From xen-changelog-bounces@lists.xenproject.org Fri Jul 02 14:11:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Jul 2021 14:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.149162.275748 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lzJso-0006dk-Ib; Fri, 02 Jul 2021 14:11:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 149162.275748; Fri, 02 Jul 2021 14:11:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lzJso-0006da-F8; Fri, 02 Jul 2021 14:11:06 +0000
Received: by outflank-mailman (input) for mailman id 149162;
 Fri, 02 Jul 2021 14:11:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzJsm-0006dU-T4
 for xen-changelog@lists.xenproject.org; Fri, 02 Jul 2021 14:11:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzJsm-0002Ea-PY
 for xen-changelog@lists.xenproject.org; Fri, 02 Jul 2021 14:11:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzJsm-0000PI-Of
 for xen-changelog@lists.xenproject.org; Fri, 02 Jul 2021 14: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=biBVrGid6m1FcezXj59g7wDtL7pGuV2Gr9fR3aQm2aE=; b=1y0/XrfzdGH3/imOfseaZRxS4V
	jXdojJOcu3l2kqaFQygpQu5RsRgMruSMvVrjSf0FOFodZfBKeddfHeJt3R2O7F5xhOCIs+im+ivcG
	SKlbvKOwsQLkEgje1dKcbUNwSZyk8dRcNtYS/b7hTe/B1i6puXsoB8O0ESkgXwBgye0U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Config.mk: re-pin OVMF changeset and unpin qemu-xen
Message-Id: <E1lzJsm-0000PI-Of@xenbits.xenproject.org>
Date: Fri, 02 Jul 2021 14:11:04 +0000

commit 07d6dd51a5c508cc0f3c93a876f8b4e3102ecf60
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Mon Jun 28 14:42:17 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Jul 2 14:59:41 2021 +0100

    Config.mk: re-pin OVMF changeset and unpin qemu-xen
    
    qemu-xen tree have a osstest gate and doesn't need to be pinned.
    
    On the other hand, OVMF's xen repository doesn't have a gate and needs
    to be pinned. The "master" branch correspond now to the tag
    "edk2-stable202105", so pin to that commit.
    
    Fixes: a04509d34d72 ("Branching: Update version files etc. for newly unstable")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 Config.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Config.mk b/Config.mk
index 9a174c77f3..f9dce4549b 100644
--- a/Config.mk
+++ b/Config.mk
@@ -244,8 +244,8 @@ QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
-OVMF_UPSTREAM_REVISION ?= master
-QEMU_UPSTREAM_REVISION ?= 7ea428895af2840d85c524f0bd11a38aac308308
+OVMF_UPSTREAM_REVISION ?= e1999b264f1f9d7230edf2448f757c73da567832
+QEMU_UPSTREAM_REVISION ?= master
 MINIOS_UPSTREAM_REVISION ?= 051b87bb9c19609976fb038f386920e1ce5454c5
 
 SEABIOS_UPSTREAM_REVISION ?= rel-1.14.0
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 02 14:11:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Jul 2021 14:11:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.149163.275752 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lzJsy-0006fe-Jh; Fri, 02 Jul 2021 14:11:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 149163.275752; Fri, 02 Jul 2021 14:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lzJsy-0006fW-Gf; Fri, 02 Jul 2021 14:11:16 +0000
Received: by outflank-mailman (input) for mailman id 149163;
 Fri, 02 Jul 2021 14:11:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzJsw-0006fK-Ta
 for xen-changelog@lists.xenproject.org; Fri, 02 Jul 2021 14:11:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzJsw-0002Eu-Sm
 for xen-changelog@lists.xenproject.org; Fri, 02 Jul 2021 14:11:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzJsw-0000Q5-Rw
 for xen-changelog@lists.xenproject.org; Fri, 02 Jul 2021 14: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0s3YvnOgWLEcBMfwlPpGturl8PoQWxLSXqGnxQ/zfyg=; b=oUSzjDVu/8+aJOFF4EYxzMQ/Ks
	JmpHCJqr9vQ0n/xEuVJRwCQRizDsDm9pZWbsNG6aKD2kuXCeMDVHI+VGtgO/IYbdS3/2ORDvKy922
	McX/UR2AKciDFJwvCd5nyfVx7XIFZZ0HSiIUhbAdYLPA1Oi+xI8SKi0y2qehMNm/YKg8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libxl: Replace short-form boolean for QEMU's -vnc
Message-Id: <E1lzJsw-0000Q5-Rw@xenbits.xenproject.org>
Date: Fri, 02 Jul 2021 14:11:14 +0000

commit 217eef30f7b9b85ba6e27c81a791dae8f6fcdbe7
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Mon Jun 28 11:01:56 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Jul 2 15:01:13 2021 +0100

    libxl: Replace short-form boolean for QEMU's -vnc
    
    f3f778c81769 forgot one boolean parameter.
    
    Fixes: f3f778c81769 ("libxl: Replace QEMU's command line short-form boolean option")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
---
 tools/libs/light/libxl_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index 5b01cf2841..7670e403a9 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -1324,7 +1324,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
             vncarg = GCSPRINTF("127.0.0.1:%d", vnc->display);
 
         if (vnc->passwd && vnc->passwd[0]) {
-            vncarg = GCSPRINTF("%s,password", vncarg);
+            vncarg = GCSPRINTF("%s,password=on", vncarg);
         }
 
         if (libxl_defbool_val(vnc->findunused)) {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 02 14:11:26 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Jul 2021 14:11:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.149164.275756 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lzJt8-0006im-LS; Fri, 02 Jul 2021 14:11:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 149164.275756; Fri, 02 Jul 2021 14:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lzJt8-0006ie-IQ; Fri, 02 Jul 2021 14:11:26 +0000
Received: by outflank-mailman (input) for mailman id 149164;
 Fri, 02 Jul 2021 14:11:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzJt7-0006iI-17
 for xen-changelog@lists.xenproject.org; Fri, 02 Jul 2021 14:11:25 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzJt7-0002F5-0D
 for xen-changelog@lists.xenproject.org; Fri, 02 Jul 2021 14:11:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzJt6-0000Qm-VP
 for xen-changelog@lists.xenproject.org; Fri, 02 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mf5FdSXrtiWQWVs95YUirU67p6S3qKSQIoYj5PmlJLY=; b=GXovxxamCVnxHTUCA/m64X1cHl
	6cu2ySrMO4pA9CrZoolW2UCwvc3oZYLMvaLnLe3tNqKDRvu7yDJhWEwxYX2xWWdN60KM8x+EYaxXj
	VVQqA5FS7xxQFpmyjQI5wFH/qi/4O7XEBrhbdKxuTJZx2Q1xvVmZH4MHvX9DNqSSlrIo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libxl: Fix QEMU cmdline for scsi device
Message-Id: <E1lzJt6-0000Qm-VP@xenbits.xenproject.org>
Date: Fri, 02 Jul 2021 14:11:24 +0000

commit 3bc3be978fd61f8099797864136c5f447c0e4aae
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Mon Jun 28 11:01:57 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Jul 2 15:01:13 2021 +0100

    libxl: Fix QEMU cmdline for scsi device
    
    Usage of 'scsi-disk' device is deprecated and removed from QEMU,
    instead we need to use 'scsi-hd' for hard drives.
    See QEMU 879be3af49 (hw/scsi: remove 'scsi-disk' device)
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
---
 tools/libs/light/libxl_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index 7670e403a9..dbd3c7f278 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -1972,7 +1972,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                                                         &drive_id),
                     flexarray_vappend(dm_args,
                         "-drive", drive,
-                        "-device", GCSPRINTF("scsi-disk,drive=%s,scsi-id=%d",
+                        "-device", GCSPRINTF("scsi-hd,drive=%s,scsi-id=%d",
                                              drive_id, disk),
                         NULL);
                     continue;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 02 16:55:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Jul 2021 16:55:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.149248.275942 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lzMRW-0005Vy-Nl; Fri, 02 Jul 2021 16:55:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 149248.275942; Fri, 02 Jul 2021 16:55:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lzMRW-0005Vq-Km; Fri, 02 Jul 2021 16:55:06 +0000
Received: by outflank-mailman (input) for mailman id 149248;
 Fri, 02 Jul 2021 16:55:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzMRV-0005Vk-Ky
 for xen-changelog@lists.xenproject.org; Fri, 02 Jul 2021 16:55:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzMRV-0005Sk-Gy
 for xen-changelog@lists.xenproject.org; Fri, 02 Jul 2021 16:55:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzMRV-0003Nz-G6
 for xen-changelog@lists.xenproject.org; Fri, 02 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=n2XN1MtnkSzqzZRu7oWT3nb1U0GStf0lvGRfGWTFq68=; b=KZtV5B7petCDv9Ygs7sooD7WrD
	2s43D0CAhh9J4hAZl2JqfJlSpl94vSqt7gfwlb3moh//8BXIfmsg0jbp2K9mk+bC1QoFEzc9dz6yB
	0bHJZgE2rBxo6WDoGieZAKpqOWi0GY5/40pmuMTSGCFnAFaUq1h56HdbfGAORFw43VXE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools: fix comment typo in libxl__cpuid_legacy
Message-Id: <E1lzMRV-0003Nz-G6@xenbits.xenproject.org>
Date: Fri, 02 Jul 2021 16:55:05 +0000

commit 67a50e393a59367ba2ad475e141a6739e17260f9
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 12:30:48 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 2 16:05:26 2021 +0100

    tools: fix comment typo in libxl__cpuid_legacy
    
    Replace emualted with emulated.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libs/light/libxl_cpuid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index eb6feaa96d..b2c673841a 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -465,7 +465,7 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
      * isn't going to migrate, then the current hardware is all that matters.
      *
      * Alternatively, an internal property of vTSC is that the values read are
-     * invariant.  Advertise ITSC when we know the domain will have emualted
+     * invariant.  Advertise ITSC when we know the domain will have emulated
      * TSC everywhere it goes.
      */
     itsc = (libxl_defbool_val(info->disable_migrate) ||
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 02 16:55:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Jul 2021 16:55:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.149249.275946 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lzMRg-0005Xo-PM; Fri, 02 Jul 2021 16:55:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 149249.275946; Fri, 02 Jul 2021 16:55:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lzMRg-0005Xg-MM; Fri, 02 Jul 2021 16:55:16 +0000
Received: by outflank-mailman (input) for mailman id 149249;
 Fri, 02 Jul 2021 16:55:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzMRf-0005XY-L4
 for xen-changelog@lists.xenproject.org; Fri, 02 Jul 2021 16:55:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzMRf-0005Su-KA
 for xen-changelog@lists.xenproject.org; Fri, 02 Jul 2021 16:55:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzMRf-0003Oq-JJ
 for xen-changelog@lists.xenproject.org; Fri, 02 Jul 2021 16: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dJw/CrsN69H1pf0Q210NTHFAU6IYl8jHt3fPWE6zdYY=; b=HXL2ybPwLlAoDeUsh5wlp4IAEa
	Pmhz+a+g/jV14KsA+qLetjh3Rnr2WFdOrhrt8JLU/HImkHjh6NJXOdVyb75fhrWgZLUv52ca04cYo
	ue9Ad1PVVXogaCP3k1bJghnitbCaOD0gvtRu68D/hEX51C2Ouw6qra7Lq0/tVvtzdQPg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools: use integer division in convert-legacy-stream
Message-Id: <E1lzMRf-0003Oq-JJ@xenbits.xenproject.org>
Date: Fri, 02 Jul 2021 16:55:15 +0000

commit 74d044d51b19bb697eac5c3deafa140f6afafec8
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:55:59 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 2 16:38:00 2021 +0100

    tools: use integer division in convert-legacy-stream
    
    A single slash gives a float, a double slash gives an int.
    
        bitmap = unpack_exact("Q" * ((max_id/64) + 1))
    TypeError: can't multiply sequence by non-int of type 'float'
    
    Use future division to remain compatible with python 2.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/python/scripts/convert-legacy-stream | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/python/scripts/convert-legacy-stream b/tools/python/scripts/convert-legacy-stream
index ca93a93848..66ee3d2f5d 100755
--- a/tools/python/scripts/convert-legacy-stream
+++ b/tools/python/scripts/convert-legacy-stream
@@ -6,6 +6,7 @@ Convert a legacy migration stream to a v2 stream.
 """
 
 from __future__ import print_function
+from __future__ import division
 
 import sys
 import os, os.path
@@ -163,7 +164,7 @@ def write_libxc_hvm_params(params):
         raise RuntimeError("Expected even length list of hvm parameters")
 
     write_record(libxc.REC_TYPE_hvm_params,
-                 pack(libxc.HVM_PARAMS_FORMAT, len(params) / 2, 0),
+                 pack(libxc.HVM_PARAMS_FORMAT, len(params) // 2, 0),
                  pack("Q" * len(params), *params))
 
 def write_libxc_static_data_end():
@@ -264,8 +265,8 @@ def read_pv_extended_info(vm):
                           (so_far - total_length, ))
 
 def read_pv_p2m_frames(vm):
-    fpp = 4096 / vm.width
-    p2m_frame_len = (vm.p2m_size - 1) / fpp + 1
+    fpp = 4096 // vm.width
+    p2m_frame_len = (vm.p2m_size - 1) // fpp + 1
 
     info("P2M frames: fpp %d, p2m_frame_len %d" % (fpp, p2m_frame_len))
     write_libxc_pv_p2m_frames(vm, unpack_ulongs(p2m_frame_len))
@@ -405,7 +406,7 @@ def read_chunks(vm):
                                   (max_id, legacy.MAX_VCPU_ID))
 
             vm.max_vcpu_id = max_id
-            bitmap = unpack_exact("Q" * ((max_id/64) + 1))
+            bitmap = unpack_exact("Q" * ((max_id // 64) + 1))
 
             for idx, word in enumerate(bitmap):
                 bit_idx = 0
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sat Jul 03 18:00:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Jul 2021 18:00:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.149593.276701 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lzjvv-0001CW-Vc; Sat, 03 Jul 2021 18:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 149593.276701; Sat, 03 Jul 2021 18:00:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lzjvv-0001C8-S2; Sat, 03 Jul 2021 18:00:03 +0000
Received: by outflank-mailman (input) for mailman id 149593;
 Sat, 03 Jul 2021 18:00:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzjvu-0000tr-64
 for xen-changelog@lists.xenproject.org; Sat, 03 Jul 2021 18:00:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzjvu-0000Dq-4j
 for xen-changelog@lists.xenproject.org; Sat, 03 Jul 2021 18:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzjvu-00016t-3Y
 for xen-changelog@lists.xenproject.org; Sat, 03 Jul 2021 18: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Hy7FpK29eMWLHZ2hAAqaS//0quBumq2AiFC3pE+rmOQ=; b=08zI215Lr19/7Tik7e26lxGl7W
	ZHz1bqFOvB3irjGMFtriATokeccctAvrUzHn7TjCzdHYwFJGndMOh6F0RVlNKey3SSZ9/zeCk3p14
	MUrI6CIG+q6PzBcaVt1pQJmgvH6ZnrQrLSpw+hEE5VcZvJ9k0TKvd7okeb8M+vawJQ58=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Config.mk: re-pin OVMF changeset and unpin qemu-xen
Message-Id: <E1lzjvu-00016t-3Y@xenbits.xenproject.org>
Date: Sat, 03 Jul 2021 18:00:02 +0000

commit 07d6dd51a5c508cc0f3c93a876f8b4e3102ecf60
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Mon Jun 28 14:42:17 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Jul 2 14:59:41 2021 +0100

    Config.mk: re-pin OVMF changeset and unpin qemu-xen
    
    qemu-xen tree have a osstest gate and doesn't need to be pinned.
    
    On the other hand, OVMF's xen repository doesn't have a gate and needs
    to be pinned. The "master" branch correspond now to the tag
    "edk2-stable202105", so pin to that commit.
    
    Fixes: a04509d34d72 ("Branching: Update version files etc. for newly unstable")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 Config.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Config.mk b/Config.mk
index 9a174c77f3..f9dce4549b 100644
--- a/Config.mk
+++ b/Config.mk
@@ -244,8 +244,8 @@ QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
-OVMF_UPSTREAM_REVISION ?= master
-QEMU_UPSTREAM_REVISION ?= 7ea428895af2840d85c524f0bd11a38aac308308
+OVMF_UPSTREAM_REVISION ?= e1999b264f1f9d7230edf2448f757c73da567832
+QEMU_UPSTREAM_REVISION ?= master
 MINIOS_UPSTREAM_REVISION ?= 051b87bb9c19609976fb038f386920e1ce5454c5
 
 SEABIOS_UPSTREAM_REVISION ?= rel-1.14.0
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Jul 03 18:00:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Jul 2021 18:00:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.149595.276708 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lzjw6-0001VW-3h; Sat, 03 Jul 2021 18:00:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 149595.276708; Sat, 03 Jul 2021 18:00:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lzjw6-0001VO-0Y; Sat, 03 Jul 2021 18:00:14 +0000
Received: by outflank-mailman (input) for mailman id 149595;
 Sat, 03 Jul 2021 18:00:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzjw4-0001V7-A4
 for xen-changelog@lists.xenproject.org; Sat, 03 Jul 2021 18:00:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzjw4-0000E6-95
 for xen-changelog@lists.xenproject.org; Sat, 03 Jul 2021 18:00:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzjw4-00018q-8G
 for xen-changelog@lists.xenproject.org; Sat, 03 Jul 2021 18: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CEMagyPn8GDoWaH5TJis0ornk+9K5HmldyfF+wnXHe4=; b=hve3ypebsYuBz0i5hraOEmhJVB
	toPOuYzy/+NdIa/Gst2fMvr6Su5JKnDqEH8K18NECYXbFtRrU6jALeZ4pCFa7je1bfYLxeyXER63I
	3bsxsuJKeb/POTwmVr+Z/WUKYkK8ifsWR6jWjlbq7PQUtmi7FwkjsCG6vEHF/0ok2rXk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libxl: Replace short-form boolean for QEMU's -vnc
Message-Id: <E1lzjw4-00018q-8G@xenbits.xenproject.org>
Date: Sat, 03 Jul 2021 18:00:12 +0000

commit 217eef30f7b9b85ba6e27c81a791dae8f6fcdbe7
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Mon Jun 28 11:01:56 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Jul 2 15:01:13 2021 +0100

    libxl: Replace short-form boolean for QEMU's -vnc
    
    f3f778c81769 forgot one boolean parameter.
    
    Fixes: f3f778c81769 ("libxl: Replace QEMU's command line short-form boolean option")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
---
 tools/libs/light/libxl_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index 5b01cf2841..7670e403a9 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -1324,7 +1324,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
             vncarg = GCSPRINTF("127.0.0.1:%d", vnc->display);
 
         if (vnc->passwd && vnc->passwd[0]) {
-            vncarg = GCSPRINTF("%s,password", vncarg);
+            vncarg = GCSPRINTF("%s,password=on", vncarg);
         }
 
         if (libxl_defbool_val(vnc->findunused)) {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Jul 03 18:00:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Jul 2021 18:00:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.149596.276712 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lzjwG-0001Ym-5T; Sat, 03 Jul 2021 18:00:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 149596.276712; Sat, 03 Jul 2021 18:00:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lzjwG-0001Ye-2A; Sat, 03 Jul 2021 18:00:24 +0000
Received: by outflank-mailman (input) for mailman id 149596;
 Sat, 03 Jul 2021 18:00:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzjwE-0001Y5-Ea
 for xen-changelog@lists.xenproject.org; Sat, 03 Jul 2021 18:00:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzjwE-0000ER-Di
 for xen-changelog@lists.xenproject.org; Sat, 03 Jul 2021 18:00:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzjwE-00019t-CK
 for xen-changelog@lists.xenproject.org; Sat, 03 Jul 2021 18: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MZb58LwpcGGVQ0y7moY2SpmjoqTyzIXa/uv3XEMbobM=; b=c3qiE56DW4yWKNl5t11kVvJhVL
	beXQ0OmfBpHvav17DMnvB9+zKfItzx3BG3qzXNmkOGrkZagHXd92M7NJOHASKN2Ca2n6lFYM35oWe
	wLb21aqLFbPEM2FlsiIFDPuvf/pW9P27jYZdMRgQi1VM5IF1YMomSJ/YyiklrnbUCFwk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libxl: Fix QEMU cmdline for scsi device
Message-Id: <E1lzjwE-00019t-CK@xenbits.xenproject.org>
Date: Sat, 03 Jul 2021 18:00:22 +0000

commit 3bc3be978fd61f8099797864136c5f447c0e4aae
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Mon Jun 28 11:01:57 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Jul 2 15:01:13 2021 +0100

    libxl: Fix QEMU cmdline for scsi device
    
    Usage of 'scsi-disk' device is deprecated and removed from QEMU,
    instead we need to use 'scsi-hd' for hard drives.
    See QEMU 879be3af49 (hw/scsi: remove 'scsi-disk' device)
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
---
 tools/libs/light/libxl_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index 7670e403a9..dbd3c7f278 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -1972,7 +1972,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                                                         &drive_id),
                     flexarray_vappend(dm_args,
                         "-drive", drive,
-                        "-device", GCSPRINTF("scsi-disk,drive=%s,scsi-id=%d",
+                        "-device", GCSPRINTF("scsi-hd,drive=%s,scsi-id=%d",
                                              drive_id, disk),
                         NULL);
                     continue;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Jul 03 18:00:33 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Jul 2021 18:00:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.149597.276716 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lzjwP-0001bz-6e; Sat, 03 Jul 2021 18:00:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 149597.276716; Sat, 03 Jul 2021 18:00:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lzjwP-0001br-3i; Sat, 03 Jul 2021 18:00:33 +0000
Received: by outflank-mailman (input) for mailman id 149597;
 Sat, 03 Jul 2021 18:00:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzjwO-0001bj-Hh
 for xen-changelog@lists.xenproject.org; Sat, 03 Jul 2021 18:00:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzjwO-0000F0-Gx
 for xen-changelog@lists.xenproject.org; Sat, 03 Jul 2021 18:00:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzjwO-0001Ax-G0
 for xen-changelog@lists.xenproject.org; Sat, 03 Jul 2021 18: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LSzDnMiA2PZCLpzD1KBawxobCgb8yGZex1slENMzo/4=; b=z8OgfTwmzHcS0s/DKL8lpld0Un
	FE2iOQOUjehyH757WGu3+ZUx7O72YornbpQRDMz5rXF0IbuXrUD7455lrNG3nOZPg7ODrzikkVBk2
	zAV/6P77AqgbLqnrgYWbg2/901nMEI6zp11J6HqTtFr+yzdRylmNYxSuD3vKO/mmD7MY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools: fix comment typo in libxl__cpuid_legacy
Message-Id: <E1lzjwO-0001Ax-G0@xenbits.xenproject.org>
Date: Sat, 03 Jul 2021 18:00:32 +0000

commit 67a50e393a59367ba2ad475e141a6739e17260f9
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 12:30:48 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 2 16:05:26 2021 +0100

    tools: fix comment typo in libxl__cpuid_legacy
    
    Replace emualted with emulated.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libs/light/libxl_cpuid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index eb6feaa96d..b2c673841a 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -465,7 +465,7 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
      * isn't going to migrate, then the current hardware is all that matters.
      *
      * Alternatively, an internal property of vTSC is that the values read are
-     * invariant.  Advertise ITSC when we know the domain will have emualted
+     * invariant.  Advertise ITSC when we know the domain will have emulated
      * TSC everywhere it goes.
      */
     itsc = (libxl_defbool_val(info->disable_migrate) ||
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Jul 03 18:00:43 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Jul 2021 18:00:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.149598.276720 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lzjwZ-0001fG-86; Sat, 03 Jul 2021 18:00:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 149598.276720; Sat, 03 Jul 2021 18:00:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lzjwZ-0001f8-5F; Sat, 03 Jul 2021 18:00:43 +0000
Received: by outflank-mailman (input) for mailman id 149598;
 Sat, 03 Jul 2021 18:00:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzjwY-0001ey-Km
 for xen-changelog@lists.xenproject.org; Sat, 03 Jul 2021 18:00:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzjwY-0000FA-Ju
 for xen-changelog@lists.xenproject.org; Sat, 03 Jul 2021 18:00:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lzjwY-0001Bu-J8
 for xen-changelog@lists.xenproject.org; Sat, 03 Jul 2021 18:00: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4wEJIh/DBT58ez+LqVrdSfxwSO7X2yVhh+efq7/IcYY=; b=QZK9NxkbE/IuX5UAoIAxraRS19
	nE+EuDCFEW2zBvkGMLzgk9gKmtO6+bElstGFwtRtQiFfh7pnAPtkrA5UcB+bBUdICw50zGKKZaBox
	lYJxmF93hgn+ik6ktjIANUoiRJV/vjm1N7fd1IQT3JZZZWBSgKAoiYpZwQR2HcF0wnN4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools: use integer division in convert-legacy-stream
Message-Id: <E1lzjwY-0001Bu-J8@xenbits.xenproject.org>
Date: Sat, 03 Jul 2021 18:00:42 +0000

commit 74d044d51b19bb697eac5c3deafa140f6afafec8
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:55:59 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 2 16:38:00 2021 +0100

    tools: use integer division in convert-legacy-stream
    
    A single slash gives a float, a double slash gives an int.
    
        bitmap = unpack_exact("Q" * ((max_id/64) + 1))
    TypeError: can't multiply sequence by non-int of type 'float'
    
    Use future division to remain compatible with python 2.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/python/scripts/convert-legacy-stream | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/python/scripts/convert-legacy-stream b/tools/python/scripts/convert-legacy-stream
index ca93a93848..66ee3d2f5d 100755
--- a/tools/python/scripts/convert-legacy-stream
+++ b/tools/python/scripts/convert-legacy-stream
@@ -6,6 +6,7 @@ Convert a legacy migration stream to a v2 stream.
 """
 
 from __future__ import print_function
+from __future__ import division
 
 import sys
 import os, os.path
@@ -163,7 +164,7 @@ def write_libxc_hvm_params(params):
         raise RuntimeError("Expected even length list of hvm parameters")
 
     write_record(libxc.REC_TYPE_hvm_params,
-                 pack(libxc.HVM_PARAMS_FORMAT, len(params) / 2, 0),
+                 pack(libxc.HVM_PARAMS_FORMAT, len(params) // 2, 0),
                  pack("Q" * len(params), *params))
 
 def write_libxc_static_data_end():
@@ -264,8 +265,8 @@ def read_pv_extended_info(vm):
                           (so_far - total_length, ))
 
 def read_pv_p2m_frames(vm):
-    fpp = 4096 / vm.width
-    p2m_frame_len = (vm.p2m_size - 1) / fpp + 1
+    fpp = 4096 // vm.width
+    p2m_frame_len = (vm.p2m_size - 1) // fpp + 1
 
     info("P2M frames: fpp %d, p2m_frame_len %d" % (fpp, p2m_frame_len))
     write_libxc_pv_p2m_frames(vm, unpack_ulongs(p2m_frame_len))
@@ -405,7 +406,7 @@ def read_chunks(vm):
                                   (max_id, legacy.MAX_VCPU_ID))
 
             vm.max_vcpu_id = max_id
-            bitmap = unpack_exact("Q" * ((max_id/64) + 1))
+            bitmap = unpack_exact("Q" * ((max_id // 64) + 1))
 
             for idx, word in enumerate(bitmap):
                 bit_idx = 0
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jul 05 09:55:54 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Jul 2021 09:55:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150036.277472 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0LKO-0002Rz-Uq; Mon, 05 Jul 2021 09:55:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150036.277472; Mon, 05 Jul 2021 09:55:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0LKO-0002Rs-RC; Mon, 05 Jul 2021 09:55:48 +0000
Received: by outflank-mailman (input) for mailman id 150036;
 Mon, 05 Jul 2021 09:55:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0LKO-0002Rm-98
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 09:55:48 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0LKO-0003YI-64
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 09:55:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0LKO-00010z-54
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 09: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OgKvOtLSPqAtCKLsBIsqLIFweGap+HnVg+MQXgkY0do=; b=aPecogTRWG2SD7KaK+5MJJGAUv
	cZMyIvsQ2Ld+GNpTjBAtfQOuEXXZ4UExahhxSEJAoMUH3dhdx36veOSKRtjJS4ZkMWY8PwkicOpr4
	csEIX1jA8NwqvRyJJai0ys17MNb/RmtLnvWuoO8ruv35PnJh3Bae7zDu8urGH7NyTm9A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge tag 'v6.0.0' into 'staging'
Message-Id: <E1m0LKO-00010z-54@xenbits.xenproject.org>
Date: Mon, 05 Jul 2021 09:55:48 +0000

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

commit df430619eba32ea76ed1138deac06d6057d54b3e
Merge: 609d7596524ab204ccd71ef42c9eee4c7c338ea4 7ea428895af2840d85c524f0bd11a38aac308308
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Mon Jul 5 10:42:40 2021 +0100
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Mon Jul 5 10:42:40 2021 +0100

    Merge tag 'v6.0.0' into 'staging'
 .cirrus.yml                                        |    153 +-
 .editorconfig                                      |     18 +-
 .gitattributes                                     |      3 +
 .github/lockdown.yml                               |      8 +-
 .gitignore                                         |    160 +-
 .gitlab-ci.d/check-dco.py                          |     94 +
 .gitlab-ci.d/check-patch.py                        |     56 +
 .gitlab-ci.d/containers.yml                        |     57 +-
 .gitlab-ci.d/crossbuilds.yml                       |    209 +
 .gitlab-ci.d/edk2.yml                              |      1 +
 .gitlab-ci.d/opensbi.yml                           |     29 +-
 .gitlab-ci.yml                                     |    630 +-
 .gitmodules                                        |     46 +-
 .mailmap                                           |     13 +-
 .readthedocs.yml                                   |      2 +-
 .shippable.yml                                     |     39 -
 .travis.yml                                        |    285 +-
 CODING_STYLE.rst                                   |    641 -
 Changelog                                          |    580 -
 Kconfig                                            |      1 +
 Kconfig.host                                       |     12 +-
 MAINTAINERS                                        |    618 +-
 Makefile                                           |   1373 +-
 Makefile.objs                                      |    215 -
 Makefile.target                                    |    287 -
 README.rst                                         |     27 +-
 VERSION                                            |      2 +-
 accel/Kconfig                                      |      9 +
 accel/Makefile.objs                                |      6 -
 accel/accel-common.c                               |    105 +
 accel/accel-softmmu.c                              |    100 +
 accel/accel-softmmu.h                              |     15 +
 accel/accel-user.c                                 |     24 +
 accel/accel.c                                      |     85 -
 accel/dummy-cpus.c                                 |     72 +
 accel/hvf/entitlements.plist                       |      8 +
 accel/kvm/Makefile.objs                            |      2 -
 accel/kvm/kvm-accel-ops.c                          |    100 +
 accel/kvm/kvm-all.c                                |    147 +-
 accel/kvm/kvm-cpus.h                               |     22 +
 accel/kvm/meson.build                              |      8 +
 accel/kvm/sev-stub.c                               |     10 +-
 accel/kvm/trace-events                             |      1 +
 accel/kvm/trace.h                                  |      1 +
 accel/meson.build                                  |     17 +
 accel/qtest.c                                      |     54 -
 accel/qtest/meson.build                            |      6 +
 accel/qtest/qtest.c                                |     71 +
 accel/stubs/Makefile.objs                          |      6 -
 accel/stubs/hax-stub.c                             |     11 -
 accel/stubs/hvf-stub.c                             |     30 -
 accel/stubs/kvm-stub.c                             |     33 -
 accel/stubs/meson.build                            |      4 +
 accel/stubs/tcg-stub.c                             |     11 +-
 accel/stubs/whpx-stub.c                            |     47 -
 accel/stubs/xen-stub.c                             |     43 +-
 accel/tcg/Makefile.objs                            |      9 -
 accel/tcg/atomic_common.c.inc                      |     54 +
 accel/tcg/atomic_common.inc.c                      |     54 -
 accel/tcg/atomic_template.h                        |     20 +-
 accel/tcg/cpu-exec.c                               |    312 +-
 accel/tcg/cputlb.c                                 |    500 +-
 accel/tcg/internal.h                               |     20 +
 accel/tcg/meson.build                              |     22 +
 accel/tcg/plugin-gen.c                             |     60 +-
 accel/tcg/tcg-accel-ops-icount.c                   |    144 +
 accel/tcg/tcg-accel-ops-icount.h                   |     19 +
 accel/tcg/tcg-accel-ops-mttcg.c                    |    133 +
 accel/tcg/tcg-accel-ops-mttcg.h                    |     19 +
 accel/tcg/tcg-accel-ops-rr.c                       |    298 +
 accel/tcg/tcg-accel-ops-rr.h                       |     21 +
 accel/tcg/tcg-accel-ops.c                          |    133 +
 accel/tcg/tcg-accel-ops.h                          |     22 +
 accel/tcg/tcg-all.c                                |     87 +-
 accel/tcg/tcg-runtime.c                            |     10 +-
 accel/tcg/tcg-runtime.h                            |     13 +-
 accel/tcg/trace-events                             |      2 +-
 accel/tcg/trace.h                                  |      1 +
 accel/tcg/translate-all.c                          |    612 +-
 accel/tcg/translate-all.h                          |     39 -
 accel/tcg/translator.c                             |     10 +-
 accel/tcg/user-exec-stub.c                         |      4 +
 accel/tcg/user-exec.c                              |    113 +-
 accel/xen/Makefile.objs                            |      1 -
 accel/xen/meson.build                              |      1 +
 accel/xen/xen-all.c                                |     22 +-
 audio/Makefile.objs                                |     35 -
 audio/alsaaudio.c                                  |     18 +-
 audio/audio.c                                      |    187 +-
 audio/audio.h                                      |      2 +-
 audio/audio_int.h                                  |      2 +
 audio/audio_legacy.c                               |      3 +-
 audio/audio_template.h                             |     26 +-
 audio/audio_win_int.c                              |     73 +-
 audio/coreaudio.c                                  |    474 +-
 audio/dsound_template.h                            |      2 +-
 audio/dsoundaudio.c                                |     56 +-
 audio/jackaudio.c                                  |     71 +-
 audio/meson.build                                  |     30 +
 audio/noaudio.c                                    |      1 +
 audio/ossaudio.c                                   |     13 +-
 audio/paaudio.c                                    |     73 +-
 audio/sdlaudio.c                                   |    305 +-
 audio/spiceaudio.c                                 |     31 +-
 audio/trace-events                                 |      3 -
 audio/trace.h                                      |      1 +
 audio/wavcapture.c                                 |      8 +-
 authz/Makefile.objs                                |      7 -
 authz/base.c                                       |      2 +-
 authz/list.c                                       |      3 +-
 authz/listfile.c                                   |     14 +-
 authz/meson.build                                  |      9 +
 authz/pamacct.c                                    |      9 +-
 authz/simple.c                                     |     17 +-
 authz/trace.h                                      |      1 +
 backends/Makefile.objs                             |     23 -
 backends/confidential-guest-support.c              |     33 +
 backends/cryptodev-builtin.c                       |      9 +-
 backends/cryptodev-vhost-user.c                    |     24 +-
 backends/cryptodev-vhost.c                         |      2 +-
 backends/cryptodev.c                               |     10 +-
 backends/dbus-vmstate.c                            |     42 +-
 backends/hostmem-file.c                            |     42 +-
 backends/hostmem-memfd.c                           |      7 +-
 backends/hostmem.c                                 |     21 +-
 backends/meson.build                               |     20 +
 backends/rng-builtin.c                             |     10 +-
 backends/rng-egd.c                                 |     17 +-
 backends/rng-random.c                              |     10 +-
 backends/rng.c                                     |      8 +-
 backends/tpm/Makefile.objs                         |      4 -
 backends/tpm/meson.build                           |      8 +
 backends/tpm/tpm_emulator.c                        |     10 +-
 backends/tpm/tpm_ioctl.h                           |      4 +
 backends/tpm/tpm_passthrough.c                     |     15 +-
 backends/tpm/tpm_util.c                            |     18 +-
 backends/tpm/trace.h                               |      1 +
 backends/trace.h                                   |      1 +
 backends/vhost-user.c                              |      7 +-
 block.c                                            |   1169 +-
 block/Makefile.objs                                |     75 -
 block/accounting.c                                 |     32 +-
 block/backup-top.c                                 |     41 +-
 block/backup-top.h                                 |      1 +
 block/backup.c                                     |    253 +-
 block/blkdebug.c                                   |     19 +-
 block/blklogwrites.c                               |     11 +-
 block/blkreplay.c                                  |      6 +-
 block/blkverify.c                                  |     13 +-
 block/block-backend.c                              |     43 +-
 block/block-copy.c                                 |    234 +-
 block/block-gen.h                                  |     49 +
 block/commit.c                                     |    103 +-
 block/copy-on-read.c                               |    197 +-
 block/copy-on-read.h                               |     32 +
 block/coroutines.h                                 |     69 +
 block/crypto.c                                     |     15 +-
 block/crypto.h                                     |      2 +-
 block/curl.c                                       |    106 +-
 block/dirty-bitmap.c                               |     59 +-
 block/dmg-lzfse.c                                  |      1 -
 block/dmg.c                                        |      2 +-
 block/export/export.c                              |    361 +
 block/export/fuse.c                                |    726 +
 block/export/meson.build                           |      7 +
 block/export/vhost-user-blk-server.c               |    526 +
 block/export/vhost-user-blk-server.h               |     19 +
 block/file-posix.c                                 |     85 +-
 block/file-win32.c                                 |     27 +-
 block/filter-compress.c                            |      2 -
 block/gluster.c                                    |     17 +-
 block/io.c                                         |   1177 +-
 block/io_uring.c                                   |      2 +-
 block/iscsi.c                                      |     54 +-
 block/meson.build                                  |    128 +
 block/mirror.c                                     |    202 +-
 block/monitor/Makefile.objs                        |      2 -
 block/monitor/block-hmp-cmds.c                     |     39 +-
 block/monitor/meson.build                          |      2 +
 block/nbd.c                                        |    538 +-
 block/nfs.c                                        |     17 +-
 block/null.c                                       |      7 +
 block/nvme.c                                       |    495 +-
 block/parallels-ext.c                              |    300 +
 block/parallels.c                                  |     26 +-
 block/parallels.h                                  |      7 +-
 block/preallocate.c                                |    559 +
 block/qapi.c                                       |    142 +-
 block/qcow.c                                       |      9 -
 block/qcow2-bitmap.c                               |    105 +-
 block/qcow2-cluster.c                              |    978 +-
 block/qcow2-refcount.c                             |    144 +-
 block/qcow2-snapshot.c                             |     29 +-
 block/qcow2.c                                      |    593 +-
 block/qcow2.h                                      |    264 +-
 block/qed.c                                        |     24 +-
 block/quorum.c                                     |    121 +-
 block/raw-format.c                                 |      6 +
 block/rbd.c                                        |     55 +-
 block/replication.c                                |      2 +
 block/sheepdog.c                                   |     18 +-
 block/snapshot.c                                   |    360 +-
 block/stream.c                                     |    211 +-
 block/throttle-groups.c                            |     69 +-
 block/throttle.c                                   |     15 +-
 block/trace-events                                 |     53 +-
 block/trace.h                                      |      1 +
 block/vdi.c                                        |     11 +-
 block/vhdx.c                                       |      6 +-
 block/vmdk.c                                       |     36 +-
 block/vpc.c                                        |    154 +-
 block/vvfat.c                                      |     17 +-
 blockdev-nbd.c                                     |    177 +-
 blockdev.c                                         |    328 +-
 blockjob.c                                         |     44 +-
 bootdevice.c                                       |    429 -
 bsd-user/Makefile.objs                             |      2 -
 bsd-user/arm/target_arch_sysarch.h                 |     78 +
 bsd-user/arm/target_syscall.h                      |     36 +
 bsd-user/elfload.c                                 |      2 +-
 bsd-user/freebsd/os-strace.h                       |     29 +
 bsd-user/freebsd/strace.list                       |     65 +-
 bsd-user/freebsd/syscall_nr.h                      |    695 +-
 bsd-user/i386/target_arch_sysarch.h                |     77 +
 bsd-user/i386/target_syscall.h                     |     19 +
 bsd-user/main.c                                    |     24 +-
 bsd-user/meson.build                               |     10 +
 bsd-user/mips/target_arch_sysarch.h                |     69 +
 bsd-user/mips/target_syscall.h                     |     52 +
 bsd-user/mips64/target_arch_sysarch.h              |     69 +
 bsd-user/mips64/target_syscall.h                   |     53 +
 bsd-user/mmap.c                                    |     23 +-
 bsd-user/netbsd/os-strace.h                        |      1 +
 bsd-user/openbsd/os-strace.h                       |      1 +
 bsd-user/qemu.h                                    |     17 +-
 bsd-user/sparc/target_arch_sysarch.h               |     52 +
 bsd-user/sparc/target_syscall.h                    |     24 +-
 bsd-user/sparc64/target_arch_sysarch.h             |     52 +
 bsd-user/sparc64/target_syscall.h                  |     24 +-
 bsd-user/strace.c                                  |     11 +
 bsd-user/syscall.c                                 |      6 +-
 bsd-user/x86_64/target_arch_sysarch.h              |     76 +
 bsd-user/x86_64/target_syscall.h                   |     21 +-
 capstone                                           |      2 +-
 chardev/Makefile.objs                              |     29 -
 chardev/baum.c                                     |      9 +-
 chardev/char-fd.c                                  |      2 +-
 chardev/char-mux.c                                 |     38 +-
 chardev/char-pipe.c                                |      6 +-
 chardev/char-pty.c                                 |      9 +-
 chardev/char-ringbuf.c                             |     10 +-
 chardev/char-socket.c                              |    140 +-
 chardev/char-stdio.c                               |      4 +-
 chardev/char-udp.c                                 |      9 +-
 chardev/char-win-stdio.c                           |     10 +-
 chardev/char.c                                     |    136 +-
 chardev/chardev-internal.h                         |      8 +-
 chardev/chardev-sysemu.c                           |     69 -
 chardev/meson.build                                |     44 +
 chardev/msmouse.c                                  |     10 +-
 chardev/spice.c                                    |     39 +-
 chardev/testdev.c                                  |     10 +-
 chardev/trace.h                                    |      1 +
 chardev/wctablet.c                                 |     10 +-
 configure                                          |   4134 +-
 contrib/elf2dmp/Makefile.objs                      |      4 -
 contrib/elf2dmp/addrspace.c                        |      4 +-
 contrib/elf2dmp/addrspace.h                        |      6 +-
 contrib/elf2dmp/main.c                             |     22 +-
 contrib/elf2dmp/meson.build                        |      5 +
 contrib/elf2dmp/pdb.c                              |      1 +
 contrib/elf2dmp/qemu_elf.c                         |      1 +
 contrib/gitdm/domain-map                           |     10 +-
 contrib/gitdm/filetypes.txt                        |      8 +-
 contrib/gitdm/group-map-academics                  |      4 +
 contrib/gitdm/group-map-individuals                |     13 +
 contrib/gitdm/group-map-redhat                     |      1 +
 contrib/ivshmem-client/Makefile.objs               |      1 -
 contrib/ivshmem-client/ivshmem-client.c            |     12 +-
 contrib/ivshmem-client/ivshmem-client.h            |      2 +-
 contrib/ivshmem-client/meson.build                 |      4 +
 contrib/ivshmem-server/Makefile.objs               |      1 -
 contrib/ivshmem-server/ivshmem-server.c            |     12 +-
 contrib/ivshmem-server/main.c                      |      2 +-
 contrib/ivshmem-server/meson.build                 |      4 +
 contrib/libvhost-user/Makefile.objs                |      1 -
 contrib/libvhost-user/libvhost-user-glib.c         |    170 -
 contrib/libvhost-user/libvhost-user-glib.h         |     36 -
 contrib/libvhost-user/libvhost-user.c              |   2821 -
 contrib/libvhost-user/libvhost-user.h              |    664 -
 contrib/plugins/Makefile                           |     43 +
 contrib/plugins/hotblocks.c                        |    145 +
 contrib/plugins/hotpages.c                         |    193 +
 contrib/plugins/howvec.c                           |    361 +
 contrib/plugins/hwprofile.c                        |    305 +
 contrib/plugins/lockstep.c                         |    343 +
 contrib/rdmacm-mux/Makefile.objs                   |      3 -
 contrib/rdmacm-mux/main.c                          |      2 +-
 contrib/rdmacm-mux/meson.build                     |      9 +
 contrib/vhost-user-blk/Makefile.objs               |      1 -
 contrib/vhost-user-blk/meson.build                 |      5 +
 contrib/vhost-user-blk/vhost-user-blk.c            |      9 +-
 contrib/vhost-user-gpu/Makefile.objs               |     10 -
 contrib/vhost-user-gpu/meson.build                 |     13 +
 contrib/vhost-user-gpu/vhost-user-gpu.c            |    106 +-
 contrib/vhost-user-gpu/virgl.c                     |      6 +-
 contrib/vhost-user-gpu/vugbm.c                     |     45 +-
 contrib/vhost-user-gpu/vugbm.h                     |      4 +-
 contrib/vhost-user-gpu/vugpu.h                     |     13 +-
 contrib/vhost-user-input/Makefile.objs             |      1 -
 contrib/vhost-user-input/main.c                    |      8 +-
 contrib/vhost-user-input/meson.build               |      4 +
 contrib/vhost-user-scsi/Makefile.objs              |      1 -
 contrib/vhost-user-scsi/meson.build                |      6 +
 contrib/vhost-user-scsi/vhost-user-scsi.c          |      9 +-
 cpu.c                                              |    437 +
 cpus-common.c                                      |     28 +-
 crypto/Makefile.objs                               |     43 -
 crypto/aes.c                                       |     57 +-
 crypto/afalgpriv.h                                 |      3 +
 crypto/block-luks.c                                |      9 +-
 crypto/cipher-afalg.c                              |     25 +-
 crypto/cipher-builtin.c                            |    532 -
 crypto/cipher-builtin.c.inc                        |    435 +
 crypto/cipher-gcrypt.c                             |    422 -
 crypto/cipher-gcrypt.c.inc                         |    409 +
 crypto/cipher-nettle.c                             |    733 -
 crypto/cipher-nettle.c.inc                         |    760 +
 crypto/cipher.c                                    |     44 +-
 crypto/cipherpriv.h                                |      6 +-
 crypto/desrfb.c                                    |      4 +-
 crypto/meson.build                                 |     73 +
 crypto/secret.c                                    |     14 -
 crypto/secret_common.c                             |     21 +-
 crypto/secret_keyring.c                            |     15 -
 crypto/tls-cipher-suites.c                         |      2 +-
 crypto/tlscredsanon.c                              |      3 +-
 crypto/tlscredspsk.c                               |      3 +-
 crypto/tlscredsx509.c                              |     53 +-
 crypto/trace.h                                     |      1 +
 default-configs/aarch64-linux-user.mak             |      1 -
 default-configs/aarch64-softmmu.mak                |      8 -
 default-configs/aarch64_be-linux-user.mak          |      1 -
 default-configs/alpha-linux-user.mak               |      1 -
 default-configs/alpha-softmmu.mak                  |     10 -
 default-configs/arm-linux-user.mak                 |      1 -
 default-configs/arm-softmmu.mak                    |     45 -
 default-configs/armeb-linux-user.mak               |      1 -
 default-configs/avr-softmmu.mak                    |      5 -
 default-configs/cris-linux-user.mak                |      1 -
 default-configs/cris-softmmu.mak                   |      5 -
 default-configs/devices/aarch64-softmmu.mak        |      8 +
 default-configs/devices/alpha-softmmu.mak          |     10 +
 default-configs/devices/arm-softmmu.mak            |     46 +
 default-configs/devices/avr-softmmu.mak            |      5 +
 default-configs/devices/cris-softmmu.mak           |      5 +
 default-configs/devices/hppa-softmmu.mak           |      9 +
 default-configs/devices/i386-softmmu.mak           |     31 +
 default-configs/devices/lm32-softmmu.mak           |     12 +
 default-configs/devices/m68k-softmmu.mak           |     11 +
 default-configs/devices/microblaze-softmmu.mak     |      7 +
 default-configs/devices/microblazeel-softmmu.mak   |      3 +
 default-configs/devices/mips-softmmu-common.mak    |     41 +
 default-configs/devices/mips-softmmu.mak           |      3 +
 default-configs/devices/mips64-softmmu.mak         |      4 +
 default-configs/devices/mips64el-softmmu.mak       |     15 +
 default-configs/devices/mipsel-softmmu.mak         |      3 +
 default-configs/devices/moxie-softmmu.mak          |      5 +
 default-configs/devices/nios2-softmmu.mak          |      8 +
 default-configs/devices/or1k-softmmu.mak           |      5 +
 default-configs/devices/ppc-softmmu.mak            |     18 +
 default-configs/devices/ppc64-softmmu.mak          |     11 +
 default-configs/devices/riscv32-softmmu.mak        |     15 +
 default-configs/devices/riscv64-softmmu.mak        |     15 +
 default-configs/devices/rx-softmmu.mak             |      3 +
 default-configs/devices/s390x-softmmu.mak          |     13 +
 default-configs/devices/sh4-softmmu.mak            |     11 +
 default-configs/devices/sh4eb-softmmu.mak          |      3 +
 default-configs/devices/sparc-softmmu.mak          |     11 +
 default-configs/devices/sparc64-softmmu.mak        |     12 +
 default-configs/devices/tricore-softmmu.mak        |      1 +
 default-configs/devices/unicore32-softmmu.mak      |      6 +
 default-configs/devices/x86_64-softmmu.mak         |      3 +
 default-configs/devices/xtensa-softmmu.mak         |      9 +
 default-configs/devices/xtensaeb-softmmu.mak       |      3 +
 default-configs/hppa-linux-user.mak                |      1 -
 default-configs/hppa-softmmu.mak                   |      9 -
 default-configs/i386-bsd-user.mak                  |      1 -
 default-configs/i386-linux-user.mak                |      1 -
 default-configs/i386-softmmu.mak                   |     31 -
 default-configs/lm32-softmmu.mak                   |     12 -
 default-configs/m68k-linux-user.mak                |      1 -
 default-configs/m68k-softmmu.mak                   |     10 -
 default-configs/microblaze-linux-user.mak          |      1 -
 default-configs/microblaze-softmmu.mak             |      7 -
 default-configs/microblazeel-linux-user.mak        |      1 -
 default-configs/microblazeel-softmmu.mak           |      3 -
 default-configs/mips-linux-user.mak                |      1 -
 default-configs/mips-softmmu-common.mak            |     42 -
 default-configs/mips-softmmu.mak                   |      3 -
 default-configs/mips64-linux-user.mak              |      1 -
 default-configs/mips64-softmmu.mak                 |      4 -
 default-configs/mips64el-linux-user.mak            |      1 -
 default-configs/mips64el-softmmu.mak               |     14 -
 default-configs/mipsel-linux-user.mak              |      1 -
 default-configs/mipsel-softmmu.mak                 |      3 -
 default-configs/mipsn32-linux-user.mak             |      1 -
 default-configs/mipsn32el-linux-user.mak           |      1 -
 default-configs/moxie-softmmu.mak                  |      5 -
 default-configs/nios2-linux-user.mak               |      1 -
 default-configs/nios2-softmmu.mak                  |      8 -
 default-configs/or1k-linux-user.mak                |      1 -
 default-configs/or1k-softmmu.mak                   |      5 -
 default-configs/ppc-linux-user.mak                 |      1 -
 default-configs/ppc-softmmu.mak                    |     18 -
 default-configs/ppc64-linux-user.mak               |      1 -
 default-configs/ppc64-softmmu.mak                  |     11 -
 default-configs/ppc64abi32-linux-user.mak          |      1 -
 default-configs/ppc64le-linux-user.mak             |      1 -
 default-configs/riscv32-linux-user.mak             |      1 -
 default-configs/riscv32-softmmu.mak                |     13 -
 default-configs/riscv64-linux-user.mak             |      1 -
 default-configs/riscv64-softmmu.mak                |     12 -
 default-configs/rx-softmmu.mak                     |      3 -
 default-configs/s390x-linux-user.mak               |      1 -
 default-configs/s390x-softmmu.mak                  |     13 -
 default-configs/sh4-linux-user.mak                 |      1 -
 default-configs/sh4-softmmu.mak                    |     11 -
 default-configs/sh4eb-linux-user.mak               |      1 -
 default-configs/sh4eb-softmmu.mak                  |      3 -
 default-configs/sparc-bsd-user.mak                 |      1 -
 default-configs/sparc-linux-user.mak               |      1 -
 default-configs/sparc-softmmu.mak                  |     11 -
 default-configs/sparc32plus-linux-user.mak         |      1 -
 default-configs/sparc64-bsd-user.mak               |      1 -
 default-configs/sparc64-linux-user.mak             |      1 -
 default-configs/sparc64-softmmu.mak                |     12 -
 default-configs/targets/aarch64-linux-user.mak     |      5 +
 default-configs/targets/aarch64-softmmu.mak        |      5 +
 default-configs/targets/aarch64_be-linux-user.mak  |      6 +
 default-configs/targets/alpha-linux-user.mak       |      4 +
 default-configs/targets/alpha-softmmu.mak          |      3 +
 default-configs/targets/arm-linux-user.mak         |      6 +
 default-configs/targets/arm-softmmu.mak            |      4 +
 default-configs/targets/armeb-linux-user.mak       |      7 +
 default-configs/targets/avr-softmmu.mak            |      2 +
 default-configs/targets/cris-linux-user.mak        |      1 +
 default-configs/targets/cris-softmmu.mak           |      1 +
 default-configs/targets/hexagon-linux-user.mak     |      1 +
 default-configs/targets/hppa-linux-user.mak        |      5 +
 default-configs/targets/hppa-softmmu.mak           |      4 +
 default-configs/targets/i386-bsd-user.mak          |      2 +
 default-configs/targets/i386-linux-user.mak        |      4 +
 default-configs/targets/i386-softmmu.mak           |      3 +
 default-configs/targets/lm32-softmmu.mak           |      2 +
 default-configs/targets/m68k-linux-user.mak        |      6 +
 default-configs/targets/m68k-softmmu.mak           |      3 +
 default-configs/targets/microblaze-linux-user.mak  |      5 +
 default-configs/targets/microblaze-softmmu.mak     |      4 +
 .../targets/microblazeel-linux-user.mak            |      4 +
 default-configs/targets/microblazeel-softmmu.mak   |      3 +
 default-configs/targets/mips-linux-user.mak        |      6 +
 default-configs/targets/mips-softmmu.mak           |      4 +
 default-configs/targets/mips64-linux-user.mak      |      7 +
 default-configs/targets/mips64-softmmu.mak         |      4 +
 default-configs/targets/mips64el-linux-user.mak    |      6 +
 default-configs/targets/mips64el-softmmu.mak       |      4 +
 default-configs/targets/mipsel-linux-user.mak      |      5 +
 default-configs/targets/mipsel-softmmu.mak         |      3 +
 default-configs/targets/mipsn32-linux-user.mak     |      8 +
 default-configs/targets/mipsn32el-linux-user.mak   |      7 +
 default-configs/targets/moxie-softmmu.mak          |      2 +
 default-configs/targets/nios2-linux-user.mak       |      1 +
 default-configs/targets/nios2-softmmu.mak          |      1 +
 default-configs/targets/or1k-linux-user.mak        |      2 +
 default-configs/targets/or1k-softmmu.mak           |      2 +
 default-configs/targets/ppc-linux-user.mak         |      5 +
 default-configs/targets/ppc-softmmu.mak            |      4 +
 default-configs/targets/ppc64-linux-user.mak       |      7 +
 default-configs/targets/ppc64-softmmu.mak          |      6 +
 default-configs/targets/ppc64abi32-linux-user.mak  |      8 +
 default-configs/targets/ppc64le-linux-user.mak     |      6 +
 default-configs/targets/riscv32-linux-user.mak     |      5 +
 default-configs/targets/riscv32-softmmu.mak        |      5 +
 default-configs/targets/riscv64-linux-user.mak     |      5 +
 default-configs/targets/riscv64-softmmu.mak        |      5 +
 default-configs/targets/rx-softmmu.mak             |      3 +
 default-configs/targets/s390x-linux-user.mak       |      5 +
 default-configs/targets/s390x-softmmu.mak          |      4 +
 default-configs/targets/sh4-linux-user.mak         |      5 +
 default-configs/targets/sh4-softmmu.mak            |      2 +
 default-configs/targets/sh4eb-linux-user.mak       |      6 +
 default-configs/targets/sh4eb-softmmu.mak          |      3 +
 default-configs/targets/sparc-bsd-user.mak         |      3 +
 default-configs/targets/sparc-linux-user.mak       |      5 +
 default-configs/targets/sparc-softmmu.mak          |      3 +
 default-configs/targets/sparc32plus-linux-user.mak |      8 +
 default-configs/targets/sparc64-bsd-user.mak       |      4 +
 default-configs/targets/sparc64-linux-user.mak     |      6 +
 default-configs/targets/sparc64-softmmu.mak        |      4 +
 default-configs/targets/tricore-softmmu.mak        |      1 +
 default-configs/targets/unicore32-softmmu.mak      |      1 +
 default-configs/targets/x86_64-bsd-user.mak        |      3 +
 default-configs/targets/x86_64-linux-user.mak      |      5 +
 default-configs/targets/x86_64-softmmu.mak         |      4 +
 default-configs/targets/xtensa-linux-user.mak      |      5 +
 default-configs/targets/xtensa-softmmu.mak         |      3 +
 default-configs/targets/xtensaeb-linux-user.mak    |      6 +
 default-configs/targets/xtensaeb-softmmu.mak       |      4 +
 default-configs/tilegx-linux-user.mak              |      1 -
 default-configs/tricore-softmmu.mak                |      1 -
 default-configs/unicore32-softmmu.mak              |      6 -
 default-configs/x86_64-bsd-user.mak                |      1 -
 default-configs/x86_64-linux-user.mak              |      1 -
 default-configs/x86_64-softmmu.mak                 |      3 -
 default-configs/xtensa-linux-user.mak              |      1 -
 default-configs/xtensa-softmmu.mak                 |      9 -
 default-configs/xtensaeb-linux-user.mak            |      1 -
 default-configs/xtensaeb-softmmu.mak               |      3 -
 device_tree.c                                      |    579 -
 disas.c                                            |    695 +-
 disas/Makefile.objs                                |     30 -
 disas/arm-a64.cc                                   |      2 +-
 disas/capstone.c                                   |    326 +
 disas/hexagon.c                                    |     65 +
 disas/hppa.c                                       |      2 +-
 disas/libvixl/Makefile.objs                        |      5 -
 disas/libvixl/meson.build                          |      7 +
 disas/libvixl/vixl/a64/disasm-a64.cc               |      4 +
 disas/libvixl/vixl/globals.h                       |      6 +-
 disas/lm32.c                                       |      2 +-
 disas/m68k.c                                       |      8 +-
 disas/meson.build                                  |     25 +
 disas/nanomips.cpp                                 |      4 +-
 disas/ppc.c                                        |      2 +-
 disas/tci.c                                        |     61 -
 dma-helpers.c                                      |    331 -
 docs/COLO-FT.txt                                   |     18 +-
 docs/_templates/editpage.html                      |      5 +
 docs/amd-memory-encryption.txt                     |      6 +-
 docs/can.txt                                       |    113 +-
 docs/ccid.txt                                      |      6 +-
 docs/colo-proxy.txt                                |     16 +-
 docs/conf.py                                       |     59 +-
 docs/confidential-guest-support.txt                |     49 +
 docs/cpu-hotplug.rst                               |    142 -
 docs/defs.rst.inc                                  |      2 +-
 docs/devel/_templates/editpage.html                |      5 +
 docs/devel/atomics.rst                             |    136 +-
 docs/devel/blkdebug.txt                            |      2 +-
 docs/devel/blkverify.txt                           |      4 +-
 docs/devel/block-coroutine-wrapper.rst             |     54 +
 docs/devel/build-system.rst                        |    469 +
 docs/devel/build-system.txt                        |    519 -
 docs/devel/clocks.rst                              |    138 +-
 docs/devel/code-of-conduct.rst                     |     60 +
 docs/devel/conf.py                                 |     15 -
 docs/devel/conflict-resolution.rst                 |     80 +
 docs/devel/control-flow-integrity.rst              |    137 +
 docs/devel/fuzzing.rst                             |    321 +
 docs/devel/fuzzing.txt                             |    175 -
 docs/devel/index.rst                               |     18 +-
 docs/devel/kconfig.rst                             |     21 +-
 docs/devel/loads-stores.rst                        |     24 +-
 docs/devel/lockcnt.txt                             |      8 +-
 docs/devel/migration.rst                           |     15 +-
 docs/devel/multi-process.rst                       |    966 +
 docs/devel/multi-thread-tcg.rst                    |      2 +-
 docs/devel/qapi-code-gen.txt                       |    163 +-
 docs/devel/qgraph.rst                              |    568 +
 docs/devel/qom.rst                                 |    381 +
 docs/devel/qtest.rst                               |     92 +
 docs/devel/rcu.txt                                 |     34 +-
 docs/devel/style.rst                               |    701 +
 docs/devel/tcg-plugins.rst                         |    185 +
 docs/devel/testing.rst                             |    297 +-
 docs/devel/tracing.rst                             |    498 +
 docs/devel/tracing.txt                             |    451 -
 docs/devel/writing-qmp-commands.txt                |     16 +-
 docs/generic-loader.txt                            |     92 -
 docs/hyperv.txt                                    |      7 +-
 docs/index.html.in                                 |     19 -
 docs/interop/_templates/editpage.html              |      5 +
 docs/interop/bitmaps.rst                           |      2 +-
 docs/interop/conf.py                               |     22 -
 docs/interop/dbus.rst                              |      4 +-
 docs/interop/firmware.json                         |      2 +-
 docs/interop/index.rst                             |      7 +-
 docs/interop/live-block-operations.rst             |      8 +-
 docs/interop/nbd.txt                               |     25 +-
 docs/interop/parallels.txt                         |     28 +-
 docs/interop/qcow2.txt                             |     73 +-
 docs/interop/qemu-ga-ref.rst                       |     13 +
 docs/interop/qemu-ga-ref.texi                      |     80 -
 docs/interop/qemu-qmp-ref.rst                      |     13 +
 docs/interop/qemu-qmp-ref.texi                     |     80 -
 docs/interop/qemu-storage-daemon-qmp-ref.rst       |     13 +
 docs/interop/qmp-intro.txt                         |      4 +-
 docs/interop/qmp-spec.txt                          |     17 +-
 docs/interop/vhost-user-gpu.rst                    |      2 +-
 docs/interop/vhost-user.json                       |      3 +-
 docs/interop/vhost-user.rst                        |     27 +-
 docs/meson.build                                   |    107 +
 docs/microvm.rst                                   |    129 -
 docs/nvdimm.txt                                    |     24 +-
 docs/papr-pef.txt                                  |     30 +
 docs/pr-manager.rst                                |    111 -
 docs/pvrdma.txt                                    |      2 +-
 docs/qcow2-cache.txt                               |     19 +-
 docs/qdev-device-use.txt                           |     37 +-
 docs/qemu-option-trace.rst.inc                     |      6 +-
 docs/rdma.txt                                      |      4 +-
 docs/replay.txt                                    |     52 +-
 docs/specs/_templates/editpage.html                |      5 +
 docs/specs/acpi_cpu_hotplug.txt                    |     19 +-
 docs/specs/conf.py                                 |     16 -
 docs/specs/index.rst                               |      5 +-
 docs/specs/pci-ids.txt                             |      2 +
 docs/specs/ppc-spapr-hotplug.txt                   |      4 +-
 docs/specs/ppc-spapr-numa.rst                      |    410 +
 docs/specs/ppc-spapr-xive.rst                      |     14 +-
 docs/specs/pvpanic.txt                             |     13 +-
 docs/specs/tpm.rst                                 |      2 +-
 docs/specs/virt-ctlr.txt                           |     26 +
 docs/sphinx/depfile.py                             |     51 +
 docs/sphinx/kerneldoc.py                           |      8 +-
 docs/sphinx/qapidoc.py                             |    551 +
 docs/system/_templates/editpage.html               |      5 +
 docs/system/arm/aspeed.rst                         |     35 +-
 docs/system/arm/cpu-features.rst                   |     32 +
 docs/system/arm/mps2.rst                           |     42 +-
 docs/system/arm/nuvoton.rst                        |     93 +
 docs/system/arm/raspi.rst                          |     43 +
 docs/system/arm/sabrelite.rst                      |    119 +
 docs/system/arm/sbsa.rst                           |     32 +
 docs/system/arm/versatile.rst                      |     34 +
 docs/system/arm/vexpress.rst                       |     28 +
 docs/system/arm/virt.rst                           |      2 +
 docs/system/arm/xlnx-versal-virt.rst               |    177 +
 docs/system/arm/xscale.rst                         |     20 +-
 docs/system/build-platforms.rst                    |     63 +-
 docs/system/conf.py                                |     28 -
 docs/system/cpu-hotplug.rst                        |    142 +
 docs/system/cpu-models-mips.rst.inc                |     10 +-
 docs/system/cpu-models-x86.rst.inc                 |      4 +-
 docs/system/deprecated.rst                         |    518 +-
 docs/system/device-url-syntax.rst.inc              |      8 +-
 docs/system/gdb.rst                                |     65 +-
 docs/system/generic-loader.rst                     |    117 +
 docs/system/guest-loader.rst                       |     54 +
 docs/system/i386/microvm.rst                       |    128 +
 docs/system/i386/pc.rst                            |      7 +
 docs/system/images.rst                             |      2 +-
 docs/system/index.rst                              |     13 +-
 docs/system/monitor.rst                            |      2 +-
 docs/system/multi-process.rst                      |     64 +
 docs/system/mux-chardev.rst                        |      2 +-
 docs/system/nvme.rst                               |    225 +
 docs/system/ppc/embedded.rst                       |     10 +
 docs/system/ppc/powermac.rst                       |     34 +
 docs/system/ppc/powernv.rst                        |    193 +
 docs/system/ppc/prep.rst                           |     18 +
 docs/system/ppc/pseries.rst                        |     12 +
 docs/system/pr-manager.rst                         |     83 +
 docs/system/qemu-block-drivers.rst.inc             |     26 +
 docs/system/quickstart.rst                         |      8 +
 docs/system/removed-features.rst                   |    463 +
 docs/system/riscv/microchip-icicle-kit.rst         |     89 +
 docs/system/riscv/sifive_u.rst                     |    336 +
 docs/system/s390x/3270.rst                         |      2 +-
 docs/system/s390x/bootdevices.rst                  |     82 +
 docs/system/s390x/protvirt.rst                     |     19 +-
 docs/system/target-arm.rst                         |      5 +
 docs/system/target-avr.rst                         |     43 +-
 docs/system/target-i386.rst                        |     19 +-
 docs/system/target-mips.rst                        |     10 +
 docs/system/target-ppc.rst                         |     53 +-
 docs/system/target-riscv.rst                       |     73 +
 docs/system/target-s390x.rst                       |      1 +
 docs/system/targets.rst                            |     22 +-
 docs/system/tls.rst                                |      2 +-
 docs/system/usb.rst                                |      9 +-
 docs/system/virtio-net-failover.rst                |     68 +
 docs/system/virtio-pmem.rst                        |     76 +
 docs/system/vnc-security.rst                       |     20 +-
 docs/throttle.txt                                  |    108 +-
 docs/tools/_templates/editpage.html                |      5 +
 docs/tools/conf.py                                 |     33 -
 docs/tools/index.rst                               |      6 +-
 docs/tools/qemu-img.rst                            |     12 +-
 docs/tools/qemu-nbd.rst                            |     12 +-
 docs/tools/qemu-pr-helper.rst                      |     90 +
 docs/tools/qemu-storage-daemon.rst                 |    221 +
 docs/tools/virtiofsd.rst                           |    209 +-
 docs/u2f.txt                                       |    110 +
 docs/user/_templates/editpage.html                 |      5 +
 docs/user/conf.py                                  |     15 -
 docs/user/index.rst                                |      4 +-
 docs/user/main.rst                                 |    160 +-
 docs/virtio-net-failover.rst                       |     68 -
 docs/virtio-pmem.rst                               |     76 -
 docs/xbzrle.txt                                    |      5 -
 dump/Makefile.objs                                 |      3 -
 dump/dump.c                                        |     34 +-
 dump/meson.build                                   |      4 +
 exec-vary.c                                        |    108 -
 exec.c                                             |   4148 -
 fpu/softfloat-specialize.c.inc                     |   1171 +
 fpu/softfloat-specialize.inc.c                     |   1083 -
 fpu/softfloat.c                                    |    429 +-
 fsdev/9p-marshal.h                                 |     12 +-
 fsdev/Makefile.objs                                |     12 -
 fsdev/file-op-9p.h                                 |      7 +-
 fsdev/meson.build                                  |     17 +
 fsdev/virtfs-proxy-helper.c                        |      2 +-
 gdb-xml/riscv-32bit-csr.xml                        |    250 -
 gdb-xml/riscv-64bit-csr.xml                        |    250 -
 gdbstub.c                                          |    146 +-
 hmp-commands-info.hx                               |     24 +-
 hmp-commands.hx                                    |    230 +-
 hw/9pfs/9p-local.c                                 |     10 +-
 hw/9pfs/9p-proxy.c                                 |      3 +-
 hw/9pfs/9p-synth.c                                 |     12 +-
 hw/9pfs/9p.c                                       |    287 +-
 hw/9pfs/9p.h                                       |     67 +-
 hw/9pfs/Makefile.objs                              |      9 -
 hw/9pfs/codir.c                                    |    203 +-
 hw/9pfs/cofs.c                                     |      2 +-
 hw/9pfs/coth.h                                     |     15 +-
 hw/9pfs/meson.build                                |     20 +
 hw/9pfs/trace.h                                    |      1 +
 hw/9pfs/virtio-9p-device.c                         |      6 +
 hw/9pfs/virtio-9p.h                                |      9 +-
 hw/Kconfig                                         |      4 +-
 hw/Makefile.objs                                   |     48 -
 hw/acpi/Makefile.objs                              |     26 -
 hw/acpi/aml-build-stub.c                           |     14 +
 hw/acpi/aml-build.c                                |    360 +-
 hw/acpi/core.c                                     |     17 +-
 hw/acpi/cpu.c                                      |    200 +-
 hw/acpi/generic_event_device.c                     |     64 +-
 hw/acpi/ghes.c                                     |      5 +-
 hw/acpi/hmat.c                                     |      7 +-
 hw/acpi/hmat.h                                     |      5 +-
 hw/acpi/ich9.c                                     |     28 +-
 hw/acpi/memory_hotplug.c                           |     11 +-
 hw/acpi/meson.build                                |     25 +
 hw/acpi/nvdimm.c                                   |     40 +-
 hw/acpi/pci.c                                      |      6 +-
 hw/acpi/pcihp.c                                    |    146 +-
 hw/acpi/piix4.c                                    |     40 +-
 hw/acpi/tco.c                                      |     11 -
 hw/acpi/trace-events                               |      4 +
 hw/acpi/trace.h                                    |      1 +
 hw/acpi/utils.c                                    |     17 +-
 hw/acpi/vmgenid.c                                  |     13 +-
 hw/adc/Makefile.objs                               |      1 -
 hw/adc/meson.build                                 |      2 +
 hw/adc/npcm7xx_adc.c                               |    301 +
 hw/adc/trace-events                                |      5 +
 hw/adc/trace.h                                     |      1 +
 hw/alpha/Makefile.objs                             |      1 -
 hw/alpha/dp264.c                                   |     11 +-
 hw/alpha/meson.build                               |      8 +
 hw/alpha/trace.h                                   |      1 +
 hw/alpha/typhoon.c                                 |      8 +-
 hw/arm/Kconfig                                     |     37 +-
 hw/arm/Makefile.objs                               |     56 -
 hw/arm/allwinner-a10.c                             |      2 +
 hw/arm/allwinner-h3.c                              |    128 +-
 hw/arm/armsse.c                                    |   1020 +-
 hw/arm/armv7m.c                                    |     19 +-
 hw/arm/aspeed.c                                    |    184 +-
 hw/arm/aspeed_ast2600.c                            |    265 +-
 hw/arm/aspeed_soc.c                                |    264 +-
 hw/arm/bcm2835_peripherals.c                       |     30 +-
 hw/arm/bcm2836.c                                   |    184 +-
 hw/arm/boot.c                                      |      6 +-
 hw/arm/collie.c                                    |      8 +-
 hw/arm/cubieboard.c                                |      2 +-
 hw/arm/digic_boards.c                              |     22 +-
 hw/arm/exynos4210.c                                |      2 +-
 hw/arm/highbank.c                                  |     35 +-
 hw/arm/integratorcp.c                              |     41 +-
 hw/arm/mainstone.c                                 |      1 -
 hw/arm/meson.build                                 |     60 +
 hw/arm/microbit.c                                  |     10 +-
 hw/arm/mps2-tz.c                                   |    834 +-
 hw/arm/mps2.c                                      |    146 +-
 hw/arm/musca.c                                     |     33 +-
 hw/arm/musicpal.c                                  |    220 +-
 hw/arm/netduino2.c                                 |      2 +-
 hw/arm/netduinoplus2.c                             |      2 +-
 hw/arm/npcm7xx.c                                   |    804 +
 hw/arm/npcm7xx_boards.c                            |    340 +
 hw/arm/nseries.c                                   |     27 +-
 hw/arm/omap1.c                                     |      1 -
 hw/arm/orangepi.c                                  |     10 +-
 hw/arm/palm.c                                      |      8 +-
 hw/arm/pxa2xx.c                                    |     73 +-
 hw/arm/pxa2xx_gpio.c                               |      5 +-
 hw/arm/pxa2xx_pic.c                                |      8 +-
 hw/arm/raspi.c                                     |    213 +-
 hw/arm/realview.c                                  |     18 +-
 hw/arm/sabrelite.c                                 |      4 +
 hw/arm/sbsa-ref.c                                  |    112 +-
 hw/arm/smmu-common.c                               |    233 +-
 hw/arm/smmu-internal.h                             |     13 +
 hw/arm/smmuv3-internal.h                           |     19 +-
 hw/arm/smmuv3.c                                    |    214 +-
 hw/arm/spitz.c                                     |     82 +-
 hw/arm/stellaris.c                                 |    202 +-
 hw/arm/stm32f205_soc.c                             |      1 -
 hw/arm/strongarm.c                                 |     40 +-
 hw/arm/tosa.c                                      |     70 +-
 hw/arm/trace-events                                |     36 +-
 hw/arm/trace.h                                     |      1 +
 hw/arm/versatilepb.c                               |     36 +-
 hw/arm/vexpress.c                                  |     69 +-
 hw/arm/virt-acpi-build.c                           |    282 +-
 hw/arm/virt.c                                      |    771 +-
 hw/arm/xilinx_zynq.c                               |     35 +-
 hw/arm/xlnx-versal-virt.c                          |     66 +-
 hw/arm/xlnx-versal.c                               |     67 +-
 hw/arm/xlnx-zcu102.c                               |     56 +-
 hw/arm/xlnx-zynqmp.c                               |     63 +-
 hw/arm/z2.c                                        |     28 +-
 hw/audio/Makefile.objs                             |     18 -
 hw/audio/ac97.c                                    |      8 +-
 hw/audio/adlib.c                                   |      7 +-
 hw/audio/cs4231.c                                  |     17 +-
 hw/audio/cs4231a.c                                 |      9 +-
 hw/audio/es1370.c                                  |      9 +-
 hw/audio/gus.c                                     |      7 +-
 hw/audio/hda-codec.c                               |      7 +-
 hw/audio/intel-hda.c                               |      5 +-
 hw/audio/intel-hda.h                               |     18 +-
 hw/audio/marvell_88w8618.c                         |      8 +-
 hw/audio/meson.build                               |     15 +
 hw/audio/milkymist-ac97.c                          |      7 +-
 hw/audio/pcspk.c                                   |      7 +-
 hw/audio/pl041.c                                   |      7 +-
 hw/audio/sb16.c                                    |      7 +-
 hw/audio/trace.h                                   |      1 +
 hw/audio/via-ac97.c                                |     93 +
 hw/audio/wm8750.c                                  |      7 +-
 hw/avr/Makefile.objs                               |      3 -
 hw/avr/arduino.c                                   |     39 +-
 hw/avr/atmega.c                                    |     12 +-
 hw/avr/atmega.h                                    |      9 +-
 hw/avr/boot.c                                      |      1 +
 hw/avr/meson.build                                 |      6 +
 hw/block/Kconfig                                   |      3 +
 hw/block/Makefile.objs                             |     18 -
 hw/block/dataplane/Makefile.objs                   |      2 -
 hw/block/dataplane/meson.build                     |      2 +
 hw/block/dataplane/trace.h                         |      1 +
 hw/block/dataplane/virtio-blk.c                    |      4 +
 hw/block/dataplane/xen-block.c                     |      9 +-
 hw/block/fdc.c                                     |    134 +-
 hw/block/m25p80.c                                  |    334 +-
 hw/block/meson.build                               |     21 +
 hw/block/nand.c                                    |     60 +-
 hw/block/nvme-dif.c                                |    518 +
 hw/block/nvme-dif.h                                |     63 +
 hw/block/nvme-ns.c                                 |    594 +
 hw/block/nvme-ns.h                                 |    229 +
 hw/block/nvme-subsys.c                             |     91 +
 hw/block/nvme-subsys.h                             |     59 +
 hw/block/nvme.c                                    |   5657 +-
 hw/block/nvme.h                                    |    200 +-
 hw/block/onenand.c                                 |     10 +-
 hw/block/pflash_cfi01.c                            |    259 +-
 hw/block/pflash_cfi02.c                            |    321 +-
 hw/block/swim.c                                    |     16 +-
 hw/block/tc58128.c                                 |     26 +
 hw/block/trace-events                              |    165 +-
 hw/block/trace.h                                   |      1 +
 hw/block/vhost-user-blk.c                          |    100 +-
 hw/block/virtio-blk.c                              |     33 +-
 hw/block/xen-block.c                               |     39 +-
 hw/char/Kconfig                                    |     15 +
 hw/char/Makefile.objs                              |     39 -
 hw/char/avr_usart.c                                |      1 +
 hw/char/bcm2835_aux.c                              |      5 +-
 hw/char/cadence_uart.c                             |      5 +-
 hw/char/cmsdk-apb-uart.c                           |      1 +
 hw/char/debugcon.c                                 |      9 +-
 hw/char/digic-uart.c                               |      1 +
 hw/char/escc.c                                     |      1 +
 hw/char/etraxfs_ser.c                              |     13 +-
 hw/char/exynos4210_uart.c                          |     16 +-
 hw/char/goldfish_tty.c                             |    285 +
 hw/char/grlib_apbuart.c                            |      9 +-
 hw/char/ibex_uart.c                                |     28 +-
 hw/char/imx_serial.c                               |      1 +
 hw/char/ipoctal232.c                               |      5 +-
 hw/char/lm32_juart.c                               |      7 +-
 hw/char/lm32_uart.c                                |      7 +-
 hw/char/mcf_uart.c                                 |      8 +-
 hw/char/mchp_pfsoc_mmuart.c                        |     86 +
 hw/char/meson.build                                |     43 +
 hw/char/milkymist-uart.c                           |      8 +-
 hw/char/nrf51_uart.c                               |      1 +
 hw/char/parallel.c                                 |      9 +-
 hw/char/pl011.c                                    |     56 +
 hw/char/renesas_sci.c                              |      1 +
 hw/char/riscv_htif.c                               |    261 +
 hw/char/sclpconsole-lm.c                           |     13 +-
 hw/char/sclpconsole.c                              |     13 +-
 hw/char/serial-isa.c                               |     11 +-
 hw/char/serial-pci-multi.c                         |      1 +
 hw/char/serial-pci.c                               |     10 +-
 hw/char/serial.c                                   |     82 +-
 hw/char/sifive_uart.c                              |    194 +
 hw/char/spapr_vty.c                                |      9 +-
 hw/char/stm32f2xx_usart.c                          |      1 +
 hw/char/terminal3270.c                             |     22 +-
 hw/char/trace-events                               |     18 +-
 hw/char/trace.h                                    |      1 +
 hw/char/virtio-console.c                           |     11 +-
 hw/char/virtio-serial-bus.c                        |      6 -
 hw/char/xilinx_uartlite.c                          |      9 +-
 hw/core/Kconfig                                    |      5 +
 hw/core/Makefile.objs                              |     34 -
 hw/core/bus.c                                      |     30 +-
 hw/core/clock.c                                    |     58 +-
 hw/core/cpu.c                                      |     72 +-
 hw/core/generic-loader.c                           |      3 +-
 hw/core/guest-loader.c                             |    145 +
 hw/core/guest-loader.h                             |     34 +
 hw/core/irq.c                                      |      3 +-
 hw/core/loader-fit.c                               |      2 +-
 hw/core/loader.c                                   |    143 +-
 hw/core/machine-hmp-cmds.c                         |     22 +-
 hw/core/machine-qmp-cmds.c                         |    218 +-
 hw/core/machine.c                                  |    292 +-
 hw/core/meson.build                                |     44 +
 hw/core/numa.c                                     |     85 +-
 hw/core/platform-bus.c                             |      2 +-
 hw/core/ptimer.c                                   |     46 +-
 hw/core/qdev-clock.c                               |     33 +-
 hw/core/qdev-prop-internal.h                       |     28 +
 hw/core/qdev-properties-system.c                   |    743 +-
 hw/core/qdev-properties.c                          |   1092 +-
 hw/core/qdev.c                                     |    242 +-
 hw/core/register.c                                 |     43 +-
 hw/core/stream.c                                   |     20 +-
 hw/core/sysbus.c                                   |      7 +-
 hw/core/trace-events                               |      4 +-
 hw/core/trace.h                                    |      1 +
 hw/cpu/Makefile.objs                               |      5 -
 hw/cpu/a15mpcore.c                                 |      4 +-
 hw/cpu/a9mpcore.c                                  |     14 +-
 hw/cpu/core.c                                      |     18 +-
 hw/cpu/meson.build                                 |      6 +
 hw/cpu/realview_mpcore.c                           |      8 +-
 hw/cris/Makefile.objs                              |      2 -
 hw/cris/axis_dev88.c                               |      7 +-
 hw/cris/boot.c                                     |      6 +-
 hw/cris/boot.h                                     |      1 +
 hw/cris/meson.build                                |      5 +
 hw/display/Kconfig                                 |      3 -
 hw/display/Makefile.objs                           |     65 -
 hw/display/ads7846.c                               |    183 -
 hw/display/artist.c                                |    235 +-
 hw/display/ati_2d.c                                |     10 +-
 hw/display/ati_int.h                               |      7 +-
 hw/display/bcm2835_fb.c                            |      2 +-
 hw/display/bochs-display.c                         |      8 +-
 hw/display/cg3.c                                   |      8 +-
 hw/display/cirrus_vga.c                            |     41 +-
 hw/display/cirrus_vga_isa.c                        |      8 +-
 hw/display/edid-generate.c                         |     51 +-
 hw/display/exynos4210_fimd.c                       |     12 +-
 hw/display/g364fb.c                                |      7 +-
 hw/display/jazz_led.c                              |      7 +-
 hw/display/macfb.c                                 |      4 +-
 hw/display/meson.build                             |     87 +
 hw/display/milkymist-tmu2.c                        |      7 +-
 hw/display/milkymist-vgafb.c                       |      7 +-
 hw/display/milkymist-vgafb_template.h              |      2 +-
 hw/display/next-fb.c                               |      4 +-
 hw/display/omap_lcd_template.h                     |    169 -
 hw/display/omap_lcdc.c                             |    139 +-
 hw/display/pl110.c                                 |    152 +-
 hw/display/pl110_template.h                        |    120 +-
 hw/display/pxa2xx_lcd.c                            |    525 +-
 hw/display/pxa2xx_template.h                       |    447 -
 hw/display/qxl-logger.c                            |      6 +-
 hw/display/qxl-render.c                            |      1 +
 hw/display/qxl.c                                   |      9 +-
 hw/display/qxl.h                                   |      7 +-
 hw/display/ramfb-standalone.c                      |      9 +-
 hw/display/sii9022.c                               |      7 +-
 hw/display/sm501.c                                 |    174 +-
 hw/display/sm501_template.h                        |    131 -
 hw/display/ssd0303.c                               |      7 +-
 hw/display/ssd0323.c                               |     20 +-
 hw/display/tc6393xb.c                              |     50 +-
 hw/display/tc6393xb_template.h                     |     72 -
 hw/display/tcx.c                                   |     65 +-
 hw/display/trace-events                            |      4 +-
 hw/display/trace.h                                 |      1 +
 hw/display/vga-isa.c                               |      7 +-
 hw/display/vga-pci.c                               |     19 +-
 hw/display/vga.c                                   |      1 -
 hw/display/vhost-user-gpu-pci.c                    |     10 +-
 hw/display/vhost-user-gpu.c                        |     27 +-
 hw/display/vhost-user-vga.c                        |     12 +-
 hw/display/virtio-gpu-3d.c                         |     19 +-
 hw/display/virtio-gpu-base.c                       |     39 +-
 hw/display/virtio-gpu-pci.c                        |     10 +-
 hw/display/virtio-gpu.c                            |     27 +-
 hw/display/virtio-vga.c                            |     71 +-
 hw/display/virtio-vga.h                            |     17 +-
 hw/display/vmware_vga.c                            |      8 +-
 hw/display/xlnx_dp.c                               |      9 +
 hw/dma/Kconfig                                     |     10 +
 hw/dma/Makefile.objs                               |     16 -
 hw/dma/i82374.c                                    |      7 +-
 hw/dma/i8257.c                                     |      2 -
 hw/dma/meson.build                                 |     17 +
 hw/dma/pl330.c                                     |      3 +-
 hw/dma/puv3_dma.c                                  |      7 +-
 hw/dma/pxa2xx_dma.c                                |      7 +-
 hw/dma/rc4030.c                                    |      8 +-
 hw/dma/sifive_pdma.c                               |    313 +
 hw/dma/sparc32_dma.c                               |     49 +-
 hw/dma/trace.h                                     |      1 +
 hw/dma/xilinx_axidma.c                             |     69 +-
 hw/dma/xlnx_csu_dma.c                              |    745 +
 hw/dma/xlnx_dpdma.c                                |      2 +-
 hw/gpio/Kconfig                                    |      6 +
 hw/gpio/Makefile.objs                              |     12 -
 hw/gpio/gpio_key.c                                 |      7 +-
 hw/gpio/gpio_pwr.c                                 |     70 +
 hw/gpio/max7310.c                                  |     26 +-
 hw/gpio/meson.build                                |     15 +
 hw/gpio/mpc8xxx.c                                  |      9 +-
 hw/gpio/npcm7xx_gpio.c                             |    424 +
 hw/gpio/omap_gpio.c                                |      6 +-
 hw/gpio/pl061.c                                    |      7 +-
 hw/gpio/puv3_gpio.c                                |      7 +-
 hw/gpio/sifive_gpio.c                              |    397 +
 hw/gpio/trace-events                               |     13 +
 hw/gpio/trace.h                                    |      1 +
 hw/gpio/zaurus.c                                   |      4 +-
 hw/hppa/Makefile.objs                              |      1 -
 hw/hppa/dino.c                                     |     10 +-
 hw/hppa/hppa_hardware.h                            |      5 +
 hw/hppa/lasi.c                                     |     18 +-
 hw/hppa/machine.c                                  |     88 +-
 hw/hppa/meson.build                                |      4 +
 hw/hppa/trace.h                                    |      1 +
 hw/hyperv/Makefile.objs                            |      3 -
 hw/hyperv/hyperv.c                                 |     17 +-
 hw/hyperv/hyperv_testdev.c                         |      5 +-
 hw/hyperv/meson.build                              |      3 +
 hw/hyperv/trace-events                             |      2 +-
 hw/hyperv/trace.h                                  |      1 +
 hw/hyperv/vmbus.c                                  |      9 +-
 hw/i2c/Makefile.objs                               |     14 -
 hw/i2c/bitbang_i2c.c                               |      7 +-
 hw/i2c/exynos4210_i2c.c                            |      8 +-
 hw/i2c/meson.build                                 |     17 +
 hw/i2c/microbit_i2c.c                              |      1 +
 hw/i2c/mpc_i2c.c                                   |      8 +-
 hw/i2c/npcm7xx_smbus.c                             |   1098 +
 hw/i2c/pm_smbus.c                                  |      2 +-
 hw/i2c/smbus_eeprom.c                              |      8 +-
 hw/i2c/smbus_ich9.c                                |      8 +-
 hw/i2c/trace-events                                |     12 +
 hw/i2c/trace.h                                     |      1 +
 hw/i2c/versatile_i2c.c                             |      7 +-
 hw/i386/Kconfig                                    |      5 +-
 hw/i386/Makefile.objs                              |     20 -
 hw/i386/acpi-build.c                               |    699 +-
 hw/i386/acpi-common.c                              |     37 +-
 hw/i386/acpi-common.h                              |      2 +-
 hw/i386/acpi-microvm.c                             |    260 +
 hw/i386/acpi-microvm.h                             |      8 +
 hw/i386/amd_iommu.c                                |      4 +-
 hw/i386/amd_iommu.h                                |      8 +-
 hw/i386/fw_cfg.c                                   |      8 +-
 hw/i386/generic_event_device_x86.c                 |     36 +
 hw/i386/intel_iommu.c                              |    131 +-
 hw/i386/kvm/Makefile.objs                          |      5 -
 hw/i386/kvm/apic.c                                 |     14 +-
 hw/i386/kvm/clock.c                                |     18 +-
 hw/i386/kvm/i8254.c                                |     23 +-
 hw/i386/kvm/i8259.c                                |     12 +-
 hw/i386/kvm/ioapic.c                               |     35 +-
 hw/i386/kvm/meson.build                            |      8 +
 hw/i386/kvmvapic.c                                 |     10 +-
 hw/i386/meson.build                                |     33 +
 hw/i386/microvm.c                                  |    293 +-
 hw/i386/pc.c                                       |    518 +-
 hw/i386/pc_piix.c                                  |    151 +-
 hw/i386/pc_q35.c                                   |     49 +-
 hw/i386/pc_sysfw.c                                 |    144 +-
 hw/i386/port92.c                                   |      7 +-
 hw/i386/trace.h                                    |      1 +
 hw/i386/vmmouse.c                                  |      9 +-
 hw/i386/vmport.c                                   |     10 +-
 hw/i386/x86-iommu.c                                |      2 +-
 hw/i386/x86.c                                      |    457 +-
 hw/i386/xen/Makefile.objs                          |      1 -
 hw/i386/xen/meson.build                            |      7 +
 hw/i386/xen/trace.h                                |      1 +
 hw/i386/xen/xen-hvm.c                              |     13 +-
 hw/i386/xen/xen_platform.c                         |     23 +-
 hw/i386/xen/xen_pvdevice.c                         |      8 +-
 hw/ide/Makefile.objs                               |     14 -
 hw/ide/ahci-allwinner.c                            |      3 -
 hw/ide/ahci.c                                      |     33 +-
 hw/ide/ahci_internal.h                             |      7 +-
 hw/ide/atapi.c                                     |     40 +-
 hw/ide/core.c                                      |    129 +-
 hw/ide/ich.c                                       |     10 +-
 hw/ide/ioport.c                                    |      2 +-
 hw/ide/isa.c                                       |      7 +-
 hw/ide/macio.c                                     |      2 +-
 hw/ide/meson.build                                 |     14 +
 hw/ide/microdrive.c                                |      7 +-
 hw/ide/mmio.c                                      |     17 +-
 hw/ide/pci.c                                       |     14 +-
 hw/ide/piix.c                                      |     27 +-
 hw/ide/qdev.c                                      |     41 +-
 hw/ide/sii3112.c                                   |      8 +-
 hw/ide/trace-events                                |      2 +-
 hw/ide/trace.h                                     |      1 +
 hw/input/Kconfig                                   |      3 +
 hw/input/Makefile.objs                             |     18 -
 hw/input/adb-kbd.c                                 |     15 +-
 hw/input/adb-mouse.c                               |     15 +-
 hw/input/adb.c                                     |      1 +
 hw/input/ads7846.c                                 |    186 +
 hw/input/hid.c                                     |      1 -
 hw/input/lm832x.c                                  |      7 +-
 hw/input/meson.build                               |     19 +
 hw/input/milkymist-softusb.c                       |      7 +-
 hw/input/pckbd.c                                   |      2 -
 hw/input/pl050.c                                   |      7 +-
 hw/input/ps2.c                                     |      9 -
 hw/input/pxa2xx_keypad.c                           |     10 -
 hw/input/trace.h                                   |      1 +
 hw/intc/Kconfig                                    |     32 +-
 hw/intc/Makefile.objs                              |     54 -
 hw/intc/apic.c                                     |     15 +-
 hw/intc/apic_common.c                              |      5 +-
 hw/intc/arm_gic.c                                  |      9 +-
 hw/intc/arm_gic_kvm.c                              |     17 +-
 hw/intc/arm_gicv2m.c                               |      9 +-
 hw/intc/arm_gicv3_cpuif.c                          |      5 +-
 hw/intc/arm_gicv3_its_kvm.c                        |     18 +-
 hw/intc/arm_gicv3_kvm.c                            |     25 +-
 hw/intc/armv7m_nvic.c                              |    308 +-
 hw/intc/bcm2835_ic.c                               |      4 +-
 hw/intc/bcm2836_control.c                          |      8 +-
 hw/intc/etraxfs_pic.c                              |      7 +-
 hw/intc/exynos4210_combiner.c                      |      9 +-
 hw/intc/exynos4210_gic.c                           |     15 +-
 hw/intc/goldfish_pic.c                             |    219 +
 hw/intc/grlib_irqmp.c                              |     12 +-
 hw/intc/i8259.c                                    |     22 +-
 hw/intc/ibex_plic.c                                |     63 +-
 hw/intc/ioapic.c                                   |      3 +-
 hw/intc/ioapic_common.c                            |      2 +-
 hw/intc/lm32_pic.c                                 |      6 +-
 hw/intc/loongson_liointc.c                         |     47 +-
 hw/intc/m68k_irqc.c                                |    119 +
 hw/intc/meson.build                                |     61 +
 hw/intc/nios2_iic.c                                |     95 -
 hw/intc/omap_intc.c                                |      2 +-
 hw/intc/ompic.c                                    |      4 +-
 hw/intc/openpic_kvm.c                              |      8 +-
 hw/intc/pl190.c                                    |      7 +-
 hw/intc/pnv_xive.c                                 |      3 +
 hw/intc/ppc-uic.c                                  |    321 +
 hw/intc/puv3_intc.c                                |      7 +-
 hw/intc/rx_icu.c                                   |     30 +-
 hw/intc/s390_flic_kvm.c                            |     18 +-
 hw/intc/sifive_clint.c                             |    266 +
 hw/intc/sifive_plic.c                              |    548 +
 hw/intc/slavio_intctl.c                            |      8 +-
 hw/intc/spapr_xive.c                               |    129 +-
 hw/intc/spapr_xive_kvm.c                           |    264 +-
 hw/intc/trace-events                               |     48 +
 hw/intc/trace.h                                    |      1 +
 hw/intc/xics_kvm.c                                 |      2 +-
 hw/intc/xics_pnv.c                                 |      2 +-
 hw/intc/xilinx_intc.c                              |      4 +-
 hw/intc/xive.c                                     |    100 +-
 hw/ipack/Makefile.objs                             |      2 -
 hw/ipack/meson.build                               |      1 +
 hw/ipack/tpci200.c                                 |      8 +-
 hw/ipmi/Makefile.objs                              |      8 -
 hw/ipmi/ipmi_bmc_extern.c                          |     10 +-
 hw/ipmi/ipmi_bmc_sim.c                             |      1 +
 hw/ipmi/isa_ipmi_bt.c                              |      8 +-
 hw/ipmi/isa_ipmi_kcs.c                             |      8 +-
 hw/ipmi/meson.build                                |     11 +
 hw/ipmi/pci_ipmi_bt.c                              |      8 +-
 hw/ipmi/pci_ipmi_kcs.c                             |      8 +-
 hw/ipmi/smbus_ipmi.c                               |      7 +-
 hw/isa/Kconfig                                     |      2 +
 hw/isa/Makefile.objs                               |     11 -
 hw/isa/apm.c                                       |      2 +-
 hw/isa/i82378.c                                    |     10 +-
 hw/isa/isa-bus.c                                   |     11 +-
 hw/isa/isa-superio.c                               |      2 +-
 hw/isa/lpc_ich9.c                                  |     43 +-
 hw/isa/meson.build                                 |     11 +
 hw/isa/pc87312.c                                   |      2 +-
 hw/isa/piix3.c                                     |      6 +-
 hw/isa/piix4.c                                     |     23 +-
 hw/isa/trace-events                                |      8 +
 hw/isa/trace.h                                     |      1 +
 hw/isa/vt82c686.c                                  |    646 +-
 hw/lm32/Kconfig                                    |     10 +-
 hw/lm32/Makefile.objs                              |      3 -
 hw/lm32/lm32_boards.c                              |      2 +-
 hw/lm32/lm32_hwsetup.h                             |      2 +-
 hw/lm32/meson.build                                |      6 +
 hw/lm32/milkymist-hw.h                             |     11 -
 hw/lm32/milkymist.c                                |     31 +-
 hw/m68k/Kconfig                                    |     10 +
 hw/m68k/Makefile.objs                              |      4 -
 hw/m68k/an5206.c                                   |     14 +-
 hw/m68k/bootinfo.h                                 |     55 -
 hw/m68k/mcf5206.c                                  |     60 +-
 hw/m68k/mcf5208.c                                  |     14 +-
 hw/m68k/mcf_intc.c                                 |      7 +-
 hw/m68k/meson.build                                |      8 +
 hw/m68k/next-cube.c                                |    250 +-
 hw/m68k/next-kbd.c                                 |      7 +-
 hw/m68k/q800.c                                     |    121 +-
 hw/m68k/virt.c                                     |    313 +
 hw/mem/Kconfig                                     |      1 +
 hw/mem/Makefile.objs                               |      3 -
 hw/mem/memory-device.c                             |     32 +-
 hw/mem/meson.build                                 |      8 +
 hw/mem/npcm7xx_mc.c                                |     84 +
 hw/mem/nvdimm.c                                    |     12 +-
 hw/mem/pc-dimm.c                                   |      4 +-
 hw/mem/sparse-mem.c                                |    151 +
 hw/mem/trace.h                                     |      1 +
 hw/meson.build                                     |     67 +
 hw/microblaze/Makefile.objs                        |      4 -
 hw/microblaze/boot.c                               |     22 +-
 hw/microblaze/meson.build                          |      7 +
 hw/microblaze/petalogix_ml605_mmu.c                |      6 +-
 hw/microblaze/xlnx-zynqmp-pmu.c                    |     10 +-
 hw/mips/Kconfig                                    |     28 +-
 hw/mips/Makefile.objs                              |      8 -
 hw/mips/addr.c                                     |     51 -
 hw/mips/bootloader.c                               |    200 +
 hw/mips/boston.c                                   |    107 +-
 hw/mips/cps.c                                      |     29 +-
 hw/mips/fuloong2e.c                                |    136 +-
 hw/mips/fw_cfg.c                                   |     35 +
 hw/mips/fw_cfg.h                                   |     19 +
 hw/mips/gt64xxx_pci.c                              |     69 +-
 hw/mips/jazz.c                                     |     42 +-
 hw/mips/loongson3_bootp.c                          |    151 +
 hw/mips/loongson3_bootp.h                          |    236 +
 hw/mips/loongson3_virt.c                           |    638 +
 hw/mips/malta.c                                    |    173 +-
 hw/mips/meson.build                                |     12 +
 hw/mips/mipssim.c                                  |     44 +-
 hw/mips/r4k.c                                      |    318 -
 hw/mips/trace-events                               |      8 +-
 hw/mips/trace.h                                    |      1 +
 hw/misc/Kconfig                                    |     54 +-
 hw/misc/Makefile.objs                              |     95 -
 hw/misc/a9scu.c                                    |     59 +-
 hw/misc/allwinner-sid.c                            |      1 +
 hw/misc/applesmc.c                                 |      6 +-
 hw/misc/arm_integrator_debug.c                     |     10 +-
 hw/misc/arm_l2x0.c                                 |      7 +-
 hw/misc/arm_sysctl.c                               |      8 +-
 hw/misc/armsse-cpu-pwrctrl.c                       |    149 +
 hw/misc/armsse-cpuid.c                             |      2 +-
 hw/misc/armsse-mhu.c                               |      2 +-
 hw/misc/aspeed_lpc.c                               |    486 +
 hw/misc/aspeed_scu.c                               |     16 +-
 hw/misc/aspeed_sdmc.c                              |    125 +-
 hw/misc/aspeed_xdma.c                              |      2 +-
 hw/misc/auxbus.c                                   |      2 -
 hw/misc/bcm2835_cprman.c                           |    813 +
 hw/misc/debugexit.c                                |      8 +-
 hw/misc/eccmemctl.c                                |      7 +-
 hw/misc/edu.c                                      |     25 +-
 hw/misc/emc141x.c                                  |    326 +
 hw/misc/empty_slot.c                               |      7 +-
 hw/misc/exynos4210_clk.c                           |      8 +-
 hw/misc/exynos4210_pmu.c                           |      8 +-
 hw/misc/exynos4210_rng.c                           |      8 +-
 hw/misc/imx25_ccm.c                                |     12 +-
 hw/misc/imx31_ccm.c                                |     14 +-
 hw/misc/imx6_ccm.c                                 |     24 +-
 hw/misc/imx6_src.c                                 |      2 +-
 hw/misc/imx6ul_ccm.c                               |      4 +-
 hw/misc/imx7_ccm.c                                 |      8 +
 hw/misc/imx_ccm.c                                  |      6 +-
 hw/misc/iotkit-secctl.c                            |     50 +-
 hw/misc/iotkit-sysctl.c                            |    526 +-
 hw/misc/iotkit-sysinfo.c                           |     53 +-
 hw/misc/ivshmem.c                                  |     27 +-
 hw/misc/led.c                                      |    162 +
 hw/misc/mac_via.c                                  |    211 +-
 hw/misc/macio/Makefile.objs                        |      5 -
 hw/misc/macio/cuda.c                               |      6 +-
 hw/misc/macio/gpio.c                               |     24 +-
 hw/misc/macio/macio.c                              |     55 +-
 hw/misc/macio/meson.build                          |      8 +
 hw/misc/macio/pmu.c                                |      6 +-
 hw/misc/macio/trace.h                              |      1 +
 hw/misc/max111x.c                                  |     19 +-
 hw/misc/mchp_pfsoc_dmc.c                           |    216 +
 hw/misc/mchp_pfsoc_ioscb.c                         |    242 +
 hw/misc/mchp_pfsoc_sysreg.c                        |     99 +
 hw/misc/meson.build                                |    132 +
 hw/misc/milkymist-hpdmc.c                          |      7 +-
 hw/misc/milkymist-pfpu.c                           |      7 +-
 hw/misc/mips_cpc.c                                 |      3 +-
 hw/misc/mips_itu.c                                 |      2 +-
 hw/misc/mos6522.c                                  |     17 +-
 hw/misc/mps2-fpgaio.c                              |     96 +-
 hw/misc/mps2-scc.c                                 |    125 +-
 hw/misc/mst_fpga.c                                 |      8 +-
 hw/misc/npcm7xx_clk.c                              |   1095 +
 hw/misc/npcm7xx_gcr.c                              |    269 +
 hw/misc/npcm7xx_mft.c                              |    540 +
 hw/misc/npcm7xx_pwm.c                              |    569 +
 hw/misc/npcm7xx_rng.c                              |    180 +
 hw/misc/pc-testdev.c                               |      8 +-
 hw/misc/pca9552.c                                  |     12 +-
 hw/misc/pci-testdev.c                              |      8 +-
 hw/misc/puv3_pm.c                                  |      7 +-
 hw/misc/pvpanic-isa.c                              |     94 +
 hw/misc/pvpanic-pci.c                              |     94 +
 hw/misc/pvpanic.c                                  |     86 +-
 hw/misc/sbsa_ec.c                                  |     98 +
 hw/misc/sga.c                                      |      7 +-
 hw/misc/sifive_e_prci.c                            |    125 +
 hw/misc/sifive_test.c                              |    100 +
 hw/misc/sifive_u_otp.c                             |    297 +
 hw/misc/sifive_u_prci.c                            |    169 +
 hw/misc/slavio_misc.c                              |     15 +-
 hw/misc/stm32f2xx_syscfg.c                         |      2 -
 hw/misc/tmp105.c                                   |     73 +-
 hw/misc/tmp105.h                                   |     14 +-
 hw/misc/tmp421.c                                   |     45 +-
 hw/misc/trace-events                               |     63 +-
 hw/misc/trace.h                                    |      1 +
 hw/misc/tz-mpc.c                                   |     32 +-
 hw/misc/tz-ppc.c                                   |     14 +
 hw/misc/unimp.c                                    |     14 +-
 hw/misc/virt_ctrl.c                                |    151 +
 hw/misc/xlnx-versal-xramc.c                        |    253 +
 hw/misc/zynq_slcr.c                                |     19 +-
 hw/moxie/Makefile.objs                             |      2 -
 hw/moxie/meson.build                               |      4 +
 hw/moxie/moxiesim.c                                |     12 +-
 hw/net/Kconfig                                     |     16 +-
 hw/net/Makefile.objs                               |     59 -
 hw/net/allwinner-sun8i-emac.c                      |     88 +-
 hw/net/cadence_gem.c                               |     13 +-
 hw/net/can/Makefile.objs                           |      4 -
 hw/net/can/can_kvaser_pci.c                        |     10 +-
 hw/net/can/can_mioe3680_pci.c                      |     10 +-
 hw/net/can/can_pcm3680_pci.c                       |     10 +-
 hw/net/can/can_sja1000.c                           |     33 +-
 hw/net/can/ctu_can_fd_frame.h                      |    189 +
 hw/net/can/ctu_can_fd_regs.h                       |    971 +
 hw/net/can/ctucan_core.c                           |    687 +
 hw/net/can/ctucan_core.h                           |    126 +
 hw/net/can/ctucan_pci.c                            |    281 +
 hw/net/can/meson.build                             |      7 +
 hw/net/can/trace-events                            |      9 +
 hw/net/can/trace.h                                 |      1 +
 hw/net/can/xlnx-zynqmp-can.c                       |   1161 +
 hw/net/dp8393x.c                                   |     13 +-
 hw/net/e1000.c                                     |     34 +-
 hw/net/e1000e.c                                    |      9 +-
 hw/net/e1000e_core.c                               |     22 +-
 hw/net/e1000e_core.h                               |      2 +-
 hw/net/e1000x_common.c                             |      2 +-
 hw/net/e1000x_common.h                             |      2 +-
 hw/net/etraxfs_eth.c                               |      9 +-
 hw/net/fsl_etsec/etsec.c                           |      5 +-
 hw/net/fsl_etsec/etsec.h                           |      9 +-
 hw/net/fsl_etsec/rings.c                           |     25 +-
 hw/net/ftgmac100.c                                 |    108 +-
 hw/net/imx_fec.c                                   |     20 +-
 hw/net/lan9118.c                                   |     37 +-
 hw/net/mcf_fec.c                                   |      4 +-
 hw/net/meson.build                                 |     68 +
 hw/net/milkymist-minimac2.c                        |      7 +-
 hw/net/mipsnet.c                                   |      7 +-
 hw/net/msf2-emac.c                                 |      2 +-
 hw/net/ne2000-isa.c                                |      7 +-
 hw/net/net_tx_pkt.c                                |      2 +-
 hw/net/npcm7xx_emc.c                               |    859 +
 hw/net/opencores_eth.c                             |      7 +-
 hw/net/pcnet-pci.c                                 |      9 +-
 hw/net/pcnet.c                                     |      2 +-
 hw/net/rocker/rocker.c                             |     14 +-
 hw/net/rocker/rocker.h                             |      7 +-
 hw/net/rocker/rocker_fp.c                          |     17 +-
 hw/net/rocker/rocker_fp.h                          |      2 +-
 hw/net/rocker/rocker_of_dpa.c                      |     20 +-
 hw/net/rtl8139.c                                   |     11 +-
 hw/net/smc91c111.c                                 |      7 +-
 hw/net/spapr_llan.c                                |     14 +-
 hw/net/stellaris_enet.c                            |      8 +-
 hw/net/sungem.c                                    |      9 +-
 hw/net/sunhme.c                                    |      7 +-
 hw/net/trace-events                                |     17 +
 hw/net/trace.h                                     |      1 +
 hw/net/tulip.c                                     |      4 +-
 hw/net/tulip.h                                     |      3 +-
 hw/net/virtio-net.c                                |    334 +-
 hw/net/vmxnet3.c                                   |     12 +-
 hw/net/vmxnet3_defs.h                              |      9 +-
 hw/net/xen_nic.c                                   |      2 +-
 hw/net/xgmac.c                                     |      7 +-
 hw/net/xilinx_axienet.c                            |     78 +-
 hw/net/xilinx_ethlite.c                            |      5 +-
 hw/nios2/10m50_devboard.c                          |     13 +-
 hw/nios2/Makefile.objs                             |      3 -
 hw/nios2/boot.c                                    |     22 +-
 hw/nios2/cpu_pic.c                                 |     67 -
 hw/nios2/meson.build                               |      6 +
 hw/nubus/Makefile.objs                             |      4 -
 hw/nubus/meson.build                               |      7 +
 hw/nvram/Makefile.objs                             |      8 -
 hw/nvram/chrp_nvram.c                              |     24 +-
 hw/nvram/ds1225y.c                                 |      7 +-
 hw/nvram/eeprom93xx.c                              |      2 +-
 hw/nvram/eeprom_at24c.c                            |     10 +-
 hw/nvram/fw_cfg-interface.c                        |     23 +
 hw/nvram/fw_cfg.c                                  |     35 +-
 hw/nvram/mac_nvram.c                               |      2 +-
 hw/nvram/meson.build                               |     13 +
 hw/nvram/npcm7xx_otp.c                             |    440 +
 hw/nvram/nrf51_nvm.c                               |     10 +
 hw/nvram/spapr_nvram.c                             |     14 +-
 hw/nvram/trace.h                                   |      1 +
 hw/openrisc/Kconfig                                |      1 +
 hw/openrisc/Makefile.objs                          |      2 -
 hw/openrisc/meson.build                            |      5 +
 hw/openrisc/openrisc_sim.c                         |     46 +-
 hw/openrisc/pic_cpu.c                              |     61 -
 hw/pci-bridge/Kconfig                              |      2 +-
 hw/pci-bridge/Makefile.objs                        |     10 -
 hw/pci-bridge/dec.c                                |      7 +-
 hw/pci-bridge/gen_pcie_root_port.c                 |      9 +-
 hw/pci-bridge/i82801b11.c                          |      2 +-
 hw/pci-bridge/meson.build                          |     14 +
 hw/pci-bridge/pci_bridge_dev.c                     |      5 +-
 hw/pci-bridge/pci_expander_bridge.c                |     23 +-
 hw/pci-bridge/pcie_pci_bridge.c                    |      8 +-
 hw/pci-host/Kconfig                                |     12 +
 hw/pci-host/Makefile.objs                          |     24 -
 hw/pci-host/bonito.c                               |     26 +-
 hw/pci-host/designware.c                           |     21 +-
 hw/pci-host/gpex-acpi.c                            |    285 +
 hw/pci-host/grackle.c                              |     27 +-
 hw/pci-host/i440fx.c                               |     40 +-
 hw/pci-host/meson.build                            |     34 +
 hw/pci-host/pam.c                                  |      2 +-
 hw/pci-host/pnv_phb3.c                             |      5 +-
 hw/pci-host/pnv_phb4.c                             |     10 +-
 hw/pci-host/ppce500.c                              |     13 +-
 hw/pci-host/prep.c                                 |     26 +-
 hw/pci-host/q35.c                                  |      2 +-
 hw/pci-host/remote.c                               |     75 +
 hw/pci-host/sabre.c                                |     36 +-
 hw/pci-host/sh_pci.c                               |    204 +
 hw/pci-host/trace-events                           |      3 +
 hw/pci-host/trace.h                                |      1 +
 hw/pci-host/uninorth.c                             |     53 +-
 hw/pci-host/versatile.c                            |     14 +-
 hw/pci-host/xilinx-pcie.c                          |      2 +-
 hw/pci/Makefile.objs                               |     14 -
 hw/pci/meson.build                                 |     19 +
 hw/pci/msix.c                                      |      5 +-
 hw/pci/pci-stub.c                                  |      2 +-
 hw/pci/pci.c                                       |    143 +-
 hw/pci/pcie.c                                      |     28 +-
 hw/pci/shpc.c                                      |      6 +-
 hw/pci/trace.h                                     |      1 +
 hw/pcmcia/Makefile.objs                            |      2 -
 hw/pcmcia/meson.build                              |      2 +
 hw/pcmcia/pxa2xx.c                                 |      4 -
 hw/ppc/Kconfig                                     |     23 +-
 hw/ppc/Makefile.objs                               |     35 -
 hw/ppc/e500-ccsr.h                                 |      7 +-
 hw/ppc/e500.c                                      |     37 +-
 hw/ppc/e500.h                                      |     16 +-
 hw/ppc/e500plat.c                                  |      8 +-
 hw/ppc/mac.h                                       |     19 +-
 hw/ppc/mac_newworld.c                              |    111 +-
 hw/ppc/mac_oldworld.c                              |    164 +-
 hw/ppc/meson.build                                 |     82 +
 hw/ppc/mpc8544_guts.c                              |      4 +-
 hw/ppc/pef.c                                       |    140 +
 hw/ppc/pnv.c                                       |     37 +-
 hw/ppc/pnv_bmc.c                                   |     53 +-
 hw/ppc/pnv_core.c                                  |      2 +-
 hw/ppc/pnv_lpc.c                                   |     20 +-
 hw/ppc/pnv_pnor.c                                  |      3 +-
 hw/ppc/pnv_psi.c                                   |      2 +-
 hw/ppc/pnv_xscom.c                                 |      4 +-
 hw/ppc/ppc.c                                       |      8 +-
 hw/ppc/ppc405.h                                    |      8 +-
 hw/ppc/ppc405_boards.c                             |     25 +-
 hw/ppc/ppc405_uc.c                                 |    415 +-
 hw/ppc/ppc440_bamboo.c                             |     49 +-
 hw/ppc/ppc440_pcix.c                               |     58 +-
 hw/ppc/ppc440_uc.c                                 |      8 +-
 hw/ppc/ppc4xx_devs.c                               |    246 +-
 hw/ppc/ppc4xx_pci.c                                |     17 +-
 hw/ppc/ppc_booke.c                                 |      2 +-
 hw/ppc/ppce500_spin.c                              |      9 +-
 hw/ppc/prep.c                                      |      7 +-
 hw/ppc/prep_systemio.c                             |     16 +-
 hw/ppc/rs6000_mc.c                                 |     10 +-
 hw/ppc/sam460ex.c                                  |     90 +-
 hw/ppc/spapr.c                                     |    641 +-
 hw/ppc/spapr_caps.c                                |    107 +-
 hw/ppc/spapr_cpu_core.c                            |    111 +-
 hw/ppc/spapr_drc.c                                 |    143 +-
 hw/ppc/spapr_events.c                              |     33 +-
 hw/ppc/spapr_hcall.c                               |    117 +-
 hw/ppc/spapr_iommu.c                               |     22 +-
 hw/ppc/spapr_irq.c                                 |     16 +-
 hw/ppc/spapr_numa.c                                |    436 +
 hw/ppc/spapr_nvdimm.c                              |     88 +-
 hw/ppc/spapr_ovec.c                                |      7 +
 hw/ppc/spapr_pci.c                                 |    148 +-
 hw/ppc/spapr_pci_nvlink2.c                         |     20 +-
 hw/ppc/spapr_pci_vfio.c                            |      1 -
 hw/ppc/spapr_rng.c                                 |      5 +-
 hw/ppc/spapr_rtas.c                                |      6 +-
 hw/ppc/spapr_vio.c                                 |     19 +-
 hw/ppc/trace-events                                |     15 +-
 hw/ppc/trace.h                                     |      1 +
 hw/ppc/virtex_ml507.c                              |     29 +-
 hw/rdma/Makefile.objs                              |      3 -
 hw/rdma/meson.build                                |     10 +
 hw/rdma/rdma_backend.c                             |     28 +-
 hw/rdma/rdma_backend_defs.h                        |      2 +-
 hw/rdma/rdma_rm.c                                  |      2 +-
 hw/rdma/rdma_utils.c                               |     29 +-
 hw/rdma/rdma_utils.h                               |     15 +-
 hw/rdma/trace.h                                    |      1 +
 hw/rdma/vmw/pvrdma.h                               |     14 +-
 hw/rdma/vmw/pvrdma_cmd.c                           |      6 +-
 hw/rdma/vmw/pvrdma_dev_ring.c                      |     45 +-
 hw/rdma/vmw/pvrdma_dev_ring.h                      |      9 +-
 hw/rdma/vmw/pvrdma_main.c                          |      7 +-
 hw/rdma/vmw/trace.h                                |      1 +
 hw/remote/Kconfig                                  |      4 +
 hw/remote/iohub.c                                  |    119 +
 hw/remote/machine.c                                |     80 +
 hw/remote/memory.c                                 |     65 +
 hw/remote/meson.build                              |     13 +
 hw/remote/message.c                                |    230 +
 hw/remote/mpqemu-link.c                            |    267 +
 hw/remote/proxy-memory-listener.c                  |    227 +
 hw/remote/proxy.c                                  |    379 +
 hw/remote/remote-obj.c                             |    203 +
 hw/remote/trace-events                             |      4 +
 hw/remote/trace.h                                  |      1 +
 hw/riscv/Kconfig                                   |     77 +-
 hw/riscv/Makefile.objs                             |     16 -
 hw/riscv/boot.c                                    |    124 +-
 hw/riscv/meson.build                               |     12 +
 hw/riscv/microchip_pfsoc.c                         |    556 +
 hw/riscv/numa.c                                    |    242 +
 hw/riscv/opentitan.c                               |    138 +-
 hw/riscv/riscv_hart.c                              |      3 +
 hw/riscv/riscv_htif.c                              |    261 -
 hw/riscv/sifive_clint.c                            |    258 -
 hw/riscv/sifive_e.c                                |    119 +-
 hw/riscv/sifive_e_prci.c                           |    125 -
 hw/riscv/sifive_gpio.c                             |    397 -
 hw/riscv/sifive_plic.c                             |    522 -
 hw/riscv/sifive_test.c                             |    100 -
 hw/riscv/sifive_u.c                                |    433 +-
 hw/riscv/sifive_u_otp.c                            |    191 -
 hw/riscv/sifive_u_prci.c                           |    169 -
 hw/riscv/sifive_uart.c                             |    194 -
 hw/riscv/spike.c                                   |    293 +-
 hw/riscv/trace-events                              |      7 -
 hw/riscv/virt.c                                    |    701 +-
 hw/rtc/Makefile.objs                               |     15 -
 hw/rtc/ds1338.c                                    |      7 +-
 hw/rtc/exynos4210_rtc.c                            |     17 +-
 hw/rtc/goldfish_rtc.c                              |      4 +-
 hw/rtc/m41t80.c                                    |      7 +-
 hw/rtc/m48t59-isa.c                                |     46 +-
 hw/rtc/m48t59.c                                    |     54 +-
 hw/rtc/mc146818rtc.c                               |      1 +
 hw/rtc/meson.build                                 |     16 +
 hw/rtc/pl031.c                                     |      8 +
 hw/rtc/sun4v-rtc.c                                 |      7 +-
 hw/rtc/trace-events                                |      2 +-
 hw/rtc/trace.h                                     |      1 +
 hw/rtc/twl92230.c                                  |     53 +-
 hw/rx/Makefile.objs                                |      2 -
 hw/rx/meson.build                                  |      5 +
 hw/rx/rx-gdbsim.c                                  |     36 +-
 hw/rx/rx62n.c                                      |     22 +-
 hw/s390x/3270-ccw.c                                |      5 +-
 hw/s390x/Makefile.objs                             |     37 -
 hw/s390x/ap-device.c                               |      2 +-
 hw/s390x/ccw-device.h                              |     15 +-
 hw/s390x/css.c                                     |     28 +-
 hw/s390x/event-facility.c                          |      2 +-
 hw/s390x/ipl.c                                     |     19 +-
 hw/s390x/ipl.h                                     |      8 +-
 hw/s390x/meson.build                               |     56 +
 hw/s390x/pv.c                                      |     62 +
 hw/s390x/s390-pci-bus.c                            |    110 +-
 hw/s390x/s390-pci-bus.h                            |    376 -
 hw/s390x/s390-pci-inst.c                           |    137 +-
 hw/s390x/s390-pci-inst.h                           |    312 -
 hw/s390x/s390-pci-vfio.c                           |    274 +
 hw/s390x/s390-skeys.c                              |      8 +-
 hw/s390x/s390-virtio-ccw.c                         |     76 +-
 hw/s390x/sclp.c                                    |    137 +-
 hw/s390x/tod-kvm.c                                 |      2 +-
 hw/s390x/trace-events                              |      5 +
 hw/s390x/trace.h                                   |      1 +
 hw/s390x/vhost-user-fs-ccw.c                       |     75 +
 hw/s390x/vhost-vsock-ccw.c                         |     12 +
 hw/s390x/virtio-ccw-gpu.c                          |      4 +-
 hw/s390x/virtio-ccw-input.c                        |      2 +-
 hw/s390x/virtio-ccw.c                              |    107 +-
 hw/s390x/virtio-ccw.h                              |    117 +-
 hw/scsi/Makefile.objs                              |     15 -
 hw/scsi/esp-pci.c                                  |     80 +-
 hw/scsi/esp.c                                      |    996 +-
 hw/scsi/lsi53c895a.c                               |     18 +-
 hw/scsi/megasas.c                                  |     45 +-
 hw/scsi/meson.build                                |     26 +
 hw/scsi/mptconfig.c                                |      2 +-
 hw/scsi/mptendian.c                                |      2 +-
 hw/scsi/mptsas.c                                   |     18 +-
 hw/scsi/mptsas.h                                   |      8 +-
 hw/scsi/scsi-bus.c                                 |    309 +-
 hw/scsi/scsi-disk.c                                |    331 +-
 hw/scsi/scsi-generic.c                             |     68 +-
 hw/scsi/spapr_vscsi.c                              |     23 +-
 hw/scsi/trace-events                               |     18 +
 hw/scsi/trace.h                                    |      1 +
 hw/scsi/vhost-scsi-common.c                        |     27 +
 hw/scsi/vhost-scsi.c                               |      5 +-
 hw/scsi/vhost-user-scsi.c                          |      6 +-
 hw/scsi/virtio-scsi-dataplane.c                    |     32 +-
 hw/scsi/virtio-scsi.c                              |    127 +-
 hw/scsi/vmw_pvscsi.c                               |     62 +-
 hw/sd/Kconfig                                      |      4 +
 hw/sd/Makefile.objs                                |     12 -
 hw/sd/allwinner-sdhost.c                           |     67 +-
 hw/sd/aspeed_sdhci.c                               |     16 +-
 hw/sd/bcm2835_sdhost.c                             |     10 +-
 hw/sd/cadence_sdhci.c                              |    193 +
 hw/sd/core.c                                       |     54 +-
 hw/sd/meson.build                                  |     13 +
 hw/sd/milkymist-memcard.c                          |     78 +-
 hw/sd/omap_mmc.c                                   |     10 +-
 hw/sd/pl181.c                                      |    118 +-
 hw/sd/pxa2xx_mmci.c                                |     27 +-
 hw/sd/sd.c                                         |    286 +-
 hw/sd/sdhci.c                                      |    152 +-
 hw/sd/ssi-sd.c                                     |    204 +-
 hw/sd/trace-events                                 |     14 +-
 hw/sd/trace.h                                      |      1 +
 hw/semihosting/Kconfig                             |      3 -
 hw/semihosting/Makefile.objs                       |      2 -
 hw/semihosting/config.c                            |    187 -
 hw/semihosting/console.c                           |    180 -
 hw/sh4/Kconfig                                     |     12 +-
 hw/sh4/Makefile.objs                               |      4 -
 hw/sh4/meson.build                                 |      9 +
 hw/sh4/sh7750_regs.h                               |     24 +-
 hw/sh4/sh_pci.c                                    |    204 -
 hw/sh4/shix.c                                      |      3 +-
 hw/smbios/Makefile.objs                            |     10 -
 hw/smbios/meson.build                              |     13 +
 hw/smbios/smbios.c                                 |    131 +-
 hw/sparc/Kconfig                                   |      1 +
 hw/sparc/Makefile.objs                             |      3 -
 hw/sparc/leon3.c                                   |     26 +-
 hw/sparc/meson.build                               |      6 +
 hw/sparc/sun4m.c                                   |    130 +-
 hw/sparc/trace.h                                   |      1 +
 hw/sparc64/Makefile.objs                           |      4 -
 hw/sparc64/meson.build                             |      6 +
 hw/sparc64/sparc64.c                               |      3 +-
 hw/sparc64/sun4u.c                                 |     69 +-
 hw/sparc64/trace.h                                 |      1 +
 hw/ssi/Kconfig                                     |      4 +
 hw/ssi/Makefile.objs                               |     10 -
 hw/ssi/aspeed_smc.c                                |     82 +-
 hw/ssi/imx_spi.c                                   |    155 +-
 hw/ssi/meson.build                                 |     11 +
 hw/ssi/npcm7xx_fiu.c                               |    572 +
 hw/ssi/pl022.c                                     |      2 +-
 hw/ssi/sifive_spi.c                                |    358 +
 hw/ssi/ssi.c                                       |     51 +-
 hw/ssi/trace-events                                |     11 +
 hw/ssi/trace.h                                     |      1 +
 hw/ssi/xilinx_spi.c                                |      9 +-
 hw/ssi/xilinx_spips.c                              |     42 +-
 hw/timer/Kconfig                                   |     10 +
 hw/timer/Makefile.objs                             |     41 -
 hw/timer/allwinner-a10-pit.c                       |     11 +
 hw/timer/altera_timer.c                            |      8 +-
 hw/timer/arm_timer.c                               |     21 +-
 hw/timer/armv7m_systick.c                          |    132 +-
 hw/timer/bcm2835_systmr.c                          |     57 +-
 hw/timer/cadence_ttc.c                             |      8 +-
 hw/timer/cmsdk-apb-dualtimer.c                     |     54 +-
 hw/timer/cmsdk-apb-timer.c                         |     55 +-
 hw/timer/digic-timer.c                             |      8 +
 hw/timer/etraxfs_timer.c                           |     12 +-
 hw/timer/exynos4210_mct.c                          |     26 +-
 hw/timer/exynos4210_pwm.c                          |     27 +-
 hw/timer/grlib_gptimer.c                           |      5 +-
 hw/timer/hpet.c                                    |     36 +-
 hw/timer/i8254.c                                   |     12 +-
 hw/timer/lm32_timer.c                              |      6 +-
 hw/timer/meson.build                               |     40 +
 hw/timer/milkymist-sysctl.c                        |      7 +-
 hw/timer/mss-timer.c                               |     13 +
 hw/timer/npcm7xx_timer.c                           |    714 +
 hw/timer/puv3_ost.c                                |      7 +-
 hw/timer/pxa2xx_timer.c                            |      5 +-
 hw/timer/renesas_tmr.c                             |     38 +-
 hw/timer/sh_timer.c                                |     90 +-
 hw/timer/slavio_timer.c                            |     12 +-
 hw/timer/sse-counter.c                             |    474 +
 hw/timer/sse-timer.c                               |    471 +
 hw/timer/trace-events                              |     24 +-
 hw/timer/trace.h                                   |      1 +
 hw/timer/xilinx_timer.c                            |      5 +-
 hw/tpm/Makefile.objs                               |      6 -
 hw/tpm/meson.build                                 |      8 +
 hw/tpm/tpm_crb.c                                   |      9 +-
 hw/tpm/tpm_prop.h                                  |      4 +-
 hw/tpm/tpm_spapr.c                                 |     18 +-
 hw/tpm/tpm_tis_isa.c                               |      8 +-
 hw/tpm/tpm_tis_sysbus.c                            |      8 +-
 hw/tpm/trace-events                                |      3 +-
 hw/tpm/trace.h                                     |      1 +
 hw/tricore/Kconfig                                 |      8 +
 hw/tricore/Makefile.objs                           |      1 -
 hw/tricore/meson.build                             |      6 +
 hw/tricore/tc27x_soc.c                             |    246 +
 hw/tricore/triboard.c                              |     98 +
 hw/tricore/tricore_testboard.c                     |      2 +-
 hw/unicore32/Makefile.objs                         |      4 -
 hw/unicore32/meson.build                           |      5 +
 hw/usb/Kconfig                                     |     39 +-
 hw/usb/Makefile.objs                               |     71 -
 hw/usb/bus.c                                       |     59 +-
 hw/usb/ccid-card-emulated.c                        |     64 +-
 hw/usb/ccid-card-passthru.c                        |      8 +-
 hw/usb/ccid.h                                      |     13 +-
 hw/usb/core.c                                      |     23 +-
 hw/usb/dev-audio.c                                 |      8 +-
 hw/usb/dev-hid.c                                   |     33 +-
 hw/usb/dev-hub.c                                   |      8 +-
 hw/usb/dev-mtp.c                                   |      3 +-
 hw/usb/dev-network.c                               |      7 +-
 hw/usb/dev-serial.c                                |    346 +-
 hw/usb/dev-smartcard-reader.c                      |     27 +-
 hw/usb/dev-storage-bot.c                           |     63 +
 hw/usb/dev-storage-classic.c                       |    156 +
 hw/usb/dev-storage.c                               |    279 +-
 hw/usb/dev-uas.c                                   |     22 +-
 hw/usb/dev-wacom.c                                 |     19 +-
 hw/usb/hcd-dwc2.c                                  |    114 +-
 hw/usb/hcd-dwc2.h                                  |      8 +-
 hw/usb/hcd-dwc3.c                                  |    689 +
 hw/usb/hcd-ehci-sysbus.c                           |     28 +
 hw/usb/hcd-ehci.c                                  |     54 +-
 hw/usb/hcd-ehci.h                                  |     30 +-
 hw/usb/hcd-ohci-pci.c                              |      8 +-
 hw/usb/hcd-ohci.c                                  |     32 +-
 hw/usb/hcd-ohci.h                                  |      7 +-
 hw/usb/hcd-uhci.c                                  |     84 +-
 hw/usb/hcd-uhci.h                                  |     93 +
 hw/usb/hcd-xhci-nec.c                              |     41 +-
 hw/usb/hcd-xhci-pci.c                              |    259 +
 hw/usb/hcd-xhci-pci.h                              |     44 +
 hw/usb/hcd-xhci-sysbus.c                           |    121 +
 hw/usb/hcd-xhci-sysbus.h                           |     31 +
 hw/usb/hcd-xhci.c                                  |    320 +-
 hw/usb/hcd-xhci.h                                  |     50 +-
 hw/usb/host-libusb.c                               |     80 +-
 hw/usb/meson.build                                 |     85 +
 hw/usb/pcap.c                                      |    253 +
 hw/usb/redirect.c                                  |     17 +-
 hw/usb/trace-events                                |     29 +-
 hw/usb/trace.h                                     |      1 +
 hw/usb/tusb6010.c                                  |     11 +-
 hw/usb/u2f-emulated.c                              |    405 +
 hw/usb/u2f-passthru.c                              |    552 +
 hw/usb/u2f.c                                       |    351 +
 hw/usb/u2f.h                                       |     92 +
 hw/usb/vt82c686-uhci-pci.c                         |     43 +
 hw/usb/xlnx-usb-subsystem.c                        |     94 +
 hw/usb/xlnx-versal-usb2-ctrl-regs.c                |    229 +
 hw/vfio/Makefile.objs                              |      8 -
 hw/vfio/ap.c                                       |     17 +-
 hw/vfio/ccw.c                                      |     57 +-
 hw/vfio/common.c                                   |    585 +-
 hw/vfio/display.c                                  |      7 +-
 hw/vfio/igd.c                                      |      2 +-
 hw/vfio/meson.build                                |     19 +
 hw/vfio/migration.c                                |    904 +
 hw/vfio/pci-quirks.c                               |     35 +-
 hw/vfio/pci.c                                      |    142 +-
 hw/vfio/pci.h                                      |     11 +-
 hw/vfio/platform.c                                 |      9 +-
 hw/vfio/trace-events                               |     33 +-
 hw/vfio/trace.h                                    |      1 +
 hw/virtio/Makefile.objs                            |     48 -
 hw/virtio/meson.build                              |     51 +
 hw/virtio/trace-events                             |     44 +-
 hw/virtio/trace.h                                  |      1 +
 hw/virtio/vhost-backend.c                          |     91 +-
 hw/virtio/vhost-scsi-pci.c                         |     14 +-
 hw/virtio/vhost-user-blk-pci.c                     |      9 +-
 hw/virtio/vhost-user-fs-pci.c                      |      7 +-
 hw/virtio/vhost-user-fs.c                          |     31 +-
 hw/virtio/vhost-user-input-pci.c                   |      5 +-
 hw/virtio/vhost-user-scsi-pci.c                    |     14 +-
 hw/virtio/vhost-user-vsock-pci.c                   |      9 +-
 hw/virtio/vhost-user-vsock.c                       |      1 +
 hw/virtio/vhost-user.c                             |    224 +-
 hw/virtio/vhost-vdpa.c                             |    178 +-
 hw/virtio/vhost-vsock-common.c                     |      1 -
 hw/virtio/vhost-vsock-pci.c                        |     15 +-
 hw/virtio/vhost-vsock.c                            |     12 +-
 hw/virtio/vhost.c                                  |    110 +-
 hw/virtio/virtio-9p-pci.c                          |     10 +-
 hw/virtio/virtio-balloon-pci.c                     |     16 +-
 hw/virtio/virtio-balloon.c                         |     14 +-
 hw/virtio/virtio-blk-pci.c                         |     12 +-
 hw/virtio/virtio-crypto-pci.c                      |      5 +-
 hw/virtio/virtio-crypto.c                          |     17 +-
 hw/virtio/virtio-input-host-pci.c                  |      5 +-
 hw/virtio/virtio-input-pci.c                       |      9 +-
 hw/virtio/virtio-iommu-pci.c                       |      8 +-
 hw/virtio/virtio-iommu.c                           |    233 +-
 hw/virtio/virtio-mem-pci.c                         |      8 +
 hw/virtio/virtio-mem-pci.h                         |      5 +-
 hw/virtio/virtio-mem.c                             |    118 +-
 hw/virtio/virtio-mmio.c                            |    101 +-
 hw/virtio/virtio-net-pci.c                         |     15 +-
 hw/virtio/virtio-pci.c                             |    118 +-
 hw/virtio/virtio-pci.h                             |     41 +-
 hw/virtio/virtio-pmem-pci.c                        |      1 +
 hw/virtio/virtio-pmem-pci.h                        |      5 +-
 hw/virtio/virtio-pmem.c                            |      8 +-
 hw/virtio/virtio-rng-pci.c                         |      5 +-
 hw/virtio/virtio-rng.c                             |      3 +-
 hw/virtio/virtio-scsi-pci.c                        |     14 +-
 hw/virtio/virtio-serial-pci.c                      |      5 +-
 hw/virtio/virtio.c                                 |     56 +-
 hw/watchdog/Kconfig                                |      3 +
 hw/watchdog/Makefile.objs                          |      7 -
 hw/watchdog/cmsdk-apb-watchdog.c                   |     30 +-
 hw/watchdog/meson.build                            |      8 +
 hw/watchdog/sbsa_gwdt.c                            |    293 +
 hw/watchdog/trace.h                                |      1 +
 hw/watchdog/wdt_diag288.c                          |      3 -
 hw/watchdog/wdt_i6300esb.c                         |      6 +-
 hw/watchdog/wdt_ib700.c                            |      9 +-
 hw/xen/Makefile.objs                               |      7 -
 hw/xen/meson.build                                 |     20 +
 hw/xen/trace.h                                     |      1 +
 hw/xen/xen-backend.c                               |     11 +
 hw/xen/xen-bus.c                                   |     40 +-
 hw/xen/xen_pt.c                                    |     11 +-
 hw/xen/xen_pt.h                                    |      5 +-
 hw/xen/xen_pt_config_init.c                        |      6 +-
 hw/xen/xen_pt_load_rom.c                           |     14 +-
 hw/xen/xen_pt_msi.c                                |     16 +-
 hw/xen/xen_pvdev.c                                 |      2 +-
 hw/xenpv/Makefile.objs                             |      2 -
 hw/xenpv/meson.build                               |      3 +
 hw/xtensa/Makefile.objs                            |      6 -
 hw/xtensa/meson.build                              |     11 +
 hw/xtensa/pic_cpu.c                                |     10 +-
 hw/xtensa/sim.c                                    |      3 +-
 hw/xtensa/xtfpga.c                                 |     12 +-
 include/authz/base.h                               |     17 +-
 include/authz/list.h                               |     19 +-
 include/authz/listfile.h                           |     21 +-
 include/authz/pamacct.h                            |     19 +-
 include/authz/simple.h                             |     19 +-
 include/block/aio-wait.h                           |      4 +-
 include/block/aio.h                                |     18 +-
 include/block/block-copy.h                         |     61 +-
 include/block/block.h                              |    144 +-
 include/block/block_int.h                          |    164 +-
 include/block/blockjob.h                           |      2 +-
 include/block/blockjob_int.h                       |      2 +
 include/block/dirty-bitmap.h                       |      3 +-
 include/block/export.h                             |     89 +
 include/block/fuse.h                               |     30 +
 include/block/nbd.h                                |     37 +-
 include/block/nvme.h                               |    735 +-
 include/block/snapshot.h                           |     24 +-
 include/block/throttle-groups.h                    |      5 +-
 include/chardev/char-fd.h                          |      9 +-
 include/chardev/char-win.h                         |      9 +-
 include/chardev/char.h                             |     19 +-
 include/chardev/spice.h                            |     13 +-
 include/crypto/aes.h                               |      4 -
 include/crypto/block.h                             |      2 -
 include/crypto/cipher.h                            |      4 +-
 include/crypto/secret.h                            |      6 +-
 include/crypto/secret_common.h                     |     12 +-
 include/crypto/secret_keyring.h                    |     24 +-
 include/crypto/tls-cipher-suites.h                 |      9 +-
 include/crypto/tlscreds.h                          |      8 +-
 include/crypto/tlscredsanon.h                      |      7 +-
 include/crypto/tlscredspsk.h                       |      7 +-
 include/crypto/tlscredsx509.h                      |      7 +-
 include/disas/dis-asm.h                            |    109 +-
 include/disas/disas.h                              |      2 +-
 include/elf.h                                      |     28 +-
 include/exec/confidential-guest-support.h          |     62 +
 include/exec/cpu-all.h                             |     99 +-
 include/exec/cpu-common.h                          |      8 +-
 include/exec/cpu-defs.h                            |      5 +-
 include/exec/cpu_ldst.h                            |     41 +-
 include/exec/cputlb.h                              |      2 +-
 include/exec/exec-all.h                            |     93 +-
 include/exec/gdbstub.h                             |     34 +-
 include/exec/gen-icount.h                          |     29 +-
 include/exec/helper-proto.h                        |      4 +
 include/exec/hwaddr.h                              |      5 +
 include/exec/ioport.h                              |      2 +-
 include/exec/log.h                                 |     10 +-
 include/exec/memory.h                              |    276 +-
 include/exec/memory_ldst.h.inc                     |     71 +
 include/exec/memory_ldst.inc.h                     |     71 -
 include/exec/memory_ldst_cached.h.inc              |    111 +
 include/exec/memory_ldst_cached.inc.h              |    108 -
 include/exec/memory_ldst_phys.h.inc                |    147 +
 include/exec/memory_ldst_phys.inc.h                |    147 -
 include/exec/page-vary.h                           |     34 +
 include/exec/plugin-gen.h                          |      4 +-
 include/exec/poison.h                              |      5 +-
 include/exec/ram_addr.h                            |     33 +-
 include/exec/ramlist.h                             |      2 +-
 include/exec/tb-context.h                          |      3 +-
 include/exec/tb-hash.h                             |      2 +-
 include/exec/tb-lookup.h                           |     28 +-
 include/exec/translate-all.h                       |     39 +
 include/exec/translator.h                          |      2 +-
 include/exec/user/thunk.h                          |      5 +-
 include/fpu/softfloat-helpers.h                    |     10 +
 include/fpu/softfloat-types.h                      |     13 +-
 include/fpu/softfloat.h                            |    235 +
 include/glib-compat.h                              |     28 +
 include/hw/acpi/acpi-defs.h                        |      2 +-
 include/hw/acpi/acpi.h                             |      6 +-
 include/hw/acpi/acpi_dev_interface.h               |     15 +-
 include/hw/acpi/aml-build.h                        |     40 +-
 include/hw/acpi/cpu.h                              |      3 +
 include/hw/acpi/generic_event_device.h             |     25 +-
 include/hw/acpi/ghes.h                             |      3 +-
 include/hw/acpi/ich9.h                             |      3 +-
 include/hw/acpi/pci.h                              |      4 +-
 include/hw/acpi/pcihp.h                            |     13 +-
 include/hw/acpi/utils.h                            |      3 +-
 include/hw/acpi/vmgenid.h                          |     15 +-
 include/hw/adc/npcm7xx_adc.h                       |     69 +
 include/hw/adc/stm32f2xx_adc.h                     |      8 +-
 include/hw/arm/allwinner-a10.h                     |      7 +-
 include/hw/arm/allwinner-h3.h                      |     68 +-
 include/hw/arm/armsse-version.h                    |     42 +
 include/hw/arm/armsse.h                            |     74 +-
 include/hw/arm/armv7m.h                            |     15 +-
 include/hw/arm/aspeed.h                            |     14 +-
 include/hw/arm/aspeed_soc.h                        |    110 +-
 include/hw/arm/bcm2835_peripherals.h               |     15 +-
 include/hw/arm/bcm2836.h                           |     20 +-
 include/hw/arm/digic.h                             |      7 +-
 include/hw/arm/exynos4210.h                        |      8 +-
 include/hw/arm/fsl-imx25.h                         |     11 +-
 include/hw/arm/fsl-imx31.h                         |      9 +-
 include/hw/arm/fsl-imx6.h                          |      9 +-
 include/hw/arm/fsl-imx6ul.h                        |      9 +-
 include/hw/arm/fsl-imx7.h                          |      9 +-
 include/hw/arm/linux-boot-if.h                     |     11 +-
 include/hw/arm/msf2-soc.h                          |      7 +-
 include/hw/arm/npcm7xx.h                           |    139 +
 include/hw/arm/nrf51_soc.h                         |      8 +-
 include/hw/arm/omap.h                              |     18 +-
 include/hw/arm/pxa.h                               |     18 +-
 include/hw/arm/raspi_platform.h                    |     56 +-
 include/hw/arm/smmu-common.h                       |     34 +-
 include/hw/arm/smmuv3.h                            |     16 +-
 include/hw/arm/stm32f205_soc.h                     |      8 +-
 include/hw/arm/stm32f405_soc.h                     |      8 +-
 include/hw/arm/virt.h                              |     35 +-
 include/hw/arm/xlnx-versal.h                       |     29 +-
 include/hw/arm/xlnx-zynqmp.h                       |     25 +-
 include/hw/block/block.h                           |      1 +
 include/hw/block/flash.h                           |      9 +-
 include/hw/block/swim.h                            |     14 +-
 include/hw/boards.h                                |     64 +-
 include/hw/char/avr_usart.h                        |      8 +-
 include/hw/char/bcm2835_aux.h                      |      7 +-
 include/hw/char/cadence_uart.h                     |     25 +-
 include/hw/char/cmsdk-apb-uart.h                   |      8 +-
 include/hw/char/digic-uart.h                       |      8 +-
 include/hw/char/escc.h                             |      7 +-
 include/hw/char/goldfish_tty.h                     |     35 +
 include/hw/char/ibex_uart.h                        |     12 +-
 include/hw/char/imx_serial.h                       |      7 +-
 include/hw/char/mchp_pfsoc_mmuart.h                |     61 +
 include/hw/char/nrf51_uart.h                       |      7 +-
 include/hw/char/pl011.h                            |      9 +-
 include/hw/char/renesas_sci.h                      |      9 +-
 include/hw/char/riscv_htif.h                       |     59 +
 include/hw/char/serial.h                           |     25 +-
 include/hw/char/sifive_uart.h                      |     79 +
 include/hw/char/stm32f2xx_usart.h                  |      8 +-
 include/hw/clock.h                                 |    180 +-
 include/hw/core/accel-cpu.h                        |     38 +
 include/hw/core/cpu.h                              |    131 +-
 include/hw/core/generic-loader.h                   |      8 +-
 include/hw/core/split-irq.h                        |      3 +-
 include/hw/core/tcg-cpu-ops.h                      |    106 +
 include/hw/cpu/a15mpcore.h                         |      8 +-
 include/hw/cpu/a9mpcore.h                          |      8 +-
 include/hw/cpu/arm11mpcore.h                       |      8 +-
 include/hw/cpu/cluster.h                           |      8 +-
 include/hw/cpu/core.h                              |      8 +-
 include/hw/cris/etraxfs.h                          |      2 +-
 include/hw/display/bcm2835_fb.h                    |      7 +-
 include/hw/display/dpcd.h                          |      4 +-
 include/hw/display/edid.h                          |      5 +-
 include/hw/display/i2c-ddc.h                       |      4 +-
 include/hw/display/macfb.h                         |     26 +-
 include/hw/display/milkymist_tmu2.h                |      2 +-
 include/hw/display/xlnx_dp.h                       |      7 +-
 include/hw/dma/bcm2835_dma.h                       |      8 +-
 include/hw/dma/i8257.h                             |      6 +-
 include/hw/dma/pl080.h                             |     14 +-
 include/hw/dma/sifive_pdma.h                       |     57 +
 include/hw/dma/xlnx-zdma.h                         |      8 +-
 include/hw/dma/xlnx-zynq-devcfg.h                  |      8 +-
 include/hw/dma/xlnx_csu_dma.h                      |     52 +
 include/hw/dma/xlnx_dpdma.h                        |      4 +-
 include/hw/elf_ops.h                               |     11 +-
 include/hw/fw-path-provider.h                      |     11 +-
 include/hw/gpio/aspeed_gpio.h                      |     15 +-
 include/hw/gpio/bcm2835_gpio.h                     |      8 +-
 include/hw/gpio/imx_gpio.h                         |      7 +-
 include/hw/gpio/npcm7xx_gpio.h                     |     55 +
 include/hw/gpio/nrf51_gpio.h                       |      7 +-
 include/hw/gpio/sifive_gpio.h                      |     79 +
 include/hw/hotplug.h                               |     11 +-
 include/hw/hyperv/vmbus-bridge.h                   |     10 +-
 include/hw/hyperv/vmbus.h                          |     17 +-
 include/hw/i2c/arm_sbcon_i2c.h                     |     10 +-
 include/hw/i2c/aspeed_i2c.h                        |     16 +-
 include/hw/i2c/i2c.h                               |     20 +-
 include/hw/i2c/imx_i2c.h                           |      7 +-
 include/hw/i2c/microbit_i2c.h                      |      8 +-
 include/hw/i2c/npcm7xx_smbus.h                     |    113 +
 include/hw/i2c/ppc4xx_i2c.h                        |      7 +-
 include/hw/i2c/smbus_slave.h                       |     15 +-
 include/hw/i386/apic_internal.h                    |     19 +-
 include/hw/i386/ich9.h                             |     15 +-
 include/hw/i386/intel_iommu.h                      |      5 +-
 include/hw/i386/ioapic.h                           |      4 +-
 include/hw/i386/ioapic_internal.h                  |     19 +-
 include/hw/i386/microvm.h                          |     65 +-
 include/hw/i386/pc.h                               |     36 +-
 include/hw/i386/topology.h                         |    101 -
 include/hw/i386/vmport.h                           |      2 +-
 include/hw/i386/x86-iommu.h                        |     10 +-
 include/hw/i386/x86.h                              |     57 +-
 include/hw/ide/ahci.h                              |     15 +-
 include/hw/ide/internal.h                          |     38 +-
 include/hw/ide/pci.h                               |      7 +-
 include/hw/input/adb.h                             |     14 +-
 include/hw/input/i8042.h                           |      3 +-
 include/hw/input/tsc2xxx.h                         |      8 +-
 include/hw/intc/allwinner-a10-pic.h                |      7 +-
 include/hw/intc/arm_gic.h                          |     15 +-
 include/hw/intc/arm_gic_common.h                   |     21 +-
 include/hw/intc/arm_gicv3.h                        |     14 +-
 include/hw/intc/arm_gicv3_common.h                 |     17 +-
 include/hw/intc/arm_gicv3_its_common.h             |     11 +-
 include/hw/intc/armv7m_nvic.h                      |     12 +-
 include/hw/intc/aspeed_vic.h                       |      7 +-
 include/hw/intc/bcm2835_ic.h                       |      7 +-
 include/hw/intc/bcm2836_control.h                  |      8 +-
 include/hw/intc/goldfish_pic.h                     |     33 +
 include/hw/intc/heathrow_pic.h                     |      7 +-
 include/hw/intc/ibex_plic.h                        |     10 +-
 include/hw/intc/imx_avic.h                         |      7 +-
 include/hw/intc/imx_gpcv2.h                        |      7 +-
 include/hw/intc/intc.h                             |     11 +-
 include/hw/intc/loongson_liointc.h                 |     22 +
 include/hw/intc/m68k_irqc.h                        |     41 +
 include/hw/intc/mips_gic.h                         |      4 +-
 include/hw/intc/ppc-uic.h                          |     80 +
 include/hw/intc/realview_gic.h                     |      8 +-
 include/hw/intc/rx_icu.h                           |      4 +-
 include/hw/intc/sifive_clint.h                     |     60 +
 include/hw/intc/sifive_plic.h                      |     84 +
 include/hw/intc/xlnx-pmu-iomod-intc.h              |      8 +-
 include/hw/intc/xlnx-zynqmp-ipi.h                  |      8 +-
 include/hw/ipack/ipack.h                           |     14 +-
 include/hw/ipmi/ipmi.h                             |     35 +-
 include/hw/isa/i8259_internal.h                    |     14 +-
 include/hw/isa/isa.h                               |     25 +-
 include/hw/isa/pc87312.h                           |      9 +-
 include/hw/isa/superio.h                           |     19 +-
 include/hw/isa/vt82c686.h                          |     13 +-
 include/hw/kvm/clock.h                             |      4 +-
 include/hw/loader-fit.h                            |      2 +-
 include/hw/loader.h                                |     31 +
 include/hw/m68k/mcf.h                              |      3 +-
 include/hw/m68k/mcf_fec.h                          |      3 +-
 include/hw/m68k/next-cube.h                        |     15 +-
 include/hw/mem/memory-device.h                     |     23 +-
 include/hw/mem/npcm7xx_mc.h                        |     36 +
 include/hw/mem/nvdimm.h                            |     11 +-
 include/hw/mem/pc-dimm.h                           |     19 +-
 include/hw/mem/sparse-mem.h                        |     19 +
 include/hw/mips/bootloader.h                       |     22 +
 include/hw/mips/cps.h                              |     11 +-
 include/hw/mips/cpudevs.h                          |      7 -
 include/hw/mips/mips.h                             |      4 +-
 include/hw/misc/a9scu.h                            |      7 +-
 include/hw/misc/allwinner-cpucfg.h                 |      7 +-
 include/hw/misc/allwinner-h3-ccu.h                 |      7 +-
 include/hw/misc/allwinner-h3-dramc.h               |      7 +-
 include/hw/misc/allwinner-h3-sysctrl.h             |      7 +-
 include/hw/misc/allwinner-sid.h                    |      7 +-
 include/hw/misc/arm11scu.h                         |      7 +-
 include/hw/misc/arm_integrator_debug.h             |      2 +-
 include/hw/misc/armsse-cpu-pwrctrl.h               |     40 +
 include/hw/misc/armsse-cpuid.h                     |      9 +-
 include/hw/misc/armsse-mhu.h                       |      9 +-
 include/hw/misc/aspeed_lpc.h                       |     47 +
 include/hw/misc/aspeed_scu.h                       |     16 +-
 include/hw/misc/aspeed_sdmc.h                      |     28 +-
 include/hw/misc/aspeed_xdma.h                      |      9 +-
 include/hw/misc/auxbus.h                           |     11 +-
 include/hw/misc/avr_power.h                        |      7 +-
 include/hw/misc/bcm2835_cprman.h                   |    210 +
 include/hw/misc/bcm2835_cprman_internals.h         |   1019 +
 include/hw/misc/bcm2835_mbox.h                     |      8 +-
 include/hw/misc/bcm2835_mphi.h                     |      4 +-
 include/hw/misc/bcm2835_property.h                 |      8 +-
 include/hw/misc/bcm2835_rng.h                      |      8 +-
 include/hw/misc/bcm2835_thermal.h                  |      8 +-
 include/hw/misc/emc141x_regs.h                     |     37 +
 include/hw/misc/grlib_ahb_apb_pnp.h                |     13 +-
 include/hw/misc/imx25_ccm.h                        |      7 +-
 include/hw/misc/imx31_ccm.h                        |      7 +-
 include/hw/misc/imx6_ccm.h                         |      7 +-
 include/hw/misc/imx6_src.h                         |      7 +-
 include/hw/misc/imx6ul_ccm.h                       |      7 +-
 include/hw/misc/imx7_ccm.h                         |     13 +-
 include/hw/misc/imx7_gpr.h                         |      7 +-
 include/hw/misc/imx7_snvs.h                        |      7 +-
 include/hw/misc/imx_ccm.h                          |     16 +-
 include/hw/misc/imx_rngc.h                         |      7 +-
 include/hw/misc/iotkit-secctl.h                    |      8 +-
 include/hw/misc/iotkit-sysctl.h                    |     23 +-
 include/hw/misc/iotkit-sysinfo.h                   |     12 +-
 include/hw/misc/led.h                              |     98 +
 include/hw/misc/mac_via.h                          |     29 +-
 include/hw/misc/macio/cuda.h                       |     14 +-
 include/hw/misc/macio/gpio.h                       |      9 +-
 include/hw/misc/macio/macio.h                      |     37 +-
 include/hw/misc/macio/pmu.h                        |     14 +-
 include/hw/misc/max111x.h                          |     10 +-
 include/hw/misc/mchp_pfsoc_dmc.h                   |     56 +
 include/hw/misc/mchp_pfsoc_ioscb.h                 |     50 +
 include/hw/misc/mchp_pfsoc_sysreg.h                |     39 +
 include/hw/misc/mips_cmgcr.h                       |      4 +-
 include/hw/misc/mips_cpc.h                         |      9 +-
 include/hw/misc/mips_itu.h                         |      9 +-
 include/hw/misc/mos6522.h                          |     15 +-
 include/hw/misc/mps2-fpgaio.h                      |     17 +-
 include/hw/misc/mps2-scc.h                         |     19 +-
 include/hw/misc/msf2-sysreg.h                      |      7 +-
 include/hw/misc/npcm7xx_clk.h                      |    180 +
 include/hw/misc/npcm7xx_gcr.h                      |     43 +
 include/hw/misc/npcm7xx_mft.h                      |     70 +
 include/hw/misc/npcm7xx_pwm.h                      |    107 +
 include/hw/misc/npcm7xx_rng.h                      |     34 +
 include/hw/misc/nrf51_rng.h                        |      7 +-
 include/hw/misc/pca9552.h                          |      9 +-
 include/hw/misc/pvpanic.h                          |     24 +-
 include/hw/misc/sifive_e_prci.h                    |     73 +
 include/hw/misc/sifive_test.h                      |     47 +
 include/hw/misc/sifive_u_otp.h                     |     87 +
 include/hw/misc/sifive_u_prci.h                    |     93 +
 include/hw/misc/stm32f2xx_syscfg.h                 |     10 +-
 include/hw/misc/stm32f4xx_exti.h                   |      8 +-
 include/hw/misc/stm32f4xx_syscfg.h                 |      8 +-
 include/hw/misc/tz-mpc.h                           |      4 +-
 include/hw/misc/tz-msc.h                           |      7 +-
 include/hw/misc/tz-ppc.h                           |      4 +-
 include/hw/misc/unimp.h                            |      9 +-
 include/hw/misc/virt_ctrl.h                        |     22 +
 include/hw/misc/vmcoreinfo.h                       |     11 +-
 include/hw/misc/xlnx-versal-xramc.h                |     97 +
 include/hw/misc/zynq-xadc.h                        |     10 +-
 include/hw/net/allwinner-sun8i-emac.h              |     13 +-
 include/hw/net/allwinner_emac.h                    |      7 +-
 include/hw/net/cadence_gem.h                       |      9 +-
 include/hw/net/ftgmac100.h                         |     13 +-
 include/hw/net/imx_fec.h                           |      7 +-
 include/hw/net/lance.h                             |     10 +-
 include/hw/net/lasi_82596.h                        |     10 +-
 include/hw/net/msf2-emac.h                         |      8 +-
 include/hw/net/npcm7xx_emc.h                       |    286 +
 include/hw/net/xlnx-zynqmp-can.h                   |     78 +
 include/hw/nmi.h                                   |     11 +-
 include/hw/nubus/mac-nubus-bridge.h                |      8 +-
 include/hw/nubus/nubus.h                           |     15 +-
 include/hw/nvram/chrp_nvram.h                      |      3 +-
 include/hw/nvram/fw_cfg.h                          |     27 +-
 include/hw/nvram/npcm7xx_otp.h                     |     79 +
 include/hw/nvram/nrf51_nvm.h                       |      7 +-
 include/hw/or-irq.h                                |      3 +-
 include/hw/pci-bridge/simba.h                      |      8 +-
 include/hw/pci-host/designware.h                   |     14 +-
 include/hw/pci-host/gpex.h                         |     27 +-
 include/hw/pci-host/i440fx.h                       |     10 +-
 include/hw/pci-host/pam.h                          |      2 +
 include/hw/pci-host/pnv_phb3.h                     |     17 +-
 include/hw/pci-host/pnv_phb4.h                     |     18 +-
 include/hw/pci-host/q35.h                          |     17 +-
 include/hw/pci-host/remote.h                       |     30 +
 include/hw/pci-host/sabre.h                        |     15 +-
 include/hw/pci-host/spapr.h                        |     11 +-
 include/hw/pci-host/uninorth.h                     |     31 +-
 include/hw/pci-host/xilinx-pcie.h                  |     17 +-
 include/hw/pci/pci.h                               |     75 +-
 include/hw/pci/pci_bridge.h                        |      3 +-
 include/hw/pci/pci_bus.h                           |      4 +-
 include/hw/pci/pci_host.h                          |     12 +-
 include/hw/pci/pci_ids.h                           |      6 +-
 include/hw/pci/pcie.h                              |      2 +-
 include/hw/pci/pcie_host.h                         |      4 +-
 include/hw/pci/pcie_port.h                         |     16 +-
 include/hw/pcmcia.h                                |     16 +-
 include/hw/platform-bus.h                          |     11 +-
 include/hw/ppc/mac_dbdma.h                         |      8 +-
 include/hw/ppc/openpic.h                           |      7 +-
 include/hw/ppc/pef.h                               |     17 +
 include/hw/ppc/pnv.h                               |     78 +-
 include/hw/ppc/pnv_core.h                          |     26 +-
 include/hw/ppc/pnv_homer.h                         |     24 +-
 include/hw/ppc/pnv_lpc.h                           |     30 +-
 include/hw/ppc/pnv_occ.h                           |     24 +-
 include/hw/ppc/pnv_pnor.h                          |      7 +-
 include/hw/ppc/pnv_psi.h                           |     33 +-
 include/hw/ppc/pnv_xive.h                          |     16 +-
 include/hw/ppc/pnv_xscom.h                         |     14 +-
 include/hw/ppc/ppc4xx.h                            |      9 -
 include/hw/ppc/spapr.h                             |     64 +-
 include/hw/ppc/spapr_cpu_core.h                    |     17 +-
 include/hw/ppc/spapr_drc.h                         |     63 +-
 include/hw/ppc/spapr_irq.h                         |     48 +-
 include/hw/ppc/spapr_numa.h                        |     36 +
 include/hw/ppc/spapr_nvdimm.h                      |     10 +-
 include/hw/ppc/spapr_ovec.h                        |      1 +
 include/hw/ppc/spapr_tpm_proxy.h                   |      7 +-
 include/hw/ppc/spapr_vio.h                         |     19 +-
 include/hw/ppc/spapr_xive.h                        |     15 +-
 include/hw/ppc/xics.h                              |     31 +-
 include/hw/ppc/xics_spapr.h                        |      7 +-
 include/hw/ppc/xive.h                              |     86 +-
 include/hw/ppc/xive_regs.h                         |      2 +
 include/hw/ptimer.h                                |     22 +
 include/hw/qdev-clock.h                            |     25 +-
 include/hw/qdev-core.h                             |    163 +-
 include/hw/qdev-properties-system.h                |     77 +
 include/hw/qdev-properties.h                       |    240 +-
 include/hw/rdma/rdma.h                             |     11 +-
 include/hw/register.h                              |      7 +-
 include/hw/remote/iohub.h                          |     42 +
 include/hw/remote/machine.h                        |     38 +
 include/hw/remote/memory.h                         |     19 +
 include/hw/remote/mpqemu-link.h                    |     99 +
 include/hw/remote/proxy-memory-listener.h          |     28 +
 include/hw/remote/proxy.h                          |     48 +
 include/hw/resettable.h                            |     11 +-
 include/hw/riscv/boot.h                            |     23 +-
 include/hw/riscv/microchip_pfsoc.h                 |    151 +
 include/hw/riscv/numa.h                            |    113 +
 include/hw/riscv/opentitan.h                       |     57 +-
 include/hw/riscv/riscv_hart.h                      |      9 +-
 include/hw/riscv/riscv_htif.h                      |     59 -
 include/hw/riscv/sifive_clint.h                    |     57 -
 include/hw/riscv/sifive_e.h                        |     40 +-
 include/hw/riscv/sifive_e_prci.h                   |     71 -
 include/hw/riscv/sifive_gpio.h                     |     76 -
 include/hw/riscv/sifive_plic.h                     |     79 -
 include/hw/riscv/sifive_test.h                     |     45 -
 include/hw/riscv/sifive_u.h                        |     61 +-
 include/hw/riscv/sifive_u_otp.h                    |     80 -
 include/hw/riscv/sifive_u_prci.h                   |     91 -
 include/hw/riscv/sifive_uart.h                     |     77 -
 include/hw/riscv/spike.h                           |     23 +-
 include/hw/riscv/virt.h                            |     28 +-
 include/hw/rtc/allwinner-rtc.h                     |     15 +-
 include/hw/rtc/aspeed_rtc.h                        |      7 +-
 include/hw/rtc/goldfish_rtc.h                      |      8 +-
 include/hw/rtc/m48t59.h                            |     17 +-
 include/hw/rtc/mc146818rtc.h                       |      9 +-
 include/hw/rtc/pl031.h                             |      7 +-
 include/hw/rtc/xlnx-zynqmp-rtc.h                   |      8 +-
 include/hw/rx/rx62n.h                              |      9 +-
 include/hw/s390x/3270-ccw.h                        |     16 +-
 include/hw/s390x/ap-device.h                       |     12 +-
 include/hw/s390x/css-bridge.h                      |     14 +-
 include/hw/s390x/css.h                             |      9 +-
 include/hw/s390x/event-facility.h                  |     35 +-
 include/hw/s390x/pv.h                              |     17 +
 include/hw/s390x/s390-ccw.h                        |     19 +-
 include/hw/s390x/s390-pci-bus.h                    |    394 +
 include/hw/s390x/s390-pci-clp.h                    |    215 +
 include/hw/s390x/s390-pci-inst.h                   |    119 +
 include/hw/s390x/s390-pci-vfio.h                   |     39 +
 include/hw/s390x/s390-virtio-ccw.h                 |     14 +-
 include/hw/s390x/s390_flic.h                       |     32 +-
 include/hw/s390x/sclp.h                            |     29 +-
 include/hw/s390x/storage-attributes.h              |     34 +-
 include/hw/s390x/storage-keys.h                    |     25 +-
 include/hw/s390x/tod.h                             |     15 +-
 include/hw/s390x/vfio-ccw.h                        |      5 +-
 include/hw/scsi/esp.h                              |     60 +-
 include/hw/scsi/scsi.h                             |     28 +-
 include/hw/sd/allwinner-sdhost.h                   |     21 +-
 include/hw/sd/aspeed_sdhci.h                       |     10 +-
 include/hw/sd/bcm2835_sdhost.h                     |      8 +-
 include/hw/sd/cadence_sdhci.h                      |     47 +
 include/hw/sd/sd.h                                 |    141 +-
 include/hw/sd/sdcard_legacy.h                      |     50 +
 include/hw/sd/sdhci.h                              |     13 +-
 include/hw/semihosting/console.h                   |     69 -
 include/hw/semihosting/semihost.h                  |     77 -
 include/hw/sh4/sh.h                                |     31 +-
 include/hw/southbridge/piix.h                      |     10 +-
 include/hw/sparc/grlib.h                           |     10 +-
 include/hw/sparc/sparc32_dma.h                     |     34 +-
 include/hw/sparc/sun4m_iommu.h                     |      9 +-
 include/hw/sparc/sun4u_iommu.h                     |      9 +-
 include/hw/ssi/aspeed_smc.h                        |     17 +-
 include/hw/ssi/imx_spi.h                           |     12 +-
 include/hw/ssi/mss-spi.h                           |      7 +-
 include/hw/ssi/npcm7xx_fiu.h                       |     73 +
 include/hw/ssi/pl022.h                             |     12 +-
 include/hw/ssi/sifive_spi.h                        |     47 +
 include/hw/ssi/ssi.h                               |     63 +-
 include/hw/ssi/stm32f2xx_spi.h                     |      8 +-
 include/hw/ssi/xilinx_spips.h                      |     31 +-
 include/hw/stream.h                                |     44 +-
 include/hw/sysbus.h                                |     17 +-
 include/hw/timer/a9gtimer.h                        |      4 +-
 include/hw/timer/allwinner-a10-pit.h               |      4 +-
 include/hw/timer/arm_mptimer.h                     |      8 +-
 include/hw/timer/armv7m_systick.h                  |     10 +-
 include/hw/timer/aspeed_timer.h                    |     16 +-
 include/hw/timer/avr_timer16.h                     |      8 +-
 include/hw/timer/bcm2835_systmr.h                  |     23 +-
 include/hw/timer/cmsdk-apb-dualtimer.h             |     10 +-
 include/hw/timer/cmsdk-apb-timer.h                 |     38 +-
 include/hw/timer/digic-timer.h                     |      7 +-
 include/hw/timer/i8254.h                           |      8 +-
 include/hw/timer/i8254_internal.h                  |      8 +-
 include/hw/timer/imx_epit.h                        |      7 +-
 include/hw/timer/imx_gpt.h                         |      9 +-
 include/hw/timer/mss-timer.h                       |      8 +-
 include/hw/timer/npcm7xx_timer.h                   |    113 +
 include/hw/timer/nrf51_timer.h                     |      7 +-
 include/hw/timer/renesas_cmt.h                     |      9 +-
 include/hw/timer/renesas_tmr.h                     |      9 +-
 include/hw/timer/sse-counter.h                     |    105 +
 include/hw/timer/sse-timer.h                       |     53 +
 include/hw/timer/stm32f2xx_timer.h                 |     10 +-
 include/hw/tricore/tc27x_soc.h                     |    129 +
 include/hw/tricore/triboard.h                      |     50 +
 include/hw/usb.h                                   |     26 +-
 include/hw/usb/chipidea.h                          |      7 +-
 include/hw/usb/hcd-dwc3.h                          |     55 +
 include/hw/usb/hid.h                               |     17 +
 include/hw/usb/imx-usb-phy.h                       |      7 +-
 include/hw/usb/msd.h                               |     54 +
 include/hw/usb/xhci.h                              |     21 +
 include/hw/usb/xlnx-usb-subsystem.h                |     45 +
 include/hw/usb/xlnx-versal-usb2-ctrl-regs.h        |     45 +
 include/hw/vfio/vfio-amd-xgbe.h                    |     11 +-
 include/hw/vfio/vfio-calxeda-xgmac.h               |     21 +-
 include/hw/vfio/vfio-common.h                      |     32 +
 include/hw/vfio/vfio-platform.h                    |     19 +-
 include/hw/virtio/vhost-backend.h                  |      2 +
 include/hw/virtio/vhost-scsi-common.h              |     10 +-
 include/hw/virtio/vhost-scsi.h                     |      8 +-
 include/hw/virtio/vhost-user-blk.h                 |     20 +-
 include/hw/virtio/vhost-user-fs.h                  |      9 +-
 include/hw/virtio/vhost-user-scsi.h                |      8 +-
 include/hw/virtio/vhost-user-vsock.h               |      8 +-
 include/hw/virtio/vhost-vdpa.h                     |      1 +
 include/hw/virtio/vhost-vsock-common.h             |      8 +-
 include/hw/virtio/vhost-vsock.h                    |      8 +-
 include/hw/virtio/vhost.h                          |      2 +
 include/hw/virtio/virtio-balloon.h                 |      8 +-
 include/hw/virtio/virtio-blk.h                     |     13 +-
 include/hw/virtio/virtio-bus.h                     |     15 +-
 include/hw/virtio/virtio-crypto.h                  |      8 +-
 include/hw/virtio/virtio-gpu-pci.h                 |      5 +-
 include/hw/virtio/virtio-gpu.h                     |     39 +-
 include/hw/virtio/virtio-input.h                   |     23 +-
 include/hw/virtio/virtio-iommu.h                   |      8 +-
 include/hw/virtio/virtio-mem.h                     |     17 +-
 include/hw/virtio/virtio-mmio.h                    |     17 +-
 include/hw/virtio/virtio-net.h                     |     14 +-
 include/hw/virtio/virtio-pmem.h                    |     19 +-
 include/hw/virtio/virtio-rng.h                     |      8 +-
 include/hw/virtio/virtio-scsi.h                    |     20 +-
 include/hw/virtio/virtio-serial.h                  |     22 +-
 include/hw/virtio/virtio.h                         |     14 +-
 include/hw/vmstate-if.h                            |     11 +-
 include/hw/watchdog/cmsdk-apb-watchdog.h           |     13 +-
 include/hw/watchdog/sbsa_gwdt.h                    |     79 +
 include/hw/watchdog/wdt_aspeed.h                   |     16 +-
 include/hw/watchdog/wdt_diag288.h                  |     19 +-
 include/hw/watchdog/wdt_imx2.h                     |      7 +-
 include/hw/xen/interface/io/ring.h                 |      9 -
 include/hw/xen/xen-backend.h                       |      1 +
 include/hw/xen/xen-block.h                         |     33 +-
 include/hw/xen/xen-bus.h                           |     38 +-
 include/hw/xen/xen-legacy-backend.h                |      6 +-
 include/hw/xen/xen-x86.h                           |     15 +
 include/hw/xen/xen.h                               |      4 +-
 include/io/channel-buffer.h                        |      7 +-
 include/io/channel-command.h                       |      7 +-
 include/io/channel-file.h                          |      7 +-
 include/io/channel-socket.h                        |      7 +-
 include/io/channel-tls.h                           |      7 +-
 include/io/channel-util.h                          |      2 +-
 include/io/channel-watch.h                         |      2 +-
 include/io/channel-websock.h                       |      7 +-
 include/io/channel.h                               |     95 +-
 include/io/dns-resolver.h                          |     15 +-
 include/io/net-listener.h                          |     14 +-
 include/io/task.h                                  |      2 +-
 include/migration/misc.h                           |      3 +-
 include/migration/snapshot.h                       |     47 +-
 include/migration/vmstate.h                        |     20 +-
 include/monitor/hmp-target.h                       |      7 +-
 include/monitor/hmp.h                              |      9 +-
 include/monitor/monitor.h                          |     13 +-
 include/net/can_emu.h                              |     19 +-
 include/net/can_host.h                             |     20 +-
 include/net/checksum.h                             |      7 +-
 include/net/eth.h                                  |     17 +
 include/net/filter.h                               |     11 +-
 include/net/net.h                                  |     17 +-
 include/net/queue.h                                |      8 +
 include/qapi/compat-policy.h                       |     38 +
 include/qapi/error.h                               |      2 +-
 include/qapi/qmp/dispatch.h                        |     11 +-
 include/qapi/qmp/json-writer.h                     |     35 +
 include/qapi/qmp/qbool.h                           |      2 -
 include/qapi/qmp/qdict.h                           |      2 -
 include/qapi/qmp/qerror.h                          |     23 -
 include/qapi/qmp/qjson.h                           |      4 +-
 include/qapi/qmp/qlist.h                           |      2 -
 include/qapi/qmp/qnull.h                           |      2 -
 include/qapi/qmp/qnum.h                            |      3 -
 include/qapi/qmp/qobject.h                         |      9 +-
 include/qapi/qmp/qstring.h                         |     14 +-
 include/qapi/qobject-input-visitor.h               |      4 +
 include/qapi/qobject-output-visitor.h              |      4 +
 include/qapi/util.h                                |     28 +
 include/qapi/visitor-impl.h                        |      6 +
 include/qapi/visitor.h                             |     18 +
 include/qemu-common.h                              |     35 +-
 include/qemu/accel.h                               |     81 +
 include/qemu/atomic.h                              |    275 +-
 include/qemu/atomic128.h                           |      6 +-
 include/qemu/base64.h                              |      2 +-
 include/qemu/bitops.h                              |      2 +-
 include/qemu/bswap.h                               |     66 -
 include/qemu/buffer.h                              |      2 +-
 include/qemu/cacheflush.h                          |     35 +
 include/qemu/compiler.h                            |     72 +-
 include/qemu/config-file.h                         |      6 +-
 include/qemu/coroutine.h                           |     19 +-
 include/qemu/crc-ccitt.h                           |     33 +
 include/qemu/cutils.h                              |     25 +
 include/qemu/datadir.h                             |     28 +
 include/qemu/error-report.h                        |      2 +-
 include/qemu/event_notifier.h                      |      1 +
 include/qemu/fifo8.h                               |     16 +-
 include/qemu/filemonitor.h                         |      2 +-
 include/qemu/help_option.h                         |     11 +
 include/qemu/id.h                                  |      1 +
 include/qemu/int128.h                              |     26 +
 include/qemu/iov.h                                 |     25 +-
 include/qemu/job.h                                 |      5 +
 include/qemu/log.h                                 |      6 +-
 include/qemu/main-loop.h                           |      2 +-
 include/qemu/mmap-alloc.h                          |      6 +-
 include/qemu/module.h                              |      8 +-
 include/qemu/nvdimm-utils.h                        |      1 -
 include/qemu/option.h                              |      5 +-
 include/qemu/osdep.h                               |     91 +-
 include/qemu/plugin.h                              |      8 +-
 include/qemu/qemu-plugin.h                         |    247 +-
 include/qemu/queue.h                               |      7 +-
 include/qemu/rcu.h                                 |     11 +-
 include/qemu/rcu_queue.h                           |    100 +-
 include/qemu/seqlock.h                             |      8 +-
 include/qemu/stats64.h                             |     28 +-
 include/qemu/thread.h                              |     24 +-
 include/qemu/timer.h                               |     54 +-
 include/qemu/typedefs.h                            |      8 +-
 include/qemu/userfaultfd.h                         |     35 +
 include/qemu/vfio-helpers.h                        |      2 +-
 include/qemu/vhost-user-server.h                   |     65 +
 include/qemu/xxhash.h                              |     98 +
 include/qemu/yank.h                                |     87 +
 include/qom/object.h                               |    748 +-
 include/qom/object_interfaces.h                    |    106 +-
 include/scsi/constants.h                           |      1 +
 include/scsi/pr-manager.h                          |     16 +-
 include/scsi/utils.h                               |     31 +-
 include/semihosting/console.h                      |     69 +
 include/semihosting/semihost.h                     |     77 +
 include/standard-headers/asm-m68k/bootinfo-mac.h   |    120 +
 include/standard-headers/asm-m68k/bootinfo-virt.h  |     18 +
 include/standard-headers/asm-m68k/bootinfo.h       |    166 +
 include/standard-headers/asm-x86/kvm_para.h        |      1 +
 .../drivers/infiniband/hw/vmw_pvrdma/pvrdma_ring.h |    114 -
 include/standard-headers/drm/drm_fourcc.h          |    315 +-
 include/standard-headers/linux/const.h             |     36 +
 include/standard-headers/linux/ethtool.h           |     91 +-
 include/standard-headers/linux/fuse.h              |     78 +-
 include/standard-headers/linux/input-event-codes.h |      7 +-
 include/standard-headers/linux/kernel.h            |      9 +-
 include/standard-headers/linux/pci_regs.h          |     22 +-
 include/standard-headers/linux/vhost_types.h       |     20 +
 include/standard-headers/linux/virtio_9p.h         |      4 +-
 include/standard-headers/linux/virtio_blk.h        |     26 +-
 include/standard-headers/linux/virtio_config.h     |      8 +-
 include/standard-headers/linux/virtio_console.h    |      8 +-
 include/standard-headers/linux/virtio_fs.h         |      3 +
 include/standard-headers/linux/virtio_gpu.h        |    101 +
 include/standard-headers/linux/virtio_ids.h        |     44 +-
 include/standard-headers/linux/virtio_mmio.h       |     11 +
 include/standard-headers/linux/virtio_net.h        |      6 +-
 include/standard-headers/linux/virtio_pci.h        |     11 +-
 include/standard-headers/linux/virtio_scsi.h       |     20 +-
 include/sysemu/accel-ops.h                         |     45 +
 include/sysemu/accel.h                             |     77 -
 include/sysemu/arch_init.h                         |      9 +
 include/sysemu/balloon.h                           |      2 +-
 include/sysemu/block-backend.h                     |      3 +-
 include/sysemu/blockdev.h                          |      1 -
 include/sysemu/cpu-timers.h                        |     90 +
 include/sysemu/cpus.h                              |     41 +-
 include/sysemu/cryptodev-vhost-user.h              |      2 +-
 include/sysemu/cryptodev-vhost.h                   |      2 +-
 include/sysemu/cryptodev.h                         |     18 +-
 include/sysemu/device_tree.h                       |     17 +
 include/sysemu/dma.h                               |    129 +-
 include/sysemu/hax.h                               |     17 -
 include/sysemu/hostmem.h                           |     10 +-
 include/sysemu/hvf.h                               |     16 +-
 include/sysemu/hw_accel.h                          |     68 +-
 include/sysemu/iothread.h                          |     15 +-
 include/sysemu/kvm.h                               |     63 +-
 include/sysemu/kvm_int.h                           |      7 +-
 include/sysemu/numa.h                              |      4 -
 include/sysemu/os-win32.h                          |      4 +-
 include/sysemu/qtest.h                             |      2 +
 include/sysemu/replay.h                            |     42 +-
 include/sysemu/rng-random.h                        |      3 +-
 include/sysemu/rng.h                               |     10 +-
 include/sysemu/runstate-action.h                   |     19 +
 include/sysemu/runstate.h                          |     13 +-
 include/sysemu/sev.h                               |     11 +-
 include/sysemu/sysemu.h                            |     17 +-
 include/sysemu/tcg.h                               |      3 +-
 include/sysemu/tpm.h                               |     11 +-
 include/sysemu/tpm_backend.h                       |     12 +-
 include/sysemu/tpm_util.h                          |      2 +-
 include/sysemu/vhost-user-backend.h                |     17 +-
 include/sysemu/whpx.h                              |     21 +-
 include/sysemu/xen.h                               |      2 +
 include/tcg/tcg-gvec-desc.h                        |     36 +-
 include/tcg/tcg-op.h                               |     21 +-
 include/tcg/tcg-opc.h                              |     21 +-
 include/tcg/tcg.h                                  |    160 +-
 include/ui/console.h                               |     77 +-
 include/ui/egl-context.h                           |      1 -
 include/ui/egl-helpers.h                           |     10 +-
 include/ui/gtk.h                                   |      8 +-
 include/ui/qemu-spice-module.h                     |     44 +
 include/ui/qemu-spice.h                            |     45 +-
 include/ui/sdl2.h                                  |      1 -
 include/ui/spice-display.h                         |      2 +-
 include/user/syscall-trace.h                       |      2 +-
 io/Makefile.objs                                   |     12 -
 io/channel-buffer.c                                |      2 +-
 io/channel-command.c                               |      2 +-
 io/channel-file.c                                  |      4 +-
 io/channel-socket.c                                |      2 +-
 io/channel-tls.c                                   |      8 +-
 io/channel-util.c                                  |      2 +-
 io/channel-watch.c                                 |      2 +-
 io/channel-websock.c                               |      4 +-
 io/channel.c                                       |    117 +-
 io/dns-resolver.c                                  |      3 +-
 io/meson.build                                     |     15 +
 io/net-listener.c                                  |      1 -
 io/task.c                                          |      2 +-
 io/trace.h                                         |      1 +
 iothread.c                                         |     30 +-
 job-qmp.c                                          |     15 +-
 job.c                                              |     12 +-
 libdecnumber/Makefile.objs                         |      5 -
 libdecnumber/decNumber.c                           |      2 +-
 libdecnumber/meson.build                           |      7 +
 linux-headers/asm-arm64/kvm.h                      |     24 +-
 linux-headers/asm-arm64/mman.h                     |      1 +
 linux-headers/asm-generic/hugetlb_encode.h         |      1 +
 linux-headers/asm-generic/unistd.h                 |     28 +-
 linux-headers/asm-mips/unistd_n32.h                |      3 +
 linux-headers/asm-mips/unistd_n64.h                |      3 +
 linux-headers/asm-mips/unistd_o32.h                |      3 +
 linux-headers/asm-powerpc/kvm.h                    |      5 +
 linux-headers/asm-powerpc/unistd_32.h              |      3 +
 linux-headers/asm-powerpc/unistd_64.h              |      3 +
 linux-headers/asm-s390/kvm.h                       |      7 +-
 linux-headers/asm-s390/unistd_32.h                 |      3 +
 linux-headers/asm-s390/unistd_64.h                 |      3 +
 linux-headers/asm-x86/kvm.h                        |     21 +
 linux-headers/asm-x86/unistd_32.h                  |      3 +
 linux-headers/asm-x86/unistd_64.h                  |      3 +
 linux-headers/asm-x86/unistd_x32.h                 |      3 +
 linux-headers/linux/kvm.h                          |     85 +-
 linux-headers/linux/mman.h                         |      1 +
 linux-headers/linux/userfaultfd.h                  |      9 +
 linux-headers/linux/vfio.h                         |     32 +-
 linux-headers/linux/vfio_zdev.h                    |     78 +
 linux-headers/linux/vhost.h                        |      6 +
 linux-user/Makefile.objs                           |     25 -
 linux-user/aarch64/cpu_loop.c                      |     41 +-
 linux-user/aarch64/signal.c                        |     12 +-
 linux-user/aarch64/syscall_nr.h                    |      7 +-
 linux-user/aarch64/target_cpu.h                    |      2 +-
 linux-user/aarch64/target_signal.h                 |      3 +
 linux-user/aarch64/target_structs.h                |      2 +-
 linux-user/aarch64/target_syscall.h                |     18 +-
 linux-user/aarch64/termbits.h                      |    228 +-
 linux-user/alpha/Makefile.objs                     |      5 -
 linux-user/alpha/meson.build                       |      5 +
 linux-user/alpha/syscall.tbl                       |      4 +-
 linux-user/alpha/target_cpu.h                      |      2 +-
 linux-user/alpha/target_fcntl.h                    |      3 +-
 linux-user/alpha/target_signal.h                   |      9 +-
 linux-user/alpha/target_structs.h                  |      2 +-
 linux-user/alpha/target_syscall.h                  |      5 +-
 linux-user/alpha/termbits.h                        |      1 +
 linux-user/arm/Makefile.objs                       |      8 -
 linux-user/arm/cpu_loop.c                          |     31 +-
 linux-user/arm/meson.build                         |      7 +
 linux-user/arm/nwfpe/Makefile.objs                 |      2 -
 linux-user/arm/nwfpe/meson.build                   |     10 +
 linux-user/arm/semihost.c                          |     76 -
 linux-user/arm/syscall.tbl                         |      4 +-
 linux-user/arm/target_cpu.h                        |      2 +-
 linux-user/arm/target_signal.h                     |      6 +-
 linux-user/arm/target_structs.h                    |      2 +-
 linux-user/arm/target_syscall.h                    |      6 +-
 linux-user/arm/termbits.h                          |    223 +-
 linux-user/cris/target_cpu.h                       |      2 +-
 linux-user/cris/target_signal.h                    |      6 +-
 linux-user/cris/target_structs.h                   |      2 +-
 linux-user/cris/target_syscall.h                   |      9 +-
 linux-user/cris/termbits.h                         |     18 +-
 linux-user/elfload.c                               |    501 +-
 linux-user/exit.c                                  |      2 +-
 linux-user/fd-trans.c                              |     18 +-
 linux-user/flat.h                                  |      2 +-
 linux-user/flatload.c                              |      6 +-
 linux-user/generic/fcntl.h                         |      5 -
 linux-user/generic/signal.h                        |      6 +
 linux-user/generic/sockbits.h                      |      3 +
 linux-user/generic/termbits.h                      |    318 +
 linux-user/hexagon/cpu_loop.c                      |    100 +
 linux-user/hexagon/signal.c                        |    276 +
 linux-user/hexagon/sockbits.h                      |     18 +
 linux-user/hexagon/syscall_nr.h                    |    322 +
 linux-user/hexagon/target_cpu.h                    |     44 +
 linux-user/hexagon/target_elf.h                    |     40 +
 linux-user/hexagon/target_fcntl.h                  |     18 +
 linux-user/hexagon/target_signal.h                 |     34 +
 linux-user/hexagon/target_structs.h                |     54 +
 linux-user/hexagon/target_syscall.h                |     36 +
 linux-user/hexagon/termbits.h                      |     18 +
 linux-user/host/ppc64/safe-syscall.inc.S           |      2 +-
 linux-user/hppa/Makefile.objs                      |      5 -
 linux-user/hppa/cpu_loop.c                         |     40 +-
 linux-user/hppa/meson.build                        |      5 +
 linux-user/hppa/syscall.tbl                        |      8 +-
 linux-user/hppa/target_cpu.h                       |      2 +-
 linux-user/hppa/target_fcntl.h                     |      4 +-
 linux-user/hppa/target_signal.h                    |      7 +-
 linux-user/hppa/target_structs.h                   |      2 +-
 linux-user/hppa/target_syscall.h                   |      5 +-
 linux-user/hppa/termbits.h                         |     17 +-
 linux-user/i386/Makefile.objs                      |      5 -
 linux-user/i386/cpu_loop.c                         |      6 +-
 linux-user/i386/meson.build                        |      5 +
 linux-user/i386/signal.c                           |      5 +-
 linux-user/i386/syscall_32.tbl                     |    820 +-
 linux-user/i386/syscall_nr.h                       |      1 +
 linux-user/i386/target_cpu.h                       |      2 +-
 linux-user/i386/target_signal.h                    |      6 +-
 linux-user/i386/target_structs.h                   |      2 +-
 linux-user/i386/target_syscall.h                   |      5 +-
 linux-user/i386/termbits.h                         |    233 +-
 linux-user/ioctls.h                                |    177 +-
 linux-user/m68k/Makefile.objs                      |      5 -
 linux-user/m68k/meson.build                        |      5 +
 linux-user/m68k/syscall.tbl                        |      4 +-
 linux-user/m68k/target_signal.h                    |      6 +-
 linux-user/m68k/target_syscall.h                   |      6 +-
 linux-user/m68k/termbits.h                         |    234 +-
 linux-user/main.c                                  |     46 +-
 linux-user/meson.build                             |     38 +
 linux-user/microblaze/Makefile.objs                |      5 -
 linux-user/microblaze/cpu_loop.c                   |     26 +-
 linux-user/microblaze/meson.build                  |      5 +
 linux-user/microblaze/signal.c                     |    144 +-
 linux-user/microblaze/syscall.tbl                  |      4 +-
 linux-user/microblaze/target_cpu.h                 |      2 +-
 linux-user/microblaze/target_signal.h              |      7 +-
 linux-user/microblaze/target_structs.h             |      2 +-
 linux-user/microblaze/target_syscall.h             |      5 +-
 linux-user/microblaze/termbits.h                   |    220 +-
 linux-user/mips/Makefile.objs                      |      5 -
 linux-user/mips/cpu_loop.c                         |     11 +-
 linux-user/mips/meson.build                        |      6 +
 linux-user/mips/sockbits.h                         |      2 +
 linux-user/mips/syscall-args-o32.c.inc             |      4 +
 linux-user/mips/syscall_nr.h                       |      1 +
 linux-user/mips/syscall_o32.tbl                    |      8 +-
 linux-user/mips/target_cpu.h                       |      2 +-
 linux-user/mips/target_signal.h                    |     12 +-
 linux-user/mips/target_structs.h                   |      2 +-
 linux-user/mips/target_syscall.h                   |      5 +-
 linux-user/mips/termbits.h                         |     17 +-
 linux-user/mips64/Makefile.objs                    |     12 -
 linux-user/mips64/meson.build                      |      6 +
 linux-user/mips64/syscall_n32.tbl                  |      8 +-
 linux-user/mips64/syscall_n64.tbl                  |      4 +-
 linux-user/mips64/syscall_nr.h                     |     10 +
 linux-user/mips64/target_cpu.h                     |      2 +-
 linux-user/mips64/target_elf.h                     |      3 +
 linux-user/mips64/target_signal.h                  |     16 +-
 linux-user/mips64/target_syscall.h                 |      5 +-
 linux-user/mmap.c                                  |    203 +-
 linux-user/nios2/syscall_nr.h                      |      7 +-
 linux-user/nios2/target_cpu.h                      |      2 +-
 linux-user/nios2/target_signal.h                   |      5 +-
 linux-user/nios2/target_structs.h                  |      2 +-
 linux-user/nios2/target_syscall.h                  |      5 +-
 linux-user/nios2/termbits.h                        |    228 +-
 linux-user/openrisc/syscall_nr.h                   |      8 +-
 linux-user/openrisc/target_syscall.h               |      5 +-
 linux-user/openrisc/termbits.h                     |    302 +-
 linux-user/ppc/Makefile.objs                       |      6 -
 linux-user/ppc/meson.build                         |      5 +
 linux-user/ppc/signal.c                            |      4 +-
 linux-user/ppc/syscall.tbl                         |     30 +-
 linux-user/ppc/target_cpu.h                        |      2 +-
 linux-user/ppc/target_signal.h                     |      6 +-
 linux-user/ppc/target_structs.h                    |      2 +-
 linux-user/ppc/target_syscall.h                    |      7 +-
 linux-user/ppc/termbits.h                          |     21 +-
 linux-user/qemu.h                                  |    127 +-
 linux-user/riscv/cpu_loop.c                        |     10 +
 linux-user/riscv/syscall32_nr.h                    |      8 +-
 linux-user/riscv/syscall64_nr.h                    |      8 +-
 linux-user/riscv/target_syscall.h                  |      5 +-
 linux-user/riscv/termbits.h                        |    228 +-
 linux-user/s390x/Makefile.objs                     |      5 -
 linux-user/s390x/meson.build                       |      5 +
 linux-user/s390x/signal.c                          |      5 +-
 linux-user/s390x/syscall.tbl                       |      8 +-
 linux-user/s390x/target_signal.h                   |      2 +-
 linux-user/s390x/target_structs.h                  |      2 +-
 linux-user/s390x/target_syscall.h                  |      5 +-
 linux-user/s390x/termbits.h                        |    289 +-
 linux-user/semihost.c                              |     76 +
 linux-user/sh4/Makefile.objs                       |      5 -
 linux-user/sh4/meson.build                         |      5 +
 linux-user/sh4/signal.c                            |      8 +-
 linux-user/sh4/syscall.tbl                         |      4 +-
 linux-user/sh4/target_signal.h                     |      6 +-
 linux-user/sh4/target_syscall.h                    |      5 +-
 linux-user/sh4/termbits.h                          |     19 +-
 linux-user/signal.c                                |     11 +-
 linux-user/sparc/Makefile.objs                     |      5 -
 linux-user/sparc/meson.build                       |      5 +
 linux-user/sparc/signal.c                          |    153 +-
 linux-user/sparc/syscall.tbl                       |      8 +-
 linux-user/sparc/target_cpu.h                      |      2 +-
 linux-user/sparc/target_signal.h                   |     12 +-
 linux-user/sparc/target_structs.h                  |      2 +-
 linux-user/sparc/target_syscall.h                  |      5 +-
 linux-user/sparc/termbits.h                        |     18 +-
 linux-user/sparc64/Makefile.objs                   |      5 -
 linux-user/sparc64/meson.build                     |      5 +
 linux-user/sparc64/syscall.tbl                     |      8 +-
 linux-user/sparc64/target_structs.h                |      2 +-
 linux-user/sparc64/target_syscall.h                |      5 +-
 linux-user/sparc64/termbits.h                      |     18 +-
 linux-user/strace.c                                |   1238 +-
 linux-user/strace.list                             |     35 +-
 linux-user/syscall.c                               |   1515 +-
 linux-user/syscall_defs.h                          |    179 +-
 linux-user/syscall_types.h                         |    167 +
 linux-user/tilegx/cpu_loop.c                       |    287 -
 linux-user/tilegx/signal.c                         |    178 -
 linux-user/tilegx/sockbits.h                       |      1 -
 linux-user/tilegx/syscall_nr.h                     |    327 -
 linux-user/tilegx/target_cpu.h                     |     44 -
 linux-user/tilegx/target_elf.h                     |     14 -
 linux-user/tilegx/target_fcntl.h                   |     11 -
 linux-user/tilegx/target_signal.h                  |     23 -
 linux-user/tilegx/target_structs.h                 |     46 -
 linux-user/tilegx/target_syscall.h                 |     43 -
 linux-user/tilegx/termbits.h                       |    275 -
 linux-user/trace.h                                 |      1 +
 linux-user/uaccess.c                               |     82 +-
 linux-user/x86_64/Makefile.objs                    |      5 -
 linux-user/x86_64/meson.build                      |      5 +
 linux-user/x86_64/syscall_64.tbl                   |    742 +-
 linux-user/x86_64/syscall_nr.h                     |      1 +
 linux-user/x86_64/target_signal.h                  |      6 +-
 linux-user/x86_64/target_structs.h                 |      2 +-
 linux-user/x86_64/target_syscall.h                 |      5 +-
 linux-user/x86_64/termbits.h                       |    254 +-
 linux-user/xtensa/Makefile.objs                    |      5 -
 linux-user/xtensa/meson.build                      |      5 +
 linux-user/xtensa/syscall.tbl                      |      4 +-
 linux-user/xtensa/target_syscall.h                 |      5 +-
 linux-user/xtensa/termbits.h                       |     55 +-
 memory_ldst.c.inc                                  |    533 +
 memory_ldst.inc.c                                  |    529 -
 meson                                              |      1 +
 meson.build                                        |   2743 +
 meson_options.txt                                  |    127 +
 migration/Makefile.objs                            |     18 -
 migration/block-dirty-bitmap.c                     |    450 +-
 migration/block.c                                  |     40 +-
 migration/channel.c                                |     16 +
 migration/colo-failover.c                          |      6 +-
 migration/colo.c                                   |      7 +-
 migration/dirtyrate.c                              |    426 +
 migration/dirtyrate.h                              |     69 +
 migration/fd.c                                     |      4 +-
 migration/global_state.c                           |      4 +-
 migration/meson.build                              |     34 +
 migration/migration.c                              |    766 +-
 migration/migration.h                              |     54 +-
 migration/multifd.c                                |    178 +-
 migration/multifd.h                                |      2 +
 migration/page_cache.c                             |     21 +-
 migration/page_cache.h                             |      2 +-
 migration/postcopy-ram.c                           |     94 +-
 migration/postcopy-ram.h                           |      2 +-
 migration/qemu-file-channel.c                      |      8 +
 migration/qemu-file.c                              |      2 +-
 migration/qjson.c                                  |    114 -
 migration/qjson.h                                  |     29 -
 migration/ram.c                                    |    417 +-
 migration/ram.h                                    |     19 +-
 migration/rdma.c                                   |     54 +-
 migration/savevm.c                                 |    511 +-
 migration/savevm.h                                 |      3 +
 migration/socket.c                                 |     72 +-
 migration/socket.h                                 |     11 +-
 migration/tls.c                                    |     31 +-
 migration/tls.h                                    |      8 +-
 migration/trace-events                             |     67 +-
 migration/trace.h                                  |      1 +
 migration/vmstate-types.c                          |     64 +-
 migration/vmstate.c                                |     62 +-
 migration/yank_functions.c                         |     20 +
 migration/yank_functions.h                         |     17 +
 monitor/Makefile.objs                              |      6 -
 monitor/hmp-cmds.c                                 |    206 +-
 monitor/hmp.c                                      |     75 +-
 monitor/meson.build                                |      9 +
 monitor/misc.c                                     |    418 +-
 monitor/monitor-internal.h                         |     14 +-
 monitor/monitor.c                                  |    145 +-
 monitor/qmp-cmds-control.c                         |    125 +-
 monitor/qmp-cmds.c                                 |    133 +-
 monitor/qmp.c                                      |    255 +-
 monitor/trace-events                               |      4 +
 monitor/trace.h                                    |      1 +
 nbd/Makefile.objs                                  |      1 -
 nbd/meson.build                                    |      7 +
 nbd/nbd-internal.h                                 |      2 +-
 nbd/server.c                                       |    818 +-
 nbd/trace.h                                        |      1 +
 net/Makefile.objs                                  |     32 -
 net/announce.c                                     |      1 -
 net/can/Makefile.objs                              |      2 -
 net/can/can_core.c                                 |     36 +
 net/can/can_host.c                                 |     21 +-
 net/can/can_socketcan.c                            |     60 +-
 net/can/meson.build                                |      5 +
 net/checksum.c                                     |     24 +-
 net/colo-compare.c                                 |    107 +-
 net/colo.c                                         |      5 +-
 net/dump.c                                         |     15 +-
 net/eth.c                                          |     67 +-
 net/filter-buffer.c                                |     33 +-
 net/filter-mirror.c                                |     81 +-
 net/filter-replay.c                                |      5 +-
 net/filter-rewriter.c                              |     48 +-
 net/filter.c                                       |     24 +-
 net/l2tpv3.c                                       |      9 +-
 net/meson.build                                    |     41 +
 net/net.c                                          |    175 +-
 net/queue.c                                        |     22 +
 net/slirp.c                                        |     13 +-
 net/socket.c                                       |      2 +-
 net/tap-win32.c                                    |     16 +-
 net/tap.c                                          |     45 +-
 net/trace-events                                   |      2 -
 net/trace.h                                        |      1 +
 net/vhost-user.c                                   |     10 +-
 net/vhost-vdpa.c                                   |      7 +-
 os-posix.c                                         |     29 +-
 os-win32.c                                         |     11 -
 page-vary-common.c                                 |     54 +
 page-vary.c                                        |     41 +
 pc-bios/README                                     |     16 +-
 pc-bios/bios-256k.bin                              |    Bin 262144 -> 262144 bytes
 pc-bios/bios-microvm.bin                           |    Bin 65536 -> 131072 bytes
 pc-bios/bios.bin                                   |    Bin 131072 -> 131072 bytes
 pc-bios/descriptors/meson.build                    |     16 +
 pc-bios/edk2-aarch64-code.fd.bz2                   |    Bin 1178070 -> 1507722 bytes
 pc-bios/edk2-arm-code.fd.bz2                       |    Bin 1172752 -> 1503187 bytes
 pc-bios/edk2-i386-code.fd.bz2                      |    Bin 1736199 -> 1646741 bytes


From xen-changelog-bounces@lists.xenproject.org Mon Jul 05 10:00:07 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Jul 2021 10:00:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150040.277476 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0LOY-0003Ot-D8; Mon, 05 Jul 2021 10:00:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150040.277476; Mon, 05 Jul 2021 10:00:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0LOY-0003OK-9X; Mon, 05 Jul 2021 10:00:06 +0000
Received: by outflank-mailman (input) for mailman id 150040;
 Mon, 05 Jul 2021 10:00:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0LOX-0003Kx-KW
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 10:00:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0LOX-0003jl-Je
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 10:00:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0LOX-0001aN-Ie
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 10: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CxBTPtYed8aP7K6sA1EyuayILM71R7OCWbpcC0v+ybs=; b=nkVTlZC3GTMrE7thGHCjYDiNFm
	mxyK5bcqIBqdQRuQIEzJzocqs75Zp30pfLQK0oh68GZfcaPyYGOBG6CkwUrveaL+snz/8/O0eSmdd
	ujn4cEzqCvWvpbgeNpVuQ46yJCq2XLYKCJDZSJPF1Br3ysbkodAWpXxi4nEXy6a2aLb8=;
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: <E1m0LOX-0001aN-Ie@xenbits.xenproject.org>
Date: Mon, 05 Jul 2021 10:00:05 +0000

commit 21a5a3d67a8c5a403ffa5c8b024a19a7725f94ba
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: Mon Jul 5 10:43:11 2021 +0100

    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 5188ff6540..c1150613f9 100644
--- a/util/main-loop.c
+++ b/util/main-loop.c
@@ -183,6 +183,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
@@ -241,6 +285,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();
@@ -413,6 +459,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 Mon Jul 05 10:00:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Jul 2021 10:00:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150041.277480 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0LOi-0003RY-EW; Mon, 05 Jul 2021 10:00:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150041.277480; Mon, 05 Jul 2021 10:00:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0LOi-0003RP-Bj; Mon, 05 Jul 2021 10:00:16 +0000
Received: by outflank-mailman (input) for mailman id 150041;
 Mon, 05 Jul 2021 10:00:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0LOh-0003Qz-NZ
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 10:00:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0LOh-0003k0-Mn
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 10:00:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0LOh-0001bl-Ls
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 10:00: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zjb/DDmWN12EzwyEYKUq6SgMX9V6EroxciiAfMW+Eiw=; b=0EqDuCqdMdm4CljZ1EP/w4eSVk
	MMB75rZZtS9JWQGxmwtFMGmEafx/2dT3XCQ2msgthElWd08foUoMMZ5yCmOVY+PVLahmZ4bslipQO
	fnnkJ2A6rQBCoJjxtO8VEuBQ80u1E5o2z2ARWWpxcT96N9o1OhcNTeaPNXXg7AcJZxcE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] xen-mapcache: avoid a race on memory map while using MAP_FIXED
Message-Id: <E1m0LOh-0001bl-Ls@xenbits.xenproject.org>
Date: Mon, 05 Jul 2021 10:00:15 +0000

commit 73cf1ac4b6fc9f1678f27a51fd1d4ece0c56c77c
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Tue Apr 20 04:35:02 2021 +0100
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Mon Jul 5 10:45:20 2021 +0100

    xen-mapcache: avoid a race on memory map while using MAP_FIXED
    
    When we're replacing the existing mapping there is possibility of a race
    on memory map with other threads doing mmap operations - the address being
    unmapped/re-mapped could be occupied by another thread in between.
    
    Linux mmap man page recommends keeping the existing mappings in place to
    reserve the place and instead utilize the fact that the next mmap operation
    with MAP_FIXED flag passed will implicitly destroy the existing mappings
    behind the chosen address. This behavior is guaranteed by POSIX / BSD and
    therefore is portable.
    
    Note that it wouldn't make the replacement atomic for parallel accesses to
    the replaced region - those might still fail with SIGBUS due to
    xenforeignmemory_map not being atomic. So we're still not expecting those.
    
    Tested-by: Anthony PERARD <anthony.perard@citrix.com>
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Message-Id: <1618889702-13104-1-git-send-email-igor.druzhinin@citrix.com>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    (cherry picked from commit 3e81a71c9f3d23002b1e0dfff902c155d6c8d224)
---
 hw/i386/xen/xen-mapcache.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/hw/i386/xen/xen-mapcache.c b/hw/i386/xen/xen-mapcache.c
index 5b120ed44b..e82b7dcdd2 100644
--- a/hw/i386/xen/xen-mapcache.c
+++ b/hw/i386/xen/xen-mapcache.c
@@ -171,7 +171,20 @@ static void xen_remap_bucket(MapCacheEntry *entry,
         if (!(entry->flags & XEN_MAPCACHE_ENTRY_DUMMY)) {
             ram_block_notify_remove(entry->vaddr_base, entry->size);
         }
-        if (munmap(entry->vaddr_base, entry->size) != 0) {
+
+        /*
+         * If an entry is being replaced by another mapping and we're using
+         * MAP_FIXED flag for it - there is possibility of a race for vaddr
+         * address with another thread doing an mmap call itself
+         * (see man 2 mmap). To avoid that we skip explicit unmapping here
+         * and allow the kernel to destroy the previous mappings by replacing
+         * them in mmap call later.
+         *
+         * Non-identical replacements are not allowed therefore.
+         */
+        assert(!vaddr || (entry->vaddr_base == vaddr && entry->size == size));
+
+        if (!vaddr && munmap(entry->vaddr_base, entry->size) != 0) {
             perror("unmap fails");
             exit(-1);
         }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jul 05 10:00:27 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Jul 2021 10:00:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150042.277484 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0LOt-0003Ut-Ga; Mon, 05 Jul 2021 10:00:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150042.277484; Mon, 05 Jul 2021 10:00:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0LOt-0003Ui-DG; Mon, 05 Jul 2021 10:00:27 +0000
Received: by outflank-mailman (input) for mailman id 150042;
 Mon, 05 Jul 2021 10:00:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0LOr-0003UT-RD
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 10:00:25 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0LOr-0003kE-QF
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 10:00:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0LOr-0001cT-Ow
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 10: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>
DKIM-Signature: v=1; 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+oTDJU/Q7brOTNk3USxd5vTMOHZ1nqsroCvCntMJf8=; b=UumazpeewQQmh8BSY7qgqBnpD6
	i8YYIUJ3XucphZQSrepzuz1CL0J27I5FJR7ESq9YXVx086X1hKfCrKEC+KXWDXXwADJGrK8hr3Zso
	rz8i3kojOlfuRGm/HgbbmLmyp4LPjtlMXzwMeri8JvFbn/YwWxwQTZ54yf8haCkAu5SM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] xen: Free xenforeignmemory_resource at exit
Message-Id: <E1m0LOr-0001cT-Ow@xenbits.xenproject.org>
Date: Mon, 05 Jul 2021 10:00:25 +0000

commit 077876e6d59d93c458731095928e25ec9860036c
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Fri Apr 30 17:37:42 2021 +0100
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Mon Jul 5 10:45:20 2021 +0100

    xen: Free xenforeignmemory_resource at exit
    
    Because Coverity complains about it and this is one leak that Valgrind
    reports.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Paul Durrant <paul@xen.org>
    Message-Id: <20210430163742.469739-1-anthony.perard@citrix.com>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    (cherry picked from commit f1e43b6026500690fc402828fa7cc735175b93b6)
---
 hw/i386/xen/xen-hvm.c       | 9 ++++++---
 include/hw/xen/xen_common.h | 6 ++++++
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
index 7ce672e5a5..47ed7772fa 100644
--- a/hw/i386/xen/xen-hvm.c
+++ b/hw/i386/xen/xen-hvm.c
@@ -109,6 +109,7 @@ typedef struct XenIOState {
     shared_iopage_t *shared_page;
     shared_vmport_iopage_t *shared_vmport_page;
     buffered_iopage_t *buffered_io_page;
+    xenforeignmemory_resource_handle *fres;
     QEMUTimer *buffered_io_timer;
     CPUState **cpu_by_vcpu_id;
     /* the evtchn port for polling the notification, */
@@ -1254,6 +1255,9 @@ static void xen_exit_notifier(Notifier *n, void *data)
     XenIOState *state = container_of(n, XenIOState, exit);
 
     xen_destroy_ioreq_server(xen_domid, state->ioservid);
+    if (state->fres != NULL) {
+        xenforeignmemory_unmap_resource(xen_fmem, state->fres);
+    }
 
     xenevtchn_close(state->xce_handle);
     xs_daemon_close(state->xenstore);
@@ -1321,7 +1325,6 @@ static void xen_wakeup_notifier(Notifier *notifier, void *data)
 static int xen_map_ioreq_server(XenIOState *state)
 {
     void *addr = NULL;
-    xenforeignmemory_resource_handle *fres;
     xen_pfn_t ioreq_pfn;
     xen_pfn_t bufioreq_pfn;
     evtchn_port_t bufioreq_evtchn;
@@ -1333,12 +1336,12 @@ static int xen_map_ioreq_server(XenIOState *state)
      */
     QEMU_BUILD_BUG_ON(XENMEM_resource_ioreq_server_frame_bufioreq != 0);
     QEMU_BUILD_BUG_ON(XENMEM_resource_ioreq_server_frame_ioreq(0) != 1);
-    fres = xenforeignmemory_map_resource(xen_fmem, xen_domid,
+    state->fres = xenforeignmemory_map_resource(xen_fmem, xen_domid,
                                          XENMEM_resource_ioreq_server,
                                          state->ioservid, 0, 2,
                                          &addr,
                                          PROT_READ | PROT_WRITE, 0);
-    if (fres != NULL) {
+    if (state->fres != NULL) {
         trace_xen_map_resource_ioreq(state->ioservid, addr);
         state->buffered_io_page = addr;
         state->shared_page = addr + TARGET_PAGE_SIZE;
diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h
index 82e56339dd..a8118b41ac 100644
--- a/include/hw/xen/xen_common.h
+++ b/include/hw/xen/xen_common.h
@@ -134,6 +134,12 @@ static inline xenforeignmemory_resource_handle *xenforeignmemory_map_resource(
     return NULL;
 }
 
+static inline int xenforeignmemory_unmap_resource(
+    xenforeignmemory_handle *fmem, xenforeignmemory_resource_handle *fres)
+{
+    return 0;
+}
+
 #endif /* CONFIG_XEN_CTRL_INTERFACE_VERSION < 41100 */
 
 #if CONFIG_XEN_CTRL_INTERFACE_VERSION < 41000
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jul 05 10:00:37 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Jul 2021 10:00:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150043.277488 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0LP3-0003Y0-I2; Mon, 05 Jul 2021 10:00:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150043.277488; Mon, 05 Jul 2021 10:00:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0LP3-0003Xs-F0; Mon, 05 Jul 2021 10:00:37 +0000
Received: by outflank-mailman (input) for mailman id 150043;
 Mon, 05 Jul 2021 10:00:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0LP1-0003Xa-UH
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 10:00:35 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0LP1-0003kU-TQ
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 10:00:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0LP1-0001dE-SR
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 10: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3+UftY8qinYXXeAtT21HTd+vyLzODzm1pwZRe19BeNU=; b=DaIDgX+r++Ja5Cgu5cGCtYWv7i
	u5iBpS51wPrf1DErMY7sIz5UPfJVnm88BXnkpCIWAIcbBvS6iXykmbuE/r4JCjigT5511GbkTEWpR
	fhMNOfyn8wlx3diyOMkcpTzFLg42cz+V3k8tdw3VLA1r6ov+crcU+sKsHUFNIRkR/PIU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] xen-block: Use specific blockdev driver
Message-Id: <E1m0LP1-0001dE-SR@xenbits.xenproject.org>
Date: Mon, 05 Jul 2021 10:00:35 +0000

commit 136c34c9bc4179dc64b15b2bb5f0c54ca4ddf823
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Fri Apr 30 17:34:32 2021 +0100
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Mon Jul 5 10:45:21 2021 +0100

    xen-block: Use specific blockdev driver
    
    ... when a xen-block backend instance is created via xenstore.
    
    Following 8d17adf34f50 ("block: remove support for using "file" driver
    with block/char devices"), using the "file" blockdev driver for
    everything doesn't work anymore, we need to use the "host_device"
    driver when the disk image is a block device and "file" driver when it
    is a regular file.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Paul Durrant <paul@xen.org>
    Message-Id: <20210430163432.468894-1-anthony.perard@citrix.com>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    (cherry picked from commit 1898293990702c5601e225dac9afd2402fc46e2d)
---
 hw/block/xen-block.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
index 83754a4344..674953f1ad 100644
--- a/hw/block/xen-block.c
+++ b/hw/block/xen-block.c
@@ -728,6 +728,8 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
     XenBlockDrive *drive = NULL;
     QDict *file_layer;
     QDict *driver_layer;
+    struct stat st;
+    int rc;
 
     if (params) {
         char **v = g_strsplit(params, ":", 2);
@@ -761,7 +763,17 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
     file_layer = qdict_new();
     driver_layer = qdict_new();
 
-    qdict_put_str(file_layer, "driver", "file");
+    rc = stat(filename, &st);
+    if (rc) {
+        error_setg_errno(errp, errno, "Could not stat file '%s'", filename);
+        goto done;
+    }
+    if (S_ISBLK(st.st_mode)) {
+        qdict_put_str(file_layer, "driver", "host_device");
+    } else {
+        qdict_put_str(file_layer, "driver", "file");
+    }
+
     qdict_put_str(file_layer, "filename", filename);
     g_free(filename);
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jul 05 10:55:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Jul 2021 10:55:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150093.277569 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0MFm-0003m5-E0; Mon, 05 Jul 2021 10:55:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150093.277569; Mon, 05 Jul 2021 10:55:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0MFm-0003lx-Aw; Mon, 05 Jul 2021 10:55:06 +0000
Received: by outflank-mailman (input) for mailman id 150093;
 Mon, 05 Jul 2021 10:55:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0MFl-0003ln-02
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 10:55:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0MFk-0004e2-Ub
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 10:55:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0MFk-0005bg-Tg
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 10:55: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ON5YF2sMYXqzdBANZO1dQPf5+2jIB9jpr1MnF3Vc0ys=; b=BaI5tx+fIVlRuVPbBZDPxyK+Z/
	iUvxkBCUDebLnz/IbAQI2nYSbg7szd7JNAOp32fPeZbKDEc579Qgm297x1CMuqBm/zk5XBv9dIY31
	9HoCoxC17gsYmg/iZibQxAay8rprIHjO4hfdUNy7QW8Eu0LIKliHoWFa0E5Ga17SiZdw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxenguest: Fix max_extd_leaf calculation for legacy restore
Message-Id: <E1m0MFk-0005bg-Tg@xenbits.xenproject.org>
Date: Mon, 05 Jul 2021 10:55:04 +0000

commit 5fa174cbf54cc625a023b8e7170e359dd150c072
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jul 2 18:37:57 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Jul 5 11:30:14 2021 +0100

    tools/libxenguest: Fix max_extd_leaf calculation for legacy restore
    
    0x1c is lower than any value which will actually be observed in
    p->extd.max_leaf, but higher than the logical 9 leaves worth of extended data
    on Intel systems, causing x86_cpuid_copy_to_buffer() to fail with -ENOBUFS.
    
    Correct the calculation.
    
    The problem was first noticed in c/s 34990446ca9 "libxl: don't ignore the
    return value from xc_cpuid_apply_policy" but introduced earlier.
    
    Fixes: 111c8c33a8a1 ("x86/cpuid: do not expand max leaves on restore")
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 tools/libs/guest/xg_cpuid_x86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x86.c
index e01d657e03..0c9c4fefc1 100644
--- a/tools/libs/guest/xg_cpuid_x86.c
+++ b/tools/libs/guest/xg_cpuid_x86.c
@@ -513,7 +513,7 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
         /* Clamp maximum leaves to the ones supported on 4.12. */
         p->basic.max_leaf = min(p->basic.max_leaf, 0xdu);
         p->feat.max_subleaf = 0;
-        p->extd.max_leaf = min(p->extd.max_leaf, 0x1cu);
+        p->extd.max_leaf = min(p->extd.max_leaf, 0x8000001c);
     }
 
     if ( featureset )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jul 05 10:55:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Jul 2021 10:55:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150094.277573 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0MFw-0003oh-Fd; Mon, 05 Jul 2021 10:55:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150094.277573; Mon, 05 Jul 2021 10:55:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0MFw-0003oV-CT; Mon, 05 Jul 2021 10:55:16 +0000
Received: by outflank-mailman (input) for mailman id 150094;
 Mon, 05 Jul 2021 10:55:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0MFv-0003oH-2A
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 10:55:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0MFv-0004eF-1N
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 10:55:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0MFv-0005cQ-0N
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 10: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gM+b7AOc1Rl8bEA/uNNhAHu0QIwo9TF04JwfuIICVXQ=; b=n1dLlqwbylXZEBShCZ+qYRKxG+
	+U4MTK9Oshn7Jpuc/ecUvhADaWmjYI8/nB4YimX6otDj7+pT/aTD4AVnT3AF40RzMQnd2gl0f6kyl
	4ntKn/zVlu6SPgFMpVD9SvhASjCz74UrJUAkw4+YXsc/ooIO62QoK9pKqV2CC0mf3k/o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxenguest: Fix migration's debug option
Message-Id: <E1m0MFv-0005cQ-0N@xenbits.xenproject.org>
Date: Mon, 05 Jul 2021 10:55:15 +0000

commit 383b41974d5543b62f3181d216070fe3691fb130
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jul 2 19:08:46 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Jul 5 11:30:14 2021 +0100

    tools/libxenguest: Fix migration's debug option
    
    The code has gone through many refactors, but the first refactor was the one
    which broke it by inverting the check with respect to checkpointed streams.
    
    Fixes: 7449fb36c6c8 ("migration/save: pass checkpointed_stream from libxl to libxc")
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 tools/libs/guest/xg_sr_save.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index 2ba7c3200c..f0e2bd048d 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -752,7 +752,7 @@ static int send_domain_memory_live(struct xc_sr_context *ctx)
     if ( rc )
         goto out;
 
-    if ( ctx->save.debug && ctx->stream_type != XC_STREAM_PLAIN )
+    if ( ctx->save.debug && ctx->stream_type == XC_STREAM_PLAIN )
     {
         rc = verify_frames(ctx);
         if ( rc )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jul 05 14:55:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Jul 2021 14:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150294.277902 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0Q02-0008A2-Cx; Mon, 05 Jul 2021 14:55:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150294.277902; Mon, 05 Jul 2021 14:55:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0Q02-00089u-A5; Mon, 05 Jul 2021 14:55:06 +0000
Received: by outflank-mailman (input) for mailman id 150294;
 Mon, 05 Jul 2021 14:55:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0Q01-00089o-8h
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 14:55:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0Q01-0000R4-65
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 14:55:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0Q01-00061W-4Y
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 14: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/1U/m2emM2Ygny/q1cZoQ6q7J/1yrbCjZsKdKH6uri4=; b=BAZdMNepTX7tOd94uCOqRYN7XZ
	JYSFB1d7Ml+9axbBB0njvNtNybG/th1JpqQwyM5KHOJnUkAlfQ1gxork61e2MODa8FSoK/EH3Ky1I
	Yqt12KUvI7ZMdTEc0ImopS4oYEDqDDz3QZxTR4+eHzY1VDz+OmXCKA7YK14VhQVm+Aq8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: drop callback_mask pseudo-variables
Message-Id: <E1m0Q01-00061W-4Y@xenbits.xenproject.org>
Date: Mon, 05 Jul 2021 14:55:05 +0000

commit 5b2a5523d697b6d1a97a18d33dc6bf92a33def32
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jul 5 16:46:46 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 5 16:46:46 2021 +0200

    x86/shadow: drop callback_mask pseudo-variables
    
    In commit 90629587e16e ("x86/shadow: replace stale literal numbers in
    hash_{vcpu,domain}_foreach()") I had to work around Clang not following
    gcc in certain relaxed requirements as to the expressions usable with
    _Static_assert() (gcc tolerates static const variables in otherwise
    integer constant expressions). Roberto suggests that we'd better not
    rely on such behavior. Drop the involved static const-s, using their
    "expansions" in both of the prior use sites each. This then allows
    dropping the short-circuiting of the check for clang.
    
    Requested-by: Roberto Bagnara <roberto.bagnara@bugseng.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 6db538502d..8c1b041f71 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1626,12 +1626,8 @@ void shadow_hash_delete(struct domain *d, unsigned long n, unsigned int t,
 typedef int (*hash_vcpu_callback_t)(struct vcpu *v, mfn_t smfn, mfn_t other_mfn);
 typedef int (*hash_domain_callback_t)(struct domain *d, mfn_t smfn, mfn_t other_mfn);
 
-#ifndef __clang__ /* At least some versions dislike some of the uses. */
 #define HASH_CALLBACKS_CHECK(mask) \
     BUILD_BUG_ON((mask) > (1U << ARRAY_SIZE(callbacks)) - 1)
-#else
-#define HASH_CALLBACKS_CHECK(mask) ((void)(mask))
-#endif
 
 static void hash_vcpu_foreach(struct vcpu *v, unsigned int callback_mask,
                               const hash_vcpu_callback_t callbacks[],
@@ -1829,7 +1825,6 @@ int sh_remove_write_access(struct domain *d, mfn_t gmfn,
         [SH_type_l1_64_shadow] = SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, 4),
         [SH_type_fl1_64_shadow] = SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, 4),
     };
-    static const unsigned int callback_mask = SHF_L1_ANY | SHF_FL1_ANY;
     struct page_info *pg = mfn_to_page(gmfn);
 #if SHADOW_OPTIMIZATIONS & SHOPT_WRITABLE_HEURISTIC
     struct vcpu *curr = current;
@@ -2004,8 +1999,8 @@ int sh_remove_write_access(struct domain *d, mfn_t gmfn,
         perfc_incr(shadow_writeable_bf_1);
     else
         perfc_incr(shadow_writeable_bf);
-    HASH_CALLBACKS_CHECK(callback_mask);
-    hash_domain_foreach(d, callback_mask, callbacks, gmfn);
+    HASH_CALLBACKS_CHECK(SHF_L1_ANY | SHF_FL1_ANY);
+    hash_domain_foreach(d, SHF_L1_ANY | SHF_FL1_ANY, callbacks, gmfn);
 
     /* If that didn't catch the mapping, then there's some non-pagetable
      * mapping -- ioreq page, grant mapping, &c. */
@@ -2044,7 +2039,6 @@ int sh_remove_all_mappings(struct domain *d, mfn_t gmfn, gfn_t gfn)
         [SH_type_l1_64_shadow] = SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, 4),
         [SH_type_fl1_64_shadow] = SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, 4),
     };
-    static const unsigned int callback_mask = SHF_L1_ANY | SHF_FL1_ANY;
 
     perfc_incr(shadow_mappings);
     if ( sh_check_page_has_no_refs(page) )
@@ -2060,8 +2054,8 @@ int sh_remove_all_mappings(struct domain *d, mfn_t gmfn, gfn_t gfn)
 
     /* Brute-force search of all the shadows, by walking the hash */
     perfc_incr(shadow_mappings_bf);
-    HASH_CALLBACKS_CHECK(callback_mask);
-    hash_domain_foreach(d, callback_mask, callbacks, gmfn);
+    HASH_CALLBACKS_CHECK(SHF_L1_ANY | SHF_FL1_ANY);
+    hash_domain_foreach(d, SHF_L1_ANY | SHF_FL1_ANY, callbacks, gmfn);
 
     /* If that didn't catch the mapping, something is very wrong */
     if ( !sh_check_page_has_no_refs(page) )
@@ -2307,10 +2301,9 @@ void sh_reset_l3_up_pointers(struct vcpu *v)
     static const hash_vcpu_callback_t callbacks[SH_type_unused] = {
         [SH_type_l3_64_shadow] = sh_clear_up_pointer,
     };
-    static const unsigned int callback_mask = SHF_L3_64;
 
-    HASH_CALLBACKS_CHECK(callback_mask);
-    hash_vcpu_foreach(v, callback_mask, callbacks, INVALID_MFN);
+    HASH_CALLBACKS_CHECK(SHF_L3_64);
+    hash_vcpu_foreach(v, SHF_L3_64, callbacks, INVALID_MFN);
 }
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jul 05 14:55:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Jul 2021 14:55:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150295.277906 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0Q0C-0008Bj-EQ; Mon, 05 Jul 2021 14:55:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150295.277906; Mon, 05 Jul 2021 14:55:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0Q0C-0008Bb-Bb; Mon, 05 Jul 2021 14:55:16 +0000
Received: by outflank-mailman (input) for mailman id 150295;
 Mon, 05 Jul 2021 14:55:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0Q0B-0008BP-AY
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 14:55:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0Q0B-0000R8-9V
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 14:55:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0Q0B-000625-8I
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 14: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6PD7Rk8oV3I4EQ0VpYRo81j0qqMGlXXM/mYVVs/+YK0=; b=noNfjulgECxcQPFpKzzckr+wGv
	fUE+sPQ4G3mpSrxpDb/EIy9iNsbXbS9LLDlE/YGKOzYCAajyB0jEco3qVk9xajrJHljgsrYMXbTAo
	UOADKbgXW5E73XUPmccmAFOkP4X9zZyWA3NMDjaFnuZ6YGmBm+OLyC2vTkdQKwe/s91w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] build: fix %.s: %.S rule
Message-Id: <E1m0Q0B-000625-8I@xenbits.xenproject.org>
Date: Mon, 05 Jul 2021 14:55:15 +0000

commit d468f9522174114ab06239894b6079c0a487e408
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Mon Jul 5 16:47:51 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 5 16:47:51 2021 +0200

    build: fix %.s: %.S rule
    
    Fixes: e321576f4047 ("xen/build: start using if_changed")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Rules.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index ceb3d204b8..d65d6a4899 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -227,8 +227,8 @@ cmd_cpp_i_c = $(CPP) $(filter-out -Wa$(comma)%,$(c_flags)) -MQ $@ -o $@ $<
 quiet_cmd_cc_s_c = CC      $@
 cmd_cc_s_c = $(CC) $(filter-out -Wa$(comma)%,$(c_flags)) -S $< -o $@
 
-quiet_cmd_s_S = CPP     $@
-cmd_s_S = $(CPP) $(filter-out -Wa$(comma)%,$(a_flags)) -MQ $@ -o $@ $<
+quiet_cmd_cpp_s_S = CPP     $@
+cmd_cpp_s_S = $(CPP) $(filter-out -Wa$(comma)%,$(a_flags)) -MQ $@ -o $@ $<
 
 %.i: %.c FORCE
 	$(call if_changed,cpp_i_c)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jul 05 14:55:26 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Jul 2021 14:55:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150296.277910 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0Q0M-0008FE-G0; Mon, 05 Jul 2021 14:55:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150296.277910; Mon, 05 Jul 2021 14:55:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0Q0M-0008F6-D5; Mon, 05 Jul 2021 14:55:26 +0000
Received: by outflank-mailman (input) for mailman id 150296;
 Mon, 05 Jul 2021 14:55:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0Q0L-0008Eo-DH
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 14:55:25 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0Q0L-0000RV-CT
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 14:55:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0Q0L-00062h-Ba
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 14: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZWKU1+BO0eUup1PHUp6s4iJ2UpiaHAUhVnrtWJsi2aM=; b=N+ekCQEqWG7y7lZycO4cwvBjrn
	lhWdFI40UJfQor1CLeMB6PGgygrmVhvCyYAdzeK6yYN2zYcdEpsNmp5KCB0H+NIlOCNvwHPkunHvk
	kD7OXp/JgyLfUTWdNrRzbNdPaEmdmOf52+SBq4uKpjewNP8mbFDcUuEnWZo0fYiM+gFA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] MAINTAINERS: Updating after change to tools/include/
Message-Id: <E1m0Q0L-00062h-Ba@xenbits.xenproject.org>
Date: Mon, 05 Jul 2021 14:55:25 +0000

commit 44e8904ebfbc57ba0950c40b9d3a28507b553e4e
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Mon Jul 5 16:48:06 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 5 16:48:06 2021 +0200

    MAINTAINERS: Updating after change to tools/include/
    
    The LIBS section doesn't mention the headers associated with the
    libraries, same for LIBXENLIGHT section.
    
    They aren't any ':' in other section names, so remove it.
    
    Fixes: 4664034cdc72 ("tools/libs: move official headers to common directory")
    Fixes: f7079d7ef69f ("MAINTAINERS: add myself as tools/libs reviewer")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 MAINTAINERS | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 8a52a03969..56d16e4328 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -374,11 +374,25 @@ F:	xen/include/{kexec,kimage}.h
 F:	xen/arch/x86/machine_kexec.c
 F:	xen/arch/x86/x86_64/kexec_reloc.S
 
-LIBS:
+LIBS
 M:	Ian Jackson <iwj@xenproject.org>
 M:	Wei Liu <wl@xen.org>
 R:	Juergen Gross <jgross@suse.com>
 S:	Supported
+F:	tools/include/libxenvchan.h
+F:	tools/include/xencall.h
+F:	tools/include/xenctrl*.h
+F:	tools/include/xendevicemodel.h
+F:	tools/include/xenevtchn.h
+F:	tools/include/xenforeignmemory.h
+F:	tools/include/xengnttab.h
+F:	tools/include/xenguest.h
+F:	tools/include/xenhypfs.h
+F:	tools/include/xenstat.h
+F:	tools/include/xenstore*.h
+F:	tools/include/xenstore-compat/*.h
+F:	tools/include/xentoolcore*.h
+F:	tools/include/xentoollog.h
 F:	tools/libs/
 
 LIBXENLIGHT
@@ -386,6 +400,7 @@ M:	Ian Jackson <iwj@xenproject.org>
 M:	Wei Liu <wl@xen.org>
 M:	Anthony PERARD <anthony.perard@citrix.com>
 S:	Supported
+F:	tools/include/libxl*.h
 F:	tools/libs/light/
 F:	tools/libs/util/
 F:	tools/xl/
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jul 05 16:34:02 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Jul 2021 16:34:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150541.278328 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0RXi-0006pf-PQ; Mon, 05 Jul 2021 16:33:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150541.278328; Mon, 05 Jul 2021 16:33:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0RXi-0006pY-L0; Mon, 05 Jul 2021 16:33:58 +0000
Received: by outflank-mailman (input) for mailman id 150541;
 Mon, 05 Jul 2021 16:33:57 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0RXh-0006pS-G1
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 16:33:57 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0RXh-00033D-Ee
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 16:33:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0RXh-000164-DX
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 16: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OgKvOtLSPqAtCKLsBIsqLIFweGap+HnVg+MQXgkY0do=; b=WG1ejniaI3BLupvgpR7iQf2hck
	PZpTOHkAqBeNqZjvpTZdJTZFGu/H59gfO6UvvtEnq66cq/cL2z4g8YsPXzUlOWGIG9AlW22V0QDb+
	mA05FfiHzqi1sYk6p50uP+H5TANKfonstCZ0nE4BXbVyvIQ0JN8kvarcGadLUEuTTHpY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge tag 'v6.0.0' into 'staging'
Message-Id: <E1m0RXh-000164-DX@xenbits.xenproject.org>
Date: Mon, 05 Jul 2021 16:33:57 +0000

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

commit df430619eba32ea76ed1138deac06d6057d54b3e
Merge: 609d7596524ab204ccd71ef42c9eee4c7c338ea4 7ea428895af2840d85c524f0bd11a38aac308308
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Mon Jul 5 10:42:40 2021 +0100
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Mon Jul 5 10:42:40 2021 +0100

    Merge tag 'v6.0.0' into 'staging'
 .cirrus.yml                                        |    153 +-
 .editorconfig                                      |     18 +-
 .gitattributes                                     |      3 +
 .github/lockdown.yml                               |      8 +-
 .gitignore                                         |    160 +-
 .gitlab-ci.d/check-dco.py                          |     94 +
 .gitlab-ci.d/check-patch.py                        |     56 +
 .gitlab-ci.d/containers.yml                        |     57 +-
 .gitlab-ci.d/crossbuilds.yml                       |    209 +
 .gitlab-ci.d/edk2.yml                              |      1 +
 .gitlab-ci.d/opensbi.yml                           |     29 +-
 .gitlab-ci.yml                                     |    630 +-
 .gitmodules                                        |     46 +-
 .mailmap                                           |     13 +-
 .readthedocs.yml                                   |      2 +-
 .shippable.yml                                     |     39 -
 .travis.yml                                        |    285 +-
 CODING_STYLE.rst                                   |    641 -
 Changelog                                          |    580 -
 Kconfig                                            |      1 +
 Kconfig.host                                       |     12 +-
 MAINTAINERS                                        |    618 +-
 Makefile                                           |   1373 +-
 Makefile.objs                                      |    215 -
 Makefile.target                                    |    287 -
 README.rst                                         |     27 +-
 VERSION                                            |      2 +-
 accel/Kconfig                                      |      9 +
 accel/Makefile.objs                                |      6 -
 accel/accel-common.c                               |    105 +
 accel/accel-softmmu.c                              |    100 +
 accel/accel-softmmu.h                              |     15 +
 accel/accel-user.c                                 |     24 +
 accel/accel.c                                      |     85 -
 accel/dummy-cpus.c                                 |     72 +
 accel/hvf/entitlements.plist                       |      8 +
 accel/kvm/Makefile.objs                            |      2 -
 accel/kvm/kvm-accel-ops.c                          |    100 +
 accel/kvm/kvm-all.c                                |    147 +-
 accel/kvm/kvm-cpus.h                               |     22 +
 accel/kvm/meson.build                              |      8 +
 accel/kvm/sev-stub.c                               |     10 +-
 accel/kvm/trace-events                             |      1 +
 accel/kvm/trace.h                                  |      1 +
 accel/meson.build                                  |     17 +
 accel/qtest.c                                      |     54 -
 accel/qtest/meson.build                            |      6 +
 accel/qtest/qtest.c                                |     71 +
 accel/stubs/Makefile.objs                          |      6 -
 accel/stubs/hax-stub.c                             |     11 -
 accel/stubs/hvf-stub.c                             |     30 -
 accel/stubs/kvm-stub.c                             |     33 -
 accel/stubs/meson.build                            |      4 +
 accel/stubs/tcg-stub.c                             |     11 +-
 accel/stubs/whpx-stub.c                            |     47 -
 accel/stubs/xen-stub.c                             |     43 +-
 accel/tcg/Makefile.objs                            |      9 -
 accel/tcg/atomic_common.c.inc                      |     54 +
 accel/tcg/atomic_common.inc.c                      |     54 -
 accel/tcg/atomic_template.h                        |     20 +-
 accel/tcg/cpu-exec.c                               |    312 +-
 accel/tcg/cputlb.c                                 |    500 +-
 accel/tcg/internal.h                               |     20 +
 accel/tcg/meson.build                              |     22 +
 accel/tcg/plugin-gen.c                             |     60 +-
 accel/tcg/tcg-accel-ops-icount.c                   |    144 +
 accel/tcg/tcg-accel-ops-icount.h                   |     19 +
 accel/tcg/tcg-accel-ops-mttcg.c                    |    133 +
 accel/tcg/tcg-accel-ops-mttcg.h                    |     19 +
 accel/tcg/tcg-accel-ops-rr.c                       |    298 +
 accel/tcg/tcg-accel-ops-rr.h                       |     21 +
 accel/tcg/tcg-accel-ops.c                          |    133 +
 accel/tcg/tcg-accel-ops.h                          |     22 +
 accel/tcg/tcg-all.c                                |     87 +-
 accel/tcg/tcg-runtime.c                            |     10 +-
 accel/tcg/tcg-runtime.h                            |     13 +-
 accel/tcg/trace-events                             |      2 +-
 accel/tcg/trace.h                                  |      1 +
 accel/tcg/translate-all.c                          |    612 +-
 accel/tcg/translate-all.h                          |     39 -
 accel/tcg/translator.c                             |     10 +-
 accel/tcg/user-exec-stub.c                         |      4 +
 accel/tcg/user-exec.c                              |    113 +-
 accel/xen/Makefile.objs                            |      1 -
 accel/xen/meson.build                              |      1 +
 accel/xen/xen-all.c                                |     22 +-
 audio/Makefile.objs                                |     35 -
 audio/alsaaudio.c                                  |     18 +-
 audio/audio.c                                      |    187 +-
 audio/audio.h                                      |      2 +-
 audio/audio_int.h                                  |      2 +
 audio/audio_legacy.c                               |      3 +-
 audio/audio_template.h                             |     26 +-
 audio/audio_win_int.c                              |     73 +-
 audio/coreaudio.c                                  |    474 +-
 audio/dsound_template.h                            |      2 +-
 audio/dsoundaudio.c                                |     56 +-
 audio/jackaudio.c                                  |     71 +-
 audio/meson.build                                  |     30 +
 audio/noaudio.c                                    |      1 +
 audio/ossaudio.c                                   |     13 +-
 audio/paaudio.c                                    |     73 +-
 audio/sdlaudio.c                                   |    305 +-
 audio/spiceaudio.c                                 |     31 +-
 audio/trace-events                                 |      3 -
 audio/trace.h                                      |      1 +
 audio/wavcapture.c                                 |      8 +-
 authz/Makefile.objs                                |      7 -
 authz/base.c                                       |      2 +-
 authz/list.c                                       |      3 +-
 authz/listfile.c                                   |     14 +-
 authz/meson.build                                  |      9 +
 authz/pamacct.c                                    |      9 +-
 authz/simple.c                                     |     17 +-
 authz/trace.h                                      |      1 +
 backends/Makefile.objs                             |     23 -
 backends/confidential-guest-support.c              |     33 +
 backends/cryptodev-builtin.c                       |      9 +-
 backends/cryptodev-vhost-user.c                    |     24 +-
 backends/cryptodev-vhost.c                         |      2 +-
 backends/cryptodev.c                               |     10 +-
 backends/dbus-vmstate.c                            |     42 +-
 backends/hostmem-file.c                            |     42 +-
 backends/hostmem-memfd.c                           |      7 +-
 backends/hostmem.c                                 |     21 +-
 backends/meson.build                               |     20 +
 backends/rng-builtin.c                             |     10 +-
 backends/rng-egd.c                                 |     17 +-
 backends/rng-random.c                              |     10 +-
 backends/rng.c                                     |      8 +-
 backends/tpm/Makefile.objs                         |      4 -
 backends/tpm/meson.build                           |      8 +
 backends/tpm/tpm_emulator.c                        |     10 +-
 backends/tpm/tpm_ioctl.h                           |      4 +
 backends/tpm/tpm_passthrough.c                     |     15 +-
 backends/tpm/tpm_util.c                            |     18 +-
 backends/tpm/trace.h                               |      1 +
 backends/trace.h                                   |      1 +
 backends/vhost-user.c                              |      7 +-
 block.c                                            |   1169 +-
 block/Makefile.objs                                |     75 -
 block/accounting.c                                 |     32 +-
 block/backup-top.c                                 |     41 +-
 block/backup-top.h                                 |      1 +
 block/backup.c                                     |    253 +-
 block/blkdebug.c                                   |     19 +-
 block/blklogwrites.c                               |     11 +-
 block/blkreplay.c                                  |      6 +-
 block/blkverify.c                                  |     13 +-
 block/block-backend.c                              |     43 +-
 block/block-copy.c                                 |    234 +-
 block/block-gen.h                                  |     49 +
 block/commit.c                                     |    103 +-
 block/copy-on-read.c                               |    197 +-
 block/copy-on-read.h                               |     32 +
 block/coroutines.h                                 |     69 +
 block/crypto.c                                     |     15 +-
 block/crypto.h                                     |      2 +-
 block/curl.c                                       |    106 +-
 block/dirty-bitmap.c                               |     59 +-
 block/dmg-lzfse.c                                  |      1 -
 block/dmg.c                                        |      2 +-
 block/export/export.c                              |    361 +
 block/export/fuse.c                                |    726 +
 block/export/meson.build                           |      7 +
 block/export/vhost-user-blk-server.c               |    526 +
 block/export/vhost-user-blk-server.h               |     19 +
 block/file-posix.c                                 |     85 +-
 block/file-win32.c                                 |     27 +-
 block/filter-compress.c                            |      2 -
 block/gluster.c                                    |     17 +-
 block/io.c                                         |   1177 +-
 block/io_uring.c                                   |      2 +-
 block/iscsi.c                                      |     54 +-
 block/meson.build                                  |    128 +
 block/mirror.c                                     |    202 +-
 block/monitor/Makefile.objs                        |      2 -
 block/monitor/block-hmp-cmds.c                     |     39 +-
 block/monitor/meson.build                          |      2 +
 block/nbd.c                                        |    538 +-
 block/nfs.c                                        |     17 +-
 block/null.c                                       |      7 +
 block/nvme.c                                       |    495 +-
 block/parallels-ext.c                              |    300 +
 block/parallels.c                                  |     26 +-
 block/parallels.h                                  |      7 +-
 block/preallocate.c                                |    559 +
 block/qapi.c                                       |    142 +-
 block/qcow.c                                       |      9 -
 block/qcow2-bitmap.c                               |    105 +-
 block/qcow2-cluster.c                              |    978 +-
 block/qcow2-refcount.c                             |    144 +-
 block/qcow2-snapshot.c                             |     29 +-
 block/qcow2.c                                      |    593 +-
 block/qcow2.h                                      |    264 +-
 block/qed.c                                        |     24 +-
 block/quorum.c                                     |    121 +-
 block/raw-format.c                                 |      6 +
 block/rbd.c                                        |     55 +-
 block/replication.c                                |      2 +
 block/sheepdog.c                                   |     18 +-
 block/snapshot.c                                   |    360 +-
 block/stream.c                                     |    211 +-
 block/throttle-groups.c                            |     69 +-
 block/throttle.c                                   |     15 +-
 block/trace-events                                 |     53 +-
 block/trace.h                                      |      1 +
 block/vdi.c                                        |     11 +-
 block/vhdx.c                                       |      6 +-
 block/vmdk.c                                       |     36 +-
 block/vpc.c                                        |    154 +-
 block/vvfat.c                                      |     17 +-
 blockdev-nbd.c                                     |    177 +-
 blockdev.c                                         |    328 +-
 blockjob.c                                         |     44 +-
 bootdevice.c                                       |    429 -
 bsd-user/Makefile.objs                             |      2 -
 bsd-user/arm/target_arch_sysarch.h                 |     78 +
 bsd-user/arm/target_syscall.h                      |     36 +
 bsd-user/elfload.c                                 |      2 +-
 bsd-user/freebsd/os-strace.h                       |     29 +
 bsd-user/freebsd/strace.list                       |     65 +-
 bsd-user/freebsd/syscall_nr.h                      |    695 +-
 bsd-user/i386/target_arch_sysarch.h                |     77 +
 bsd-user/i386/target_syscall.h                     |     19 +
 bsd-user/main.c                                    |     24 +-
 bsd-user/meson.build                               |     10 +
 bsd-user/mips/target_arch_sysarch.h                |     69 +
 bsd-user/mips/target_syscall.h                     |     52 +
 bsd-user/mips64/target_arch_sysarch.h              |     69 +
 bsd-user/mips64/target_syscall.h                   |     53 +
 bsd-user/mmap.c                                    |     23 +-
 bsd-user/netbsd/os-strace.h                        |      1 +
 bsd-user/openbsd/os-strace.h                       |      1 +
 bsd-user/qemu.h                                    |     17 +-
 bsd-user/sparc/target_arch_sysarch.h               |     52 +
 bsd-user/sparc/target_syscall.h                    |     24 +-
 bsd-user/sparc64/target_arch_sysarch.h             |     52 +
 bsd-user/sparc64/target_syscall.h                  |     24 +-
 bsd-user/strace.c                                  |     11 +
 bsd-user/syscall.c                                 |      6 +-
 bsd-user/x86_64/target_arch_sysarch.h              |     76 +
 bsd-user/x86_64/target_syscall.h                   |     21 +-
 capstone                                           |      2 +-
 chardev/Makefile.objs                              |     29 -
 chardev/baum.c                                     |      9 +-
 chardev/char-fd.c                                  |      2 +-
 chardev/char-mux.c                                 |     38 +-
 chardev/char-pipe.c                                |      6 +-
 chardev/char-pty.c                                 |      9 +-
 chardev/char-ringbuf.c                             |     10 +-
 chardev/char-socket.c                              |    140 +-
 chardev/char-stdio.c                               |      4 +-
 chardev/char-udp.c                                 |      9 +-
 chardev/char-win-stdio.c                           |     10 +-
 chardev/char.c                                     |    136 +-
 chardev/chardev-internal.h                         |      8 +-
 chardev/chardev-sysemu.c                           |     69 -
 chardev/meson.build                                |     44 +
 chardev/msmouse.c                                  |     10 +-
 chardev/spice.c                                    |     39 +-
 chardev/testdev.c                                  |     10 +-
 chardev/trace.h                                    |      1 +
 chardev/wctablet.c                                 |     10 +-
 configure                                          |   4134 +-
 contrib/elf2dmp/Makefile.objs                      |      4 -
 contrib/elf2dmp/addrspace.c                        |      4 +-
 contrib/elf2dmp/addrspace.h                        |      6 +-
 contrib/elf2dmp/main.c                             |     22 +-
 contrib/elf2dmp/meson.build                        |      5 +
 contrib/elf2dmp/pdb.c                              |      1 +
 contrib/elf2dmp/qemu_elf.c                         |      1 +
 contrib/gitdm/domain-map                           |     10 +-
 contrib/gitdm/filetypes.txt                        |      8 +-
 contrib/gitdm/group-map-academics                  |      4 +
 contrib/gitdm/group-map-individuals                |     13 +
 contrib/gitdm/group-map-redhat                     |      1 +
 contrib/ivshmem-client/Makefile.objs               |      1 -
 contrib/ivshmem-client/ivshmem-client.c            |     12 +-
 contrib/ivshmem-client/ivshmem-client.h            |      2 +-
 contrib/ivshmem-client/meson.build                 |      4 +
 contrib/ivshmem-server/Makefile.objs               |      1 -
 contrib/ivshmem-server/ivshmem-server.c            |     12 +-
 contrib/ivshmem-server/main.c                      |      2 +-
 contrib/ivshmem-server/meson.build                 |      4 +
 contrib/libvhost-user/Makefile.objs                |      1 -
 contrib/libvhost-user/libvhost-user-glib.c         |    170 -
 contrib/libvhost-user/libvhost-user-glib.h         |     36 -
 contrib/libvhost-user/libvhost-user.c              |   2821 -
 contrib/libvhost-user/libvhost-user.h              |    664 -
 contrib/plugins/Makefile                           |     43 +
 contrib/plugins/hotblocks.c                        |    145 +
 contrib/plugins/hotpages.c                         |    193 +
 contrib/plugins/howvec.c                           |    361 +
 contrib/plugins/hwprofile.c                        |    305 +
 contrib/plugins/lockstep.c                         |    343 +
 contrib/rdmacm-mux/Makefile.objs                   |      3 -
 contrib/rdmacm-mux/main.c                          |      2 +-
 contrib/rdmacm-mux/meson.build                     |      9 +
 contrib/vhost-user-blk/Makefile.objs               |      1 -
 contrib/vhost-user-blk/meson.build                 |      5 +
 contrib/vhost-user-blk/vhost-user-blk.c            |      9 +-
 contrib/vhost-user-gpu/Makefile.objs               |     10 -
 contrib/vhost-user-gpu/meson.build                 |     13 +
 contrib/vhost-user-gpu/vhost-user-gpu.c            |    106 +-
 contrib/vhost-user-gpu/virgl.c                     |      6 +-
 contrib/vhost-user-gpu/vugbm.c                     |     45 +-
 contrib/vhost-user-gpu/vugbm.h                     |      4 +-
 contrib/vhost-user-gpu/vugpu.h                     |     13 +-
 contrib/vhost-user-input/Makefile.objs             |      1 -
 contrib/vhost-user-input/main.c                    |      8 +-
 contrib/vhost-user-input/meson.build               |      4 +
 contrib/vhost-user-scsi/Makefile.objs              |      1 -
 contrib/vhost-user-scsi/meson.build                |      6 +
 contrib/vhost-user-scsi/vhost-user-scsi.c          |      9 +-
 cpu.c                                              |    437 +
 cpus-common.c                                      |     28 +-
 crypto/Makefile.objs                               |     43 -
 crypto/aes.c                                       |     57 +-
 crypto/afalgpriv.h                                 |      3 +
 crypto/block-luks.c                                |      9 +-
 crypto/cipher-afalg.c                              |     25 +-
 crypto/cipher-builtin.c                            |    532 -
 crypto/cipher-builtin.c.inc                        |    435 +
 crypto/cipher-gcrypt.c                             |    422 -
 crypto/cipher-gcrypt.c.inc                         |    409 +
 crypto/cipher-nettle.c                             |    733 -
 crypto/cipher-nettle.c.inc                         |    760 +
 crypto/cipher.c                                    |     44 +-
 crypto/cipherpriv.h                                |      6 +-
 crypto/desrfb.c                                    |      4 +-
 crypto/meson.build                                 |     73 +
 crypto/secret.c                                    |     14 -
 crypto/secret_common.c                             |     21 +-
 crypto/secret_keyring.c                            |     15 -
 crypto/tls-cipher-suites.c                         |      2 +-
 crypto/tlscredsanon.c                              |      3 +-
 crypto/tlscredspsk.c                               |      3 +-
 crypto/tlscredsx509.c                              |     53 +-
 crypto/trace.h                                     |      1 +
 default-configs/aarch64-linux-user.mak             |      1 -
 default-configs/aarch64-softmmu.mak                |      8 -
 default-configs/aarch64_be-linux-user.mak          |      1 -
 default-configs/alpha-linux-user.mak               |      1 -
 default-configs/alpha-softmmu.mak                  |     10 -
 default-configs/arm-linux-user.mak                 |      1 -
 default-configs/arm-softmmu.mak                    |     45 -
 default-configs/armeb-linux-user.mak               |      1 -
 default-configs/avr-softmmu.mak                    |      5 -
 default-configs/cris-linux-user.mak                |      1 -
 default-configs/cris-softmmu.mak                   |      5 -
 default-configs/devices/aarch64-softmmu.mak        |      8 +
 default-configs/devices/alpha-softmmu.mak          |     10 +
 default-configs/devices/arm-softmmu.mak            |     46 +
 default-configs/devices/avr-softmmu.mak            |      5 +
 default-configs/devices/cris-softmmu.mak           |      5 +
 default-configs/devices/hppa-softmmu.mak           |      9 +
 default-configs/devices/i386-softmmu.mak           |     31 +
 default-configs/devices/lm32-softmmu.mak           |     12 +
 default-configs/devices/m68k-softmmu.mak           |     11 +
 default-configs/devices/microblaze-softmmu.mak     |      7 +
 default-configs/devices/microblazeel-softmmu.mak   |      3 +
 default-configs/devices/mips-softmmu-common.mak    |     41 +
 default-configs/devices/mips-softmmu.mak           |      3 +
 default-configs/devices/mips64-softmmu.mak         |      4 +
 default-configs/devices/mips64el-softmmu.mak       |     15 +
 default-configs/devices/mipsel-softmmu.mak         |      3 +
 default-configs/devices/moxie-softmmu.mak          |      5 +
 default-configs/devices/nios2-softmmu.mak          |      8 +
 default-configs/devices/or1k-softmmu.mak           |      5 +
 default-configs/devices/ppc-softmmu.mak            |     18 +
 default-configs/devices/ppc64-softmmu.mak          |     11 +
 default-configs/devices/riscv32-softmmu.mak        |     15 +
 default-configs/devices/riscv64-softmmu.mak        |     15 +
 default-configs/devices/rx-softmmu.mak             |      3 +
 default-configs/devices/s390x-softmmu.mak          |     13 +
 default-configs/devices/sh4-softmmu.mak            |     11 +
 default-configs/devices/sh4eb-softmmu.mak          |      3 +
 default-configs/devices/sparc-softmmu.mak          |     11 +
 default-configs/devices/sparc64-softmmu.mak        |     12 +
 default-configs/devices/tricore-softmmu.mak        |      1 +
 default-configs/devices/unicore32-softmmu.mak      |      6 +
 default-configs/devices/x86_64-softmmu.mak         |      3 +
 default-configs/devices/xtensa-softmmu.mak         |      9 +
 default-configs/devices/xtensaeb-softmmu.mak       |      3 +
 default-configs/hppa-linux-user.mak                |      1 -
 default-configs/hppa-softmmu.mak                   |      9 -
 default-configs/i386-bsd-user.mak                  |      1 -
 default-configs/i386-linux-user.mak                |      1 -
 default-configs/i386-softmmu.mak                   |     31 -
 default-configs/lm32-softmmu.mak                   |     12 -
 default-configs/m68k-linux-user.mak                |      1 -
 default-configs/m68k-softmmu.mak                   |     10 -
 default-configs/microblaze-linux-user.mak          |      1 -
 default-configs/microblaze-softmmu.mak             |      7 -
 default-configs/microblazeel-linux-user.mak        |      1 -
 default-configs/microblazeel-softmmu.mak           |      3 -
 default-configs/mips-linux-user.mak                |      1 -
 default-configs/mips-softmmu-common.mak            |     42 -
 default-configs/mips-softmmu.mak                   |      3 -
 default-configs/mips64-linux-user.mak              |      1 -
 default-configs/mips64-softmmu.mak                 |      4 -
 default-configs/mips64el-linux-user.mak            |      1 -
 default-configs/mips64el-softmmu.mak               |     14 -
 default-configs/mipsel-linux-user.mak              |      1 -
 default-configs/mipsel-softmmu.mak                 |      3 -
 default-configs/mipsn32-linux-user.mak             |      1 -
 default-configs/mipsn32el-linux-user.mak           |      1 -
 default-configs/moxie-softmmu.mak                  |      5 -
 default-configs/nios2-linux-user.mak               |      1 -
 default-configs/nios2-softmmu.mak                  |      8 -
 default-configs/or1k-linux-user.mak                |      1 -
 default-configs/or1k-softmmu.mak                   |      5 -
 default-configs/ppc-linux-user.mak                 |      1 -
 default-configs/ppc-softmmu.mak                    |     18 -
 default-configs/ppc64-linux-user.mak               |      1 -
 default-configs/ppc64-softmmu.mak                  |     11 -
 default-configs/ppc64abi32-linux-user.mak          |      1 -
 default-configs/ppc64le-linux-user.mak             |      1 -
 default-configs/riscv32-linux-user.mak             |      1 -
 default-configs/riscv32-softmmu.mak                |     13 -
 default-configs/riscv64-linux-user.mak             |      1 -
 default-configs/riscv64-softmmu.mak                |     12 -
 default-configs/rx-softmmu.mak                     |      3 -
 default-configs/s390x-linux-user.mak               |      1 -
 default-configs/s390x-softmmu.mak                  |     13 -
 default-configs/sh4-linux-user.mak                 |      1 -
 default-configs/sh4-softmmu.mak                    |     11 -
 default-configs/sh4eb-linux-user.mak               |      1 -
 default-configs/sh4eb-softmmu.mak                  |      3 -
 default-configs/sparc-bsd-user.mak                 |      1 -
 default-configs/sparc-linux-user.mak               |      1 -
 default-configs/sparc-softmmu.mak                  |     11 -
 default-configs/sparc32plus-linux-user.mak         |      1 -
 default-configs/sparc64-bsd-user.mak               |      1 -
 default-configs/sparc64-linux-user.mak             |      1 -
 default-configs/sparc64-softmmu.mak                |     12 -
 default-configs/targets/aarch64-linux-user.mak     |      5 +
 default-configs/targets/aarch64-softmmu.mak        |      5 +
 default-configs/targets/aarch64_be-linux-user.mak  |      6 +
 default-configs/targets/alpha-linux-user.mak       |      4 +
 default-configs/targets/alpha-softmmu.mak          |      3 +
 default-configs/targets/arm-linux-user.mak         |      6 +
 default-configs/targets/arm-softmmu.mak            |      4 +
 default-configs/targets/armeb-linux-user.mak       |      7 +
 default-configs/targets/avr-softmmu.mak            |      2 +
 default-configs/targets/cris-linux-user.mak        |      1 +
 default-configs/targets/cris-softmmu.mak           |      1 +
 default-configs/targets/hexagon-linux-user.mak     |      1 +
 default-configs/targets/hppa-linux-user.mak        |      5 +
 default-configs/targets/hppa-softmmu.mak           |      4 +
 default-configs/targets/i386-bsd-user.mak          |      2 +
 default-configs/targets/i386-linux-user.mak        |      4 +
 default-configs/targets/i386-softmmu.mak           |      3 +
 default-configs/targets/lm32-softmmu.mak           |      2 +
 default-configs/targets/m68k-linux-user.mak        |      6 +
 default-configs/targets/m68k-softmmu.mak           |      3 +
 default-configs/targets/microblaze-linux-user.mak  |      5 +
 default-configs/targets/microblaze-softmmu.mak     |      4 +
 .../targets/microblazeel-linux-user.mak            |      4 +
 default-configs/targets/microblazeel-softmmu.mak   |      3 +
 default-configs/targets/mips-linux-user.mak        |      6 +
 default-configs/targets/mips-softmmu.mak           |      4 +
 default-configs/targets/mips64-linux-user.mak      |      7 +
 default-configs/targets/mips64-softmmu.mak         |      4 +
 default-configs/targets/mips64el-linux-user.mak    |      6 +
 default-configs/targets/mips64el-softmmu.mak       |      4 +
 default-configs/targets/mipsel-linux-user.mak      |      5 +
 default-configs/targets/mipsel-softmmu.mak         |      3 +
 default-configs/targets/mipsn32-linux-user.mak     |      8 +
 default-configs/targets/mipsn32el-linux-user.mak   |      7 +
 default-configs/targets/moxie-softmmu.mak          |      2 +
 default-configs/targets/nios2-linux-user.mak       |      1 +
 default-configs/targets/nios2-softmmu.mak          |      1 +
 default-configs/targets/or1k-linux-user.mak        |      2 +
 default-configs/targets/or1k-softmmu.mak           |      2 +
 default-configs/targets/ppc-linux-user.mak         |      5 +
 default-configs/targets/ppc-softmmu.mak            |      4 +
 default-configs/targets/ppc64-linux-user.mak       |      7 +
 default-configs/targets/ppc64-softmmu.mak          |      6 +
 default-configs/targets/ppc64abi32-linux-user.mak  |      8 +
 default-configs/targets/ppc64le-linux-user.mak     |      6 +
 default-configs/targets/riscv32-linux-user.mak     |      5 +
 default-configs/targets/riscv32-softmmu.mak        |      5 +
 default-configs/targets/riscv64-linux-user.mak     |      5 +
 default-configs/targets/riscv64-softmmu.mak        |      5 +
 default-configs/targets/rx-softmmu.mak             |      3 +
 default-configs/targets/s390x-linux-user.mak       |      5 +
 default-configs/targets/s390x-softmmu.mak          |      4 +
 default-configs/targets/sh4-linux-user.mak         |      5 +
 default-configs/targets/sh4-softmmu.mak            |      2 +
 default-configs/targets/sh4eb-linux-user.mak       |      6 +
 default-configs/targets/sh4eb-softmmu.mak          |      3 +
 default-configs/targets/sparc-bsd-user.mak         |      3 +
 default-configs/targets/sparc-linux-user.mak       |      5 +
 default-configs/targets/sparc-softmmu.mak          |      3 +
 default-configs/targets/sparc32plus-linux-user.mak |      8 +
 default-configs/targets/sparc64-bsd-user.mak       |      4 +
 default-configs/targets/sparc64-linux-user.mak     |      6 +
 default-configs/targets/sparc64-softmmu.mak        |      4 +
 default-configs/targets/tricore-softmmu.mak        |      1 +
 default-configs/targets/unicore32-softmmu.mak      |      1 +
 default-configs/targets/x86_64-bsd-user.mak        |      3 +
 default-configs/targets/x86_64-linux-user.mak      |      5 +
 default-configs/targets/x86_64-softmmu.mak         |      4 +
 default-configs/targets/xtensa-linux-user.mak      |      5 +
 default-configs/targets/xtensa-softmmu.mak         |      3 +
 default-configs/targets/xtensaeb-linux-user.mak    |      6 +
 default-configs/targets/xtensaeb-softmmu.mak       |      4 +
 default-configs/tilegx-linux-user.mak              |      1 -
 default-configs/tricore-softmmu.mak                |      1 -
 default-configs/unicore32-softmmu.mak              |      6 -
 default-configs/x86_64-bsd-user.mak                |      1 -
 default-configs/x86_64-linux-user.mak              |      1 -
 default-configs/x86_64-softmmu.mak                 |      3 -
 default-configs/xtensa-linux-user.mak              |      1 -
 default-configs/xtensa-softmmu.mak                 |      9 -
 default-configs/xtensaeb-linux-user.mak            |      1 -
 default-configs/xtensaeb-softmmu.mak               |      3 -
 device_tree.c                                      |    579 -
 disas.c                                            |    695 +-
 disas/Makefile.objs                                |     30 -
 disas/arm-a64.cc                                   |      2 +-
 disas/capstone.c                                   |    326 +
 disas/hexagon.c                                    |     65 +
 disas/hppa.c                                       |      2 +-
 disas/libvixl/Makefile.objs                        |      5 -
 disas/libvixl/meson.build                          |      7 +
 disas/libvixl/vixl/a64/disasm-a64.cc               |      4 +
 disas/libvixl/vixl/globals.h                       |      6 +-
 disas/lm32.c                                       |      2 +-
 disas/m68k.c                                       |      8 +-
 disas/meson.build                                  |     25 +
 disas/nanomips.cpp                                 |      4 +-
 disas/ppc.c                                        |      2 +-
 disas/tci.c                                        |     61 -
 dma-helpers.c                                      |    331 -
 docs/COLO-FT.txt                                   |     18 +-
 docs/_templates/editpage.html                      |      5 +
 docs/amd-memory-encryption.txt                     |      6 +-
 docs/can.txt                                       |    113 +-
 docs/ccid.txt                                      |      6 +-
 docs/colo-proxy.txt                                |     16 +-
 docs/conf.py                                       |     59 +-
 docs/confidential-guest-support.txt                |     49 +
 docs/cpu-hotplug.rst                               |    142 -
 docs/defs.rst.inc                                  |      2 +-
 docs/devel/_templates/editpage.html                |      5 +
 docs/devel/atomics.rst                             |    136 +-
 docs/devel/blkdebug.txt                            |      2 +-
 docs/devel/blkverify.txt                           |      4 +-
 docs/devel/block-coroutine-wrapper.rst             |     54 +
 docs/devel/build-system.rst                        |    469 +
 docs/devel/build-system.txt                        |    519 -
 docs/devel/clocks.rst                              |    138 +-
 docs/devel/code-of-conduct.rst                     |     60 +
 docs/devel/conf.py                                 |     15 -
 docs/devel/conflict-resolution.rst                 |     80 +
 docs/devel/control-flow-integrity.rst              |    137 +
 docs/devel/fuzzing.rst                             |    321 +
 docs/devel/fuzzing.txt                             |    175 -
 docs/devel/index.rst                               |     18 +-
 docs/devel/kconfig.rst                             |     21 +-
 docs/devel/loads-stores.rst                        |     24 +-
 docs/devel/lockcnt.txt                             |      8 +-
 docs/devel/migration.rst                           |     15 +-
 docs/devel/multi-process.rst                       |    966 +
 docs/devel/multi-thread-tcg.rst                    |      2 +-
 docs/devel/qapi-code-gen.txt                       |    163 +-
 docs/devel/qgraph.rst                              |    568 +
 docs/devel/qom.rst                                 |    381 +
 docs/devel/qtest.rst                               |     92 +
 docs/devel/rcu.txt                                 |     34 +-
 docs/devel/style.rst                               |    701 +
 docs/devel/tcg-plugins.rst                         |    185 +
 docs/devel/testing.rst                             |    297 +-
 docs/devel/tracing.rst                             |    498 +
 docs/devel/tracing.txt                             |    451 -
 docs/devel/writing-qmp-commands.txt                |     16 +-
 docs/generic-loader.txt                            |     92 -
 docs/hyperv.txt                                    |      7 +-
 docs/index.html.in                                 |     19 -
 docs/interop/_templates/editpage.html              |      5 +
 docs/interop/bitmaps.rst                           |      2 +-
 docs/interop/conf.py                               |     22 -
 docs/interop/dbus.rst                              |      4 +-
 docs/interop/firmware.json                         |      2 +-
 docs/interop/index.rst                             |      7 +-
 docs/interop/live-block-operations.rst             |      8 +-
 docs/interop/nbd.txt                               |     25 +-
 docs/interop/parallels.txt                         |     28 +-
 docs/interop/qcow2.txt                             |     73 +-
 docs/interop/qemu-ga-ref.rst                       |     13 +
 docs/interop/qemu-ga-ref.texi                      |     80 -
 docs/interop/qemu-qmp-ref.rst                      |     13 +
 docs/interop/qemu-qmp-ref.texi                     |     80 -
 docs/interop/qemu-storage-daemon-qmp-ref.rst       |     13 +
 docs/interop/qmp-intro.txt                         |      4 +-
 docs/interop/qmp-spec.txt                          |     17 +-
 docs/interop/vhost-user-gpu.rst                    |      2 +-
 docs/interop/vhost-user.json                       |      3 +-
 docs/interop/vhost-user.rst                        |     27 +-
 docs/meson.build                                   |    107 +
 docs/microvm.rst                                   |    129 -
 docs/nvdimm.txt                                    |     24 +-
 docs/papr-pef.txt                                  |     30 +
 docs/pr-manager.rst                                |    111 -
 docs/pvrdma.txt                                    |      2 +-
 docs/qcow2-cache.txt                               |     19 +-
 docs/qdev-device-use.txt                           |     37 +-
 docs/qemu-option-trace.rst.inc                     |      6 +-
 docs/rdma.txt                                      |      4 +-
 docs/replay.txt                                    |     52 +-
 docs/specs/_templates/editpage.html                |      5 +
 docs/specs/acpi_cpu_hotplug.txt                    |     19 +-
 docs/specs/conf.py                                 |     16 -
 docs/specs/index.rst                               |      5 +-
 docs/specs/pci-ids.txt                             |      2 +
 docs/specs/ppc-spapr-hotplug.txt                   |      4 +-
 docs/specs/ppc-spapr-numa.rst                      |    410 +
 docs/specs/ppc-spapr-xive.rst                      |     14 +-
 docs/specs/pvpanic.txt                             |     13 +-
 docs/specs/tpm.rst                                 |      2 +-
 docs/specs/virt-ctlr.txt                           |     26 +
 docs/sphinx/depfile.py                             |     51 +
 docs/sphinx/kerneldoc.py                           |      8 +-
 docs/sphinx/qapidoc.py                             |    551 +
 docs/system/_templates/editpage.html               |      5 +
 docs/system/arm/aspeed.rst                         |     35 +-
 docs/system/arm/cpu-features.rst                   |     32 +
 docs/system/arm/mps2.rst                           |     42 +-
 docs/system/arm/nuvoton.rst                        |     93 +
 docs/system/arm/raspi.rst                          |     43 +
 docs/system/arm/sabrelite.rst                      |    119 +
 docs/system/arm/sbsa.rst                           |     32 +
 docs/system/arm/versatile.rst                      |     34 +
 docs/system/arm/vexpress.rst                       |     28 +
 docs/system/arm/virt.rst                           |      2 +
 docs/system/arm/xlnx-versal-virt.rst               |    177 +
 docs/system/arm/xscale.rst                         |     20 +-
 docs/system/build-platforms.rst                    |     63 +-
 docs/system/conf.py                                |     28 -
 docs/system/cpu-hotplug.rst                        |    142 +
 docs/system/cpu-models-mips.rst.inc                |     10 +-
 docs/system/cpu-models-x86.rst.inc                 |      4 +-
 docs/system/deprecated.rst                         |    518 +-
 docs/system/device-url-syntax.rst.inc              |      8 +-
 docs/system/gdb.rst                                |     65 +-
 docs/system/generic-loader.rst                     |    117 +
 docs/system/guest-loader.rst                       |     54 +
 docs/system/i386/microvm.rst                       |    128 +
 docs/system/i386/pc.rst                            |      7 +
 docs/system/images.rst                             |      2 +-
 docs/system/index.rst                              |     13 +-
 docs/system/monitor.rst                            |      2 +-
 docs/system/multi-process.rst                      |     64 +
 docs/system/mux-chardev.rst                        |      2 +-
 docs/system/nvme.rst                               |    225 +
 docs/system/ppc/embedded.rst                       |     10 +
 docs/system/ppc/powermac.rst                       |     34 +
 docs/system/ppc/powernv.rst                        |    193 +
 docs/system/ppc/prep.rst                           |     18 +
 docs/system/ppc/pseries.rst                        |     12 +
 docs/system/pr-manager.rst                         |     83 +
 docs/system/qemu-block-drivers.rst.inc             |     26 +
 docs/system/quickstart.rst                         |      8 +
 docs/system/removed-features.rst                   |    463 +
 docs/system/riscv/microchip-icicle-kit.rst         |     89 +
 docs/system/riscv/sifive_u.rst                     |    336 +
 docs/system/s390x/3270.rst                         |      2 +-
 docs/system/s390x/bootdevices.rst                  |     82 +
 docs/system/s390x/protvirt.rst                     |     19 +-
 docs/system/target-arm.rst                         |      5 +
 docs/system/target-avr.rst                         |     43 +-
 docs/system/target-i386.rst                        |     19 +-
 docs/system/target-mips.rst                        |     10 +
 docs/system/target-ppc.rst                         |     53 +-
 docs/system/target-riscv.rst                       |     73 +
 docs/system/target-s390x.rst                       |      1 +
 docs/system/targets.rst                            |     22 +-
 docs/system/tls.rst                                |      2 +-
 docs/system/usb.rst                                |      9 +-
 docs/system/virtio-net-failover.rst                |     68 +
 docs/system/virtio-pmem.rst                        |     76 +
 docs/system/vnc-security.rst                       |     20 +-
 docs/throttle.txt                                  |    108 +-
 docs/tools/_templates/editpage.html                |      5 +
 docs/tools/conf.py                                 |     33 -
 docs/tools/index.rst                               |      6 +-
 docs/tools/qemu-img.rst                            |     12 +-
 docs/tools/qemu-nbd.rst                            |     12 +-
 docs/tools/qemu-pr-helper.rst                      |     90 +
 docs/tools/qemu-storage-daemon.rst                 |    221 +
 docs/tools/virtiofsd.rst                           |    209 +-
 docs/u2f.txt                                       |    110 +
 docs/user/_templates/editpage.html                 |      5 +
 docs/user/conf.py                                  |     15 -
 docs/user/index.rst                                |      4 +-
 docs/user/main.rst                                 |    160 +-
 docs/virtio-net-failover.rst                       |     68 -
 docs/virtio-pmem.rst                               |     76 -
 docs/xbzrle.txt                                    |      5 -
 dump/Makefile.objs                                 |      3 -
 dump/dump.c                                        |     34 +-
 dump/meson.build                                   |      4 +
 exec-vary.c                                        |    108 -
 exec.c                                             |   4148 -
 fpu/softfloat-specialize.c.inc                     |   1171 +
 fpu/softfloat-specialize.inc.c                     |   1083 -
 fpu/softfloat.c                                    |    429 +-
 fsdev/9p-marshal.h                                 |     12 +-
 fsdev/Makefile.objs                                |     12 -
 fsdev/file-op-9p.h                                 |      7 +-
 fsdev/meson.build                                  |     17 +
 fsdev/virtfs-proxy-helper.c                        |      2 +-
 gdb-xml/riscv-32bit-csr.xml                        |    250 -
 gdb-xml/riscv-64bit-csr.xml                        |    250 -
 gdbstub.c                                          |    146 +-
 hmp-commands-info.hx                               |     24 +-
 hmp-commands.hx                                    |    230 +-
 hw/9pfs/9p-local.c                                 |     10 +-
 hw/9pfs/9p-proxy.c                                 |      3 +-
 hw/9pfs/9p-synth.c                                 |     12 +-
 hw/9pfs/9p.c                                       |    287 +-
 hw/9pfs/9p.h                                       |     67 +-
 hw/9pfs/Makefile.objs                              |      9 -
 hw/9pfs/codir.c                                    |    203 +-
 hw/9pfs/cofs.c                                     |      2 +-
 hw/9pfs/coth.h                                     |     15 +-
 hw/9pfs/meson.build                                |     20 +
 hw/9pfs/trace.h                                    |      1 +
 hw/9pfs/virtio-9p-device.c                         |      6 +
 hw/9pfs/virtio-9p.h                                |      9 +-
 hw/Kconfig                                         |      4 +-
 hw/Makefile.objs                                   |     48 -
 hw/acpi/Makefile.objs                              |     26 -
 hw/acpi/aml-build-stub.c                           |     14 +
 hw/acpi/aml-build.c                                |    360 +-
 hw/acpi/core.c                                     |     17 +-
 hw/acpi/cpu.c                                      |    200 +-
 hw/acpi/generic_event_device.c                     |     64 +-
 hw/acpi/ghes.c                                     |      5 +-
 hw/acpi/hmat.c                                     |      7 +-
 hw/acpi/hmat.h                                     |      5 +-
 hw/acpi/ich9.c                                     |     28 +-
 hw/acpi/memory_hotplug.c                           |     11 +-
 hw/acpi/meson.build                                |     25 +
 hw/acpi/nvdimm.c                                   |     40 +-
 hw/acpi/pci.c                                      |      6 +-
 hw/acpi/pcihp.c                                    |    146 +-
 hw/acpi/piix4.c                                    |     40 +-
 hw/acpi/tco.c                                      |     11 -
 hw/acpi/trace-events                               |      4 +
 hw/acpi/trace.h                                    |      1 +
 hw/acpi/utils.c                                    |     17 +-
 hw/acpi/vmgenid.c                                  |     13 +-
 hw/adc/Makefile.objs                               |      1 -
 hw/adc/meson.build                                 |      2 +
 hw/adc/npcm7xx_adc.c                               |    301 +
 hw/adc/trace-events                                |      5 +
 hw/adc/trace.h                                     |      1 +
 hw/alpha/Makefile.objs                             |      1 -
 hw/alpha/dp264.c                                   |     11 +-
 hw/alpha/meson.build                               |      8 +
 hw/alpha/trace.h                                   |      1 +
 hw/alpha/typhoon.c                                 |      8 +-
 hw/arm/Kconfig                                     |     37 +-
 hw/arm/Makefile.objs                               |     56 -
 hw/arm/allwinner-a10.c                             |      2 +
 hw/arm/allwinner-h3.c                              |    128 +-
 hw/arm/armsse.c                                    |   1020 +-
 hw/arm/armv7m.c                                    |     19 +-
 hw/arm/aspeed.c                                    |    184 +-
 hw/arm/aspeed_ast2600.c                            |    265 +-
 hw/arm/aspeed_soc.c                                |    264 +-
 hw/arm/bcm2835_peripherals.c                       |     30 +-
 hw/arm/bcm2836.c                                   |    184 +-
 hw/arm/boot.c                                      |      6 +-
 hw/arm/collie.c                                    |      8 +-
 hw/arm/cubieboard.c                                |      2 +-
 hw/arm/digic_boards.c                              |     22 +-
 hw/arm/exynos4210.c                                |      2 +-
 hw/arm/highbank.c                                  |     35 +-
 hw/arm/integratorcp.c                              |     41 +-
 hw/arm/mainstone.c                                 |      1 -
 hw/arm/meson.build                                 |     60 +
 hw/arm/microbit.c                                  |     10 +-
 hw/arm/mps2-tz.c                                   |    834 +-
 hw/arm/mps2.c                                      |    146 +-
 hw/arm/musca.c                                     |     33 +-
 hw/arm/musicpal.c                                  |    220 +-
 hw/arm/netduino2.c                                 |      2 +-
 hw/arm/netduinoplus2.c                             |      2 +-
 hw/arm/npcm7xx.c                                   |    804 +
 hw/arm/npcm7xx_boards.c                            |    340 +
 hw/arm/nseries.c                                   |     27 +-
 hw/arm/omap1.c                                     |      1 -
 hw/arm/orangepi.c                                  |     10 +-
 hw/arm/palm.c                                      |      8 +-
 hw/arm/pxa2xx.c                                    |     73 +-
 hw/arm/pxa2xx_gpio.c                               |      5 +-
 hw/arm/pxa2xx_pic.c                                |      8 +-
 hw/arm/raspi.c                                     |    213 +-
 hw/arm/realview.c                                  |     18 +-
 hw/arm/sabrelite.c                                 |      4 +
 hw/arm/sbsa-ref.c                                  |    112 +-
 hw/arm/smmu-common.c                               |    233 +-
 hw/arm/smmu-internal.h                             |     13 +
 hw/arm/smmuv3-internal.h                           |     19 +-
 hw/arm/smmuv3.c                                    |    214 +-
 hw/arm/spitz.c                                     |     82 +-
 hw/arm/stellaris.c                                 |    202 +-
 hw/arm/stm32f205_soc.c                             |      1 -
 hw/arm/strongarm.c                                 |     40 +-
 hw/arm/tosa.c                                      |     70 +-
 hw/arm/trace-events                                |     36 +-
 hw/arm/trace.h                                     |      1 +
 hw/arm/versatilepb.c                               |     36 +-
 hw/arm/vexpress.c                                  |     69 +-
 hw/arm/virt-acpi-build.c                           |    282 +-
 hw/arm/virt.c                                      |    771 +-
 hw/arm/xilinx_zynq.c                               |     35 +-
 hw/arm/xlnx-versal-virt.c                          |     66 +-
 hw/arm/xlnx-versal.c                               |     67 +-
 hw/arm/xlnx-zcu102.c                               |     56 +-
 hw/arm/xlnx-zynqmp.c                               |     63 +-
 hw/arm/z2.c                                        |     28 +-
 hw/audio/Makefile.objs                             |     18 -
 hw/audio/ac97.c                                    |      8 +-
 hw/audio/adlib.c                                   |      7 +-
 hw/audio/cs4231.c                                  |     17 +-
 hw/audio/cs4231a.c                                 |      9 +-
 hw/audio/es1370.c                                  |      9 +-
 hw/audio/gus.c                                     |      7 +-
 hw/audio/hda-codec.c                               |      7 +-
 hw/audio/intel-hda.c                               |      5 +-
 hw/audio/intel-hda.h                               |     18 +-
 hw/audio/marvell_88w8618.c                         |      8 +-
 hw/audio/meson.build                               |     15 +
 hw/audio/milkymist-ac97.c                          |      7 +-
 hw/audio/pcspk.c                                   |      7 +-
 hw/audio/pl041.c                                   |      7 +-
 hw/audio/sb16.c                                    |      7 +-
 hw/audio/trace.h                                   |      1 +
 hw/audio/via-ac97.c                                |     93 +
 hw/audio/wm8750.c                                  |      7 +-
 hw/avr/Makefile.objs                               |      3 -
 hw/avr/arduino.c                                   |     39 +-
 hw/avr/atmega.c                                    |     12 +-
 hw/avr/atmega.h                                    |      9 +-
 hw/avr/boot.c                                      |      1 +
 hw/avr/meson.build                                 |      6 +
 hw/block/Kconfig                                   |      3 +
 hw/block/Makefile.objs                             |     18 -
 hw/block/dataplane/Makefile.objs                   |      2 -
 hw/block/dataplane/meson.build                     |      2 +
 hw/block/dataplane/trace.h                         |      1 +
 hw/block/dataplane/virtio-blk.c                    |      4 +
 hw/block/dataplane/xen-block.c                     |      9 +-
 hw/block/fdc.c                                     |    134 +-
 hw/block/m25p80.c                                  |    334 +-
 hw/block/meson.build                               |     21 +
 hw/block/nand.c                                    |     60 +-
 hw/block/nvme-dif.c                                |    518 +
 hw/block/nvme-dif.h                                |     63 +
 hw/block/nvme-ns.c                                 |    594 +
 hw/block/nvme-ns.h                                 |    229 +
 hw/block/nvme-subsys.c                             |     91 +
 hw/block/nvme-subsys.h                             |     59 +
 hw/block/nvme.c                                    |   5657 +-
 hw/block/nvme.h                                    |    200 +-
 hw/block/onenand.c                                 |     10 +-
 hw/block/pflash_cfi01.c                            |    259 +-
 hw/block/pflash_cfi02.c                            |    321 +-
 hw/block/swim.c                                    |     16 +-
 hw/block/tc58128.c                                 |     26 +
 hw/block/trace-events                              |    165 +-
 hw/block/trace.h                                   |      1 +
 hw/block/vhost-user-blk.c                          |    100 +-
 hw/block/virtio-blk.c                              |     33 +-
 hw/block/xen-block.c                               |     39 +-
 hw/char/Kconfig                                    |     15 +
 hw/char/Makefile.objs                              |     39 -
 hw/char/avr_usart.c                                |      1 +
 hw/char/bcm2835_aux.c                              |      5 +-
 hw/char/cadence_uart.c                             |      5 +-
 hw/char/cmsdk-apb-uart.c                           |      1 +
 hw/char/debugcon.c                                 |      9 +-
 hw/char/digic-uart.c                               |      1 +
 hw/char/escc.c                                     |      1 +
 hw/char/etraxfs_ser.c                              |     13 +-
 hw/char/exynos4210_uart.c                          |     16 +-
 hw/char/goldfish_tty.c                             |    285 +
 hw/char/grlib_apbuart.c                            |      9 +-
 hw/char/ibex_uart.c                                |     28 +-
 hw/char/imx_serial.c                               |      1 +
 hw/char/ipoctal232.c                               |      5 +-
 hw/char/lm32_juart.c                               |      7 +-
 hw/char/lm32_uart.c                                |      7 +-
 hw/char/mcf_uart.c                                 |      8 +-
 hw/char/mchp_pfsoc_mmuart.c                        |     86 +
 hw/char/meson.build                                |     43 +
 hw/char/milkymist-uart.c                           |      8 +-
 hw/char/nrf51_uart.c                               |      1 +
 hw/char/parallel.c                                 |      9 +-
 hw/char/pl011.c                                    |     56 +
 hw/char/renesas_sci.c                              |      1 +
 hw/char/riscv_htif.c                               |    261 +
 hw/char/sclpconsole-lm.c                           |     13 +-
 hw/char/sclpconsole.c                              |     13 +-
 hw/char/serial-isa.c                               |     11 +-
 hw/char/serial-pci-multi.c                         |      1 +
 hw/char/serial-pci.c                               |     10 +-
 hw/char/serial.c                                   |     82 +-
 hw/char/sifive_uart.c                              |    194 +
 hw/char/spapr_vty.c                                |      9 +-
 hw/char/stm32f2xx_usart.c                          |      1 +
 hw/char/terminal3270.c                             |     22 +-
 hw/char/trace-events                               |     18 +-
 hw/char/trace.h                                    |      1 +
 hw/char/virtio-console.c                           |     11 +-
 hw/char/virtio-serial-bus.c                        |      6 -
 hw/char/xilinx_uartlite.c                          |      9 +-
 hw/core/Kconfig                                    |      5 +
 hw/core/Makefile.objs                              |     34 -
 hw/core/bus.c                                      |     30 +-
 hw/core/clock.c                                    |     58 +-
 hw/core/cpu.c                                      |     72 +-
 hw/core/generic-loader.c                           |      3 +-
 hw/core/guest-loader.c                             |    145 +
 hw/core/guest-loader.h                             |     34 +
 hw/core/irq.c                                      |      3 +-
 hw/core/loader-fit.c                               |      2 +-
 hw/core/loader.c                                   |    143 +-
 hw/core/machine-hmp-cmds.c                         |     22 +-
 hw/core/machine-qmp-cmds.c                         |    218 +-
 hw/core/machine.c                                  |    292 +-
 hw/core/meson.build                                |     44 +
 hw/core/numa.c                                     |     85 +-
 hw/core/platform-bus.c                             |      2 +-
 hw/core/ptimer.c                                   |     46 +-
 hw/core/qdev-clock.c                               |     33 +-
 hw/core/qdev-prop-internal.h                       |     28 +
 hw/core/qdev-properties-system.c                   |    743 +-
 hw/core/qdev-properties.c                          |   1092 +-
 hw/core/qdev.c                                     |    242 +-
 hw/core/register.c                                 |     43 +-
 hw/core/stream.c                                   |     20 +-
 hw/core/sysbus.c                                   |      7 +-
 hw/core/trace-events                               |      4 +-
 hw/core/trace.h                                    |      1 +
 hw/cpu/Makefile.objs                               |      5 -
 hw/cpu/a15mpcore.c                                 |      4 +-
 hw/cpu/a9mpcore.c                                  |     14 +-
 hw/cpu/core.c                                      |     18 +-
 hw/cpu/meson.build                                 |      6 +
 hw/cpu/realview_mpcore.c                           |      8 +-
 hw/cris/Makefile.objs                              |      2 -
 hw/cris/axis_dev88.c                               |      7 +-
 hw/cris/boot.c                                     |      6 +-
 hw/cris/boot.h                                     |      1 +
 hw/cris/meson.build                                |      5 +
 hw/display/Kconfig                                 |      3 -
 hw/display/Makefile.objs                           |     65 -
 hw/display/ads7846.c                               |    183 -
 hw/display/artist.c                                |    235 +-
 hw/display/ati_2d.c                                |     10 +-
 hw/display/ati_int.h                               |      7 +-
 hw/display/bcm2835_fb.c                            |      2 +-
 hw/display/bochs-display.c                         |      8 +-
 hw/display/cg3.c                                   |      8 +-
 hw/display/cirrus_vga.c                            |     41 +-
 hw/display/cirrus_vga_isa.c                        |      8 +-
 hw/display/edid-generate.c                         |     51 +-
 hw/display/exynos4210_fimd.c                       |     12 +-
 hw/display/g364fb.c                                |      7 +-
 hw/display/jazz_led.c                              |      7 +-
 hw/display/macfb.c                                 |      4 +-
 hw/display/meson.build                             |     87 +
 hw/display/milkymist-tmu2.c                        |      7 +-
 hw/display/milkymist-vgafb.c                       |      7 +-
 hw/display/milkymist-vgafb_template.h              |      2 +-
 hw/display/next-fb.c                               |      4 +-
 hw/display/omap_lcd_template.h                     |    169 -
 hw/display/omap_lcdc.c                             |    139 +-
 hw/display/pl110.c                                 |    152 +-
 hw/display/pl110_template.h                        |    120 +-
 hw/display/pxa2xx_lcd.c                            |    525 +-
 hw/display/pxa2xx_template.h                       |    447 -
 hw/display/qxl-logger.c                            |      6 +-
 hw/display/qxl-render.c                            |      1 +
 hw/display/qxl.c                                   |      9 +-
 hw/display/qxl.h                                   |      7 +-
 hw/display/ramfb-standalone.c                      |      9 +-
 hw/display/sii9022.c                               |      7 +-
 hw/display/sm501.c                                 |    174 +-
 hw/display/sm501_template.h                        |    131 -
 hw/display/ssd0303.c                               |      7 +-
 hw/display/ssd0323.c                               |     20 +-
 hw/display/tc6393xb.c                              |     50 +-
 hw/display/tc6393xb_template.h                     |     72 -
 hw/display/tcx.c                                   |     65 +-
 hw/display/trace-events                            |      4 +-
 hw/display/trace.h                                 |      1 +
 hw/display/vga-isa.c                               |      7 +-
 hw/display/vga-pci.c                               |     19 +-
 hw/display/vga.c                                   |      1 -
 hw/display/vhost-user-gpu-pci.c                    |     10 +-
 hw/display/vhost-user-gpu.c                        |     27 +-
 hw/display/vhost-user-vga.c                        |     12 +-
 hw/display/virtio-gpu-3d.c                         |     19 +-
 hw/display/virtio-gpu-base.c                       |     39 +-
 hw/display/virtio-gpu-pci.c                        |     10 +-
 hw/display/virtio-gpu.c                            |     27 +-
 hw/display/virtio-vga.c                            |     71 +-
 hw/display/virtio-vga.h                            |     17 +-
 hw/display/vmware_vga.c                            |      8 +-
 hw/display/xlnx_dp.c                               |      9 +
 hw/dma/Kconfig                                     |     10 +
 hw/dma/Makefile.objs                               |     16 -
 hw/dma/i82374.c                                    |      7 +-
 hw/dma/i8257.c                                     |      2 -
 hw/dma/meson.build                                 |     17 +
 hw/dma/pl330.c                                     |      3 +-
 hw/dma/puv3_dma.c                                  |      7 +-
 hw/dma/pxa2xx_dma.c                                |      7 +-
 hw/dma/rc4030.c                                    |      8 +-
 hw/dma/sifive_pdma.c                               |    313 +
 hw/dma/sparc32_dma.c                               |     49 +-
 hw/dma/trace.h                                     |      1 +
 hw/dma/xilinx_axidma.c                             |     69 +-
 hw/dma/xlnx_csu_dma.c                              |    745 +
 hw/dma/xlnx_dpdma.c                                |      2 +-
 hw/gpio/Kconfig                                    |      6 +
 hw/gpio/Makefile.objs                              |     12 -
 hw/gpio/gpio_key.c                                 |      7 +-
 hw/gpio/gpio_pwr.c                                 |     70 +
 hw/gpio/max7310.c                                  |     26 +-
 hw/gpio/meson.build                                |     15 +
 hw/gpio/mpc8xxx.c                                  |      9 +-
 hw/gpio/npcm7xx_gpio.c                             |    424 +
 hw/gpio/omap_gpio.c                                |      6 +-
 hw/gpio/pl061.c                                    |      7 +-
 hw/gpio/puv3_gpio.c                                |      7 +-
 hw/gpio/sifive_gpio.c                              |    397 +
 hw/gpio/trace-events                               |     13 +
 hw/gpio/trace.h                                    |      1 +
 hw/gpio/zaurus.c                                   |      4 +-
 hw/hppa/Makefile.objs                              |      1 -
 hw/hppa/dino.c                                     |     10 +-
 hw/hppa/hppa_hardware.h                            |      5 +
 hw/hppa/lasi.c                                     |     18 +-
 hw/hppa/machine.c                                  |     88 +-
 hw/hppa/meson.build                                |      4 +
 hw/hppa/trace.h                                    |      1 +
 hw/hyperv/Makefile.objs                            |      3 -
 hw/hyperv/hyperv.c                                 |     17 +-
 hw/hyperv/hyperv_testdev.c                         |      5 +-
 hw/hyperv/meson.build                              |      3 +
 hw/hyperv/trace-events                             |      2 +-
 hw/hyperv/trace.h                                  |      1 +
 hw/hyperv/vmbus.c                                  |      9 +-
 hw/i2c/Makefile.objs                               |     14 -
 hw/i2c/bitbang_i2c.c                               |      7 +-
 hw/i2c/exynos4210_i2c.c                            |      8 +-
 hw/i2c/meson.build                                 |     17 +
 hw/i2c/microbit_i2c.c                              |      1 +
 hw/i2c/mpc_i2c.c                                   |      8 +-
 hw/i2c/npcm7xx_smbus.c                             |   1098 +
 hw/i2c/pm_smbus.c                                  |      2 +-
 hw/i2c/smbus_eeprom.c                              |      8 +-
 hw/i2c/smbus_ich9.c                                |      8 +-
 hw/i2c/trace-events                                |     12 +
 hw/i2c/trace.h                                     |      1 +
 hw/i2c/versatile_i2c.c                             |      7 +-
 hw/i386/Kconfig                                    |      5 +-
 hw/i386/Makefile.objs                              |     20 -
 hw/i386/acpi-build.c                               |    699 +-
 hw/i386/acpi-common.c                              |     37 +-
 hw/i386/acpi-common.h                              |      2 +-
 hw/i386/acpi-microvm.c                             |    260 +
 hw/i386/acpi-microvm.h                             |      8 +
 hw/i386/amd_iommu.c                                |      4 +-
 hw/i386/amd_iommu.h                                |      8 +-
 hw/i386/fw_cfg.c                                   |      8 +-
 hw/i386/generic_event_device_x86.c                 |     36 +
 hw/i386/intel_iommu.c                              |    131 +-
 hw/i386/kvm/Makefile.objs                          |      5 -
 hw/i386/kvm/apic.c                                 |     14 +-
 hw/i386/kvm/clock.c                                |     18 +-
 hw/i386/kvm/i8254.c                                |     23 +-
 hw/i386/kvm/i8259.c                                |     12 +-
 hw/i386/kvm/ioapic.c                               |     35 +-
 hw/i386/kvm/meson.build                            |      8 +
 hw/i386/kvmvapic.c                                 |     10 +-
 hw/i386/meson.build                                |     33 +
 hw/i386/microvm.c                                  |    293 +-
 hw/i386/pc.c                                       |    518 +-
 hw/i386/pc_piix.c                                  |    151 +-
 hw/i386/pc_q35.c                                   |     49 +-
 hw/i386/pc_sysfw.c                                 |    144 +-
 hw/i386/port92.c                                   |      7 +-
 hw/i386/trace.h                                    |      1 +
 hw/i386/vmmouse.c                                  |      9 +-
 hw/i386/vmport.c                                   |     10 +-
 hw/i386/x86-iommu.c                                |      2 +-
 hw/i386/x86.c                                      |    457 +-
 hw/i386/xen/Makefile.objs                          |      1 -
 hw/i386/xen/meson.build                            |      7 +
 hw/i386/xen/trace.h                                |      1 +
 hw/i386/xen/xen-hvm.c                              |     13 +-
 hw/i386/xen/xen_platform.c                         |     23 +-
 hw/i386/xen/xen_pvdevice.c                         |      8 +-
 hw/ide/Makefile.objs                               |     14 -
 hw/ide/ahci-allwinner.c                            |      3 -
 hw/ide/ahci.c                                      |     33 +-
 hw/ide/ahci_internal.h                             |      7 +-
 hw/ide/atapi.c                                     |     40 +-
 hw/ide/core.c                                      |    129 +-
 hw/ide/ich.c                                       |     10 +-
 hw/ide/ioport.c                                    |      2 +-
 hw/ide/isa.c                                       |      7 +-
 hw/ide/macio.c                                     |      2 +-
 hw/ide/meson.build                                 |     14 +
 hw/ide/microdrive.c                                |      7 +-
 hw/ide/mmio.c                                      |     17 +-
 hw/ide/pci.c                                       |     14 +-
 hw/ide/piix.c                                      |     27 +-
 hw/ide/qdev.c                                      |     41 +-
 hw/ide/sii3112.c                                   |      8 +-
 hw/ide/trace-events                                |      2 +-
 hw/ide/trace.h                                     |      1 +
 hw/input/Kconfig                                   |      3 +
 hw/input/Makefile.objs                             |     18 -
 hw/input/adb-kbd.c                                 |     15 +-
 hw/input/adb-mouse.c                               |     15 +-
 hw/input/adb.c                                     |      1 +
 hw/input/ads7846.c                                 |    186 +
 hw/input/hid.c                                     |      1 -
 hw/input/lm832x.c                                  |      7 +-
 hw/input/meson.build                               |     19 +
 hw/input/milkymist-softusb.c                       |      7 +-
 hw/input/pckbd.c                                   |      2 -
 hw/input/pl050.c                                   |      7 +-
 hw/input/ps2.c                                     |      9 -
 hw/input/pxa2xx_keypad.c                           |     10 -
 hw/input/trace.h                                   |      1 +
 hw/intc/Kconfig                                    |     32 +-
 hw/intc/Makefile.objs                              |     54 -
 hw/intc/apic.c                                     |     15 +-
 hw/intc/apic_common.c                              |      5 +-
 hw/intc/arm_gic.c                                  |      9 +-
 hw/intc/arm_gic_kvm.c                              |     17 +-
 hw/intc/arm_gicv2m.c                               |      9 +-
 hw/intc/arm_gicv3_cpuif.c                          |      5 +-
 hw/intc/arm_gicv3_its_kvm.c                        |     18 +-
 hw/intc/arm_gicv3_kvm.c                            |     25 +-
 hw/intc/armv7m_nvic.c                              |    308 +-
 hw/intc/bcm2835_ic.c                               |      4 +-
 hw/intc/bcm2836_control.c                          |      8 +-
 hw/intc/etraxfs_pic.c                              |      7 +-
 hw/intc/exynos4210_combiner.c                      |      9 +-
 hw/intc/exynos4210_gic.c                           |     15 +-
 hw/intc/goldfish_pic.c                             |    219 +
 hw/intc/grlib_irqmp.c                              |     12 +-
 hw/intc/i8259.c                                    |     22 +-
 hw/intc/ibex_plic.c                                |     63 +-
 hw/intc/ioapic.c                                   |      3 +-
 hw/intc/ioapic_common.c                            |      2 +-
 hw/intc/lm32_pic.c                                 |      6 +-
 hw/intc/loongson_liointc.c                         |     47 +-
 hw/intc/m68k_irqc.c                                |    119 +
 hw/intc/meson.build                                |     61 +
 hw/intc/nios2_iic.c                                |     95 -
 hw/intc/omap_intc.c                                |      2 +-
 hw/intc/ompic.c                                    |      4 +-
 hw/intc/openpic_kvm.c                              |      8 +-
 hw/intc/pl190.c                                    |      7 +-
 hw/intc/pnv_xive.c                                 |      3 +
 hw/intc/ppc-uic.c                                  |    321 +
 hw/intc/puv3_intc.c                                |      7 +-
 hw/intc/rx_icu.c                                   |     30 +-
 hw/intc/s390_flic_kvm.c                            |     18 +-
 hw/intc/sifive_clint.c                             |    266 +
 hw/intc/sifive_plic.c                              |    548 +
 hw/intc/slavio_intctl.c                            |      8 +-
 hw/intc/spapr_xive.c                               |    129 +-
 hw/intc/spapr_xive_kvm.c                           |    264 +-
 hw/intc/trace-events                               |     48 +
 hw/intc/trace.h                                    |      1 +
 hw/intc/xics_kvm.c                                 |      2 +-
 hw/intc/xics_pnv.c                                 |      2 +-
 hw/intc/xilinx_intc.c                              |      4 +-
 hw/intc/xive.c                                     |    100 +-
 hw/ipack/Makefile.objs                             |      2 -
 hw/ipack/meson.build                               |      1 +
 hw/ipack/tpci200.c                                 |      8 +-
 hw/ipmi/Makefile.objs                              |      8 -
 hw/ipmi/ipmi_bmc_extern.c                          |     10 +-
 hw/ipmi/ipmi_bmc_sim.c                             |      1 +
 hw/ipmi/isa_ipmi_bt.c                              |      8 +-
 hw/ipmi/isa_ipmi_kcs.c                             |      8 +-
 hw/ipmi/meson.build                                |     11 +
 hw/ipmi/pci_ipmi_bt.c                              |      8 +-
 hw/ipmi/pci_ipmi_kcs.c                             |      8 +-
 hw/ipmi/smbus_ipmi.c                               |      7 +-
 hw/isa/Kconfig                                     |      2 +
 hw/isa/Makefile.objs                               |     11 -
 hw/isa/apm.c                                       |      2 +-
 hw/isa/i82378.c                                    |     10 +-
 hw/isa/isa-bus.c                                   |     11 +-
 hw/isa/isa-superio.c                               |      2 +-
 hw/isa/lpc_ich9.c                                  |     43 +-
 hw/isa/meson.build                                 |     11 +
 hw/isa/pc87312.c                                   |      2 +-
 hw/isa/piix3.c                                     |      6 +-
 hw/isa/piix4.c                                     |     23 +-
 hw/isa/trace-events                                |      8 +
 hw/isa/trace.h                                     |      1 +
 hw/isa/vt82c686.c                                  |    646 +-
 hw/lm32/Kconfig                                    |     10 +-
 hw/lm32/Makefile.objs                              |      3 -
 hw/lm32/lm32_boards.c                              |      2 +-
 hw/lm32/lm32_hwsetup.h                             |      2 +-
 hw/lm32/meson.build                                |      6 +
 hw/lm32/milkymist-hw.h                             |     11 -
 hw/lm32/milkymist.c                                |     31 +-
 hw/m68k/Kconfig                                    |     10 +
 hw/m68k/Makefile.objs                              |      4 -
 hw/m68k/an5206.c                                   |     14 +-
 hw/m68k/bootinfo.h                                 |     55 -
 hw/m68k/mcf5206.c                                  |     60 +-
 hw/m68k/mcf5208.c                                  |     14 +-
 hw/m68k/mcf_intc.c                                 |      7 +-
 hw/m68k/meson.build                                |      8 +
 hw/m68k/next-cube.c                                |    250 +-
 hw/m68k/next-kbd.c                                 |      7 +-
 hw/m68k/q800.c                                     |    121 +-
 hw/m68k/virt.c                                     |    313 +
 hw/mem/Kconfig                                     |      1 +
 hw/mem/Makefile.objs                               |      3 -
 hw/mem/memory-device.c                             |     32 +-
 hw/mem/meson.build                                 |      8 +
 hw/mem/npcm7xx_mc.c                                |     84 +
 hw/mem/nvdimm.c                                    |     12 +-
 hw/mem/pc-dimm.c                                   |      4 +-
 hw/mem/sparse-mem.c                                |    151 +
 hw/mem/trace.h                                     |      1 +
 hw/meson.build                                     |     67 +
 hw/microblaze/Makefile.objs                        |      4 -
 hw/microblaze/boot.c                               |     22 +-
 hw/microblaze/meson.build                          |      7 +
 hw/microblaze/petalogix_ml605_mmu.c                |      6 +-
 hw/microblaze/xlnx-zynqmp-pmu.c                    |     10 +-
 hw/mips/Kconfig                                    |     28 +-
 hw/mips/Makefile.objs                              |      8 -
 hw/mips/addr.c                                     |     51 -
 hw/mips/bootloader.c                               |    200 +
 hw/mips/boston.c                                   |    107 +-
 hw/mips/cps.c                                      |     29 +-
 hw/mips/fuloong2e.c                                |    136 +-
 hw/mips/fw_cfg.c                                   |     35 +
 hw/mips/fw_cfg.h                                   |     19 +
 hw/mips/gt64xxx_pci.c                              |     69 +-
 hw/mips/jazz.c                                     |     42 +-
 hw/mips/loongson3_bootp.c                          |    151 +
 hw/mips/loongson3_bootp.h                          |    236 +
 hw/mips/loongson3_virt.c                           |    638 +
 hw/mips/malta.c                                    |    173 +-
 hw/mips/meson.build                                |     12 +
 hw/mips/mipssim.c                                  |     44 +-
 hw/mips/r4k.c                                      |    318 -
 hw/mips/trace-events                               |      8 +-
 hw/mips/trace.h                                    |      1 +
 hw/misc/Kconfig                                    |     54 +-
 hw/misc/Makefile.objs                              |     95 -
 hw/misc/a9scu.c                                    |     59 +-
 hw/misc/allwinner-sid.c                            |      1 +
 hw/misc/applesmc.c                                 |      6 +-
 hw/misc/arm_integrator_debug.c                     |     10 +-
 hw/misc/arm_l2x0.c                                 |      7 +-
 hw/misc/arm_sysctl.c                               |      8 +-
 hw/misc/armsse-cpu-pwrctrl.c                       |    149 +
 hw/misc/armsse-cpuid.c                             |      2 +-
 hw/misc/armsse-mhu.c                               |      2 +-
 hw/misc/aspeed_lpc.c                               |    486 +
 hw/misc/aspeed_scu.c                               |     16 +-
 hw/misc/aspeed_sdmc.c                              |    125 +-
 hw/misc/aspeed_xdma.c                              |      2 +-
 hw/misc/auxbus.c                                   |      2 -
 hw/misc/bcm2835_cprman.c                           |    813 +
 hw/misc/debugexit.c                                |      8 +-
 hw/misc/eccmemctl.c                                |      7 +-
 hw/misc/edu.c                                      |     25 +-
 hw/misc/emc141x.c                                  |    326 +
 hw/misc/empty_slot.c                               |      7 +-
 hw/misc/exynos4210_clk.c                           |      8 +-
 hw/misc/exynos4210_pmu.c                           |      8 +-
 hw/misc/exynos4210_rng.c                           |      8 +-
 hw/misc/imx25_ccm.c                                |     12 +-
 hw/misc/imx31_ccm.c                                |     14 +-
 hw/misc/imx6_ccm.c                                 |     24 +-
 hw/misc/imx6_src.c                                 |      2 +-
 hw/misc/imx6ul_ccm.c                               |      4 +-
 hw/misc/imx7_ccm.c                                 |      8 +
 hw/misc/imx_ccm.c                                  |      6 +-
 hw/misc/iotkit-secctl.c                            |     50 +-
 hw/misc/iotkit-sysctl.c                            |    526 +-
 hw/misc/iotkit-sysinfo.c                           |     53 +-
 hw/misc/ivshmem.c                                  |     27 +-
 hw/misc/led.c                                      |    162 +
 hw/misc/mac_via.c                                  |    211 +-
 hw/misc/macio/Makefile.objs                        |      5 -
 hw/misc/macio/cuda.c                               |      6 +-
 hw/misc/macio/gpio.c                               |     24 +-
 hw/misc/macio/macio.c                              |     55 +-
 hw/misc/macio/meson.build                          |      8 +
 hw/misc/macio/pmu.c                                |      6 +-
 hw/misc/macio/trace.h                              |      1 +
 hw/misc/max111x.c                                  |     19 +-
 hw/misc/mchp_pfsoc_dmc.c                           |    216 +
 hw/misc/mchp_pfsoc_ioscb.c                         |    242 +
 hw/misc/mchp_pfsoc_sysreg.c                        |     99 +
 hw/misc/meson.build                                |    132 +
 hw/misc/milkymist-hpdmc.c                          |      7 +-
 hw/misc/milkymist-pfpu.c                           |      7 +-
 hw/misc/mips_cpc.c                                 |      3 +-
 hw/misc/mips_itu.c                                 |      2 +-
 hw/misc/mos6522.c                                  |     17 +-
 hw/misc/mps2-fpgaio.c                              |     96 +-
 hw/misc/mps2-scc.c                                 |    125 +-
 hw/misc/mst_fpga.c                                 |      8 +-
 hw/misc/npcm7xx_clk.c                              |   1095 +
 hw/misc/npcm7xx_gcr.c                              |    269 +
 hw/misc/npcm7xx_mft.c                              |    540 +
 hw/misc/npcm7xx_pwm.c                              |    569 +
 hw/misc/npcm7xx_rng.c                              |    180 +
 hw/misc/pc-testdev.c                               |      8 +-
 hw/misc/pca9552.c                                  |     12 +-
 hw/misc/pci-testdev.c                              |      8 +-
 hw/misc/puv3_pm.c                                  |      7 +-
 hw/misc/pvpanic-isa.c                              |     94 +
 hw/misc/pvpanic-pci.c                              |     94 +
 hw/misc/pvpanic.c                                  |     86 +-
 hw/misc/sbsa_ec.c                                  |     98 +
 hw/misc/sga.c                                      |      7 +-
 hw/misc/sifive_e_prci.c                            |    125 +
 hw/misc/sifive_test.c                              |    100 +
 hw/misc/sifive_u_otp.c                             |    297 +
 hw/misc/sifive_u_prci.c                            |    169 +
 hw/misc/slavio_misc.c                              |     15 +-
 hw/misc/stm32f2xx_syscfg.c                         |      2 -
 hw/misc/tmp105.c                                   |     73 +-
 hw/misc/tmp105.h                                   |     14 +-
 hw/misc/tmp421.c                                   |     45 +-
 hw/misc/trace-events                               |     63 +-
 hw/misc/trace.h                                    |      1 +
 hw/misc/tz-mpc.c                                   |     32 +-
 hw/misc/tz-ppc.c                                   |     14 +
 hw/misc/unimp.c                                    |     14 +-
 hw/misc/virt_ctrl.c                                |    151 +
 hw/misc/xlnx-versal-xramc.c                        |    253 +
 hw/misc/zynq_slcr.c                                |     19 +-
 hw/moxie/Makefile.objs                             |      2 -
 hw/moxie/meson.build                               |      4 +
 hw/moxie/moxiesim.c                                |     12 +-
 hw/net/Kconfig                                     |     16 +-
 hw/net/Makefile.objs                               |     59 -
 hw/net/allwinner-sun8i-emac.c                      |     88 +-
 hw/net/cadence_gem.c                               |     13 +-
 hw/net/can/Makefile.objs                           |      4 -
 hw/net/can/can_kvaser_pci.c                        |     10 +-
 hw/net/can/can_mioe3680_pci.c                      |     10 +-
 hw/net/can/can_pcm3680_pci.c                       |     10 +-
 hw/net/can/can_sja1000.c                           |     33 +-
 hw/net/can/ctu_can_fd_frame.h                      |    189 +
 hw/net/can/ctu_can_fd_regs.h                       |    971 +
 hw/net/can/ctucan_core.c                           |    687 +
 hw/net/can/ctucan_core.h                           |    126 +
 hw/net/can/ctucan_pci.c                            |    281 +
 hw/net/can/meson.build                             |      7 +
 hw/net/can/trace-events                            |      9 +
 hw/net/can/trace.h                                 |      1 +
 hw/net/can/xlnx-zynqmp-can.c                       |   1161 +
 hw/net/dp8393x.c                                   |     13 +-
 hw/net/e1000.c                                     |     34 +-
 hw/net/e1000e.c                                    |      9 +-
 hw/net/e1000e_core.c                               |     22 +-
 hw/net/e1000e_core.h                               |      2 +-
 hw/net/e1000x_common.c                             |      2 +-
 hw/net/e1000x_common.h                             |      2 +-
 hw/net/etraxfs_eth.c                               |      9 +-
 hw/net/fsl_etsec/etsec.c                           |      5 +-
 hw/net/fsl_etsec/etsec.h                           |      9 +-
 hw/net/fsl_etsec/rings.c                           |     25 +-
 hw/net/ftgmac100.c                                 |    108 +-
 hw/net/imx_fec.c                                   |     20 +-
 hw/net/lan9118.c                                   |     37 +-
 hw/net/mcf_fec.c                                   |      4 +-
 hw/net/meson.build                                 |     68 +
 hw/net/milkymist-minimac2.c                        |      7 +-
 hw/net/mipsnet.c                                   |      7 +-
 hw/net/msf2-emac.c                                 |      2 +-
 hw/net/ne2000-isa.c                                |      7 +-
 hw/net/net_tx_pkt.c                                |      2 +-
 hw/net/npcm7xx_emc.c                               |    859 +
 hw/net/opencores_eth.c                             |      7 +-
 hw/net/pcnet-pci.c                                 |      9 +-
 hw/net/pcnet.c                                     |      2 +-
 hw/net/rocker/rocker.c                             |     14 +-
 hw/net/rocker/rocker.h                             |      7 +-
 hw/net/rocker/rocker_fp.c                          |     17 +-
 hw/net/rocker/rocker_fp.h                          |      2 +-
 hw/net/rocker/rocker_of_dpa.c                      |     20 +-
 hw/net/rtl8139.c                                   |     11 +-
 hw/net/smc91c111.c                                 |      7 +-
 hw/net/spapr_llan.c                                |     14 +-
 hw/net/stellaris_enet.c                            |      8 +-
 hw/net/sungem.c                                    |      9 +-
 hw/net/sunhme.c                                    |      7 +-
 hw/net/trace-events                                |     17 +
 hw/net/trace.h                                     |      1 +
 hw/net/tulip.c                                     |      4 +-
 hw/net/tulip.h                                     |      3 +-
 hw/net/virtio-net.c                                |    334 +-
 hw/net/vmxnet3.c                                   |     12 +-
 hw/net/vmxnet3_defs.h                              |      9 +-
 hw/net/xen_nic.c                                   |      2 +-
 hw/net/xgmac.c                                     |      7 +-
 hw/net/xilinx_axienet.c                            |     78 +-
 hw/net/xilinx_ethlite.c                            |      5 +-
 hw/nios2/10m50_devboard.c                          |     13 +-
 hw/nios2/Makefile.objs                             |      3 -
 hw/nios2/boot.c                                    |     22 +-
 hw/nios2/cpu_pic.c                                 |     67 -
 hw/nios2/meson.build                               |      6 +
 hw/nubus/Makefile.objs                             |      4 -
 hw/nubus/meson.build                               |      7 +
 hw/nvram/Makefile.objs                             |      8 -
 hw/nvram/chrp_nvram.c                              |     24 +-
 hw/nvram/ds1225y.c                                 |      7 +-
 hw/nvram/eeprom93xx.c                              |      2 +-
 hw/nvram/eeprom_at24c.c                            |     10 +-
 hw/nvram/fw_cfg-interface.c                        |     23 +
 hw/nvram/fw_cfg.c                                  |     35 +-
 hw/nvram/mac_nvram.c                               |      2 +-
 hw/nvram/meson.build                               |     13 +
 hw/nvram/npcm7xx_otp.c                             |    440 +
 hw/nvram/nrf51_nvm.c                               |     10 +
 hw/nvram/spapr_nvram.c                             |     14 +-
 hw/nvram/trace.h                                   |      1 +
 hw/openrisc/Kconfig                                |      1 +
 hw/openrisc/Makefile.objs                          |      2 -
 hw/openrisc/meson.build                            |      5 +
 hw/openrisc/openrisc_sim.c                         |     46 +-
 hw/openrisc/pic_cpu.c                              |     61 -
 hw/pci-bridge/Kconfig                              |      2 +-
 hw/pci-bridge/Makefile.objs                        |     10 -
 hw/pci-bridge/dec.c                                |      7 +-
 hw/pci-bridge/gen_pcie_root_port.c                 |      9 +-
 hw/pci-bridge/i82801b11.c                          |      2 +-
 hw/pci-bridge/meson.build                          |     14 +
 hw/pci-bridge/pci_bridge_dev.c                     |      5 +-
 hw/pci-bridge/pci_expander_bridge.c                |     23 +-
 hw/pci-bridge/pcie_pci_bridge.c                    |      8 +-
 hw/pci-host/Kconfig                                |     12 +
 hw/pci-host/Makefile.objs                          |     24 -
 hw/pci-host/bonito.c                               |     26 +-
 hw/pci-host/designware.c                           |     21 +-
 hw/pci-host/gpex-acpi.c                            |    285 +
 hw/pci-host/grackle.c                              |     27 +-
 hw/pci-host/i440fx.c                               |     40 +-
 hw/pci-host/meson.build                            |     34 +
 hw/pci-host/pam.c                                  |      2 +-
 hw/pci-host/pnv_phb3.c                             |      5 +-
 hw/pci-host/pnv_phb4.c                             |     10 +-
 hw/pci-host/ppce500.c                              |     13 +-
 hw/pci-host/prep.c                                 |     26 +-
 hw/pci-host/q35.c                                  |      2 +-
 hw/pci-host/remote.c                               |     75 +
 hw/pci-host/sabre.c                                |     36 +-
 hw/pci-host/sh_pci.c                               |    204 +
 hw/pci-host/trace-events                           |      3 +
 hw/pci-host/trace.h                                |      1 +
 hw/pci-host/uninorth.c                             |     53 +-
 hw/pci-host/versatile.c                            |     14 +-
 hw/pci-host/xilinx-pcie.c                          |      2 +-
 hw/pci/Makefile.objs                               |     14 -
 hw/pci/meson.build                                 |     19 +
 hw/pci/msix.c                                      |      5 +-
 hw/pci/pci-stub.c                                  |      2 +-
 hw/pci/pci.c                                       |    143 +-
 hw/pci/pcie.c                                      |     28 +-
 hw/pci/shpc.c                                      |      6 +-
 hw/pci/trace.h                                     |      1 +
 hw/pcmcia/Makefile.objs                            |      2 -
 hw/pcmcia/meson.build                              |      2 +
 hw/pcmcia/pxa2xx.c                                 |      4 -
 hw/ppc/Kconfig                                     |     23 +-
 hw/ppc/Makefile.objs                               |     35 -
 hw/ppc/e500-ccsr.h                                 |      7 +-
 hw/ppc/e500.c                                      |     37 +-
 hw/ppc/e500.h                                      |     16 +-
 hw/ppc/e500plat.c                                  |      8 +-
 hw/ppc/mac.h                                       |     19 +-
 hw/ppc/mac_newworld.c                              |    111 +-
 hw/ppc/mac_oldworld.c                              |    164 +-
 hw/ppc/meson.build                                 |     82 +
 hw/ppc/mpc8544_guts.c                              |      4 +-
 hw/ppc/pef.c                                       |    140 +
 hw/ppc/pnv.c                                       |     37 +-
 hw/ppc/pnv_bmc.c                                   |     53 +-
 hw/ppc/pnv_core.c                                  |      2 +-
 hw/ppc/pnv_lpc.c                                   |     20 +-
 hw/ppc/pnv_pnor.c                                  |      3 +-
 hw/ppc/pnv_psi.c                                   |      2 +-
 hw/ppc/pnv_xscom.c                                 |      4 +-
 hw/ppc/ppc.c                                       |      8 +-
 hw/ppc/ppc405.h                                    |      8 +-
 hw/ppc/ppc405_boards.c                             |     25 +-
 hw/ppc/ppc405_uc.c                                 |    415 +-
 hw/ppc/ppc440_bamboo.c                             |     49 +-
 hw/ppc/ppc440_pcix.c                               |     58 +-
 hw/ppc/ppc440_uc.c                                 |      8 +-
 hw/ppc/ppc4xx_devs.c                               |    246 +-
 hw/ppc/ppc4xx_pci.c                                |     17 +-
 hw/ppc/ppc_booke.c                                 |      2 +-
 hw/ppc/ppce500_spin.c                              |      9 +-
 hw/ppc/prep.c                                      |      7 +-
 hw/ppc/prep_systemio.c                             |     16 +-
 hw/ppc/rs6000_mc.c                                 |     10 +-
 hw/ppc/sam460ex.c                                  |     90 +-
 hw/ppc/spapr.c                                     |    641 +-
 hw/ppc/spapr_caps.c                                |    107 +-
 hw/ppc/spapr_cpu_core.c                            |    111 +-
 hw/ppc/spapr_drc.c                                 |    143 +-
 hw/ppc/spapr_events.c                              |     33 +-
 hw/ppc/spapr_hcall.c                               |    117 +-
 hw/ppc/spapr_iommu.c                               |     22 +-
 hw/ppc/spapr_irq.c                                 |     16 +-
 hw/ppc/spapr_numa.c                                |    436 +
 hw/ppc/spapr_nvdimm.c                              |     88 +-
 hw/ppc/spapr_ovec.c                                |      7 +
 hw/ppc/spapr_pci.c                                 |    148 +-
 hw/ppc/spapr_pci_nvlink2.c                         |     20 +-
 hw/ppc/spapr_pci_vfio.c                            |      1 -
 hw/ppc/spapr_rng.c                                 |      5 +-
 hw/ppc/spapr_rtas.c                                |      6 +-
 hw/ppc/spapr_vio.c                                 |     19 +-
 hw/ppc/trace-events                                |     15 +-
 hw/ppc/trace.h                                     |      1 +
 hw/ppc/virtex_ml507.c                              |     29 +-
 hw/rdma/Makefile.objs                              |      3 -
 hw/rdma/meson.build                                |     10 +
 hw/rdma/rdma_backend.c                             |     28 +-
 hw/rdma/rdma_backend_defs.h                        |      2 +-
 hw/rdma/rdma_rm.c                                  |      2 +-
 hw/rdma/rdma_utils.c                               |     29 +-
 hw/rdma/rdma_utils.h                               |     15 +-
 hw/rdma/trace.h                                    |      1 +
 hw/rdma/vmw/pvrdma.h                               |     14 +-
 hw/rdma/vmw/pvrdma_cmd.c                           |      6 +-
 hw/rdma/vmw/pvrdma_dev_ring.c                      |     45 +-
 hw/rdma/vmw/pvrdma_dev_ring.h                      |      9 +-
 hw/rdma/vmw/pvrdma_main.c                          |      7 +-
 hw/rdma/vmw/trace.h                                |      1 +
 hw/remote/Kconfig                                  |      4 +
 hw/remote/iohub.c                                  |    119 +
 hw/remote/machine.c                                |     80 +
 hw/remote/memory.c                                 |     65 +
 hw/remote/meson.build                              |     13 +
 hw/remote/message.c                                |    230 +
 hw/remote/mpqemu-link.c                            |    267 +
 hw/remote/proxy-memory-listener.c                  |    227 +
 hw/remote/proxy.c                                  |    379 +
 hw/remote/remote-obj.c                             |    203 +
 hw/remote/trace-events                             |      4 +
 hw/remote/trace.h                                  |      1 +
 hw/riscv/Kconfig                                   |     77 +-
 hw/riscv/Makefile.objs                             |     16 -
 hw/riscv/boot.c                                    |    124 +-
 hw/riscv/meson.build                               |     12 +
 hw/riscv/microchip_pfsoc.c                         |    556 +
 hw/riscv/numa.c                                    |    242 +
 hw/riscv/opentitan.c                               |    138 +-
 hw/riscv/riscv_hart.c                              |      3 +
 hw/riscv/riscv_htif.c                              |    261 -
 hw/riscv/sifive_clint.c                            |    258 -
 hw/riscv/sifive_e.c                                |    119 +-
 hw/riscv/sifive_e_prci.c                           |    125 -
 hw/riscv/sifive_gpio.c                             |    397 -
 hw/riscv/sifive_plic.c                             |    522 -
 hw/riscv/sifive_test.c                             |    100 -
 hw/riscv/sifive_u.c                                |    433 +-
 hw/riscv/sifive_u_otp.c                            |    191 -
 hw/riscv/sifive_u_prci.c                           |    169 -
 hw/riscv/sifive_uart.c                             |    194 -
 hw/riscv/spike.c                                   |    293 +-
 hw/riscv/trace-events                              |      7 -
 hw/riscv/virt.c                                    |    701 +-
 hw/rtc/Makefile.objs                               |     15 -
 hw/rtc/ds1338.c                                    |      7 +-
 hw/rtc/exynos4210_rtc.c                            |     17 +-
 hw/rtc/goldfish_rtc.c                              |      4 +-
 hw/rtc/m41t80.c                                    |      7 +-
 hw/rtc/m48t59-isa.c                                |     46 +-
 hw/rtc/m48t59.c                                    |     54 +-
 hw/rtc/mc146818rtc.c                               |      1 +
 hw/rtc/meson.build                                 |     16 +
 hw/rtc/pl031.c                                     |      8 +
 hw/rtc/sun4v-rtc.c                                 |      7 +-
 hw/rtc/trace-events                                |      2 +-
 hw/rtc/trace.h                                     |      1 +
 hw/rtc/twl92230.c                                  |     53 +-
 hw/rx/Makefile.objs                                |      2 -
 hw/rx/meson.build                                  |      5 +
 hw/rx/rx-gdbsim.c                                  |     36 +-
 hw/rx/rx62n.c                                      |     22 +-
 hw/s390x/3270-ccw.c                                |      5 +-
 hw/s390x/Makefile.objs                             |     37 -
 hw/s390x/ap-device.c                               |      2 +-
 hw/s390x/ccw-device.h                              |     15 +-
 hw/s390x/css.c                                     |     28 +-
 hw/s390x/event-facility.c                          |      2 +-
 hw/s390x/ipl.c                                     |     19 +-
 hw/s390x/ipl.h                                     |      8 +-
 hw/s390x/meson.build                               |     56 +
 hw/s390x/pv.c                                      |     62 +
 hw/s390x/s390-pci-bus.c                            |    110 +-
 hw/s390x/s390-pci-bus.h                            |    376 -
 hw/s390x/s390-pci-inst.c                           |    137 +-
 hw/s390x/s390-pci-inst.h                           |    312 -
 hw/s390x/s390-pci-vfio.c                           |    274 +
 hw/s390x/s390-skeys.c                              |      8 +-
 hw/s390x/s390-virtio-ccw.c                         |     76 +-
 hw/s390x/sclp.c                                    |    137 +-
 hw/s390x/tod-kvm.c                                 |      2 +-
 hw/s390x/trace-events                              |      5 +
 hw/s390x/trace.h                                   |      1 +
 hw/s390x/vhost-user-fs-ccw.c                       |     75 +
 hw/s390x/vhost-vsock-ccw.c                         |     12 +
 hw/s390x/virtio-ccw-gpu.c                          |      4 +-
 hw/s390x/virtio-ccw-input.c                        |      2 +-
 hw/s390x/virtio-ccw.c                              |    107 +-
 hw/s390x/virtio-ccw.h                              |    117 +-
 hw/scsi/Makefile.objs                              |     15 -
 hw/scsi/esp-pci.c                                  |     80 +-
 hw/scsi/esp.c                                      |    996 +-
 hw/scsi/lsi53c895a.c                               |     18 +-
 hw/scsi/megasas.c                                  |     45 +-
 hw/scsi/meson.build                                |     26 +
 hw/scsi/mptconfig.c                                |      2 +-
 hw/scsi/mptendian.c                                |      2 +-
 hw/scsi/mptsas.c                                   |     18 +-
 hw/scsi/mptsas.h                                   |      8 +-
 hw/scsi/scsi-bus.c                                 |    309 +-
 hw/scsi/scsi-disk.c                                |    331 +-
 hw/scsi/scsi-generic.c                             |     68 +-
 hw/scsi/spapr_vscsi.c                              |     23 +-
 hw/scsi/trace-events                               |     18 +
 hw/scsi/trace.h                                    |      1 +
 hw/scsi/vhost-scsi-common.c                        |     27 +
 hw/scsi/vhost-scsi.c                               |      5 +-
 hw/scsi/vhost-user-scsi.c                          |      6 +-
 hw/scsi/virtio-scsi-dataplane.c                    |     32 +-
 hw/scsi/virtio-scsi.c                              |    127 +-
 hw/scsi/vmw_pvscsi.c                               |     62 +-
 hw/sd/Kconfig                                      |      4 +
 hw/sd/Makefile.objs                                |     12 -
 hw/sd/allwinner-sdhost.c                           |     67 +-
 hw/sd/aspeed_sdhci.c                               |     16 +-
 hw/sd/bcm2835_sdhost.c                             |     10 +-
 hw/sd/cadence_sdhci.c                              |    193 +
 hw/sd/core.c                                       |     54 +-
 hw/sd/meson.build                                  |     13 +
 hw/sd/milkymist-memcard.c                          |     78 +-
 hw/sd/omap_mmc.c                                   |     10 +-
 hw/sd/pl181.c                                      |    118 +-
 hw/sd/pxa2xx_mmci.c                                |     27 +-
 hw/sd/sd.c                                         |    286 +-
 hw/sd/sdhci.c                                      |    152 +-
 hw/sd/ssi-sd.c                                     |    204 +-
 hw/sd/trace-events                                 |     14 +-
 hw/sd/trace.h                                      |      1 +
 hw/semihosting/Kconfig                             |      3 -
 hw/semihosting/Makefile.objs                       |      2 -
 hw/semihosting/config.c                            |    187 -
 hw/semihosting/console.c                           |    180 -
 hw/sh4/Kconfig                                     |     12 +-
 hw/sh4/Makefile.objs                               |      4 -
 hw/sh4/meson.build                                 |      9 +
 hw/sh4/sh7750_regs.h                               |     24 +-
 hw/sh4/sh_pci.c                                    |    204 -
 hw/sh4/shix.c                                      |      3 +-
 hw/smbios/Makefile.objs                            |     10 -
 hw/smbios/meson.build                              |     13 +
 hw/smbios/smbios.c                                 |    131 +-
 hw/sparc/Kconfig                                   |      1 +
 hw/sparc/Makefile.objs                             |      3 -
 hw/sparc/leon3.c                                   |     26 +-
 hw/sparc/meson.build                               |      6 +
 hw/sparc/sun4m.c                                   |    130 +-
 hw/sparc/trace.h                                   |      1 +
 hw/sparc64/Makefile.objs                           |      4 -
 hw/sparc64/meson.build                             |      6 +
 hw/sparc64/sparc64.c                               |      3 +-
 hw/sparc64/sun4u.c                                 |     69 +-
 hw/sparc64/trace.h                                 |      1 +
 hw/ssi/Kconfig                                     |      4 +
 hw/ssi/Makefile.objs                               |     10 -
 hw/ssi/aspeed_smc.c                                |     82 +-
 hw/ssi/imx_spi.c                                   |    155 +-
 hw/ssi/meson.build                                 |     11 +
 hw/ssi/npcm7xx_fiu.c                               |    572 +
 hw/ssi/pl022.c                                     |      2 +-
 hw/ssi/sifive_spi.c                                |    358 +
 hw/ssi/ssi.c                                       |     51 +-
 hw/ssi/trace-events                                |     11 +
 hw/ssi/trace.h                                     |      1 +
 hw/ssi/xilinx_spi.c                                |      9 +-
 hw/ssi/xilinx_spips.c                              |     42 +-
 hw/timer/Kconfig                                   |     10 +
 hw/timer/Makefile.objs                             |     41 -
 hw/timer/allwinner-a10-pit.c                       |     11 +
 hw/timer/altera_timer.c                            |      8 +-
 hw/timer/arm_timer.c                               |     21 +-
 hw/timer/armv7m_systick.c                          |    132 +-
 hw/timer/bcm2835_systmr.c                          |     57 +-
 hw/timer/cadence_ttc.c                             |      8 +-
 hw/timer/cmsdk-apb-dualtimer.c                     |     54 +-
 hw/timer/cmsdk-apb-timer.c                         |     55 +-
 hw/timer/digic-timer.c                             |      8 +
 hw/timer/etraxfs_timer.c                           |     12 +-
 hw/timer/exynos4210_mct.c                          |     26 +-
 hw/timer/exynos4210_pwm.c                          |     27 +-
 hw/timer/grlib_gptimer.c                           |      5 +-
 hw/timer/hpet.c                                    |     36 +-
 hw/timer/i8254.c                                   |     12 +-
 hw/timer/lm32_timer.c                              |      6 +-
 hw/timer/meson.build                               |     40 +
 hw/timer/milkymist-sysctl.c                        |      7 +-
 hw/timer/mss-timer.c                               |     13 +
 hw/timer/npcm7xx_timer.c                           |    714 +
 hw/timer/puv3_ost.c                                |      7 +-
 hw/timer/pxa2xx_timer.c                            |      5 +-
 hw/timer/renesas_tmr.c                             |     38 +-
 hw/timer/sh_timer.c                                |     90 +-
 hw/timer/slavio_timer.c                            |     12 +-
 hw/timer/sse-counter.c                             |    474 +
 hw/timer/sse-timer.c                               |    471 +
 hw/timer/trace-events                              |     24 +-
 hw/timer/trace.h                                   |      1 +
 hw/timer/xilinx_timer.c                            |      5 +-
 hw/tpm/Makefile.objs                               |      6 -
 hw/tpm/meson.build                                 |      8 +
 hw/tpm/tpm_crb.c                                   |      9 +-
 hw/tpm/tpm_prop.h                                  |      4 +-
 hw/tpm/tpm_spapr.c                                 |     18 +-
 hw/tpm/tpm_tis_isa.c                               |      8 +-
 hw/tpm/tpm_tis_sysbus.c                            |      8 +-
 hw/tpm/trace-events                                |      3 +-
 hw/tpm/trace.h                                     |      1 +
 hw/tricore/Kconfig                                 |      8 +
 hw/tricore/Makefile.objs                           |      1 -
 hw/tricore/meson.build                             |      6 +
 hw/tricore/tc27x_soc.c                             |    246 +
 hw/tricore/triboard.c                              |     98 +
 hw/tricore/tricore_testboard.c                     |      2 +-
 hw/unicore32/Makefile.objs                         |      4 -
 hw/unicore32/meson.build                           |      5 +
 hw/usb/Kconfig                                     |     39 +-
 hw/usb/Makefile.objs                               |     71 -
 hw/usb/bus.c                                       |     59 +-
 hw/usb/ccid-card-emulated.c                        |     64 +-
 hw/usb/ccid-card-passthru.c                        |      8 +-
 hw/usb/ccid.h                                      |     13 +-
 hw/usb/core.c                                      |     23 +-
 hw/usb/dev-audio.c                                 |      8 +-
 hw/usb/dev-hid.c                                   |     33 +-
 hw/usb/dev-hub.c                                   |      8 +-
 hw/usb/dev-mtp.c                                   |      3 +-
 hw/usb/dev-network.c                               |      7 +-
 hw/usb/dev-serial.c                                |    346 +-
 hw/usb/dev-smartcard-reader.c                      |     27 +-
 hw/usb/dev-storage-bot.c                           |     63 +
 hw/usb/dev-storage-classic.c                       |    156 +
 hw/usb/dev-storage.c                               |    279 +-
 hw/usb/dev-uas.c                                   |     22 +-
 hw/usb/dev-wacom.c                                 |     19 +-
 hw/usb/hcd-dwc2.c                                  |    114 +-
 hw/usb/hcd-dwc2.h                                  |      8 +-
 hw/usb/hcd-dwc3.c                                  |    689 +
 hw/usb/hcd-ehci-sysbus.c                           |     28 +
 hw/usb/hcd-ehci.c                                  |     54 +-
 hw/usb/hcd-ehci.h                                  |     30 +-
 hw/usb/hcd-ohci-pci.c                              |      8 +-
 hw/usb/hcd-ohci.c                                  |     32 +-
 hw/usb/hcd-ohci.h                                  |      7 +-
 hw/usb/hcd-uhci.c                                  |     84 +-
 hw/usb/hcd-uhci.h                                  |     93 +
 hw/usb/hcd-xhci-nec.c                              |     41 +-
 hw/usb/hcd-xhci-pci.c                              |    259 +
 hw/usb/hcd-xhci-pci.h                              |     44 +
 hw/usb/hcd-xhci-sysbus.c                           |    121 +
 hw/usb/hcd-xhci-sysbus.h                           |     31 +
 hw/usb/hcd-xhci.c                                  |    320 +-
 hw/usb/hcd-xhci.h                                  |     50 +-
 hw/usb/host-libusb.c                               |     80 +-
 hw/usb/meson.build                                 |     85 +
 hw/usb/pcap.c                                      |    253 +
 hw/usb/redirect.c                                  |     17 +-
 hw/usb/trace-events                                |     29 +-
 hw/usb/trace.h                                     |      1 +
 hw/usb/tusb6010.c                                  |     11 +-
 hw/usb/u2f-emulated.c                              |    405 +
 hw/usb/u2f-passthru.c                              |    552 +
 hw/usb/u2f.c                                       |    351 +
 hw/usb/u2f.h                                       |     92 +
 hw/usb/vt82c686-uhci-pci.c                         |     43 +
 hw/usb/xlnx-usb-subsystem.c                        |     94 +
 hw/usb/xlnx-versal-usb2-ctrl-regs.c                |    229 +
 hw/vfio/Makefile.objs                              |      8 -
 hw/vfio/ap.c                                       |     17 +-
 hw/vfio/ccw.c                                      |     57 +-
 hw/vfio/common.c                                   |    585 +-
 hw/vfio/display.c                                  |      7 +-
 hw/vfio/igd.c                                      |      2 +-
 hw/vfio/meson.build                                |     19 +
 hw/vfio/migration.c                                |    904 +
 hw/vfio/pci-quirks.c                               |     35 +-
 hw/vfio/pci.c                                      |    142 +-
 hw/vfio/pci.h                                      |     11 +-
 hw/vfio/platform.c                                 |      9 +-
 hw/vfio/trace-events                               |     33 +-
 hw/vfio/trace.h                                    |      1 +
 hw/virtio/Makefile.objs                            |     48 -
 hw/virtio/meson.build                              |     51 +
 hw/virtio/trace-events                             |     44 +-
 hw/virtio/trace.h                                  |      1 +
 hw/virtio/vhost-backend.c                          |     91 +-
 hw/virtio/vhost-scsi-pci.c                         |     14 +-
 hw/virtio/vhost-user-blk-pci.c                     |      9 +-
 hw/virtio/vhost-user-fs-pci.c                      |      7 +-
 hw/virtio/vhost-user-fs.c                          |     31 +-
 hw/virtio/vhost-user-input-pci.c                   |      5 +-
 hw/virtio/vhost-user-scsi-pci.c                    |     14 +-
 hw/virtio/vhost-user-vsock-pci.c                   |      9 +-
 hw/virtio/vhost-user-vsock.c                       |      1 +
 hw/virtio/vhost-user.c                             |    224 +-
 hw/virtio/vhost-vdpa.c                             |    178 +-
 hw/virtio/vhost-vsock-common.c                     |      1 -
 hw/virtio/vhost-vsock-pci.c                        |     15 +-
 hw/virtio/vhost-vsock.c                            |     12 +-
 hw/virtio/vhost.c                                  |    110 +-
 hw/virtio/virtio-9p-pci.c                          |     10 +-
 hw/virtio/virtio-balloon-pci.c                     |     16 +-
 hw/virtio/virtio-balloon.c                         |     14 +-
 hw/virtio/virtio-blk-pci.c                         |     12 +-
 hw/virtio/virtio-crypto-pci.c                      |      5 +-
 hw/virtio/virtio-crypto.c                          |     17 +-
 hw/virtio/virtio-input-host-pci.c                  |      5 +-
 hw/virtio/virtio-input-pci.c                       |      9 +-
 hw/virtio/virtio-iommu-pci.c                       |      8 +-
 hw/virtio/virtio-iommu.c                           |    233 +-
 hw/virtio/virtio-mem-pci.c                         |      8 +
 hw/virtio/virtio-mem-pci.h                         |      5 +-
 hw/virtio/virtio-mem.c                             |    118 +-
 hw/virtio/virtio-mmio.c                            |    101 +-
 hw/virtio/virtio-net-pci.c                         |     15 +-
 hw/virtio/virtio-pci.c                             |    118 +-
 hw/virtio/virtio-pci.h                             |     41 +-
 hw/virtio/virtio-pmem-pci.c                        |      1 +
 hw/virtio/virtio-pmem-pci.h                        |      5 +-
 hw/virtio/virtio-pmem.c                            |      8 +-
 hw/virtio/virtio-rng-pci.c                         |      5 +-
 hw/virtio/virtio-rng.c                             |      3 +-
 hw/virtio/virtio-scsi-pci.c                        |     14 +-
 hw/virtio/virtio-serial-pci.c                      |      5 +-
 hw/virtio/virtio.c                                 |     56 +-
 hw/watchdog/Kconfig                                |      3 +
 hw/watchdog/Makefile.objs                          |      7 -
 hw/watchdog/cmsdk-apb-watchdog.c                   |     30 +-
 hw/watchdog/meson.build                            |      8 +
 hw/watchdog/sbsa_gwdt.c                            |    293 +
 hw/watchdog/trace.h                                |      1 +
 hw/watchdog/wdt_diag288.c                          |      3 -
 hw/watchdog/wdt_i6300esb.c                         |      6 +-
 hw/watchdog/wdt_ib700.c                            |      9 +-
 hw/xen/Makefile.objs                               |      7 -
 hw/xen/meson.build                                 |     20 +
 hw/xen/trace.h                                     |      1 +
 hw/xen/xen-backend.c                               |     11 +
 hw/xen/xen-bus.c                                   |     40 +-
 hw/xen/xen_pt.c                                    |     11 +-
 hw/xen/xen_pt.h                                    |      5 +-
 hw/xen/xen_pt_config_init.c                        |      6 +-
 hw/xen/xen_pt_load_rom.c                           |     14 +-
 hw/xen/xen_pt_msi.c                                |     16 +-
 hw/xen/xen_pvdev.c                                 |      2 +-
 hw/xenpv/Makefile.objs                             |      2 -
 hw/xenpv/meson.build                               |      3 +
 hw/xtensa/Makefile.objs                            |      6 -
 hw/xtensa/meson.build                              |     11 +
 hw/xtensa/pic_cpu.c                                |     10 +-
 hw/xtensa/sim.c                                    |      3 +-
 hw/xtensa/xtfpga.c                                 |     12 +-
 include/authz/base.h                               |     17 +-
 include/authz/list.h                               |     19 +-
 include/authz/listfile.h                           |     21 +-
 include/authz/pamacct.h                            |     19 +-
 include/authz/simple.h                             |     19 +-
 include/block/aio-wait.h                           |      4 +-
 include/block/aio.h                                |     18 +-
 include/block/block-copy.h                         |     61 +-
 include/block/block.h                              |    144 +-
 include/block/block_int.h                          |    164 +-
 include/block/blockjob.h                           |      2 +-
 include/block/blockjob_int.h                       |      2 +
 include/block/dirty-bitmap.h                       |      3 +-
 include/block/export.h                             |     89 +
 include/block/fuse.h                               |     30 +
 include/block/nbd.h                                |     37 +-
 include/block/nvme.h                               |    735 +-
 include/block/snapshot.h                           |     24 +-
 include/block/throttle-groups.h                    |      5 +-
 include/chardev/char-fd.h                          |      9 +-
 include/chardev/char-win.h                         |      9 +-
 include/chardev/char.h                             |     19 +-
 include/chardev/spice.h                            |     13 +-
 include/crypto/aes.h                               |      4 -
 include/crypto/block.h                             |      2 -
 include/crypto/cipher.h                            |      4 +-
 include/crypto/secret.h                            |      6 +-
 include/crypto/secret_common.h                     |     12 +-
 include/crypto/secret_keyring.h                    |     24 +-
 include/crypto/tls-cipher-suites.h                 |      9 +-
 include/crypto/tlscreds.h                          |      8 +-
 include/crypto/tlscredsanon.h                      |      7 +-
 include/crypto/tlscredspsk.h                       |      7 +-
 include/crypto/tlscredsx509.h                      |      7 +-
 include/disas/dis-asm.h                            |    109 +-
 include/disas/disas.h                              |      2 +-
 include/elf.h                                      |     28 +-
 include/exec/confidential-guest-support.h          |     62 +
 include/exec/cpu-all.h                             |     99 +-
 include/exec/cpu-common.h                          |      8 +-
 include/exec/cpu-defs.h                            |      5 +-
 include/exec/cpu_ldst.h                            |     41 +-
 include/exec/cputlb.h                              |      2 +-
 include/exec/exec-all.h                            |     93 +-
 include/exec/gdbstub.h                             |     34 +-
 include/exec/gen-icount.h                          |     29 +-
 include/exec/helper-proto.h                        |      4 +
 include/exec/hwaddr.h                              |      5 +
 include/exec/ioport.h                              |      2 +-
 include/exec/log.h                                 |     10 +-
 include/exec/memory.h                              |    276 +-
 include/exec/memory_ldst.h.inc                     |     71 +
 include/exec/memory_ldst.inc.h                     |     71 -
 include/exec/memory_ldst_cached.h.inc              |    111 +
 include/exec/memory_ldst_cached.inc.h              |    108 -
 include/exec/memory_ldst_phys.h.inc                |    147 +
 include/exec/memory_ldst_phys.inc.h                |    147 -
 include/exec/page-vary.h                           |     34 +
 include/exec/plugin-gen.h                          |      4 +-
 include/exec/poison.h                              |      5 +-
 include/exec/ram_addr.h                            |     33 +-
 include/exec/ramlist.h                             |      2 +-
 include/exec/tb-context.h                          |      3 +-
 include/exec/tb-hash.h                             |      2 +-
 include/exec/tb-lookup.h                           |     28 +-
 include/exec/translate-all.h                       |     39 +
 include/exec/translator.h                          |      2 +-
 include/exec/user/thunk.h                          |      5 +-
 include/fpu/softfloat-helpers.h                    |     10 +
 include/fpu/softfloat-types.h                      |     13 +-
 include/fpu/softfloat.h                            |    235 +
 include/glib-compat.h                              |     28 +
 include/hw/acpi/acpi-defs.h                        |      2 +-
 include/hw/acpi/acpi.h                             |      6 +-
 include/hw/acpi/acpi_dev_interface.h               |     15 +-
 include/hw/acpi/aml-build.h                        |     40 +-
 include/hw/acpi/cpu.h                              |      3 +
 include/hw/acpi/generic_event_device.h             |     25 +-
 include/hw/acpi/ghes.h                             |      3 +-
 include/hw/acpi/ich9.h                             |      3 +-
 include/hw/acpi/pci.h                              |      4 +-
 include/hw/acpi/pcihp.h                            |     13 +-
 include/hw/acpi/utils.h                            |      3 +-
 include/hw/acpi/vmgenid.h                          |     15 +-
 include/hw/adc/npcm7xx_adc.h                       |     69 +
 include/hw/adc/stm32f2xx_adc.h                     |      8 +-
 include/hw/arm/allwinner-a10.h                     |      7 +-
 include/hw/arm/allwinner-h3.h                      |     68 +-
 include/hw/arm/armsse-version.h                    |     42 +
 include/hw/arm/armsse.h                            |     74 +-
 include/hw/arm/armv7m.h                            |     15 +-
 include/hw/arm/aspeed.h                            |     14 +-
 include/hw/arm/aspeed_soc.h                        |    110 +-
 include/hw/arm/bcm2835_peripherals.h               |     15 +-
 include/hw/arm/bcm2836.h                           |     20 +-
 include/hw/arm/digic.h                             |      7 +-
 include/hw/arm/exynos4210.h                        |      8 +-
 include/hw/arm/fsl-imx25.h                         |     11 +-
 include/hw/arm/fsl-imx31.h                         |      9 +-
 include/hw/arm/fsl-imx6.h                          |      9 +-
 include/hw/arm/fsl-imx6ul.h                        |      9 +-
 include/hw/arm/fsl-imx7.h                          |      9 +-
 include/hw/arm/linux-boot-if.h                     |     11 +-
 include/hw/arm/msf2-soc.h                          |      7 +-
 include/hw/arm/npcm7xx.h                           |    139 +
 include/hw/arm/nrf51_soc.h                         |      8 +-
 include/hw/arm/omap.h                              |     18 +-
 include/hw/arm/pxa.h                               |     18 +-
 include/hw/arm/raspi_platform.h                    |     56 +-
 include/hw/arm/smmu-common.h                       |     34 +-
 include/hw/arm/smmuv3.h                            |     16 +-
 include/hw/arm/stm32f205_soc.h                     |      8 +-
 include/hw/arm/stm32f405_soc.h                     |      8 +-
 include/hw/arm/virt.h                              |     35 +-
 include/hw/arm/xlnx-versal.h                       |     29 +-
 include/hw/arm/xlnx-zynqmp.h                       |     25 +-
 include/hw/block/block.h                           |      1 +
 include/hw/block/flash.h                           |      9 +-
 include/hw/block/swim.h                            |     14 +-
 include/hw/boards.h                                |     64 +-
 include/hw/char/avr_usart.h                        |      8 +-
 include/hw/char/bcm2835_aux.h                      |      7 +-
 include/hw/char/cadence_uart.h                     |     25 +-
 include/hw/char/cmsdk-apb-uart.h                   |      8 +-
 include/hw/char/digic-uart.h                       |      8 +-
 include/hw/char/escc.h                             |      7 +-
 include/hw/char/goldfish_tty.h                     |     35 +
 include/hw/char/ibex_uart.h                        |     12 +-
 include/hw/char/imx_serial.h                       |      7 +-
 include/hw/char/mchp_pfsoc_mmuart.h                |     61 +
 include/hw/char/nrf51_uart.h                       |      7 +-
 include/hw/char/pl011.h                            |      9 +-
 include/hw/char/renesas_sci.h                      |      9 +-
 include/hw/char/riscv_htif.h                       |     59 +
 include/hw/char/serial.h                           |     25 +-
 include/hw/char/sifive_uart.h                      |     79 +
 include/hw/char/stm32f2xx_usart.h                  |      8 +-
 include/hw/clock.h                                 |    180 +-
 include/hw/core/accel-cpu.h                        |     38 +
 include/hw/core/cpu.h                              |    131 +-
 include/hw/core/generic-loader.h                   |      8 +-
 include/hw/core/split-irq.h                        |      3 +-
 include/hw/core/tcg-cpu-ops.h                      |    106 +
 include/hw/cpu/a15mpcore.h                         |      8 +-
 include/hw/cpu/a9mpcore.h                          |      8 +-
 include/hw/cpu/arm11mpcore.h                       |      8 +-
 include/hw/cpu/cluster.h                           |      8 +-
 include/hw/cpu/core.h                              |      8 +-
 include/hw/cris/etraxfs.h                          |      2 +-
 include/hw/display/bcm2835_fb.h                    |      7 +-
 include/hw/display/dpcd.h                          |      4 +-
 include/hw/display/edid.h                          |      5 +-
 include/hw/display/i2c-ddc.h                       |      4 +-
 include/hw/display/macfb.h                         |     26 +-
 include/hw/display/milkymist_tmu2.h                |      2 +-
 include/hw/display/xlnx_dp.h                       |      7 +-
 include/hw/dma/bcm2835_dma.h                       |      8 +-
 include/hw/dma/i8257.h                             |      6 +-
 include/hw/dma/pl080.h                             |     14 +-
 include/hw/dma/sifive_pdma.h                       |     57 +
 include/hw/dma/xlnx-zdma.h                         |      8 +-
 include/hw/dma/xlnx-zynq-devcfg.h                  |      8 +-
 include/hw/dma/xlnx_csu_dma.h                      |     52 +
 include/hw/dma/xlnx_dpdma.h                        |      4 +-
 include/hw/elf_ops.h                               |     11 +-
 include/hw/fw-path-provider.h                      |     11 +-
 include/hw/gpio/aspeed_gpio.h                      |     15 +-
 include/hw/gpio/bcm2835_gpio.h                     |      8 +-
 include/hw/gpio/imx_gpio.h                         |      7 +-
 include/hw/gpio/npcm7xx_gpio.h                     |     55 +
 include/hw/gpio/nrf51_gpio.h                       |      7 +-
 include/hw/gpio/sifive_gpio.h                      |     79 +
 include/hw/hotplug.h                               |     11 +-
 include/hw/hyperv/vmbus-bridge.h                   |     10 +-
 include/hw/hyperv/vmbus.h                          |     17 +-
 include/hw/i2c/arm_sbcon_i2c.h                     |     10 +-
 include/hw/i2c/aspeed_i2c.h                        |     16 +-
 include/hw/i2c/i2c.h                               |     20 +-
 include/hw/i2c/imx_i2c.h                           |      7 +-
 include/hw/i2c/microbit_i2c.h                      |      8 +-
 include/hw/i2c/npcm7xx_smbus.h                     |    113 +
 include/hw/i2c/ppc4xx_i2c.h                        |      7 +-
 include/hw/i2c/smbus_slave.h                       |     15 +-
 include/hw/i386/apic_internal.h                    |     19 +-
 include/hw/i386/ich9.h                             |     15 +-
 include/hw/i386/intel_iommu.h                      |      5 +-
 include/hw/i386/ioapic.h                           |      4 +-
 include/hw/i386/ioapic_internal.h                  |     19 +-
 include/hw/i386/microvm.h                          |     65 +-
 include/hw/i386/pc.h                               |     36 +-
 include/hw/i386/topology.h                         |    101 -
 include/hw/i386/vmport.h                           |      2 +-
 include/hw/i386/x86-iommu.h                        |     10 +-
 include/hw/i386/x86.h                              |     57 +-
 include/hw/ide/ahci.h                              |     15 +-
 include/hw/ide/internal.h                          |     38 +-
 include/hw/ide/pci.h                               |      7 +-
 include/hw/input/adb.h                             |     14 +-
 include/hw/input/i8042.h                           |      3 +-
 include/hw/input/tsc2xxx.h                         |      8 +-
 include/hw/intc/allwinner-a10-pic.h                |      7 +-
 include/hw/intc/arm_gic.h                          |     15 +-
 include/hw/intc/arm_gic_common.h                   |     21 +-
 include/hw/intc/arm_gicv3.h                        |     14 +-
 include/hw/intc/arm_gicv3_common.h                 |     17 +-
 include/hw/intc/arm_gicv3_its_common.h             |     11 +-
 include/hw/intc/armv7m_nvic.h                      |     12 +-
 include/hw/intc/aspeed_vic.h                       |      7 +-
 include/hw/intc/bcm2835_ic.h                       |      7 +-
 include/hw/intc/bcm2836_control.h                  |      8 +-
 include/hw/intc/goldfish_pic.h                     |     33 +
 include/hw/intc/heathrow_pic.h                     |      7 +-
 include/hw/intc/ibex_plic.h                        |     10 +-
 include/hw/intc/imx_avic.h                         |      7 +-
 include/hw/intc/imx_gpcv2.h                        |      7 +-
 include/hw/intc/intc.h                             |     11 +-
 include/hw/intc/loongson_liointc.h                 |     22 +
 include/hw/intc/m68k_irqc.h                        |     41 +
 include/hw/intc/mips_gic.h                         |      4 +-
 include/hw/intc/ppc-uic.h                          |     80 +
 include/hw/intc/realview_gic.h                     |      8 +-
 include/hw/intc/rx_icu.h                           |      4 +-
 include/hw/intc/sifive_clint.h                     |     60 +
 include/hw/intc/sifive_plic.h                      |     84 +
 include/hw/intc/xlnx-pmu-iomod-intc.h              |      8 +-
 include/hw/intc/xlnx-zynqmp-ipi.h                  |      8 +-
 include/hw/ipack/ipack.h                           |     14 +-
 include/hw/ipmi/ipmi.h                             |     35 +-
 include/hw/isa/i8259_internal.h                    |     14 +-
 include/hw/isa/isa.h                               |     25 +-
 include/hw/isa/pc87312.h                           |      9 +-
 include/hw/isa/superio.h                           |     19 +-
 include/hw/isa/vt82c686.h                          |     13 +-
 include/hw/kvm/clock.h                             |      4 +-
 include/hw/loader-fit.h                            |      2 +-
 include/hw/loader.h                                |     31 +
 include/hw/m68k/mcf.h                              |      3 +-
 include/hw/m68k/mcf_fec.h                          |      3 +-
 include/hw/m68k/next-cube.h                        |     15 +-
 include/hw/mem/memory-device.h                     |     23 +-
 include/hw/mem/npcm7xx_mc.h                        |     36 +
 include/hw/mem/nvdimm.h                            |     11 +-
 include/hw/mem/pc-dimm.h                           |     19 +-
 include/hw/mem/sparse-mem.h                        |     19 +
 include/hw/mips/bootloader.h                       |     22 +
 include/hw/mips/cps.h                              |     11 +-
 include/hw/mips/cpudevs.h                          |      7 -
 include/hw/mips/mips.h                             |      4 +-
 include/hw/misc/a9scu.h                            |      7 +-
 include/hw/misc/allwinner-cpucfg.h                 |      7 +-
 include/hw/misc/allwinner-h3-ccu.h                 |      7 +-
 include/hw/misc/allwinner-h3-dramc.h               |      7 +-
 include/hw/misc/allwinner-h3-sysctrl.h             |      7 +-
 include/hw/misc/allwinner-sid.h                    |      7 +-
 include/hw/misc/arm11scu.h                         |      7 +-
 include/hw/misc/arm_integrator_debug.h             |      2 +-
 include/hw/misc/armsse-cpu-pwrctrl.h               |     40 +
 include/hw/misc/armsse-cpuid.h                     |      9 +-
 include/hw/misc/armsse-mhu.h                       |      9 +-
 include/hw/misc/aspeed_lpc.h                       |     47 +
 include/hw/misc/aspeed_scu.h                       |     16 +-
 include/hw/misc/aspeed_sdmc.h                      |     28 +-
 include/hw/misc/aspeed_xdma.h                      |      9 +-
 include/hw/misc/auxbus.h                           |     11 +-
 include/hw/misc/avr_power.h                        |      7 +-
 include/hw/misc/bcm2835_cprman.h                   |    210 +
 include/hw/misc/bcm2835_cprman_internals.h         |   1019 +
 include/hw/misc/bcm2835_mbox.h                     |      8 +-
 include/hw/misc/bcm2835_mphi.h                     |      4 +-
 include/hw/misc/bcm2835_property.h                 |      8 +-
 include/hw/misc/bcm2835_rng.h                      |      8 +-
 include/hw/misc/bcm2835_thermal.h                  |      8 +-
 include/hw/misc/emc141x_regs.h                     |     37 +
 include/hw/misc/grlib_ahb_apb_pnp.h                |     13 +-
 include/hw/misc/imx25_ccm.h                        |      7 +-
 include/hw/misc/imx31_ccm.h                        |      7 +-
 include/hw/misc/imx6_ccm.h                         |      7 +-
 include/hw/misc/imx6_src.h                         |      7 +-
 include/hw/misc/imx6ul_ccm.h                       |      7 +-
 include/hw/misc/imx7_ccm.h                         |     13 +-
 include/hw/misc/imx7_gpr.h                         |      7 +-
 include/hw/misc/imx7_snvs.h                        |      7 +-
 include/hw/misc/imx_ccm.h                          |     16 +-
 include/hw/misc/imx_rngc.h                         |      7 +-
 include/hw/misc/iotkit-secctl.h                    |      8 +-
 include/hw/misc/iotkit-sysctl.h                    |     23 +-
 include/hw/misc/iotkit-sysinfo.h                   |     12 +-
 include/hw/misc/led.h                              |     98 +
 include/hw/misc/mac_via.h                          |     29 +-
 include/hw/misc/macio/cuda.h                       |     14 +-
 include/hw/misc/macio/gpio.h                       |      9 +-
 include/hw/misc/macio/macio.h                      |     37 +-
 include/hw/misc/macio/pmu.h                        |     14 +-
 include/hw/misc/max111x.h                          |     10 +-
 include/hw/misc/mchp_pfsoc_dmc.h                   |     56 +
 include/hw/misc/mchp_pfsoc_ioscb.h                 |     50 +
 include/hw/misc/mchp_pfsoc_sysreg.h                |     39 +
 include/hw/misc/mips_cmgcr.h                       |      4 +-
 include/hw/misc/mips_cpc.h                         |      9 +-
 include/hw/misc/mips_itu.h                         |      9 +-
 include/hw/misc/mos6522.h                          |     15 +-
 include/hw/misc/mps2-fpgaio.h                      |     17 +-
 include/hw/misc/mps2-scc.h                         |     19 +-
 include/hw/misc/msf2-sysreg.h                      |      7 +-
 include/hw/misc/npcm7xx_clk.h                      |    180 +
 include/hw/misc/npcm7xx_gcr.h                      |     43 +
 include/hw/misc/npcm7xx_mft.h                      |     70 +
 include/hw/misc/npcm7xx_pwm.h                      |    107 +
 include/hw/misc/npcm7xx_rng.h                      |     34 +
 include/hw/misc/nrf51_rng.h                        |      7 +-
 include/hw/misc/pca9552.h                          |      9 +-
 include/hw/misc/pvpanic.h                          |     24 +-
 include/hw/misc/sifive_e_prci.h                    |     73 +
 include/hw/misc/sifive_test.h                      |     47 +
 include/hw/misc/sifive_u_otp.h                     |     87 +
 include/hw/misc/sifive_u_prci.h                    |     93 +
 include/hw/misc/stm32f2xx_syscfg.h                 |     10 +-
 include/hw/misc/stm32f4xx_exti.h                   |      8 +-
 include/hw/misc/stm32f4xx_syscfg.h                 |      8 +-
 include/hw/misc/tz-mpc.h                           |      4 +-
 include/hw/misc/tz-msc.h                           |      7 +-
 include/hw/misc/tz-ppc.h                           |      4 +-
 include/hw/misc/unimp.h                            |      9 +-
 include/hw/misc/virt_ctrl.h                        |     22 +
 include/hw/misc/vmcoreinfo.h                       |     11 +-
 include/hw/misc/xlnx-versal-xramc.h                |     97 +
 include/hw/misc/zynq-xadc.h                        |     10 +-
 include/hw/net/allwinner-sun8i-emac.h              |     13 +-
 include/hw/net/allwinner_emac.h                    |      7 +-
 include/hw/net/cadence_gem.h                       |      9 +-
 include/hw/net/ftgmac100.h                         |     13 +-
 include/hw/net/imx_fec.h                           |      7 +-
 include/hw/net/lance.h                             |     10 +-
 include/hw/net/lasi_82596.h                        |     10 +-
 include/hw/net/msf2-emac.h                         |      8 +-
 include/hw/net/npcm7xx_emc.h                       |    286 +
 include/hw/net/xlnx-zynqmp-can.h                   |     78 +
 include/hw/nmi.h                                   |     11 +-
 include/hw/nubus/mac-nubus-bridge.h                |      8 +-
 include/hw/nubus/nubus.h                           |     15 +-
 include/hw/nvram/chrp_nvram.h                      |      3 +-
 include/hw/nvram/fw_cfg.h                          |     27 +-
 include/hw/nvram/npcm7xx_otp.h                     |     79 +
 include/hw/nvram/nrf51_nvm.h                       |      7 +-
 include/hw/or-irq.h                                |      3 +-
 include/hw/pci-bridge/simba.h                      |      8 +-
 include/hw/pci-host/designware.h                   |     14 +-
 include/hw/pci-host/gpex.h                         |     27 +-
 include/hw/pci-host/i440fx.h                       |     10 +-
 include/hw/pci-host/pam.h                          |      2 +
 include/hw/pci-host/pnv_phb3.h                     |     17 +-
 include/hw/pci-host/pnv_phb4.h                     |     18 +-
 include/hw/pci-host/q35.h                          |     17 +-
 include/hw/pci-host/remote.h                       |     30 +
 include/hw/pci-host/sabre.h                        |     15 +-
 include/hw/pci-host/spapr.h                        |     11 +-
 include/hw/pci-host/uninorth.h                     |     31 +-
 include/hw/pci-host/xilinx-pcie.h                  |     17 +-
 include/hw/pci/pci.h                               |     75 +-
 include/hw/pci/pci_bridge.h                        |      3 +-
 include/hw/pci/pci_bus.h                           |      4 +-
 include/hw/pci/pci_host.h                          |     12 +-
 include/hw/pci/pci_ids.h                           |      6 +-
 include/hw/pci/pcie.h                              |      2 +-
 include/hw/pci/pcie_host.h                         |      4 +-
 include/hw/pci/pcie_port.h                         |     16 +-
 include/hw/pcmcia.h                                |     16 +-
 include/hw/platform-bus.h                          |     11 +-
 include/hw/ppc/mac_dbdma.h                         |      8 +-
 include/hw/ppc/openpic.h                           |      7 +-
 include/hw/ppc/pef.h                               |     17 +
 include/hw/ppc/pnv.h                               |     78 +-
 include/hw/ppc/pnv_core.h                          |     26 +-
 include/hw/ppc/pnv_homer.h                         |     24 +-
 include/hw/ppc/pnv_lpc.h                           |     30 +-
 include/hw/ppc/pnv_occ.h                           |     24 +-
 include/hw/ppc/pnv_pnor.h                          |      7 +-
 include/hw/ppc/pnv_psi.h                           |     33 +-
 include/hw/ppc/pnv_xive.h                          |     16 +-
 include/hw/ppc/pnv_xscom.h                         |     14 +-
 include/hw/ppc/ppc4xx.h                            |      9 -
 include/hw/ppc/spapr.h                             |     64 +-
 include/hw/ppc/spapr_cpu_core.h                    |     17 +-
 include/hw/ppc/spapr_drc.h                         |     63 +-
 include/hw/ppc/spapr_irq.h                         |     48 +-
 include/hw/ppc/spapr_numa.h                        |     36 +
 include/hw/ppc/spapr_nvdimm.h                      |     10 +-
 include/hw/ppc/spapr_ovec.h                        |      1 +
 include/hw/ppc/spapr_tpm_proxy.h                   |      7 +-
 include/hw/ppc/spapr_vio.h                         |     19 +-
 include/hw/ppc/spapr_xive.h                        |     15 +-
 include/hw/ppc/xics.h                              |     31 +-
 include/hw/ppc/xics_spapr.h                        |      7 +-
 include/hw/ppc/xive.h                              |     86 +-
 include/hw/ppc/xive_regs.h                         |      2 +
 include/hw/ptimer.h                                |     22 +
 include/hw/qdev-clock.h                            |     25 +-
 include/hw/qdev-core.h                             |    163 +-
 include/hw/qdev-properties-system.h                |     77 +
 include/hw/qdev-properties.h                       |    240 +-
 include/hw/rdma/rdma.h                             |     11 +-
 include/hw/register.h                              |      7 +-
 include/hw/remote/iohub.h                          |     42 +
 include/hw/remote/machine.h                        |     38 +
 include/hw/remote/memory.h                         |     19 +
 include/hw/remote/mpqemu-link.h                    |     99 +
 include/hw/remote/proxy-memory-listener.h          |     28 +
 include/hw/remote/proxy.h                          |     48 +
 include/hw/resettable.h                            |     11 +-
 include/hw/riscv/boot.h                            |     23 +-
 include/hw/riscv/microchip_pfsoc.h                 |    151 +
 include/hw/riscv/numa.h                            |    113 +
 include/hw/riscv/opentitan.h                       |     57 +-
 include/hw/riscv/riscv_hart.h                      |      9 +-
 include/hw/riscv/riscv_htif.h                      |     59 -
 include/hw/riscv/sifive_clint.h                    |     57 -
 include/hw/riscv/sifive_e.h                        |     40 +-
 include/hw/riscv/sifive_e_prci.h                   |     71 -
 include/hw/riscv/sifive_gpio.h                     |     76 -
 include/hw/riscv/sifive_plic.h                     |     79 -
 include/hw/riscv/sifive_test.h                     |     45 -
 include/hw/riscv/sifive_u.h                        |     61 +-
 include/hw/riscv/sifive_u_otp.h                    |     80 -
 include/hw/riscv/sifive_u_prci.h                   |     91 -
 include/hw/riscv/sifive_uart.h                     |     77 -
 include/hw/riscv/spike.h                           |     23 +-
 include/hw/riscv/virt.h                            |     28 +-
 include/hw/rtc/allwinner-rtc.h                     |     15 +-
 include/hw/rtc/aspeed_rtc.h                        |      7 +-
 include/hw/rtc/goldfish_rtc.h                      |      8 +-
 include/hw/rtc/m48t59.h                            |     17 +-
 include/hw/rtc/mc146818rtc.h                       |      9 +-
 include/hw/rtc/pl031.h                             |      7 +-
 include/hw/rtc/xlnx-zynqmp-rtc.h                   |      8 +-
 include/hw/rx/rx62n.h                              |      9 +-
 include/hw/s390x/3270-ccw.h                        |     16 +-
 include/hw/s390x/ap-device.h                       |     12 +-
 include/hw/s390x/css-bridge.h                      |     14 +-
 include/hw/s390x/css.h                             |      9 +-
 include/hw/s390x/event-facility.h                  |     35 +-
 include/hw/s390x/pv.h                              |     17 +
 include/hw/s390x/s390-ccw.h                        |     19 +-
 include/hw/s390x/s390-pci-bus.h                    |    394 +
 include/hw/s390x/s390-pci-clp.h                    |    215 +
 include/hw/s390x/s390-pci-inst.h                   |    119 +
 include/hw/s390x/s390-pci-vfio.h                   |     39 +
 include/hw/s390x/s390-virtio-ccw.h                 |     14 +-
 include/hw/s390x/s390_flic.h                       |     32 +-
 include/hw/s390x/sclp.h                            |     29 +-
 include/hw/s390x/storage-attributes.h              |     34 +-
 include/hw/s390x/storage-keys.h                    |     25 +-
 include/hw/s390x/tod.h                             |     15 +-
 include/hw/s390x/vfio-ccw.h                        |      5 +-
 include/hw/scsi/esp.h                              |     60 +-
 include/hw/scsi/scsi.h                             |     28 +-
 include/hw/sd/allwinner-sdhost.h                   |     21 +-
 include/hw/sd/aspeed_sdhci.h                       |     10 +-
 include/hw/sd/bcm2835_sdhost.h                     |      8 +-
 include/hw/sd/cadence_sdhci.h                      |     47 +
 include/hw/sd/sd.h                                 |    141 +-
 include/hw/sd/sdcard_legacy.h                      |     50 +
 include/hw/sd/sdhci.h                              |     13 +-
 include/hw/semihosting/console.h                   |     69 -
 include/hw/semihosting/semihost.h                  |     77 -
 include/hw/sh4/sh.h                                |     31 +-
 include/hw/southbridge/piix.h                      |     10 +-
 include/hw/sparc/grlib.h                           |     10 +-
 include/hw/sparc/sparc32_dma.h                     |     34 +-
 include/hw/sparc/sun4m_iommu.h                     |      9 +-
 include/hw/sparc/sun4u_iommu.h                     |      9 +-
 include/hw/ssi/aspeed_smc.h                        |     17 +-
 include/hw/ssi/imx_spi.h                           |     12 +-
 include/hw/ssi/mss-spi.h                           |      7 +-
 include/hw/ssi/npcm7xx_fiu.h                       |     73 +
 include/hw/ssi/pl022.h                             |     12 +-
 include/hw/ssi/sifive_spi.h                        |     47 +
 include/hw/ssi/ssi.h                               |     63 +-
 include/hw/ssi/stm32f2xx_spi.h                     |      8 +-
 include/hw/ssi/xilinx_spips.h                      |     31 +-
 include/hw/stream.h                                |     44 +-
 include/hw/sysbus.h                                |     17 +-
 include/hw/timer/a9gtimer.h                        |      4 +-
 include/hw/timer/allwinner-a10-pit.h               |      4 +-
 include/hw/timer/arm_mptimer.h                     |      8 +-
 include/hw/timer/armv7m_systick.h                  |     10 +-
 include/hw/timer/aspeed_timer.h                    |     16 +-
 include/hw/timer/avr_timer16.h                     |      8 +-
 include/hw/timer/bcm2835_systmr.h                  |     23 +-
 include/hw/timer/cmsdk-apb-dualtimer.h             |     10 +-
 include/hw/timer/cmsdk-apb-timer.h                 |     38 +-
 include/hw/timer/digic-timer.h                     |      7 +-
 include/hw/timer/i8254.h                           |      8 +-
 include/hw/timer/i8254_internal.h                  |      8 +-
 include/hw/timer/imx_epit.h                        |      7 +-
 include/hw/timer/imx_gpt.h                         |      9 +-
 include/hw/timer/mss-timer.h                       |      8 +-
 include/hw/timer/npcm7xx_timer.h                   |    113 +
 include/hw/timer/nrf51_timer.h                     |      7 +-
 include/hw/timer/renesas_cmt.h                     |      9 +-
 include/hw/timer/renesas_tmr.h                     |      9 +-
 include/hw/timer/sse-counter.h                     |    105 +
 include/hw/timer/sse-timer.h                       |     53 +
 include/hw/timer/stm32f2xx_timer.h                 |     10 +-
 include/hw/tricore/tc27x_soc.h                     |    129 +
 include/hw/tricore/triboard.h                      |     50 +
 include/hw/usb.h                                   |     26 +-
 include/hw/usb/chipidea.h                          |      7 +-
 include/hw/usb/hcd-dwc3.h                          |     55 +
 include/hw/usb/hid.h                               |     17 +
 include/hw/usb/imx-usb-phy.h                       |      7 +-
 include/hw/usb/msd.h                               |     54 +
 include/hw/usb/xhci.h                              |     21 +
 include/hw/usb/xlnx-usb-subsystem.h                |     45 +
 include/hw/usb/xlnx-versal-usb2-ctrl-regs.h        |     45 +
 include/hw/vfio/vfio-amd-xgbe.h                    |     11 +-
 include/hw/vfio/vfio-calxeda-xgmac.h               |     21 +-
 include/hw/vfio/vfio-common.h                      |     32 +
 include/hw/vfio/vfio-platform.h                    |     19 +-
 include/hw/virtio/vhost-backend.h                  |      2 +
 include/hw/virtio/vhost-scsi-common.h              |     10 +-
 include/hw/virtio/vhost-scsi.h                     |      8 +-
 include/hw/virtio/vhost-user-blk.h                 |     20 +-
 include/hw/virtio/vhost-user-fs.h                  |      9 +-
 include/hw/virtio/vhost-user-scsi.h                |      8 +-
 include/hw/virtio/vhost-user-vsock.h               |      8 +-
 include/hw/virtio/vhost-vdpa.h                     |      1 +
 include/hw/virtio/vhost-vsock-common.h             |      8 +-
 include/hw/virtio/vhost-vsock.h                    |      8 +-
 include/hw/virtio/vhost.h                          |      2 +
 include/hw/virtio/virtio-balloon.h                 |      8 +-
 include/hw/virtio/virtio-blk.h                     |     13 +-
 include/hw/virtio/virtio-bus.h                     |     15 +-
 include/hw/virtio/virtio-crypto.h                  |      8 +-
 include/hw/virtio/virtio-gpu-pci.h                 |      5 +-
 include/hw/virtio/virtio-gpu.h                     |     39 +-
 include/hw/virtio/virtio-input.h                   |     23 +-
 include/hw/virtio/virtio-iommu.h                   |      8 +-
 include/hw/virtio/virtio-mem.h                     |     17 +-
 include/hw/virtio/virtio-mmio.h                    |     17 +-
 include/hw/virtio/virtio-net.h                     |     14 +-
 include/hw/virtio/virtio-pmem.h                    |     19 +-
 include/hw/virtio/virtio-rng.h                     |      8 +-
 include/hw/virtio/virtio-scsi.h                    |     20 +-
 include/hw/virtio/virtio-serial.h                  |     22 +-
 include/hw/virtio/virtio.h                         |     14 +-
 include/hw/vmstate-if.h                            |     11 +-
 include/hw/watchdog/cmsdk-apb-watchdog.h           |     13 +-
 include/hw/watchdog/sbsa_gwdt.h                    |     79 +
 include/hw/watchdog/wdt_aspeed.h                   |     16 +-
 include/hw/watchdog/wdt_diag288.h                  |     19 +-
 include/hw/watchdog/wdt_imx2.h                     |      7 +-
 include/hw/xen/interface/io/ring.h                 |      9 -
 include/hw/xen/xen-backend.h                       |      1 +
 include/hw/xen/xen-block.h                         |     33 +-
 include/hw/xen/xen-bus.h                           |     38 +-
 include/hw/xen/xen-legacy-backend.h                |      6 +-
 include/hw/xen/xen-x86.h                           |     15 +
 include/hw/xen/xen.h                               |      4 +-
 include/io/channel-buffer.h                        |      7 +-
 include/io/channel-command.h                       |      7 +-
 include/io/channel-file.h                          |      7 +-
 include/io/channel-socket.h                        |      7 +-
 include/io/channel-tls.h                           |      7 +-
 include/io/channel-util.h                          |      2 +-
 include/io/channel-watch.h                         |      2 +-
 include/io/channel-websock.h                       |      7 +-
 include/io/channel.h                               |     95 +-
 include/io/dns-resolver.h                          |     15 +-
 include/io/net-listener.h                          |     14 +-
 include/io/task.h                                  |      2 +-
 include/migration/misc.h                           |      3 +-
 include/migration/snapshot.h                       |     47 +-
 include/migration/vmstate.h                        |     20 +-
 include/monitor/hmp-target.h                       |      7 +-
 include/monitor/hmp.h                              |      9 +-
 include/monitor/monitor.h                          |     13 +-
 include/net/can_emu.h                              |     19 +-
 include/net/can_host.h                             |     20 +-
 include/net/checksum.h                             |      7 +-
 include/net/eth.h                                  |     17 +
 include/net/filter.h                               |     11 +-
 include/net/net.h                                  |     17 +-
 include/net/queue.h                                |      8 +
 include/qapi/compat-policy.h                       |     38 +
 include/qapi/error.h                               |      2 +-
 include/qapi/qmp/dispatch.h                        |     11 +-
 include/qapi/qmp/json-writer.h                     |     35 +
 include/qapi/qmp/qbool.h                           |      2 -
 include/qapi/qmp/qdict.h                           |      2 -
 include/qapi/qmp/qerror.h                          |     23 -
 include/qapi/qmp/qjson.h                           |      4 +-
 include/qapi/qmp/qlist.h                           |      2 -
 include/qapi/qmp/qnull.h                           |      2 -
 include/qapi/qmp/qnum.h                            |      3 -
 include/qapi/qmp/qobject.h                         |      9 +-
 include/qapi/qmp/qstring.h                         |     14 +-
 include/qapi/qobject-input-visitor.h               |      4 +
 include/qapi/qobject-output-visitor.h              |      4 +
 include/qapi/util.h                                |     28 +
 include/qapi/visitor-impl.h                        |      6 +
 include/qapi/visitor.h                             |     18 +
 include/qemu-common.h                              |     35 +-
 include/qemu/accel.h                               |     81 +
 include/qemu/atomic.h                              |    275 +-
 include/qemu/atomic128.h                           |      6 +-
 include/qemu/base64.h                              |      2 +-
 include/qemu/bitops.h                              |      2 +-
 include/qemu/bswap.h                               |     66 -
 include/qemu/buffer.h                              |      2 +-
 include/qemu/cacheflush.h                          |     35 +
 include/qemu/compiler.h                            |     72 +-
 include/qemu/config-file.h                         |      6 +-
 include/qemu/coroutine.h                           |     19 +-
 include/qemu/crc-ccitt.h                           |     33 +
 include/qemu/cutils.h                              |     25 +
 include/qemu/datadir.h                             |     28 +
 include/qemu/error-report.h                        |      2 +-
 include/qemu/event_notifier.h                      |      1 +
 include/qemu/fifo8.h                               |     16 +-
 include/qemu/filemonitor.h                         |      2 +-
 include/qemu/help_option.h                         |     11 +
 include/qemu/id.h                                  |      1 +
 include/qemu/int128.h                              |     26 +
 include/qemu/iov.h                                 |     25 +-
 include/qemu/job.h                                 |      5 +
 include/qemu/log.h                                 |      6 +-
 include/qemu/main-loop.h                           |      2 +-
 include/qemu/mmap-alloc.h                          |      6 +-
 include/qemu/module.h                              |      8 +-
 include/qemu/nvdimm-utils.h                        |      1 -
 include/qemu/option.h                              |      5 +-
 include/qemu/osdep.h                               |     91 +-
 include/qemu/plugin.h                              |      8 +-
 include/qemu/qemu-plugin.h                         |    247 +-
 include/qemu/queue.h                               |      7 +-
 include/qemu/rcu.h                                 |     11 +-
 include/qemu/rcu_queue.h                           |    100 +-
 include/qemu/seqlock.h                             |      8 +-
 include/qemu/stats64.h                             |     28 +-
 include/qemu/thread.h                              |     24 +-
 include/qemu/timer.h                               |     54 +-
 include/qemu/typedefs.h                            |      8 +-
 include/qemu/userfaultfd.h                         |     35 +
 include/qemu/vfio-helpers.h                        |      2 +-
 include/qemu/vhost-user-server.h                   |     65 +
 include/qemu/xxhash.h                              |     98 +
 include/qemu/yank.h                                |     87 +
 include/qom/object.h                               |    748 +-
 include/qom/object_interfaces.h                    |    106 +-
 include/scsi/constants.h                           |      1 +
 include/scsi/pr-manager.h                          |     16 +-
 include/scsi/utils.h                               |     31 +-
 include/semihosting/console.h                      |     69 +
 include/semihosting/semihost.h                     |     77 +
 include/standard-headers/asm-m68k/bootinfo-mac.h   |    120 +
 include/standard-headers/asm-m68k/bootinfo-virt.h  |     18 +
 include/standard-headers/asm-m68k/bootinfo.h       |    166 +
 include/standard-headers/asm-x86/kvm_para.h        |      1 +
 .../drivers/infiniband/hw/vmw_pvrdma/pvrdma_ring.h |    114 -
 include/standard-headers/drm/drm_fourcc.h          |    315 +-
 include/standard-headers/linux/const.h             |     36 +
 include/standard-headers/linux/ethtool.h           |     91 +-
 include/standard-headers/linux/fuse.h              |     78 +-
 include/standard-headers/linux/input-event-codes.h |      7 +-
 include/standard-headers/linux/kernel.h            |      9 +-
 include/standard-headers/linux/pci_regs.h          |     22 +-
 include/standard-headers/linux/vhost_types.h       |     20 +
 include/standard-headers/linux/virtio_9p.h         |      4 +-
 include/standard-headers/linux/virtio_blk.h        |     26 +-
 include/standard-headers/linux/virtio_config.h     |      8 +-
 include/standard-headers/linux/virtio_console.h    |      8 +-
 include/standard-headers/linux/virtio_fs.h         |      3 +
 include/standard-headers/linux/virtio_gpu.h        |    101 +
 include/standard-headers/linux/virtio_ids.h        |     44 +-
 include/standard-headers/linux/virtio_mmio.h       |     11 +
 include/standard-headers/linux/virtio_net.h        |      6 +-
 include/standard-headers/linux/virtio_pci.h        |     11 +-
 include/standard-headers/linux/virtio_scsi.h       |     20 +-
 include/sysemu/accel-ops.h                         |     45 +
 include/sysemu/accel.h                             |     77 -
 include/sysemu/arch_init.h                         |      9 +
 include/sysemu/balloon.h                           |      2 +-
 include/sysemu/block-backend.h                     |      3 +-
 include/sysemu/blockdev.h                          |      1 -
 include/sysemu/cpu-timers.h                        |     90 +
 include/sysemu/cpus.h                              |     41 +-
 include/sysemu/cryptodev-vhost-user.h              |      2 +-
 include/sysemu/cryptodev-vhost.h                   |      2 +-
 include/sysemu/cryptodev.h                         |     18 +-
 include/sysemu/device_tree.h                       |     17 +
 include/sysemu/dma.h                               |    129 +-
 include/sysemu/hax.h                               |     17 -
 include/sysemu/hostmem.h                           |     10 +-
 include/sysemu/hvf.h                               |     16 +-
 include/sysemu/hw_accel.h                          |     68 +-
 include/sysemu/iothread.h                          |     15 +-
 include/sysemu/kvm.h                               |     63 +-
 include/sysemu/kvm_int.h                           |      7 +-
 include/sysemu/numa.h                              |      4 -
 include/sysemu/os-win32.h                          |      4 +-
 include/sysemu/qtest.h                             |      2 +
 include/sysemu/replay.h                            |     42 +-
 include/sysemu/rng-random.h                        |      3 +-
 include/sysemu/rng.h                               |     10 +-
 include/sysemu/runstate-action.h                   |     19 +
 include/sysemu/runstate.h                          |     13 +-
 include/sysemu/sev.h                               |     11 +-
 include/sysemu/sysemu.h                            |     17 +-
 include/sysemu/tcg.h                               |      3 +-
 include/sysemu/tpm.h                               |     11 +-
 include/sysemu/tpm_backend.h                       |     12 +-
 include/sysemu/tpm_util.h                          |      2 +-
 include/sysemu/vhost-user-backend.h                |     17 +-
 include/sysemu/whpx.h                              |     21 +-
 include/sysemu/xen.h                               |      2 +
 include/tcg/tcg-gvec-desc.h                        |     36 +-
 include/tcg/tcg-op.h                               |     21 +-
 include/tcg/tcg-opc.h                              |     21 +-
 include/tcg/tcg.h                                  |    160 +-
 include/ui/console.h                               |     77 +-
 include/ui/egl-context.h                           |      1 -
 include/ui/egl-helpers.h                           |     10 +-
 include/ui/gtk.h                                   |      8 +-
 include/ui/qemu-spice-module.h                     |     44 +
 include/ui/qemu-spice.h                            |     45 +-
 include/ui/sdl2.h                                  |      1 -
 include/ui/spice-display.h                         |      2 +-
 include/user/syscall-trace.h                       |      2 +-
 io/Makefile.objs                                   |     12 -
 io/channel-buffer.c                                |      2 +-
 io/channel-command.c                               |      2 +-
 io/channel-file.c                                  |      4 +-
 io/channel-socket.c                                |      2 +-
 io/channel-tls.c                                   |      8 +-
 io/channel-util.c                                  |      2 +-
 io/channel-watch.c                                 |      2 +-
 io/channel-websock.c                               |      4 +-
 io/channel.c                                       |    117 +-
 io/dns-resolver.c                                  |      3 +-
 io/meson.build                                     |     15 +
 io/net-listener.c                                  |      1 -
 io/task.c                                          |      2 +-
 io/trace.h                                         |      1 +
 iothread.c                                         |     30 +-
 job-qmp.c                                          |     15 +-
 job.c                                              |     12 +-
 libdecnumber/Makefile.objs                         |      5 -
 libdecnumber/decNumber.c                           |      2 +-
 libdecnumber/meson.build                           |      7 +
 linux-headers/asm-arm64/kvm.h                      |     24 +-
 linux-headers/asm-arm64/mman.h                     |      1 +
 linux-headers/asm-generic/hugetlb_encode.h         |      1 +
 linux-headers/asm-generic/unistd.h                 |     28 +-
 linux-headers/asm-mips/unistd_n32.h                |      3 +
 linux-headers/asm-mips/unistd_n64.h                |      3 +
 linux-headers/asm-mips/unistd_o32.h                |      3 +
 linux-headers/asm-powerpc/kvm.h                    |      5 +
 linux-headers/asm-powerpc/unistd_32.h              |      3 +
 linux-headers/asm-powerpc/unistd_64.h              |      3 +
 linux-headers/asm-s390/kvm.h                       |      7 +-
 linux-headers/asm-s390/unistd_32.h                 |      3 +
 linux-headers/asm-s390/unistd_64.h                 |      3 +
 linux-headers/asm-x86/kvm.h                        |     21 +
 linux-headers/asm-x86/unistd_32.h                  |      3 +
 linux-headers/asm-x86/unistd_64.h                  |      3 +
 linux-headers/asm-x86/unistd_x32.h                 |      3 +
 linux-headers/linux/kvm.h                          |     85 +-
 linux-headers/linux/mman.h                         |      1 +
 linux-headers/linux/userfaultfd.h                  |      9 +
 linux-headers/linux/vfio.h                         |     32 +-
 linux-headers/linux/vfio_zdev.h                    |     78 +
 linux-headers/linux/vhost.h                        |      6 +
 linux-user/Makefile.objs                           |     25 -
 linux-user/aarch64/cpu_loop.c                      |     41 +-
 linux-user/aarch64/signal.c                        |     12 +-
 linux-user/aarch64/syscall_nr.h                    |      7 +-
 linux-user/aarch64/target_cpu.h                    |      2 +-
 linux-user/aarch64/target_signal.h                 |      3 +
 linux-user/aarch64/target_structs.h                |      2 +-
 linux-user/aarch64/target_syscall.h                |     18 +-
 linux-user/aarch64/termbits.h                      |    228 +-
 linux-user/alpha/Makefile.objs                     |      5 -
 linux-user/alpha/meson.build                       |      5 +
 linux-user/alpha/syscall.tbl                       |      4 +-
 linux-user/alpha/target_cpu.h                      |      2 +-
 linux-user/alpha/target_fcntl.h                    |      3 +-
 linux-user/alpha/target_signal.h                   |      9 +-
 linux-user/alpha/target_structs.h                  |      2 +-
 linux-user/alpha/target_syscall.h                  |      5 +-
 linux-user/alpha/termbits.h                        |      1 +
 linux-user/arm/Makefile.objs                       |      8 -
 linux-user/arm/cpu_loop.c                          |     31 +-
 linux-user/arm/meson.build                         |      7 +
 linux-user/arm/nwfpe/Makefile.objs                 |      2 -
 linux-user/arm/nwfpe/meson.build                   |     10 +
 linux-user/arm/semihost.c                          |     76 -
 linux-user/arm/syscall.tbl                         |      4 +-
 linux-user/arm/target_cpu.h                        |      2 +-
 linux-user/arm/target_signal.h                     |      6 +-
 linux-user/arm/target_structs.h                    |      2 +-
 linux-user/arm/target_syscall.h                    |      6 +-
 linux-user/arm/termbits.h                          |    223 +-
 linux-user/cris/target_cpu.h                       |      2 +-
 linux-user/cris/target_signal.h                    |      6 +-
 linux-user/cris/target_structs.h                   |      2 +-
 linux-user/cris/target_syscall.h                   |      9 +-
 linux-user/cris/termbits.h                         |     18 +-
 linux-user/elfload.c                               |    501 +-
 linux-user/exit.c                                  |      2 +-
 linux-user/fd-trans.c                              |     18 +-
 linux-user/flat.h                                  |      2 +-
 linux-user/flatload.c                              |      6 +-
 linux-user/generic/fcntl.h                         |      5 -
 linux-user/generic/signal.h                        |      6 +
 linux-user/generic/sockbits.h                      |      3 +
 linux-user/generic/termbits.h                      |    318 +
 linux-user/hexagon/cpu_loop.c                      |    100 +
 linux-user/hexagon/signal.c                        |    276 +
 linux-user/hexagon/sockbits.h                      |     18 +
 linux-user/hexagon/syscall_nr.h                    |    322 +
 linux-user/hexagon/target_cpu.h                    |     44 +
 linux-user/hexagon/target_elf.h                    |     40 +
 linux-user/hexagon/target_fcntl.h                  |     18 +
 linux-user/hexagon/target_signal.h                 |     34 +
 linux-user/hexagon/target_structs.h                |     54 +
 linux-user/hexagon/target_syscall.h                |     36 +
 linux-user/hexagon/termbits.h                      |     18 +
 linux-user/host/ppc64/safe-syscall.inc.S           |      2 +-
 linux-user/hppa/Makefile.objs                      |      5 -
 linux-user/hppa/cpu_loop.c                         |     40 +-
 linux-user/hppa/meson.build                        |      5 +
 linux-user/hppa/syscall.tbl                        |      8 +-
 linux-user/hppa/target_cpu.h                       |      2 +-
 linux-user/hppa/target_fcntl.h                     |      4 +-
 linux-user/hppa/target_signal.h                    |      7 +-
 linux-user/hppa/target_structs.h                   |      2 +-
 linux-user/hppa/target_syscall.h                   |      5 +-
 linux-user/hppa/termbits.h                         |     17 +-
 linux-user/i386/Makefile.objs                      |      5 -
 linux-user/i386/cpu_loop.c                         |      6 +-
 linux-user/i386/meson.build                        |      5 +
 linux-user/i386/signal.c                           |      5 +-
 linux-user/i386/syscall_32.tbl                     |    820 +-
 linux-user/i386/syscall_nr.h                       |      1 +
 linux-user/i386/target_cpu.h                       |      2 +-
 linux-user/i386/target_signal.h                    |      6 +-
 linux-user/i386/target_structs.h                   |      2 +-
 linux-user/i386/target_syscall.h                   |      5 +-
 linux-user/i386/termbits.h                         |    233 +-
 linux-user/ioctls.h                                |    177 +-
 linux-user/m68k/Makefile.objs                      |      5 -
 linux-user/m68k/meson.build                        |      5 +
 linux-user/m68k/syscall.tbl                        |      4 +-
 linux-user/m68k/target_signal.h                    |      6 +-
 linux-user/m68k/target_syscall.h                   |      6 +-
 linux-user/m68k/termbits.h                         |    234 +-
 linux-user/main.c                                  |     46 +-
 linux-user/meson.build                             |     38 +
 linux-user/microblaze/Makefile.objs                |      5 -
 linux-user/microblaze/cpu_loop.c                   |     26 +-
 linux-user/microblaze/meson.build                  |      5 +
 linux-user/microblaze/signal.c                     |    144 +-
 linux-user/microblaze/syscall.tbl                  |      4 +-
 linux-user/microblaze/target_cpu.h                 |      2 +-
 linux-user/microblaze/target_signal.h              |      7 +-
 linux-user/microblaze/target_structs.h             |      2 +-
 linux-user/microblaze/target_syscall.h             |      5 +-
 linux-user/microblaze/termbits.h                   |    220 +-
 linux-user/mips/Makefile.objs                      |      5 -
 linux-user/mips/cpu_loop.c                         |     11 +-
 linux-user/mips/meson.build                        |      6 +
 linux-user/mips/sockbits.h                         |      2 +
 linux-user/mips/syscall-args-o32.c.inc             |      4 +
 linux-user/mips/syscall_nr.h                       |      1 +
 linux-user/mips/syscall_o32.tbl                    |      8 +-
 linux-user/mips/target_cpu.h                       |      2 +-
 linux-user/mips/target_signal.h                    |     12 +-
 linux-user/mips/target_structs.h                   |      2 +-
 linux-user/mips/target_syscall.h                   |      5 +-
 linux-user/mips/termbits.h                         |     17 +-
 linux-user/mips64/Makefile.objs                    |     12 -
 linux-user/mips64/meson.build                      |      6 +
 linux-user/mips64/syscall_n32.tbl                  |      8 +-
 linux-user/mips64/syscall_n64.tbl                  |      4 +-
 linux-user/mips64/syscall_nr.h                     |     10 +
 linux-user/mips64/target_cpu.h                     |      2 +-
 linux-user/mips64/target_elf.h                     |      3 +
 linux-user/mips64/target_signal.h                  |     16 +-
 linux-user/mips64/target_syscall.h                 |      5 +-
 linux-user/mmap.c                                  |    203 +-
 linux-user/nios2/syscall_nr.h                      |      7 +-
 linux-user/nios2/target_cpu.h                      |      2 +-
 linux-user/nios2/target_signal.h                   |      5 +-
 linux-user/nios2/target_structs.h                  |      2 +-
 linux-user/nios2/target_syscall.h                  |      5 +-
 linux-user/nios2/termbits.h                        |    228 +-
 linux-user/openrisc/syscall_nr.h                   |      8 +-
 linux-user/openrisc/target_syscall.h               |      5 +-
 linux-user/openrisc/termbits.h                     |    302 +-
 linux-user/ppc/Makefile.objs                       |      6 -
 linux-user/ppc/meson.build                         |      5 +
 linux-user/ppc/signal.c                            |      4 +-
 linux-user/ppc/syscall.tbl                         |     30 +-
 linux-user/ppc/target_cpu.h                        |      2 +-
 linux-user/ppc/target_signal.h                     |      6 +-
 linux-user/ppc/target_structs.h                    |      2 +-
 linux-user/ppc/target_syscall.h                    |      7 +-
 linux-user/ppc/termbits.h                          |     21 +-
 linux-user/qemu.h                                  |    127 +-
 linux-user/riscv/cpu_loop.c                        |     10 +
 linux-user/riscv/syscall32_nr.h                    |      8 +-
 linux-user/riscv/syscall64_nr.h                    |      8 +-
 linux-user/riscv/target_syscall.h                  |      5 +-
 linux-user/riscv/termbits.h                        |    228 +-
 linux-user/s390x/Makefile.objs                     |      5 -
 linux-user/s390x/meson.build                       |      5 +
 linux-user/s390x/signal.c                          |      5 +-
 linux-user/s390x/syscall.tbl                       |      8 +-
 linux-user/s390x/target_signal.h                   |      2 +-
 linux-user/s390x/target_structs.h                  |      2 +-
 linux-user/s390x/target_syscall.h                  |      5 +-
 linux-user/s390x/termbits.h                        |    289 +-
 linux-user/semihost.c                              |     76 +
 linux-user/sh4/Makefile.objs                       |      5 -
 linux-user/sh4/meson.build                         |      5 +
 linux-user/sh4/signal.c                            |      8 +-
 linux-user/sh4/syscall.tbl                         |      4 +-
 linux-user/sh4/target_signal.h                     |      6 +-
 linux-user/sh4/target_syscall.h                    |      5 +-
 linux-user/sh4/termbits.h                          |     19 +-
 linux-user/signal.c                                |     11 +-
 linux-user/sparc/Makefile.objs                     |      5 -
 linux-user/sparc/meson.build                       |      5 +
 linux-user/sparc/signal.c                          |    153 +-
 linux-user/sparc/syscall.tbl                       |      8 +-
 linux-user/sparc/target_cpu.h                      |      2 +-
 linux-user/sparc/target_signal.h                   |     12 +-
 linux-user/sparc/target_structs.h                  |      2 +-
 linux-user/sparc/target_syscall.h                  |      5 +-
 linux-user/sparc/termbits.h                        |     18 +-
 linux-user/sparc64/Makefile.objs                   |      5 -
 linux-user/sparc64/meson.build                     |      5 +
 linux-user/sparc64/syscall.tbl                     |      8 +-
 linux-user/sparc64/target_structs.h                |      2 +-
 linux-user/sparc64/target_syscall.h                |      5 +-
 linux-user/sparc64/termbits.h                      |     18 +-
 linux-user/strace.c                                |   1238 +-
 linux-user/strace.list                             |     35 +-
 linux-user/syscall.c                               |   1515 +-
 linux-user/syscall_defs.h                          |    179 +-
 linux-user/syscall_types.h                         |    167 +
 linux-user/tilegx/cpu_loop.c                       |    287 -
 linux-user/tilegx/signal.c                         |    178 -
 linux-user/tilegx/sockbits.h                       |      1 -
 linux-user/tilegx/syscall_nr.h                     |    327 -
 linux-user/tilegx/target_cpu.h                     |     44 -
 linux-user/tilegx/target_elf.h                     |     14 -
 linux-user/tilegx/target_fcntl.h                   |     11 -
 linux-user/tilegx/target_signal.h                  |     23 -
 linux-user/tilegx/target_structs.h                 |     46 -
 linux-user/tilegx/target_syscall.h                 |     43 -
 linux-user/tilegx/termbits.h                       |    275 -
 linux-user/trace.h                                 |      1 +
 linux-user/uaccess.c                               |     82 +-
 linux-user/x86_64/Makefile.objs                    |      5 -
 linux-user/x86_64/meson.build                      |      5 +
 linux-user/x86_64/syscall_64.tbl                   |    742 +-
 linux-user/x86_64/syscall_nr.h                     |      1 +
 linux-user/x86_64/target_signal.h                  |      6 +-
 linux-user/x86_64/target_structs.h                 |      2 +-
 linux-user/x86_64/target_syscall.h                 |      5 +-
 linux-user/x86_64/termbits.h                       |    254 +-
 linux-user/xtensa/Makefile.objs                    |      5 -
 linux-user/xtensa/meson.build                      |      5 +
 linux-user/xtensa/syscall.tbl                      |      4 +-
 linux-user/xtensa/target_syscall.h                 |      5 +-
 linux-user/xtensa/termbits.h                       |     55 +-
 memory_ldst.c.inc                                  |    533 +
 memory_ldst.inc.c                                  |    529 -
 meson                                              |      1 +
 meson.build                                        |   2743 +
 meson_options.txt                                  |    127 +
 migration/Makefile.objs                            |     18 -
 migration/block-dirty-bitmap.c                     |    450 +-
 migration/block.c                                  |     40 +-
 migration/channel.c                                |     16 +
 migration/colo-failover.c                          |      6 +-
 migration/colo.c                                   |      7 +-
 migration/dirtyrate.c                              |    426 +
 migration/dirtyrate.h                              |     69 +
 migration/fd.c                                     |      4 +-
 migration/global_state.c                           |      4 +-
 migration/meson.build                              |     34 +
 migration/migration.c                              |    766 +-
 migration/migration.h                              |     54 +-
 migration/multifd.c                                |    178 +-
 migration/multifd.h                                |      2 +
 migration/page_cache.c                             |     21 +-
 migration/page_cache.h                             |      2 +-
 migration/postcopy-ram.c                           |     94 +-
 migration/postcopy-ram.h                           |      2 +-
 migration/qemu-file-channel.c                      |      8 +
 migration/qemu-file.c                              |      2 +-
 migration/qjson.c                                  |    114 -
 migration/qjson.h                                  |     29 -
 migration/ram.c                                    |    417 +-
 migration/ram.h                                    |     19 +-
 migration/rdma.c                                   |     54 +-
 migration/savevm.c                                 |    511 +-
 migration/savevm.h                                 |      3 +
 migration/socket.c                                 |     72 +-
 migration/socket.h                                 |     11 +-
 migration/tls.c                                    |     31 +-
 migration/tls.h                                    |      8 +-
 migration/trace-events                             |     67 +-
 migration/trace.h                                  |      1 +
 migration/vmstate-types.c                          |     64 +-
 migration/vmstate.c                                |     62 +-
 migration/yank_functions.c                         |     20 +
 migration/yank_functions.h                         |     17 +
 monitor/Makefile.objs                              |      6 -
 monitor/hmp-cmds.c                                 |    206 +-
 monitor/hmp.c                                      |     75 +-
 monitor/meson.build                                |      9 +
 monitor/misc.c                                     |    418 +-
 monitor/monitor-internal.h                         |     14 +-
 monitor/monitor.c                                  |    145 +-
 monitor/qmp-cmds-control.c                         |    125 +-
 monitor/qmp-cmds.c                                 |    133 +-
 monitor/qmp.c                                      |    255 +-
 monitor/trace-events                               |      4 +
 monitor/trace.h                                    |      1 +
 nbd/Makefile.objs                                  |      1 -
 nbd/meson.build                                    |      7 +
 nbd/nbd-internal.h                                 |      2 +-
 nbd/server.c                                       |    818 +-
 nbd/trace.h                                        |      1 +
 net/Makefile.objs                                  |     32 -
 net/announce.c                                     |      1 -
 net/can/Makefile.objs                              |      2 -
 net/can/can_core.c                                 |     36 +
 net/can/can_host.c                                 |     21 +-
 net/can/can_socketcan.c                            |     60 +-
 net/can/meson.build                                |      5 +
 net/checksum.c                                     |     24 +-
 net/colo-compare.c                                 |    107 +-
 net/colo.c                                         |      5 +-
 net/dump.c                                         |     15 +-
 net/eth.c                                          |     67 +-
 net/filter-buffer.c                                |     33 +-
 net/filter-mirror.c                                |     81 +-
 net/filter-replay.c                                |      5 +-
 net/filter-rewriter.c                              |     48 +-
 net/filter.c                                       |     24 +-
 net/l2tpv3.c                                       |      9 +-
 net/meson.build                                    |     41 +
 net/net.c                                          |    175 +-
 net/queue.c                                        |     22 +
 net/slirp.c                                        |     13 +-
 net/socket.c                                       |      2 +-
 net/tap-win32.c                                    |     16 +-
 net/tap.c                                          |     45 +-
 net/trace-events                                   |      2 -
 net/trace.h                                        |      1 +
 net/vhost-user.c                                   |     10 +-
 net/vhost-vdpa.c                                   |      7 +-
 os-posix.c                                         |     29 +-
 os-win32.c                                         |     11 -
 page-vary-common.c                                 |     54 +
 page-vary.c                                        |     41 +
 pc-bios/README                                     |     16 +-
 pc-bios/bios-256k.bin                              |    Bin 262144 -> 262144 bytes
 pc-bios/bios-microvm.bin                           |    Bin 65536 -> 131072 bytes
 pc-bios/bios.bin                                   |    Bin 131072 -> 131072 bytes
 pc-bios/descriptors/meson.build                    |     16 +
 pc-bios/edk2-aarch64-code.fd.bz2                   |    Bin 1178070 -> 1507722 bytes
 pc-bios/edk2-arm-code.fd.bz2                       |    Bin 1172752 -> 1503187 bytes
 pc-bios/edk2-i386-code.fd.bz2                      |    Bin 1736199 -> 1646741 bytes


From xen-changelog-bounces@lists.xenproject.org Mon Jul 05 16:44:07 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Jul 2021 16:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150546.278331 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0RhU-0007kx-JI; Mon, 05 Jul 2021 16:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150546.278331; Mon, 05 Jul 2021 16:44:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0RhU-0007kn-Fy; Mon, 05 Jul 2021 16:44:04 +0000
Received: by outflank-mailman (input) for mailman id 150546;
 Mon, 05 Jul 2021 16:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0RhS-0007kh-NB
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 16:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0RhS-0003Cq-Fr
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 16:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0RhS-000269-Em
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 16: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>
DKIM-Signature: v=1; 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/ge6b91S48cpaJi0GQ3UDfX7NuOAJJyMsfIW4q9IWE=; b=mKcKQfYwZlZHaoTRJwOC/4NVYp
	vvkjArot7A3MilR8VjNdDedrrVk6P3TR2q5EJ4DvGZCblK1KpdIqaDFGI7ZKMDaJlaZclfBIWtOrO
	LVR4l/FkrnvItaM3/hRI5X/inZMATrShMIReT/t7W8fNQ4+fDdl16RLjQA7zX5eFeenE=;
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: <E1m0RhS-000269-Em@xenbits.xenproject.org>
Date: Mon, 05 Jul 2021 16:44:02 +0000

commit 21a5a3d67a8c5a403ffa5c8b024a19a7725f94ba
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: Mon Jul 5 10:43:11 2021 +0100

    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 5188ff6540..c1150613f9 100644
--- a/util/main-loop.c
+++ b/util/main-loop.c
@@ -183,6 +183,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
@@ -241,6 +285,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();
@@ -413,6 +459,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 Mon Jul 05 16:44:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Jul 2021 16:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150547.278335 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0Rhd-0007mx-KR; Mon, 05 Jul 2021 16:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150547.278335; Mon, 05 Jul 2021 16:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0Rhd-0007mp-HS; Mon, 05 Jul 2021 16:44:13 +0000
Received: by outflank-mailman (input) for mailman id 150547;
 Mon, 05 Jul 2021 16:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0Rhc-0007mf-KR
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 16:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0Rhc-0003DF-JO
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 16:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0Rhc-000276-I9
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 16: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=c27F8oCQqt8TNqJ1z+P7fbeEOR3eCiuQeP+wKpIG2aA=; b=S0e4ps2FzvqABvLtLf1JF/n1rl
	hIJXpjFvjzDAusngPC1F01IN1q0w6RE79hOtChh4UddUBGzk6ZYSsAnM8Z6fgx9rsIMwZkoNjE+4x
	wBYEhH1OJwkvnbru5h5D01XHt9+bIc+uKbMt5DfNgOtWY7+0SMn/YcEHYno7gzAnkWiw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] xen-mapcache: avoid a race on memory map while using MAP_FIXED
Message-Id: <E1m0Rhc-000276-I9@xenbits.xenproject.org>
Date: Mon, 05 Jul 2021 16:44:12 +0000

commit 73cf1ac4b6fc9f1678f27a51fd1d4ece0c56c77c
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Tue Apr 20 04:35:02 2021 +0100
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Mon Jul 5 10:45:20 2021 +0100

    xen-mapcache: avoid a race on memory map while using MAP_FIXED
    
    When we're replacing the existing mapping there is possibility of a race
    on memory map with other threads doing mmap operations - the address being
    unmapped/re-mapped could be occupied by another thread in between.
    
    Linux mmap man page recommends keeping the existing mappings in place to
    reserve the place and instead utilize the fact that the next mmap operation
    with MAP_FIXED flag passed will implicitly destroy the existing mappings
    behind the chosen address. This behavior is guaranteed by POSIX / BSD and
    therefore is portable.
    
    Note that it wouldn't make the replacement atomic for parallel accesses to
    the replaced region - those might still fail with SIGBUS due to
    xenforeignmemory_map not being atomic. So we're still not expecting those.
    
    Tested-by: Anthony PERARD <anthony.perard@citrix.com>
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Message-Id: <1618889702-13104-1-git-send-email-igor.druzhinin@citrix.com>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    (cherry picked from commit 3e81a71c9f3d23002b1e0dfff902c155d6c8d224)
---
 hw/i386/xen/xen-mapcache.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/hw/i386/xen/xen-mapcache.c b/hw/i386/xen/xen-mapcache.c
index 5b120ed44b..e82b7dcdd2 100644
--- a/hw/i386/xen/xen-mapcache.c
+++ b/hw/i386/xen/xen-mapcache.c
@@ -171,7 +171,20 @@ static void xen_remap_bucket(MapCacheEntry *entry,
         if (!(entry->flags & XEN_MAPCACHE_ENTRY_DUMMY)) {
             ram_block_notify_remove(entry->vaddr_base, entry->size);
         }
-        if (munmap(entry->vaddr_base, entry->size) != 0) {
+
+        /*
+         * If an entry is being replaced by another mapping and we're using
+         * MAP_FIXED flag for it - there is possibility of a race for vaddr
+         * address with another thread doing an mmap call itself
+         * (see man 2 mmap). To avoid that we skip explicit unmapping here
+         * and allow the kernel to destroy the previous mappings by replacing
+         * them in mmap call later.
+         *
+         * Non-identical replacements are not allowed therefore.
+         */
+        assert(!vaddr || (entry->vaddr_base == vaddr && entry->size == size));
+
+        if (!vaddr && munmap(entry->vaddr_base, entry->size) != 0) {
             perror("unmap fails");
             exit(-1);
         }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jul 05 16:44:23 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Jul 2021 16:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150548.278339 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0Rhn-0007qZ-MC; Mon, 05 Jul 2021 16:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150548.278339; Mon, 05 Jul 2021 16:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0Rhn-0007qR-J1; Mon, 05 Jul 2021 16:44:23 +0000
Received: by outflank-mailman (input) for mailman id 150548;
 Mon, 05 Jul 2021 16:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0Rhm-0007qB-Oq
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 16:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0Rhm-0003DS-Nx
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 16:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0Rhm-000282-Mc
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 16:44: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EPq/BrQq+tjThWyUM3DixS+Sm3Vj12aORzD1dAhQ0uA=; b=Hqme9p46IyMlkO+VxM/6q33GF4
	r3k0+nIX9zLtrYLi6YZ4FsKE7vE78U4CwyZuuuvOhoZLckgVW7VvNSWKY8CbMleVdbJeZJN2O6RAR
	4Imd0rU+KifJ+nuWATVPb2wziopHu+AKX3jvIVfyOajju/7v/1bPTpXZI0B2XIa8EExE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] xen: Free xenforeignmemory_resource at exit
Message-Id: <E1m0Rhm-000282-Mc@xenbits.xenproject.org>
Date: Mon, 05 Jul 2021 16:44:22 +0000

commit 077876e6d59d93c458731095928e25ec9860036c
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Fri Apr 30 17:37:42 2021 +0100
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Mon Jul 5 10:45:20 2021 +0100

    xen: Free xenforeignmemory_resource at exit
    
    Because Coverity complains about it and this is one leak that Valgrind
    reports.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Paul Durrant <paul@xen.org>
    Message-Id: <20210430163742.469739-1-anthony.perard@citrix.com>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    (cherry picked from commit f1e43b6026500690fc402828fa7cc735175b93b6)
---
 hw/i386/xen/xen-hvm.c       | 9 ++++++---
 include/hw/xen/xen_common.h | 6 ++++++
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
index 7ce672e5a5..47ed7772fa 100644
--- a/hw/i386/xen/xen-hvm.c
+++ b/hw/i386/xen/xen-hvm.c
@@ -109,6 +109,7 @@ typedef struct XenIOState {
     shared_iopage_t *shared_page;
     shared_vmport_iopage_t *shared_vmport_page;
     buffered_iopage_t *buffered_io_page;
+    xenforeignmemory_resource_handle *fres;
     QEMUTimer *buffered_io_timer;
     CPUState **cpu_by_vcpu_id;
     /* the evtchn port for polling the notification, */
@@ -1254,6 +1255,9 @@ static void xen_exit_notifier(Notifier *n, void *data)
     XenIOState *state = container_of(n, XenIOState, exit);
 
     xen_destroy_ioreq_server(xen_domid, state->ioservid);
+    if (state->fres != NULL) {
+        xenforeignmemory_unmap_resource(xen_fmem, state->fres);
+    }
 
     xenevtchn_close(state->xce_handle);
     xs_daemon_close(state->xenstore);
@@ -1321,7 +1325,6 @@ static void xen_wakeup_notifier(Notifier *notifier, void *data)
 static int xen_map_ioreq_server(XenIOState *state)
 {
     void *addr = NULL;
-    xenforeignmemory_resource_handle *fres;
     xen_pfn_t ioreq_pfn;
     xen_pfn_t bufioreq_pfn;
     evtchn_port_t bufioreq_evtchn;
@@ -1333,12 +1336,12 @@ static int xen_map_ioreq_server(XenIOState *state)
      */
     QEMU_BUILD_BUG_ON(XENMEM_resource_ioreq_server_frame_bufioreq != 0);
     QEMU_BUILD_BUG_ON(XENMEM_resource_ioreq_server_frame_ioreq(0) != 1);
-    fres = xenforeignmemory_map_resource(xen_fmem, xen_domid,
+    state->fres = xenforeignmemory_map_resource(xen_fmem, xen_domid,
                                          XENMEM_resource_ioreq_server,
                                          state->ioservid, 0, 2,
                                          &addr,
                                          PROT_READ | PROT_WRITE, 0);
-    if (fres != NULL) {
+    if (state->fres != NULL) {
         trace_xen_map_resource_ioreq(state->ioservid, addr);
         state->buffered_io_page = addr;
         state->shared_page = addr + TARGET_PAGE_SIZE;
diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h
index 82e56339dd..a8118b41ac 100644
--- a/include/hw/xen/xen_common.h
+++ b/include/hw/xen/xen_common.h
@@ -134,6 +134,12 @@ static inline xenforeignmemory_resource_handle *xenforeignmemory_map_resource(
     return NULL;
 }
 
+static inline int xenforeignmemory_unmap_resource(
+    xenforeignmemory_handle *fmem, xenforeignmemory_resource_handle *fres)
+{
+    return 0;
+}
+
 #endif /* CONFIG_XEN_CTRL_INTERFACE_VERSION < 41100 */
 
 #if CONFIG_XEN_CTRL_INTERFACE_VERSION < 41000
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jul 05 16:44:33 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Jul 2021 16:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150549.278343 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0Rhx-0007td-OH; Mon, 05 Jul 2021 16:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150549.278343; Mon, 05 Jul 2021 16:44:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0Rhx-0007tV-Kh; Mon, 05 Jul 2021 16:44:33 +0000
Received: by outflank-mailman (input) for mailman id 150549;
 Mon, 05 Jul 2021 16:44:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0Rhx-0007tO-3x
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 16:44:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0Rhx-0003Df-32
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 16:44:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0Rhw-000293-W6
 for xen-changelog@lists.xenproject.org; Mon, 05 Jul 2021 16: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Vqj+UHqz7P8QEohoJmuVwzd34WU+HdoHd7rEkG4mI6g=; b=EVgDo4L3keu2SUnPwxYVyrCIon
	f72wQTRyureY0IwqoEuiV9hvjX+gb3k/VJ2JJEsmfCj0ImhZ3z87Uf2R9dXcH3o6hxxTXMF56PIo8
	R0uajsb4iOddwsb7KlMTbTttXbd7eY03DhXL6cF/xtRIiteE6nkw52qjaZqsQPzncsLw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] xen-block: Use specific blockdev driver
Message-Id: <E1m0Rhw-000293-W6@xenbits.xenproject.org>
Date: Mon, 05 Jul 2021 16:44:32 +0000

commit 136c34c9bc4179dc64b15b2bb5f0c54ca4ddf823
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Fri Apr 30 17:34:32 2021 +0100
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Mon Jul 5 10:45:21 2021 +0100

    xen-block: Use specific blockdev driver
    
    ... when a xen-block backend instance is created via xenstore.
    
    Following 8d17adf34f50 ("block: remove support for using "file" driver
    with block/char devices"), using the "file" blockdev driver for
    everything doesn't work anymore, we need to use the "host_device"
    driver when the disk image is a block device and "file" driver when it
    is a regular file.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Paul Durrant <paul@xen.org>
    Message-Id: <20210430163432.468894-1-anthony.perard@citrix.com>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    (cherry picked from commit 1898293990702c5601e225dac9afd2402fc46e2d)
---
 hw/block/xen-block.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
index 83754a4344..674953f1ad 100644
--- a/hw/block/xen-block.c
+++ b/hw/block/xen-block.c
@@ -728,6 +728,8 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
     XenBlockDrive *drive = NULL;
     QDict *file_layer;
     QDict *driver_layer;
+    struct stat st;
+    int rc;
 
     if (params) {
         char **v = g_strsplit(params, ":", 2);
@@ -761,7 +763,17 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
     file_layer = qdict_new();
     driver_layer = qdict_new();
 
-    qdict_put_str(file_layer, "driver", "file");
+    rc = stat(filename, &st);
+    if (rc) {
+        error_setg_errno(errp, errno, "Could not stat file '%s'", filename);
+        goto done;
+    }
+    if (S_ISBLK(st.st_mode)) {
+        qdict_put_str(file_layer, "driver", "host_device");
+    } else {
+        qdict_put_str(file_layer, "driver", "file");
+    }
+
     qdict_put_str(file_layer, "filename", filename);
     g_free(filename);
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 06 04:44:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jul 2021 04:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150704.278612 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0cwG-0008JQ-Bj; Tue, 06 Jul 2021 04:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150704.278612; Tue, 06 Jul 2021 04:44:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0cwG-0008JG-8R; Tue, 06 Jul 2021 04:44:04 +0000
Received: by outflank-mailman (input) for mailman id 150704;
 Tue, 06 Jul 2021 04:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0cwE-0008JA-6b
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 04:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0cwE-0008Ty-4s
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 04:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0cwE-0001oO-3r
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 04: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UcK7Wpyvqb++S5ErzAHFwvrDnuZpvX83MqTFz7Kr33c=; b=x6r+cA2uUC4QHJBb/IN8Jl2X1E
	lTQNscJ6kIDVU8LeUBio/T+nSAEi2Qzu/gCL4wHqY4d2fDKny7XLs7eiZw579nDk7Iu5qy0CX49lS
	HrY2g4695RkE6cJl6xBQksjHeg9oXgnD11q19/JhZcsdUffCVIb73qQO7vh2si9VKpWs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxenguest: Fix max_extd_leaf calculation for legacy restore
Message-Id: <E1m0cwE-0001oO-3r@xenbits.xenproject.org>
Date: Tue, 06 Jul 2021 04:44:02 +0000

commit 5fa174cbf54cc625a023b8e7170e359dd150c072
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jul 2 18:37:57 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Jul 5 11:30:14 2021 +0100

    tools/libxenguest: Fix max_extd_leaf calculation for legacy restore
    
    0x1c is lower than any value which will actually be observed in
    p->extd.max_leaf, but higher than the logical 9 leaves worth of extended data
    on Intel systems, causing x86_cpuid_copy_to_buffer() to fail with -ENOBUFS.
    
    Correct the calculation.
    
    The problem was first noticed in c/s 34990446ca9 "libxl: don't ignore the
    return value from xc_cpuid_apply_policy" but introduced earlier.
    
    Fixes: 111c8c33a8a1 ("x86/cpuid: do not expand max leaves on restore")
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 tools/libs/guest/xg_cpuid_x86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x86.c
index e01d657e03..0c9c4fefc1 100644
--- a/tools/libs/guest/xg_cpuid_x86.c
+++ b/tools/libs/guest/xg_cpuid_x86.c
@@ -513,7 +513,7 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
         /* Clamp maximum leaves to the ones supported on 4.12. */
         p->basic.max_leaf = min(p->basic.max_leaf, 0xdu);
         p->feat.max_subleaf = 0;
-        p->extd.max_leaf = min(p->extd.max_leaf, 0x1cu);
+        p->extd.max_leaf = min(p->extd.max_leaf, 0x8000001c);
     }
 
     if ( featureset )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 06 04:44:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jul 2021 04:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150705.278616 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0cwQ-0008LI-Cw; Tue, 06 Jul 2021 04:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150705.278616; Tue, 06 Jul 2021 04:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0cwQ-0008LA-9x; Tue, 06 Jul 2021 04:44:14 +0000
Received: by outflank-mailman (input) for mailman id 150705;
 Tue, 06 Jul 2021 04:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0cwO-0008Ko-97
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 04:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0cwO-0008UI-8E
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 04:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0cwO-0001pB-7D
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 04: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dpQ7K4mGdxfujo040rtRgwRu91ertC88vUnUUOZaCMc=; b=26YY/A81xHiRh7ixWLItPyMnCg
	5QAt8iI5rlErsyfdyJSB7aM3830YS3/L2Z8VLjtZwTkmYaEs27UJ7vRpMKjxTDHJcL4XO6zHT/fVV
	gIcOaSZpYYfEzID8eK4tHe2Up7rll2XWqU09FYRFxZ4HHZTpWZ8zORKzdKNKpaAaZQEE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxenguest: Fix migration's debug option
Message-Id: <E1m0cwO-0001pB-7D@xenbits.xenproject.org>
Date: Tue, 06 Jul 2021 04:44:12 +0000

commit 383b41974d5543b62f3181d216070fe3691fb130
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jul 2 19:08:46 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Jul 5 11:30:14 2021 +0100

    tools/libxenguest: Fix migration's debug option
    
    The code has gone through many refactors, but the first refactor was the one
    which broke it by inverting the check with respect to checkpointed streams.
    
    Fixes: 7449fb36c6c8 ("migration/save: pass checkpointed_stream from libxl to libxc")
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 tools/libs/guest/xg_sr_save.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index 2ba7c3200c..f0e2bd048d 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -752,7 +752,7 @@ static int send_domain_memory_live(struct xc_sr_context *ctx)
     if ( rc )
         goto out;
 
-    if ( ctx->save.debug && ctx->stream_type != XC_STREAM_PLAIN )
+    if ( ctx->save.debug && ctx->stream_type == XC_STREAM_PLAIN )
     {
         rc = verify_frames(ctx);
         if ( rc )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 06 08:55:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jul 2021 08:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150911.278968 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0grD-0007vE-6Y; Tue, 06 Jul 2021 08:55:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150911.278968; Tue, 06 Jul 2021 08:55:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0grD-0007v6-23; Tue, 06 Jul 2021 08:55:07 +0000
Received: by outflank-mailman (input) for mailman id 150911;
 Tue, 06 Jul 2021 08:55:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0grB-0007uy-3g
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 08:55:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0grB-0005Bh-1X
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 08:55:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0grB-0005TZ-0d
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 08: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Q27VuWSl4IAzZ5KM8bSMgGi/Oxc6bZPM2MIl2Hzj/aA=; b=g5Ko7zHIHW1630Wgc3Pu6rdW33
	sSejXvIpEwzjldimRjRsUJcjdjkxqEDIXifGwMFwd08/wsHEQ3u6x3f5TbkRn/KA0Mb4N67wGlVQw
	HaAiduXarvv0bYz00USVEEAttCcertvcGLOIIkgBJuCGI3LRT0zRK1oRyuu95pj3BBGM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libxl/arm: provide guests with random seed
Message-Id: <E1m0grB-0005TZ-0d@xenbits.xenproject.org>
Date: Tue, 06 Jul 2021 08:55:05 +0000

commit 33e48312cf28f6fb78c03b14514fa7718de97ef5
Author:     Sergiy Kibrik <Sergiy_Kibrik@epam.com>
AuthorDate: Tue Jul 6 06:33:45 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Jul 6 09:47:33 2021 +0100

    libxl/arm: provide guests with random seed
    
    Pass 128 bytes of random seed via FDT, so that guests' CRNGs are better seeded
    early at boot. This is larger than ChaCha20 key size of 32, so each byte of
    CRNG state will be mixed 4 times using this seed. There does not seem to be
    advantage in larger seed though.
    
    Depending on its configuration Linux can use the seed as device randomness
    or to just quickly initialize CRNG.
    In either case this will provide extra randomness to further harden CRNG.
    
    Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
    Reviewed-by: Julien Grall <julien@xen.org>
    Reviewed-by: Michal Orzel <michal.orzel@arm.com>
---
 tools/libs/light/libxl_arm.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
index e2901f13b7..e3140a6e00 100644
--- a/tools/libs/light/libxl_arm.c
+++ b/tools/libs/light/libxl_arm.c
@@ -305,6 +305,9 @@ static int make_chosen_node(libxl__gc *gc, void *fdt, bool ramdisk,
 {
     int res;
 
+    /* 1024 bit enough to mix Linux CRNG state several times */
+    uint8_t seed[128];
+
     /* See linux Documentation/devicetree/... */
     res = fdt_begin_node(fdt, "chosen");
     if (res) return res;
@@ -343,6 +346,11 @@ static int make_chosen_node(libxl__gc *gc, void *fdt, bool ramdisk,
         if (res) return res;
     }
 
+    res = libxl__random_bytes(gc, seed, sizeof(seed));
+    if (res) return res;
+    res = fdt_property(fdt, "rng-seed", seed, sizeof(seed));
+    if (res) return res;
+
     res = fdt_end_node(fdt);
     if (res) return res;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jul 06 08:55:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jul 2021 08:55:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150912.278971 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0grM-0007xm-8B; Tue, 06 Jul 2021 08:55:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150912.278971; Tue, 06 Jul 2021 08:55:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0grM-0007xd-52; Tue, 06 Jul 2021 08:55:16 +0000
Received: by outflank-mailman (input) for mailman id 150912;
 Tue, 06 Jul 2021 08:55:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0grL-0007xT-5C
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 08:55:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0grL-0005C4-4R
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 08:55:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0grL-0005UG-3b
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 08: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=G8XRedC9mHKnWCptu6a87+nOIIlaUjI/TNjKk7w+PH4=; b=jgs/90bv5KmRLLCwbakorNPq/E
	LaYC3xeO/WlKHNRDfvm9Kd4hJGnDnjnNW9hvMhUB5QQZnynCdzr3JlYJSP4BVqydb8mJsO37xvEir
	CkzSzy50wpcivPxttujg5TOVdm0+HLiCQ8MZUKGl0Kfm6nQW4CmIuYlOSHJ0FqAht4Ek=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstored: Stash the correct request in lu_status->in
Message-Id: <E1m0grL-0005UG-3b@xenbits.xenproject.org>
Date: Tue, 06 Jul 2021 08:55:15 +0000

commit 09e2cd69956fe529bfc3d53dae477b44eff217d1
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Jul 1 15:03:07 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Jul 6 09:50:57 2021 +0100

    tools/xenstored: Stash the correct request in lu_status->in
    
    When Live-Updating with some load, Xenstored may hit the assert
    req->in == lu_status->in in do_lu_start().
    
    This is happening because the request is stashed when Live-Update
    begins. This happens in a different request (see call lu_begin()
    when select the new binary) from the one performing Live-Update.
    
    To avoid the problem, stash the request in lu_start().
    
    Fixes: 65f19ed62aa1 ("tools/xenstore: Don't assume conn->in points to the LU request")
    Reported-by: Michael Kurth <mku@amazon.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: luca.fancellu@arm.com
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstore/xenstored_control.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_control.c
index a1b1bd5a71..ff9863c17f 100644
--- a/tools/xenstore/xenstored_control.c
+++ b/tools/xenstore/xenstored_control.c
@@ -103,7 +103,6 @@ static const char *lu_begin(struct connection *conn)
 	if (!lu_status)
 		return "Allocation failure.";
 	lu_status->conn = conn;
-	lu_status->in = conn->in;
 	talloc_set_destructor(lu_status, lu_destroy);
 
 	return NULL;
@@ -757,6 +756,7 @@ static const char *lu_start(const void *ctx, struct connection *conn,
 	lu_status->force = force;
 	lu_status->timeout = to;
 	lu_status->started_at = time(NULL);
+	lu_status->in = conn->in;
 
 	errno = delay_request(conn, conn->in, do_lu_start, conn, false);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jul 06 09:00:06 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jul 2021 09:00:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150925.278999 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0gw2-0001WY-4o; Tue, 06 Jul 2021 09:00:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150925.278999; Tue, 06 Jul 2021 09:00:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0gw2-0001WD-1W; Tue, 06 Jul 2021 09:00:06 +0000
Received: by outflank-mailman (input) for mailman id 150925;
 Tue, 06 Jul 2021 09:00:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0gw0-0001NV-QR
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09:00:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0gw0-0005Jr-PY
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09:00:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0gw0-00068U-OV
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09:00: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GorMqiMGux+LSy+ZfWH92jrf/U0fUpE3S3l4ceZq5t0=; b=kBUTpxyh+sxiOeKT3vkOmYloPB
	E+LC7He/eRArCbD37c+f1UVAYlfPBgJL95owpQySwhcJQDZm+6mQMvnW+eW5rdglLdgdUP7ITKbzM
	TVv7IOh69ATjIeYh2fc31Qt598JVVsq33G9r30TAcM6bZ0yYdRIg7J3W4AvwcwrmWges=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: bootfdt: Always sort memory banks
Message-Id: <E1m0gw0-00068U-OV@xenbits.xenproject.org>
Date: Tue, 06 Jul 2021 09:00:04 +0000

commit 4473f3601098a2c3cf5ab89d5a29504772985e3a
Author:     Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
AuthorDate: Mon Jul 5 20:48:51 2021 +0300
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Jul 6 09:55:53 2021 +0100

    xen/arm: bootfdt: Always sort memory banks
    
    At the moment, Xen on Arm64 expects the memory banks to be ordered.
    Unfortunately, there may be a case when updated by firmware
    device tree contains unordered banks. This means Xen will panic
    when setting xenheap mappings for the subsequent bank with start
    address being less than xenheap_mfn_start (start address of
    the first bank).
    
    As there is no clear requirement regarding ordering in the device
    tree, update code to be able to deal with by sorting memory
    banks. There is only one heap region on Arm32, so the sorting
    is fine to be done in the common code.
    
    Suggested-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/bootfdt.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
index dcff512648..476e32e0f5 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/arch/arm/bootfdt.c
@@ -13,6 +13,7 @@
 #include <xen/init.h>
 #include <xen/device_tree.h>
 #include <xen/libfdt/libfdt.h>
+#include <xen/sort.h>
 #include <xsm/xsm.h>
 #include <asm/setup.h>
 
@@ -395,6 +396,21 @@ static void __init early_print_info(void)
     printk("\n");
 }
 
+/* This function assumes that memory regions are not overlapped */
+static int __init cmp_memory_node(const void *key, const void *elem)
+{
+    const struct membank *handler0 = key;
+    const struct membank *handler1 = elem;
+
+    if ( handler0->start < handler1->start )
+        return -1;
+
+    if ( handler0->start >= (handler1->start + handler1->size) )
+        return 1;
+
+    return 0;
+}
+
 /**
  * boot_fdt_info - initialize bootinfo from a DTB
  * @fdt: flattened device tree binary
@@ -412,6 +428,15 @@ size_t __init boot_fdt_info(const void *fdt, paddr_t paddr)
     add_boot_module(BOOTMOD_FDT, paddr, fdt_totalsize(fdt), false);
 
     device_tree_for_each_node((void *)fdt, 0, early_scan_node, NULL);
+
+    /*
+     * On Arm64 setup_xenheap_mappings() expects to be called with the lowest
+     * bank in memory first. There is no requirement that the DT will provide
+     * the banks sorted in ascending order. So sort them through.
+     */
+    sort(bootinfo.mem.bank, bootinfo.mem.nr_banks, sizeof(struct membank),
+         cmp_memory_node, NULL);
+
     early_print_info();
 
     return fdt_totalsize(fdt);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jul 06 09:11:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jul 2021 09:11:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150941.279026 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0h6g-0003lK-D5; Tue, 06 Jul 2021 09:11:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150941.279026; Tue, 06 Jul 2021 09:11:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0h6g-0003lD-9s; Tue, 06 Jul 2021 09:11:06 +0000
Received: by outflank-mailman (input) for mailman id 150941;
 Tue, 06 Jul 2021 09:11:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0h6e-0003l5-8d
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09:11:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0h6e-0005VW-7l
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09:11:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0h6e-00076l-6e
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YIZrMUBNUAJOIrXwUISvhJLfY2TVUYJPmuBVuKWNvB4=; b=69kcG5x1YpTMFZ/XRuzbfEJzGK
	Q7Xhxa9hClfTgkV+Ja/w8dlym+8J9ZZFNl7/3Bd705fApDqP3ndhAySL+NS3RN66R742+0pKCt327
	gOtmvZ9BWcc404gK3olJIhTMFGeU7xR7E2CYV1T/u3yiqyJW6PZ2ecQyXpMRSEB1Hy/8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm64: Change type of hsr, cpsr, spsr_el1 to uint64_t
Message-Id: <E1m0h6e-00076l-6e@xenbits.xenproject.org>
Date: Tue, 06 Jul 2021 09:11:04 +0000

commit 918b8842a852e0e7446286f546724b1c63c56c66
Author:     Michal Orzel <michal.orzel@arm.com>
AuthorDate: Mon Jul 5 08:39:52 2021 +0200
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Jul 6 10:02:00 2021 +0100

    arm64: Change type of hsr, cpsr, spsr_el1 to uint64_t
    
    AArch64 registers are 64bit whereas AArch32 registers
    are 32bit or 64bit. MSR/MRS are expecting 64bit values thus
    we should get rid of helpers READ/WRITE_SYSREG32
    in favour of using READ/WRITE_SYSREG.
    We should also use register_t type when reading sysregs
    which can correspond to uint64_t or uint32_t.
    Even though many AArch64 registers have upper 32bit reserved
    it does not mean that they can't be widen in the future.
    
    Modify type of hsr, cpsr, spsr_el1 to uint64_t.
    Previously we relied on the padding after spsr_el1.
    As we removed the padding, modify the union to be 64bit so we don't corrupt spsr_fiq.
    No need to modify the assembly code because the accesses were based on 64bit
    registers as there was a 32bit padding after spsr_el1.
    
    Remove 32bit padding in cpu_user_regs before spsr_fiq
    as it is no longer needed due to upper union being 64bit now.
    Add 64bit padding in cpu_user_regs before spsr_el1
    because the kernel frame should be 16-byte aligned.
    
    Change type of cpsr to uint64_t in the public outside interface
    "public/arch-arm.h" to allow ABI compatibility between 32bit and 64bit.
    Increment XEN_DOMCTL_INTERFACE_VERSION.
    
    Change type of cpsr to uint64_t in the public outside interface
    "public/vm_event.h" to allow ABI compatibility between 32bit and 64bit.
    
    Signed-off-by: Michal Orzel <michal.orzel@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/arm64/entry.S            |  4 ++--
 xen/arch/arm/arm64/traps.c            |  2 +-
 xen/arch/arm/arm64/vsysreg.c          |  3 ++-
 xen/arch/arm/domain.c                 |  2 +-
 xen/arch/arm/traps.c                  | 28 +++++++++++++++-------------
 xen/arch/arm/vcpreg.c                 | 13 +++++++------
 xen/include/asm-arm/arm64/processor.h | 11 ++++++-----
 xen/include/asm-arm/hsr.h             |  2 +-
 xen/include/public/arch-arm.h         |  4 ++--
 xen/include/public/domctl.h           |  2 +-
 xen/include/public/vm_event.h         |  3 +--
 11 files changed, 39 insertions(+), 35 deletions(-)

diff --git a/xen/arch/arm/arm64/entry.S b/xen/arch/arm/arm64/entry.S
index ab9a65fc14..fc3811ad0a 100644
--- a/xen/arch/arm/arm64/entry.S
+++ b/xen/arch/arm/arm64/entry.S
@@ -155,7 +155,7 @@
         add     x21, sp, #UREGS_CPSR
         mrs     x22, spsr_el2
         mrs     x23, esr_el2
-        stp     w22, w23, [x21]
+        stp     x22, x23, [x21]
 
         .endm
 
@@ -432,7 +432,7 @@ return_from_trap:
         msr     daifset, #IFLAGS___I_ /* Mask interrupts */
 
         ldr     x21, [sp, #UREGS_PC]            /* load ELR */
-        ldr     w22, [sp, #UREGS_CPSR]          /* load SPSR */
+        ldr     x22, [sp, #UREGS_CPSR]          /* load SPSR */
 
         pop     x0, x1
         pop     x2, x3
diff --git a/xen/arch/arm/arm64/traps.c b/xen/arch/arm/arm64/traps.c
index babfc1d884..9113a15c7a 100644
--- a/xen/arch/arm/arm64/traps.c
+++ b/xen/arch/arm/arm64/traps.c
@@ -36,7 +36,7 @@ void do_bad_mode(struct cpu_user_regs *regs, int reason)
     union hsr hsr = { .bits = regs->hsr };
 
     printk("Bad mode in %s handler detected\n", handler[reason]);
-    printk("ESR=0x%08"PRIx32":  EC=%"PRIx32", IL=%"PRIx32", ISS=%"PRIx32"\n",
+    printk("ESR=%#"PRIregister":  EC=%"PRIx32", IL=%"PRIx32", ISS=%"PRIx32"\n",
            hsr.bits, hsr.ec, hsr.len, hsr.iss);
 
     local_irq_disable();
diff --git a/xen/arch/arm/arm64/vsysreg.c b/xen/arch/arm/arm64/vsysreg.c
index 41f18612c6..caf17174b8 100644
--- a/xen/arch/arm/arm64/vsysreg.c
+++ b/xen/arch/arm/arm64/vsysreg.c
@@ -368,7 +368,8 @@ void do_sysreg(struct cpu_user_regs *regs,
                      sysreg.op2,
                      sysreg.read ? "=>" : "<=",
                      sysreg.reg, regs->pc);
-            gdprintk(XENLOG_ERR, "unhandled 64-bit sysreg access %#x\n",
+            gdprintk(XENLOG_ERR,
+                     "unhandled 64-bit sysreg access %#"PRIregister"\n",
                      hsr.bits & HSR_SYSREG_REGS_MASK);
             inject_undef_exception(regs, hsr);
             return;
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index c021a03c61..74bdbb9082 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -845,7 +845,7 @@ static int is_guest_pv32_psr(uint32_t psr)
 
 
 #ifdef CONFIG_ARM_64
-static int is_guest_pv64_psr(uint32_t psr)
+static int is_guest_pv64_psr(uint64_t psr)
 {
     if ( psr & PSR_MODE_BIT )
         return 0;
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index e7384381cc..4ccb6e7d18 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -546,7 +546,7 @@ void inject_undef64_exception(struct cpu_user_regs *regs, int instr_len)
         PSR_IRQ_MASK | PSR_DBG_MASK;
     regs->pc = handler;
 
-    WRITE_SYSREG32(esr.bits, ESR_EL1);
+    WRITE_SYSREG(esr.bits, ESR_EL1);
 }
 
 /* Inject an abort exception into a 64 bit guest */
@@ -580,7 +580,7 @@ static void inject_abt64_exception(struct cpu_user_regs *regs,
     regs->pc = handler;
 
     WRITE_SYSREG(addr, FAR_EL1);
-    WRITE_SYSREG32(esr.bits, ESR_EL1);
+    WRITE_SYSREG(esr.bits, ESR_EL1);
 }
 
 static void inject_dabt64_exception(struct cpu_user_regs *regs,
@@ -717,7 +717,7 @@ struct reg_ctxt {
     uint64_t vttbr_el2;
 };
 
-static const char *mode_string(uint32_t cpsr)
+static const char *mode_string(register_t cpsr)
 {
     uint32_t mode;
     static const char *mode_strings[] = {
@@ -762,7 +762,7 @@ static void show_registers_32(const struct cpu_user_regs *regs,
         printk(" %pS", _p(regs->pc));
     printk("\n");
 #endif
-    printk("CPSR:   %08"PRIx32" MODE:%s\n", regs->cpsr,
+    printk("CPSR:   %"PRIregister" MODE:%s\n", regs->cpsr,
            mode_string(regs->cpsr));
     printk("     R0: %08"PRIx32" R1: %08"PRIx32" R2: %08"PRIx32" R3: %08"PRIx32"\n",
            regs->r0, regs->r1, regs->r2, regs->r3);
@@ -846,7 +846,7 @@ static void show_registers_64(const struct cpu_user_regs *regs,
     {
         printk("SP:     %016"PRIx64"\n", regs->sp);
     }
-    printk("CPSR:   %08"PRIx32" MODE:%s\n", regs->cpsr,
+    printk("CPSR:   %016"PRIx64" MODE:%s\n", regs->cpsr,
            mode_string(regs->cpsr));
     printk("     X0: %016"PRIx64"  X1: %016"PRIx64"  X2: %016"PRIx64"\n",
            regs->x0, regs->x1, regs->x2);
@@ -919,7 +919,7 @@ static void _show_registers(const struct cpu_user_regs *regs,
     printk("   HCR_EL2: %"PRIregister"\n", READ_SYSREG(HCR_EL2));
     printk(" TTBR0_EL2: %016"PRIx64"\n", READ_SYSREG64(TTBR0_EL2));
     printk("\n");
-    printk("   ESR_EL2: %08"PRIx32"\n", regs->hsr);
+    printk("   ESR_EL2: %"PRIregister"\n", regs->hsr);
     printk(" HPFAR_EL2: %"PRIregister"\n", READ_SYSREG(HPFAR_EL2));
 
 #ifdef CONFIG_ARM_32
@@ -1599,7 +1599,7 @@ static const unsigned short cc_map[16] = {
 
 int check_conditional_instr(struct cpu_user_regs *regs, const union hsr hsr)
 {
-    unsigned long cpsr, cpsr_cond;
+    register_t cpsr, cpsr_cond;
     int cond;
 
     /*
@@ -1661,7 +1661,7 @@ int check_conditional_instr(struct cpu_user_regs *regs, const union hsr hsr)
 
 void advance_pc(struct cpu_user_regs *regs, const union hsr hsr)
 {
-    unsigned long itbits, cond, cpsr = regs->cpsr;
+    register_t itbits, cond, cpsr = regs->cpsr;
     bool is_thumb = psr_mode_is_32bit(regs) && (cpsr & PSR_THUMB);
 
     if ( is_thumb && (cpsr & PSR_IT_MASK) )
@@ -2004,13 +2004,15 @@ static void do_trap_stage2_abort_guest(struct cpu_user_regs *regs,
 
         break;
     default:
-        gprintk(XENLOG_WARNING, "Unsupported FSC: HSR=%#x DFSC=%#x\n",
+        gprintk(XENLOG_WARNING,
+                "Unsupported FSC: HSR=%#"PRIregister" DFSC=%#x\n",
                 hsr.bits, xabt.fsc);
     }
 
 inject_abt:
-    gdprintk(XENLOG_DEBUG, "HSR=0x%x pc=%#"PRIregister" gva=%#"PRIvaddr
-             " gpa=%#"PRIpaddr"\n", hsr.bits, regs->pc, gva, gpa);
+    gdprintk(XENLOG_DEBUG,
+             "HSR=%#"PRIregister" pc=%#"PRIregister" gva=%#"PRIvaddr" gpa=%#"PRIpaddr"\n",
+             hsr.bits, regs->pc, gva, gpa);
     if ( is_data )
         inject_dabt_exception(regs, gva, hsr.len);
     else
@@ -2204,7 +2206,7 @@ void do_trap_guest_sync(struct cpu_user_regs *regs)
 
     default:
         gprintk(XENLOG_WARNING,
-                "Unknown Guest Trap. HSR=0x%x EC=0x%x IL=%x Syndrome=0x%"PRIx32"\n",
+                "Unknown Guest Trap. HSR=%#"PRIregister" EC=0x%x IL=%x Syndrome=0x%"PRIx32"\n",
                 hsr.bits, hsr.ec, hsr.len, hsr.iss);
         inject_undef_exception(regs, hsr);
     }
@@ -2242,7 +2244,7 @@ void do_trap_hyp_sync(struct cpu_user_regs *regs)
         break;
     }
     default:
-        printk("Hypervisor Trap. HSR=0x%x EC=0x%x IL=%x Syndrome=0x%"PRIx32"\n",
+        printk("Hypervisor Trap. HSR=%#"PRIregister" EC=0x%x IL=%x Syndrome=0x%"PRIx32"\n",
                hsr.bits, hsr.ec, hsr.len, hsr.iss);
         do_unexpected_trap("Hypervisor", regs);
     }
diff --git a/xen/arch/arm/vcpreg.c b/xen/arch/arm/vcpreg.c
index 55351fc087..f0cdcc8a54 100644
--- a/xen/arch/arm/vcpreg.c
+++ b/xen/arch/arm/vcpreg.c
@@ -385,7 +385,7 @@ void do_cp15_32(struct cpu_user_regs *regs, const union hsr hsr)
                  "%s p15, %d, r%d, cr%d, cr%d, %d @ 0x%"PRIregister"\n",
                  cp32.read ? "mrc" : "mcr",
                  cp32.op1, cp32.reg, cp32.crn, cp32.crm, cp32.op2, regs->pc);
-        gdprintk(XENLOG_ERR, "unhandled 32-bit CP15 access %#x\n",
+        gdprintk(XENLOG_ERR, "unhandled 32-bit CP15 access %#"PRIregister"\n",
                  hsr.bits & HSR_CP32_REGS_MASK);
         inject_undef_exception(regs, hsr);
         return;
@@ -454,7 +454,8 @@ void do_cp15_64(struct cpu_user_regs *regs, const union hsr hsr)
                      "%s p15, %d, r%d, r%d, cr%d @ 0x%"PRIregister"\n",
                      cp64.read ? "mrrc" : "mcrr",
                      cp64.op1, cp64.reg1, cp64.reg2, cp64.crm, regs->pc);
-            gdprintk(XENLOG_ERR, "unhandled 64-bit CP15 access %#x\n",
+            gdprintk(XENLOG_ERR,
+                     "unhandled 64-bit CP15 access %#"PRIregister"\n",
                      hsr.bits & HSR_CP64_REGS_MASK);
             inject_undef_exception(regs, hsr);
             return;
@@ -585,7 +586,7 @@ void do_cp14_32(struct cpu_user_regs *regs, const union hsr hsr)
                  "%s p14, %d, r%d, cr%d, cr%d, %d @ 0x%"PRIregister"\n",
                   cp32.read ? "mrc" : "mcr",
                   cp32.op1, cp32.reg, cp32.crn, cp32.crm, cp32.op2, regs->pc);
-        gdprintk(XENLOG_ERR, "unhandled 32-bit cp14 access %#x\n",
+        gdprintk(XENLOG_ERR, "unhandled 32-bit cp14 access %#"PRIregister"\n",
                  hsr.bits & HSR_CP32_REGS_MASK);
         inject_undef_exception(regs, hsr);
         return;
@@ -627,7 +628,7 @@ void do_cp14_64(struct cpu_user_regs *regs, const union hsr hsr)
              "%s p14, %d, r%d, r%d, cr%d @ 0x%"PRIregister"\n",
              cp64.read ? "mrrc" : "mcrr",
              cp64.op1, cp64.reg1, cp64.reg2, cp64.crm, regs->pc);
-    gdprintk(XENLOG_ERR, "unhandled 64-bit CP14 access %#x\n",
+    gdprintk(XENLOG_ERR, "unhandled 64-bit CP14 access %#"PRIregister"\n",
              hsr.bits & HSR_CP64_REGS_MASK);
     inject_undef_exception(regs, hsr);
 }
@@ -658,7 +659,7 @@ void do_cp14_dbg(struct cpu_user_regs *regs, const union hsr hsr)
              "%s p14, %d, r%d, r%d, cr%d @ 0x%"PRIregister"\n",
              cp64.read ? "mrrc" : "mcrr",
              cp64.op1, cp64.reg1, cp64.reg2, cp64.crm, regs->pc);
-    gdprintk(XENLOG_ERR, "unhandled 64-bit CP14 DBG access %#x\n",
+    gdprintk(XENLOG_ERR, "unhandled 64-bit CP14 DBG access %#"PRIregister"\n",
              hsr.bits & HSR_CP64_REGS_MASK);
 
     inject_undef_exception(regs, hsr);
@@ -692,7 +693,7 @@ void do_cp10(struct cpu_user_regs *regs, const union hsr hsr)
                  "%s p10, %d, r%d, cr%d, cr%d, %d @ 0x%"PRIregister"\n",
                  cp32.read ? "mrc" : "mcr",
                  cp32.op1, cp32.reg, cp32.crn, cp32.crm, cp32.op2, regs->pc);
-        gdprintk(XENLOG_ERR, "unhandled 32-bit CP10 access %#x\n",
+        gdprintk(XENLOG_ERR, "unhandled 32-bit CP10 access %#"PRIregister"\n",
                  hsr.bits & HSR_CP32_REGS_MASK);
         inject_undef_exception(regs, hsr);
         return;
diff --git a/xen/include/asm-arm/arm64/processor.h b/xen/include/asm-arm/arm64/processor.h
index 81dfc5e615..c749f80ad9 100644
--- a/xen/include/asm-arm/arm64/processor.h
+++ b/xen/include/asm-arm/arm64/processor.h
@@ -63,18 +63,19 @@ struct cpu_user_regs
 
     /* Return address and mode */
     __DECL_REG(pc,           pc32);             /* ELR_EL2 */
-    uint32_t cpsr;                              /* SPSR_EL2 */
-    uint32_t hsr;                               /* ESR_EL2 */
+    uint64_t cpsr;                              /* SPSR_EL2 */
+    uint64_t hsr;                               /* ESR_EL2 */
+
+    /* The kernel frame should be 16-byte aligned. */
+    uint64_t pad0;
 
     /* Outer guest frame only from here on... */
 
     union {
-        uint32_t spsr_el1;       /* AArch64 */
+        uint64_t spsr_el1;       /* AArch64 */
         uint32_t spsr_svc;       /* AArch32 */
     };
 
-    uint32_t pad1; /* Doubleword-align the user half of the frame */
-
     /* AArch32 guests only */
     uint32_t spsr_fiq, spsr_irq, spsr_und, spsr_abt;
 
diff --git a/xen/include/asm-arm/hsr.h b/xen/include/asm-arm/hsr.h
index 29d4531f40..9b91b28c48 100644
--- a/xen/include/asm-arm/hsr.h
+++ b/xen/include/asm-arm/hsr.h
@@ -16,7 +16,7 @@ enum dabt_size {
 };
 
 union hsr {
-    uint32_t bits;
+    register_t bits;
     struct {
         unsigned long iss:25;  /* Instruction Specific Syndrome */
         unsigned long len:1;   /* Instruction length */
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 713fd65317..64a2ca30da 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -267,10 +267,10 @@ struct vcpu_guest_core_regs
 
     /* Return address and mode */
     __DECL_REG(pc64,         pc32);             /* ELR_EL2 */
-    uint32_t cpsr;                              /* SPSR_EL2 */
+    uint64_t cpsr;                              /* SPSR_EL2 */
 
     union {
-        uint32_t spsr_el1;       /* AArch64 */
+        uint64_t spsr_el1;       /* AArch64 */
         uint32_t spsr_svc;       /* AArch32 */
     };
 
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 4dbf107785..d576bfabd6 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -38,7 +38,7 @@
 #include "hvm/save.h"
 #include "memory.h"
 
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000013
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000014
 
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
diff --git a/xen/include/public/vm_event.h b/xen/include/public/vm_event.h
index 36135ba4f1..bb003d21d0 100644
--- a/xen/include/public/vm_event.h
+++ b/xen/include/public/vm_event.h
@@ -266,8 +266,7 @@ struct vm_event_regs_arm {
     uint64_t ttbr1;
     uint64_t ttbcr;
     uint64_t pc;
-    uint32_t cpsr;
-    uint32_t _pad;
+    uint64_t cpsr;
 };
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jul 06 09:55:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jul 2021 09:55:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150969.279074 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0hnH-0001MP-Gy; Tue, 06 Jul 2021 09:55:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150969.279074; Tue, 06 Jul 2021 09:55:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0hnH-0001MG-Dm; Tue, 06 Jul 2021 09:55:07 +0000
Received: by outflank-mailman (input) for mailman id 150969;
 Tue, 06 Jul 2021 09:55:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0hnF-0001MA-Np
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09:55:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0hnF-0006E2-FE
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09:55:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0hnF-0002W3-E6
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=eZLBjMEBHI7/wYaEwyVnaPLy4GalwxKjwH3DScsH5Eg=; b=24UPXBDurY+WE3T3BQaeHcp8zB
	I1lLx/gu8AQTM3xsdwqb6HeAvVyFfkQKj1WWQuNg3svocbycV8b74QRUZXY/o3wYTycPrXGq3l60W
	1M9sbODCPeoKaBMjgaEH4ycijOV5988W3jkpkMjM7v9FUYSHVFoG13NYj7WsJdUkb4Os=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/python: handle libxl__physmap_info.name properly in convert-legacy-stream
Message-Id: <E1m0hnF-0002W3-E6@xenbits.xenproject.org>
Date: Tue, 06 Jul 2021 09:55:05 +0000

commit c8f88810db2a25d6aacf65c1c60bc4f5d848a483
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:56:00 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jul 6 10:49:58 2021 +0100

    tools/python: handle libxl__physmap_info.name properly in convert-legacy-stream
    
    The trailing member name[] in libxl__physmap_info is written as a
    cstring into the stream. The current code does a sanity check if the
    last byte is zero. This attempt fails with python3 because name[-1]
    returns a type int. As a result the comparison with byte(\00) fails:
    
      File "/usr/lib/xen/bin/convert-legacy-stream", line 347, in read_libxl_toolstack
        raise StreamError("physmap name not NUL terminated")
      StreamError: physmap name not NUL terminated
    
    To handle both python variants, cast to bytearray().
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 tools/python/scripts/convert-legacy-stream | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/python/scripts/convert-legacy-stream b/tools/python/scripts/convert-legacy-stream
index 66ee3d2f5d..227e1b5c3f 100755
--- a/tools/python/scripts/convert-legacy-stream
+++ b/tools/python/scripts/convert-legacy-stream
@@ -343,7 +343,7 @@ def read_libxl_toolstack(vm, data):
         if twidth == 64:
             name = name[:-4]
 
-        if name[-1] != b'\x00':
+        if bytearray(name)[-1] != 0:
             raise StreamError("physmap name not NUL terminated")
 
         root = b"physmap/%x" % (phys, )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jul 06 09:55:18 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jul 2021 09:55:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150970.279079 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0hnR-0001OF-Iq; Tue, 06 Jul 2021 09:55:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150970.279079; Tue, 06 Jul 2021 09:55:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0hnR-0001O7-FM; Tue, 06 Jul 2021 09:55:17 +0000
Received: by outflank-mailman (input) for mailman id 150970;
 Tue, 06 Jul 2021 09:55:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0hnP-0001Nz-JM
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09:55:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0hnP-0006EV-IY
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09:55:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0hnP-0002Wy-HP
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1N6DjQun8XNd2gAih99gS5n4uMrrlThAPkblwpCMiwA=; b=4sRbh2rIUYGq2ht7+2mUFmBxx4
	fCYms8JlqXJRabWgVp25sZ6n0ruipidhMAMqCpIcVs3KEs6lwoQ3GAR2SNPROkDoopbFoOEvufYGC
	Jht5/3LgCjuxj3m+W3grTa/RTofhbkx9kUk0j8tZSTzsyuZgNoLi9CGDUjF+jpIYJjHQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/python: fix Python3.4 TypeError in format string
Message-Id: <E1m0hnP-0002Wy-HP@xenbits.xenproject.org>
Date: Tue, 06 Jul 2021 09:55:15 +0000

commit a27976a1080d537fb1f212a8f9133d60daa0025b
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:56:01 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jul 6 10:49:58 2021 +0100

    tools/python: fix Python3.4 TypeError in format string
    
    Using the first element of a tuple for a format specifier fails with
    python3.4 as included in SLE12:
        b = b"string/%x" % (i, )
    TypeError: unsupported operand type(s) for %: 'bytes' and 'tuple'
    
    It happens to work with python 2.7 and 3.6.
    To support older Py3, format as strings and explicitly encode as ASCII.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 tools/python/scripts/convert-legacy-stream | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/python/scripts/convert-legacy-stream b/tools/python/scripts/convert-legacy-stream
index 227e1b5c3f..7fe375a668 100755
--- a/tools/python/scripts/convert-legacy-stream
+++ b/tools/python/scripts/convert-legacy-stream
@@ -346,9 +346,9 @@ def read_libxl_toolstack(vm, data):
         if bytearray(name)[-1] != 0:
             raise StreamError("physmap name not NUL terminated")
 
-        root = b"physmap/%x" % (phys, )
-        kv = [root + b"/start_addr", b"%x" % (start, ),
-              root + b"/size",       b"%x" % (size, ),
+        root = ("physmap/%x" % (phys, )).encode('ascii')
+        kv = [root + b"/start_addr", ("%x" % (start, )).encode('ascii'),
+              root + b"/size",       ("%x" % (size, )).encode('ascii'),
               root + b"/name",       name[:-1]]
 
         for key, val in zip(kv[0::2], kv[1::2]):
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jul 06 09:55:27 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jul 2021 09:55:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150971.279082 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0hnb-0001RS-LR; Tue, 06 Jul 2021 09:55:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150971.279082; Tue, 06 Jul 2021 09:55:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0hnb-0001RK-IU; Tue, 06 Jul 2021 09:55:27 +0000
Received: by outflank-mailman (input) for mailman id 150971;
 Tue, 06 Jul 2021 09:55:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0hnZ-0001Qw-NN
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09:55:25 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0hnZ-0006Eh-Ma
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09:55:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0hnZ-0002Xw-LT
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0MKDmrOLh1uqb7A8RMmTMSsOyIQeLz2gTy8B1RCX7Qk=; b=aZXmSs36/zT7K9ssOMXnWZZjT+
	y4GJdVzLEgsDkReOidbXRreaj9Ih5V+tk2m7LK9Tq6WTssOfPY2N9XSS7VJaff83TZ9Xi85cW7Osq
	0CK6N40/Ch1aN1uJXcpa4Megxzl1BIGwldgENnDQL12vwwMtSvJ4PaXAOVimgDrYZNnk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/migration: unify known page type checking
Message-Id: <E1m0hnZ-0002Xw-LT@xenbits.xenproject.org>
Date: Tue, 06 Jul 2021 09:55:25 +0000

commit 9e59d9f8ee3808acde9833192211da25f66d8cc2
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:56:05 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jul 6 10:49:58 2021 +0100

    tools/migration: unify known page type checking
    
    Users of xc_get_pfn_type_batch may want to sanity check the data
    returned by Xen. Add helpers for this purpose:
    
    is_known_page_type verifies the type returned by Xen on the saving
    side, or the incoming type for a page on the restoring side, is known
    by the save/restore code.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libs/guest/xg_sr_common.h  | 29 +++++++++++++++++++++++++++++
 tools/libs/guest/xg_sr_restore.c |  5 ++---
 tools/libs/guest/xg_sr_save.c    |  6 ++++++
 3 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index e2994e18ac..e8436d1abb 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -455,6 +455,35 @@ int populate_pfns(struct xc_sr_context *ctx, unsigned int count,
 /* Handle a STATIC_DATA_END record. */
 int handle_static_data_end(struct xc_sr_context *ctx);
 
+/* Page type known to the migration logic? */
+static inline bool is_known_page_type(uint32_t type)
+{
+    switch ( type )
+    {
+    case XEN_DOMCTL_PFINFO_NOTAB:
+
+    case XEN_DOMCTL_PFINFO_L1TAB:
+    case XEN_DOMCTL_PFINFO_L1TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_L2TAB:
+    case XEN_DOMCTL_PFINFO_L2TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_L3TAB:
+    case XEN_DOMCTL_PFINFO_L3TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_L4TAB:
+    case XEN_DOMCTL_PFINFO_L4TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_XTAB:
+    case XEN_DOMCTL_PFINFO_XALLOC: /* Synthetic type in Xen 4.2 - 4.5 */
+    case XEN_DOMCTL_PFINFO_BROKEN:
+        return true;
+
+    default:
+        return false;
+    }
+}
+
 #endif
 /*
  * Local variables:
diff --git a/tools/libs/guest/xg_sr_restore.c b/tools/libs/guest/xg_sr_restore.c
index b57a787519..508953fd3c 100644
--- a/tools/libs/guest/xg_sr_restore.c
+++ b/tools/libs/guest/xg_sr_restore.c
@@ -406,10 +406,9 @@ static int handle_page_data(struct xc_sr_context *ctx, struct xc_sr_record *rec)
         }
 
         type = (pages->pfn[i] & PAGE_DATA_TYPE_MASK) >> 32;
-        if ( ((type >> XEN_DOMCTL_PFINFO_LTAB_SHIFT) >= 5) &&
-             ((type >> XEN_DOMCTL_PFINFO_LTAB_SHIFT) <= 8) )
+        if ( !is_known_page_type(type) )
         {
-            ERROR("Invalid type %#"PRIx32" for pfn %#"PRIpfn" (index %u)",
+            ERROR("Unknown type %#"PRIx32" for pfn %#"PRIpfn" (index %u)",
                   type, pfn, i);
             goto err;
         }
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index f0e2bd048d..c84a073e86 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -147,6 +147,12 @@ static int write_batch(struct xc_sr_context *ctx)
 
     for ( i = 0; i < nr_pfns; ++i )
     {
+        if ( !is_known_page_type(types[i]) )
+        {
+            ERROR("Unknown type %#"PRIpfn" for pfn %#"PRIpfn, types[i], mfns[i]);
+            goto err;
+        }
+
         switch ( types[i] )
         {
         case XEN_DOMCTL_PFINFO_BROKEN:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jul 06 09:55:37 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jul 2021 09:55:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150974.279086 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0hnl-0001Uh-N3; Tue, 06 Jul 2021 09:55:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150974.279086; Tue, 06 Jul 2021 09:55:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0hnl-0001UZ-Jx; Tue, 06 Jul 2021 09:55:37 +0000
Received: by outflank-mailman (input) for mailman id 150974;
 Tue, 06 Jul 2021 09:55:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0hnj-0001UI-QT
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09:55:35 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0hnj-0006Ew-Pe
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09:55:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0hnj-0002Yd-Oi
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nPipaiwDldy7nLA9g1b8GsWawWgehytg4Q9EoKnLsxA=; b=Fc9NoNB3tyDMvN6AxEn6jfJE1v
	6vWQ7APx1nc8+ZyB6EF/54WtlBrLD6JvNbjSZZpLhL7bmONnhvjHcbSYRyfc742UcBFAR8Vi6IG5C
	A/zxK+OxhWkItksNRxksxHhkpNWYa8Gy2CfLInvN92MC68XQzHPMXgUJbVz8xPKbjMJE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/migration: unify type checking for data pfns in the VM
Message-Id: <E1m0hnj-0002Yd-Oi@xenbits.xenproject.org>
Date: Tue, 06 Jul 2021 09:55:35 +0000

commit 5588ebcfca774477cf823949e5703b0ac48818cc
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:56:07 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jul 6 10:49:58 2021 +0100

    tools/migration: unify type checking for data pfns in the VM
    
    Introduce a helper which decides if a given pfn in the migration
    stream is backed by memory.
    
    This highlights more clearly that type XEN_DOMCTL_PFINFO_XALLOC (a
    synthetic toolstack-only type used between Xen 4.2 to 4.5 which
    indicated a dirty page on the sending side for which no data will be
    send in the initial iteration) does get populated in the VM.
    
    No change in behaviour intended, except for invalid page types which now
    have a safer default.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libs/guest/xg_sr_common.h  | 29 +++++++++++++++++++++++++++++
 tools/libs/guest/xg_sr_restore.c |  4 +---
 2 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index e8436d1abb..7f4b0439f6 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -484,6 +484,35 @@ static inline bool is_known_page_type(uint32_t type)
     }
 }
 
+/* Page type backed by RAM in the guest? */
+static inline bool page_type_to_populate(uint32_t type)
+{
+    switch ( type )
+    {
+    case XEN_DOMCTL_PFINFO_NOTAB:
+
+    case XEN_DOMCTL_PFINFO_L1TAB:
+    case XEN_DOMCTL_PFINFO_L1TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_L2TAB:
+    case XEN_DOMCTL_PFINFO_L2TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_L3TAB:
+    case XEN_DOMCTL_PFINFO_L3TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_L4TAB:
+    case XEN_DOMCTL_PFINFO_L4TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_XALLOC:
+        return true;
+
+    case XEN_DOMCTL_PFINFO_XTAB:
+    case XEN_DOMCTL_PFINFO_BROKEN:
+    default:
+        return false;
+    }
+}
+
 #endif
 /*
  * Local variables:
diff --git a/tools/libs/guest/xg_sr_restore.c b/tools/libs/guest/xg_sr_restore.c
index 508953fd3c..3d63442d45 100644
--- a/tools/libs/guest/xg_sr_restore.c
+++ b/tools/libs/guest/xg_sr_restore.c
@@ -152,9 +152,7 @@ int populate_pfns(struct xc_sr_context *ctx, unsigned int count,
 
     for ( i = 0; i < count; ++i )
     {
-        if ( (!types || (types &&
-                         (types[i] != XEN_DOMCTL_PFINFO_XTAB &&
-                          types[i] != XEN_DOMCTL_PFINFO_BROKEN))) &&
+        if ( (!types || page_type_to_populate(types[i])) &&
              !pfn_is_populated(ctx, original_pfns[i]) )
         {
             rc = pfn_set_populated(ctx, original_pfns[i]);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jul 06 09:55:47 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jul 2021 09:55:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.150976.279090 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0hnv-0001YW-Oq; Tue, 06 Jul 2021 09:55:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 150976.279090; Tue, 06 Jul 2021 09:55:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0hnv-0001YN-LZ; Tue, 06 Jul 2021 09:55:47 +0000
Received: by outflank-mailman (input) for mailman id 150976;
 Tue, 06 Jul 2021 09:55:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0hnt-0001XU-TX
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09:55:45 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0hnt-0006F7-So
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09:55:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0hnt-0002Zf-Rt
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 09: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=u5oyK4JkHPhRwEEAOUtysHV8twjS0pn9rTGWRMKQXGg=; b=jgxLwasWgcta9r0XtWm6gYU+Bh
	bT+VaFTWM4BsO6Hw9cXNOHlFs8EsoRY9jmmfWRWZKvl18ONg1B2DV8iEh9pIJMPfFZ4GLsjJwpDKu
	+sSlFV4TdKUB+R7Qy/LvNx1t8XKgHB6qit8bss7VlvKo5yx0yJDRSxH9vqAWH08LBBAY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/migration: unify type checking for data pfns in migration stream
Message-Id: <E1m0hnt-0002Zf-Rt@xenbits.xenproject.org>
Date: Tue, 06 Jul 2021 09:55:45 +0000

commit f17a73b3c0264c62dd6b5dae01ed621c051c3038
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:56:08 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jul 6 10:49:58 2021 +0100

    tools/migration: unify type checking for data pfns in migration stream
    
    Introduce a helper which decides if a given pfn type has data
    in the migration stream.
    
    No change in behaviour intended, except for invalid page types which now
    have a safer default.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 tools/libs/guest/xg_sr_common.h  | 27 +++++++++++++++++++++++++++
 tools/libs/guest/xg_sr_restore.c | 29 +++--------------------------
 tools/libs/guest/xg_sr_save.c    | 14 ++------------
 3 files changed, 32 insertions(+), 38 deletions(-)

diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index 7f4b0439f6..36d45ef56f 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -513,6 +513,33 @@ static inline bool page_type_to_populate(uint32_t type)
     }
 }
 
+static inline bool page_type_has_stream_data(uint32_t type)
+{
+    switch ( type )
+    {
+    case XEN_DOMCTL_PFINFO_NOTAB:
+
+    case XEN_DOMCTL_PFINFO_L1TAB:
+    case XEN_DOMCTL_PFINFO_L1TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_L2TAB:
+    case XEN_DOMCTL_PFINFO_L2TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_L3TAB:
+    case XEN_DOMCTL_PFINFO_L3TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_L4TAB:
+    case XEN_DOMCTL_PFINFO_L4TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+        return true;
+
+    case XEN_DOMCTL_PFINFO_XTAB:
+    case XEN_DOMCTL_PFINFO_BROKEN:
+    case XEN_DOMCTL_PFINFO_XALLOC:
+    default:
+        return false;
+    }
+}
+
 #endif
 /*
  * Local variables:
diff --git a/tools/libs/guest/xg_sr_restore.c b/tools/libs/guest/xg_sr_restore.c
index 3d63442d45..aa4113d7f6 100644
--- a/tools/libs/guest/xg_sr_restore.c
+++ b/tools/libs/guest/xg_sr_restore.c
@@ -231,25 +231,8 @@ static int process_page_data(struct xc_sr_context *ctx, unsigned int count,
     {
         ctx->restore.ops.set_page_type(ctx, pfns[i], types[i]);
 
-        switch ( types[i] )
-        {
-        case XEN_DOMCTL_PFINFO_NOTAB:
-
-        case XEN_DOMCTL_PFINFO_L1TAB:
-        case XEN_DOMCTL_PFINFO_L1TAB | XEN_DOMCTL_PFINFO_LPINTAB:
-
-        case XEN_DOMCTL_PFINFO_L2TAB:
-        case XEN_DOMCTL_PFINFO_L2TAB | XEN_DOMCTL_PFINFO_LPINTAB:
-
-        case XEN_DOMCTL_PFINFO_L3TAB:
-        case XEN_DOMCTL_PFINFO_L3TAB | XEN_DOMCTL_PFINFO_LPINTAB:
-
-        case XEN_DOMCTL_PFINFO_L4TAB:
-        case XEN_DOMCTL_PFINFO_L4TAB | XEN_DOMCTL_PFINFO_LPINTAB:
-
+        if ( page_type_has_stream_data(types[i]) )
             mfns[nr_pages++] = ctx->restore.ops.pfn_to_gfn(ctx, pfns[i]);
-            break;
-        }
     }
 
     /* Nothing to do? */
@@ -269,14 +252,8 @@ static int process_page_data(struct xc_sr_context *ctx, unsigned int count,
 
     for ( i = 0, j = 0; i < count; ++i )
     {
-        switch ( types[i] )
-        {
-        case XEN_DOMCTL_PFINFO_XTAB:
-        case XEN_DOMCTL_PFINFO_BROKEN:
-        case XEN_DOMCTL_PFINFO_XALLOC:
-            /* No page data to deal with. */
+        if ( !page_type_has_stream_data(types[i]) )
             continue;
-        }
 
         if ( map_errs[j] )
         {
@@ -411,7 +388,7 @@ static int handle_page_data(struct xc_sr_context *ctx, struct xc_sr_record *rec)
             goto err;
         }
 
-        if ( type < XEN_DOMCTL_PFINFO_BROKEN )
+        if ( page_type_has_stream_data(type) )
             /* NOTAB and all L1 through L4 tables (including pinned) should
              * have a page worth of data in the record. */
             pages_of_data++;
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index c84a073e86..3fce41b6cf 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -153,13 +153,8 @@ static int write_batch(struct xc_sr_context *ctx)
             goto err;
         }
 
-        switch ( types[i] )
-        {
-        case XEN_DOMCTL_PFINFO_BROKEN:
-        case XEN_DOMCTL_PFINFO_XALLOC:
-        case XEN_DOMCTL_PFINFO_XTAB:
+        if ( !page_type_has_stream_data(types[i]) )
             continue;
-        }
 
         mfns[nr_pages++] = mfns[i];
     }
@@ -177,13 +172,8 @@ static int write_batch(struct xc_sr_context *ctx)
 
         for ( i = 0, p = 0; i < nr_pfns; ++i )
         {
-            switch ( types[i] )
-            {
-            case XEN_DOMCTL_PFINFO_BROKEN:
-            case XEN_DOMCTL_PFINFO_XALLOC:
-            case XEN_DOMCTL_PFINFO_XTAB:
+            if ( !page_type_has_stream_data(types[i]) )
                 continue;
-            }
 
             if ( errors[p] )
             {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jul 06 19:55:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jul 2021 19:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.151692.280302 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0r9s-0002Rn-9s; Tue, 06 Jul 2021 19:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 151692.280302; Tue, 06 Jul 2021 19:55:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0r9s-0002Rf-6f; Tue, 06 Jul 2021 19:55:04 +0000
Received: by outflank-mailman (input) for mailman id 151692;
 Tue, 06 Jul 2021 19:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0r9q-0002RY-QJ
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 19:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0r9q-0000ip-PN
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 19:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0r9q-0006H4-OU
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 19:55: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UTn03UUlV0o2rrG3yoEX4JUlOaxLN/w+Dsnclpf3BwM=; b=Joz/hB2lU4h9oqnUygOdrgEKIY
	IggYQ0Bcmi+O7JqzD6hQxuhyHkptl9DtNDrgijplVKGno60DR7MqY2DwA5XT7C2iclbHmIhGpZf9i
	08Axnd7b9JNGwWGQBBhlH/T77rI0nYAZSd0LtYYQQmA41H0qhbDrMs3p7G6j/s0H3bVM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: drop callback_mask pseudo-variables
Message-Id: <E1m0r9q-0006H4-OU@xenbits.xenproject.org>
Date: Tue, 06 Jul 2021 19:55:02 +0000

commit 5b2a5523d697b6d1a97a18d33dc6bf92a33def32
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jul 5 16:46:46 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 5 16:46:46 2021 +0200

    x86/shadow: drop callback_mask pseudo-variables
    
    In commit 90629587e16e ("x86/shadow: replace stale literal numbers in
    hash_{vcpu,domain}_foreach()") I had to work around Clang not following
    gcc in certain relaxed requirements as to the expressions usable with
    _Static_assert() (gcc tolerates static const variables in otherwise
    integer constant expressions). Roberto suggests that we'd better not
    rely on such behavior. Drop the involved static const-s, using their
    "expansions" in both of the prior use sites each. This then allows
    dropping the short-circuiting of the check for clang.
    
    Requested-by: Roberto Bagnara <roberto.bagnara@bugseng.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 6db538502d..8c1b041f71 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1626,12 +1626,8 @@ void shadow_hash_delete(struct domain *d, unsigned long n, unsigned int t,
 typedef int (*hash_vcpu_callback_t)(struct vcpu *v, mfn_t smfn, mfn_t other_mfn);
 typedef int (*hash_domain_callback_t)(struct domain *d, mfn_t smfn, mfn_t other_mfn);
 
-#ifndef __clang__ /* At least some versions dislike some of the uses. */
 #define HASH_CALLBACKS_CHECK(mask) \
     BUILD_BUG_ON((mask) > (1U << ARRAY_SIZE(callbacks)) - 1)
-#else
-#define HASH_CALLBACKS_CHECK(mask) ((void)(mask))
-#endif
 
 static void hash_vcpu_foreach(struct vcpu *v, unsigned int callback_mask,
                               const hash_vcpu_callback_t callbacks[],
@@ -1829,7 +1825,6 @@ int sh_remove_write_access(struct domain *d, mfn_t gmfn,
         [SH_type_l1_64_shadow] = SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, 4),
         [SH_type_fl1_64_shadow] = SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, 4),
     };
-    static const unsigned int callback_mask = SHF_L1_ANY | SHF_FL1_ANY;
     struct page_info *pg = mfn_to_page(gmfn);
 #if SHADOW_OPTIMIZATIONS & SHOPT_WRITABLE_HEURISTIC
     struct vcpu *curr = current;
@@ -2004,8 +1999,8 @@ int sh_remove_write_access(struct domain *d, mfn_t gmfn,
         perfc_incr(shadow_writeable_bf_1);
     else
         perfc_incr(shadow_writeable_bf);
-    HASH_CALLBACKS_CHECK(callback_mask);
-    hash_domain_foreach(d, callback_mask, callbacks, gmfn);
+    HASH_CALLBACKS_CHECK(SHF_L1_ANY | SHF_FL1_ANY);
+    hash_domain_foreach(d, SHF_L1_ANY | SHF_FL1_ANY, callbacks, gmfn);
 
     /* If that didn't catch the mapping, then there's some non-pagetable
      * mapping -- ioreq page, grant mapping, &c. */
@@ -2044,7 +2039,6 @@ int sh_remove_all_mappings(struct domain *d, mfn_t gmfn, gfn_t gfn)
         [SH_type_l1_64_shadow] = SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, 4),
         [SH_type_fl1_64_shadow] = SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, 4),
     };
-    static const unsigned int callback_mask = SHF_L1_ANY | SHF_FL1_ANY;
 
     perfc_incr(shadow_mappings);
     if ( sh_check_page_has_no_refs(page) )
@@ -2060,8 +2054,8 @@ int sh_remove_all_mappings(struct domain *d, mfn_t gmfn, gfn_t gfn)
 
     /* Brute-force search of all the shadows, by walking the hash */
     perfc_incr(shadow_mappings_bf);
-    HASH_CALLBACKS_CHECK(callback_mask);
-    hash_domain_foreach(d, callback_mask, callbacks, gmfn);
+    HASH_CALLBACKS_CHECK(SHF_L1_ANY | SHF_FL1_ANY);
+    hash_domain_foreach(d, SHF_L1_ANY | SHF_FL1_ANY, callbacks, gmfn);
 
     /* If that didn't catch the mapping, something is very wrong */
     if ( !sh_check_page_has_no_refs(page) )
@@ -2307,10 +2301,9 @@ void sh_reset_l3_up_pointers(struct vcpu *v)
     static const hash_vcpu_callback_t callbacks[SH_type_unused] = {
         [SH_type_l3_64_shadow] = sh_clear_up_pointer,
     };
-    static const unsigned int callback_mask = SHF_L3_64;
 
-    HASH_CALLBACKS_CHECK(callback_mask);
-    hash_vcpu_foreach(v, callback_mask, callbacks, INVALID_MFN);
+    HASH_CALLBACKS_CHECK(SHF_L3_64);
+    hash_vcpu_foreach(v, SHF_L3_64, callbacks, INVALID_MFN);
 }
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 06 19:55:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jul 2021 19:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.151693.280308 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0rA2-0002Th-DC; Tue, 06 Jul 2021 19:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 151693.280308; Tue, 06 Jul 2021 19:55:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0rA2-0002TY-8G; Tue, 06 Jul 2021 19:55:14 +0000
Received: by outflank-mailman (input) for mailman id 151693;
 Tue, 06 Jul 2021 19:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0rA0-0002TO-TA
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 19:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0rA0-0000it-SM
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 19:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0rA0-0006II-RV
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 19:55: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ohBkEhm96Xof5CqNyhMYlZ2oehQ6VpystvviYc0gOhs=; b=Qva+oqgaN23QxmAWCyDMfuY2+O
	tHUUTajGXbVA+Vb3eEm7YSejjcWupJzZI2lr98tO1QafwgDl+VAV6BLdRqs0ccHfwWFpObhiZNFZb
	UU/v+a1wlRtW2rb5233tsdPIwXu1an+Jrwhqt2wcaDdBg8DoUWfGlSR11xYdf/GXFu0k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] build: fix %.s: %.S rule
Message-Id: <E1m0rA0-0006II-RV@xenbits.xenproject.org>
Date: Tue, 06 Jul 2021 19:55:12 +0000

commit d468f9522174114ab06239894b6079c0a487e408
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Mon Jul 5 16:47:51 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 5 16:47:51 2021 +0200

    build: fix %.s: %.S rule
    
    Fixes: e321576f4047 ("xen/build: start using if_changed")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Rules.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index ceb3d204b8..d65d6a4899 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -227,8 +227,8 @@ cmd_cpp_i_c = $(CPP) $(filter-out -Wa$(comma)%,$(c_flags)) -MQ $@ -o $@ $<
 quiet_cmd_cc_s_c = CC      $@
 cmd_cc_s_c = $(CC) $(filter-out -Wa$(comma)%,$(c_flags)) -S $< -o $@
 
-quiet_cmd_s_S = CPP     $@
-cmd_s_S = $(CPP) $(filter-out -Wa$(comma)%,$(a_flags)) -MQ $@ -o $@ $<
+quiet_cmd_cpp_s_S = CPP     $@
+cmd_cpp_s_S = $(CPP) $(filter-out -Wa$(comma)%,$(a_flags)) -MQ $@ -o $@ $<
 
 %.i: %.c FORCE
 	$(call if_changed,cpp_i_c)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 06 19:55:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jul 2021 19:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.151694.280309 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0rAC-0002Wh-Cp; Tue, 06 Jul 2021 19:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 151694.280309; Tue, 06 Jul 2021 19:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0rAC-0002WY-9q; Tue, 06 Jul 2021 19:55:24 +0000
Received: by outflank-mailman (input) for mailman id 151694;
 Tue, 06 Jul 2021 19:55:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0rAB-0002W4-0d
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 19:55:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0rAA-0000jQ-Vw
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 19:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0rAA-0006JG-US
 for xen-changelog@lists.xenproject.org; Tue, 06 Jul 2021 19:55: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9Sp127tsgYJu5Cxj9xaBL7x4j6cwzSEt8vNF6V9CyIE=; b=fXS/qn0hIDXKnI8r0RyZMpCoIZ
	gZ5NO2tjwC08/GgD6314o0nyXLT1bJiCmSKpTdTtFsebinfAEy6iKS/KWvgxu1UxGUkSmSHKdsxLM
	8lZRdfd1w0cMG3oJ6s6e4vXW5gEy5QjX4UCYL2ZpNfqQ7lv3h2pDIiwb/NchzZJ/40z0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] MAINTAINERS: Updating after change to tools/include/
Message-Id: <E1m0rAA-0006JG-US@xenbits.xenproject.org>
Date: Tue, 06 Jul 2021 19:55:22 +0000

commit 44e8904ebfbc57ba0950c40b9d3a28507b553e4e
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Mon Jul 5 16:48:06 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 5 16:48:06 2021 +0200

    MAINTAINERS: Updating after change to tools/include/
    
    The LIBS section doesn't mention the headers associated with the
    libraries, same for LIBXENLIGHT section.
    
    They aren't any ':' in other section names, so remove it.
    
    Fixes: 4664034cdc72 ("tools/libs: move official headers to common directory")
    Fixes: f7079d7ef69f ("MAINTAINERS: add myself as tools/libs reviewer")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 MAINTAINERS | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 8a52a03969..56d16e4328 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -374,11 +374,25 @@ F:	xen/include/{kexec,kimage}.h
 F:	xen/arch/x86/machine_kexec.c
 F:	xen/arch/x86/x86_64/kexec_reloc.S
 
-LIBS:
+LIBS
 M:	Ian Jackson <iwj@xenproject.org>
 M:	Wei Liu <wl@xen.org>
 R:	Juergen Gross <jgross@suse.com>
 S:	Supported
+F:	tools/include/libxenvchan.h
+F:	tools/include/xencall.h
+F:	tools/include/xenctrl*.h
+F:	tools/include/xendevicemodel.h
+F:	tools/include/xenevtchn.h
+F:	tools/include/xenforeignmemory.h
+F:	tools/include/xengnttab.h
+F:	tools/include/xenguest.h
+F:	tools/include/xenhypfs.h
+F:	tools/include/xenstat.h
+F:	tools/include/xenstore*.h
+F:	tools/include/xenstore-compat/*.h
+F:	tools/include/xentoolcore*.h
+F:	tools/include/xentoollog.h
 F:	tools/libs/
 
 LIBXENLIGHT
@@ -386,6 +400,7 @@ M:	Ian Jackson <iwj@xenproject.org>
 M:	Wei Liu <wl@xen.org>
 M:	Anthony PERARD <anthony.perard@citrix.com>
 S:	Supported
+F:	tools/include/libxl*.h
 F:	tools/libs/light/
 F:	tools/libs/util/
 F:	tools/xl/
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jul 07 05:00:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jul 2021 05:00:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.151917.280705 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0zfI-0008PZ-BF; Wed, 07 Jul 2021 05:00:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 151917.280705; Wed, 07 Jul 2021 05:00:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0zfI-0008P7-87; Wed, 07 Jul 2021 05:00:04 +0000
Received: by outflank-mailman (input) for mailman id 151917;
 Wed, 07 Jul 2021 05:00:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0zfG-0008Dm-WE
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 05:00:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0zfG-0003XI-V8
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 05:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0zfG-0006zP-UB
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 05: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=iTkgyCDEfHxyq5MBYt4p807oCVPsvzo+bUdYPOKZhXE=; b=jkJhhZrzm7ciVTANSDtIXQvuJV
	flKTMkr65rSAfMCRHqeTNO4avVHZR4SIn+v4n59zu8IRl5USK8+RELNJMy2xQww5/mZwr06vrEQTR
	c+4hcWoAVojKlkbDQGnmBMF7ICt9PlIG+/fxXrkGj16mbdEtEaMSnNm2xjLvUEwHbFHc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libxl/arm: provide guests with random seed
Message-Id: <E1m0zfG-0006zP-UB@xenbits.xenproject.org>
Date: Wed, 07 Jul 2021 05:00:02 +0000

commit 33e48312cf28f6fb78c03b14514fa7718de97ef5
Author:     Sergiy Kibrik <Sergiy_Kibrik@epam.com>
AuthorDate: Tue Jul 6 06:33:45 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Jul 6 09:47:33 2021 +0100

    libxl/arm: provide guests with random seed
    
    Pass 128 bytes of random seed via FDT, so that guests' CRNGs are better seeded
    early at boot. This is larger than ChaCha20 key size of 32, so each byte of
    CRNG state will be mixed 4 times using this seed. There does not seem to be
    advantage in larger seed though.
    
    Depending on its configuration Linux can use the seed as device randomness
    or to just quickly initialize CRNG.
    In either case this will provide extra randomness to further harden CRNG.
    
    Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
    Reviewed-by: Julien Grall <julien@xen.org>
    Reviewed-by: Michal Orzel <michal.orzel@arm.com>
---
 tools/libs/light/libxl_arm.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
index e2901f13b7..e3140a6e00 100644
--- a/tools/libs/light/libxl_arm.c
+++ b/tools/libs/light/libxl_arm.c
@@ -305,6 +305,9 @@ static int make_chosen_node(libxl__gc *gc, void *fdt, bool ramdisk,
 {
     int res;
 
+    /* 1024 bit enough to mix Linux CRNG state several times */
+    uint8_t seed[128];
+
     /* See linux Documentation/devicetree/... */
     res = fdt_begin_node(fdt, "chosen");
     if (res) return res;
@@ -343,6 +346,11 @@ static int make_chosen_node(libxl__gc *gc, void *fdt, bool ramdisk,
         if (res) return res;
     }
 
+    res = libxl__random_bytes(gc, seed, sizeof(seed));
+    if (res) return res;
+    res = fdt_property(fdt, "rng-seed", seed, sizeof(seed));
+    if (res) return res;
+
     res = fdt_end_node(fdt);
     if (res) return res;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jul 07 05:00:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jul 2021 05:00:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.151918.280709 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0zfS-0000I1-Cf; Wed, 07 Jul 2021 05:00:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 151918.280709; Wed, 07 Jul 2021 05:00:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0zfS-0000Hs-9f; Wed, 07 Jul 2021 05:00:14 +0000
Received: by outflank-mailman (input) for mailman id 151918;
 Wed, 07 Jul 2021 05:00:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0zfR-0000Hc-37
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 05:00:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0zfR-0003XM-2M
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 05:00:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0zfR-000711-1J
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 05: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8P8wHyVhP7BqSZsLd5i0/Iqg57qH8b2LlPg1pV+Jbtc=; b=hMSIiX0SVzU/ZClh1WJ6q+aRFH
	MjtVTme/0AZxGtmgYH1HC5dbHKR/7aZAevONNEGdpftzHPXycyZWG6ETM9kFPF0Tp6ViYWLVxAfqz
	pz7H0J9ckuv23xwoeQq4GkSfT2OS7zvxCQ+2nfcMmEnzNtx4gxcJ7sfj1ZG2YdBu9PEI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: Stash the correct request in lu_status->in
Message-Id: <E1m0zfR-000711-1J@xenbits.xenproject.org>
Date: Wed, 07 Jul 2021 05:00:13 +0000

commit 09e2cd69956fe529bfc3d53dae477b44eff217d1
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Jul 1 15:03:07 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Jul 6 09:50:57 2021 +0100

    tools/xenstored: Stash the correct request in lu_status->in
    
    When Live-Updating with some load, Xenstored may hit the assert
    req->in == lu_status->in in do_lu_start().
    
    This is happening because the request is stashed when Live-Update
    begins. This happens in a different request (see call lu_begin()
    when select the new binary) from the one performing Live-Update.
    
    To avoid the problem, stash the request in lu_start().
    
    Fixes: 65f19ed62aa1 ("tools/xenstore: Don't assume conn->in points to the LU request")
    Reported-by: Michael Kurth <mku@amazon.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: luca.fancellu@arm.com
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstore/xenstored_control.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_control.c
index a1b1bd5a71..ff9863c17f 100644
--- a/tools/xenstore/xenstored_control.c
+++ b/tools/xenstore/xenstored_control.c
@@ -103,7 +103,6 @@ static const char *lu_begin(struct connection *conn)
 	if (!lu_status)
 		return "Allocation failure.";
 	lu_status->conn = conn;
-	lu_status->in = conn->in;
 	talloc_set_destructor(lu_status, lu_destroy);
 
 	return NULL;
@@ -757,6 +756,7 @@ static const char *lu_start(const void *ctx, struct connection *conn,
 	lu_status->force = force;
 	lu_status->timeout = to;
 	lu_status->started_at = time(NULL);
+	lu_status->in = conn->in;
 
 	errno = delay_request(conn, conn->in, do_lu_start, conn, false);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jul 07 05:00:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jul 2021 05:00:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.151919.280713 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0zfc-0000L0-E6; Wed, 07 Jul 2021 05:00:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 151919.280713; Wed, 07 Jul 2021 05:00:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m0zfc-0000Ks-BH; Wed, 07 Jul 2021 05:00:24 +0000
Received: by outflank-mailman (input) for mailman id 151919;
 Wed, 07 Jul 2021 05:00:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0zfb-0000Kg-6k
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 05:00:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0zfb-0003Xa-5q
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 05:00:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m0zfb-00071o-4l
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 05:00: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=C7gRDY8QVflieGgjADsLLKyqaOqSmFhDsNmYGMKb+Oc=; b=VQqnzfZh/sAhvMT7fpHLG/oMuv
	ek+1mpxERIcbYj4VcPlfbjDuTX4Xub3MOlmqWoETZTwwwD9v4Pt8oRgeUs+zXW4GttBQcQXteMUnH
	1cWVXOxWfNhUFaYtlYkL1LDBPDoYlpVaN5asPypQT5BMtAlI+pRRUv8AUYfFdVZ4VKZ4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: bootfdt: Always sort memory banks
Message-Id: <E1m0zfb-00071o-4l@xenbits.xenproject.org>
Date: Wed, 07 Jul 2021 05:00:23 +0000

commit 4473f3601098a2c3cf5ab89d5a29504772985e3a
Author:     Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
AuthorDate: Mon Jul 5 20:48:51 2021 +0300
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Jul 6 09:55:53 2021 +0100

    xen/arm: bootfdt: Always sort memory banks
    
    At the moment, Xen on Arm64 expects the memory banks to be ordered.
    Unfortunately, there may be a case when updated by firmware
    device tree contains unordered banks. This means Xen will panic
    when setting xenheap mappings for the subsequent bank with start
    address being less than xenheap_mfn_start (start address of
    the first bank).
    
    As there is no clear requirement regarding ordering in the device
    tree, update code to be able to deal with by sorting memory
    banks. There is only one heap region on Arm32, so the sorting
    is fine to be done in the common code.
    
    Suggested-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/bootfdt.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
index dcff512648..476e32e0f5 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/arch/arm/bootfdt.c
@@ -13,6 +13,7 @@
 #include <xen/init.h>
 #include <xen/device_tree.h>
 #include <xen/libfdt/libfdt.h>
+#include <xen/sort.h>
 #include <xsm/xsm.h>
 #include <asm/setup.h>
 
@@ -395,6 +396,21 @@ static void __init early_print_info(void)
     printk("\n");
 }
 
+/* This function assumes that memory regions are not overlapped */
+static int __init cmp_memory_node(const void *key, const void *elem)
+{
+    const struct membank *handler0 = key;
+    const struct membank *handler1 = elem;
+
+    if ( handler0->start < handler1->start )
+        return -1;
+
+    if ( handler0->start >= (handler1->start + handler1->size) )
+        return 1;
+
+    return 0;
+}
+
 /**
  * boot_fdt_info - initialize bootinfo from a DTB
  * @fdt: flattened device tree binary
@@ -412,6 +428,15 @@ size_t __init boot_fdt_info(const void *fdt, paddr_t paddr)
     add_boot_module(BOOTMOD_FDT, paddr, fdt_totalsize(fdt), false);
 
     device_tree_for_each_node((void *)fdt, 0, early_scan_node, NULL);
+
+    /*
+     * On Arm64 setup_xenheap_mappings() expects to be called with the lowest
+     * bank in memory first. There is no requirement that the DT will provide
+     * the banks sorted in ascending order. So sort them through.
+     */
+    sort(bootinfo.mem.bank, bootinfo.mem.nr_banks, sizeof(struct membank),
+         cmp_memory_node, NULL);
+
     early_print_info();
 
     return fdt_totalsize(fdt);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jul 07 10:44:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jul 2021 10:44:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.152125.281050 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m152D-0002ZR-Km; Wed, 07 Jul 2021 10:44:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 152125.281050; Wed, 07 Jul 2021 10:44:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m152D-0002ZK-Hs; Wed, 07 Jul 2021 10:44:05 +0000
Received: by outflank-mailman (input) for mailman id 152125;
 Wed, 07 Jul 2021 10:44:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m152C-0002ZE-NF
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 10:44:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m152C-0001XF-Ky
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 10:44:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m152C-0006oJ-K1
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TVcTChseqBzd2r2XffoI8dFN1YmqJhXJrzdVRqiZmUs=; b=CbOF5t/gchP4fI6zCZ+HvJiNLo
	MxNQZMQ7/TYWVu/F+lHBtMNl+7Ak4dHuX+vLB+BAiovpFfc9vr+vCiXSmNvdJizzkVG7AwYXFglfU
	Q/WYGzq6vQxA4AFzPSfEv05mi7hiJzmo4+Xds42XvIORI1fxx3gcoHWmmXSuJzeemKDE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] IOMMU: make DMA containment of quarantined devices optional
Message-Id: <E1m152C-0006oJ-K1@xenbits.xenproject.org>
Date: Wed, 07 Jul 2021 10:44:04 +0000

commit 980d6acf1517f0602e6dcf05ea922cf14c95e9c0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jul 7 12:32:45 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 7 12:32:45 2021 +0200

    IOMMU: make DMA containment of quarantined devices optional
    
    Containing still in flight DMA was introduced to work around certain
    devices / systems hanging hard upon hitting a "not-present" IOMMU fault.
    Passing through (such) devices (on such systems) is inherently insecure
    (as guests could easily arrange for IOMMU faults of any kind to occur).
    Defaulting to a mode where admins may not even become aware of issues
    with devices can be considered undesirable. Therefore convert this mode
    of operation to an optional one, not one enabled by default.
    
    This involves resurrecting code commit ea38867831da ("x86 / iommu: set
    up a scratch page in the quarantine domain") did remove, in a slightly
    extended and abstracted fashion. Here, instead of reintroducing a pretty
    pointless use of "goto" in domain_context_unmap(), and instead of making
    the function (at least temporarily) inconsistent, take the opportunity
    and replace the other similarly pointless "goto" as well.
    
    In order to key the re-instated bypasses off of there (not) being a root
    page table this further requires moving the allocate_domain_resources()
    invocation from reassign_device() to amd_iommu_setup_domain_device() (or
    else reassign_device() would allocate a root page table anyway); this is
    benign to the second caller of the latter function.
    
    In VT-d's domain_context_unmap(), instead of adding yet another
    "goto out" when all that's wanted is a "return", eliminate the "out"
    label at the same time.
    
    Take the opportunity and also limit the control to builds supporting
    PCI.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
---
 docs/misc/xen-command-line.pandoc           | 31 +++++++++++++---
 xen/drivers/passthrough/Kconfig             | 28 +++++++++++++++
 xen/drivers/passthrough/amd/pci_amd_iommu.c | 55 +++++++++++++++++------------
 xen/drivers/passthrough/iommu.c             | 23 ++++++++++--
 xen/drivers/passthrough/vtd/iommu.c         | 27 ++++++++------
 xen/include/xen/iommu.h                     |  4 ++-
 6 files changed, 127 insertions(+), 41 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 3ece83a427..b175645fde 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1364,7 +1364,7 @@ detection of systems known to misbehave upon accesses to that port.
 > Default: `new` unless directed-EOI is supported
 
 ### iommu
-    = List of [ <bool>, verbose, debug, force, required, quarantine,
+    = List of [ <bool>, verbose, debug, force, required, quarantine[=scratch-page],
                 sharept, intremap, intpost, crash-disable,
                 snoop, qinval, igfx, amd-iommu-perdev-intremap,
                 dom0-{passthrough,strict} ]
@@ -1402,11 +1402,32 @@ boolean (e.g. `iommu=no`) can override this and leave the IOMMUs disabled.
     will prevent Xen from booting if IOMMUs aren't discovered and enabled
     successfully.
 
-*   The `quarantine` boolean can be used to control Xen's behavior when
-    de-assigning devices from guests.  If enabled (the default), Xen always
+*   The `quarantine` option can be used to control Xen's behavior when
+    de-assigning devices from guests.
+
+    When a PCI device is assigned to an untrusted domain, it is possible
+    for that domain to program the device to DMA to an arbitrary address.
+    The IOMMU is used to protect the host from malicious DMA by making
+    sure that the device addresses can only target memory assigned to the
+    guest.  However, when the guest domain is torn down, assigning the
+    device back to the hardware domain would allow any in-flight DMA to
+    potentially target critical host data.  To avoid this, quarantining
+    should be enabled.  Quarantining can be done in two ways: In its basic
+    form, all in-flight DMA will simply be forced to encounter IOMMU
+    faults.  Since there are systems where doing so can cause host lockup,
+    an alternative form is available where writes to memory will be made
+    fault, but reads will be directed to a scratch page.  The implication
+    here is that such reads will go unnoticed, i.e. an admin may not
+    become aware of the underlying problem.
+
+    Therefore, if this option is set to true (the default), Xen always
     quarantines such devices; they must be explicitly assigned back to Dom0
-    before they can be used there again.  If disabled, Xen will only
-    quarantine devices the toolstack hass arranged for getting quarantined.
+    before they can be used there again.  If set to "scratch-page", still
+    active DMA reads will additionally be directed to a "scratch" page.  If
+    set to false, Xen will only quarantine devices the toolstack has arranged
+    for getting quarantined, and only in the "basic" form.
+
+    This option is only valid on builds supporting PCI.
 
 *   The `sharept` boolean controls whether the IOMMU pagetables are shared
     with the CPU-side HAP pagetables, or allocated separately.  Sharing
diff --git a/xen/drivers/passthrough/Kconfig b/xen/drivers/passthrough/Kconfig
index 82f02f56af..09505aa983 100644
--- a/xen/drivers/passthrough/Kconfig
+++ b/xen/drivers/passthrough/Kconfig
@@ -39,3 +39,31 @@ endif
 
 config IOMMU_FORCE_PT_SHARE
 	bool
+
+choice
+	prompt "IOMMU device quarantining default behavior"
+	depends on HAS_PCI
+	default IOMMU_QUARANTINE_BASIC
+	---help---
+	  When a PCI device is assigned to an untrusted domain, it is possible
+	  for that domain to program the device to DMA to an arbitrary address.
+	  The IOMMU is used to protect the host from malicious DMA by making
+	  sure that the device addresses can only target memory assigned to the
+	  guest.  However, when the guest domain is torn down, assigning the
+	  device back to the hardware domain would allow any in-flight DMA to
+	  potentially target critical host data.  To avoid this, quarantining
+	  should be enabled.  Quarantining can be done in two ways: In its basic
+	  form, all in-flight DMA will simply be forced to encounter IOMMU
+	  faults.  Since there are systems where doing so can cause host lockup,
+	  an alternative form is available where writes to memory will be made
+	  fault, but reads will be directed to a scratch page.  The implication
+	  here is that such reads will go unnoticed, i.e. an admin may not
+	  become aware of the underlying problem.
+
+	config IOMMU_QUARANTINE_NONE
+		bool "none"
+	config IOMMU_QUARANTINE_BASIC
+		bool "basic"
+	config IOMMU_QUARANTINE_SCRATCH_PAGE
+		bool "scratch page"
+endchoice
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 2dce505b97..8c0e6cfede 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -25,6 +25,9 @@
 #include "iommu.h"
 #include "../ats.h"
 
+/* dom_io is used as a sentinel for quarantined devices */
+#define QUARANTINE_SKIP(d) ((d) == dom_io && !dom_iommu(d)->arch.amd.root_table)
+
 static bool_t __read_mostly init_done;
 
 static const struct iommu_init_ops _iommu_init_ops;
@@ -81,19 +84,36 @@ int get_dma_requestor_id(uint16_t seg, uint16_t bdf)
     return req_id;
 }
 
-static void amd_iommu_setup_domain_device(
+static int __must_check allocate_domain_resources(struct domain *d)
+{
+    struct domain_iommu *hd = dom_iommu(d);
+    int rc;
+
+    spin_lock(&hd->arch.mapping_lock);
+    rc = amd_iommu_alloc_root(d);
+    spin_unlock(&hd->arch.mapping_lock);
+
+    return rc;
+}
+
+static int __must_check amd_iommu_setup_domain_device(
     struct domain *domain, struct amd_iommu *iommu,
     uint8_t devfn, struct pci_dev *pdev)
 {
     struct amd_iommu_dte *table, *dte;
     unsigned long flags;
-    int req_id, valid = 1;
+    int req_id, valid = 1, rc;
     u8 bus = pdev->bus;
-    const struct domain_iommu *hd = dom_iommu(domain);
+    struct domain_iommu *hd = dom_iommu(domain);
 
-    BUG_ON( !hd->arch.amd.root_table ||
-            !hd->arch.amd.paging_mode ||
-            !iommu->dev_table.buffer );
+    if ( QUARANTINE_SKIP(domain) )
+        return 0;
+
+    BUG_ON(!hd->arch.amd.paging_mode || !iommu->dev_table.buffer);
+
+    rc = allocate_domain_resources(domain);
+    if ( rc )
+        return rc;
 
     if ( iommu_hwdom_passthrough && is_hardware_domain(domain) )
         valid = 0;
@@ -153,6 +173,8 @@ static void amd_iommu_setup_domain_device(
 
         amd_iommu_flush_iotlb(devfn, pdev, INV_IOMMU_ALL_PAGES_ADDRESS, 0);
     }
+
+    return 0;
 }
 
 int __init acpi_ivrs_init(void)
@@ -224,18 +246,6 @@ int amd_iommu_alloc_root(struct domain *d)
     return 0;
 }
 
-static int __must_check allocate_domain_resources(struct domain *d)
-{
-    struct domain_iommu *hd = dom_iommu(d);
-    int rc;
-
-    spin_lock(&hd->arch.mapping_lock);
-    rc = amd_iommu_alloc_root(d);
-    spin_unlock(&hd->arch.mapping_lock);
-
-    return rc;
-}
-
 static int amd_iommu_domain_init(struct domain *d)
 {
     struct domain_iommu *hd = dom_iommu(d);
@@ -285,6 +295,9 @@ static void amd_iommu_disable_domain_device(const struct domain *domain,
     int req_id;
     u8 bus = pdev->bus;
 
+    if ( QUARANTINE_SKIP(domain) )
+        return;
+
     BUG_ON ( iommu->dev_table.buffer == NULL );
     req_id = get_dma_requestor_id(iommu->seg, PCI_BDF2(bus, devfn));
     table = iommu->dev_table.buffer;
@@ -354,11 +367,10 @@ static int reassign_device(struct domain *source, struct domain *target,
         pdev->domain = target;
     }
 
-    rc = allocate_domain_resources(target);
+    rc = amd_iommu_setup_domain_device(target, iommu, devfn, pdev);
     if ( rc )
         return rc;
 
-    amd_iommu_setup_domain_device(target, iommu, devfn, pdev);
     AMD_IOMMU_DEBUG("Re-assign %pp from dom%d to dom%d\n",
                     &pdev->sbdf, source->domain_id, target->domain_id);
 
@@ -465,8 +477,7 @@ static int amd_iommu_add_device(u8 devfn, struct pci_dev *pdev)
         amd_iommu_flush_device(iommu, bdf);
     }
 
-    amd_iommu_setup_domain_device(pdev->domain, iommu, devfn, pdev);
-    return 0;
+    return amd_iommu_setup_domain_device(pdev->domain, iommu, devfn, pdev);
 }
 
 static int amd_iommu_remove_device(u8 devfn, struct pci_dev *pdev)
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 879d238bcd..ab2ae61b11 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -31,9 +31,24 @@ bool_t __initdata iommu_enable = 1;
 bool_t __read_mostly iommu_enabled;
 bool_t __read_mostly force_iommu;
 bool_t __read_mostly iommu_verbose;
-bool __read_mostly iommu_quarantine = true;
 bool_t __read_mostly iommu_crash_disable;
 
+#define IOMMU_quarantine_none         0 /* aka false */
+#define IOMMU_quarantine_basic        1 /* aka true */
+#define IOMMU_quarantine_scratch_page 2
+#ifdef CONFIG_HAS_PCI
+uint8_t __read_mostly iommu_quarantine =
+# if defined(CONFIG_IOMMU_QUARANTINE_NONE)
+    IOMMU_quarantine_none;
+# elif defined(CONFIG_IOMMU_QUARANTINE_BASIC)
+    IOMMU_quarantine_basic;
+# elif defined(CONFIG_IOMMU_QUARANTINE_SCRATCH_PAGE)
+    IOMMU_quarantine_scratch_page;
+# endif
+#else
+# define iommu_quarantine IOMMU_quarantine_none
+#endif /* CONFIG_HAS_PCI */
+
 static bool __hwdom_initdata iommu_hwdom_none;
 bool __hwdom_initdata iommu_hwdom_strict;
 bool __read_mostly iommu_hwdom_passthrough;
@@ -64,8 +79,12 @@ static int __init parse_iommu_param(const char *s)
         else if ( (val = parse_boolean("force", s, ss)) >= 0 ||
                   (val = parse_boolean("required", s, ss)) >= 0 )
             force_iommu = val;
+#ifdef CONFIG_HAS_PCI
         else if ( (val = parse_boolean("quarantine", s, ss)) >= 0 )
             iommu_quarantine = val;
+        else if ( ss == s + 15 && !strncmp(s, "quarantine=scratch-page", 23) )
+            iommu_quarantine = IOMMU_quarantine_scratch_page;
+#endif
 #ifdef CONFIG_X86
         else if ( (val = parse_boolean("igfx", s, ss)) >= 0 )
             iommu_igfx = val;
@@ -432,7 +451,7 @@ static int __init iommu_quarantine_init(void)
     dom_io->options |= XEN_DOMCTL_CDF_iommu;
 
     rc = iommu_domain_init(dom_io, 0);
-    if ( rc )
+    if ( rc || iommu_quarantine < IOMMU_quarantine_scratch_page )
         return rc;
 
     if ( !hd->platform_ops->quarantine_init )
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 0f10951ce9..12d0d43d8e 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -42,6 +42,9 @@
 #include "vtd.h"
 #include "../ats.h"
 
+/* dom_io is used as a sentinel for quarantined devices */
+#define QUARANTINE_SKIP(d) ((d) == dom_io && !dom_iommu(d)->arch.vtd.pgd_maddr)
+
 struct mapped_rmrr {
     struct list_head list;
     u64 base, end;
@@ -1342,6 +1345,9 @@ int domain_context_mapping_one(
     int rc, ret;
     bool_t flush_dev_iotlb;
 
+    if ( QUARANTINE_SKIP(domain) )
+        return 0;
+
     ASSERT(pcidevs_locked());
     spin_lock(&iommu->lock);
     maddr = bus_to_context_maddr(iommu, bus);
@@ -1584,6 +1590,9 @@ int domain_context_unmap_one(
     int iommu_domid, rc, ret;
     bool_t flush_dev_iotlb;
 
+    if ( QUARANTINE_SKIP(domain) )
+        return 0;
+
     ASSERT(pcidevs_locked());
     spin_lock(&iommu->lock);
 
@@ -1658,7 +1667,7 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
 {
     struct acpi_drhd_unit *drhd;
     struct vtd_iommu *iommu;
-    int ret = 0;
+    int ret;
     u8 seg = pdev->seg, bus = pdev->bus, tmp_bus, tmp_devfn, secbus;
     int found = 0;
 
@@ -1673,14 +1682,12 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
         if ( iommu_debug )
             printk(VTDPREFIX "%pd:Hostbridge: skip %pp unmap\n",
                    domain, &PCI_SBDF3(seg, bus, devfn));
-        if ( !is_hardware_domain(domain) )
-            return -EPERM;
-        goto out;
+        return is_hardware_domain(domain) ? 0 : -EPERM;
 
     case DEV_TYPE_PCIe_BRIDGE:
     case DEV_TYPE_PCIe2PCI_BRIDGE:
     case DEV_TYPE_LEGACY_PCI_BRIDGE:
-        goto out;
+        return 0;
 
     case DEV_TYPE_PCIe_ENDPOINT:
         if ( iommu_debug )
@@ -1734,12 +1741,11 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
     default:
         dprintk(XENLOG_ERR VTDPREFIX, "%pd:unknown(%u): %pp\n",
                 domain, pdev->type, &PCI_SBDF3(seg, bus, devfn));
-        ret = -EINVAL;
-        goto out;
+        return -EINVAL;
     }
 
-    if ( ret )
-        goto out;
+    if ( ret || QUARANTINE_SKIP(domain) )
+        return ret;
 
     /*
      * if no other devices under the same iommu owned by this domain,
@@ -1764,8 +1770,7 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
         cleanup_domid_map(domain, iommu);
     }
 
-out:
-    return ret;
+    return 0;
 }
 
 static void iommu_clear_root_pgtable(struct domain *d)
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 03420cbea3..6b2cdffa4a 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -53,7 +53,9 @@ static inline bool_t dfn_eq(dfn_t x, dfn_t y)
 
 #ifdef CONFIG_HAS_PASSTHROUGH
 extern bool_t iommu_enable, iommu_enabled;
-extern bool force_iommu, iommu_quarantine, iommu_verbose;
+extern bool force_iommu, iommu_verbose;
+/* Boolean except for the specific purposes of drivers/passthrough/iommu.c. */
+extern uint8_t iommu_quarantine;
 #else
 #define iommu_enabled false
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jul 07 10:44:15 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jul 2021 10:44:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.152126.281054 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m152N-0002c9-O4; Wed, 07 Jul 2021 10:44:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 152126.281054; Wed, 07 Jul 2021 10:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m152N-0002c1-L5; Wed, 07 Jul 2021 10:44:15 +0000
Received: by outflank-mailman (input) for mailman id 152126;
 Wed, 07 Jul 2021 10:44:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m152M-0002bs-Ot
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 10:44:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m152M-0001XJ-Ny
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 10:44:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m152M-0006oq-N5
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2WmPZRGumL2AWKXPAwuy4/95QtR4qOA6WwaPMJkPlQU=; b=tFINWLdhI9+oFEa+xkZ6miGlFo
	vFxX7irFiG5+SmFt4MVQDfUtMjwyspmSPbVoDQThfaEFeTVP0ARAjaVUx4/bLB3H1h8/uZYUMbz5n
	cTvGY5lP7eusZf33ZsEo4Ibg2RDtSU2lzTHHP6umiulNpY6Fr6GcbuqGcgovEcZzKrsU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mem-sharing: ensure consistent lock order in get_two_gfns()
Message-Id: <E1m152M-0006oq-N5@xenbits.xenproject.org>
Date: Wed, 07 Jul 2021 10:44:14 +0000

commit 09af2d01a2fe6a0af08598bdfe12c9707f4d82ba
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jul 7 12:35:12 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 7 12:35:12 2021 +0200

    x86/mem-sharing: ensure consistent lock order in get_two_gfns()
    
    While the comment validly says "Sort by domain, if same domain by gfn",
    the implementation also included equal domain IDs in the first part of
    the check, thus rending the second part entirely dead and leaving
    deadlock potential when there's only a single domain involved.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/include/asm-x86/p2m.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 5b697df573..e569471a2f 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -587,7 +587,7 @@ do {                                                    \
     dest ## _t   = (source ## t)   ?: &scratch_t;       \
 } while (0)
 
-    if ( (rd->domain_id <= ld->domain_id) ||
+    if ( (rd->domain_id < ld->domain_id) ||
          ((rd == ld) && (gfn_x(rgfn) <= gfn_x(lgfn))) )
     {
         assign_pointers(first, r);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jul 07 10:44:25 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jul 2021 10:44:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.152127.281058 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m152X-0002fG-Pb; Wed, 07 Jul 2021 10:44:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 152127.281058; Wed, 07 Jul 2021 10:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m152X-0002f8-Mg; Wed, 07 Jul 2021 10:44:25 +0000
Received: by outflank-mailman (input) for mailman id 152127;
 Wed, 07 Jul 2021 10:44:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m152W-0002f0-SP
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 10:44:24 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m152W-0001Xb-Rf
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 10:44:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m152W-0006pR-QK
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oqL+j5IAc6Ly34+avEl7Cl74HtEi54z8OPA9yzx4GPo=; b=Io26KCCbf6uoLkmJwfI2kyagNf
	kRhTaSKxoRCA48O1GZ6FyHxgQdxpxY5z86gfCCJnZn1ngdbZSx5k3ScGOSFPujAC1qNX8SRZD+jdo
	Woo5NeNqLA0d23+V3YAR9ewfLEdwxs7vryxmjZrfozkaIXEnu60/O2gNlgGEWQfTCtJE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mem-sharing: mov {get,put}_two_gfns()
Message-Id: <E1m152W-0006pR-QK@xenbits.xenproject.org>
Date: Wed, 07 Jul 2021 10:44:24 +0000

commit b8d27e5b3391f4f90744f6ce75c02bd2661f7788
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jul 7 12:35:54 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 7 12:35:54 2021 +0200

    x86/mem-sharing: mov {get,put}_two_gfns()
    
    There's no reason for every CU including p2m.h to have these two
    functions compiled, when they're both mem-sharing specific right now and
    for the foreseeable future.
    
    Largely just code movement, with some style tweaks, the inline-s
    dropped, and "put" being made consistent with "get" as to their NULL
    checking of the passed in pointer to struct two_gfns.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/mm/mem_sharing.c | 60 +++++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/p2m.h     | 56 ----------------------------------------
 2 files changed, 60 insertions(+), 56 deletions(-)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 98b14f7b0a..8d5d44bdbc 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -432,6 +432,66 @@ static void mem_sharing_gfn_destroy(struct page_info *page, struct domain *d,
     xfree(gfn_info);
 }
 
+/* Deadlock-avoidance scheme when calling get_gfn on different gfn's */
+struct two_gfns {
+    struct domain *first_domain, *second_domain;
+    gfn_t          first_gfn,     second_gfn;
+};
+
+/*
+ * Returns mfn, type and access for potential caller consumption, but any
+ * of those can be NULL.
+ */
+static void get_two_gfns(struct domain *rd, gfn_t rgfn, p2m_type_t *rt,
+                         p2m_access_t *ra, mfn_t *rmfn,
+                         struct domain *ld, gfn_t lgfn, p2m_type_t *lt,
+                         p2m_access_t *la, mfn_t *lmfn,
+                         p2m_query_t q, struct two_gfns *rval, bool lock)
+{
+    mfn_t        *first_mfn, *second_mfn, scratch_mfn;
+    p2m_access_t *first_a, *second_a, scratch_a;
+    p2m_type_t   *first_t, *second_t, scratch_t;
+
+    /* Sort by domain, if same domain by gfn */
+
+#define assign_pointers(dest, source)                   \
+do {                                                    \
+    rval-> dest ## _domain = source ## d;               \
+    rval-> dest ## _gfn = source ## gfn;                \
+    dest ## _mfn = (source ## mfn) ?: &scratch_mfn;     \
+    dest ## _a   = (source ## a)   ?: &scratch_a;       \
+    dest ## _t   = (source ## t)   ?: &scratch_t;       \
+} while ( false )
+
+    if ( (rd->domain_id < ld->domain_id) ||
+         ((rd == ld) && (gfn_x(rgfn) <= gfn_x(lgfn))) )
+    {
+        assign_pointers(first, r);
+        assign_pointers(second, l);
+    }
+    else
+    {
+        assign_pointers(first, l);
+        assign_pointers(second, r);
+    }
+
+#undef assign_pointers
+
+    /* Now do the gets. */
+    *first_mfn  = __get_gfn_type_access(p2m_get_hostp2m(rval->first_domain),
+                                        gfn_x(rval->first_gfn), first_t,
+                                        first_a, q, NULL, lock);
+    *second_mfn = __get_gfn_type_access(p2m_get_hostp2m(rval->second_domain),
+                                        gfn_x(rval->second_gfn), second_t,
+                                        second_a, q, NULL, lock);
+}
+
+static void put_two_gfns(const struct two_gfns *arg)
+{
+    put_gfn(arg->second_domain, gfn_x(arg->second_gfn));
+    put_gfn(arg->first_domain,  gfn_x(arg->first_gfn));
+}
+
 static struct page_info *mem_sharing_lookup(unsigned long mfn)
 {
     struct page_info *page;
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index e569471a2f..d2e7a8db85 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -559,62 +559,6 @@ int altp2m_get_effective_entry(struct p2m_domain *ap2m, gfn_t gfn, mfn_t *mfn,
                                bool prepopulate);
 #endif
 
-/* Deadlock-avoidance scheme when calling get_gfn on different gfn's */
-struct two_gfns {
-    struct domain *first_domain, *second_domain;
-    gfn_t          first_gfn,     second_gfn;
-};
-
-/* Returns mfn, type and access for potential caller consumption, but any
- * of those can be NULL */
-static inline void get_two_gfns(struct domain *rd, gfn_t rgfn,
-        p2m_type_t *rt, p2m_access_t *ra, mfn_t *rmfn, struct domain *ld,
-        gfn_t lgfn, p2m_type_t *lt, p2m_access_t *la, mfn_t *lmfn,
-        p2m_query_t q, struct two_gfns *rval, bool lock)
-{
-    mfn_t           *first_mfn, *second_mfn, scratch_mfn;
-    p2m_access_t    *first_a, *second_a, scratch_a;
-    p2m_type_t      *first_t, *second_t, scratch_t;
-
-    /* Sort by domain, if same domain by gfn */
-
-#define assign_pointers(dest, source)                   \
-do {                                                    \
-    rval-> dest ## _domain = source ## d;               \
-    rval-> dest ## _gfn = source ## gfn;                \
-    dest ## _mfn = (source ## mfn) ?: &scratch_mfn;     \
-    dest ## _a   = (source ## a)   ?: &scratch_a;       \
-    dest ## _t   = (source ## t)   ?: &scratch_t;       \
-} while (0)
-
-    if ( (rd->domain_id < ld->domain_id) ||
-         ((rd == ld) && (gfn_x(rgfn) <= gfn_x(lgfn))) )
-    {
-        assign_pointers(first, r);
-        assign_pointers(second, l);
-    } else {
-        assign_pointers(first, l);
-        assign_pointers(second, r);
-    }
-
-#undef assign_pointers
-
-    /* Now do the gets */
-    *first_mfn  = __get_gfn_type_access(p2m_get_hostp2m(rval->first_domain),
-                                        gfn_x(rval->first_gfn), first_t, first_a, q, NULL, lock);
-    *second_mfn = __get_gfn_type_access(p2m_get_hostp2m(rval->second_domain),
-                                        gfn_x(rval->second_gfn), second_t, second_a, q, NULL, lock);
-}
-
-static inline void put_two_gfns(struct two_gfns *arg)
-{
-    if ( !arg )
-        return;
-
-    put_gfn(arg->second_domain, gfn_x(arg->second_gfn));
-    put_gfn(arg->first_domain,  gfn_x(arg->first_gfn));
-}
-
 /* Init the datastructures for later use by the p2m code */
 int p2m_init(struct domain *d);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jul 07 12:11:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jul 2021 12:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.152149.281099 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m16OQ-00038M-1a; Wed, 07 Jul 2021 12:11:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 152149.281099; Wed, 07 Jul 2021 12:11:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m16OP-00038E-UF; Wed, 07 Jul 2021 12:11:05 +0000
Received: by outflank-mailman (input) for mailman id 152149;
 Wed, 07 Jul 2021 12:11:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m16OP-000388-Cc
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 12:11:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m16OP-0002za-AM
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 12:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m16OP-0003wV-9G
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 12: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ytQ8v7fuiy+vuqtSZOgLK/ZrGE4y/CJXjhT7Ejpmc/s=; b=k/vWu01FGJr3ZMrb4O6/iBnxf5
	x2etYhvcdkUK1unn8DYsMRzkGWYRnf7W1zCDZEXteevKeCm6TXwmaF0ZC+FsBsve3n9lthvDJdnNk
	aYSiMc83ByxLSrHUfzMk84/62jPryJj7SLE4D6/75h9STcTiYnOjN0DJFzwAyGgJ17jE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xen-foreign: Update the size for vcpu_guest_{core_regs, context}
Message-Id: <E1m16OP-0003wV-9G@xenbits.xenproject.org>
Date: Wed, 07 Jul 2021 12:11:05 +0000

commit cc83cae4de8116c7a8c9c9510d6b117745f42ff5
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Tue Jul 6 14:20:00 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jul 7 13:07:46 2021 +0100

    tools/xen-foreign: Update the size for vcpu_guest_{core_regs, context}
    
    Commit 918b8842a852 ("arm64: Change type of hsr, cpsr, spsr_el1 to
    uint64_t") updated the size of the structure vcpu_guest_core_regs and
    indirectly vcpu_guest_context.
    
    On Arm, the two structures are only accessible to the tools and the
    hypervisor (and therefore stable). However, they are still checked
    by the scripts in tools/include/xen-foreign are not able to understand
    that.
    
    Ideally we should rework the scripts so we don't have to update
    the size for non-stable structure. But I don't have limited time
    to spend on the issue. So chose the simple solution and update
    the size accordingly.
    
    Note that we need to keep vcpu_guest_core_regs around because
    the structure is used by vcpu_guest_context and therefore the
    scripts expects the generated header to contain it.
    
    Fixes: 918b8842a852 ("arm64: Change type of hsr, cpsr, spsr_el1 to uint64_t")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@arm.com>
    Tested-by: Michal Orzel <michal.orzel@arm.com>
---
 tools/include/xen-foreign/reference.size | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/include/xen-foreign/reference.size b/tools/include/xen-foreign/reference.size
index a0409db5c4..11a06a7a43 100644
--- a/tools/include/xen-foreign/reference.size
+++ b/tools/include/xen-foreign/reference.size
@@ -4,8 +4,8 @@ structs                   |   arm32   arm64  x86_32  x86_64
 start_info                |       -       -    1112    1168
 trap_info                 |       -       -       8      16
 cpu_user_regs             |       -       -      68     200
-vcpu_guest_core_regs      |     304     304       -       -
-vcpu_guest_context        |     344     344    2800    5168
+vcpu_guest_core_regs      |     312     312       -       -
+vcpu_guest_context        |     352     352    2800    5168
 arch_vcpu_info            |       0       0      24      16
 vcpu_time_info            |      32      32      32      32
 vcpu_info                 |      48      48      64      64
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jul 07 12:11:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jul 2021 12:11:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.152150.281103 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m16Oa-0003A0-30; Wed, 07 Jul 2021 12:11:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 152150.281103; Wed, 07 Jul 2021 12:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m16OZ-00039r-Vz; Wed, 07 Jul 2021 12:11:15 +0000
Received: by outflank-mailman (input) for mailman id 152150;
 Wed, 07 Jul 2021 12:11:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m16OZ-00039j-ED
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 12:11:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m16OZ-0002ze-DP
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 12:11:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m16OZ-0003x1-CV
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 12: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1ARVHLvGeAwEmEumMtslJ9UoOv7U5xyPiDD+6Ai+zRk=; b=4kmunIG+zAhwVBjTlveSlJ0fPY
	TXXgJ+C8nLn/idQEJF34pZzHivbNmBvXH689sG42EwEEG6tL606xASjrOZz1FoydZTRPa9F3xCVww
	3Asa3Nhpa5XHLzK+j8JlZJ5ai9g2+NJxRNMSNmCOKS9eT4JeyZ7otGtyiiNrIByMeSQw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools: Fix CPSR/SPSR print size
Message-Id: <E1m16OZ-0003x1-CV@xenbits.xenproject.org>
Date: Wed, 07 Jul 2021 12:11:15 +0000

commit 32cbc7f96ffa3ddceacb3812da0e31a82840b138
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Tue Jul 6 16:28:57 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jul 7 13:07:46 2021 +0100

    tools: Fix CPSR/SPSR print size
    
    918b8842a852 changed CPSR and SPSR to be stored as 64bit values.
    
    This is fixing the print size in some tools to use 64bit type.
    
    Fixes: 918b8842a852 ("arm64: Change type of hsr, cpsr, spsr_el1 to uint64_t")
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@arm.com>
    Tested-by: Michal Orzel <michal.orzel@arm.com>
---
 tools/libs/guest/xg_dom_arm.c | 4 ++--
 tools/xentrace/xenctx.c       | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/libs/guest/xg_dom_arm.c b/tools/libs/guest/xg_dom_arm.c
index 01e85e0ea9..5e3b76355e 100644
--- a/tools/libs/guest/xg_dom_arm.c
+++ b/tools/libs/guest/xg_dom_arm.c
@@ -140,7 +140,7 @@ static int vcpu_arm32(struct xc_dom_image *dom)
 
     ctxt->flags = VGCF_online;
 
-    DOMPRINTF("Initial state CPSR %#"PRIx32" PC %#"PRIx32,
+    DOMPRINTF("Initial state CPSR %#"PRIx64" PC %#"PRIx32,
            ctxt->user_regs.cpsr, ctxt->user_regs.pc32);
 
     rc = xc_vcpu_setcontext(dom->xch, dom->guest_domid, 0, &any_ctx);
@@ -182,7 +182,7 @@ static int vcpu_arm64(struct xc_dom_image *dom)
 
     ctxt->flags = VGCF_online;
 
-    DOMPRINTF("Initial state CPSR %#"PRIx32" PC %#"PRIx64,
+    DOMPRINTF("Initial state CPSR %#"PRIx64" PC %#"PRIx64,
            ctxt->user_regs.cpsr, ctxt->user_regs.pc64);
 
     rc = xc_vcpu_setcontext(dom->xch, dom->guest_domid, 0, &any_ctx);
diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index 972f473dbf..85ba0c0fa6 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -556,7 +556,7 @@ static void print_ctx_32(vcpu_guest_context_t *ctx)
     printf("PC:       %08"PRIx32, regs->pc32);
     print_symbol(regs->pc32, KERNEL_TEXT_ADDR);
     printf("\n");
-    printf("CPSR:     %08"PRIx32"\n", regs->cpsr);
+    printf("CPSR:     %08"PRIx64"\n", regs->cpsr);
     printf("USR:               SP:%08"PRIx32" LR:%08"PRIx32"\n",
            regs->sp_usr, regs->lr_usr);
     printf("SVC: SPSR:%08"PRIx32" SP:%08"PRIx32" LR:%08"PRIx32"\n",
@@ -614,8 +614,8 @@ static void print_ctx_64(vcpu_guest_context_t *ctx)
     printf("LR:       %016"PRIx64"\n", regs->x30);
     printf("ELR_EL1:  %016"PRIx64"\n", regs->elr_el1);
 
-    printf("CPSR:     %08"PRIx32"\n", regs->cpsr);
-    printf("SPSR_EL1: %08"PRIx32"\n", regs->spsr_el1);
+    printf("CPSR:     %08"PRIx64"\n", regs->cpsr);
+    printf("SPSR_EL1: %08"PRIx64"\n", regs->spsr_el1);
 
     printf("SP_EL0:   %016"PRIx64"\n", regs->sp_el0);
     printf("SP_EL1:   %016"PRIx64"\n", regs->sp_el1);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jul 07 13:11:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jul 2021 13:11:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.152210.281219 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m17KT-0005Jq-Sm; Wed, 07 Jul 2021 13:11:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 152210.281219; Wed, 07 Jul 2021 13:11:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m17KT-0005Je-PO; Wed, 07 Jul 2021 13:11:05 +0000
Received: by outflank-mailman (input) for mailman id 152210;
 Wed, 07 Jul 2021 13:11:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m17KT-0005JV-7V
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 13:11:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m17KT-000449-6d
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 13:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m17KT-000876-5k
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 13: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pTlyFj0TdUnDAUigeNbt6OwtHPYSiriYKhw7y0WvrpQ=; b=4KLgINd1mjoeKcDlf20fulstKx
	9G7TFskBPpvmUL7OEtoJOKJPJShIIDvjqvGf9UaGsg0JehFGsFcnjKF5z0h5/p4H8dvXNHaeC9tDk
	Lt0RPyzGUhqx0Az0ERRgiY/+oxRHAUqlnStSPstjW5R3C/lgbO5lY0ulXBFHgu2mbeqo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm: Fix arch_initialise_vcpu to be unsupported
Message-Id: <E1m17KT-000876-5k@xenbits.xenproject.org>
Date: Wed, 07 Jul 2021 13:11:05 +0000

commit 63fdea768d175e96443a53b95a6441f520743e2e
Author:     Michal Orzel <michal.orzel@arm.com>
AuthorDate: Tue Jul 6 12:28:53 2021 +0200
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Jul 7 14:05:40 2021 +0100

    arm: Fix arch_initialise_vcpu to be unsupported
    
    Function arch_initialise_vcpu is not reachable as the
    VCPUOP_initialise is an unsupported operation on arm.
    Modify the function by adding ASSERT_UNREACHABLE() and
    returning -EOPNOTSUPP.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Michal Orzel <michal.orzel@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/domain.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 74bdbb9082..19c756ac3d 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -923,7 +923,8 @@ int arch_set_info_guest(
 
 int arch_initialise_vcpu(struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
-    return default_initialise_vcpu(v, arg);
+    ASSERT_UNREACHABLE();
+    return -EOPNOTSUPP;
 }
 
 int arch_vcpu_reset(struct vcpu *v)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jul 07 13:11:20 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jul 2021 13:11:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.152214.281222 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m17Ke-0005Qj-UA; Wed, 07 Jul 2021 13:11:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 152214.281222; Wed, 07 Jul 2021 13:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m17Ke-0005QW-Qt; Wed, 07 Jul 2021 13:11:16 +0000
Received: by outflank-mailman (input) for mailman id 152214;
 Wed, 07 Jul 2021 13:11:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m17Kd-0005QA-Ar
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 13:11:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m17Kd-00044H-9z
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 13:11:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m17Kd-00088P-8w
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 13: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=I5v4KTOEfoLpMvHEyhHPxrR4rFNYUpjOXSNLQs57vCY=; b=BIKjNQzPI8TtA7I7P98gWisJqo
	e7br6watPzFcXX5BLVRo9jXo9xIWLe49K380aFTD5B7xc/TF6PxuP+htS/b65A1jpKNS9cY7Qs4iU
	H+t8TV/ODp4zEhwwW6+63sa1Jqn/+raTrUQa0hbD+CgdBXueeZTSKaPd4/WGYW9bMo3I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: smmuv1: Switch from kzalloc_array(..) to devm_kcalloc(..)
Message-Id: <E1m17Kd-00088P-8w@xenbits.xenproject.org>
Date: Wed, 07 Jul 2021 13:11:15 +0000

commit e362d3276d40e4f370c92eaa6c0e84e34badb92b
Author:     Rahul Singh <rahul.singh@arm.com>
AuthorDate: Tue Jul 6 11:53:59 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Jul 7 14:08:15 2021 +0100

    xen/arm: smmuv1: Switch from kzalloc_array(..) to devm_kcalloc(..)
    
    Switch from kzalloc_array(..) to devm_kcalloc(..) when allocating the
    SMR to make code coherent.
    
    Signed-off-by: Rahul Singh <rahul.singh@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/drivers/passthrough/arm/smmu.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index da2cd457d7..658c40433c 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -149,7 +149,8 @@ typedef enum irqreturn irqreturn_t;
 #define kzalloc(size, flags)		_xzalloc(size, sizeof(void *))
 #define devm_kzalloc(dev, size, flags)	_xzalloc(size, sizeof(void *))
 #define kmalloc_array(size, n, flags)	_xmalloc_array(size, sizeof(void *), n)
-#define kzalloc_array(size, n, flags)	_xzalloc_array(size, sizeof(void *), n)
+#define devm_kcalloc(dev, n, size, flags)			\
+	_xzalloc_array(size, sizeof(void *), n)
 
 static void __iomem *devm_ioremap_resource(struct device *dev,
 					   struct resource *res)
@@ -2222,7 +2223,8 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu)
 		smmu->smr_mask_mask = smr >> SMR_MASK_SHIFT;
 
 		/* Zero-initialised to mark as invalid */
-		smmu->smrs = kzalloc_array(sizeof(*smmu->smrs), size, GFP_KERNEL);
+		smmu->smrs = devm_kcalloc(smmu->dev, size, sizeof(*smmu->smrs),
+								GFP_KERNEL);
 		if (!smmu->smrs)
 			return -ENOMEM;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jul 07 15:55:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jul 2021 15:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.152586.281872 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m19tC-0004nx-J2; Wed, 07 Jul 2021 15:55:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 152586.281872; Wed, 07 Jul 2021 15:55:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m19tC-0004np-GA; Wed, 07 Jul 2021 15:55:06 +0000
Received: by outflank-mailman (input) for mailman id 152586;
 Wed, 07 Jul 2021 15:55:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m19tB-0004ni-9Q
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 15:55:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m19tB-0007BX-7n
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 15:55:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m19tB-0003Fj-6k
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cFMJUcAcXIvidK+sijUou7siN0OixCzn5vfCG87kxnM=; b=30AzwD6kFkQsZGfGFYwjU0dklr
	d4IEEyNyZ1v46euFc/4T3ACaEXI/sfpZL6nPbQWZfFB2/YMueUUvSha1WZEppvahrNwApL6o4zfn1
	uBdtDXwfuxQ9mY6Hoy3DFnxVB/wMTz8IxPYeSqJHKYLDZX9aHLJnsPge9CiJu58dnwrg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] build: clean "lib.a"
Message-Id: <E1m19tB-0003Fj-6k@xenbits.xenproject.org>
Date: Wed, 07 Jul 2021 15:55:05 +0000

commit 3ce2765ac21dbd739e8216694b025aaabf4afff3
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed Jul 7 17:51:18 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 7 17:51:18 2021 +0200

    build: clean "lib.a"
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index 89879fad4c..b0e47a8c75 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -343,7 +343,7 @@ _clean: delete-unfresh-files
 	$(MAKE) $(clean) test
 	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) clean
 	find . \( -name "*.o" -o -name ".*.d" -o -name ".*.d2" \
-		-o -name "*.gcno" -o -name ".*.cmd" \) -exec rm -f {} \;
+		-o -name "*.gcno" -o -name ".*.cmd" -o -name "lib.a" \) -exec rm -f {} \;
 	rm -f include/asm $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET).efi.map $(TARGET)-syms $(TARGET)-syms.map *~ core
 	rm -f asm-offsets.s include/asm-*/asm-offsets.h
 	rm -f .banner
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jul 07 15:55:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jul 2021 15:55:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.152588.281876 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m19tM-0004qB-Kk; Wed, 07 Jul 2021 15:55:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 152588.281876; Wed, 07 Jul 2021 15:55:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m19tM-0004q3-HZ; Wed, 07 Jul 2021 15:55:16 +0000
Received: by outflank-mailman (input) for mailman id 152588;
 Wed, 07 Jul 2021 15:55:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m19tL-0004pt-Bo
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 15:55:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m19tL-0007Bb-B2
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 15:55:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m19tL-0003GG-A0
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 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>
DKIM-Signature: v=1; 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/NACLDRwEy0pUGI3gq+qCEt+3MOdXgNePAfhZBpnw8=; b=Nleb5SfSPD/TFmId8A0Khw9eWR
	Sx+iKL6pctpknuRwbjAXnI+4Va2ce3d5dJzO27IFWalp1sYAHb1WjIK5qCw7fBbBTvwk7S8NxI9rh
	ABXKr7uGIQp4szikjJhrSU3Mr2Uyy614TXMuDUwu2JWp1wdbVOCuDHVzyV/f1vM7PRiU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] build: use $(kconfig) shortcut in clean rule
Message-Id: <E1m19tL-0003GG-A0@xenbits.xenproject.org>
Date: Wed, 07 Jul 2021 15:55:15 +0000

commit ad76d87d65e1fd2ec3b08699d6dcfb0d2a9441c1
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed Jul 7 17:51:34 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 7 17:51:34 2021 +0200

    build: use $(kconfig) shortcut in clean rule
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index b0e47a8c75..8023680ffb 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -341,7 +341,7 @@ _clean: delete-unfresh-files
 	$(MAKE) $(clean) arch/riscv
 	$(MAKE) $(clean) arch/x86
 	$(MAKE) $(clean) test
-	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) clean
+	$(MAKE) $(kconfig) clean
 	find . \( -name "*.o" -o -name ".*.d" -o -name ".*.d2" \
 		-o -name "*.gcno" -o -name ".*.cmd" -o -name "lib.a" \) -exec rm -f {} \;
 	rm -f include/asm $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET).efi.map $(TARGET)-syms $(TARGET)-syms.map *~ core
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jul 07 15:55:26 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jul 2021 15:55:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.152590.281880 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m19tW-0004tJ-Lv; Wed, 07 Jul 2021 15:55:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 152590.281880; Wed, 07 Jul 2021 15:55:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m19tW-0004tB-J2; Wed, 07 Jul 2021 15:55:26 +0000
Received: by outflank-mailman (input) for mailman id 152590;
 Wed, 07 Jul 2021 15:55:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m19tV-0004t0-FB
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 15:55:25 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m19tV-0007Bq-EO
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 15:55:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m19tV-0003H8-DE
 for xen-changelog@lists.xenproject.org; Wed, 07 Jul 2021 15: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XHn/DSs6jweFU7Q9S7wtlMokAUNI860fOb0/sNx1Xh0=; b=wp4D86VRUN2FnryPLCWke743r+
	VKqdgSqCeX7YU6qNhRG2GLsB9JDO+EkhfoXMx4DV9/zoHwUP0QTdujeswdYkzlqDvceCgGbiS46n/
	5CqEuMxmxthi2iTEdg3GQkwe9YN6R+lJZkv1meT3pLkZyoxbm8wncpPucPVyiRgyZNyU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] build,tools: have default rules depends on symbols
Message-Id: <E1m19tV-0003H8-DE@xenbits.xenproject.org>
Date: Wed, 07 Jul 2021 15:55:25 +0000

commit 484910bf41fec2c80d79ed9c5c33831bee7318f0
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed Jul 7 17:51:49 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 7 17:51:49 2021 +0200

    build,tools: have default rules depends on symbols
    
    No need to call $(MAKE) again.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/tools/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/tools/Makefile b/xen/tools/Makefile
index e940939d61..4e42163f98 100644
--- a/xen/tools/Makefile
+++ b/xen/tools/Makefile
@@ -2,8 +2,7 @@
 include $(XEN_ROOT)/Config.mk
 
 .PHONY: default
-default:
-	$(MAKE) symbols
+default: symbols
 
 .PHONY: clean
 clean:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jul 08 13:00:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jul 2021 13:00:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153109.282853 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1TdP-00032X-D1; Thu, 08 Jul 2021 13:00:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153109.282853; Thu, 08 Jul 2021 13:00:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1TdP-00032P-9w; Thu, 08 Jul 2021 13:00:07 +0000
Received: by outflank-mailman (input) for mailman id 153109;
 Thu, 08 Jul 2021 13:00:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1TdN-0002yA-Kw
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 13:00:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1TdN-0006Sb-Hk
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 13:00:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1TdN-0000FB-Ga
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 13: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CxbRj+X3YMUu03bp81Pq9yrkxnEb8HRmo6DngtoD0Qc=; b=Y3RZuD1PZYRNIfP0LXKRy6maEQ
	Hp6/pPc8Zk30KysYJ5qovZPIRoNzQCbfcQnfahaVrSroVIB0+JYGwX+CwGzSPxxvXJsOdVBfL3QZo
	L+shoL4V3sw0W9Vpj3QbfVMCODF/yqh4VaKYFJlcXBdiKlUlgfE98FqbUZc7vCiCBARw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation: Adding ninja-build to some docker images
Message-Id: <E1m1TdN-0000FB-Ga@xenbits.xenproject.org>
Date: Thu, 08 Jul 2021 13:00:05 +0000

commit 34108a27e871ab32ee8bfd813d6c4ff3eb5c5f8a
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed Jul 7 17:40:00 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 8 12:36:21 2021 +0100

    automation: Adding ninja-build to some docker images
    
    This is to allow building the latest version of QEMU.
    
    fedora/29:
        In addition to adding "ninja", I've add to make some other
        changes: some `go build` failed with `mkdir /.cache` no
        permission, so I've created a user.
        (this was discovered while testing the new container with the
        script containerize.)
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/build/alpine/3.12.dockerfile        | 1 +
 automation/build/fedora/29.dockerfile          | 9 ++++++---
 automation/build/suse/opensuse-leap.dockerfile | 2 ++
 automation/build/ubuntu/bionic.dockerfile      | 2 ++
 automation/build/ubuntu/focal.dockerfile       | 2 ++
 5 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/automation/build/alpine/3.12.dockerfile b/automation/build/alpine/3.12.dockerfile
index bb8e5ece74..4ee3ddc12e 100644
--- a/automation/build/alpine/3.12.dockerfile
+++ b/automation/build/alpine/3.12.dockerfile
@@ -47,6 +47,7 @@ RUN \
   apk add glib-dev && \
   apk add libattr && \
   apk add libcap-ng-dev && \
+  apk add ninja && \
   apk add pixman-dev && \
   \
   # cleanup
diff --git a/automation/build/fedora/29.dockerfile b/automation/build/fedora/29.dockerfile
index 027b93ceaf..60a5d72266 100644
--- a/automation/build/fedora/29.dockerfile
+++ b/automation/build/fedora/29.dockerfile
@@ -2,9 +2,6 @@ FROM fedora:29
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
-RUN mkdir /build
-WORKDIR /build
-
 # install Xen depends
 RUN dnf -y install \
         clang \
@@ -43,5 +40,11 @@ RUN dnf -y install \
         ocaml \
         ocaml-findlib \
         golang \
+        # QEMU
+        ninja-build \
     && dnf clean all && \
     rm -rf /var/cache/dnf
+
+RUN useradd --create-home user
+USER user
+WORKDIR /build
diff --git a/automation/build/suse/opensuse-leap.dockerfile b/automation/build/suse/opensuse-leap.dockerfile
index 573fbd8ae4..03f8a7acad 100644
--- a/automation/build/suse/opensuse-leap.dockerfile
+++ b/automation/build/suse/opensuse-leap.dockerfile
@@ -67,5 +67,7 @@ RUN zypper install -y --no-recommends \
         which \
         xz-devel \
         zlib-devel \
+        # QEMU
+        ninja \
         && \
         zypper clean -a
diff --git a/automation/build/ubuntu/bionic.dockerfile b/automation/build/ubuntu/bionic.dockerfile
index 406a97494c..1e5a27c70f 100644
--- a/automation/build/ubuntu/bionic.dockerfile
+++ b/automation/build/ubuntu/bionic.dockerfile
@@ -45,6 +45,8 @@ RUN apt-get update && \
         wget \
         git \
         nasm \
+        # QEMU
+        ninja-build \
         && \
         apt-get autoremove -y && \
         apt-get clean && \
diff --git a/automation/build/ubuntu/focal.dockerfile b/automation/build/ubuntu/focal.dockerfile
index 952a3172aa..74655b9876 100644
--- a/automation/build/ubuntu/focal.dockerfile
+++ b/automation/build/ubuntu/focal.dockerfile
@@ -44,6 +44,8 @@ RUN apt-get update && \
         wget \
         git \
         nasm \
+        # QEMU
+        ninja-build \
         && \
         apt-get autoremove -y && \
         apt-get clean && \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jul 08 13:00:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jul 2021 13:00:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153110.282857 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1TdZ-00034b-Eb; Thu, 08 Jul 2021 13:00:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153110.282857; Thu, 08 Jul 2021 13:00:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1TdZ-00034U-Bc; Thu, 08 Jul 2021 13:00:17 +0000
Received: by outflank-mailman (input) for mailman id 153110;
 Thu, 08 Jul 2021 13:00:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1TdX-00034H-MO
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 13:00:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1TdX-0006Si-L8
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 13:00:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1TdX-0000Gr-K5
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 13:00: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>
DKIM-Signature: v=1; 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+q1Iu0As6v5nTAlvaPD6tUH1avVvOV9pea73U5n0T4=; b=Pekc8e4quGo1pQBvBKHrtCR6he
	/uEFfquj9r3FMnkIZYjRlaX2e1AQPdIkWV+/tn3lZpLW7ELIX4AiHDT3YPOhIEOzwBnf4+Bg/jsju
	wNj6D5hPV8rky027U0nGu4+95nl9tFVJ318NbWhNyKtk3gZr7/1zGxz7IbbJMv4UaHLc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation: Check if ninja is available before building QEMU
Message-Id: <E1m1TdX-0000Gr-K5@xenbits.xenproject.org>
Date: Thu, 08 Jul 2021 13:00:15 +0000

commit ed939ef084ada31ac5e3000c9526bc99b58136e7
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed Jul 7 17:40:01 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 8 12:36:21 2021 +0100

    automation: Check if ninja is available before building QEMU
    
    ninja is now required to build the latest version of QEMU, and not all
    distros have a suitable version.  Skip the QEMU build when ninja is not
    available.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/scripts/build | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/automation/scripts/build b/automation/scripts/build
index 46b6903d29..4a1161bb94 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -45,8 +45,9 @@ if ! test -z "$(ldd /bin/ls|grep musl|head -1)"; then
     cfgargs+=("--with-system-seabios=/bin/false")
 fi
 
-# Qemu requires Python 3.5 or later
-if ! type python3 || python3 -c "import sys; res = sys.version_info < (3, 5); exit(not(res))"; then
+# Qemu requires Python 3.5 or later, and ninja
+if ! type python3 || python3 -c "import sys; res = sys.version_info < (3, 5); exit(not(res))" \
+        || ! type ninja; then
     cfgargs+=("--with-system-qemu=/bin/false")
 fi
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jul 08 13:00:27 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jul 2021 13:00:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153111.282861 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1Tdj-00037G-GA; Thu, 08 Jul 2021 13:00:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153111.282861; Thu, 08 Jul 2021 13:00:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1Tdj-000375-DD; Thu, 08 Jul 2021 13:00:27 +0000
Received: by outflank-mailman (input) for mailman id 153111;
 Thu, 08 Jul 2021 13:00:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1Tdh-00036t-P9
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 13:00:25 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1Tdh-0006Sz-OM
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 13:00:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1Tdh-0000Ho-NO
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 13: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=X60QsIUkGfYAfPOml3tnDRZ4e1AJsKWuLFBQ9KQoN7Y=; b=Ghf91/b4Gi5BOT7viRdc5/PiCU
	xOJQtBmFVs4hOwzHGOePKNBnekFFFqDiF7eHc+TcMg21nnm1HYzpCLEEhJ/YYR2wHqi4M8IWE1sm/
	jwyoAvFB47hJj6EOajFXa8V9fS2eyiA4MvbmrA6vxJ3KZTwFrt0r8kngiB2CrHQJgxCs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation: dump contents of /etc/os-release
Message-Id: <E1m1Tdh-0000Ho-NO@xenbits.xenproject.org>
Date: Thu, 08 Jul 2021 13:00:25 +0000

commit d213e85cb1e96571e1ed2f15ea87c19d21c84586
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 8 08:29:22 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 8 12:36:21 2021 +0100

    automation: dump contents of /etc/os-release
    
    To aid debugging build failures, dump /etc/os-release during build.
    This helps with rolling releases such as Tumbleweed to understand the
    state of the build container.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/scripts/build | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/automation/scripts/build b/automation/scripts/build
index 4a1161bb94..281f8b1fcc 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -1,5 +1,7 @@
 #!/bin/bash -ex
 
+test -f /etc/os-release && cat "$_"
+
 $CC --version
 
 # Express the compiler version as an integer.  e.g. GCC 4.9.2 => 0x040902
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jul 08 13:00:37 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jul 2021 13:00:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153112.282865 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1Tdt-0003B4-Hv; Thu, 08 Jul 2021 13:00:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153112.282865; Thu, 08 Jul 2021 13:00:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1Tdt-0003Aw-Eh; Thu, 08 Jul 2021 13:00:37 +0000
Received: by outflank-mailman (input) for mailman id 153112;
 Thu, 08 Jul 2021 13:00:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1Tdr-0003AR-SF
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 13:00:35 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1Tdr-0006TG-RU
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 13:00:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1Tdr-0000Ie-QS
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yznsxUR0/+X287RsICjmNbLxVUDgxve13fwlc0HQjRY=; b=IT+DfpgwfBXd8tLVLGcfqmOhwB
	p6pBoDkWgRDJMRjossDapUNkdKBOyjXiKP50s85xOeNGD8Zi9JE4Oe2KD0k6Wra4UhdNk9/YVt06o
	LTBo+mb9CwZ/I4ForM3SSLXKbiqLpruQCNzaNkmtSjLD6DVR0taE2Bg4ejTyHLXhNomI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation: collect log files in subdirectories
Message-Id: <E1m1Tdr-0000Ie-QS@xenbits.xenproject.org>
Date: Thu, 08 Jul 2021 13:00:35 +0000

commit 0f435e2b58543f5baae96e17a10ae20d3dbc28fa
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 8 08:54:35 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 8 12:36:21 2021 +0100

    automation: collect log files in subdirectories
    
    The current single *.log pattern collects just config.log, which
    usually contains little useful information.
    Collect also log files in subdirectories, tools/config.log usually
    contains information about configure failures.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/gitlab-ci/build.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 20d1d0cb34..d177da1710 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -8,6 +8,7 @@
       - binaries/
       - xen-config
       - '*.log'
+      - '*/*.log'
     when: always
   except:
     - master
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jul 08 22:44:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jul 2021 22:44:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153329.283260 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1ckV-0004Fc-Oy; Thu, 08 Jul 2021 22:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153329.283260; Thu, 08 Jul 2021 22:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1ckV-0004FU-LK; Thu, 08 Jul 2021 22:44:03 +0000
Received: by outflank-mailman (input) for mailman id 153329;
 Thu, 08 Jul 2021 22:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1ckU-0004FO-Nl
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1ckU-000061-H8
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1ckU-0002kg-G2
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aMDEPOY0/aLB7Uu4nsMVpsmKPJWPFsFH7bdiWfue0ek=; b=p2EL/LllkY3ipWClqdBwXr/vlQ
	WpysjYJbDmnsDkbsC0nUOQqHDFa6nIKqOU5Id4NLLreXzBZHgPy/+8mliIT1wUZhCeLbME5V7M1pS
	UJQDjdifRjen4VrsBNT6rqBcz6ymvdN2wqPmmvIKSOGuJXkRithCrF4zy8fDRVxLfYks=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm64: Change type of hsr, cpsr, spsr_el1 to uint64_t
Message-Id: <E1m1ckU-0002kg-G2@xenbits.xenproject.org>
Date: Thu, 08 Jul 2021 22:44:02 +0000

commit 918b8842a852e0e7446286f546724b1c63c56c66
Author:     Michal Orzel <michal.orzel@arm.com>
AuthorDate: Mon Jul 5 08:39:52 2021 +0200
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Jul 6 10:02:00 2021 +0100

    arm64: Change type of hsr, cpsr, spsr_el1 to uint64_t
    
    AArch64 registers are 64bit whereas AArch32 registers
    are 32bit or 64bit. MSR/MRS are expecting 64bit values thus
    we should get rid of helpers READ/WRITE_SYSREG32
    in favour of using READ/WRITE_SYSREG.
    We should also use register_t type when reading sysregs
    which can correspond to uint64_t or uint32_t.
    Even though many AArch64 registers have upper 32bit reserved
    it does not mean that they can't be widen in the future.
    
    Modify type of hsr, cpsr, spsr_el1 to uint64_t.
    Previously we relied on the padding after spsr_el1.
    As we removed the padding, modify the union to be 64bit so we don't corrupt spsr_fiq.
    No need to modify the assembly code because the accesses were based on 64bit
    registers as there was a 32bit padding after spsr_el1.
    
    Remove 32bit padding in cpu_user_regs before spsr_fiq
    as it is no longer needed due to upper union being 64bit now.
    Add 64bit padding in cpu_user_regs before spsr_el1
    because the kernel frame should be 16-byte aligned.
    
    Change type of cpsr to uint64_t in the public outside interface
    "public/arch-arm.h" to allow ABI compatibility between 32bit and 64bit.
    Increment XEN_DOMCTL_INTERFACE_VERSION.
    
    Change type of cpsr to uint64_t in the public outside interface
    "public/vm_event.h" to allow ABI compatibility between 32bit and 64bit.
    
    Signed-off-by: Michal Orzel <michal.orzel@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/arm64/entry.S            |  4 ++--
 xen/arch/arm/arm64/traps.c            |  2 +-
 xen/arch/arm/arm64/vsysreg.c          |  3 ++-
 xen/arch/arm/domain.c                 |  2 +-
 xen/arch/arm/traps.c                  | 28 +++++++++++++++-------------
 xen/arch/arm/vcpreg.c                 | 13 +++++++------
 xen/include/asm-arm/arm64/processor.h | 11 ++++++-----
 xen/include/asm-arm/hsr.h             |  2 +-
 xen/include/public/arch-arm.h         |  4 ++--
 xen/include/public/domctl.h           |  2 +-
 xen/include/public/vm_event.h         |  3 +--
 11 files changed, 39 insertions(+), 35 deletions(-)

diff --git a/xen/arch/arm/arm64/entry.S b/xen/arch/arm/arm64/entry.S
index ab9a65fc14..fc3811ad0a 100644
--- a/xen/arch/arm/arm64/entry.S
+++ b/xen/arch/arm/arm64/entry.S
@@ -155,7 +155,7 @@
         add     x21, sp, #UREGS_CPSR
         mrs     x22, spsr_el2
         mrs     x23, esr_el2
-        stp     w22, w23, [x21]
+        stp     x22, x23, [x21]
 
         .endm
 
@@ -432,7 +432,7 @@ return_from_trap:
         msr     daifset, #IFLAGS___I_ /* Mask interrupts */
 
         ldr     x21, [sp, #UREGS_PC]            /* load ELR */
-        ldr     w22, [sp, #UREGS_CPSR]          /* load SPSR */
+        ldr     x22, [sp, #UREGS_CPSR]          /* load SPSR */
 
         pop     x0, x1
         pop     x2, x3
diff --git a/xen/arch/arm/arm64/traps.c b/xen/arch/arm/arm64/traps.c
index babfc1d884..9113a15c7a 100644
--- a/xen/arch/arm/arm64/traps.c
+++ b/xen/arch/arm/arm64/traps.c
@@ -36,7 +36,7 @@ void do_bad_mode(struct cpu_user_regs *regs, int reason)
     union hsr hsr = { .bits = regs->hsr };
 
     printk("Bad mode in %s handler detected\n", handler[reason]);
-    printk("ESR=0x%08"PRIx32":  EC=%"PRIx32", IL=%"PRIx32", ISS=%"PRIx32"\n",
+    printk("ESR=%#"PRIregister":  EC=%"PRIx32", IL=%"PRIx32", ISS=%"PRIx32"\n",
            hsr.bits, hsr.ec, hsr.len, hsr.iss);
 
     local_irq_disable();
diff --git a/xen/arch/arm/arm64/vsysreg.c b/xen/arch/arm/arm64/vsysreg.c
index 41f18612c6..caf17174b8 100644
--- a/xen/arch/arm/arm64/vsysreg.c
+++ b/xen/arch/arm/arm64/vsysreg.c
@@ -368,7 +368,8 @@ void do_sysreg(struct cpu_user_regs *regs,
                      sysreg.op2,
                      sysreg.read ? "=>" : "<=",
                      sysreg.reg, regs->pc);
-            gdprintk(XENLOG_ERR, "unhandled 64-bit sysreg access %#x\n",
+            gdprintk(XENLOG_ERR,
+                     "unhandled 64-bit sysreg access %#"PRIregister"\n",
                      hsr.bits & HSR_SYSREG_REGS_MASK);
             inject_undef_exception(regs, hsr);
             return;
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index c021a03c61..74bdbb9082 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -845,7 +845,7 @@ static int is_guest_pv32_psr(uint32_t psr)
 
 
 #ifdef CONFIG_ARM_64
-static int is_guest_pv64_psr(uint32_t psr)
+static int is_guest_pv64_psr(uint64_t psr)
 {
     if ( psr & PSR_MODE_BIT )
         return 0;
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index e7384381cc..4ccb6e7d18 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -546,7 +546,7 @@ void inject_undef64_exception(struct cpu_user_regs *regs, int instr_len)
         PSR_IRQ_MASK | PSR_DBG_MASK;
     regs->pc = handler;
 
-    WRITE_SYSREG32(esr.bits, ESR_EL1);
+    WRITE_SYSREG(esr.bits, ESR_EL1);
 }
 
 /* Inject an abort exception into a 64 bit guest */
@@ -580,7 +580,7 @@ static void inject_abt64_exception(struct cpu_user_regs *regs,
     regs->pc = handler;
 
     WRITE_SYSREG(addr, FAR_EL1);
-    WRITE_SYSREG32(esr.bits, ESR_EL1);
+    WRITE_SYSREG(esr.bits, ESR_EL1);
 }
 
 static void inject_dabt64_exception(struct cpu_user_regs *regs,
@@ -717,7 +717,7 @@ struct reg_ctxt {
     uint64_t vttbr_el2;
 };
 
-static const char *mode_string(uint32_t cpsr)
+static const char *mode_string(register_t cpsr)
 {
     uint32_t mode;
     static const char *mode_strings[] = {
@@ -762,7 +762,7 @@ static void show_registers_32(const struct cpu_user_regs *regs,
         printk(" %pS", _p(regs->pc));
     printk("\n");
 #endif
-    printk("CPSR:   %08"PRIx32" MODE:%s\n", regs->cpsr,
+    printk("CPSR:   %"PRIregister" MODE:%s\n", regs->cpsr,
            mode_string(regs->cpsr));
     printk("     R0: %08"PRIx32" R1: %08"PRIx32" R2: %08"PRIx32" R3: %08"PRIx32"\n",
            regs->r0, regs->r1, regs->r2, regs->r3);
@@ -846,7 +846,7 @@ static void show_registers_64(const struct cpu_user_regs *regs,
     {
         printk("SP:     %016"PRIx64"\n", regs->sp);
     }
-    printk("CPSR:   %08"PRIx32" MODE:%s\n", regs->cpsr,
+    printk("CPSR:   %016"PRIx64" MODE:%s\n", regs->cpsr,
            mode_string(regs->cpsr));
     printk("     X0: %016"PRIx64"  X1: %016"PRIx64"  X2: %016"PRIx64"\n",
            regs->x0, regs->x1, regs->x2);
@@ -919,7 +919,7 @@ static void _show_registers(const struct cpu_user_regs *regs,
     printk("   HCR_EL2: %"PRIregister"\n", READ_SYSREG(HCR_EL2));
     printk(" TTBR0_EL2: %016"PRIx64"\n", READ_SYSREG64(TTBR0_EL2));
     printk("\n");
-    printk("   ESR_EL2: %08"PRIx32"\n", regs->hsr);
+    printk("   ESR_EL2: %"PRIregister"\n", regs->hsr);
     printk(" HPFAR_EL2: %"PRIregister"\n", READ_SYSREG(HPFAR_EL2));
 
 #ifdef CONFIG_ARM_32
@@ -1599,7 +1599,7 @@ static const unsigned short cc_map[16] = {
 
 int check_conditional_instr(struct cpu_user_regs *regs, const union hsr hsr)
 {
-    unsigned long cpsr, cpsr_cond;
+    register_t cpsr, cpsr_cond;
     int cond;
 
     /*
@@ -1661,7 +1661,7 @@ int check_conditional_instr(struct cpu_user_regs *regs, const union hsr hsr)
 
 void advance_pc(struct cpu_user_regs *regs, const union hsr hsr)
 {
-    unsigned long itbits, cond, cpsr = regs->cpsr;
+    register_t itbits, cond, cpsr = regs->cpsr;
     bool is_thumb = psr_mode_is_32bit(regs) && (cpsr & PSR_THUMB);
 
     if ( is_thumb && (cpsr & PSR_IT_MASK) )
@@ -2004,13 +2004,15 @@ static void do_trap_stage2_abort_guest(struct cpu_user_regs *regs,
 
         break;
     default:
-        gprintk(XENLOG_WARNING, "Unsupported FSC: HSR=%#x DFSC=%#x\n",
+        gprintk(XENLOG_WARNING,
+                "Unsupported FSC: HSR=%#"PRIregister" DFSC=%#x\n",
                 hsr.bits, xabt.fsc);
     }
 
 inject_abt:
-    gdprintk(XENLOG_DEBUG, "HSR=0x%x pc=%#"PRIregister" gva=%#"PRIvaddr
-             " gpa=%#"PRIpaddr"\n", hsr.bits, regs->pc, gva, gpa);
+    gdprintk(XENLOG_DEBUG,
+             "HSR=%#"PRIregister" pc=%#"PRIregister" gva=%#"PRIvaddr" gpa=%#"PRIpaddr"\n",
+             hsr.bits, regs->pc, gva, gpa);
     if ( is_data )
         inject_dabt_exception(regs, gva, hsr.len);
     else
@@ -2204,7 +2206,7 @@ void do_trap_guest_sync(struct cpu_user_regs *regs)
 
     default:
         gprintk(XENLOG_WARNING,
-                "Unknown Guest Trap. HSR=0x%x EC=0x%x IL=%x Syndrome=0x%"PRIx32"\n",
+                "Unknown Guest Trap. HSR=%#"PRIregister" EC=0x%x IL=%x Syndrome=0x%"PRIx32"\n",
                 hsr.bits, hsr.ec, hsr.len, hsr.iss);
         inject_undef_exception(regs, hsr);
     }
@@ -2242,7 +2244,7 @@ void do_trap_hyp_sync(struct cpu_user_regs *regs)
         break;
     }
     default:
-        printk("Hypervisor Trap. HSR=0x%x EC=0x%x IL=%x Syndrome=0x%"PRIx32"\n",
+        printk("Hypervisor Trap. HSR=%#"PRIregister" EC=0x%x IL=%x Syndrome=0x%"PRIx32"\n",
                hsr.bits, hsr.ec, hsr.len, hsr.iss);
         do_unexpected_trap("Hypervisor", regs);
     }
diff --git a/xen/arch/arm/vcpreg.c b/xen/arch/arm/vcpreg.c
index 55351fc087..f0cdcc8a54 100644
--- a/xen/arch/arm/vcpreg.c
+++ b/xen/arch/arm/vcpreg.c
@@ -385,7 +385,7 @@ void do_cp15_32(struct cpu_user_regs *regs, const union hsr hsr)
                  "%s p15, %d, r%d, cr%d, cr%d, %d @ 0x%"PRIregister"\n",
                  cp32.read ? "mrc" : "mcr",
                  cp32.op1, cp32.reg, cp32.crn, cp32.crm, cp32.op2, regs->pc);
-        gdprintk(XENLOG_ERR, "unhandled 32-bit CP15 access %#x\n",
+        gdprintk(XENLOG_ERR, "unhandled 32-bit CP15 access %#"PRIregister"\n",
                  hsr.bits & HSR_CP32_REGS_MASK);
         inject_undef_exception(regs, hsr);
         return;
@@ -454,7 +454,8 @@ void do_cp15_64(struct cpu_user_regs *regs, const union hsr hsr)
                      "%s p15, %d, r%d, r%d, cr%d @ 0x%"PRIregister"\n",
                      cp64.read ? "mrrc" : "mcrr",
                      cp64.op1, cp64.reg1, cp64.reg2, cp64.crm, regs->pc);
-            gdprintk(XENLOG_ERR, "unhandled 64-bit CP15 access %#x\n",
+            gdprintk(XENLOG_ERR,
+                     "unhandled 64-bit CP15 access %#"PRIregister"\n",
                      hsr.bits & HSR_CP64_REGS_MASK);
             inject_undef_exception(regs, hsr);
             return;
@@ -585,7 +586,7 @@ void do_cp14_32(struct cpu_user_regs *regs, const union hsr hsr)
                  "%s p14, %d, r%d, cr%d, cr%d, %d @ 0x%"PRIregister"\n",
                   cp32.read ? "mrc" : "mcr",
                   cp32.op1, cp32.reg, cp32.crn, cp32.crm, cp32.op2, regs->pc);
-        gdprintk(XENLOG_ERR, "unhandled 32-bit cp14 access %#x\n",
+        gdprintk(XENLOG_ERR, "unhandled 32-bit cp14 access %#"PRIregister"\n",
                  hsr.bits & HSR_CP32_REGS_MASK);
         inject_undef_exception(regs, hsr);
         return;
@@ -627,7 +628,7 @@ void do_cp14_64(struct cpu_user_regs *regs, const union hsr hsr)
              "%s p14, %d, r%d, r%d, cr%d @ 0x%"PRIregister"\n",
              cp64.read ? "mrrc" : "mcrr",
              cp64.op1, cp64.reg1, cp64.reg2, cp64.crm, regs->pc);
-    gdprintk(XENLOG_ERR, "unhandled 64-bit CP14 access %#x\n",
+    gdprintk(XENLOG_ERR, "unhandled 64-bit CP14 access %#"PRIregister"\n",
              hsr.bits & HSR_CP64_REGS_MASK);
     inject_undef_exception(regs, hsr);
 }
@@ -658,7 +659,7 @@ void do_cp14_dbg(struct cpu_user_regs *regs, const union hsr hsr)
              "%s p14, %d, r%d, r%d, cr%d @ 0x%"PRIregister"\n",
              cp64.read ? "mrrc" : "mcrr",
              cp64.op1, cp64.reg1, cp64.reg2, cp64.crm, regs->pc);
-    gdprintk(XENLOG_ERR, "unhandled 64-bit CP14 DBG access %#x\n",
+    gdprintk(XENLOG_ERR, "unhandled 64-bit CP14 DBG access %#"PRIregister"\n",
              hsr.bits & HSR_CP64_REGS_MASK);
 
     inject_undef_exception(regs, hsr);
@@ -692,7 +693,7 @@ void do_cp10(struct cpu_user_regs *regs, const union hsr hsr)
                  "%s p10, %d, r%d, cr%d, cr%d, %d @ 0x%"PRIregister"\n",
                  cp32.read ? "mrc" : "mcr",
                  cp32.op1, cp32.reg, cp32.crn, cp32.crm, cp32.op2, regs->pc);
-        gdprintk(XENLOG_ERR, "unhandled 32-bit CP10 access %#x\n",
+        gdprintk(XENLOG_ERR, "unhandled 32-bit CP10 access %#"PRIregister"\n",
                  hsr.bits & HSR_CP32_REGS_MASK);
         inject_undef_exception(regs, hsr);
         return;
diff --git a/xen/include/asm-arm/arm64/processor.h b/xen/include/asm-arm/arm64/processor.h
index 81dfc5e615..c749f80ad9 100644
--- a/xen/include/asm-arm/arm64/processor.h
+++ b/xen/include/asm-arm/arm64/processor.h
@@ -63,18 +63,19 @@ struct cpu_user_regs
 
     /* Return address and mode */
     __DECL_REG(pc,           pc32);             /* ELR_EL2 */
-    uint32_t cpsr;                              /* SPSR_EL2 */
-    uint32_t hsr;                               /* ESR_EL2 */
+    uint64_t cpsr;                              /* SPSR_EL2 */
+    uint64_t hsr;                               /* ESR_EL2 */
+
+    /* The kernel frame should be 16-byte aligned. */
+    uint64_t pad0;
 
     /* Outer guest frame only from here on... */
 
     union {
-        uint32_t spsr_el1;       /* AArch64 */
+        uint64_t spsr_el1;       /* AArch64 */
         uint32_t spsr_svc;       /* AArch32 */
     };
 
-    uint32_t pad1; /* Doubleword-align the user half of the frame */
-
     /* AArch32 guests only */
     uint32_t spsr_fiq, spsr_irq, spsr_und, spsr_abt;
 
diff --git a/xen/include/asm-arm/hsr.h b/xen/include/asm-arm/hsr.h
index 29d4531f40..9b91b28c48 100644
--- a/xen/include/asm-arm/hsr.h
+++ b/xen/include/asm-arm/hsr.h
@@ -16,7 +16,7 @@ enum dabt_size {
 };
 
 union hsr {
-    uint32_t bits;
+    register_t bits;
     struct {
         unsigned long iss:25;  /* Instruction Specific Syndrome */
         unsigned long len:1;   /* Instruction length */
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 713fd65317..64a2ca30da 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -267,10 +267,10 @@ struct vcpu_guest_core_regs
 
     /* Return address and mode */
     __DECL_REG(pc64,         pc32);             /* ELR_EL2 */
-    uint32_t cpsr;                              /* SPSR_EL2 */
+    uint64_t cpsr;                              /* SPSR_EL2 */
 
     union {
-        uint32_t spsr_el1;       /* AArch64 */
+        uint64_t spsr_el1;       /* AArch64 */
         uint32_t spsr_svc;       /* AArch32 */
     };
 
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 4dbf107785..d576bfabd6 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -38,7 +38,7 @@
 #include "hvm/save.h"
 #include "memory.h"
 
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000013
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000014
 
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
diff --git a/xen/include/public/vm_event.h b/xen/include/public/vm_event.h
index 36135ba4f1..bb003d21d0 100644
--- a/xen/include/public/vm_event.h
+++ b/xen/include/public/vm_event.h
@@ -266,8 +266,7 @@ struct vm_event_regs_arm {
     uint64_t ttbr1;
     uint64_t ttbcr;
     uint64_t pc;
-    uint32_t cpsr;
-    uint32_t _pad;
+    uint64_t cpsr;
 };
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jul 08 22:44:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jul 2021 22:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153330.283263 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1ckf-0004I5-SP; Thu, 08 Jul 2021 22:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153330.283263; Thu, 08 Jul 2021 22:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1ckf-0004Hw-P3; Thu, 08 Jul 2021 22:44:13 +0000
Received: by outflank-mailman (input) for mailman id 153330;
 Thu, 08 Jul 2021 22:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cke-0004Hi-Le
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cke-000065-Kg
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cke-0002lG-JX
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OVWJ7+QnmhrAeozM5eKtbHdeQSYRI4qCSIIoZ4HH6aA=; b=1htlEh0Kg142uSRezLtJ4neKBR
	TcEO9FIA7mTz/1m0rWq0r+LTkh4jKdBN4KWG4qJ6ohgdSzl6qP7Ks88yNQJqg1Dsz30k/KfDBKCo7
	dq+b3M61kHgAXrokO+YMAFOTMSafbkCVe+wgKW7P1R14kVfGDw4DdvnJyNEzWdRmK6gE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/python: handle libxl__physmap_info.name properly in convert-legacy-stream
Message-Id: <E1m1cke-0002lG-JX@xenbits.xenproject.org>
Date: Thu, 08 Jul 2021 22:44:12 +0000

commit c8f88810db2a25d6aacf65c1c60bc4f5d848a483
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:56:00 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jul 6 10:49:58 2021 +0100

    tools/python: handle libxl__physmap_info.name properly in convert-legacy-stream
    
    The trailing member name[] in libxl__physmap_info is written as a
    cstring into the stream. The current code does a sanity check if the
    last byte is zero. This attempt fails with python3 because name[-1]
    returns a type int. As a result the comparison with byte(\00) fails:
    
      File "/usr/lib/xen/bin/convert-legacy-stream", line 347, in read_libxl_toolstack
        raise StreamError("physmap name not NUL terminated")
      StreamError: physmap name not NUL terminated
    
    To handle both python variants, cast to bytearray().
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 tools/python/scripts/convert-legacy-stream | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/python/scripts/convert-legacy-stream b/tools/python/scripts/convert-legacy-stream
index 66ee3d2f5d..227e1b5c3f 100755
--- a/tools/python/scripts/convert-legacy-stream
+++ b/tools/python/scripts/convert-legacy-stream
@@ -343,7 +343,7 @@ def read_libxl_toolstack(vm, data):
         if twidth == 64:
             name = name[:-4]
 
-        if name[-1] != b'\x00':
+        if bytearray(name)[-1] != 0:
             raise StreamError("physmap name not NUL terminated")
 
         root = b"physmap/%x" % (phys, )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jul 08 22:44:23 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jul 2021 22:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153331.283267 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1ckp-0004LO-Tu; Thu, 08 Jul 2021 22:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153331.283267; Thu, 08 Jul 2021 22:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1ckp-0004LF-Qp; Thu, 08 Jul 2021 22:44:23 +0000
Received: by outflank-mailman (input) for mailman id 153331;
 Thu, 08 Jul 2021 22:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cko-0004L2-Ok
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cko-00006G-Nu
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cko-0002lu-Mt
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:44: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hr88MtoNksRR0kK5un9/6omMIZ/OY4tn5zb0yttV/hM=; b=NFRwHIuDFQmyGC3yphnUXfecBl
	RB8Z6G8Iwy2cTFVheZ7vh8IiT2h22js408XvQDOTr4yw4iecNyK1Ddu/Sco6NBPUklwqSPMH/idZh
	CluaxmdIPrbwdhMDmT6lGdOGG+5CZEORxwAvb7OSsMFs9yl+OgJH2AWkErpLQ84Dx59Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/python: fix Python3.4 TypeError in format string
Message-Id: <E1m1cko-0002lu-Mt@xenbits.xenproject.org>
Date: Thu, 08 Jul 2021 22:44:22 +0000

commit a27976a1080d537fb1f212a8f9133d60daa0025b
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:56:01 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jul 6 10:49:58 2021 +0100

    tools/python: fix Python3.4 TypeError in format string
    
    Using the first element of a tuple for a format specifier fails with
    python3.4 as included in SLE12:
        b = b"string/%x" % (i, )
    TypeError: unsupported operand type(s) for %: 'bytes' and 'tuple'
    
    It happens to work with python 2.7 and 3.6.
    To support older Py3, format as strings and explicitly encode as ASCII.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 tools/python/scripts/convert-legacy-stream | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/python/scripts/convert-legacy-stream b/tools/python/scripts/convert-legacy-stream
index 227e1b5c3f..7fe375a668 100755
--- a/tools/python/scripts/convert-legacy-stream
+++ b/tools/python/scripts/convert-legacy-stream
@@ -346,9 +346,9 @@ def read_libxl_toolstack(vm, data):
         if bytearray(name)[-1] != 0:
             raise StreamError("physmap name not NUL terminated")
 
-        root = b"physmap/%x" % (phys, )
-        kv = [root + b"/start_addr", b"%x" % (start, ),
-              root + b"/size",       b"%x" % (size, ),
+        root = ("physmap/%x" % (phys, )).encode('ascii')
+        kv = [root + b"/start_addr", ("%x" % (start, )).encode('ascii'),
+              root + b"/size",       ("%x" % (size, )).encode('ascii'),
               root + b"/name",       name[:-1]]
 
         for key, val in zip(kv[0::2], kv[1::2]):
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jul 08 22:44:33 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jul 2021 22:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153332.283271 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1ckz-0004Og-VI; Thu, 08 Jul 2021 22:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153332.283271; Thu, 08 Jul 2021 22:44:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1ckz-0004OY-SQ; Thu, 08 Jul 2021 22:44:33 +0000
Received: by outflank-mailman (input) for mailman id 153332;
 Thu, 08 Jul 2021 22:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cky-0004OD-Rj
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cky-00006Y-Qw
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cky-0002mP-QD
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:44: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+RgQt/RVThkcItTgjMCuUZeRcegbBRO1wmd0kKyHEio=; b=JvvfixY7E2WqjEDwTDX3tl7mAC
	NrZD/nv7wGmEeMRARUGL3Zfc4ZXNwdEKRksdsvONCgwK6emg25K8left7cN4YDhPZPU3s/aNYltbN
	aJYt49E6sDaoazI6SLrozfctNMuaO0drx8N3/WmG9fyO6SiogbqantpbFzExrjZsdae4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/migration: unify known page type checking
Message-Id: <E1m1cky-0002mP-QD@xenbits.xenproject.org>
Date: Thu, 08 Jul 2021 22:44:32 +0000

commit 9e59d9f8ee3808acde9833192211da25f66d8cc2
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:56:05 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jul 6 10:49:58 2021 +0100

    tools/migration: unify known page type checking
    
    Users of xc_get_pfn_type_batch may want to sanity check the data
    returned by Xen. Add helpers for this purpose:
    
    is_known_page_type verifies the type returned by Xen on the saving
    side, or the incoming type for a page on the restoring side, is known
    by the save/restore code.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libs/guest/xg_sr_common.h  | 29 +++++++++++++++++++++++++++++
 tools/libs/guest/xg_sr_restore.c |  5 ++---
 tools/libs/guest/xg_sr_save.c    |  6 ++++++
 3 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index e2994e18ac..e8436d1abb 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -455,6 +455,35 @@ int populate_pfns(struct xc_sr_context *ctx, unsigned int count,
 /* Handle a STATIC_DATA_END record. */
 int handle_static_data_end(struct xc_sr_context *ctx);
 
+/* Page type known to the migration logic? */
+static inline bool is_known_page_type(uint32_t type)
+{
+    switch ( type )
+    {
+    case XEN_DOMCTL_PFINFO_NOTAB:
+
+    case XEN_DOMCTL_PFINFO_L1TAB:
+    case XEN_DOMCTL_PFINFO_L1TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_L2TAB:
+    case XEN_DOMCTL_PFINFO_L2TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_L3TAB:
+    case XEN_DOMCTL_PFINFO_L3TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_L4TAB:
+    case XEN_DOMCTL_PFINFO_L4TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_XTAB:
+    case XEN_DOMCTL_PFINFO_XALLOC: /* Synthetic type in Xen 4.2 - 4.5 */
+    case XEN_DOMCTL_PFINFO_BROKEN:
+        return true;
+
+    default:
+        return false;
+    }
+}
+
 #endif
 /*
  * Local variables:
diff --git a/tools/libs/guest/xg_sr_restore.c b/tools/libs/guest/xg_sr_restore.c
index b57a787519..508953fd3c 100644
--- a/tools/libs/guest/xg_sr_restore.c
+++ b/tools/libs/guest/xg_sr_restore.c
@@ -406,10 +406,9 @@ static int handle_page_data(struct xc_sr_context *ctx, struct xc_sr_record *rec)
         }
 
         type = (pages->pfn[i] & PAGE_DATA_TYPE_MASK) >> 32;
-        if ( ((type >> XEN_DOMCTL_PFINFO_LTAB_SHIFT) >= 5) &&
-             ((type >> XEN_DOMCTL_PFINFO_LTAB_SHIFT) <= 8) )
+        if ( !is_known_page_type(type) )
         {
-            ERROR("Invalid type %#"PRIx32" for pfn %#"PRIpfn" (index %u)",
+            ERROR("Unknown type %#"PRIx32" for pfn %#"PRIpfn" (index %u)",
                   type, pfn, i);
             goto err;
         }
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index f0e2bd048d..c84a073e86 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -147,6 +147,12 @@ static int write_batch(struct xc_sr_context *ctx)
 
     for ( i = 0; i < nr_pfns; ++i )
     {
+        if ( !is_known_page_type(types[i]) )
+        {
+            ERROR("Unknown type %#"PRIpfn" for pfn %#"PRIpfn, types[i], mfns[i]);
+            goto err;
+        }
+
         switch ( types[i] )
         {
         case XEN_DOMCTL_PFINFO_BROKEN:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jul 08 22:44:44 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jul 2021 22:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153334.283275 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1clA-0004Rr-0y; Thu, 08 Jul 2021 22:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153334.283275; Thu, 08 Jul 2021 22:44:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1cl9-0004Rj-Tz; Thu, 08 Jul 2021 22:44:43 +0000
Received: by outflank-mailman (input) for mailman id 153334;
 Thu, 08 Jul 2021 22:44:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cl8-0004RX-Ux
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:44:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cl8-00006m-U9
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cl8-0002my-T3
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:44: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ctzY+pR4z3hPVYDT3FeLXvwVEisTRVwUCc7PUr+4GwQ=; b=6o4GI0lQhz5TtlMFi0NxMSxJhX
	H43HQBHrFxZVyjtHI3HDpADRXzjhkiWyuZ/heKwwH0IZsWiRKEL8tQb7TZ+9tOtCy5AFCbXVekKtj
	ole6cInNzs9mLb8CNv4QqHdXXh/8LlLUQNQI2ihFPq8kUImNZG9O1hf+k9Mn5pEmQ6BY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/migration: unify type checking for data pfns in the VM
Message-Id: <E1m1cl8-0002my-T3@xenbits.xenproject.org>
Date: Thu, 08 Jul 2021 22:44:42 +0000

commit 5588ebcfca774477cf823949e5703b0ac48818cc
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:56:07 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jul 6 10:49:58 2021 +0100

    tools/migration: unify type checking for data pfns in the VM
    
    Introduce a helper which decides if a given pfn in the migration
    stream is backed by memory.
    
    This highlights more clearly that type XEN_DOMCTL_PFINFO_XALLOC (a
    synthetic toolstack-only type used between Xen 4.2 to 4.5 which
    indicated a dirty page on the sending side for which no data will be
    send in the initial iteration) does get populated in the VM.
    
    No change in behaviour intended, except for invalid page types which now
    have a safer default.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libs/guest/xg_sr_common.h  | 29 +++++++++++++++++++++++++++++
 tools/libs/guest/xg_sr_restore.c |  4 +---
 2 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index e8436d1abb..7f4b0439f6 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -484,6 +484,35 @@ static inline bool is_known_page_type(uint32_t type)
     }
 }
 
+/* Page type backed by RAM in the guest? */
+static inline bool page_type_to_populate(uint32_t type)
+{
+    switch ( type )
+    {
+    case XEN_DOMCTL_PFINFO_NOTAB:
+
+    case XEN_DOMCTL_PFINFO_L1TAB:
+    case XEN_DOMCTL_PFINFO_L1TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_L2TAB:
+    case XEN_DOMCTL_PFINFO_L2TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_L3TAB:
+    case XEN_DOMCTL_PFINFO_L3TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_L4TAB:
+    case XEN_DOMCTL_PFINFO_L4TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_XALLOC:
+        return true;
+
+    case XEN_DOMCTL_PFINFO_XTAB:
+    case XEN_DOMCTL_PFINFO_BROKEN:
+    default:
+        return false;
+    }
+}
+
 #endif
 /*
  * Local variables:
diff --git a/tools/libs/guest/xg_sr_restore.c b/tools/libs/guest/xg_sr_restore.c
index 508953fd3c..3d63442d45 100644
--- a/tools/libs/guest/xg_sr_restore.c
+++ b/tools/libs/guest/xg_sr_restore.c
@@ -152,9 +152,7 @@ int populate_pfns(struct xc_sr_context *ctx, unsigned int count,
 
     for ( i = 0; i < count; ++i )
     {
-        if ( (!types || (types &&
-                         (types[i] != XEN_DOMCTL_PFINFO_XTAB &&
-                          types[i] != XEN_DOMCTL_PFINFO_BROKEN))) &&
+        if ( (!types || page_type_to_populate(types[i])) &&
              !pfn_is_populated(ctx, original_pfns[i]) )
         {
             rc = pfn_set_populated(ctx, original_pfns[i]);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jul 08 22:44:54 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jul 2021 22:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153335.283279 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1clK-0004Uu-2U; Thu, 08 Jul 2021 22:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153335.283279; Thu, 08 Jul 2021 22:44:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1clJ-0004Um-Va; Thu, 08 Jul 2021 22:44:53 +0000
Received: by outflank-mailman (input) for mailman id 153335;
 Thu, 08 Jul 2021 22:44:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1clJ-0004Ue-1t
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:44:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1clJ-00006x-0u
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:44:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1clJ-0002nW-08
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Uad2+6/wQ8HEh7JPidolrGwGnPIrdIuYVfXYaZpUTtU=; b=ElJlkvzdJI1WIcRRuS753pOMAD
	50YWp5PzxkD91cbaDAiK1UBO6SWr9OQgGiVQl5rc+/m33pP8snKdRx6gAxMthhjTmK0esRfoq00Ub
	2X51EL5GfP81I2S4vFPECW1rkPFETe5tGsg3kJ9YvUODlv1IEbTWNzZiCO0nEWTHfJ2Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/migration: unify type checking for data pfns in migration stream
Message-Id: <E1m1clJ-0002nW-08@xenbits.xenproject.org>
Date: Thu, 08 Jul 2021 22:44:53 +0000

commit f17a73b3c0264c62dd6b5dae01ed621c051c3038
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:56:08 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jul 6 10:49:58 2021 +0100

    tools/migration: unify type checking for data pfns in migration stream
    
    Introduce a helper which decides if a given pfn type has data
    in the migration stream.
    
    No change in behaviour intended, except for invalid page types which now
    have a safer default.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 tools/libs/guest/xg_sr_common.h  | 27 +++++++++++++++++++++++++++
 tools/libs/guest/xg_sr_restore.c | 29 +++--------------------------
 tools/libs/guest/xg_sr_save.c    | 14 ++------------
 3 files changed, 32 insertions(+), 38 deletions(-)

diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index 7f4b0439f6..36d45ef56f 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -513,6 +513,33 @@ static inline bool page_type_to_populate(uint32_t type)
     }
 }
 
+static inline bool page_type_has_stream_data(uint32_t type)
+{
+    switch ( type )
+    {
+    case XEN_DOMCTL_PFINFO_NOTAB:
+
+    case XEN_DOMCTL_PFINFO_L1TAB:
+    case XEN_DOMCTL_PFINFO_L1TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_L2TAB:
+    case XEN_DOMCTL_PFINFO_L2TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_L3TAB:
+    case XEN_DOMCTL_PFINFO_L3TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+
+    case XEN_DOMCTL_PFINFO_L4TAB:
+    case XEN_DOMCTL_PFINFO_L4TAB | XEN_DOMCTL_PFINFO_LPINTAB:
+        return true;
+
+    case XEN_DOMCTL_PFINFO_XTAB:
+    case XEN_DOMCTL_PFINFO_BROKEN:
+    case XEN_DOMCTL_PFINFO_XALLOC:
+    default:
+        return false;
+    }
+}
+
 #endif
 /*
  * Local variables:
diff --git a/tools/libs/guest/xg_sr_restore.c b/tools/libs/guest/xg_sr_restore.c
index 3d63442d45..aa4113d7f6 100644
--- a/tools/libs/guest/xg_sr_restore.c
+++ b/tools/libs/guest/xg_sr_restore.c
@@ -231,25 +231,8 @@ static int process_page_data(struct xc_sr_context *ctx, unsigned int count,
     {
         ctx->restore.ops.set_page_type(ctx, pfns[i], types[i]);
 
-        switch ( types[i] )
-        {
-        case XEN_DOMCTL_PFINFO_NOTAB:
-
-        case XEN_DOMCTL_PFINFO_L1TAB:
-        case XEN_DOMCTL_PFINFO_L1TAB | XEN_DOMCTL_PFINFO_LPINTAB:
-
-        case XEN_DOMCTL_PFINFO_L2TAB:
-        case XEN_DOMCTL_PFINFO_L2TAB | XEN_DOMCTL_PFINFO_LPINTAB:
-
-        case XEN_DOMCTL_PFINFO_L3TAB:
-        case XEN_DOMCTL_PFINFO_L3TAB | XEN_DOMCTL_PFINFO_LPINTAB:
-
-        case XEN_DOMCTL_PFINFO_L4TAB:
-        case XEN_DOMCTL_PFINFO_L4TAB | XEN_DOMCTL_PFINFO_LPINTAB:
-
+        if ( page_type_has_stream_data(types[i]) )
             mfns[nr_pages++] = ctx->restore.ops.pfn_to_gfn(ctx, pfns[i]);
-            break;
-        }
     }
 
     /* Nothing to do? */
@@ -269,14 +252,8 @@ static int process_page_data(struct xc_sr_context *ctx, unsigned int count,
 
     for ( i = 0, j = 0; i < count; ++i )
     {
-        switch ( types[i] )
-        {
-        case XEN_DOMCTL_PFINFO_XTAB:
-        case XEN_DOMCTL_PFINFO_BROKEN:
-        case XEN_DOMCTL_PFINFO_XALLOC:
-            /* No page data to deal with. */
+        if ( !page_type_has_stream_data(types[i]) )
             continue;
-        }
 
         if ( map_errs[j] )
         {
@@ -411,7 +388,7 @@ static int handle_page_data(struct xc_sr_context *ctx, struct xc_sr_record *rec)
             goto err;
         }
 
-        if ( type < XEN_DOMCTL_PFINFO_BROKEN )
+        if ( page_type_has_stream_data(type) )
             /* NOTAB and all L1 through L4 tables (including pinned) should
              * have a page worth of data in the record. */
             pages_of_data++;
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index c84a073e86..3fce41b6cf 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -153,13 +153,8 @@ static int write_batch(struct xc_sr_context *ctx)
             goto err;
         }
 
-        switch ( types[i] )
-        {
-        case XEN_DOMCTL_PFINFO_BROKEN:
-        case XEN_DOMCTL_PFINFO_XALLOC:
-        case XEN_DOMCTL_PFINFO_XTAB:
+        if ( !page_type_has_stream_data(types[i]) )
             continue;
-        }
 
         mfns[nr_pages++] = mfns[i];
     }
@@ -177,13 +172,8 @@ static int write_batch(struct xc_sr_context *ctx)
 
         for ( i = 0, p = 0; i < nr_pfns; ++i )
         {
-            switch ( types[i] )
-            {
-            case XEN_DOMCTL_PFINFO_BROKEN:
-            case XEN_DOMCTL_PFINFO_XALLOC:
-            case XEN_DOMCTL_PFINFO_XTAB:
+            if ( !page_type_has_stream_data(types[i]) )
                 continue;
-            }
 
             if ( errors[p] )
             {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jul 08 22:45:04 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jul 2021 22:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153336.283284 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1clU-0004XQ-51; Thu, 08 Jul 2021 22:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153336.283284; Thu, 08 Jul 2021 22:45:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1clU-0004XI-0x; Thu, 08 Jul 2021 22:45:04 +0000
Received: by outflank-mailman (input) for mailman id 153336;
 Thu, 08 Jul 2021 22:45:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1clT-0004X9-5h
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:45:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1clT-00007r-4o
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:45:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1clT-0002oJ-3k
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EO8SqvzSmtl2mrNr17Aw/v2VaxoIVpieoAcgg+rlYmI=; b=1ehbqwalX7GXhE3bBBNkwxE4sL
	cqEapBMffpcW6Ou3AYtnKPiNyehzLmVYR2OhSbyQcLDdM0c+YojZg/V3vXSenzKSwaioFol9aXbiX
	ME86Leo9G+r8RIpL8lIpNmw2yWWCFoT+xsEYKjA+Av9WVRmzZvUjlSt3t83UN3CwbUWQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] IOMMU: make DMA containment of quarantined devices optional
Message-Id: <E1m1clT-0002oJ-3k@xenbits.xenproject.org>
Date: Thu, 08 Jul 2021 22:45:03 +0000

commit 980d6acf1517f0602e6dcf05ea922cf14c95e9c0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jul 7 12:32:45 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 7 12:32:45 2021 +0200

    IOMMU: make DMA containment of quarantined devices optional
    
    Containing still in flight DMA was introduced to work around certain
    devices / systems hanging hard upon hitting a "not-present" IOMMU fault.
    Passing through (such) devices (on such systems) is inherently insecure
    (as guests could easily arrange for IOMMU faults of any kind to occur).
    Defaulting to a mode where admins may not even become aware of issues
    with devices can be considered undesirable. Therefore convert this mode
    of operation to an optional one, not one enabled by default.
    
    This involves resurrecting code commit ea38867831da ("x86 / iommu: set
    up a scratch page in the quarantine domain") did remove, in a slightly
    extended and abstracted fashion. Here, instead of reintroducing a pretty
    pointless use of "goto" in domain_context_unmap(), and instead of making
    the function (at least temporarily) inconsistent, take the opportunity
    and replace the other similarly pointless "goto" as well.
    
    In order to key the re-instated bypasses off of there (not) being a root
    page table this further requires moving the allocate_domain_resources()
    invocation from reassign_device() to amd_iommu_setup_domain_device() (or
    else reassign_device() would allocate a root page table anyway); this is
    benign to the second caller of the latter function.
    
    In VT-d's domain_context_unmap(), instead of adding yet another
    "goto out" when all that's wanted is a "return", eliminate the "out"
    label at the same time.
    
    Take the opportunity and also limit the control to builds supporting
    PCI.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
---
 docs/misc/xen-command-line.pandoc           | 31 +++++++++++++---
 xen/drivers/passthrough/Kconfig             | 28 +++++++++++++++
 xen/drivers/passthrough/amd/pci_amd_iommu.c | 55 +++++++++++++++++------------
 xen/drivers/passthrough/iommu.c             | 23 ++++++++++--
 xen/drivers/passthrough/vtd/iommu.c         | 27 ++++++++------
 xen/include/xen/iommu.h                     |  4 ++-
 6 files changed, 127 insertions(+), 41 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 3ece83a427..b175645fde 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1364,7 +1364,7 @@ detection of systems known to misbehave upon accesses to that port.
 > Default: `new` unless directed-EOI is supported
 
 ### iommu
-    = List of [ <bool>, verbose, debug, force, required, quarantine,
+    = List of [ <bool>, verbose, debug, force, required, quarantine[=scratch-page],
                 sharept, intremap, intpost, crash-disable,
                 snoop, qinval, igfx, amd-iommu-perdev-intremap,
                 dom0-{passthrough,strict} ]
@@ -1402,11 +1402,32 @@ boolean (e.g. `iommu=no`) can override this and leave the IOMMUs disabled.
     will prevent Xen from booting if IOMMUs aren't discovered and enabled
     successfully.
 
-*   The `quarantine` boolean can be used to control Xen's behavior when
-    de-assigning devices from guests.  If enabled (the default), Xen always
+*   The `quarantine` option can be used to control Xen's behavior when
+    de-assigning devices from guests.
+
+    When a PCI device is assigned to an untrusted domain, it is possible
+    for that domain to program the device to DMA to an arbitrary address.
+    The IOMMU is used to protect the host from malicious DMA by making
+    sure that the device addresses can only target memory assigned to the
+    guest.  However, when the guest domain is torn down, assigning the
+    device back to the hardware domain would allow any in-flight DMA to
+    potentially target critical host data.  To avoid this, quarantining
+    should be enabled.  Quarantining can be done in two ways: In its basic
+    form, all in-flight DMA will simply be forced to encounter IOMMU
+    faults.  Since there are systems where doing so can cause host lockup,
+    an alternative form is available where writes to memory will be made
+    fault, but reads will be directed to a scratch page.  The implication
+    here is that such reads will go unnoticed, i.e. an admin may not
+    become aware of the underlying problem.
+
+    Therefore, if this option is set to true (the default), Xen always
     quarantines such devices; they must be explicitly assigned back to Dom0
-    before they can be used there again.  If disabled, Xen will only
-    quarantine devices the toolstack hass arranged for getting quarantined.
+    before they can be used there again.  If set to "scratch-page", still
+    active DMA reads will additionally be directed to a "scratch" page.  If
+    set to false, Xen will only quarantine devices the toolstack has arranged
+    for getting quarantined, and only in the "basic" form.
+
+    This option is only valid on builds supporting PCI.
 
 *   The `sharept` boolean controls whether the IOMMU pagetables are shared
     with the CPU-side HAP pagetables, or allocated separately.  Sharing
diff --git a/xen/drivers/passthrough/Kconfig b/xen/drivers/passthrough/Kconfig
index 82f02f56af..09505aa983 100644
--- a/xen/drivers/passthrough/Kconfig
+++ b/xen/drivers/passthrough/Kconfig
@@ -39,3 +39,31 @@ endif
 
 config IOMMU_FORCE_PT_SHARE
 	bool
+
+choice
+	prompt "IOMMU device quarantining default behavior"
+	depends on HAS_PCI
+	default IOMMU_QUARANTINE_BASIC
+	---help---
+	  When a PCI device is assigned to an untrusted domain, it is possible
+	  for that domain to program the device to DMA to an arbitrary address.
+	  The IOMMU is used to protect the host from malicious DMA by making
+	  sure that the device addresses can only target memory assigned to the
+	  guest.  However, when the guest domain is torn down, assigning the
+	  device back to the hardware domain would allow any in-flight DMA to
+	  potentially target critical host data.  To avoid this, quarantining
+	  should be enabled.  Quarantining can be done in two ways: In its basic
+	  form, all in-flight DMA will simply be forced to encounter IOMMU
+	  faults.  Since there are systems where doing so can cause host lockup,
+	  an alternative form is available where writes to memory will be made
+	  fault, but reads will be directed to a scratch page.  The implication
+	  here is that such reads will go unnoticed, i.e. an admin may not
+	  become aware of the underlying problem.
+
+	config IOMMU_QUARANTINE_NONE
+		bool "none"
+	config IOMMU_QUARANTINE_BASIC
+		bool "basic"
+	config IOMMU_QUARANTINE_SCRATCH_PAGE
+		bool "scratch page"
+endchoice
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 2dce505b97..8c0e6cfede 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -25,6 +25,9 @@
 #include "iommu.h"
 #include "../ats.h"
 
+/* dom_io is used as a sentinel for quarantined devices */
+#define QUARANTINE_SKIP(d) ((d) == dom_io && !dom_iommu(d)->arch.amd.root_table)
+
 static bool_t __read_mostly init_done;
 
 static const struct iommu_init_ops _iommu_init_ops;
@@ -81,19 +84,36 @@ int get_dma_requestor_id(uint16_t seg, uint16_t bdf)
     return req_id;
 }
 
-static void amd_iommu_setup_domain_device(
+static int __must_check allocate_domain_resources(struct domain *d)
+{
+    struct domain_iommu *hd = dom_iommu(d);
+    int rc;
+
+    spin_lock(&hd->arch.mapping_lock);
+    rc = amd_iommu_alloc_root(d);
+    spin_unlock(&hd->arch.mapping_lock);
+
+    return rc;
+}
+
+static int __must_check amd_iommu_setup_domain_device(
     struct domain *domain, struct amd_iommu *iommu,
     uint8_t devfn, struct pci_dev *pdev)
 {
     struct amd_iommu_dte *table, *dte;
     unsigned long flags;
-    int req_id, valid = 1;
+    int req_id, valid = 1, rc;
     u8 bus = pdev->bus;
-    const struct domain_iommu *hd = dom_iommu(domain);
+    struct domain_iommu *hd = dom_iommu(domain);
 
-    BUG_ON( !hd->arch.amd.root_table ||
-            !hd->arch.amd.paging_mode ||
-            !iommu->dev_table.buffer );
+    if ( QUARANTINE_SKIP(domain) )
+        return 0;
+
+    BUG_ON(!hd->arch.amd.paging_mode || !iommu->dev_table.buffer);
+
+    rc = allocate_domain_resources(domain);
+    if ( rc )
+        return rc;
 
     if ( iommu_hwdom_passthrough && is_hardware_domain(domain) )
         valid = 0;
@@ -153,6 +173,8 @@ static void amd_iommu_setup_domain_device(
 
         amd_iommu_flush_iotlb(devfn, pdev, INV_IOMMU_ALL_PAGES_ADDRESS, 0);
     }
+
+    return 0;
 }
 
 int __init acpi_ivrs_init(void)
@@ -224,18 +246,6 @@ int amd_iommu_alloc_root(struct domain *d)
     return 0;
 }
 
-static int __must_check allocate_domain_resources(struct domain *d)
-{
-    struct domain_iommu *hd = dom_iommu(d);
-    int rc;
-
-    spin_lock(&hd->arch.mapping_lock);
-    rc = amd_iommu_alloc_root(d);
-    spin_unlock(&hd->arch.mapping_lock);
-
-    return rc;
-}
-
 static int amd_iommu_domain_init(struct domain *d)
 {
     struct domain_iommu *hd = dom_iommu(d);
@@ -285,6 +295,9 @@ static void amd_iommu_disable_domain_device(const struct domain *domain,
     int req_id;
     u8 bus = pdev->bus;
 
+    if ( QUARANTINE_SKIP(domain) )
+        return;
+
     BUG_ON ( iommu->dev_table.buffer == NULL );
     req_id = get_dma_requestor_id(iommu->seg, PCI_BDF2(bus, devfn));
     table = iommu->dev_table.buffer;
@@ -354,11 +367,10 @@ static int reassign_device(struct domain *source, struct domain *target,
         pdev->domain = target;
     }
 
-    rc = allocate_domain_resources(target);
+    rc = amd_iommu_setup_domain_device(target, iommu, devfn, pdev);
     if ( rc )
         return rc;
 
-    amd_iommu_setup_domain_device(target, iommu, devfn, pdev);
     AMD_IOMMU_DEBUG("Re-assign %pp from dom%d to dom%d\n",
                     &pdev->sbdf, source->domain_id, target->domain_id);
 
@@ -465,8 +477,7 @@ static int amd_iommu_add_device(u8 devfn, struct pci_dev *pdev)
         amd_iommu_flush_device(iommu, bdf);
     }
 
-    amd_iommu_setup_domain_device(pdev->domain, iommu, devfn, pdev);
-    return 0;
+    return amd_iommu_setup_domain_device(pdev->domain, iommu, devfn, pdev);
 }
 
 static int amd_iommu_remove_device(u8 devfn, struct pci_dev *pdev)
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 879d238bcd..ab2ae61b11 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -31,9 +31,24 @@ bool_t __initdata iommu_enable = 1;
 bool_t __read_mostly iommu_enabled;
 bool_t __read_mostly force_iommu;
 bool_t __read_mostly iommu_verbose;
-bool __read_mostly iommu_quarantine = true;
 bool_t __read_mostly iommu_crash_disable;
 
+#define IOMMU_quarantine_none         0 /* aka false */
+#define IOMMU_quarantine_basic        1 /* aka true */
+#define IOMMU_quarantine_scratch_page 2
+#ifdef CONFIG_HAS_PCI
+uint8_t __read_mostly iommu_quarantine =
+# if defined(CONFIG_IOMMU_QUARANTINE_NONE)
+    IOMMU_quarantine_none;
+# elif defined(CONFIG_IOMMU_QUARANTINE_BASIC)
+    IOMMU_quarantine_basic;
+# elif defined(CONFIG_IOMMU_QUARANTINE_SCRATCH_PAGE)
+    IOMMU_quarantine_scratch_page;
+# endif
+#else
+# define iommu_quarantine IOMMU_quarantine_none
+#endif /* CONFIG_HAS_PCI */
+
 static bool __hwdom_initdata iommu_hwdom_none;
 bool __hwdom_initdata iommu_hwdom_strict;
 bool __read_mostly iommu_hwdom_passthrough;
@@ -64,8 +79,12 @@ static int __init parse_iommu_param(const char *s)
         else if ( (val = parse_boolean("force", s, ss)) >= 0 ||
                   (val = parse_boolean("required", s, ss)) >= 0 )
             force_iommu = val;
+#ifdef CONFIG_HAS_PCI
         else if ( (val = parse_boolean("quarantine", s, ss)) >= 0 )
             iommu_quarantine = val;
+        else if ( ss == s + 15 && !strncmp(s, "quarantine=scratch-page", 23) )
+            iommu_quarantine = IOMMU_quarantine_scratch_page;
+#endif
 #ifdef CONFIG_X86
         else if ( (val = parse_boolean("igfx", s, ss)) >= 0 )
             iommu_igfx = val;
@@ -432,7 +451,7 @@ static int __init iommu_quarantine_init(void)
     dom_io->options |= XEN_DOMCTL_CDF_iommu;
 
     rc = iommu_domain_init(dom_io, 0);
-    if ( rc )
+    if ( rc || iommu_quarantine < IOMMU_quarantine_scratch_page )
         return rc;
 
     if ( !hd->platform_ops->quarantine_init )
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 0f10951ce9..12d0d43d8e 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -42,6 +42,9 @@
 #include "vtd.h"
 #include "../ats.h"
 
+/* dom_io is used as a sentinel for quarantined devices */
+#define QUARANTINE_SKIP(d) ((d) == dom_io && !dom_iommu(d)->arch.vtd.pgd_maddr)
+
 struct mapped_rmrr {
     struct list_head list;
     u64 base, end;
@@ -1342,6 +1345,9 @@ int domain_context_mapping_one(
     int rc, ret;
     bool_t flush_dev_iotlb;
 
+    if ( QUARANTINE_SKIP(domain) )
+        return 0;
+
     ASSERT(pcidevs_locked());
     spin_lock(&iommu->lock);
     maddr = bus_to_context_maddr(iommu, bus);
@@ -1584,6 +1590,9 @@ int domain_context_unmap_one(
     int iommu_domid, rc, ret;
     bool_t flush_dev_iotlb;
 
+    if ( QUARANTINE_SKIP(domain) )
+        return 0;
+
     ASSERT(pcidevs_locked());
     spin_lock(&iommu->lock);
 
@@ -1658,7 +1667,7 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
 {
     struct acpi_drhd_unit *drhd;
     struct vtd_iommu *iommu;
-    int ret = 0;
+    int ret;
     u8 seg = pdev->seg, bus = pdev->bus, tmp_bus, tmp_devfn, secbus;
     int found = 0;
 
@@ -1673,14 +1682,12 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
         if ( iommu_debug )
             printk(VTDPREFIX "%pd:Hostbridge: skip %pp unmap\n",
                    domain, &PCI_SBDF3(seg, bus, devfn));
-        if ( !is_hardware_domain(domain) )
-            return -EPERM;
-        goto out;
+        return is_hardware_domain(domain) ? 0 : -EPERM;
 
     case DEV_TYPE_PCIe_BRIDGE:
     case DEV_TYPE_PCIe2PCI_BRIDGE:
     case DEV_TYPE_LEGACY_PCI_BRIDGE:
-        goto out;
+        return 0;
 
     case DEV_TYPE_PCIe_ENDPOINT:
         if ( iommu_debug )
@@ -1734,12 +1741,11 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
     default:
         dprintk(XENLOG_ERR VTDPREFIX, "%pd:unknown(%u): %pp\n",
                 domain, pdev->type, &PCI_SBDF3(seg, bus, devfn));
-        ret = -EINVAL;
-        goto out;
+        return -EINVAL;
     }
 
-    if ( ret )
-        goto out;
+    if ( ret || QUARANTINE_SKIP(domain) )
+        return ret;
 
     /*
      * if no other devices under the same iommu owned by this domain,
@@ -1764,8 +1770,7 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
         cleanup_domid_map(domain, iommu);
     }
 
-out:
-    return ret;
+    return 0;
 }
 
 static void iommu_clear_root_pgtable(struct domain *d)
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 03420cbea3..6b2cdffa4a 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -53,7 +53,9 @@ static inline bool_t dfn_eq(dfn_t x, dfn_t y)
 
 #ifdef CONFIG_HAS_PASSTHROUGH
 extern bool_t iommu_enable, iommu_enabled;
-extern bool force_iommu, iommu_quarantine, iommu_verbose;
+extern bool force_iommu, iommu_verbose;
+/* Boolean except for the specific purposes of drivers/passthrough/iommu.c. */
+extern uint8_t iommu_quarantine;
 #else
 #define iommu_enabled false
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jul 08 22:45:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jul 2021 22:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153339.283301 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1cle-0004uP-IA; Thu, 08 Jul 2021 22:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153339.283301; Thu, 08 Jul 2021 22:45:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1cle-0004uD-Ej; Thu, 08 Jul 2021 22:45:14 +0000
Received: by outflank-mailman (input) for mailman id 153339;
 Thu, 08 Jul 2021 22:45:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cld-0004tY-8f
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:45:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cld-00008H-7z
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:45:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cld-0002oo-78
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qPk6cPJvUtaBg4poSYCm83P3Dr6417p4Rxg9VN7BAJM=; b=LjrVGaFKUBHf4hSY0ZyCjV+7kT
	Gog5TC5hRDngMnySWZcZHMA2QwUW+aQoxbt55ioXtPu7pq5XMvnKjdZRBMEv2dmttG8gzETyr1qwM
	g6S0OosPzuAG6eiW7xjDrlFp3l13n4oXbuVf22+8vaQ3TAItz+y+4+kk63sVr7mu+rmI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mem-sharing: ensure consistent lock order in get_two_gfns()
Message-Id: <E1m1cld-0002oo-78@xenbits.xenproject.org>
Date: Thu, 08 Jul 2021 22:45:13 +0000

commit 09af2d01a2fe6a0af08598bdfe12c9707f4d82ba
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jul 7 12:35:12 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 7 12:35:12 2021 +0200

    x86/mem-sharing: ensure consistent lock order in get_two_gfns()
    
    While the comment validly says "Sort by domain, if same domain by gfn",
    the implementation also included equal domain IDs in the first part of
    the check, thus rending the second part entirely dead and leaving
    deadlock potential when there's only a single domain involved.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/include/asm-x86/p2m.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 5b697df573..e569471a2f 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -587,7 +587,7 @@ do {                                                    \
     dest ## _t   = (source ## t)   ?: &scratch_t;       \
 } while (0)
 
-    if ( (rd->domain_id <= ld->domain_id) ||
+    if ( (rd->domain_id < ld->domain_id) ||
          ((rd == ld) && (gfn_x(rgfn) <= gfn_x(lgfn))) )
     {
         assign_pointers(first, r);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jul 08 22:45:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jul 2021 22:45:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153341.283305 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1clo-00052i-Jc; Thu, 08 Jul 2021 22:45:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153341.283305; Thu, 08 Jul 2021 22:45:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1clo-00052Z-GD; Thu, 08 Jul 2021 22:45:24 +0000
Received: by outflank-mailman (input) for mailman id 153341;
 Thu, 08 Jul 2021 22:45:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cln-00050s-C5
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:45:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cln-00008W-BH
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:45:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cln-0002pQ-AQ
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:45: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SZL96VEdIKRTP8tDSx6Z7WimcXgdeR5BRE9dZ5hzgDg=; b=g85ZL3S4M3A45Qs+Cm6o/Erzvb
	hSKsAePGVHBOyGTCbsF28yXe8zUYrWrrojD+9JsFUhUpfLgNyZxStPT3V0RyWlMlCiTJ/e6fwqQes
	HK6P2wXPxG103U9HaHS+xQSHpLKReKpN2aeBsGaa/t78mkSCYatpJ720QnpiJAZMBnKI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mem-sharing: mov {get,put}_two_gfns()
Message-Id: <E1m1cln-0002pQ-AQ@xenbits.xenproject.org>
Date: Thu, 08 Jul 2021 22:45:23 +0000

commit b8d27e5b3391f4f90744f6ce75c02bd2661f7788
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jul 7 12:35:54 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 7 12:35:54 2021 +0200

    x86/mem-sharing: mov {get,put}_two_gfns()
    
    There's no reason for every CU including p2m.h to have these two
    functions compiled, when they're both mem-sharing specific right now and
    for the foreseeable future.
    
    Largely just code movement, with some style tweaks, the inline-s
    dropped, and "put" being made consistent with "get" as to their NULL
    checking of the passed in pointer to struct two_gfns.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/mm/mem_sharing.c | 60 +++++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/p2m.h     | 56 ----------------------------------------
 2 files changed, 60 insertions(+), 56 deletions(-)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 98b14f7b0a..8d5d44bdbc 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -432,6 +432,66 @@ static void mem_sharing_gfn_destroy(struct page_info *page, struct domain *d,
     xfree(gfn_info);
 }
 
+/* Deadlock-avoidance scheme when calling get_gfn on different gfn's */
+struct two_gfns {
+    struct domain *first_domain, *second_domain;
+    gfn_t          first_gfn,     second_gfn;
+};
+
+/*
+ * Returns mfn, type and access for potential caller consumption, but any
+ * of those can be NULL.
+ */
+static void get_two_gfns(struct domain *rd, gfn_t rgfn, p2m_type_t *rt,
+                         p2m_access_t *ra, mfn_t *rmfn,
+                         struct domain *ld, gfn_t lgfn, p2m_type_t *lt,
+                         p2m_access_t *la, mfn_t *lmfn,
+                         p2m_query_t q, struct two_gfns *rval, bool lock)
+{
+    mfn_t        *first_mfn, *second_mfn, scratch_mfn;
+    p2m_access_t *first_a, *second_a, scratch_a;
+    p2m_type_t   *first_t, *second_t, scratch_t;
+
+    /* Sort by domain, if same domain by gfn */
+
+#define assign_pointers(dest, source)                   \
+do {                                                    \
+    rval-> dest ## _domain = source ## d;               \
+    rval-> dest ## _gfn = source ## gfn;                \
+    dest ## _mfn = (source ## mfn) ?: &scratch_mfn;     \
+    dest ## _a   = (source ## a)   ?: &scratch_a;       \
+    dest ## _t   = (source ## t)   ?: &scratch_t;       \
+} while ( false )
+
+    if ( (rd->domain_id < ld->domain_id) ||
+         ((rd == ld) && (gfn_x(rgfn) <= gfn_x(lgfn))) )
+    {
+        assign_pointers(first, r);
+        assign_pointers(second, l);
+    }
+    else
+    {
+        assign_pointers(first, l);
+        assign_pointers(second, r);
+    }
+
+#undef assign_pointers
+
+    /* Now do the gets. */
+    *first_mfn  = __get_gfn_type_access(p2m_get_hostp2m(rval->first_domain),
+                                        gfn_x(rval->first_gfn), first_t,
+                                        first_a, q, NULL, lock);
+    *second_mfn = __get_gfn_type_access(p2m_get_hostp2m(rval->second_domain),
+                                        gfn_x(rval->second_gfn), second_t,
+                                        second_a, q, NULL, lock);
+}
+
+static void put_two_gfns(const struct two_gfns *arg)
+{
+    put_gfn(arg->second_domain, gfn_x(arg->second_gfn));
+    put_gfn(arg->first_domain,  gfn_x(arg->first_gfn));
+}
+
 static struct page_info *mem_sharing_lookup(unsigned long mfn)
 {
     struct page_info *page;
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index e569471a2f..d2e7a8db85 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -559,62 +559,6 @@ int altp2m_get_effective_entry(struct p2m_domain *ap2m, gfn_t gfn, mfn_t *mfn,
                                bool prepopulate);
 #endif
 
-/* Deadlock-avoidance scheme when calling get_gfn on different gfn's */
-struct two_gfns {
-    struct domain *first_domain, *second_domain;
-    gfn_t          first_gfn,     second_gfn;
-};
-
-/* Returns mfn, type and access for potential caller consumption, but any
- * of those can be NULL */
-static inline void get_two_gfns(struct domain *rd, gfn_t rgfn,
-        p2m_type_t *rt, p2m_access_t *ra, mfn_t *rmfn, struct domain *ld,
-        gfn_t lgfn, p2m_type_t *lt, p2m_access_t *la, mfn_t *lmfn,
-        p2m_query_t q, struct two_gfns *rval, bool lock)
-{
-    mfn_t           *first_mfn, *second_mfn, scratch_mfn;
-    p2m_access_t    *first_a, *second_a, scratch_a;
-    p2m_type_t      *first_t, *second_t, scratch_t;
-
-    /* Sort by domain, if same domain by gfn */
-
-#define assign_pointers(dest, source)                   \
-do {                                                    \
-    rval-> dest ## _domain = source ## d;               \
-    rval-> dest ## _gfn = source ## gfn;                \
-    dest ## _mfn = (source ## mfn) ?: &scratch_mfn;     \
-    dest ## _a   = (source ## a)   ?: &scratch_a;       \
-    dest ## _t   = (source ## t)   ?: &scratch_t;       \
-} while (0)
-
-    if ( (rd->domain_id < ld->domain_id) ||
-         ((rd == ld) && (gfn_x(rgfn) <= gfn_x(lgfn))) )
-    {
-        assign_pointers(first, r);
-        assign_pointers(second, l);
-    } else {
-        assign_pointers(first, l);
-        assign_pointers(second, r);
-    }
-
-#undef assign_pointers
-
-    /* Now do the gets */
-    *first_mfn  = __get_gfn_type_access(p2m_get_hostp2m(rval->first_domain),
-                                        gfn_x(rval->first_gfn), first_t, first_a, q, NULL, lock);
-    *second_mfn = __get_gfn_type_access(p2m_get_hostp2m(rval->second_domain),
-                                        gfn_x(rval->second_gfn), second_t, second_a, q, NULL, lock);
-}
-
-static inline void put_two_gfns(struct two_gfns *arg)
-{
-    if ( !arg )
-        return;
-
-    put_gfn(arg->second_domain, gfn_x(arg->second_gfn));
-    put_gfn(arg->first_domain,  gfn_x(arg->first_gfn));
-}
-
 /* Init the datastructures for later use by the p2m code */
 int p2m_init(struct domain *d);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jul 08 22:45:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jul 2021 22:45:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153342.283309 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1cly-0005CM-Kx; Thu, 08 Jul 2021 22:45:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153342.283309; Thu, 08 Jul 2021 22:45:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1cly-0005CD-Hg; Thu, 08 Jul 2021 22:45:34 +0000
Received: by outflank-mailman (input) for mailman id 153342;
 Thu, 08 Jul 2021 22:45:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1clx-0005Bz-FI
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:45:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1clx-00008l-EK
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:45:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1clx-0002qO-DV
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OeE8+cgIkGQ0SEgKLMJ3f8TPDWZNXWFvkWQ/z2o0fY0=; b=vUdBLsMY/O5s/HUZH+la4wEgTy
	+te7dfWL5ExTsBGfjdcwfX9ZO/VbnKwoATf3UvOk44/hZh5UoFrVAFJgJMmGLkYMmDZ2zI4/U1di7
	4VqQiEp4UCSS3PZwqe2dzH1RYnMPGvQ1x/T9njAfUDDig0JP7HfPg0fPXN4WnivB8y/E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xen-foreign: Update the size for vcpu_guest_{core_regs, context}
Message-Id: <E1m1clx-0002qO-DV@xenbits.xenproject.org>
Date: Thu, 08 Jul 2021 22:45:33 +0000

commit cc83cae4de8116c7a8c9c9510d6b117745f42ff5
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Tue Jul 6 14:20:00 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jul 7 13:07:46 2021 +0100

    tools/xen-foreign: Update the size for vcpu_guest_{core_regs, context}
    
    Commit 918b8842a852 ("arm64: Change type of hsr, cpsr, spsr_el1 to
    uint64_t") updated the size of the structure vcpu_guest_core_regs and
    indirectly vcpu_guest_context.
    
    On Arm, the two structures are only accessible to the tools and the
    hypervisor (and therefore stable). However, they are still checked
    by the scripts in tools/include/xen-foreign are not able to understand
    that.
    
    Ideally we should rework the scripts so we don't have to update
    the size for non-stable structure. But I don't have limited time
    to spend on the issue. So chose the simple solution and update
    the size accordingly.
    
    Note that we need to keep vcpu_guest_core_regs around because
    the structure is used by vcpu_guest_context and therefore the
    scripts expects the generated header to contain it.
    
    Fixes: 918b8842a852 ("arm64: Change type of hsr, cpsr, spsr_el1 to uint64_t")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@arm.com>
    Tested-by: Michal Orzel <michal.orzel@arm.com>
---
 tools/include/xen-foreign/reference.size | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/include/xen-foreign/reference.size b/tools/include/xen-foreign/reference.size
index a0409db5c4..11a06a7a43 100644
--- a/tools/include/xen-foreign/reference.size
+++ b/tools/include/xen-foreign/reference.size
@@ -4,8 +4,8 @@ structs                   |   arm32   arm64  x86_32  x86_64
 start_info                |       -       -    1112    1168
 trap_info                 |       -       -       8      16
 cpu_user_regs             |       -       -      68     200
-vcpu_guest_core_regs      |     304     304       -       -
-vcpu_guest_context        |     344     344    2800    5168
+vcpu_guest_core_regs      |     312     312       -       -
+vcpu_guest_context        |     352     352    2800    5168
 arch_vcpu_info            |       0       0      24      16
 vcpu_time_info            |      32      32      32      32
 vcpu_info                 |      48      48      64      64
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jul 08 22:45:44 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jul 2021 22:45:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153344.283313 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1cm8-0005Gq-Lv; Thu, 08 Jul 2021 22:45:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153344.283313; Thu, 08 Jul 2021 22:45:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1cm8-0005Gi-J6; Thu, 08 Jul 2021 22:45:44 +0000
Received: by outflank-mailman (input) for mailman id 153344;
 Thu, 08 Jul 2021 22:45:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cm7-0005GY-I5
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:45:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cm7-00008x-HN
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:45:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cm7-0002qx-Gf
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:45: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vWSJ6hijdyuhEoBp4wwKj/nOQ6y4+kGidrKXVvMEmG0=; b=XtGKoSYvEaSwhqlgEBWkUiHsfz
	NtvhnmqFf4WtCQNqXvKlbyYUW+VoVGZOJpmzQnLKkHHI22A9Y6wECD4CH1cv/qHp3IsUq9xtHyi6U
	iJQAgyNyDFdgi+85XFQg7gxqfi1fCf9k4t3FxjOECbSQ591aw6dSYNP5aUxh4PHRywEo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools: Fix CPSR/SPSR print size
Message-Id: <E1m1cm7-0002qx-Gf@xenbits.xenproject.org>
Date: Thu, 08 Jul 2021 22:45:43 +0000

commit 32cbc7f96ffa3ddceacb3812da0e31a82840b138
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Tue Jul 6 16:28:57 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jul 7 13:07:46 2021 +0100

    tools: Fix CPSR/SPSR print size
    
    918b8842a852 changed CPSR and SPSR to be stored as 64bit values.
    
    This is fixing the print size in some tools to use 64bit type.
    
    Fixes: 918b8842a852 ("arm64: Change type of hsr, cpsr, spsr_el1 to uint64_t")
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@arm.com>
    Tested-by: Michal Orzel <michal.orzel@arm.com>
---
 tools/libs/guest/xg_dom_arm.c | 4 ++--
 tools/xentrace/xenctx.c       | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/libs/guest/xg_dom_arm.c b/tools/libs/guest/xg_dom_arm.c
index 01e85e0ea9..5e3b76355e 100644
--- a/tools/libs/guest/xg_dom_arm.c
+++ b/tools/libs/guest/xg_dom_arm.c
@@ -140,7 +140,7 @@ static int vcpu_arm32(struct xc_dom_image *dom)
 
     ctxt->flags = VGCF_online;
 
-    DOMPRINTF("Initial state CPSR %#"PRIx32" PC %#"PRIx32,
+    DOMPRINTF("Initial state CPSR %#"PRIx64" PC %#"PRIx32,
            ctxt->user_regs.cpsr, ctxt->user_regs.pc32);
 
     rc = xc_vcpu_setcontext(dom->xch, dom->guest_domid, 0, &any_ctx);
@@ -182,7 +182,7 @@ static int vcpu_arm64(struct xc_dom_image *dom)
 
     ctxt->flags = VGCF_online;
 
-    DOMPRINTF("Initial state CPSR %#"PRIx32" PC %#"PRIx64,
+    DOMPRINTF("Initial state CPSR %#"PRIx64" PC %#"PRIx64,
            ctxt->user_regs.cpsr, ctxt->user_regs.pc64);
 
     rc = xc_vcpu_setcontext(dom->xch, dom->guest_domid, 0, &any_ctx);
diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index 972f473dbf..85ba0c0fa6 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -556,7 +556,7 @@ static void print_ctx_32(vcpu_guest_context_t *ctx)
     printf("PC:       %08"PRIx32, regs->pc32);
     print_symbol(regs->pc32, KERNEL_TEXT_ADDR);
     printf("\n");
-    printf("CPSR:     %08"PRIx32"\n", regs->cpsr);
+    printf("CPSR:     %08"PRIx64"\n", regs->cpsr);
     printf("USR:               SP:%08"PRIx32" LR:%08"PRIx32"\n",
            regs->sp_usr, regs->lr_usr);
     printf("SVC: SPSR:%08"PRIx32" SP:%08"PRIx32" LR:%08"PRIx32"\n",
@@ -614,8 +614,8 @@ static void print_ctx_64(vcpu_guest_context_t *ctx)
     printf("LR:       %016"PRIx64"\n", regs->x30);
     printf("ELR_EL1:  %016"PRIx64"\n", regs->elr_el1);
 
-    printf("CPSR:     %08"PRIx32"\n", regs->cpsr);
-    printf("SPSR_EL1: %08"PRIx32"\n", regs->spsr_el1);
+    printf("CPSR:     %08"PRIx64"\n", regs->cpsr);
+    printf("SPSR_EL1: %08"PRIx64"\n", regs->spsr_el1);
 
     printf("SP_EL0:   %016"PRIx64"\n", regs->sp_el0);
     printf("SP_EL1:   %016"PRIx64"\n", regs->sp_el1);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jul 08 22:45:55 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jul 2021 22:45:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153345.283317 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1cmJ-0005KI-Nq; Thu, 08 Jul 2021 22:45:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153345.283317; Thu, 08 Jul 2021 22:45:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1cmJ-0005KA-KZ; Thu, 08 Jul 2021 22:45:55 +0000
Received: by outflank-mailman (input) for mailman id 153345;
 Thu, 08 Jul 2021 22:45:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cmH-0005Jm-LC
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:45:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cmH-00009Q-KW
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:45:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cmH-0002ru-Jf
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:45: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=janXWvLRigqz2kcKa2NerOieRfllydOH4u7/PYjafpY=; b=FQ4oGyOffyZdvV9kaqqXffOLGO
	/wKXUflgYgqlHsPbWyXl6HJ17bJ1YUq3MNnZS9mocojhOsE47elJrwkBRotz/C68x+PTvQpp48J5n
	T8xn7I0N9IAeCoZ5O7NwpElsWye5PB+B+GyTq6GCmpMTk/1uCOnu6H5fY7k3VxsXpeJM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm: Fix arch_initialise_vcpu to be unsupported
Message-Id: <E1m1cmH-0002ru-Jf@xenbits.xenproject.org>
Date: Thu, 08 Jul 2021 22:45:53 +0000

commit 63fdea768d175e96443a53b95a6441f520743e2e
Author:     Michal Orzel <michal.orzel@arm.com>
AuthorDate: Tue Jul 6 12:28:53 2021 +0200
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Jul 7 14:05:40 2021 +0100

    arm: Fix arch_initialise_vcpu to be unsupported
    
    Function arch_initialise_vcpu is not reachable as the
    VCPUOP_initialise is an unsupported operation on arm.
    Modify the function by adding ASSERT_UNREACHABLE() and
    returning -EOPNOTSUPP.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Michal Orzel <michal.orzel@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/domain.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 74bdbb9082..19c756ac3d 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -923,7 +923,8 @@ int arch_set_info_guest(
 
 int arch_initialise_vcpu(struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
-    return default_initialise_vcpu(v, arg);
+    ASSERT_UNREACHABLE();
+    return -EOPNOTSUPP;
 }
 
 int arch_vcpu_reset(struct vcpu *v)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jul 08 22:46:05 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jul 2021 22:46:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153347.283321 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1cmT-0005Or-PY; Thu, 08 Jul 2021 22:46:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153347.283321; Thu, 08 Jul 2021 22:46:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1cmT-0005Oj-M6; Thu, 08 Jul 2021 22:46:05 +0000
Received: by outflank-mailman (input) for mailman id 153347;
 Thu, 08 Jul 2021 22:46:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cmR-0005OI-OT
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:46:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cmR-00009p-Ni
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:46:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cmR-0002sm-Mt
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=iDK9/KUQxAi4ZHuHBZRJCeTiz3iITxa7PUC+NeYzKik=; b=MkSLeKKSFu4EJ7pXVj+s1EGNnG
	Dsbc/lyUObZ0XYY6pFz+dBjuZKpCJKSp8F56eLEP9fAL+vDNVSDKp9mTCCzdIRFYWHnt6MPiy9ipC
	Qq2TiRBMyMpLkXHpcTdG1/2CqsbBJnGRnT3xhC1fo8bMTXe33pB0DlktoGtFWlQD6XKE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: smmuv1: Switch from kzalloc_array(..) to devm_kcalloc(..)
Message-Id: <E1m1cmR-0002sm-Mt@xenbits.xenproject.org>
Date: Thu, 08 Jul 2021 22:46:03 +0000

commit e362d3276d40e4f370c92eaa6c0e84e34badb92b
Author:     Rahul Singh <rahul.singh@arm.com>
AuthorDate: Tue Jul 6 11:53:59 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Jul 7 14:08:15 2021 +0100

    xen/arm: smmuv1: Switch from kzalloc_array(..) to devm_kcalloc(..)
    
    Switch from kzalloc_array(..) to devm_kcalloc(..) when allocating the
    SMR to make code coherent.
    
    Signed-off-by: Rahul Singh <rahul.singh@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/drivers/passthrough/arm/smmu.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index da2cd457d7..658c40433c 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -149,7 +149,8 @@ typedef enum irqreturn irqreturn_t;
 #define kzalloc(size, flags)		_xzalloc(size, sizeof(void *))
 #define devm_kzalloc(dev, size, flags)	_xzalloc(size, sizeof(void *))
 #define kmalloc_array(size, n, flags)	_xmalloc_array(size, sizeof(void *), n)
-#define kzalloc_array(size, n, flags)	_xzalloc_array(size, sizeof(void *), n)
+#define devm_kcalloc(dev, n, size, flags)			\
+	_xzalloc_array(size, sizeof(void *), n)
 
 static void __iomem *devm_ioremap_resource(struct device *dev,
 					   struct resource *res)
@@ -2222,7 +2223,8 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu)
 		smmu->smr_mask_mask = smr >> SMR_MASK_SHIFT;
 
 		/* Zero-initialised to mark as invalid */
-		smmu->smrs = kzalloc_array(sizeof(*smmu->smrs), size, GFP_KERNEL);
+		smmu->smrs = devm_kcalloc(smmu->dev, size, sizeof(*smmu->smrs),
+								GFP_KERNEL);
 		if (!smmu->smrs)
 			return -ENOMEM;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jul 08 22:46:15 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jul 2021 22:46:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153349.283325 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1cmd-0005SW-Qo; Thu, 08 Jul 2021 22:46:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153349.283325; Thu, 08 Jul 2021 22:46:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1cmd-0005SO-Ne; Thu, 08 Jul 2021 22:46:15 +0000
Received: by outflank-mailman (input) for mailman id 153349;
 Thu, 08 Jul 2021 22:46:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cmb-0005Rb-RX
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:46:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cmb-0000A1-Qp
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:46:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cmb-0002tZ-Px
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:46: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=73PLlIMoN6oTWJvxkOf3JnhAqwef8AGFtUfzF2Oc2jY=; b=NXqESoYmW8g1B8epoznG2mw6sD
	2/Zsof9PTwG8vNbDLiSWYUFYrfE1sEDfo+ye7p6UDCoY2gBI3HlAtQRukOnyQtwJr8q1jMdidSZui
	3311JOxFtlAR+FT/Hpd3lxMWL2TuBYT5HjIvZ3GhDDArldfM6ItTgSAvT3oeQZmQzMTY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] build: clean "lib.a"
Message-Id: <E1m1cmb-0002tZ-Px@xenbits.xenproject.org>
Date: Thu, 08 Jul 2021 22:46:13 +0000

commit 3ce2765ac21dbd739e8216694b025aaabf4afff3
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed Jul 7 17:51:18 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 7 17:51:18 2021 +0200

    build: clean "lib.a"
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index 89879fad4c..b0e47a8c75 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -343,7 +343,7 @@ _clean: delete-unfresh-files
 	$(MAKE) $(clean) test
 	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) clean
 	find . \( -name "*.o" -o -name ".*.d" -o -name ".*.d2" \
-		-o -name "*.gcno" -o -name ".*.cmd" \) -exec rm -f {} \;
+		-o -name "*.gcno" -o -name ".*.cmd" -o -name "lib.a" \) -exec rm -f {} \;
 	rm -f include/asm $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET).efi.map $(TARGET)-syms $(TARGET)-syms.map *~ core
 	rm -f asm-offsets.s include/asm-*/asm-offsets.h
 	rm -f .banner
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jul 08 22:46:25 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jul 2021 22:46:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153350.283329 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1cmn-0005W4-TR; Thu, 08 Jul 2021 22:46:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153350.283329; Thu, 08 Jul 2021 22:46:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1cmn-0005Vw-QX; Thu, 08 Jul 2021 22:46:25 +0000
Received: by outflank-mailman (input) for mailman id 153350;
 Thu, 08 Jul 2021 22:46:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cml-0005Vh-Uc
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:46:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cml-0000AY-Tv
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:46:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cml-0002u9-T7
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:46: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>
DKIM-Signature: v=1; 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+afNxIYAKV0NVCxh0k8S1YNjcobIqEtZyT3NRvPK/U=; b=A64k4vuqOZ8JAh2n/5nlfZuuGc
	RvA3B8+gLgCP4JV0mPVHKoNSjMNt0LPy/vpNtGXhJe4sgfI19XQjkPFP6W+Eo2WeFhDi+Hyd25xR3
	4L1UC/+u/cbc5ktRBoLwWjAU9CJjTLvRwnjPQISfIorVWpm3o3Doo0c2f8vABQlGzVGw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] build: use $(kconfig) shortcut in clean rule
Message-Id: <E1m1cml-0002u9-T7@xenbits.xenproject.org>
Date: Thu, 08 Jul 2021 22:46:23 +0000

commit ad76d87d65e1fd2ec3b08699d6dcfb0d2a9441c1
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed Jul 7 17:51:34 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 7 17:51:34 2021 +0200

    build: use $(kconfig) shortcut in clean rule
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index b0e47a8c75..8023680ffb 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -341,7 +341,7 @@ _clean: delete-unfresh-files
 	$(MAKE) $(clean) arch/riscv
 	$(MAKE) $(clean) arch/x86
 	$(MAKE) $(clean) test
-	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) clean
+	$(MAKE) $(kconfig) clean
 	find . \( -name "*.o" -o -name ".*.d" -o -name ".*.d2" \
 		-o -name "*.gcno" -o -name ".*.cmd" -o -name "lib.a" \) -exec rm -f {} \;
 	rm -f include/asm $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET).efi.map $(TARGET)-syms $(TARGET)-syms.map *~ core
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jul 08 22:46:35 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jul 2021 22:46:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153352.283333 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1cmx-0005Zi-Uu; Thu, 08 Jul 2021 22:46:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153352.283333; Thu, 08 Jul 2021 22:46:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1cmx-0005ZZ-Rw; Thu, 08 Jul 2021 22:46:35 +0000
Received: by outflank-mailman (input) for mailman id 153352;
 Thu, 08 Jul 2021 22:46:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cmw-0005ZJ-1Y
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:46:34 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cmw-0000Ao-0h
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:46:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1cmv-0002uk-W5
 for xen-changelog@lists.xenproject.org; Thu, 08 Jul 2021 22:46: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aLggZQ9bg3ydUaiRbDTf0dhiZ2jVeBwB+UeDt10ei5k=; b=HN3ixu3dwcv/sMe1DVtFoQJrS9
	I7rLi0hjFxUMX/mCGWyMlZ4lK80y4S2fbTgukiRD7WTZyym1Jx19tPTRBaiJ1x1btP25fqk77xqKD
	JSDnEdQzPtcGde7Cq/RDDNanx0q3nIy5MyJvPDBtmM9yauQSMKsHKtPyJNbcdjp/p5G8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] build,tools: have default rules depends on symbols
Message-Id: <E1m1cmv-0002uk-W5@xenbits.xenproject.org>
Date: Thu, 08 Jul 2021 22:46:33 +0000

commit 484910bf41fec2c80d79ed9c5c33831bee7318f0
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed Jul 7 17:51:49 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jul 7 17:51:49 2021 +0200

    build,tools: have default rules depends on symbols
    
    No need to call $(MAKE) again.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/tools/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/tools/Makefile b/xen/tools/Makefile
index e940939d61..4e42163f98 100644
--- a/xen/tools/Makefile
+++ b/xen/tools/Makefile
@@ -2,8 +2,7 @@
 include $(XEN_ROOT)/Config.mk
 
 .PHONY: default
-default:
-	$(MAKE) symbols
+default: symbols
 
 .PHONY: clean
 clean:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 06:33:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 06:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153415.283446 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1k4R-0002VQ-9o; Fri, 09 Jul 2021 06:33:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153415.283446; Fri, 09 Jul 2021 06:33:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1k4R-0002VH-5h; Fri, 09 Jul 2021 06:33:07 +0000
Received: by outflank-mailman (input) for mailman id 153415;
 Fri, 09 Jul 2021 06:33:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1k4P-0002VB-DW
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 06:33:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1k4P-0001xF-9B
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 06:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1k4P-0000f3-81
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 06: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NE8KYntO1Ztj3MKCixKQ2jv8sj6oDlo3tIxhJvKRxlY=; b=3NxiQyXug4eCzFUdljVyX7z2Jt
	AMIQ98HDPHTTBqWmJCHjJ657etc5UOAQKxy2bRyvdG+nsm4Fvpk6ri4v+E+PsncImsqd1In7Hhr0X
	CzqsfIyz0GTwFfSVkpyJ9BqK6KIg1uWI2n0fc1Qk4C/cuEessWpoPssXMz1rnF9SE/mU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] docs/designs/launch: Hyperlaunch design document
Message-Id: <E1m1k4P-0000f3-81@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 06:33:05 +0000

commit d4f3125f1bb4683a61a47d281ac5effa0740e79b
Author:     Daniel P. Smith <dpsmith@apertussolutions.com>
AuthorDate: Fri Jul 9 08:19:47 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 9 08:21:45 2021 +0200

    docs/designs/launch: Hyperlaunch design document
    
    Adds a design document for Hyperlaunch, formerly DomB mode of dom0less.
    
    Signed-off-by: Christopher Clark <christopher.clark@starlab.io>
    Signed-off by: Daniel P. Smith <dpsmith@apertussolutions.com>
    Reviewed-by: Rich Persaud <rp@stacktrust.org>
---
 docs/designs/launch/hyperlaunch.rst | 1004 +++++++++++++++++++++++++++++++++++
 1 file changed, 1004 insertions(+)

diff --git a/docs/designs/launch/hyperlaunch.rst b/docs/designs/launch/hyperlaunch.rst
new file mode 100644
index 0000000000..4c138da884
--- /dev/null
+++ b/docs/designs/launch/hyperlaunch.rst
@@ -0,0 +1,1004 @@
+###########################
+Hyperlaunch Design Document
+###########################
+
+.. sectnum:: :depth: 4
+
+This post is a Request for Comment on the included v4 of a design document that
+describes Hyperlaunch: a new method of launching the Xen hypervisor, relating
+to dom0less and work from the Hyperlaunch project. We invite discussion of this
+on this list, at the monthly Xen Community Calls, and at dedicated meetings on
+this topic in the Xen Working Group which will be announced in advance on the
+Xen Development mailing list.
+
+
+.. contents:: :depth: 3
+
+
+Introduction
+============
+
+This document describes the design and motivation for the funded development of
+a new, flexible system for launching the Xen hypervisor and virtual machines
+named: "Hyperlaunch".
+
+The design enables seamless transition for existing systems that require a
+dom0, and provides a new general capability to build and launch alternative
+configurations of virtual machines, including support for static partitioning
+and accelerated start of VMs during host boot, while adhering to the principles
+of least privilege. It incorporates the existing dom0less functionality,
+extended to fold in the new developments from the Hyperlaunch project, with
+support for both x86 and Arm platform architectures, building upon and
+replacing the earlier 'late hardware domain' feature for disaggregation of
+dom0.
+
+Hyperlaunch is designed to be flexible and reusable across multiple use cases,
+and our aim is to ensure that it is capable, widely exercised, comprehensively
+tested, and well understood by the Xen community.
+
+Document Structure
+==================
+
+This is the primary design document for Hyperlaunch, to provide an overview of
+the feature. Separate additional documents will cover specific aspects of
+Hyperlaunch in further detail, including:
+
+  - The Device Tree specification for Hyperlaunch metadata
+  - New Domain Roles for Xen and the Xen Security Modules (XSM) policy
+  - Passthrough of PCI devices with Hyperlaunch
+
+Approach
+========
+
+Born out of improving support for Dynamic Root of Trust for Measurement (DRTM),
+the Hyperlaunch project is focused on restructuring the system launch of Xen.
+The Hyperlaunch design provides a security architecture that builds on the
+principles of Least Privilege and Strong Isolation, achieving this through the
+disaggregation of system functions. It enables this with the introduction of a
+boot domain that works in conjunction with the hypervisor to provide the
+ability to launch multiple domains as part of host boot while maintaining a
+least privilege implementation.
+
+While the Hyperlaunch project inception was and continues to be driven by a
+focus on security through disaggregation, there are multiple use cases with a
+non-security focus that require or benefit from the ability to launch multiple
+domains at host boot. This was proven by the need that drove the implementation
+of the dom0less capability in the Arm branch of Xen.
+
+Hyperlaunch is designed to be flexible and reusable across multiple use cases,
+and our aim is to ensure that it is capable, widely exercised, comprehensively
+tested, and provides a robust foundation for current and emerging system launch
+requirements of the Xen community.
+
+
+Objectives
+----------
+
+* In general strive to maintain compatibility with existing Xen behavior
+* A default build of the hypervisor should be capable of booting both legacy-compatible and new styles of launch:
+
+        * classic Xen boot: starting a single, privileged Dom0
+        * classic Xen boot with late hardware domain: starting a Dom0 that transitions hardware access/control to another domain
+        * a dom0less boot: starting multiple domains without privilege assignment controls
+        * Hyperlaunch: starting one or more VMs, with flexible configuration
+
+* Preferred that it be managed via KCONFIG options to govern inclusion of support for each style
+* The selection between classic boot and Hyperlaunch boot should be automatic
+
+        * Preferred that it not require a kernel command line parameter for selection
+
+* It should not require modification to boot loaders
+* It should provide a user friendly interface for its configuration and management
+* It must provide a method for building systems that fallback to console access in the event of misconfiguration
+* It should be able to boot an x86 Xen environment without the need for a Dom0 domain
+
+
+Requirements and Design
+=======================
+
+Hyperlaunch is defined as the ability of a hypervisor to construct and start
+one or more virtual machines at system launch in a specific way. A hypervisor
+can support one or both modes of configuration, Hyperlaunch Static and
+Hyperlaunch Dynamic. The Hyperlaunch Static mode functions as a static
+partitioning hypervisor ensuring only the virtual machines started at system
+launch are running on the system. The Hyperlaunch Dynamic mode functions as a
+dynamic hypervisor allowing for additional virtual machines to be started after
+the initial virtual machines have started. The Xen hypervisor is capable of
+both modes of configuration from the same binary and when paired with its XSM
+flask, provides strong controls that enable fine grained system partitioning.
+
+Hypervisor Launch Landscape
+---------
+
+This comparison table presents the distinctive capabilities of Hyperlaunch with
+reference to existing launch configurations currently available in Xen and
+other hypervisors.
+
+::
+
+ +---------------+-----------+------------+-----------+-------------+---------------------+
+ | **Xen Dom0**  | **Linux** | **Late**   | **Jail**  | **Xen**     | **Xen Hyperlaunch** |
+ | **(Classic)** | **KVM**   | **HW Dom** | **house** | **dom0less**+---------+-----------+
+ |               |           |            |           |             | Static  | Dynamic   |
+ +===============+===========+============+===========+=============+=========+===========+
+ | Hypervisor able to launch multiple VMs during host boot                                |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |            |     Y     |       Y     |    Y    |     Y     |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | Hypervisor supports Static Partitioning                                                |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |            |     Y     |       Y     |    Y    |           |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | Able to launch VMs dynamically after host boot                                         |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |       Y       |     Y     |      Y*    |     Y     |       Y*    |         |     Y     |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | Supports strong isolation between all VMs started at host boot                         |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |            |     Y     |       Y     |    Y    |     Y     |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | Enables flexible sequencing of VM start during host boot                               |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |            |           |             |    Y    |     Y     |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | Prevent all-powerful static root domain being launched at boot                         |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |            |           |       Y*    |    Y    |     Y     |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | Operates without a Highly-privileged management VM (eg. Dom0)                          |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |      Y*    |           |       Y*    |    Y    |     Y     |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | Operates without a privileged toolstack VM (Control Domain)                            |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |            |           |       Y*    |    Y    |           |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | Extensible VM configuration applied before launch of VMs at host boot                  |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |            |           |             |    Y    |     Y     |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | Flexible granular assignment of permissions and functions to VMs                       |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |            |           |             |    Y    |     Y     |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | Supports extensible VM measurement architecture for DRTM and attestation               |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |            |           |             |    Y    |     Y     |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | PCI passthrough configured at host boot                                                |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |            |           |             |    Y    |     Y     |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+
+
+Domain Construction
+-------------------
+
+An important aspect of the Hyperlaunch architecture is that the hypervisor
+performs domain construction for all the Initial Domains,  ie. it builds each
+domain that is described in the Launch Control Module. More specifically, the
+hypervisor will perform the function of *domain creation* for each Initial
+Domain: it allocates the unique domain identifier assigned to the virtual
+machine and records essential metadata about it in the internal data structure
+that enables scheduling the domain to run. It will also perform *basic domain
+construction*: build the initial page tables with data from the kernel and
+initial ramdisk supplied, and as appropriate for the domain type, populate the
+p2m table and ACPI tables.
+
+Subsequent to this, the boot domain can apply additional configuration to the
+initial domains from the data in the LCM, in *extended domain construction*.
+
+The benefits of this structure include:
+
+* Security: Contrains the permissions required by the boot domain: it does not
+  require the capability to create domains in this structure. This aligns with
+  the principles of least privilege.
+* Flexibility: Enables policy-based dynamic assignment of hardware by the boot
+  domain, customizable according to use-case and able to adapt to hardware
+  discovery
+* Compatibility: Supports reuse of familiar tools with use-case customized boot
+  domains.
+* Commonality: Reuses the same logic for initial basic domain building across
+  diverse Xen deployments.
+	* It aligns the x86 initial domain construction with the existing Arm
+	  dom0less feature for construction of multiple domains at boot.
+	* The boot domain implementation may vary significantly with different
+	  deployment use cases, whereas the hypervisor implementation is
+	  common.
+* Correctness: Increases confidence in the implementation of domain
+  construction, since it is performed by the hypervisor in well maintained and
+  centrally tested logic.
+* Performance: Enables launch for configurations where a fast start of
+  multiple domains at boot is a requirement.
+* Capability: Supports launch of advanced configurations where a sequenced
+  start of multiple domains is required, or multiple domains are involved in
+  startup of the running system configuration
+	* eg. for PCI passthrough on systems where the toolstack runs in a
+	  separate domain to the hardware management.
+
+Please, see the ‘Hyperlaunch Device Tree’ design document, which describes the
+configuration module that is provided to the hypervisor by the bootloader.
+
+The hypervisor determines how these domains are started as host boot completes:
+in some systems the Boot Domain acts upon the extended boot configuration
+supplied as part of launch, performing configuration tasks for preparing the
+other domains for the hypervisor to commence running them.
+
+Common Boot Configurations
+--------------------------
+
+When looking across those that have expressed interest or discussed a need for
+launching multiple domains at host boot, the Hyperlaunch approach is to provide
+the means to start nearly any combination of domains. Below is an enumerated
+selection of common boot configurations for reference in the following section.
+
+Dynamic Launch with a Highly-Privileged Domain 0
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Hyperlaunch Classic: Dom0
+        This configuration mimics the classic Xen start and domain construction
+        where a single domain is constructed with all privileges and functions for
+        managing hardware and running virtualization toolstack software.
+
+Hyperlaunch Classic: Extended Launch Dom0
+        This configuration is where a Dom0 is started via a Boot Domain that runs
+        first. This is for cases where some preprocessing in a less privileged domain
+        is required before starting the all-privileged Domain 0.
+
+Hyperlaunch Classic: Basic Cloud
+        This configuration constructs a Dom0 that is started in parallel with some
+        number of workload domains.
+
+Hyperlaunch Classic: Cloud
+        This configuration builds a Dom0 and some number of workload domains, launched
+        via a Boot Domain that runs first.
+
+
+Static Launch Configurations: without a Domain 0 or a Control Domain
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Hyperlaunch Static: Basic
+        Simple static partitioning where all domains that can be run on this system are
+        built and started during host boot and where no domain is started with the
+        Control Domain permissions, thus making it not possible to create/start any
+        further new domains.
+
+Hyperlaunch Static: Standard
+        This is a variation of the “Hyperlaunch Static: Basic” static partitioning
+        configuration with the introduction of a Boot Domain. This configuration allows
+        for use of a Boot Domain to be able to apply extended configuration
+        to the Initial Domains before they are started and
+        sequence the order in which they start.
+
+Hyperlaunch Static: Disaggregated
+        This is a variation of the “Hyperlaunch Static: Standard” configuration with
+        the introduction of a Boot Domain and an illustration that some functions can
+        be disaggregated to dedicated domains.
+
+Dynamic Launch of Disaggregated System Configurations
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Hyperlaunch Dynamic: Hardware Domain
+        This configuration mimics the existing Xen feature late hardware domain with
+        the one difference being that the hardware domain is constructed by the
+        hypervisor at startup instead of later by Dom0.
+
+Hyperlaunch Dynamic: Flexible Disaggregation
+        This configuration is similar to the “Hyperlaunch Classic: Dom0” configuration
+        except that it includes starting a separate hardware domain during Xen startup.
+        It is also similar to “Hyperlaunch Dynamic: Hardware Domain” configuration, but
+        it launches via a Boot Domain that runs first.
+
+Hyperlaunch Dynamic: Full Disaggregation
+        In this configuration it is demonstrated how it is possible to start a fully
+        disaggregated system: the virtualization toolstack runs in a Control Domain,
+        separate from the domains responsible for managing hardware, XenStore, the Xen
+        Console and Crash functions, each launched via a Boot Domain.
+
+
+Example Use Cases and Configurations
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The following example use cases can be matched to configurations listed in the
+previous section.
+
+Use case: Modern cloud hypervisor
+"""""""""""""""""""""""""""""""""
+
+**Option:** Hyperlaunch Classic: Cloud
+
+This configuration will support strong isolation for virtual TPM domains and
+measured launch in support of attestation to infrastructure management, while
+allowing the use of existing Dom0 virtualization toolstack software.
+
+Use case: Edge device with security or safety requirements
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+**Option:** Hyperlaunch Static: Boot
+
+This configuration runs without requiring a highly-privileged Dom0, and enables
+extended VM configuration to be applied to the Initial VMs prior to launching
+them, optionally in a sequenced start.
+
+Use case: Client hypervisor
+"""""""""""""""""""""""""""
+
+**Option:** Hyperlaunch Dynamic: Flexible Disaggregation
+
+**Option:** Hyperlaunch Dynamic: Full Disaggregation
+
+These configurations enable dynamic client workloads, strong isolation for the
+domain running the virtualization toolstack software and each domain managing
+hardware, with PCI passthrough performed during host boot and support for
+measured launch.
+
+Hyperlaunch Disaggregated Launch
+--------------------------------
+
+
+Existing in Xen today are two primary permissions, *control domain* and
+*hardware domain*, and two functions, *console domain* and *xenstore domain*,
+that can be assigned to a domain. Traditionally all of these permissions and
+functions are all assigned to Dom0 at start and can then be delegated to other
+domains created by the toolstack in Dom0. With Hyperlaunch it becomes possible
+to assign these permissions and functions to any domain for which there is a
+definition provided at startup.
+
+Additionally, two further functions are introduced: the *recovery domain*,
+intended to assist with recovery from failures encountered starting VMs during
+host boot, and the *boot domain*, for performing aspects of domain construction
+during startup.
+
+Supporting the booting of each of the above common boot configurations is
+accomplished by considering the set of initial domains and the assignment of
+Xen’s permissions and functions, including the ones introduced by Hyperlaunch,
+to these domains. A discussion of these will be covered later but for now they
+are laid out in a table with a mapping to the common boot configurations. This
+table is not intended to be an exhaustive list of configurations and does not
+account for flask policy specified functions that are use case specific.
+
+In the table each number represents a separate domain being
+constructed by the Hyperlaunch construction path as Xen starts, and the
+designator, ``{n}`` signifies that there may be “n” additional domains that may
+be constructed that do not have any special role for a general Xen system.
+
+::
+
+ +-------------------+------------------+-----------------------------------+
+ | Configuration     |    Permission    |            Function               |
+ |                   +------+------+----+------+--------+--------+----------+
+ |                   | None | Ctrl | HW | Boot |Recovery| Console| Xenstore |
+ +===================+======+======+====+======+========+========+==========+
+ | Classic: Dom0     |      |  0   | 0  |      |   0    |   0    |    0     |
+ +-------------------+------+------+----+------+--------+--------+----------+
+ | Classic: Extended |      |  1   | 1  |  0   |   1    |   1    |    1     |
+ | Launch Dom0       |      |      |    |      |        |        |          |
+ +-------------------+------+------+----+------+--------+--------+----------+
+ | Classic:          | {n}  |  0   | 0  |      |   0    |   0    |    0     |
+ | Basic Cloud       |      |      |    |      |        |        |          |
+ +-------------------+------+------+----+------+--------+--------+----------+
+ | Classic: Cloud    | {n}  |  1   | 1  |  0   |   1    |   1    |    1     |
+ +-------------------+------+------+----+------+--------+--------+----------+
+ | Static: Basic     | {n}  |      | 0  |      |   0    |   0    |    0     |
+ +-------------------+------+------+----+------+--------+--------+----------+
+ | Static: Standard  | {n}  |      | 1  |  0   |   1    |   1    |    1     |
+ +-------------------+------+------+----+------+--------+--------+----------+
+ | Static:           | {n}  |      | 2  |  0   |   3    |   4    |    1     |
+ | Disaggregated     |      |      |    |      |        |        |          |
+ +-------------------+------+------+----+------+--------+--------+----------+
+ | Dynamic:          |      |  0   | 1  |      |   0    |   0    |    0     |
+ | Hardware Domain   |      |      |    |      |        |        |          |
+ +-------------------+------+------+----+------+--------+--------+----------+
+ | Dynamic: Flexible | {n}  |  1   | 2  |  0   |   1    |   1    |    1     |
+ | Disaggregation    |      |      |    |      |        |        |          |
+ +-------------------+------+------+----+------+--------+--------+----------+
+ | Dynamic: Full     | {n}  |  2   | 3  |  0   |   4    |   5    |    1     |
+ | Disaggregation    |      |      |    |      |        |        |          |
+ +-------------------+------+------+----+------+--------+--------+----------+
+
+Overview of Hyperlaunch Flow
+----------------------------
+
+Before delving into Hyperlaunch, a good basis to start with is an understanding
+of the current process to create a domain. A way to view this process starts
+with the core configuration which is the information the hypervisor requires to
+make the call to `domain_create`, followed by basic construction to provide the
+memory image to run, including the kernel and ramdisk. A subsequent step
+applies the extended configuration used by the toolstack to provide a domain
+with any additional configuration information. Until the extended configuration
+is completed, a domain has access to no resources except its allocated vcpus
+and memory. The exception to this is Dom0, which the hypervisor explicitly
+grants control and access to all system resources, except for those that only
+the hypervisor should have control over.  This exception for Dom0 is driven by
+the system structure with a monolithic Dom0 domain predating introduction of
+support for disaggregation into Xen, and the corresponding default assignment
+of multiple roles within the Xen system to Dom0.
+
+While not a different domain creation path, there does exist the Hardware
+Domain (hwdom), sometimes also referred to as late-Dom0. It is an early effort
+to disaggregate Dom0’s roles into a separate control domain and hardware
+domain. This capability is activated by the passing of a domain id to the
+`hardware_dom` kernel command line parameter, and the Xen hypervisor will then
+flag that domain id as the hardware domain. Later when the toolstack constructs
+a domain with that domain id as the requested domid, the hypervisor will
+transfer all device I/O from Dom0 to this domain. In addition it will also
+transfer the “host shutdown on domain shutdown” flag from Dom0 to the hardware
+domain. It is worth mentioning that this approach for disaggregation was
+created in this manner due to the inability of Xen to launch more than one
+domain at startup.
+
+Hyperlaunch Xen startup
+^^^^^^^^^^^^^^^^^^^^^^^
+
+The Hyperlaunch approach’s primary focus is on how to assign the roles
+traditionally granted to Dom0 to one or more domains at host boot. While the
+statement is simple to make, the implications are not trivial by any means.
+This also explains why the Hyperlaunch approach is orthogonal to the existing
+dom0less capability. The dom0less capability focuses on enabling the launch of
+multiple domains in parallel with Dom0 at host boot. A corollary for dom0less
+is that for systems that don’t require Dom0 after all guest domains have
+started, they are able to do the host boot without a Dom0. Though it should be
+noted that it may be possible to start  Dom0 at a later point. Whereas with
+Hyperlaunch, its approach of separating Dom0’s roles requires the ability to
+launch multiple domains at host boot. The direct consequences from this
+approach are profound and provide a myriad of possible configurations for which
+a sample of common boot configurations were already presented.
+
+To enable the Hyperlaunch approach a new alternative path for host boot within
+the hypervisor must be introduced. This alternative path effectively branches
+just before the current point of Dom0 construction and begins an alternate
+means of system construction. The determination if this alternate path should
+be taken is through the inspection of the boot chain. If the bootloader has
+loaded a specific configuration, as described later, it will enable Xen to
+detect that a Hyperlaunch configuration has been provided. Once a Hyperlaunch
+configuration is detected, this alternate path can be thought of as occurring
+in phases: domain creation, domain preparation, and launch finalization.
+
+Domain Creation
+"""""""""""""""
+
+The domain creation phase begins with Xen parsing the bootloader provided
+material, to understand the content of the modules provided. It will then load
+any microcode or XSM policy it discovers. For each domain configuration Xen
+finds, it parses the configuration to construct the necessary domain definition
+to instantiate an instance of the domain and leave it in a paused state. When
+all domain configurations have been instantiated as domains, if one of them is
+flagged as the Boot Domain, that domain will be unpaused starting the domain
+preparation phase. If there is no Boot Domain defined, then the domain
+preparation phase will be skipped and Xen will trigger the launch finalization
+phase.
+
+Domain Preparation Phase
+""""""""""""""""""""""""
+
+The domain preparation phase is an optional check point for the execution of a
+workload specific domain, the Boot Domain. While the Boot Domain is the first
+domain to run and has some degree of control over the system, it is extremely
+restricted in both system resource access and hypervisor operations. Its
+purpose is to:
+
+* Access the configuration provided by the bootloader
+* Finalize the configuration of the domains
+* Conduct any setup and launch related operations
+* Do an ordered unpause of domains that require an ordered start
+
+When the Boot Domain has completed, it will notify the hypervisor that it is
+done triggering the launch finalization phase.
+
+
+Launch Finalization
+"""""""""""""""""""
+
+The hypervisor handles the launch finalization phase which is equivalent to the
+clean up phase. As such the steps taken by the hypervisor, not necessarily in
+implementation order, are as follows,
+
+* Free the boot module chain
+* If a Boot Domain was used, reclaim Boot Domain resources
+* Unpause any domains still in a paused state
+* Boot Domain uses a reserved function thus can never be respawned
+
+While the focus thus far has been on how the Hyperlaunch capability will work,
+it is worth mentioning what it does not do or limit from occurring. It does not
+stop or inhibit the assigning of the control domain role which gives the domain
+the ability to create, start, stop, restart, and destroy domains or the
+hardware domain role which gives access to all I/O devices except those that
+the hypervisor has reserved for itself. In particular it is still possible to
+construct a domain with all the privileged roles, i.e. a Dom0, with or without
+the domain id being zero. In fact what limitations are imposed now become fully
+configurable without the risk of circumvention by an all privileged domain.
+
+Structuring of Hyperlaunch
+--------------------------
+
+The structure of Hyperlaunch is built around the existing capabilities of the
+host boot protocol. This approach was driven by the objective not to require
+modifications to the boot loader. The only requirement is that the boot loader
+supports the Multiboot2 (MB2) protocol. For UEFI boot, our recommendation is to
+use GRUB.efi to load Xen and the initial domain materials via the multiboot2
+method. On Arm platforms, Hyperlaunch is compatible with the existing interface
+for boot into the hypervisor.
+
+
+x86 Multiboot2
+^^^^^^^^^^^^^^
+
+The MB2 protocol has no concept of a manifest to tell the initial kernel what
+is contained in the chain, leaving it to the kernel to impose a loading
+convention, use magic number identification, or both. When considering the
+passing of multiple kernels, ramdisks, and domain configuration along with any
+existing modules already passed, there is no sane convention that could be
+imposed and magic number identification is nearly impossible when considering
+the objective not to impose unnecessary complication to the hypervisor.
+
+As it was alluded to previously, a manifest describing the contents in the MB2
+chain and how they relate within a Xen context is needed. To address this need
+the Launch Control Module (LCM) was designed to provide such a manifest. The
+LCM was designed to have a specific set of properties,
+
+* minimize the complexity of the parsing logic required by the hypervisor
+* allow for expanding and optional configuration fragments without breaking
+  backwards compatibility
+
+To enable automatic detection of a Hyperlaunch configuration, the LCM must be
+the first MB2 module in the MB2 module chain. The LCM is implemented using the
+Device Tree as defined in the Hyperlaunch Device Tree design document. With the
+LCM implemented in Device Tree, it has a magic number that enables the
+hypervisor to detect its presence when used in a Multiboot2 module chain. The
+hypervisor can confirm that it is a proper LCM Device Tree by checking for a
+compliant Hyperlaunch Device Tree. The Hyperlaunch Device Tree nodes are
+designed to allow,
+
+* for the hypervisor to parse only those entries it understands,
+* for packing custom information for a custom boot domain,
+* the ability to use a new LCM with an older hypervisor,
+* and the ability to use an older LCM with a new hypervisor.
+
+Arm Device Tree
+^^^^^^^^^^^^^^^
+
+As discussed the LCM is in Device Tree format and was designed to co-exist in
+the Device Tree ecosystem, and in particular in parallel with dom0less Device
+Tree entries. On Arm, Xen is already designed to boot from a host Device Tree
+description (dtb) file and the LCM entries can be embedded into this host dtb
+file. This makes detecting the LCM entries and supporting Hyperlaunch on Arm
+relatively straight forward. Relative to the described x86 approach, at the
+point where Xen inspects the first MB2 module, on Arm Xen will check if the top
+level LCM node exists in the host dtb file. If the LCM node does exist, then at
+that point it will enter into the same code path as the x86 entry would go.
+
+Xen hypervisor
+^^^^^^^^^^^^^^
+
+It was previously discussed at a higher level of the new host boot flow that
+will be introduced. Within this new flow is the configuration parsing and
+domain creation phase which will be expanded upon here. The hypervisor will
+inspect the LCM for a config node and if found will iterate through all modules
+nodes. The module nodes are used to identify if any modules contain microcode
+or an XSM policy. As it processes domain nodes, it will construct the domain
+using the node properties and the modules nodes. Once it has completed
+iterating through all the entries in the LCM, if a constructed domain has the
+Boot Domain attribute, it will then be unpaused. Otherwise the hypervisor will
+start the launch finalization phase.
+
+Boot Domain
+^^^^^^^^^^^
+
+Traditionally domain creation was controlled by the user within the Dom0
+environment whereby custom toolstacks could be implemented to impose
+requirements on the process. The Boot Domain is a means to enable the user to
+continue to maintain a degree of that control over domain creation but within a
+limited privilege environment. The Boot Domain will have access to the LCM and
+the boot chain along with access to a subset of the hypercall operations. When
+the Boot Domain is finished it will notify the hypervisor through a hypercall
+op.
+
+Recovery Domain
+^^^^^^^^^^^^^^^
+
+With the existing Dom0 host boot path, when a failure occurs there are several
+assumptions that can safely be made to get the user to a console for
+troubleshooting. With the Hyperlaunch host boot path those assumptions can no
+longer be made, thus a means is needed to get the user to a console in the case
+of a recoverable failure. The recovery domain is configured by a domain
+configuration entry in the LCM, in the same manner as the other initial
+domains, and it will not be unpaused at launch finalization unless a failure is
+encountered starting the initial domains.
+
+Xen has existing support for a Crash Environment where memory can be reserved
+at host boot and a kernel loaded into it, to be jumped into at any point while
+the system is running when a crash is detected. The Recovery Domain
+functionality is a separate, complementary capability. The Crash Environment
+replaces the previously active hypervisor and running guests, and enables a
+process for mounting disks to write out log information prior to rebooting the
+system. In contrast, the Recovery Domain is able to use the functionality of
+the Xen hypervisor, that is still present and running, to perform recovery
+handling for errors encountered with starting the initial domains.
+
+Deferred Design
+"""""""""""""""
+
+To be determined:
+
+* Define what is detected as a crash
+* Explain how crash detection is performed and which components are involved
+* Explain how the recovery domain is unpaused
+* Explain how and when the resources assigned to the recovery domain are reclaimed
+* Define what the recovery domain is able to do
+* Determine what permissions the recovery domain requires to perform its job
+
+
+Control Domain
+^^^^^^^^^^^^^^
+
+The concept of the Control Domain already exists within Xen as a boolean,
+`is_privileged`, that governs access to many of the privileged interfaces of
+the hypervisor that support a domain running a virtualization system toolstack.
+Hyperlaunch will allow the `is_privileged` flag to be set on any domain that is
+created at launch, rather than only a Dom0. It may potentially be set on
+multiple domains.
+
+Hardware Domain
+^^^^^^^^^^^^^^^
+
+The Hardware Domain is also an existing concept for Xen that is enabled through
+the `is_hardware_domain` check. With Hyperlaunch the previous process of I/O
+accesses being assigned to Dom0 for later transfer to the hardware domain would
+no longer be required. Instead during the configuration phase the Xen
+hypervisor would directly assign the I/O accesses to the domain with the
+hardware domain permission bit enabled.
+
+Console Domain
+^^^^^^^^^^^^^^
+
+Traditionally the Xen console is assigned to the control domain and then
+reassignable by the toolstack to another domain. With Hyperlaunch it becomes
+possible to construct a boot configuration where there is no control domain or
+have a use case where the Xen console needs to be isolated. As such it becomes
+necessary to be able to designate which of the initial domains should be
+assigned the Xen console. Therefore Hyperlaunch introduces the ability to
+specify an initial domain which the console is assigned along with a convention
+of ordered assignment for when there is no explicit assignment.
+
+Communication of Domain Configurations
+======================================
+
+There are several standard methods for an Operating System to access machine
+configuration and environment information: ACPI is common on x86 systems,
+whereas Device Tree is more typical on Arm platforms. There are currently
+implementations of both in Xen.
+
+* For dom0less, guest Device Trees are dynamically constructed by the
+  hypervisor to convey domain configuration data
+
+* For PVH dom0 on x86, ACPI tables are built by the hypervisor before the
+  domain is started
+
+Note that both of these mechanisms convey static data that is fixed prior to
+the point of domain construction. Hyperlaunch will retain both the existing
+ACPI and Device Tree methods.
+
+Communication of data between a Boot Domain and a Control Domain is of note
+since they may not be running concurrently: the method used will depend on
+their specific implementations, but one option available is to use Xen’s hypfs
+for transfer of basic data to support system bootstrap.
+
+-------------------------------------------------------------------------------
+
+Appendix
+========
+
+Appendix 1: Flow Sequence of Steps of a Hyperlaunch Boot
+--------------------------------------------------------
+
+Provided here is an ordered flow of a Hyperlaunch with a highlight logic
+decision points. Not all branch points are recorded, specifically for the
+variety of error conditions that may occur. ::
+
+  1. Hypervisor Startup:
+  2a. (x86) Inspect first module provided by the bootloader
+      a. Is the module an LCM
+          i. YES: proceed with the Hyperlaunch host boot path
+          ii. NO: proceed with a Dom0 host boot path
+  2b. (Arm) Inspect host dtb for `/chosen/hypervisor` node
+      a. Is the LCM present
+          i. YES: proceed with the Hyperlaunch host boot path
+          ii. NO: proceed with a Dom0/dom0less host boot path
+  3. Iterate through the LCM entries looking for the module description
+     entry
+      a. Check if any of the modules are microcode or policy and if so,
+         load
+  4. Iterate through the LCM entries processing all domain description
+     entries
+      a. Use the details from the Basic Configuration to call
+         `domain_create`
+      b. Record if a domain is flagged as the Boot Domain
+      c. Record if a domain is flagged as the Recovery Domain
+  5. Was a Boot Domain created
+      a. YES:
+          i. Attach console to Boot Domain
+          ii. Unpause Boot Domain
+          iii. Goto Boot Domain (step 6)
+      b. NO: Goto Launch Finalization (step 10)
+  6. Boot Domain:
+  7. Boot Domain comes online and may do any of the following actions
+      a. Process the LCM
+      b. Validate the MB2 chain
+      c. Make additional configuration settings for staged domains
+      d. Unpause any precursor domains
+      e. Set any runtime configurations
+  8. Boot Domain does any necessary cleanup
+  9. Boot Domain make hypercall op call to signal it is finished
+      i. Hypervisor reclaims all Boot Domain resources
+      ii. Hypervisor records that the Boot Domain ran
+      ii. Goto Launch Finalization (step 9)
+  10. Launch Finalization
+  11. If a configured domain was flagged to have the console, the
+      hypervisor assigns it
+  12. The hypervisor clears the LCM and bootloader loaded module,
+      reclaiming the memory
+  13. The hypervisor iterates through domains unpausing any domain not
+      flagged as the recovery domain
+
+
+Appendix 2: Considerations in Naming the Hyperlaunch Feature
+------------------------------------------------------------
+
+* The term “Launch” is preferred over “Boot”
+
+        * Multiple individual component boots can occur in the new system start
+          process; Launch is preferable for describing the whole process
+        * Fortunately there is consensus in the current group of stakeholders
+          that the term “Launch” is good and appropriate
+
+* The names we define must support becoming meaningful and simple to use
+  outside the Xen community
+
+        * They must be able to be resolved quickly via search engine to a clear
+          explanation (eg. Xen marketing material, documentation or wiki)
+        * We prefer that the terms be helpful for marketing communications
+        * Consequence: avoid the term “domain” which is Xen-specific and
+          requires a definition to be provided each time when used elsewhere
+
+
+* There is a need to communicate that Xen is  capable of being used as a Static
+  Partitioning hypervisor
+
+        * The community members using and maintaining dom0less are the current
+          primary stakeholders for this
+
+* There is a need to communicate that the new launch functionality provides new
+  capabilities not available elsewhere, and is more than just supporting Static
+  Partitioning
+
+        * No other hypervisor known to the authors of this document is capable
+          of providing what Hyperlaunch will be able to do. The launch sequence is
+          designed to:
+
+                * Remove dependency on a single, highly-privileged initial domain
+                * Allow the initial domains started to be independent and fully
+                  isolated from each other
+                * Support configurations where no further VMs can be launched
+                  once the initial domains have started
+                * Use a standard, extensible format for conveying VM
+                  configuration data
+                * Ensure that domain building of all initial domains is
+                  performed by the hypervisor from materials supplied by the
+                  bootloader
+                * Enable flexible configuration to be applied to all initial
+                  domains by an optional Boot Domain, that runs with limited
+                  privilege, before any other domain starts and obtains the VM
+                  configuration data from the bootloader materials via the
+                  hypervisor
+                * Enable measurements of all of the boot materials prior to
+                  their use, in a sequence with minimized privilege
+                * Support use-case-specific customized Boot Domains
+                * Complement the hypervisor’s existing ability to enforce
+                  policy-based Mandatory Access Control
+
+
+* “Static” and “Dynamic” have different and important meanings in different
+  communities
+
+        * Static and Dynamic Partitioning describe the ability to create new
+          virtual machines, or not, after the initial host boot process
+          completes
+        * Static and Dynamic Root of Trust describe the nature of the trust
+          chain for a measured launch. In this case Static is referring to the
+          fact that the trust chain is fixed and non-repeatable until the next
+          host reboot or shutdown. Whereas Dynamic in this case refers to the
+          ability to conduct the measured launch at any time and potentially
+          multiple times before the next host reboot or shutdown.
+
+                * We will be using Hyperlaunch with both Static and Dynamic
+                  Roots of Trust, to launch both Static and Dynamically
+                  Partitioned Systems, and being clear about exactly which
+                  combination is being started will be very important (eg. for
+                  certification processes)
+
+        * Consequence: uses of “Static” and “Dynamic” need to be qualified if
+          they are incorporated into the naming of this functionality
+
+                * This can be done by adding the preceding, stronger branded
+                  term: “Hyperlaunch”, before “Static” or “Dynamic”
+                * ie. “Hyperlaunch Static” describes launch of a
+                  Statically Partitioned system
+                * and “Hyperlaunch Dynamic” describes launch of a
+                  Dynamically Partitioned system.
+                * In practice, this means that “Hyperlaunch Static” describes
+                  starting a Static Partitioned system where no new domains can
+                  be started later (ie. no VM has the Control Domain
+                  permission), whereas “Hyperlaunch Dynamic” will launch some
+                  VM with the Control Domain permission, able to create VMs
+                  dynamically at a later point.
+
+**Naming Proposal:**
+
+* New Term: “Hyperlaunch” : the ability of a hypervisor to construct and start
+  one or more virtual machines at system launch, in the following manner:
+
+        * The hypervisor must build all of the domains that it starts at host
+          boot
+
+                * Similar to the way the dom0 domain is built by the hypervisor
+                  today, and how dom0less works: it will run a loop to build
+                  them all, driven from the configuration provided
+                * This is a requirement for ensuring that there is Strong
+                  Isolation between each of the initial VMs
+
+        * A single file contains the VM configs (“Launch Control Module”: LCM,
+          in Device Tree binary format) is provided to the hypervisor
+
+                * The hypervisor parses it and builds domains
+                * If the LCM config says that a Boot Domain should run first,
+                  then the LCM file itself is made available to the Boot Domain
+                  for it to parse and act on, to invoke operations via the
+                  hypervisor to apply additional configuration to the other VMs
+                  (ie. executing a privilege-constrained toolstack)
+
+* New Term: “Hyperlaunch Static”: starts a Static Partitioned system, where
+  only the virtual machines started at system launch are running on the system
+
+* New Term: “Hyperlaunch Dynamic”: starts a system where virtual machines may
+  be dynamically added after the initial virtual machines have started.
+
+
+In the default configuration, Xen will be capable of both styles of Hyperlaunch
+from the same hypervisor binary, when paired with its XSM flask, provides
+strong controls that enable fine grained system partitioning.
+
+
+* Retiring Term: “DomB”: will no longer be used to describe the optional first
+  domain that is started. It is replaced with the more general term: “Boot
+  Domain”.
+
+* Retiring Term: “Dom0less”: it is to be replaced with “Hyperlaunch Static”
+
+
+Appendix 3: Terminology
+-----------------------
+
+To help ensure clarity in reading this document, the following is the
+definition of terminology used within this document.
+
+
+Basic Configuration
+    the minimal information the hypervisor requires to instantiate a domain instance
+
+
+Boot Domain
+    a domain with limited privileges launched by the hypervisor during a
+    Multiple Domain Boot that runs as the first domain started. In the Hyperlaunch
+    architecture, it is responsible for assisting with higher level operations of
+    the domain setup process.
+
+
+Classic Launch
+    a backwards-compatible host boot that ends with the launch of a single domain (Dom0)
+
+
+Console Domain
+    a domain that has the Xen console assigned to it
+
+
+Control Domain
+    a privileged domain that has been granted Control Domain permissions which
+    are those that are required by the Xen toolstack for managing other domains.
+    These permissions are a subset of those that are granted to Dom0.
+
+
+Device Tree
+    a standardized data structure, with defined file formats, for describing
+    initial system configuration
+
+
+Disaggregation
+    the separation of system roles and responsibilities across multiple
+    connected components that work together to provide functionality
+
+
+Dom0
+    the highly-privileged, first and only domain started at host boot on a
+    conventional Xen system
+
+
+Dom0less
+    an existing feature of Xen on Arm that provides Multiple Domain Boot
+
+
+Domain
+    a running instance of a virtual machine; (as the term is commonly used in
+    the Xen Community)
+
+DomB
+     the former name for Hyperlaunch
+
+
+Extended Configuration
+    any configuration options for a domain beyond its Basic Configuration
+
+
+Hardware Domain
+    a privileged domain that has been granted permissions to access and manage
+    host hardware. These permissions are a subset of those that are granted to
+    Dom0.
+
+
+Host Boot
+    the system startup of Xen using the configuration provided by the bootloader
+
+
+Hyperlaunch
+    a flexible host boot that ends with the launch of one or more domains
+
+
+Initial Domain
+    a domain that is described in the LCM that is run as part of a multiple
+    domain boot. This includes the Boot Domain, Recovery Domain and all Launched
+    Domains.
+
+
+Late Hardware Domain
+    a Hardware Domain that is launched after host boot has already completed
+    with a running Dom0. When the Late Hardware Domain is started, Dom0
+    relinquishes and transfers the permissions to access and manage host hardware
+    to it..
+
+
+Launch Control Module (LCM)
+    A file supplied to the hypervisor by the bootloader that contains
+    configuration data for the hypervisor and the initial set of virtual machines
+    to be run at boot
+
+
+Launched Domain
+    a domain, aside from the boot domain and recovery domain, that is started as
+    part of a multiple domain boot and remains running once the boot process is
+    complete
+
+
+Multiple Domain Boot
+    a system configuration where the hypervisor and multiple virtual machines
+    are all launched when the host system hardware boots
+
+
+Recovery Domain
+    an optional fallback domain that the hypervisor may start in the event of a
+    detectable error encountered during the multiple domain boot process
+
+
+System Device Tree
+    this is the product of an Arm community project to extend Device Tree to
+    cover more aspects of initial system configuration
+
+
+Appendix 4: Copyright License
+-----------------------------
+
+This work is licensed under a Creative Commons Attribution 4.0 International
+License. A copy of this license may be obtained from the Creative Commons
+website (https://creativecommons.org/licenses/by/4.0/legalcode).
+
+| Contributions by:
+| Christopher Clark are Copyright © 2021 Star Lab Corporation
+| Daniel P. Smith are Copyright  © 2021 Apertus Solutions, LLC
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 06:33:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 06:33:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153416.283449 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1k4b-0002XG-Cv; Fri, 09 Jul 2021 06:33:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153416.283449; Fri, 09 Jul 2021 06:33:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1k4b-0002X8-9k; Fri, 09 Jul 2021 06:33:17 +0000
Received: by outflank-mailman (input) for mailman id 153416;
 Fri, 09 Jul 2021 06:33:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1k4Z-0002Wy-DP
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 06:33:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1k4Z-0001xJ-CS
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 06:33:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1k4Z-0000fk-BS
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cfRrww/z0C9gYtA3RznytCCTw3z0Jpw57nxXdGgQWxk=; b=Co/VhS0Ryb7sUGoF1L2uj96NRc
	0xzxmJCQsXLNyY9/2VwnkxhI470YumkX6R8v1a4MzCiA0YCS5Y+tfufI2dwcxnppeWX5z53Wux/X8
	jWIm/zWSWI+OaSa4UVfcrzf15XSy5KGdhhgmJJD4f6CVv0onHvmZRa1Gfxx3QlF/HP3c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] docs/designs/launch: Hyperlaunch device tree
Message-Id: <E1m1k4Z-0000fk-BS@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 06:33:15 +0000

commit 0cbed4f0fd94a7fd40662fb0b4b82a58abeca111
Author:     Daniel P. Smith <dpsmith@apertussolutions.com>
AuthorDate: Fri Jul 9 08:26:42 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 9 08:26:42 2021 +0200

    docs/designs/launch: Hyperlaunch device tree
    
    Adds a design document for Hyperlaunch device tree structure.
    
    Signed-off-by: Christopher Clark <christopher.clark@starlab.io>
    Signed-off by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 docs/designs/launch/hyperlaunch-devicetree.rst | 343 +++++++++++++++++++++++++
 1 file changed, 343 insertions(+)

diff --git a/docs/designs/launch/hyperlaunch-devicetree.rst b/docs/designs/launch/hyperlaunch-devicetree.rst
new file mode 100644
index 0000000000..b49c98cfbd
--- /dev/null
+++ b/docs/designs/launch/hyperlaunch-devicetree.rst
@@ -0,0 +1,343 @@
+-------------------------------------
+Xen Hyperlaunch Device Tree Bindings
+-------------------------------------
+
+The Xen Hyperlaunch device tree adopts the dom0less device tree structure and
+extends it to meet the requirements for the Hyperlaunch capability. The primary
+difference is the introduction of the ``hypervisor`` node that is under the
+``/chosen`` node. The move to a dedicated node was driven by:
+
+1. Reduces the need to walk over nodes that are not of interest, e.g. only
+   nodes of interest should be in ``/chosen/hypervisor``
+
+2. Allows for the domain construction information to easily be sanitized by
+   simple removing the ``/chosen/hypervisor`` node.
+
+Example Configuration
+---------------------
+
+Below are two example device tree definitions for the hypervisor node. The
+first is an example of a multiboot-based configuration for x86 and the second
+is a module-based configuration for Arm.
+
+Multiboot x86 Configuration:
+""""""""""""""""""""""""""""
+
+::
+
+    hypervisor {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        compatible = “hypervisor,xen”
+
+        // Configuration container
+        config {
+            compatible = "xen,config";
+
+            module {
+                compatible = "module,microcode", "multiboot,module";
+                mb-index = <1>;
+            };
+
+            module {
+                compatible = "module,xsm-policy", "multiboot,module";
+                mb-index = <2>;
+            };
+        };
+
+        // Boot Domain definition
+        domain {
+            compatible = "xen,domain";
+
+            domid = <0x7FF5>;
+
+            // FUNCTION_NONE            (0)
+            // FUNCTION_BOOT            (1 << 0)
+            // FUNCTION_CRASH           (1 << 1)
+            // FUNCTION_CONSOLE         (1 << 2)
+            // FUNCTION_XENSTORE        (1 << 30)
+            // FUNCTION_LEGACY_DOM0     (1 << 31)
+            functions = <0x00000001>;
+
+            memory = <0x0 0x20000>;
+            cpus = <1>;
+            module {
+                compatible = "module,kernel", "multiboot,module";
+                mb-index = <3>;
+            };
+
+            module {
+                compatible = "module,ramdisk", "multiboot,module";
+                mb-index = <4>;
+            };
+            module {
+                compatible = "module,config", "multiboot,module";
+                mb-index = <5>;
+            };
+
+        // Classic Dom0 definition
+        domain {
+            compatible = "xen,domain";
+
+            domid = <0>;
+
+            // PERMISSION_NONE          (0)
+            // PERMISSION_CONTROL       (1 << 0)
+            // PERMISSION_HARDWARE      (1 << 1)
+            permissions = <3>;
+
+            // FUNCTION_NONE            (0)
+            // FUNCTION_BOOT            (1 << 0)
+            // FUNCTION_CRASH           (1 << 1)
+            // FUNCTION_CONSOLE         (1 << 2)
+            // FUNCTION_XENSTORE        (1 << 30)
+            // FUNCTION_LEGACY_DOM0     (1 << 31)
+            functions = <0xC0000006>;
+
+            // MODE_PARAVIRTUALIZED     (1 << 0) /* PV | PVH/HVM */
+            // MODE_ENABLE_DEVICE_MODEL (1 << 1) /* HVM | PVH */
+            // MODE_LONG                (1 << 2) /* 64 BIT | 32 BIT */
+            mode = <5>; /* 64 BIT, PV */
+
+            // UUID
+            domain-uuid = [B3 FB 98 FB 8F 9F 67 A3];
+
+            cpus = <1>;
+            memory = <0x0 0x20000>;
+            security-id = “dom0_t;
+
+            module {
+                compatible = "module,kernel", "multiboot,module";
+                mb-index = <6>;
+                bootargs = "console=hvc0";
+            };
+            module {
+                compatible = "module,ramdisk", "multiboot,module";
+                mb-index = <7>;
+            };
+    };
+
+The multiboot modules supplied when using the above config would be, in order:
+
+* (the above config, compiled)
+* CPU microcode
+* XSM policy
+* kernel for boot domain
+* ramdisk for boot domain
+* boot domain configuration file
+* kernel for the classic dom0 domain
+* ramdisk for the classic dom0 domain
+
+Module Arm Configuration:
+"""""""""""""""""""""""""
+
+::
+
+    hypervisor {
+        compatible = “hypervisor,xen”
+
+        // Configuration container
+        config {
+            compatible = "xen,config";
+
+            module {
+                compatible = "module,microcode”;
+                module-addr = <0x0000ff00 0x80>;
+            };
+
+            module {
+                compatible = "module,xsm-policy";
+                module-addr = <0x0000ff00 0x80>;
+
+            };
+        };
+
+        // Boot Domain definition
+        domain {
+            compatible = "xen,domain";
+
+            domid = <0x7FF5>;
+
+            // FUNCTION_NONE            (0)
+            // FUNCTION_BOOT            (1 << 0)
+            // FUNCTION_CRASH           (1 << 1)
+            // FUNCTION_CONSOLE         (1 << 2)
+            // FUNCTION_XENSTORE        (1 << 30)
+            // FUNCTION_LEGACY_DOM0     (1 << 31)
+            functions = <0x00000001>;
+
+            memory = <0x0 0x20000>;
+            cpus = <1>;
+            module {
+                compatible = "module,kernel";
+                module-addr = <0x0000ff00 0x80>;
+            };
+
+            module {
+                compatible = "module,ramdisk";
+                module-addr = <0x0000ff00 0x80>;
+            };
+            module {
+                compatible = "module,config";
+                module-addr = <0x0000ff00 0x80>;
+            };
+
+        // Classic Dom0 definition
+        domain@0 {
+            compatible = "xen,domain";
+
+            domid = <0>;
+
+            // PERMISSION_NONE          (0)
+            // PERMISSION_CONTROL       (1 << 0)
+            // PERMISSION_HARDWARE      (1 << 1)
+            permissions = <3>;
+
+            // FUNCTION_NONE            (0)
+            // FUNCTION_BOOT            (1 << 0)
+            // FUNCTION_CRASH           (1 << 1)
+            // FUNCTION_CONSOLE         (1 << 2)
+            // FUNCTION_XENSTORE        (1 << 30)
+            // FUNCTION_LEGACY_DOM0     (1 << 31)
+            functions = <0xC0000006>;
+
+            // MODE_PARAVIRTUALIZED     (1 << 0) /* PV | PVH/HVM */
+            // MODE_ENABLE_DEVICE_MODEL (1 << 1) /* HVM | PVH */
+            // MODE_LONG                (1 << 2) /* 64 BIT | 32 BIT */
+            mode = <5>; /* 64 BIT, PV */
+
+            // UUID
+            domain-uuid = [B3 FB 98 FB 8F 9F 67 A3];
+
+            cpus = <1>;
+            memory = <0x0 0x20000>;
+            security-id = “dom0_t”;
+
+            module {
+                compatible = "module,kernel";
+                module-addr = <0x0000ff00 0x80>;
+                bootargs = "console=hvc0";
+            };
+            module {
+                compatible = "module,ramdisk";
+                module-addr = <0x0000ff00 0x80>;
+            };
+    };
+
+The modules that would be supplied when using the above config would be:
+
+* (the above config, compiled into hardware tree)
+* CPU microcode
+* XSM policy
+* kernel for boot domain
+* ramdisk for boot domain
+* boot domain configuration file
+* kernel for the classic dom0 domain
+* ramdisk for the classic dom0 domain
+
+The hypervisor device tree would be compiled into the hardware device tree and
+provided to Xen using the standard method currently in use. The remaining
+modules would need to be loaded in the respective addresses specified in the
+`module-addr` property.
+
+
+The Hypervisor node
+-------------------
+
+The hypervisor node is a top level container for the domains that will be built
+by hypervisor on start up. On the ``hypervisor`` node the ``compatible``
+property is used to identify the type of hypervisor node present..
+
+compatible
+  Identifies the type of node. Required.
+
+The Config node
+---------------
+
+A config node is for detailing any modules that are of interest to Xen itself.
+For example this would be where Xen would be informed of microcode or XSM
+policy locations. If the modules are multiboot modules and are able to be
+located by index within the module chain, the ``mb-index`` property should be
+used to specify the index in the multiboot module chain.. If the module will be
+located by physical memory address, then the ``module-addr`` property should be
+used to identify the location and size of the module.
+
+compatible
+  Identifies the type of node. Required.
+
+The Domain node
+---------------
+
+A domain node is for describing the construction of a domain. It may provide a
+domid property which will be used as the requested domain id for the domain
+with a value of “0” signifying to use the next available domain id, which is
+the default behavior if omitted. A domain configuration is not able to request
+a domid of “0”. After that a domain node may have any of the following
+parameters,
+
+compatible
+  Identifies the type of node. Required.
+
+domid
+  Identifies the domid requested to assign to the domain. Required.
+
+permissions
+  This sets what Discretionary Access Control permissions
+  a domain is assigned. Optional, default is none.
+
+functions
+  This identifies what system functions a domain will fulfill.
+  Optional, the default is none.
+
+.. note::  The `functions` bits that have been selected to indicate
+   ``FUNCTION_XENSTORE`` and ``FUNCTION_LEGACY_DOM0`` are the last two bits
+   (30, 31) such that should these features ever be fully retired, the flags may
+   be dropped without leaving a gap in the flag set.
+
+mode
+  The mode the domain will be executed under. Required.
+
+domain-uuid
+  A globally unique identifier for the domain. Optional,
+  the default is NULL.
+
+cpus
+  The number of vCPUs to be assigned to the domain. Optional,
+  the default is “1”.
+
+memory
+  The amount of memory to assign to the domain, in KBs.
+  Required.
+
+security-id
+  The security identity to be assigned to the domain when XSM
+  is the access control mechanism being used. Optional,
+  the default is “domu_t”.
+
+The Module node
+---------------
+
+This node describes a boot module loaded by the boot loader. The required
+compatible property follows the format: module,<type> where type can be
+“kernel”, “ramdisk”, “device-tree”, “microcode”, “xsm-policy” or “config”. In
+the case the module is a multiboot module, the additional property string
+“multiboot,module” may be present. One of two properties is required and
+identifies how to locate the module. They are the mb-index, used for multiboot
+modules, and the module-addr for memory address based location.
+
+compatible
+  This identifies what the module is and thus what the hypervisor
+  should use the module for during domain construction. Required.
+
+mb-index
+  This identifies the index for this module in the multiboot module chain.
+  Required for multiboot environments.
+
+module-addr
+  This identifies where in memory this module is located. Required for
+  non-multiboot environments.
+
+bootargs
+  This is used to provide the boot params to kernel modules.
+
+.. note::  The bootargs property is intended for situations where the same kernel multiboot module is used for more than one domain.
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 06:33:27 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 06:33:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153417.283453 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1k4l-0002aG-Ed; Fri, 09 Jul 2021 06:33:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153417.283453; Fri, 09 Jul 2021 06:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1k4l-0002a8-BH; Fri, 09 Jul 2021 06:33:27 +0000
Received: by outflank-mailman (input) for mailman id 153417;
 Fri, 09 Jul 2021 06:33:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1k4j-0002Zs-Ge
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 06:33:25 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1k4j-0001xR-Fq
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 06:33:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1k4j-0000gn-Et
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xMx9B2zVHLD1RHdH4Uio6dlOWQQxdwVWFr6tmAd2bQk=; b=vLVbYXNGTYagzS64Fo5+i3eKiq
	dDCFQZX1vopGDvDspDMl3q/SU5KNsvE1HD+1/Hn6+2UAQAF/R9JJzv/f2DlvAcUXyhEEX7xfeOG1s
	NXWkKQnRQw58j1FIvVEGatd8BOBo+zLXiXtx7iBkFVS020NqNEKuZY8CavaNmMmZHVHw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/AMD: expose SYSCFG, TOM, TOM2, and IORRs to Dom0
Message-Id: <E1m1k4j-0000gn-Et@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 06:33:25 +0000

commit bfcdaae9c210bd7984d7691285aaf43deb1b0604
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jul 9 08:28:14 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 9 08:28:14 2021 +0200

    x86/AMD: expose SYSCFG, TOM, TOM2, and IORRs to Dom0
    
    Sufficiently old Linux (3.12-ish) accesses these MSRs (with the
    exception of IORRs) in an unguarded manner. Furthermore these same MSRs,
    at least on Fam11 and older CPUs, are also consulted by modern Linux,
    and their (bogus) built-in zapping of #GP faults from MSR accesses leads
    to it effectively reading zero instead of the intended values, which are
    relevant for PCI BAR placement (which ought to all live in MMIO-type
    space, not in DRAM-type one).
    
    For SYSCFG, only certain bits get exposed. Since MtrrVarDramEn also
    covers the IORRs, expose them as well. Introduce (consistently named)
    constants for the bits we're interested in and use them in pre-existing
    code as well. While there also drop the unused and somewhat questionable
    K8_MTRR_RDMEM_WRMEM_MASK. To complete the set of memory type and DRAM vs
    MMIO controlling MSRs, also expose TSEG_{BASE,MASK} (the former also
    gets read by Linux, dealing with which was already the subject of
    6eef0a99262c ["x86/PV: conditionally avoid raising #GP for early guest
    MSR reads"]).
    
    As a welcome side effect, verbosity on/of debug builds gets (perhaps
    significantly) reduced.
    
    Note that at least as far as those MSR accesses by Linux are concerned,
    there's no similar issue for DomU-s, as the accesses sit behind PCI
    device matching logic. The checked for devices would never be exposed to
    DomU-s in the first place. Nevertheless I think that at least for HVM we
    should return sensible values, not 0 (as svm_msr_read_intercept() does
    right now). The intended values may, however, need to be determined by
    hvmloader, and then get made known to Xen.
    
    Fixes: 322ec7c89f66 ("x86/pv: disallow access to unknown MSRs")
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/amd.c              |  4 ++--
 xen/arch/x86/cpu/mtrr/generic.c     |  2 +-
 xen/arch/x86/msr.c                  | 19 +++++++++++++++++++
 xen/arch/x86/x86_64/mmconf-fam10h.c |  2 +-
 xen/include/asm-x86/msr-index.h     | 20 +++++++++++++++-----
 5 files changed, 38 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 169f80d635..83b33047b7 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -468,14 +468,14 @@ static void check_syscfg_dram_mod_en(void)
 		return;
 
 	rdmsrl(MSR_K8_SYSCFG, syscfg);
-	if (!(syscfg & K8_MTRRFIXRANGE_DRAM_MODIFY))
+	if (!(syscfg & SYSCFG_MTRR_FIX_DRAM_MOD_EN))
 		return;
 
 	if (!test_and_set_bool(printed))
 		printk(KERN_ERR "MTRR: SYSCFG[MtrrFixDramModEn] not "
 			"cleared by BIOS, clearing this bit\n");
 
-	syscfg &= ~K8_MTRRFIXRANGE_DRAM_MODIFY;
+	syscfg &= ~SYSCFG_MTRR_FIX_DRAM_MOD_EN;
 	wrmsrl(MSR_K8_SYSCFG, syscfg);
 }
 
diff --git a/xen/arch/x86/cpu/mtrr/generic.c b/xen/arch/x86/cpu/mtrr/generic.c
index 06fa0c0420..883e3398ff 100644
--- a/xen/arch/x86/cpu/mtrr/generic.c
+++ b/xen/arch/x86/cpu/mtrr/generic.c
@@ -224,7 +224,7 @@ static void __init print_mtrr_state(const char *level)
 		uint64_t syscfg, tom2;
 
 		rdmsrl(MSR_K8_SYSCFG, syscfg);
-		if (syscfg & (1 << 21)) {
+		if (syscfg & SYSCFG_MTRR_TOM2_EN) {
 			rdmsrl(MSR_K8_TOP_MEM2, tom2);
 			printk("%sTOM2: %012"PRIx64"%s\n", level, tom2,
 			       syscfg & (1 << 22) ? " (WB)" : "");
diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index 72bbe46949..650d060b12 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -354,6 +354,25 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
         *val = msrs->tsc_aux;
         break;
 
+    case MSR_K8_SYSCFG:
+    case MSR_K8_TOP_MEM1:
+    case MSR_K8_TOP_MEM2:
+    case MSR_K8_IORR_BASE0:
+    case MSR_K8_IORR_MASK0:
+    case MSR_K8_IORR_BASE1:
+    case MSR_K8_IORR_MASK1:
+    case MSR_K8_TSEG_BASE:
+    case MSR_K8_TSEG_MASK:
+        if ( !(cp->x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
+            goto gp_fault;
+        if ( !is_hardware_domain(d) )
+            return X86EMUL_UNHANDLEABLE;
+        rdmsrl(msr, *val);
+        if ( msr == MSR_K8_SYSCFG )
+            *val &= (SYSCFG_TOM2_FORCE_WB | SYSCFG_MTRR_TOM2_EN |
+                     SYSCFG_MTRR_VAR_DRAM_EN | SYSCFG_MTRR_FIX_DRAM_EN);
+        break;
+
     case MSR_K8_HWCR:
         if ( !(cp->x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
             goto gp_fault;
diff --git a/xen/arch/x86/x86_64/mmconf-fam10h.c b/xen/arch/x86/x86_64/mmconf-fam10h.c
index 3b57d2b5ca..a834ab3149 100644
--- a/xen/arch/x86/x86_64/mmconf-fam10h.c
+++ b/xen/arch/x86/x86_64/mmconf-fam10h.c
@@ -69,7 +69,7 @@ static void __init get_fam10h_pci_mmconf_base(void)
 	rdmsrl(address, val);
 
 	/* TOP_MEM2 is not enabled? */
-	if (!(val & (1<<21))) {
+	if (!(val & SYSCFG_MTRR_TOM2_EN)) {
 		tom2 = 1ULL << 32;
 	} else {
 		/* TOP_MEM2 */
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 9a772c12b8..7e38c257d8 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -118,6 +118,21 @@
 #define  PASID_PASID_MASK                   0x000fffff
 #define  PASID_VALID                        (_AC(1, ULL) << 31)
 
+#define MSR_K8_SYSCFG                       0xc0010010
+#define  SYSCFG_MTRR_FIX_DRAM_EN            (_AC(1, ULL) << 18)
+#define  SYSCFG_MTRR_FIX_DRAM_MOD_EN        (_AC(1, ULL) << 19)
+#define  SYSCFG_MTRR_VAR_DRAM_EN            (_AC(1, ULL) << 20)
+#define  SYSCFG_MTRR_TOM2_EN                (_AC(1, ULL) << 21)
+#define  SYSCFG_TOM2_FORCE_WB               (_AC(1, ULL) << 22)
+
+#define MSR_K8_IORR_BASE0                   0xc0010016
+#define MSR_K8_IORR_MASK0                   0xc0010017
+#define MSR_K8_IORR_BASE1                   0xc0010018
+#define MSR_K8_IORR_MASK1                   0xc0010019
+
+#define MSR_K8_TSEG_BASE                    0xc0010112 /* AMD doc: SMMAddr */
+#define MSR_K8_TSEG_MASK                    0xc0010113 /* AMD doc: SMMMask */
+
 #define MSR_K8_VM_CR                        0xc0010114
 #define  VM_CR_INIT_REDIRECTION             (_AC(1, ULL) <<  1)
 #define  VM_CR_SVM_DISABLE                  (_AC(1, ULL) <<  4)
@@ -281,11 +296,6 @@
 #define MSR_K8_TOP_MEM1			0xc001001a
 #define MSR_K7_CLK_CTL			0xc001001b
 #define MSR_K8_TOP_MEM2			0xc001001d
-#define MSR_K8_SYSCFG			0xc0010010
-
-#define K8_MTRRFIXRANGE_DRAM_ENABLE	0x00040000 /* MtrrFixDramEn bit    */
-#define K8_MTRRFIXRANGE_DRAM_MODIFY	0x00080000 /* MtrrFixDramModEn bit */
-#define K8_MTRR_RDMEM_WRMEM_MASK	0x18181818 /* Mask: RdMem|WrMem    */
 
 #define MSR_K7_HWCR			0xc0010015
 #define MSR_K8_HWCR			0xc0010015
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 06:33:37 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 06:33:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153418.283456 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1k4v-0002dM-Fg; Fri, 09 Jul 2021 06:33:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153418.283456; Fri, 09 Jul 2021 06:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1k4v-0002dF-Cr; Fri, 09 Jul 2021 06:33:37 +0000
Received: by outflank-mailman (input) for mailman id 153418;
 Fri, 09 Jul 2021 06:33:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1k4t-0002cv-Jy
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 06:33:35 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1k4t-0001xf-J6
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 06:33:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1k4t-0000hI-IF
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Yt3A0yOTGvBRRGmjMLIb4OS+R0u9749KKWyz/ytrxys=; b=u5Bhznm1GREIphxK1NbT4CVYml
	1h7CkWlF8vCfZ2Hnd8jbL6odGCQB2Drmx0mIbjebaL73MZqJi3ywQeIild4/B8DSM+CKPxC5xMIuc
	EVDdi6pHEZFsn5yQl3qEQ+2A1nQSjhwPTeap3tcPY/7qBN1fS3bGXx0uC7/aFJjuFThY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/AMD: drop MSR_K7_HWCR
Message-Id: <E1m1k4t-0000hI-IF@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 06:33:35 +0000

commit 836314747b0fd1688fc9526f7c73fd9313ba82f3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jul 9 08:30:35 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 9 08:30:35 2021 +0200

    x86/AMD: drop MSR_K7_HWCR
    
    We don't support any K7 (32-bit only) hardware anymore, and the MSR is
    accessible as MSR_K8_HWCR as well. Using the K7 name was particularly
    odd for Hygon as well as in a Fam0F-specific piece of code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/amd.c          | 8 ++++----
 xen/arch/x86/cpu/hygon.c        | 4 ++--
 xen/include/asm-x86/msr-index.h | 1 -
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 83b33047b7..2260eef3aa 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -694,9 +694,9 @@ static void init_amd(struct cpuinfo_x86 *c)
 	 * Errata 122 for all steppings (F+ have it disabled by default)
 	 */
 	if (c->x86 == 15) {
-		rdmsrl(MSR_K7_HWCR, value);
+		rdmsrl(MSR_K8_HWCR, value);
 		value |= 1 << 6;
-		wrmsrl(MSR_K7_HWCR, value);
+		wrmsrl(MSR_K8_HWCR, value);
 	}
 
 	/*
@@ -928,9 +928,9 @@ static void init_amd(struct cpuinfo_x86 *c)
 	}
 
 	if (cpu_has(c, X86_FEATURE_EFRO)) {
-		rdmsr(MSR_K7_HWCR, l, h);
+		rdmsr(MSR_K8_HWCR, l, h);
 		l |= (1 << 27); /* Enable read-only APERF/MPERF bit */
-		wrmsr(MSR_K7_HWCR, l, h);
+		wrmsr(MSR_K8_HWCR, l, h);
 	}
 
 	/* Prevent TSC drift in non single-processor, single-core platforms. */
diff --git a/xen/arch/x86/cpu/hygon.c b/xen/arch/x86/cpu/hygon.c
index 2272e1113f..67e23c5df9 100644
--- a/xen/arch/x86/cpu/hygon.c
+++ b/xen/arch/x86/cpu/hygon.c
@@ -70,9 +70,9 @@ static void init_hygon(struct cpuinfo_x86 *c)
 		__set_bit(X86_FEATURE_ARAT, c->x86_capability);
 
 	if (cpu_has(c, X86_FEATURE_EFRO)) {
-		rdmsrl(MSR_K7_HWCR, value);
+		rdmsrl(MSR_K8_HWCR, value);
 		value |= (1 << 27); /* Enable read-only APERF/MPERF bit */
-		wrmsrl(MSR_K7_HWCR, value);
+		wrmsrl(MSR_K8_HWCR, value);
 	}
 
 	amd_log_freq(c);
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 7e38c257d8..a14841055f 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -297,7 +297,6 @@
 #define MSR_K7_CLK_CTL			0xc001001b
 #define MSR_K8_TOP_MEM2			0xc001001d
 
-#define MSR_K7_HWCR			0xc0010015
 #define MSR_K8_HWCR			0xc0010015
 #define K8_HWCR_TSC_FREQ_SEL		(1ULL << 24)
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 06:33:47 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 06:33:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153419.283463 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1k55-0002gu-Il; Fri, 09 Jul 2021 06:33:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153419.283463; Fri, 09 Jul 2021 06:33:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1k55-0002gl-EY; Fri, 09 Jul 2021 06:33:47 +0000
Received: by outflank-mailman (input) for mailman id 153419;
 Fri, 09 Jul 2021 06:33:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1k53-0002gI-NL
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 06:33:45 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1k53-0001xz-MU
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 06:33:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1k53-0000i2-Ld
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 06: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hisP6OEKX5wxVEmwlc4NOeKAQX5+ePOUkhOqCy4CTd4=; b=xs9QZVe+5G5oVAnJclDW1CPK88
	9LQhezLm566sQ0yIivgdYtcoOdCvasiYTWCoVLMOqvS1l1TD5JxVse/Q8OKYz/Wpt8KZ0/i9OkGoo
	8wjKSETeTd1j4KS9aspdYWKHku+gIHHUmLvlhA1EreQSLXPXovYj5aoA0NCflxaUBF6I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86emul: pad blob-execution "okay" messages
Message-Id: <E1m1k53-0000i2-Ld@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 06:33:45 +0000

commit 10cf9035d29c4b35fbecc02a73c285a4183dfa34
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jul 9 08:31:28 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 9 08:31:28 2021 +0200

    x86emul: pad blob-execution "okay" messages
    
    We already do so in the native execution case, and a few descriptions (I
    did notice this with SHA ones) are short enough for the output to look
    slightly odd.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 tools/tests/x86_emulator/test_x86_emulator.c | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/tools/tests/x86_emulator/test_x86_emulator.c b/tools/tests/x86_emulator/test_x86_emulator.c
index 9677476db0..9b3e98a1a5 100644
--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -5181,6 +5181,8 @@ int main(int argc, char **argv)
 
     for ( j = 0; j < ARRAY_SIZE(blobs); j++ )
     {
+        unsigned int nr;
+
         if ( blobs[j].check_cpu && !blobs[j].check_cpu() )
             continue;
 
@@ -5196,7 +5198,8 @@ int main(int argc, char **argv)
 
         if ( ctxt.addr_size == sizeof(void *) * CHAR_BIT )
         {
-            i = printf("Testing %s native execution...", blobs[j].name);
+            nr = printf("Testing %s native execution...", blobs[j].name);
+
             if ( blobs[j].set_regs )
                 blobs[j].set_regs(&regs);
             asm volatile (
@@ -5212,11 +5215,13 @@ int main(int argc, char **argv)
             );
             if ( !blobs[j].check_regs(&regs) )
                 goto fail;
-            printf("%*sokay\n", i < 40 ? 40 - i : 0, "");
+
+            printf("%*sokay\n", nr < 40 ? 40 - nr : 0, "");
         }
 
-        printf("Testing %s %u-bit code sequence",
-               blobs[j].name, ctxt.addr_size);
+        nr = printf("Testing %s %u-bit code sequence",
+                    blobs[j].name, ctxt.addr_size);
+
         if ( blobs[j].set_regs )
             blobs[j].set_regs(&regs);
         regs.eip = (unsigned long)res;
@@ -5233,7 +5238,10 @@ int main(int argc, char **argv)
                 regs.eip < (unsigned long)res + blobs[j].size )
         {
             if ( (i++ & 8191) == 0 )
+            {
                 printf(".");
+                ++nr;
+            }
             rc = x86_emulate(&ctxt, &emulops);
             if ( rc != X86EMUL_OKAY )
             {
@@ -5242,13 +5250,17 @@ int main(int argc, char **argv)
                 return 1;
             }
         }
-        for ( ; i < 2 * 8192; i += 8192 )
+        for ( ; i < 2 * 8192; i += 8192 ) {
             printf(".");
+            ++nr;
+        }
+
         if ( (regs.eip != 0x12345678) ||
              (regs.esp != ((unsigned long)res + MMAP_SZ)) ||
              !blobs[j].check_regs(&regs) )
             goto fail;
-        printf("okay\n");
+
+        printf("%*sokay\n", nr < 40 ? 40 - nr : 0, "");
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 06:33:56 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 06:33:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153420.283465 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1k5E-0002kc-Ke; Fri, 09 Jul 2021 06:33:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153420.283465; Fri, 09 Jul 2021 06:33:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1k5E-0002kU-Hf; Fri, 09 Jul 2021 06:33:56 +0000
Received: by outflank-mailman (input) for mailman id 153420;
 Fri, 09 Jul 2021 06:33:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1k5D-0002kK-QJ
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 06:33:55 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1k5D-0001yG-PV
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 06:33:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1k5D-0000iq-Oi
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 06: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>
DKIM-Signature: v=1; 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+5pSD7p0l/1soV4zYc5MijxMHIJuXhPvzCl4KZoXMA=; b=Mfr1QGk324no0Q+jIT4PggtDBM
	aPShL0iROYb75MMGkWP/F1ZKqiJ1XNt8UmrsZvWE2sLy9HdaRf69Mm4Se//BTTEpP1p8VoGOWtgzv
	oP+TDpeHtSAXArR3gUARLp8m4m3tY/ANiYlUOel0LanoJsMUeXikZ8T6xvJkYs4XQ/uE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: mark hypercall argument regs clobbering for intended fall-through
Message-Id: <E1m1k5D-0000iq-Oi@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 06:33:55 +0000

commit 140931aa2894991d9d6f1b2ba6ca275e1bc56259
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jul 9 08:32:07 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 9 08:32:07 2021 +0200

    x86: mark hypercall argument regs clobbering for intended fall-through
    
    The CIDs below are all for the PV side of things, yet while at it take
    care of the HVM side as well.
    
    Coverity-ID: 1485896, 1485901, 1485906, 1485910, 1485911,
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hypercall.c | 20 ++++++++++----------
 xen/arch/x86/pv/hypercall.c  | 20 ++++++++++----------
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index 9e1f7249f3..263d5407ea 100644
--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen/arch/x86/hvm/hypercall.c
@@ -248,11 +248,11 @@ int hvm_hypercall(struct cpu_user_regs *regs)
         /* Deliberately corrupt parameter regs not used by this hypercall. */
         switch ( hypercall_args_table[eax].native )
         {
-        case 0: rdi = 0xdeadbeefdeadf00dUL;
-        case 1: rsi = 0xdeadbeefdeadf00dUL;
-        case 2: rdx = 0xdeadbeefdeadf00dUL;
-        case 3: r10 = 0xdeadbeefdeadf00dUL;
-        case 4: r8 = 0xdeadbeefdeadf00dUL;
+        case 0: rdi = 0xdeadbeefdeadf00dUL; fallthrough;
+        case 1: rsi = 0xdeadbeefdeadf00dUL; fallthrough;
+        case 2: rdx = 0xdeadbeefdeadf00dUL; fallthrough;
+        case 3: r10 = 0xdeadbeefdeadf00dUL; fallthrough;
+        case 4: r8 = 0xdeadbeefdeadf00dUL; fallthrough;
         case 5: r9 = 0xdeadbeefdeadf00dUL;
         }
 #endif
@@ -266,11 +266,11 @@ int hvm_hypercall(struct cpu_user_regs *regs)
             /* Deliberately corrupt parameter regs used by this hypercall. */
             switch ( hypercall_args_table[eax].native )
             {
-            case 6: regs->r9  = 0xdeadbeefdeadf00dUL;
-            case 5: regs->r8  = 0xdeadbeefdeadf00dUL;
-            case 4: regs->r10 = 0xdeadbeefdeadf00dUL;
-            case 3: regs->rdx = 0xdeadbeefdeadf00dUL;
-            case 2: regs->rsi = 0xdeadbeefdeadf00dUL;
+            case 6: regs->r9  = 0xdeadbeefdeadf00dUL; fallthrough;
+            case 5: regs->r8  = 0xdeadbeefdeadf00dUL; fallthrough;
+            case 4: regs->r10 = 0xdeadbeefdeadf00dUL; fallthrough;
+            case 3: regs->rdx = 0xdeadbeefdeadf00dUL; fallthrough;
+            case 2: regs->rsi = 0xdeadbeefdeadf00dUL; fallthrough;
             case 1: regs->rdi = 0xdeadbeefdeadf00dUL;
             }
         }
diff --git a/xen/arch/x86/pv/hypercall.c b/xen/arch/x86/pv/hypercall.c
index 200b8a05b0..03939bdfcf 100644
--- a/xen/arch/x86/pv/hypercall.c
+++ b/xen/arch/x86/pv/hypercall.c
@@ -150,11 +150,11 @@ void pv_hypercall(struct cpu_user_regs *regs)
         /* Deliberately corrupt parameter regs not used by this hypercall. */
         switch ( hypercall_args_table[eax].native )
         {
-        case 0: rdi = 0xdeadbeefdeadf00dUL;
-        case 1: rsi = 0xdeadbeefdeadf00dUL;
-        case 2: rdx = 0xdeadbeefdeadf00dUL;
-        case 3: r10 = 0xdeadbeefdeadf00dUL;
-        case 4: r8 = 0xdeadbeefdeadf00dUL;
+        case 0: rdi = 0xdeadbeefdeadf00dUL; fallthrough;
+        case 1: rsi = 0xdeadbeefdeadf00dUL; fallthrough;
+        case 2: rdx = 0xdeadbeefdeadf00dUL; fallthrough;
+        case 3: r10 = 0xdeadbeefdeadf00dUL; fallthrough;
+        case 4: r8 = 0xdeadbeefdeadf00dUL; fallthrough;
         case 5: r9 = 0xdeadbeefdeadf00dUL;
         }
 #endif
@@ -173,11 +173,11 @@ void pv_hypercall(struct cpu_user_regs *regs)
             /* Deliberately corrupt parameter regs used by this hypercall. */
             switch ( hypercall_args_table[eax].native )
             {
-            case 6: regs->r9  = 0xdeadbeefdeadf00dUL;
-            case 5: regs->r8  = 0xdeadbeefdeadf00dUL;
-            case 4: regs->r10 = 0xdeadbeefdeadf00dUL;
-            case 3: regs->rdx = 0xdeadbeefdeadf00dUL;
-            case 2: regs->rsi = 0xdeadbeefdeadf00dUL;
+            case 6: regs->r9  = 0xdeadbeefdeadf00dUL; fallthrough;
+            case 5: regs->r8  = 0xdeadbeefdeadf00dUL; fallthrough;
+            case 4: regs->r10 = 0xdeadbeefdeadf00dUL; fallthrough;
+            case 3: regs->rdx = 0xdeadbeefdeadf00dUL; fallthrough;
+            case 2: regs->rsi = 0xdeadbeefdeadf00dUL; fallthrough;
             case 1: regs->rdi = 0xdeadbeefdeadf00dUL;
             }
         }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 11:33:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 11:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153574.283722 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1okk-0000Ek-Vk; Fri, 09 Jul 2021 11:33:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153574.283722; Fri, 09 Jul 2021 11:33:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1okk-0000Ed-Su; Fri, 09 Jul 2021 11:33:06 +0000
Received: by outflank-mailman (input) for mailman id 153574;
 Fri, 09 Jul 2021 11:33:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1okj-0000EX-NB
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 11:33:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1okj-0007bQ-JP
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 11:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1okj-0006KV-IQ
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EDR6M/V7nqoCXASP1MuRgUIopWGVv/i667HF0jO+3jU=; b=iYe2NuLRsntxzKM7b1CpmeM3VD
	21LwaMw4EShwk64864y1WgohJpT7F3bcv3B0rqnZHPJplvx3xeonRuVA5tlEaehwuauw0xEz7irRf
	fePK6oUPeJwKq7lVX4HR1vRoFtXWJIg55BdvJhkOURlqLUpFJMrjhaC/7BqWkLqS6GL4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools: ipxe: update for fixing build with GCC11
Message-Id: <E1m1okj-0006KV-IQ@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 11:33:05 +0000

commit ab50c903e5d550bf6545a636c9a23144b54d0eb5
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Wed Jun 16 15:14:35 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 11:12:27 2021 +0100

    tools: ipxe: update for fixing build with GCC11
    
    Use a snapshot which includes commit
    f3f568e382a5f19824b3bfc6081cde39eee661e8 ("[crypto] Add
    memory output constraints for big-integer inline assembly"),
    which fixes build with gcc11.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/firmware/etherboot/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/firmware/etherboot/Makefile b/tools/firmware/etherboot/Makefile
index ed9e11305f..4bc3633ba3 100644
--- a/tools/firmware/etherboot/Makefile
+++ b/tools/firmware/etherboot/Makefile
@@ -10,7 +10,8 @@ else
 IPXE_GIT_URL ?= git://git.ipxe.org/ipxe.git
 endif
 
-IPXE_GIT_TAG := 988d2c13cdf0f0b4140685af35ced70ac5b3283c
+# put an updated tar.gz on xenbits after changes to this variable
+IPXE_GIT_TAG := 3c040ad387099483102708bb1839110bc788cefb
 
 IPXE_TARBALL_URL ?= $(XEN_EXTFILES_URL)/ipxe-git-$(IPXE_GIT_TAG).tar.gz
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 11:33:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 11:33:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153576.283738 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1okv-0000ZL-Bc; Fri, 09 Jul 2021 11:33:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153576.283738; Fri, 09 Jul 2021 11:33:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1okv-0000ZB-7a; Fri, 09 Jul 2021 11:33:17 +0000
Received: by outflank-mailman (input) for mailman id 153576;
 Fri, 09 Jul 2021 11:33:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1okt-0000Y3-NL
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 11:33:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1okt-0007bd-MX
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 11:33:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1okt-0006Lm-Lb
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=n4H9/ShxBsTes8cPbVNC0vaD/hFw4roPsdpq/Lokfqs=; b=fQ/d+QsY14VZRh0g7MUMIFdScS
	gCV2doYqou4yNe/7efZqD3fpJ/N1U5DKl0d8JhsBEyIBUqkcXzUKcXWY+b3kopUrMvv/Bda/dptsd
	K/MV6+KdkGQ01WTJdIRlSrFhLwlwGU2wSVQbEtwN3nU1jhf7/6XER/pKKJ5nnWgkJCdk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxenstat: fix populating vbd.rd_sect
Message-Id: <E1m1okt-0006Lm-Lb@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 11:33:15 +0000

commit 89d57f291e37b4769ab26db919eba46548f2e13e
Author:     Richard Kojedzinszky <richard@kojedz.in>
AuthorDate: Fri Jul 9 10:06:45 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 11:12:27 2021 +0100

    tools/libxenstat: fix populating vbd.rd_sect
    
    Fixes: 91c3e3dc91d6 ("tools/xentop: Display '-' when stats are not available.")
    Signed-off-by: Richard Kojedzinszky <richard@kojedz.in>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libs/stat/xenstat_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/stat/xenstat_linux.c b/tools/libs/stat/xenstat_linux.c
index 875a0617ad..ebcd65f24a 100644
--- a/tools/libs/stat/xenstat_linux.c
+++ b/tools/libs/stat/xenstat_linux.c
@@ -475,7 +475,7 @@ int xenstat_collect_vbds(xenstat_node * node)
 				(read_attributes_vbd(dp->d_name, "statistics/wr_req", buf, 256)<=0) ||
 				((ret = sscanf(buf, "%llu", &vbd.wr_reqs)) != 1) ||
 				(read_attributes_vbd(dp->d_name, "statistics/rd_sect", buf, 256)<=0) ||
-				((ret = sscanf(buf, "%llu", &vbd.wr_sects)) != 1) ||
+				((ret = sscanf(buf, "%llu", &vbd.rd_sects)) != 1) ||
 				(read_attributes_vbd(dp->d_name, "statistics/wr_sect", buf, 256)<=0) ||
 				((ret = sscanf(buf, "%llu", &vbd.wr_sects)) != 1))
 			{
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 11:33:27 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 11:33:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153577.283741 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1ol5-0000hE-CN; Fri, 09 Jul 2021 11:33:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153577.283741; Fri, 09 Jul 2021 11:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1ol5-0000h4-95; Fri, 09 Jul 2021 11:33:27 +0000
Received: by outflank-mailman (input) for mailman id 153577;
 Fri, 09 Jul 2021 11:33:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1ol3-0000gL-QW
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 11:33:25 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1ol3-0007bn-Pk
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 11:33:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1ol3-0006MW-Oi
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6QR7mHardhonHHSI2K7gOVSLaV0FmzmgmLQ10oO93Zo=; b=V7AXS7iakPend8xm6ARuMH6nu4
	CJcVOOHkJ9h8P8Z8XgempRmljacMIvGjNUOgSrJUn3LpyEAaAqg8QyrTnXlkCoIABduZ9NftjE3fP
	EWz06bntuZGIVTnOC0nfzP3qGJTiXPg5Pxvc5yd7gMzd4AeVpq9ssJ19tvnbYUAMo6JQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] cirrus-ci: Fix FreeBSD build following QEMU update
Message-Id: <E1m1ol3-0006MW-Oi@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 11:33:25 +0000

commit 6de3e5fce5e2a3c5f438e8e214168dd3a474cbbf
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jul 8 12:52:14 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 11:12:27 2021 +0100

    cirrus-ci: Fix FreeBSD build following QEMU update
    
    QEMU requires ninja and bash to build now.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index fdb1c9c94d..b17f0b6369 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -4,7 +4,7 @@ freebsd_template: &FREEBSD_TEMPLATE
     APPEND_LIB: /usr/local/lib
     APPEND_INCLUDES: /usr/local/include
 
-  install_script: pkg install -y seabios gmake
+  install_script: pkg install -y seabios gmake ninja bash
                                  pkgconf python libiconv bison perl5
                                  yajl lzo2 pixman argp-standalone
                                  libxml2 glib git
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 13:33:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 13:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153672.283882 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1qct-00027N-5w; Fri, 09 Jul 2021 13:33:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153672.283882; Fri, 09 Jul 2021 13:33:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1qct-00027F-2l; Fri, 09 Jul 2021 13:33:07 +0000
Received: by outflank-mailman (input) for mailman id 153672;
 Fri, 09 Jul 2021 13:33:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1qcr-000279-0c
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 13:33:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1qcq-0001Bj-Tl
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 13:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1qcq-0006mq-Sn
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 13: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6JYi+dC5BV+pf0q332cZtrOXWSLG3SD7UIPFNeS/ves=; b=SeOhHjbWUueZEp6B+RFq9H5gk/
	7Jszga1GUWsjYKhWfPKy7esaOn7ktGYqbWF786fxM2qOupVxBtndaq+u0cTdRzmFEYk5Zx6ML3iR5
	9c0iw9tEQSVvUH+QzqUVCkYn6lBf+xYLNsA4utMnh2MAVgUmccUpqcqVt6IncADlrRoM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation: use zypper dup in tumbleweed dockerfile
Message-Id: <E1m1qcq-0006mq-Sn@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 13:33:04 +0000

commit ea7f91ded56e6de1fbf79b8a7c0985a5f5de5740
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 8 15:57:04 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 13:28:52 2021 +0100

    automation: use zypper dup in tumbleweed dockerfile
    
    The 'dup' command aligns the installed packages with the packages
    found in the enabled repositories, taking the repository priorities
    into account. Using this command is generally a safe thing to do.
    
    In the context of Tumbleweed using 'dup' is essential, because package
    versions might be downgraded, and package names occasionally change.
    Only 'dup' will do the correct thing in such cases.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/build/suse/opensuse-tumbleweed.dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/build/suse/opensuse-tumbleweed.dockerfile b/automation/build/suse/opensuse-tumbleweed.dockerfile
index a33ab0d870..3965e7f9cd 100644
--- a/automation/build/suse/opensuse-tumbleweed.dockerfile
+++ b/automation/build/suse/opensuse-tumbleweed.dockerfile
@@ -7,7 +7,7 @@ ENV USER root
 RUN mkdir /build
 WORKDIR /build
 
-RUN zypper ref && zypper up -y --no-recommends
+RUN zypper ref && zypper dup -y --no-recommends
 RUN zypper install -y --no-recommends \
         acpica \
         bc \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 13:33:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 13:33:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153673.283885 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1qd2-000296-7E; Fri, 09 Jul 2021 13:33:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153673.283885; Fri, 09 Jul 2021 13:33:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1qd2-00028y-4Q; Fri, 09 Jul 2021 13:33:16 +0000
Received: by outflank-mailman (input) for mailman id 153673;
 Fri, 09 Jul 2021 13:33:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1qd1-00028h-2O
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 13:33:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1qd1-0001Bp-1U
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 13:33:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1qd0-0006nV-Vw
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7SdbyRfe3lH9Vh8GMkbez23ASqR4+LIPfNFllSD9dV8=; b=IW+AJz26JFOZrGjjSn9Cboq5l6
	N2HxDL3ETkOGgbHlo8PuongOVoHE3nhDlKqh5RYiRjouVI7u+f1CIybQGw7w7+OOslltcjUV3IIIi
	4QnwSCP5qe1j+TkGQVUa/dqULZBNjqjirCsBcdTl4JDiLbVY8JxGDuJuT3UyeOryY2eg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation: avoid globbering the docker run args
Message-Id: <E1m1qd0-0006nV-Vw@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 13:33:14 +0000

commit 4905c2da20e2d95ff577033b0513d4bb57a9c086
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 8 16:56:49 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 13:28:52 2021 +0100

    automation: avoid globbering the docker run args
    
    containerize bash -c './configure && make' fails due to shell expansion.
    
    Collect all arguments for the script and pass them verbatim to the
    docker run command.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andew.cooper3@citrix.com>
---
 automation/scripts/containerize | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/automation/scripts/containerize b/automation/scripts/containerize
index 59edf0ba40..7682ccd347 100755
--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -47,10 +47,10 @@ case "_${CONTAINER_UID0}" in
 esac
 
 # Save the commands for future use
-cmd=$@
+cmd=("$@")
 
 # If no command was specified, just drop us into a shell if we're interactive
-[ $# -eq 0 ] && tty -s && cmd="/bin/bash"
+[ $# -eq 0 ] && tty -s && cmd=("/bin/bash")
 
 # Are we in an interactive terminal?
 tty -s && termint=t
@@ -104,4 +104,4 @@ exec ${docker_cmd} run \
     ${CONTAINER_ARGS} \
     -${termint}i --rm -- \
     ${CONTAINER} \
-    ${cmd}
+    "${cmd[@]}"
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 13:33:26 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 13:33:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153674.283890 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1qdC-0002Bp-9V; Fri, 09 Jul 2021 13:33:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153674.283890; Fri, 09 Jul 2021 13:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1qdC-0002Bh-60; Fri, 09 Jul 2021 13:33:26 +0000
Received: by outflank-mailman (input) for mailman id 153674;
 Fri, 09 Jul 2021 13:33:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1qdB-0002BR-5C
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 13:33:25 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1qdB-0001C7-4Q
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 13:33:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1qdB-0006o9-3a
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 13: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QxDWE/A3tsJzznGQduu20/uEouoCNSCk3cExfIxHmko=; b=GSLxI6HKmpQH56fnC1zrdDU1TX
	Zpo/7ZwoninoJkBlEYBaFKn/ip+/OGwhICxT6jXDyWvBinntbTpHm77DYJm/ieyret6nac/IfShy7
	qVAhJGfHa/OvS3wl8fFEjmojef4g9oTZkUy5DuXRh+RUIgB9F485I/whDGe8P1PEHLzU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation: document how to refresh a container
Message-Id: <E1m1qdB-0006o9-3a@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 13:33:25 +0000

commit cf4aa8dfb201a7db3e9ec2d4a2ff56961c7719fb
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 8 16:56:28 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 13:28:52 2021 +0100

    automation: document how to refresh a container
    
    The Tumbleweed container should be updated often.
    Describe the neccessary steps how to refresh and test it before
    pushing the new image to gitlab.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/build/README.md | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/automation/build/README.md b/automation/build/README.md
index e1fb3124de..2137957408 100644
--- a/automation/build/README.md
+++ b/automation/build/README.md
@@ -91,5 +91,17 @@ you have access to do so and have your Docker logged into the registry.
 To login you must run `docker login registry.gitlab.com`. For more
 information see the [registry help].
 
+This example shows how to refresh a container for a rolling release
+such as openSUSE Tumbleweed. Login with the gitlab.com credentials.
+
+```
+docker login registry.gitlab.com/xen-project/xen
+make -C automation/build suse/opensuse-tumbleweed
+env CONTAINER_NO_PULL=1 \
+  CONTAINER=tumbleweed \
+  automation/scripts/containerize bash -exc './configure && make'
+make -C automation/build suse/opensuse-tumbleweed PUSH=1
+```
+
 [registry]: https://gitlab.com/xen-project/xen/container_registry
 [registry help]: https://gitlab.com/help/user/project/container_registry
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 15:11:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 15:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153735.284012 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1s9k-0000EW-3T; Fri, 09 Jul 2021 15:11:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153735.284012; Fri, 09 Jul 2021 15:11:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1s9k-0000EN-08; Fri, 09 Jul 2021 15:11:08 +0000
Received: by outflank-mailman (input) for mailman id 153735;
 Fri, 09 Jul 2021 15:11:06 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1s9i-0000EE-Jk
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:11:06 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1s9h-0002uU-OK
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1s9h-0006Ei-NX
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VDwxShPwq9UVQFv+h87k1yunEaZYxTICwO3HoLDZ+uQ=; b=lrqANWpB4CNEMu+x+JX6Fjn1Ks
	QfAPxpxHc1QVEneAkhyPHVmuovs9O7U5rzaaPA46atD1Zk1uMH8779qjWmWR/C3eF43t2PTc+VSIj
	7gYl93DTOSOWAemAtFcDd2CxrEsPNRKAfgDZGihZdknlON913pbZzcSg59s9NnA+c00s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/debugger: Fix PAGE_SIZE redefinition error
Message-Id: <E1m1s9h-0006Ei-NX@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 15:11:05 +0000

commit 37588941a249a0b45a44a6385b187d7d10132e7d
Author:     Costin Lupu <costin.lupu@cs.pub.ro>
AuthorDate: Tue Jun 8 15:35:25 2021 +0300
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Jul 9 15:59:36 2021 +0100

    tools/debugger: Fix PAGE_SIZE redefinition error
    
    If PAGE_SIZE is already defined in the system (e.g. in /usr/include/limits.h
    header) then gcc will trigger a redefinition error because of -Werror. This
    patch replaces usage of PAGE_* macros with KDD_PAGE_* macros in order to avoid
    confusion between control domain page granularity (PAGE_* definitions) and
    guest domain page granularity (which is what we are dealing with here).
    
    We chose to define the KDD_PAGE_* macros instead of using XC_PAGE_* macros
    because (1) the code in kdd.c should not include any Xen headers and (2) to add
    consistency for code in both kdd.c and kdd-xen.c.
    
    Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/debugger/kdd/kdd-xen.c | 15 ++++++---------
 tools/debugger/kdd/kdd.c     | 19 ++++++++-----------
 tools/debugger/kdd/kdd.h     |  7 +++++++
 3 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/tools/debugger/kdd/kdd-xen.c b/tools/debugger/kdd/kdd-xen.c
index f3f9529f9f..e78c9311c4 100644
--- a/tools/debugger/kdd/kdd-xen.c
+++ b/tools/debugger/kdd/kdd-xen.c
@@ -48,9 +48,6 @@
 
 #define MAPSIZE 4093 /* Prime */
 
-#define PAGE_SHIFT 12
-#define PAGE_SIZE (1U << PAGE_SHIFT)
-
 struct kdd_guest {
     struct xentoollog_logger xc_log; /* Must be first for xc log callbacks */
     xc_interface *xc_handle;
@@ -72,7 +69,7 @@ static void flush_maps(kdd_guest *g)
     int i;
     for (i = 0; i < MAPSIZE; i++) {
         if (g->maps[i] != NULL)
-            munmap(g->maps[i], PAGE_SIZE);
+            munmap(g->maps[i], KDD_PAGE_SIZE);
         g->maps[i] = NULL;
     }
 }
@@ -490,13 +487,13 @@ static uint32_t kdd_access_physical_page(kdd_guest *g, uint64_t addr,
     uint32_t map_pfn, map_offset;
     uint8_t *map;
 
-    map_pfn = (addr >> PAGE_SHIFT);
-    map_offset = addr & (PAGE_SIZE - 1);
+    map_pfn = (addr >> KDD_PAGE_SHIFT);
+    map_offset = addr & (KDD_PAGE_SIZE - 1);
 
     /* Evict any mapping of the wrong frame from our slot */ 
     if (g->pfns[map_pfn % MAPSIZE] != map_pfn
         && g->maps[map_pfn % MAPSIZE] != NULL) {
-        munmap(g->maps[map_pfn % MAPSIZE], PAGE_SIZE);
+        munmap(g->maps[map_pfn % MAPSIZE], KDD_PAGE_SIZE);
         g->maps[map_pfn % MAPSIZE] = NULL;
     }
     g->pfns[map_pfn % MAPSIZE] = map_pfn;
@@ -507,7 +504,7 @@ static uint32_t kdd_access_physical_page(kdd_guest *g, uint64_t addr,
     else {
         map = xc_map_foreign_range(g->xc_handle,
                                    g->domid,
-                                   PAGE_SIZE,
+                                   KDD_PAGE_SIZE,
                                    PROT_READ|PROT_WRITE,
                                    map_pfn);
 
@@ -533,7 +530,7 @@ uint32_t kdd_access_physical(kdd_guest *g, uint64_t addr,
 {
     uint32_t chunk, rv, done = 0;
     while (len > 0) {
-        chunk = PAGE_SIZE - (addr & (PAGE_SIZE - 1));
+        chunk = KDD_PAGE_SIZE - (addr & (KDD_PAGE_SIZE - 1));
         if (chunk > len) 
             chunk = len;
         rv = kdd_access_physical_page(g, addr, chunk, buf, write);
diff --git a/tools/debugger/kdd/kdd.c b/tools/debugger/kdd/kdd.c
index 17513c2650..320c623eda 100644
--- a/tools/debugger/kdd/kdd.c
+++ b/tools/debugger/kdd/kdd.c
@@ -288,9 +288,6 @@ static void kdd_log_pkt(kdd_state *s, const char *name, kdd_pkt *p)
  *  Memory access: virtual addresses and syntactic sugar.
  */
 
-#define PAGE_SHIFT (12)
-#define PAGE_SIZE (1ULL << PAGE_SHIFT) 
-
 static uint32_t kdd_read_physical(kdd_state *s, uint64_t addr, 
                                   uint32_t len, void *buf)
 {
@@ -352,7 +349,7 @@ static uint64_t v2p(kdd_state *s, int cpuid, uint64_t va)
 
     /* Walk the appropriate number of levels */
     for (i = levels; i > 0; i--) {
-        shift = PAGE_SHIFT + bits * (i-1);
+        shift = KDD_PAGE_SHIFT + bits * (i-1);
         mask = ((1ULL << bits) - 1) << shift;
         offset = ((va & mask) >> shift) * width;
         KDD_DEBUG(s, "level %i: mask 0x%16.16"PRIx64" pa 0x%16.16"PRIx64
@@ -364,12 +361,12 @@ static uint64_t v2p(kdd_state *s, int cpuid, uint64_t va)
             return -1ULL; // Not present
         pa = entry & 0x000ffffffffff000ULL;
         if (pse && (i == 2) && (entry & 0x80)) { // Superpage
-            mask = ((1ULL << (PAGE_SHIFT + bits)) - 1);
+            mask = ((1ULL << (KDD_PAGE_SHIFT + bits)) - 1);
             return (pa & ~mask) + (va & mask);
         }
     }
 
-    return pa + (va & (PAGE_SIZE - 1));
+    return pa + (va & (KDD_PAGE_SIZE - 1));
 }
 
 static uint32_t kdd_access_virtual(kdd_state *s, int cpuid, uint64_t addr,
@@ -380,7 +377,7 @@ static uint32_t kdd_access_virtual(kdd_state *s, int cpuid, uint64_t addr,
     
     /* Process one page at a time */
     while (len > 0) {
-        chunk = PAGE_SIZE - (addr & (PAGE_SIZE - 1));
+        chunk = KDD_PAGE_SIZE - (addr & (KDD_PAGE_SIZE - 1));
         if (chunk > len) 
             chunk = len;
         pa = v2p(s, cpuid, addr);
@@ -591,7 +588,7 @@ static void get_os_info_64(kdd_state *s)
     uint64_t dbgkd_addr;
     DBGKD_GET_VERSION64 dbgkd_get_version64;
     /* Maybe 1GB is too big for the limit to search? */
-    uint32_t search_limit = (1024 * 1024 * 1024) / PAGE_SIZE; /*1GB/PageSize*/
+    uint32_t search_limit = (1024 * 1024 * 1024) / KDD_PAGE_SIZE; /*1GB/PageSize*/
     uint64_t efer;
 
     /* if we are not in 64-bit mode, fail */
@@ -620,7 +617,7 @@ static void get_os_info_64(kdd_state *s)
      * in 1GB range above the current page base address
      */
 
-    base = idt0_addr & ~(PAGE_SIZE - 1);
+    base = idt0_addr & ~(KDD_PAGE_SIZE - 1);
 
     while (search_limit) {
         uint16_t val;
@@ -633,7 +630,7 @@ static void get_os_info_64(kdd_state *s)
         if (val == MZ_HEADER) // MZ
             break;
 
-        base -= PAGE_SIZE;
+        base -= KDD_PAGE_SIZE;
         search_limit -= 1;
     }
 
@@ -720,7 +717,7 @@ static void find_os(kdd_state *s)
         /* Try each page in the potential range of kernel load addresses */
         for (limit = s->os.base + s->os.range;
              s->os.base <= limit;
-             s->os.base += PAGE_SIZE)
+             s->os.base += KDD_PAGE_SIZE)
             if (check_os(s))
                 return;
     }
diff --git a/tools/debugger/kdd/kdd.h b/tools/debugger/kdd/kdd.h
index b9a17440df..b476a76d93 100644
--- a/tools/debugger/kdd/kdd.h
+++ b/tools/debugger/kdd/kdd.h
@@ -39,6 +39,13 @@
 
 #define PACKED __attribute__((packed))
 
+/* We define our page related constants here in order to specifically
+ * avoid using the Xen page macros (this is a restriction for the code
+ * in kdd.c which should not include any Xen headers) and to add
+ * consistency for code in both kdd.c and kdd-xen.c. */
+#define KDD_PAGE_SHIFT 12
+#define KDD_PAGE_SIZE (1U << KDD_PAGE_SHIFT)
+
 /*****************************************************************************
  * Serial line protocol: Sender sends a 16-byte header with an optional
  * payload following it.  Receiver responds to each packet with an
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 15:11:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 15:11:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153736.284016 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1s9t-0000GM-4g; Fri, 09 Jul 2021 15:11:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153736.284016; Fri, 09 Jul 2021 15:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1s9t-0000GA-1b; Fri, 09 Jul 2021 15:11:17 +0000
Received: by outflank-mailman (input) for mailman id 153736;
 Fri, 09 Jul 2021 15:11:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1s9r-0000Fy-SK
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:11:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1s9r-0002uY-Ra
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:11:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1s9r-0006G3-Qh
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=x9TJQt1ShQJ8csNzKiMURt0SNOZ3Ha+qzooSR4tN7TU=; b=O3qpgf5S4No5fzwRgzQEIcePGp
	OvjV6w9o8pO6CQqWofXrMyz1iBnXhz6C1etsKSzGJv5Gq0efFT+COTnbcjF6MSwRerr+1LgRH85SZ
	u43ERcR+0+sDe7+KnxOG+NbuV6d7uUwBFVSwzIr5KvVuLjSwRFY5BCYbP/j/afTlh4jU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libfsimage: Fix PATH_MAX redefinition error
Message-Id: <E1m1s9r-0006G3-Qh@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 15:11:15 +0000

commit d276e0f3f14f2d46f27989008770eb2b9c678bc4
Author:     Costin Lupu <costin.lupu@cs.pub.ro>
AuthorDate: Tue Jun 8 15:35:26 2021 +0300
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Jul 9 15:59:59 2021 +0100

    tools/libfsimage: Fix PATH_MAX redefinition error
    
    If PATH_MAX is already defined in the system (e.g. in /usr/include/limits.h
    header) then gcc will trigger a redefinition error because of -Werror.
    
    Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libfsimage/ext2fs/fsys_ext2fs.c     | 2 ++
 tools/libfsimage/reiserfs/fsys_reiserfs.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/tools/libfsimage/ext2fs/fsys_ext2fs.c b/tools/libfsimage/ext2fs/fsys_ext2fs.c
index a4ed10419c..5ed8fce90e 100644
--- a/tools/libfsimage/ext2fs/fsys_ext2fs.c
+++ b/tools/libfsimage/ext2fs/fsys_ext2fs.c
@@ -278,7 +278,9 @@ struct ext4_extent_header {
 
 #define EXT2_SUPER_MAGIC      0xEF53	/* include/linux/ext2_fs.h */
 #define EXT2_ROOT_INO              2	/* include/linux/ext2_fs.h */
+#ifndef PATH_MAX
 #define PATH_MAX                1024	/* include/linux/limits.h */
+#endif
 #define MAX_LINK_COUNT             5	/* number of symbolic links to follow */
 
 /* made up, these are pointers into FSYS_BUF */
diff --git a/tools/libfsimage/reiserfs/fsys_reiserfs.c b/tools/libfsimage/reiserfs/fsys_reiserfs.c
index 916eb15292..10ca657476 100644
--- a/tools/libfsimage/reiserfs/fsys_reiserfs.c
+++ b/tools/libfsimage/reiserfs/fsys_reiserfs.c
@@ -284,7 +284,9 @@ struct reiserfs_de_head
 #define S_ISDIR(mode) (((mode) & 0170000) == 0040000)
 #define S_ISLNK(mode) (((mode) & 0170000) == 0120000)
 
+#ifndef PATH_MAX
 #define PATH_MAX       1024	/* include/linux/limits.h */
+#endif
 #define MAX_LINK_COUNT    5	/* number of symbolic links to follow */
 
 /* The size of the node cache */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 15:11:27 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 15:11:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153737.284021 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1sA3-0000KT-70; Fri, 09 Jul 2021 15:11:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153737.284021; Fri, 09 Jul 2021 15:11:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1sA3-0000KL-37; Fri, 09 Jul 2021 15:11:27 +0000
Received: by outflank-mailman (input) for mailman id 153737;
 Fri, 09 Jul 2021 15:11:26 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sA2-0000K5-1J
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:11:26 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sA2-0002uj-0S
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:11:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sA1-0006Gm-Tw
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1GZH6Z1ZgmA5fCyUr4jIYQGVf5mH1iswqCSaJjxpeBs=; b=euO/m1WRyz6acyY7637cupvoHS
	rkxTVSYfOiNPBeTrgL8SUOBY6RdvyCpJpEMSj4R2tjKMpsgCHiv5mD/vYQOTveZe3yYnLKg2yMnY0
	Q3mz0wXN9HKJ+fFHaftrXuy3+aqX0yRzuUIdowEfi4DNZgajQAbVfl4vzyBxR14Dq9o8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libs/foreignmemory: Fix PAGE_SIZE redefinition error
Message-Id: <E1m1sA1-0006Gm-Tw@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 15:11:25 +0000

commit 0dbb4be739c50b8018aeeb285ef290bf7962a28e
Author:     Costin Lupu <costin.lupu@cs.pub.ro>
AuthorDate: Tue Jun 8 15:35:27 2021 +0300
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Jul 9 16:00:02 2021 +0100

    tools/libs/foreignmemory: Fix PAGE_SIZE redefinition error
    
    If PAGE_SIZE is already defined in the system (e.g. in /usr/include/limits.h
    header) then gcc will trigger a redefinition error because of -Werror. This
    patch replaces usage of PAGE_* macros with XC_PAGE_* macros in order to avoid
    confusion between control domain page granularity (PAGE_* definitions) and
    guest domain page granularity.
    
    The exception is in osdep_xenforeignmemory_map() where we need the system page
    size to check whether the PFN array should be allocated with mmap() or with
    dynamic allocation.
    
    Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libs/foreignmemory/core.c    |  2 +-
 tools/libs/foreignmemory/freebsd.c | 10 +++++-----
 tools/libs/foreignmemory/linux.c   | 23 ++++++++++++-----------
 tools/libs/foreignmemory/minios.c  |  2 +-
 tools/libs/foreignmemory/netbsd.c  | 10 +++++-----
 tools/libs/foreignmemory/private.h |  9 +--------
 6 files changed, 25 insertions(+), 31 deletions(-)

diff --git a/tools/libs/foreignmemory/core.c b/tools/libs/foreignmemory/core.c
index 28ec311af1..7edc6f0dbf 100644
--- a/tools/libs/foreignmemory/core.c
+++ b/tools/libs/foreignmemory/core.c
@@ -202,7 +202,7 @@ int xenforeignmemory_resource_size(
     if ( rc )
         return rc;
 
-    *size = fres.nr_frames << PAGE_SHIFT;
+    *size = fres.nr_frames << XC_PAGE_SHIFT;
     return 0;
 }
 
diff --git a/tools/libs/foreignmemory/freebsd.c b/tools/libs/foreignmemory/freebsd.c
index d94ea07862..2cf0fa1c38 100644
--- a/tools/libs/foreignmemory/freebsd.c
+++ b/tools/libs/foreignmemory/freebsd.c
@@ -63,7 +63,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
     privcmd_mmapbatch_t ioctlx;
     int rc;
 
-    addr = mmap(addr, num << PAGE_SHIFT, prot, flags | MAP_SHARED, fd, 0);
+    addr = mmap(addr, num << XC_PAGE_SHIFT, prot, flags | MAP_SHARED, fd, 0);
     if ( addr == MAP_FAILED )
         return NULL;
 
@@ -78,7 +78,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
     {
         int saved_errno = errno;
 
-        (void)munmap(addr, num << PAGE_SHIFT);
+        (void)munmap(addr, num << XC_PAGE_SHIFT);
         errno = saved_errno;
         return NULL;
     }
@@ -89,7 +89,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num)
 {
-    return munmap(addr, num << PAGE_SHIFT);
+    return munmap(addr, num << XC_PAGE_SHIFT);
 }
 
 int osdep_xenforeignmemory_restrict(xenforeignmemory_handle *fmem,
@@ -101,7 +101,7 @@ int osdep_xenforeignmemory_restrict(xenforeignmemory_handle *fmem,
 int osdep_xenforeignmemory_unmap_resource(xenforeignmemory_handle *fmem,
                                         xenforeignmemory_resource_handle *fres)
 {
-    return fres ? munmap(fres->addr, fres->nr_frames << PAGE_SHIFT) : 0;
+    return fres ? munmap(fres->addr, fres->nr_frames << XC_PAGE_SHIFT) : 0;
 }
 
 int osdep_xenforeignmemory_map_resource(xenforeignmemory_handle *fmem,
@@ -120,7 +120,7 @@ int osdep_xenforeignmemory_map_resource(xenforeignmemory_handle *fmem,
         /* Request for resource size.  Skip mmap(). */
         goto skip_mmap;
 
-    fres->addr = mmap(fres->addr, fres->nr_frames << PAGE_SHIFT,
+    fres->addr = mmap(fres->addr, fres->nr_frames << XC_PAGE_SHIFT,
                       fres->prot, fres->flags | MAP_SHARED, fmem->fd, 0);
     if ( fres->addr == MAP_FAILED )
         return -1;
diff --git a/tools/libs/foreignmemory/linux.c b/tools/libs/foreignmemory/linux.c
index c1f35e2db7..9062117407 100644
--- a/tools/libs/foreignmemory/linux.c
+++ b/tools/libs/foreignmemory/linux.c
@@ -134,7 +134,7 @@ static int retry_paged(int fd, uint32_t dom, void *addr,
         /* At least one gfn is still in paging state */
         ioctlx.num = 1;
         ioctlx.dom = dom;
-        ioctlx.addr = (unsigned long)addr + (i<<PAGE_SHIFT);
+        ioctlx.addr = (unsigned long)addr + (i<<XC_PAGE_SHIFT);
         ioctlx.arr = arr + i;
         ioctlx.err = err + i;
 
@@ -168,7 +168,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
     size_t i;
     int rc;
 
-    addr = mmap(addr, num << PAGE_SHIFT, prot, flags | MAP_SHARED,
+    addr = mmap(addr, num << XC_PAGE_SHIFT, prot, flags | MAP_SHARED,
                 fd, 0);
     if ( addr == MAP_FAILED )
         return NULL;
@@ -198,9 +198,10 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
          */
         privcmd_mmapbatch_t ioctlx;
         xen_pfn_t *pfn;
-        unsigned int pfn_arr_size = ROUNDUP((num * sizeof(*pfn)), PAGE_SHIFT);
+        unsigned int pfn_arr_size = ROUNDUP((num * sizeof(*pfn)), XC_PAGE_SHIFT);
+        int os_page_size = sysconf(_SC_PAGESIZE);
 
-        if ( pfn_arr_size <= PAGE_SIZE )
+        if ( pfn_arr_size <= os_page_size )
             pfn = alloca(num * sizeof(*pfn));
         else
         {
@@ -209,7 +210,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
             if ( pfn == MAP_FAILED )
             {
                 PERROR("mmap of pfn array failed");
-                (void)munmap(addr, num << PAGE_SHIFT);
+                (void)munmap(addr, num << XC_PAGE_SHIFT);
                 return NULL;
             }
         }
@@ -242,7 +243,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                     continue;
                 }
                 rc = map_foreign_batch_single(fd, dom, pfn + i,
-                        (unsigned long)addr + (i<<PAGE_SHIFT));
+                        (unsigned long)addr + (i<<XC_PAGE_SHIFT));
                 if ( rc < 0 )
                 {
                     rc = -errno;
@@ -254,7 +255,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
             break;
         }
 
-        if ( pfn_arr_size > PAGE_SIZE )
+        if ( pfn_arr_size > os_page_size )
             munmap(pfn, pfn_arr_size);
 
         if ( rc == -ENOENT && i == num )
@@ -270,7 +271,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
     {
         int saved_errno = errno;
 
-        (void)munmap(addr, num << PAGE_SHIFT);
+        (void)munmap(addr, num << XC_PAGE_SHIFT);
         errno = saved_errno;
         return NULL;
     }
@@ -281,7 +282,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num)
 {
-    return munmap(addr, num << PAGE_SHIFT);
+    return munmap(addr, num << XC_PAGE_SHIFT);
 }
 
 int osdep_xenforeignmemory_restrict(xenforeignmemory_handle *fmem,
@@ -293,7 +294,7 @@ int osdep_xenforeignmemory_restrict(xenforeignmemory_handle *fmem,
 int osdep_xenforeignmemory_unmap_resource(
     xenforeignmemory_handle *fmem, xenforeignmemory_resource_handle *fres)
 {
-    return fres ? munmap(fres->addr, fres->nr_frames << PAGE_SHIFT) : 0;
+    return fres ? munmap(fres->addr, fres->nr_frames << XC_PAGE_SHIFT) : 0;
 }
 
 int osdep_xenforeignmemory_map_resource(
@@ -312,7 +313,7 @@ int osdep_xenforeignmemory_map_resource(
         /* Request for resource size.  Skip mmap(). */
         goto skip_mmap;
 
-    fres->addr = mmap(fres->addr, fres->nr_frames << PAGE_SHIFT,
+    fres->addr = mmap(fres->addr, fres->nr_frames << XC_PAGE_SHIFT,
                       fres->prot, fres->flags | MAP_SHARED, fmem->fd, 0);
     if ( fres->addr == MAP_FAILED )
         return -1;
diff --git a/tools/libs/foreignmemory/minios.c b/tools/libs/foreignmemory/minios.c
index 43341ca301..c5453736d5 100644
--- a/tools/libs/foreignmemory/minios.c
+++ b/tools/libs/foreignmemory/minios.c
@@ -55,7 +55,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num)
 {
-    return munmap(addr, num << PAGE_SHIFT);
+    return munmap(addr, num << XC_PAGE_SHIFT);
 }
 
 /*
diff --git a/tools/libs/foreignmemory/netbsd.c b/tools/libs/foreignmemory/netbsd.c
index c0b1b8f79d..597db775d7 100644
--- a/tools/libs/foreignmemory/netbsd.c
+++ b/tools/libs/foreignmemory/netbsd.c
@@ -76,7 +76,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
 {
     int fd = fmem->fd;
     privcmd_mmapbatch_v2_t ioctlx;
-    addr = mmap(addr, num * PAGE_SIZE, prot,
+    addr = mmap(addr, num * XC_PAGE_SIZE, prot,
                 flags | MAP_ANON | MAP_SHARED, -1, 0);
     if ( addr == MAP_FAILED ) {
         PERROR("osdep_xenforeignmemory_map: mmap failed");
@@ -93,7 +93,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
     {
         int saved_errno = errno;
         PERROR("osdep_xenforeignmemory_map: ioctl failed");
-        munmap(addr, num * PAGE_SIZE);
+        munmap(addr, num * XC_PAGE_SIZE);
         errno = saved_errno;
         return NULL;
     }
@@ -104,7 +104,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num)
 {
-    return munmap(addr, num * PAGE_SIZE);
+    return munmap(addr, num * XC_PAGE_SIZE);
 }
 
 int osdep_xenforeignmemory_restrict(xenforeignmemory_handle *fmem,
@@ -117,7 +117,7 @@ int osdep_xenforeignmemory_restrict(xenforeignmemory_handle *fmem,
 int osdep_xenforeignmemory_unmap_resource(
     xenforeignmemory_handle *fmem, xenforeignmemory_resource_handle *fres)
 {
-    return fres ? munmap(fres->addr, fres->nr_frames << PAGE_SHIFT) : 0;
+    return fres ? munmap(fres->addr, fres->nr_frames << XC_PAGE_SHIFT) : 0;
 }
 
 int osdep_xenforeignmemory_map_resource(
@@ -136,7 +136,7 @@ int osdep_xenforeignmemory_map_resource(
         /* Request for resource size.  Skip mmap(). */
         goto skip_mmap;
 
-    fres->addr = mmap(fres->addr, fres->nr_frames << PAGE_SHIFT,
+    fres->addr = mmap(fres->addr, fres->nr_frames << XC_PAGE_SHIFT,
                       fres->prot, fres->flags | MAP_ANON | MAP_SHARED, -1, 0);
     if ( fres->addr == MAP_FAILED )
         return -1;
diff --git a/tools/libs/foreignmemory/private.h b/tools/libs/foreignmemory/private.h
index 5bb0cefb09..8540303adc 100644
--- a/tools/libs/foreignmemory/private.h
+++ b/tools/libs/foreignmemory/private.h
@@ -1,6 +1,7 @@
 #ifndef XENFOREIGNMEMORY_PRIVATE_H
 #define XENFOREIGNMEMORY_PRIVATE_H
 
+#include <xenctrl.h>
 #include <xentoollog.h>
 
 #include <xenforeignmemory.h>
@@ -10,14 +11,6 @@
 #include <xen/xen.h>
 #include <xen/sys/privcmd.h>
 
-#ifndef PAGE_SHIFT /* Mini-os, Yukk */
-#define PAGE_SHIFT           12
-#endif
-#ifndef __MINIOS__ /* Yukk */
-#define PAGE_SIZE            (1UL << PAGE_SHIFT)
-#define PAGE_MASK            (~(PAGE_SIZE-1))
-#endif
-
 struct xenforeignmemory_handle {
     xentoollog_logger *logger, *logger_tofree;
     unsigned flags;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 15:11:37 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 15:11:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153738.284024 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1sAD-0000O9-9k; Fri, 09 Jul 2021 15:11:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153738.284024; Fri, 09 Jul 2021 15:11:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1sAD-0000Nz-6f; Fri, 09 Jul 2021 15:11:37 +0000
Received: by outflank-mailman (input) for mailman id 153738;
 Fri, 09 Jul 2021 15:11:36 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sAC-0000Nm-4W
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:11:36 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sAC-0002uz-3c
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:11:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sAC-0006HY-2m
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Oqkzs9u+cqUPa/d9O4TxiCGX2exfp/I+s0j5SL2b9yc=; b=akViia7bj5AVArMXOskJA6O1OQ
	PU53wC+S1pGGqPR3I5PluXAoM+6UHanOd1ke6jvh8nnNdDKfohAQ9GDMWqFdIjk5biolVtJzOrOLr
	VxtjYdKu1PpKsXs0NWcU5UV+ukC1yl9nC6YBzfs+2oRD1gFE2j0+qS6nzYwKRokI9wJQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libs/gnttab: Fix PAGE_SIZE redefinition error
Message-Id: <E1m1sAC-0006HY-2m@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 15:11:36 +0000

commit d1b32abd94b620db05dfff0f4ce9cc17b9da0ccf
Author:     Costin Lupu <costin.lupu@cs.pub.ro>
AuthorDate: Tue Jun 8 15:35:28 2021 +0300
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Jul 9 16:00:05 2021 +0100

    tools/libs/gnttab: Fix PAGE_SIZE redefinition error
    
    If PAGE_SIZE is already defined in the system (e.g. in /usr/include/limits.h
    header) then gcc will trigger a redefinition error because of -Werror. This
    patch replaces usage of PAGE_* macros with XC_PAGE_* macros in order to avoid
    confusion between control domain page granularity (PAGE_* definitions) and
    guest domain page granularity.
    
    The exception is in osdep_xenforeignmemory_map() where we need the system page
    size to check whether the PFN array should be allocated with mmap() or with
    dynamic allocation.
    
    Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libs/gnttab/freebsd.c | 28 +++++++++++++---------------
 tools/libs/gnttab/linux.c   | 28 +++++++++++++---------------
 tools/libs/gnttab/netbsd.c  | 23 ++++++++++-------------
 3 files changed, 36 insertions(+), 43 deletions(-)

diff --git a/tools/libs/gnttab/freebsd.c b/tools/libs/gnttab/freebsd.c
index 768af701c6..e42ac3fbf3 100644
--- a/tools/libs/gnttab/freebsd.c
+++ b/tools/libs/gnttab/freebsd.c
@@ -30,14 +30,11 @@
 
 #include <xen/sys/gntdev.h>
 
+#include <xenctrl.h>
 #include <xen-tools/libs.h>
 
 #include "private.h"
 
-#define PAGE_SHIFT           12
-#define PAGE_SIZE            (1UL << PAGE_SHIFT)
-#define PAGE_MASK            (~(PAGE_SIZE-1))
-
 #define DEVXEN "/dev/xen/gntdev"
 
 int osdep_gnttab_open(xengnttab_handle *xgt)
@@ -77,10 +74,11 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
     int domids_stride;
     unsigned int refs_size = ROUNDUP(count *
                                      sizeof(struct ioctl_gntdev_grant_ref),
-                                     PAGE_SHIFT);
+                                     XC_PAGE_SHIFT);
+    int os_page_size = getpagesize();
 
     domids_stride = (flags & XENGNTTAB_GRANT_MAP_SINGLE_DOMAIN) ? 0 : 1;
-    if ( refs_size <= PAGE_SIZE )
+    if ( refs_size <= os_page_size )
         map.refs = malloc(refs_size);
     else
     {
@@ -107,7 +105,7 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
         goto out;
     }
 
-    addr = mmap(NULL, PAGE_SIZE * count, prot, MAP_SHARED, fd,
+    addr = mmap(NULL, XC_PAGE_SIZE * count, prot, MAP_SHARED, fd,
                 map.index);
     if ( addr != MAP_FAILED )
     {
@@ -116,7 +114,7 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
 
         notify.index = map.index;
         notify.action = 0;
-        if ( notify_offset < PAGE_SIZE * count )
+        if ( notify_offset < XC_PAGE_SIZE * count )
         {
             notify.index += notify_offset;
             notify.action |= UNMAP_NOTIFY_CLEAR_BYTE;
@@ -131,7 +129,7 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
         if ( rv )
         {
             GTERROR(xgt->logger, "ioctl SET_UNMAP_NOTIFY failed");
-            munmap(addr, count * PAGE_SIZE);
+            munmap(addr, count * XC_PAGE_SIZE);
             addr = MAP_FAILED;
         }
     }
@@ -150,7 +148,7 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
     }
 
  out:
-    if ( refs_size > PAGE_SIZE )
+    if ( refs_size > os_page_size )
         munmap(map.refs, refs_size);
     else
         free(map.refs);
@@ -189,7 +187,7 @@ int osdep_gnttab_unmap(xengnttab_handle *xgt,
     }
 
     /* Next, unmap the memory. */
-    if ( (rc = munmap(start_address, count * PAGE_SIZE)) )
+    if ( (rc = munmap(start_address, count * XC_PAGE_SIZE)) )
         return rc;
 
     /* Finally, unmap the driver slots used to store the grant information. */
@@ -256,7 +254,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
         goto out;
     }
 
-    area = mmap(NULL, count * PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED,
+    area = mmap(NULL, count * XC_PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED,
                 fd, gref_info.index);
 
     if ( area == MAP_FAILED )
@@ -268,7 +266,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
 
     notify.index = gref_info.index;
     notify.action = 0;
-    if ( notify_offset < PAGE_SIZE * count )
+    if ( notify_offset < XC_PAGE_SIZE * count )
     {
         notify.index += notify_offset;
         notify.action |= UNMAP_NOTIFY_CLEAR_BYTE;
@@ -283,7 +281,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
     if ( err )
     {
         GSERROR(xgs->logger, "ioctl SET_UNMAP_NOTIFY failed");
-        munmap(area, count * PAGE_SIZE);
+        munmap(area, count * XC_PAGE_SIZE);
         area = NULL;
     }
 
@@ -306,7 +304,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
 int osdep_gntshr_unshare(xengntshr_handle *xgs,
                          void *start_address, uint32_t count)
 {
-    return munmap(start_address, count * PAGE_SIZE);
+    return munmap(start_address, count * XC_PAGE_SIZE);
 }
 
 /*
diff --git a/tools/libs/gnttab/linux.c b/tools/libs/gnttab/linux.c
index 74331a4c7b..5628fd5719 100644
--- a/tools/libs/gnttab/linux.c
+++ b/tools/libs/gnttab/linux.c
@@ -32,14 +32,11 @@
 #include <xen/sys/gntdev.h>
 #include <xen/sys/gntalloc.h>
 
+#include <xenctrl.h>
 #include <xen-tools/libs.h>
 
 #include "private.h"
 
-#define PAGE_SHIFT           12
-#define PAGE_SIZE            (1UL << PAGE_SHIFT)
-#define PAGE_MASK            (~(PAGE_SIZE-1))
-
 #define DEVXEN "/dev/xen/"
 
 #ifndef O_CLOEXEC
@@ -92,6 +89,7 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
     int fd = xgt->fd;
     struct ioctl_gntdev_map_grant_ref *map;
     unsigned int map_size = sizeof(*map) + (count - 1) * sizeof(map->refs[0]);
+    int os_page_size = sysconf(_SC_PAGESIZE);
     void *addr = NULL;
     int domids_stride = 1;
     int i;
@@ -99,11 +97,11 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
     if (flags & XENGNTTAB_GRANT_MAP_SINGLE_DOMAIN)
         domids_stride = 0;
 
-    if ( map_size <= PAGE_SIZE )
+    if ( map_size <= os_page_size )
         map = alloca(map_size);
     else
     {
-        map_size = ROUNDUP(map_size, PAGE_SHIFT);
+        map_size = ROUNDUP(map_size, XC_PAGE_SHIFT);
         map = mmap(NULL, map_size, PROT_READ | PROT_WRITE,
                    MAP_PRIVATE | MAP_ANON | MAP_POPULATE, -1, 0);
         if ( map == MAP_FAILED )
@@ -127,7 +125,7 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
     }
 
  retry:
-    addr = mmap(NULL, PAGE_SIZE * count, prot, MAP_SHARED, fd,
+    addr = mmap(NULL, XC_PAGE_SIZE * count, prot, MAP_SHARED, fd,
                 map->index);
 
     if (addr == MAP_FAILED && errno == EAGAIN)
@@ -152,7 +150,7 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
         struct ioctl_gntdev_unmap_notify notify;
         notify.index = map->index;
         notify.action = 0;
-        if (notify_offset < PAGE_SIZE * count) {
+        if (notify_offset < XC_PAGE_SIZE * count) {
             notify.index += notify_offset;
             notify.action |= UNMAP_NOTIFY_CLEAR_BYTE;
         }
@@ -164,7 +162,7 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
             rv = ioctl(fd, IOCTL_GNTDEV_SET_UNMAP_NOTIFY, &notify);
         if (rv) {
             GTERROR(xgt->logger, "ioctl SET_UNMAP_NOTIFY failed");
-            munmap(addr, count * PAGE_SIZE);
+            munmap(addr, count * XC_PAGE_SIZE);
             addr = MAP_FAILED;
         }
     }
@@ -184,7 +182,7 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
     }
 
  out:
-    if ( map_size > PAGE_SIZE )
+    if ( map_size > os_page_size )
         munmap(map, map_size);
 
     return addr;
@@ -220,7 +218,7 @@ int osdep_gnttab_unmap(xengnttab_handle *xgt,
     }
 
     /* Next, unmap the memory. */
-    if ( (rc = munmap(start_address, count * PAGE_SIZE)) )
+    if ( (rc = munmap(start_address, count * XC_PAGE_SIZE)) )
         return rc;
 
     /* Finally, unmap the driver slots used to store the grant information. */
@@ -466,7 +464,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
         goto out;
     }
 
-    area = mmap(NULL, count * PAGE_SIZE, PROT_READ | PROT_WRITE,
+    area = mmap(NULL, count * XC_PAGE_SIZE, PROT_READ | PROT_WRITE,
         MAP_SHARED, fd, gref_info->index);
 
     if (area == MAP_FAILED) {
@@ -477,7 +475,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
 
     notify.index = gref_info->index;
     notify.action = 0;
-    if (notify_offset < PAGE_SIZE * count) {
+    if (notify_offset < XC_PAGE_SIZE * count) {
         notify.index += notify_offset;
         notify.action |= UNMAP_NOTIFY_CLEAR_BYTE;
     }
@@ -489,7 +487,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
         err = ioctl(fd, IOCTL_GNTALLOC_SET_UNMAP_NOTIFY, &notify);
     if (err) {
         GSERROR(xgs->logger, "ioctl SET_UNMAP_NOTIFY failed");
-        munmap(area, count * PAGE_SIZE);
+        munmap(area, count * XC_PAGE_SIZE);
         area = NULL;
     }
 
@@ -510,7 +508,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
 int osdep_gntshr_unshare(xengntshr_handle *xgs,
                          void *start_address, uint32_t count)
 {
-    return munmap(start_address, count * PAGE_SIZE);
+    return munmap(start_address, count * XC_PAGE_SIZE);
 }
 
 /*
diff --git a/tools/libs/gnttab/netbsd.c b/tools/libs/gnttab/netbsd.c
index f8d7c356eb..a4ad624b54 100644
--- a/tools/libs/gnttab/netbsd.c
+++ b/tools/libs/gnttab/netbsd.c
@@ -28,15 +28,12 @@
 #include <sys/ioctl.h>
 #include <sys/mman.h>
 
+#include <xenctrl.h>
 #include <xen/xen.h>
 #include <xen/xenio.h>
 
 #include "private.h"
 
-#define PAGE_SHIFT           12
-#define PAGE_SIZE            (1UL << PAGE_SHIFT)
-#define PAGE_MASK            (~(PAGE_SIZE-1))
-
 #define DEVXEN "/kern/xen/privcmd"
 
 int osdep_gnttab_open(xengnttab_handle *xgt)
@@ -87,19 +84,19 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
     }
 
     map.count = count;
-    addr = mmap(NULL, count * PAGE_SIZE,
+    addr = mmap(NULL, count * XC_PAGE_SIZE,
                 prot, flags | MAP_ANON | MAP_SHARED, -1, 0);
     if ( map.va == MAP_FAILED )
     {
         GTERROR(xgt->logger, "osdep_gnttab_grant_map: mmap failed");
-        munmap((void *)map.va, count * PAGE_SIZE);
+        munmap((void *)map.va, count * XC_PAGE_SIZE);
         addr = MAP_FAILED;
     }
     map.va = addr;
 
     map.notify.offset = 0;
     map.notify.action = 0;
-    if ( notify_offset < PAGE_SIZE * count )
+    if ( notify_offset < XC_PAGE_SIZE * count )
     {
         map.notify.offset = notify_offset;
         map.notify.action |= UNMAP_NOTIFY_CLEAR_BYTE;
@@ -115,7 +112,7 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
     {
         GTERROR(xgt->logger,
             "ioctl IOCTL_GNTDEV_MMAP_GRANT_REF failed: %d", rv);
-        munmap(addr, count * PAGE_SIZE);
+        munmap(addr, count * XC_PAGE_SIZE);
         addr = MAP_FAILED;
     }
 
@@ -136,7 +133,7 @@ int osdep_gnttab_unmap(xengnttab_handle *xgt,
     }
 
     /* Next, unmap the memory. */
-    rc = munmap(start_address, count * PAGE_SIZE);
+    rc = munmap(start_address, count * XC_PAGE_SIZE);
 
     return rc;
 }
@@ -187,7 +184,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
     alloc.domid = domid;
     alloc.flags = writable ? GNTDEV_ALLOC_FLAG_WRITABLE : 0;
     alloc.count = count;
-    area = mmap(NULL, count * PAGE_SIZE,
+    area = mmap(NULL, count * XC_PAGE_SIZE,
                 PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0);
 
     if ( area == MAP_FAILED )
@@ -200,7 +197,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
 
     alloc.notify.offset = 0;
     alloc.notify.action = 0;
-    if ( notify_offset < PAGE_SIZE * count )
+    if ( notify_offset < XC_PAGE_SIZE * count )
     {
         alloc.notify.offset = notify_offset;
         alloc.notify.action |= UNMAP_NOTIFY_CLEAR_BYTE;
@@ -215,7 +212,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
     if ( err )
     {
         GSERROR(xgs->logger, "IOCTL_GNTDEV_ALLOC_GRANT_REF failed");
-        munmap(area, count * PAGE_SIZE);
+        munmap(area, count * XC_PAGE_SIZE);
         area = MAP_FAILED;
         goto out;
     }
@@ -230,7 +227,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
 int osdep_gntshr_unshare(xengntshr_handle *xgs,
                          void *start_address, uint32_t count)
 {
-    return munmap(start_address, count * PAGE_SIZE);
+    return munmap(start_address, count * XC_PAGE_SIZE);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 15:11:48 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 15:11:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153739.284028 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1sAO-0000Tw-BV; Fri, 09 Jul 2021 15:11:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153739.284028; Fri, 09 Jul 2021 15:11:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1sAO-0000Tm-8L; Fri, 09 Jul 2021 15:11:48 +0000
Received: by outflank-mailman (input) for mailman id 153739;
 Fri, 09 Jul 2021 15:11:46 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sAM-0000TZ-7d
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:11:46 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sAM-0002vB-6n
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:11:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sAM-0006IG-5x
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xiiHER++jPuTKBZyWOwmtEDJCkVWfuyYMEtCPpQ0FUI=; b=vSQJHJSX+AjdQ3f24BByzTpV4Q
	mFFsWEHNzXw0/7h3t/4UGXXRqfVAtDuNPb77IiQAL4u8EIQv5ssZ3juesFcWpBvGrD9GeKRZr2Su7
	0FUOgi1Je4Q1RSUYiwIc3jJ1jyq1bXEGjLZBBU9lyf2ullUgRp/ecHf0I9AS4h0NG2Zw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/ocaml: Fix redefinition errors
Message-Id: <E1m1sAM-0006IG-5x@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 15:11:46 +0000

commit 2d1a35f1e6c2113a6322fdb758a198608c90e4bd
Author:     Costin Lupu <costin.lupu@cs.pub.ro>
AuthorDate: Tue Jun 8 15:35:29 2021 +0300
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Jul 9 16:00:09 2021 +0100

    tools/ocaml: Fix redefinition errors
    
    If PAGE_SIZE is already defined in the system (e.g. in /usr/include/limits.h
    header) then gcc will trigger a redefinition error because of -Werror. This
    patch replaces usage of PAGE_* macros with XC_PAGE_* macros in order to avoid
    confusion between control domain page granularity (PAGE_* definitions) and
    guest domain page granularity (which is what we are dealing with here).
    
    Same issue applies for redefinitions of Val_none and Some_val macros which
    can be already define in the OCaml system headers (e.g.
    /usr/lib/ocaml/caml/mlvalues.h).
    
    Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
    Tested-by: Dario Faggioli <dfaggioli@suse.com>
---
 tools/ocaml/libs/xc/xenctrl_stubs.c            | 10 ++++------
 tools/ocaml/libs/xentoollog/xentoollog_stubs.c |  4 ++++
 tools/ocaml/libs/xl/xenlight_stubs.c           |  4 ++++
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 6e4bc567f5..a6756c4a8c 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -37,14 +37,12 @@
 
 #include "mmap_stubs.h"
 
-#define PAGE_SHIFT		12
-#define PAGE_SIZE               (1UL << PAGE_SHIFT)
-#define PAGE_MASK               (~(PAGE_SIZE-1))
-
 #define _H(__h) ((xc_interface *)(__h))
 #define _D(__d) ((uint32_t)Int_val(__d))
 
+#ifndef Val_none
 #define Val_none (Val_int(0))
+#endif
 
 #define string_of_option_array(array, index) \
 	((Field(array, index) == Val_none) ? NULL : String_val(Field(Field(array, index), 0)))
@@ -819,7 +817,7 @@ CAMLprim value stub_xc_domain_memory_increase_reservation(value xch,
 	CAMLparam3(xch, domid, mem_kb);
 	int retval;
 
-	unsigned long nr_extents = ((unsigned long)(Int64_val(mem_kb))) >> (PAGE_SHIFT - 10);
+	unsigned long nr_extents = ((unsigned long)(Int64_val(mem_kb))) >> (XC_PAGE_SHIFT - 10);
 
 	uint32_t c_domid = _D(domid);
 	caml_enter_blocking_section();
@@ -925,7 +923,7 @@ CAMLprim value stub_pages_to_kib(value pages)
 {
 	CAMLparam1(pages);
 
-	CAMLreturn(caml_copy_int64(Int64_val(pages) << (PAGE_SHIFT - 10)));
+	CAMLreturn(caml_copy_int64(Int64_val(pages) << (XC_PAGE_SHIFT - 10)));
 }
 
 
diff --git a/tools/ocaml/libs/xentoollog/xentoollog_stubs.c b/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
index bf64b211c2..e4306a0c2f 100644
--- a/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
+++ b/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
@@ -53,8 +53,12 @@ static char * dup_String_val(value s)
 #include "_xtl_levels.inc"
 
 /* Option type support as per http://www.linux-nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php */
+#ifndef Val_none
 #define Val_none Val_int(0)
+#endif
+#ifndef Some_val
 #define Some_val(v) Field(v,0)
+#endif
 
 static value Val_some(value v)
 {
diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index 352a00134d..45b8af61c7 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -227,8 +227,12 @@ static value Val_string_list(libxl_string_list *c_val)
 }
 
 /* Option type support as per http://www.linux-nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php */
+#ifndef Val_none
 #define Val_none Val_int(0)
+#endif
+#ifndef Some_val
 #define Some_val(v) Field(v,0)
+#endif
 
 static value Val_some(value v)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 15:11:57 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 15:11:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153742.284043 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1sAX-0000pm-P6; Fri, 09 Jul 2021 15:11:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153742.284043; Fri, 09 Jul 2021 15:11:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1sAX-0000pb-Ln; Fri, 09 Jul 2021 15:11:57 +0000
Received: by outflank-mailman (input) for mailman id 153742;
 Fri, 09 Jul 2021 15:11:56 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sAW-0000or-Ae
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:11:56 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sAW-0002vU-9s
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:11:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sAW-0006It-93
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RhPiHPXFrUVXuvVpaDsSRPaBnO2Fq/2f6kjAwNI/bT8=; b=wh0FngTxP3PWlt7rXlT/szhK8c
	lE8ru9ZhH1HzoFc35Q/9POoCk+HAy5ch3gTqgNdMA3vwA4C2bWiV0BuzYkZPWFjvjeqXSaD40YUI4
	mN462xH5sOk8Q8kvihdKfnNdbdttXFp9o5u+VMU8GOnouSyd6FVZTNUgOMPEwj0+LkWU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation: add meson and ninja to tumbleweed container
Message-Id: <E1m1sAW-0006It-93@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 15:11:56 +0000

commit 303c857a2701fe7c180744faca3507efd3edbb1d
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Jul 9 16:06:53 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 16:06:03 2021 +0100

    automation: add meson and ninja to tumbleweed container
    
    qemu uses meson as for configuration, and requires ninja for building.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/build/suse/opensuse-tumbleweed.dockerfile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/automation/build/suse/opensuse-tumbleweed.dockerfile b/automation/build/suse/opensuse-tumbleweed.dockerfile
index 3965e7f9cd..be5ddb0d98 100644
--- a/automation/build/suse/opensuse-tumbleweed.dockerfile
+++ b/automation/build/suse/opensuse-tumbleweed.dockerfile
@@ -48,8 +48,10 @@ RUN zypper install -y --no-recommends \
         libzstd-devel \
         lzo-devel \
         make \
+        meson \
         nasm \
         ncurses-devel \
+        ninja \
         ocaml \
         ocaml-findlib-devel \
         ocaml-ocamlbuild \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 15:12:07 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 15:12:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153744.284047 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1sAh-0000zl-Qw; Fri, 09 Jul 2021 15:12:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153744.284047; Fri, 09 Jul 2021 15:12:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1sAh-0000zd-NV; Fri, 09 Jul 2021 15:12:07 +0000
Received: by outflank-mailman (input) for mailman id 153744;
 Fri, 09 Jul 2021 15:12:06 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sAg-0000yn-Do
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:12:06 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sAg-0002wH-D0
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:12:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sAg-0006KW-C7
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=atsdGRHzULEAZ9c2hNpxiqlpUQ7rjG2iXvx2Hor8OaM=; b=gRk8O5zN53oUdlIxIaXFSwx857
	JHOmKtxPPudJN28knctaA1XKwBECB1cyXoLNAjkuBezQKbJDay5E5giUWru51JY4+KfKjPTNyXyy1
	xlqu3eic+apESn/syAiUzr07MxvBoiYFA3eW1ygYK2Fr9NLDmZjM8vO3FPijY58UN24c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation: provide SDL and SDL2 in opensuse images
Message-Id: <E1m1sAg-0006KW-C7@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 15:12:06 +0000

commit 4ad75403625111bdd60571c3caaaefd3a84c574e
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Jul 9 16:32:47 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 16:06:03 2021 +0100

    automation: provide SDL and SDL2 in opensuse images
    
    qemu-xen-traditional may make use of SDL, qemu-xen may make use of SDL2.
    Use pkgconfig() as resolvable instead of a rpm name, the latter may change.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/build/suse/opensuse-leap.dockerfile       | 3 ++-
 automation/build/suse/opensuse-tumbleweed.dockerfile | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/automation/build/suse/opensuse-leap.dockerfile b/automation/build/suse/opensuse-leap.dockerfile
index 03f8a7acad..2f92392d76 100644
--- a/automation/build/suse/opensuse-leap.dockerfile
+++ b/automation/build/suse/opensuse-leap.dockerfile
@@ -31,7 +31,6 @@ RUN zypper install -y --no-recommends \
         glibc-devel-32bit \
         gzip \
         hostname \
-        libSDL2-devel \
         libaio-devel \
         libbz2-devel \
         libext2fs-devel \
@@ -56,6 +55,8 @@ RUN zypper install -y --no-recommends \
         pandoc \
         patch \
         pkg-config \
+        'pkgconfig(sdl)' \
+        'pkgconfig(sdl2)' \
         python \
         python-devel \
         python3-devel \
diff --git a/automation/build/suse/opensuse-tumbleweed.dockerfile b/automation/build/suse/opensuse-tumbleweed.dockerfile
index be5ddb0d98..ed10cd8a22 100644
--- a/automation/build/suse/opensuse-tumbleweed.dockerfile
+++ b/automation/build/suse/opensuse-tumbleweed.dockerfile
@@ -31,7 +31,6 @@ RUN zypper install -y --no-recommends \
         glibc-devel-32bit \
         gzip \
         hostname \
-        libSDL2-devel \
         libaio-devel \
         libbz2-devel \
         libext2fs-devel \
@@ -59,6 +58,8 @@ RUN zypper install -y --no-recommends \
         pandoc \
         patch \
         pkg-config \
+        'pkgconfig(sdl)' \
+        'pkgconfig(sdl2)' \
         python-devel \
         python3-devel \
         systemd-devel \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 15:12:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 15:12:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153746.284051 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1sAr-00019c-SJ; Fri, 09 Jul 2021 15:12:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153746.284051; Fri, 09 Jul 2021 15:12:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1sAr-00019S-P8; Fri, 09 Jul 2021 15:12:17 +0000
Received: by outflank-mailman (input) for mailman id 153746;
 Fri, 09 Jul 2021 15:12:16 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sAq-00017n-HB
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:12:16 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sAq-0002wS-GV
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:12:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sAq-0006MZ-Fd
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OMy9pNLt6sIpHB2DYkHx3brhYa6IWgWkVAH+pegLCMM=; b=soPXoPu8JwtGFL2Qe2rtriqqlK
	lQkiKb3F7wbJhm6/ll07uEy8vh8PFWtl9MdtUh1khM2pdXx5OFemNKQu2bT9nWoRFh6JgKj0nzloH
	iKlwg0w+JHjqczh7MhkdVPGIE9I8/NTWdjBczKEA79i09IqdJ/GAOcT2Xl1Iu7B/IDjk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation: provide pciutils in opensuse packages
Message-Id: <E1m1sAq-0006MZ-Fd@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 15:12:16 +0000

commit e6917412628d11986f0e6fc028851c8181b24fb8
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Jul 9 16:32:48 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 16:06:03 2021 +0100

    automation: provide pciutils in opensuse packages
    
    qemu-xen-traditional may make use of pciutils-devel, for PCI passthrough.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/build/suse/opensuse-leap.dockerfile       | 1 +
 automation/build/suse/opensuse-tumbleweed.dockerfile | 1 +
 2 files changed, 2 insertions(+)

diff --git a/automation/build/suse/opensuse-leap.dockerfile b/automation/build/suse/opensuse-leap.dockerfile
index 2f92392d76..5e8111f40b 100644
--- a/automation/build/suse/opensuse-leap.dockerfile
+++ b/automation/build/suse/opensuse-leap.dockerfile
@@ -55,6 +55,7 @@ RUN zypper install -y --no-recommends \
         pandoc \
         patch \
         pkg-config \
+        'pkgconfig(libpci)' \
         'pkgconfig(sdl)' \
         'pkgconfig(sdl2)' \
         python \
diff --git a/automation/build/suse/opensuse-tumbleweed.dockerfile b/automation/build/suse/opensuse-tumbleweed.dockerfile
index ed10cd8a22..b165c48245 100644
--- a/automation/build/suse/opensuse-tumbleweed.dockerfile
+++ b/automation/build/suse/opensuse-tumbleweed.dockerfile
@@ -58,6 +58,7 @@ RUN zypper install -y --no-recommends \
         pandoc \
         patch \
         pkg-config \
+        'pkgconfig(libpci)' \
         'pkgconfig(sdl)' \
         'pkgconfig(sdl2)' \
         python-devel \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 15:22:05 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 15:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153761.284097 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1sKI-0003SK-PM; Fri, 09 Jul 2021 15:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153761.284097; Fri, 09 Jul 2021 15:22:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1sKI-0003SD-Lo; Fri, 09 Jul 2021 15:22:02 +0000
Received: by outflank-mailman (input) for mailman id 153761;
 Fri, 09 Jul 2021 15:22:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sKH-0003R2-Tu
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sKH-000377-T2
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sKH-00071J-S7
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:22: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=76+lu8AiK/nTS91jjFsz7+2W7p1ylEZe0UpiLjn0R+c=; b=kv936D/mQo9inex1cnuEIIryNF
	fRghfHsNz5PinXUNS2vypZKfHJLQ63HbexkGPXeo1cdvHj2ZIxcXlcJxs9aIdb/tVUUuA7AcBIZXA
	1fOgHr26q36PtQn/dVSkmHRuV1w74nLK9+EYBpabipDj0dVbs/eg8R22XkZUNFzV7pzQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: Adding ninja-build to some docker images
Message-Id: <E1m1sKH-00071J-S7@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 15:22:01 +0000

commit 34108a27e871ab32ee8bfd813d6c4ff3eb5c5f8a
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed Jul 7 17:40:00 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 8 12:36:21 2021 +0100

    automation: Adding ninja-build to some docker images
    
    This is to allow building the latest version of QEMU.
    
    fedora/29:
        In addition to adding "ninja", I've add to make some other
        changes: some `go build` failed with `mkdir /.cache` no
        permission, so I've created a user.
        (this was discovered while testing the new container with the
        script containerize.)
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/build/alpine/3.12.dockerfile        | 1 +
 automation/build/fedora/29.dockerfile          | 9 ++++++---
 automation/build/suse/opensuse-leap.dockerfile | 2 ++
 automation/build/ubuntu/bionic.dockerfile      | 2 ++
 automation/build/ubuntu/focal.dockerfile       | 2 ++
 5 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/automation/build/alpine/3.12.dockerfile b/automation/build/alpine/3.12.dockerfile
index bb8e5ece74..4ee3ddc12e 100644
--- a/automation/build/alpine/3.12.dockerfile
+++ b/automation/build/alpine/3.12.dockerfile
@@ -47,6 +47,7 @@ RUN \
   apk add glib-dev && \
   apk add libattr && \
   apk add libcap-ng-dev && \
+  apk add ninja && \
   apk add pixman-dev && \
   \
   # cleanup
diff --git a/automation/build/fedora/29.dockerfile b/automation/build/fedora/29.dockerfile
index 027b93ceaf..60a5d72266 100644
--- a/automation/build/fedora/29.dockerfile
+++ b/automation/build/fedora/29.dockerfile
@@ -2,9 +2,6 @@ FROM fedora:29
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
-RUN mkdir /build
-WORKDIR /build
-
 # install Xen depends
 RUN dnf -y install \
         clang \
@@ -43,5 +40,11 @@ RUN dnf -y install \
         ocaml \
         ocaml-findlib \
         golang \
+        # QEMU
+        ninja-build \
     && dnf clean all && \
     rm -rf /var/cache/dnf
+
+RUN useradd --create-home user
+USER user
+WORKDIR /build
diff --git a/automation/build/suse/opensuse-leap.dockerfile b/automation/build/suse/opensuse-leap.dockerfile
index 573fbd8ae4..03f8a7acad 100644
--- a/automation/build/suse/opensuse-leap.dockerfile
+++ b/automation/build/suse/opensuse-leap.dockerfile
@@ -67,5 +67,7 @@ RUN zypper install -y --no-recommends \
         which \
         xz-devel \
         zlib-devel \
+        # QEMU
+        ninja \
         && \
         zypper clean -a
diff --git a/automation/build/ubuntu/bionic.dockerfile b/automation/build/ubuntu/bionic.dockerfile
index 406a97494c..1e5a27c70f 100644
--- a/automation/build/ubuntu/bionic.dockerfile
+++ b/automation/build/ubuntu/bionic.dockerfile
@@ -45,6 +45,8 @@ RUN apt-get update && \
         wget \
         git \
         nasm \
+        # QEMU
+        ninja-build \
         && \
         apt-get autoremove -y && \
         apt-get clean && \
diff --git a/automation/build/ubuntu/focal.dockerfile b/automation/build/ubuntu/focal.dockerfile
index 952a3172aa..74655b9876 100644
--- a/automation/build/ubuntu/focal.dockerfile
+++ b/automation/build/ubuntu/focal.dockerfile
@@ -44,6 +44,8 @@ RUN apt-get update && \
         wget \
         git \
         nasm \
+        # QEMU
+        ninja-build \
         && \
         apt-get autoremove -y && \
         apt-get clean && \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 15:22:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 15:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153767.284100 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1sKS-0003lo-Qx; Fri, 09 Jul 2021 15:22:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153767.284100; Fri, 09 Jul 2021 15:22:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1sKS-0003lh-Nt; Fri, 09 Jul 2021 15:22:12 +0000
Received: by outflank-mailman (input) for mailman id 153767;
 Fri, 09 Jul 2021 15:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sKS-0003ko-1i
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sKS-000382-0q
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sKR-00074H-W3
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:22: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/AeeCxid4XLF1PMhyRpwui6BkTh61MWXxGDFhKIigps=; b=YVfiFtvnaNru56WaYIgMG4Oker
	V9n1pdmV1b+wJSk9U/wXJvYC/tRqFVmGr61vnNvG7SC8sWQMxuuROSCN6qqh8ZWrgW4NLEjtzHRpH
	ozjROM3daaeXyACmq/MG/IEUnExaSAQn0wDbCoi4/tsUgwztUmvA9ybmzkDkbjJ+AwYU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: Check if ninja is available before building QEMU
Message-Id: <E1m1sKR-00074H-W3@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 15:22:11 +0000

commit ed939ef084ada31ac5e3000c9526bc99b58136e7
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed Jul 7 17:40:01 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 8 12:36:21 2021 +0100

    automation: Check if ninja is available before building QEMU
    
    ninja is now required to build the latest version of QEMU, and not all
    distros have a suitable version.  Skip the QEMU build when ninja is not
    available.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/scripts/build | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/automation/scripts/build b/automation/scripts/build
index 46b6903d29..4a1161bb94 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -45,8 +45,9 @@ if ! test -z "$(ldd /bin/ls|grep musl|head -1)"; then
     cfgargs+=("--with-system-seabios=/bin/false")
 fi
 
-# Qemu requires Python 3.5 or later
-if ! type python3 || python3 -c "import sys; res = sys.version_info < (3, 5); exit(not(res))"; then
+# Qemu requires Python 3.5 or later, and ninja
+if ! type python3 || python3 -c "import sys; res = sys.version_info < (3, 5); exit(not(res))" \
+        || ! type ninja; then
     cfgargs+=("--with-system-qemu=/bin/false")
 fi
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 15:22:22 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 15:22:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153774.284105 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1sKc-000452-Sg; Fri, 09 Jul 2021 15:22:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153774.284105; Fri, 09 Jul 2021 15:22:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1sKc-00044u-PT; Fri, 09 Jul 2021 15:22:22 +0000
Received: by outflank-mailman (input) for mailman id 153774;
 Fri, 09 Jul 2021 15:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sKc-00044g-4l
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sKc-00038o-3v
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sKc-00076M-31
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:22: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=prjop4jUaZPiuW/dUkeqY4pXJGMC6V95u/M1WqL+dHA=; b=TVrzJ46FSPQr7iX8e54fqwAeEk
	5HxbMeL5iuuJkfh2OcUxK5s0kMyMI6mv5EU4HX9bHsHPIe/oCWA6potm3kkMoNKHmwFYhKXeXAvQr
	lapHdYYjOpaoHIJaPbqE2NPGyDSGuNem7Ec+BDwsLrrdg5qTt4bBnkyYEHv+jAGXrJEE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: dump contents of /etc/os-release
Message-Id: <E1m1sKc-00076M-31@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 15:22:22 +0000

commit d213e85cb1e96571e1ed2f15ea87c19d21c84586
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 8 08:29:22 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 8 12:36:21 2021 +0100

    automation: dump contents of /etc/os-release
    
    To aid debugging build failures, dump /etc/os-release during build.
    This helps with rolling releases such as Tumbleweed to understand the
    state of the build container.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/scripts/build | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/automation/scripts/build b/automation/scripts/build
index 4a1161bb94..281f8b1fcc 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -1,5 +1,7 @@
 #!/bin/bash -ex
 
+test -f /etc/os-release && cat "$_"
+
 $CC --version
 
 # Express the compiler version as an integer.  e.g. GCC 4.9.2 => 0x040902
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 15:22:32 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 15:22:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153777.284108 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1sKm-0004BV-Tn; Fri, 09 Jul 2021 15:22:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153777.284108; Fri, 09 Jul 2021 15:22:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1sKm-0004BL-Qv; Fri, 09 Jul 2021 15:22:32 +0000
Received: by outflank-mailman (input) for mailman id 153777;
 Fri, 09 Jul 2021 15:22:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sKm-0004B5-7Z
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:22:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sKm-000392-6t
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1sKm-0007Fc-65
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 15:22: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cafZG3DvGApu3fLG9f65ORMBJrg6FlpyiECvCkm+r3E=; b=mqphpxEaXPetB6pDwgt0v5SeZv
	qRQ5+ayyHTs03g5cBCqQ3dxhnQFMrFiR5IrEgA2ZGQs/MfQHCQ8dykgwoV4DSAEZ/Emne1Hxam/I9
	Bg7KdZOQRXlv+CufBjupCn/I6+iUNa1HUt8d4c/axckY5PE7hTuUtMrSHCjEHMNcuop0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: collect log files in subdirectories
Message-Id: <E1m1sKm-0007Fc-65@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 15:22:32 +0000

commit 0f435e2b58543f5baae96e17a10ae20d3dbc28fa
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 8 08:54:35 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 8 12:36:21 2021 +0100

    automation: collect log files in subdirectories
    
    The current single *.log pattern collects just config.log, which
    usually contains little useful information.
    Collect also log files in subdirectories, tools/config.log usually
    contains information about configure failures.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/gitlab-ci/build.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 20d1d0cb34..d177da1710 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -8,6 +8,7 @@
       - binaries/
       - xen-config
       - '*.log'
+      - '*/*.log'
     when: always
   except:
     - master
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 18:33:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 18:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153844.284224 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1vJB-0001JD-Ns; Fri, 09 Jul 2021 18:33:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153844.284224; Fri, 09 Jul 2021 18:33:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1vJB-0001J5-Kw; Fri, 09 Jul 2021 18:33:05 +0000
Received: by outflank-mailman (input) for mailman id 153844;
 Fri, 09 Jul 2021 18:33:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1vJB-0001Iz-2q
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 18:33:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1vJB-0006xr-1s
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 18:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1vJB-00021Q-0l
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 18: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8qUEN4jUk7HE93QAtSNZZDCwOAW3VdVw+G1eNN2KGQc=; b=d+Ul/Amehs4DYmNknEIf+W/3+R
	RO3MYFFMYjC2HJnQFgK16jERPMyF/LJEiiQsnVdAcan6VYj8XcBW5tMp14Vbnb8JcDH9mN+PwzMw8
	U8jR55CrQbNfsJSHuvZjICevlAE1j0VgfFJeAlYbWZKPl7k6vmp72c4Rw848PaGO3VWg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/misc/xen-vmtrace: handle more signals and install by default
Message-Id: <E1m1vJB-00021Q-0l@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 18:33:05 +0000

commit 2c7242bb2a11c027921b7f153841e59457edacc3
Author:     Tamas K Lengyel <tamas@tklengyel.com>
AuthorDate: Fri May 7 11:28:36 2021 -0400
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 16:38:25 2021 +0100

    tools/misc/xen-vmtrace: handle more signals and install by default
    
    Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/misc/Makefile      |  2 +-
 tools/misc/xen-vmtrace.c | 12 +++++++++---
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index 2b683819d4..c32c42d546 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -25,6 +25,7 @@ INSTALL_SBIN-$(CONFIG_X86)     += xen-lowmemd
 INSTALL_SBIN-$(CONFIG_X86)     += xen-memshare
 INSTALL_SBIN-$(CONFIG_X86)     += xen-mfndump
 INSTALL_SBIN-$(CONFIG_X86)     += xen-ucode
+INSTALL_SBIN-$(CONFIG_X86)     += xen-vmtrace
 INSTALL_SBIN                   += xencov
 INSTALL_SBIN                   += xenhypfs
 INSTALL_SBIN                   += xenlockprof
@@ -51,7 +52,6 @@ TARGETS_COPY += xenpvnetboot
 TARGETS_BUILD := $(filter-out $(TARGETS_COPY),$(TARGETS_ALL))
 
 # ... including build-only targets
-TARGETS_BUILD-$(CONFIG_X86)    += xen-vmtrace
 TARGETS_BUILD += $(TARGETS_BUILD-y)
 
 .PHONY: all build
diff --git a/tools/misc/xen-vmtrace.c b/tools/misc/xen-vmtrace.c
index 35d14c6a9b..5b688a54af 100644
--- a/tools/misc/xen-vmtrace.c
+++ b/tools/misc/xen-vmtrace.c
@@ -44,7 +44,7 @@ static size_t size;
 static char *buf;
 
 static sig_atomic_t interrupted;
-static void int_handler(int signum)
+static void close_handler(int signum)
 {
     interrupted = 1;
 }
@@ -78,8 +78,14 @@ int main(int argc, char **argv)
     int rc, exit = 1;
     xenforeignmemory_resource_handle *fres = NULL;
 
-    if ( signal(SIGINT, int_handler) == SIG_ERR )
-        err(1, "Failed to register signal handler\n");
+    struct sigaction act;
+    act.sa_handler = close_handler;
+    act.sa_flags = 0;
+    sigemptyset(&act.sa_mask);
+    sigaction(SIGHUP,  &act, NULL);
+    sigaction(SIGTERM, &act, NULL);
+    sigaction(SIGINT,  &act, NULL);
+    sigaction(SIGALRM, &act, NULL);
 
     if ( argc != 3 )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 18:33:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 18:33:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153845.284229 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1vJM-0001LF-QZ; Fri, 09 Jul 2021 18:33:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153845.284229; Fri, 09 Jul 2021 18:33:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1vJM-0001L8-Me; Fri, 09 Jul 2021 18:33:16 +0000
Received: by outflank-mailman (input) for mailman id 153845;
 Fri, 09 Jul 2021 18:33:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1vJL-0001Kv-6w
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 18:33:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1vJL-0006yB-5q
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 18:33:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1vJL-00022Z-4j
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 18: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NVCgdfSeUJeiUfaOL0N6FetQFPmS7YHQpCfzPqAO/wY=; b=aHVYLYsklV8Oe3GwrDnPupSRBT
	Wg6OG8g5JhIhCfCT3qnHMSy/ADEfZ9PnC2rrlt1WY7hus/7ovOyWDTt63obMqONrAWf6847Wkkh1i
	dqVVNtSzAWmD6xq01bQzU+XIgqRTYLrXag47AR6u+z88zVI0yBrb4b4i7DPBZyzudV14=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/tests: Drop obsolete mce-test infrastructure
Message-Id: <E1m1vJL-00022Z-4j@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 18:33:15 +0000

commit 79ca512a1fa68e0170a85cb71b8a8e8f4a34fb11
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 15 14:19:15 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 16:38:27 2021 +0100

    tools/tests: Drop obsolete mce-test infrastructure
    
    mce-test has a test suite, but it depends on xend, needs to run in-tree, and
    requires manual setup of at least one guest, and manual parameters to pass
    into cases.  Drop the test infrasturcture.
    
    Move the one useful remaining item, xen-mceinj, into misc/, fixing some minor
    style issues as it goes.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 .gitignore                                         |   1 -
 tools/misc/.gitignore                              |   1 +
 tools/misc/Makefile                                |   4 +
 tools/misc/xen-mceinj.c                            | 551 +++++++++++++++++++++
 tools/tests/Makefile                               |   1 -
 tools/tests/mce-test/Makefile                      |  12 -
 tools/tests/mce-test/README                        |  75 ---
 tools/tests/mce-test/cases/srao_llc/dom0/cases.sh  |  73 ---
 tools/tests/mce-test/cases/srao_llc/guest/cases.sh |  94 ----
 tools/tests/mce-test/cases/srao_llc/xen/cases.sh   |  69 ---
 tools/tests/mce-test/cases/srao_mem/dom0/cases.sh  |  73 ---
 tools/tests/mce-test/cases/srao_mem/guest/cases.sh |  94 ----
 tools/tests/mce-test/cases/srao_mem/xen/cases.sh   |  69 ---
 tools/tests/mce-test/cases/ucna_llc/dom0/cases.sh  |  72 ---
 tools/tests/mce-test/cases/ucna_llc/guest/cases.sh |  92 ----
 tools/tests/mce-test/cases/ucna_llc/xen/cases.sh   |  68 ---
 tools/tests/mce-test/config/setup.conf             |  24 -
 tools/tests/mce-test/lib/xen-mceinj-tool.sh        | 260 ----------
 tools/tests/mce-test/tools/Makefile                |  24 -
 tools/tests/mce-test/tools/README                  |  24 -
 tools/tests/mce-test/tools/xen-mceinj.c            | 545 --------------------
 21 files changed, 556 insertions(+), 1670 deletions(-)

diff --git a/.gitignore b/.gitignore
index 38a085e398..d4b90303b2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -276,7 +276,6 @@ tools/tests/x86_emulator/test_x86_emulator
 tools/tests/x86_emulator/x86_emulate
 tools/tests/x86_emulator/xop*.[ch]
 tools/tests/xenstore/xs-test
-tools/tests/mce-test/tools/xen-mceinj
 tools/tests/vpci/list.h
 tools/tests/vpci/vpci.[hc]
 tools/tests/vpci/test_vpci
diff --git a/tools/misc/.gitignore b/tools/misc/.gitignore
index ce6f937d0c..73ce95e6d7 100644
--- a/tools/misc/.gitignore
+++ b/tools/misc/.gitignore
@@ -1,4 +1,5 @@
 xen-access
+xen-mceinj
 xen-memshare
 xen-ucode
 xen-vmtrace
diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index c32c42d546..8b9558b93f 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -22,6 +22,7 @@ INSTALL_SBIN-$(CONFIG_MIGRATE) += xen-hptool
 INSTALL_SBIN-$(CONFIG_X86)     += xen-hvmcrash
 INSTALL_SBIN-$(CONFIG_X86)     += xen-hvmctx
 INSTALL_SBIN-$(CONFIG_X86)     += xen-lowmemd
+INSTALL_SBIN-$(CONFIG_X86)     += xen-mceinj
 INSTALL_SBIN-$(CONFIG_X86)     += xen-memshare
 INSTALL_SBIN-$(CONFIG_X86)     += xen-mfndump
 INSTALL_SBIN-$(CONFIG_X86)     += xen-ucode
@@ -97,6 +98,9 @@ xen-memshare: xen-memshare.o
 xen-vmtrace: xen-vmtrace.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(LDLIBS_libxenforeignmemory) $(APPEND_LDFLAGS)
 
+xen-mceinj: xen-mceinj.o
+	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) $(APPEND_LDFLAGS)
+
 xenperf: xenperf.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
diff --git a/tools/misc/xen-mceinj.c b/tools/misc/xen-mceinj.c
new file mode 100644
index 0000000000..df55eefbac
--- /dev/null
+++ b/tools/misc/xen-mceinj.c
@@ -0,0 +1,551 @@
+/*
+ * xen-mceinj.c: utilities to inject fake MCE for x86.
+ * Copyright (c) 2010, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Yunhong Jiang <yunhong.jiang@intel.com>
+ *          Haicheng Li <haicheng.li@intel.com>
+ *          Xudong Hao <xudong.hao@intel.com>
+ */
+
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <getopt.h>
+#include <errno.h>
+#include <signal.h>
+#include <stdarg.h>
+
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
+#include <xenctrl.h>
+#include <xenguest.h>
+#include <inttypes.h>
+#include <sys/time.h>
+#include <xen/arch-x86/xen-mca.h>
+#include <xenstore.h>
+
+#define MCi_type_CTL        0x0
+#define MCi_type_STATUS     0x1
+#define MCi_type_ADDR       0x2
+#define MCi_type_MISC       0x3
+#define MCi_type_CTL2       0x4
+
+#define INVALID_MSR         ~0UL
+
+/* Intel MSRs */
+#define MSR_IA32_MCG_CAP         0x00000179
+#define MSR_IA32_MCG_STATUS      0x0000017a
+#define MSR_IA32_MCG_CTL         0x0000017b
+#define MSR_IA32_MC0_CTL         0x00000400
+#define MSR_IA32_MC0_STATUS      0x00000401
+#define MSR_IA32_MC0_ADDR        0x00000402
+#define MSR_IA32_MC0_MISC        0x00000403
+#define MSR_IA32_MC0_CTL2        0x00000280
+
+#define MCG_STATUS_LMCE          0x8
+
+struct mce_info {
+    const char *description;
+    uint8_t mcg_stat;
+    unsigned int bank;
+    uint64_t mci_stat;
+    uint64_t mci_misc;
+    bool cmci;
+};
+
+static struct mce_info mce_table[] = {
+    /* LLC (Last Level Cache) EWB (Explicit Write Back) SRAO MCE */
+    {
+        .description = "MCE_SRAO_MEM",
+        .mcg_stat = 0x5,
+        .bank = 7,
+        .mci_stat = 0xBD2000008000017Aull,
+        .mci_misc = 0x86ull,
+    },
+    /* Memory Patrol Scrub SRAO MCE */
+    {
+        .description = "MCE_SRAO_LLC",
+        .mcg_stat = 0x5,
+        .bank = 8,
+        .mci_stat = 0xBD000000004000CFull,
+        .mci_misc = 0x86ull,
+    },
+    /* LLC EWB UCNA Error */
+    {
+        .description = "CMCI_UCNA_LLC",
+        .mcg_stat = 0x0,
+        .bank = 9,
+        .mci_stat = 0xBC20000080000136ull,
+        .mci_misc = 0x86ull,
+        .cmci = true,
+    },
+    /* AMD L1 instruction cache data or tag parity. */
+    {
+        .description = "AMD L1 icache parity",
+        .mcg_stat = 0x5,
+        .bank = 1,
+        .mci_stat = 0x9400000000000151ull,
+        .mci_misc = 0x86ull,
+    },
+    /* LLC (Last Level Cache) EWB (Explicit Write Back) SRAO MCE */
+    {
+        .description = "MCE_SRAO_MEM (Fatal)",
+        .mcg_stat = 0x5,
+        .bank = 7,
+        .mci_stat = 0xBF2000008000017Aull,
+        .mci_misc = 0x86ull,
+    },
+};
+#define MCE_TABLE_SIZE (sizeof(mce_table)/sizeof(mce_table[0]))
+
+#define LOGFILE stdout
+
+int dump;
+int lmce;
+struct xen_mc_msrinject msr_inj;
+
+static void Lprintf(const char *fmt, ...)
+{
+    char *buf;
+    va_list args;
+
+    va_start(args, fmt);
+    if (vasprintf(&buf, fmt, args) < 0)
+        abort();
+    fprintf(LOGFILE, "%s\n", buf);
+    va_end(args);
+    free(buf);
+}
+
+static void err(xc_interface *xc_handle, const char *fmt, ...)
+{
+    char *buf;
+    va_list args;
+
+    va_start(args, fmt);
+    if ( vasprintf(&buf, fmt, args) < 0 )
+        abort();
+    perror(buf);
+    va_end(args);
+    free(buf);
+
+    if ( xc_handle )
+        xc_interface_close(xc_handle);
+    exit(EXIT_FAILURE);
+}
+
+static void init_msr_inj(void)
+{
+    memset(&msr_inj, 0, sizeof(msr_inj));
+}
+
+static int flush_msr_inj(xc_interface *xc_handle)
+{
+    struct xen_mc mc;
+
+    mc.cmd = XEN_MC_msrinject;
+    mc.interface_version = XEN_MCA_INTERFACE_VERSION;
+    mc.u.mc_msrinject = msr_inj;
+
+    return xc_mca_op(xc_handle, &mc);
+}
+
+static unsigned int mca_cpuinfo(xc_interface *xc_handle)
+{
+    struct xen_mc mc;
+
+    memset(&mc, 0, sizeof(struct xen_mc));
+
+    mc.cmd = XEN_MC_physcpuinfo;
+    mc.interface_version = XEN_MCA_INTERFACE_VERSION;
+
+    if ( !xc_mca_op(xc_handle, &mc) )
+        return mc.u.mc_physcpuinfo.ncpus;
+    else
+        return 0;
+}
+
+static int inject_cmci(xc_interface *xc_handle, unsigned int cpu_nr)
+{
+    struct xen_mc mc;
+    unsigned int nr_cpus;
+
+    memset(&mc, 0, sizeof(struct xen_mc));
+
+    nr_cpus = mca_cpuinfo(xc_handle);
+    if ( !nr_cpus )
+        err(xc_handle, "Failed to get mca_cpuinfo");
+    if ( cpu_nr >= nr_cpus )
+        err(xc_handle, "-c %u is larger than %u", cpu_nr, nr_cpus - 1);
+
+    mc.cmd = XEN_MC_inject_v2;
+    mc.interface_version = XEN_MCA_INTERFACE_VERSION;
+
+    mc.u.mc_inject_v2.flags |= XEN_MC_INJECT_CPU_BROADCAST;
+    mc.u.mc_inject_v2.flags |= XEN_MC_INJECT_TYPE_CMCI;
+    mc.u.mc_inject_v2.cpumap.nr_bits = nr_cpus;
+
+    return xc_mca_op(xc_handle, &mc);
+}
+
+static int inject_mce(xc_interface *xc_handle, int cpu_nr)
+{
+    struct xen_mc mc;
+
+    memset(&mc, 0, sizeof(struct xen_mc));
+
+    mc.cmd = XEN_MC_mceinject;
+    mc.interface_version = XEN_MCA_INTERFACE_VERSION;
+    mc.u.mc_mceinject.mceinj_cpunr = cpu_nr;
+
+    return xc_mca_op(xc_handle, &mc);
+}
+
+static int inject_lmce(xc_interface *xc_handle, unsigned int cpu)
+{
+    uint8_t *cpumap = NULL;
+    size_t cpumap_size, line, shift;
+    unsigned int nr_cpus;
+    int ret;
+
+    nr_cpus = mca_cpuinfo(xc_handle);
+    if ( !nr_cpus )
+        err(xc_handle, "Failed to get mca_cpuinfo");
+    if ( cpu >= nr_cpus )
+        err(xc_handle, "-c %u is larger than %u", cpu, nr_cpus - 1);
+
+    cpumap_size = (nr_cpus + 7) / 8;
+    cpumap = malloc(cpumap_size);
+    if ( !cpumap )
+        err(xc_handle, "Failed to allocate cpumap\n");
+    memset(cpumap, 0, cpumap_size);
+    line = cpu / 8;
+    shift = cpu % 8;
+    memset(cpumap + line, 1 << shift, 1);
+
+    ret = xc_mca_op_inject_v2(xc_handle, XEN_MC_INJECT_TYPE_LMCE,
+                              cpumap, cpumap_size * 8);
+
+    free(cpumap);
+    return ret;
+}
+
+static uint64_t bank_addr(int bank, int type)
+{
+    uint64_t addr;
+
+    switch ( type )
+    {
+    case MCi_type_CTL:
+    case MCi_type_STATUS:
+    case MCi_type_ADDR:
+    case MCi_type_MISC:
+        addr = MSR_IA32_MC0_CTL + (bank * 4) + type;
+        break;
+    case MCi_type_CTL2:
+        addr = MSR_IA32_MC0_CTL2 + bank;
+        break;
+    default:
+        addr = INVALID_MSR;
+        break;
+    }
+
+    return addr;
+}
+
+static int add_msr_intpose(xc_interface *xc_handle,
+                           uint32_t cpu_nr,
+                           uint32_t flags,
+                           uint64_t msr,
+                           uint64_t val,
+                           domid_t domid)
+{
+    uint32_t count;
+
+    if ( (msr_inj.mcinj_count &&
+          (cpu_nr != msr_inj.mcinj_cpunr || flags != msr_inj.mcinj_flags ||
+           domid != msr_inj.mcinj_domid)) ||
+         msr_inj.mcinj_count == MC_MSRINJ_MAXMSRS )
+    {
+        flush_msr_inj(xc_handle);
+        init_msr_inj();
+    }
+    count = msr_inj.mcinj_count;
+
+    if ( !count )
+    {
+        msr_inj.mcinj_cpunr = cpu_nr;
+        msr_inj.mcinj_flags = flags;
+        msr_inj.mcinj_domid = domid;
+    }
+    msr_inj.mcinj_msr[count].reg = msr;
+    msr_inj.mcinj_msr[count].value = val;
+    msr_inj.mcinj_count++;
+
+    return 0;
+}
+
+static int add_msr_bank_intpose(xc_interface *xc_handle,
+                                uint32_t cpu_nr,
+                                uint32_t flags,
+                                uint32_t type,
+                                uint32_t bank,
+                                uint64_t val,
+                                domid_t domid)
+{
+    uint64_t msr;
+
+    msr = bank_addr(bank, type);
+    if ( msr == INVALID_MSR )
+        return -1;
+    return add_msr_intpose(xc_handle, cpu_nr, flags, msr, val, domid);
+}
+
+static int inject_mcg_status(xc_interface *xc_handle,
+                             uint32_t cpu_nr,
+                             uint64_t val,
+                             domid_t domid)
+{
+    return add_msr_intpose(xc_handle, cpu_nr, MC_MSRINJ_F_INTERPOSE,
+                           MSR_IA32_MCG_STATUS, val, domid);
+}
+
+static int inject_mci_status(xc_interface *xc_handle,
+                             uint32_t cpu_nr,
+                             uint64_t bank,
+                             uint64_t val,
+                             domid_t domid)
+{
+    return add_msr_bank_intpose(xc_handle, cpu_nr, MC_MSRINJ_F_INTERPOSE,
+                                MCi_type_STATUS, bank, val, domid);
+}
+
+static int inject_mci_misc(xc_interface *xc_handle,
+                           uint32_t cpu_nr,
+                           uint64_t bank,
+                           uint64_t val,
+                           domid_t domid)
+{
+    return add_msr_bank_intpose(xc_handle, cpu_nr, MC_MSRINJ_F_INTERPOSE,
+                                MCi_type_MISC, bank, val, domid);
+}
+
+static int inject_mci_addr(xc_interface *xc_handle,
+                           uint32_t cpu_nr,
+                           uint64_t bank,
+                           uint64_t val,
+                           domid_t domid)
+{
+    return add_msr_bank_intpose(xc_handle, cpu_nr,
+                                MC_MSRINJ_F_INTERPOSE |
+                                ((domid >= DOMID_FIRST_RESERVED &&
+                                  domid != DOMID_SELF) ?
+                                 0 : MC_MSRINJ_F_GPADDR),
+                                MCi_type_ADDR, bank, val, domid);
+}
+
+static int inject(xc_interface *xc_handle, struct mce_info *mce,
+                  uint32_t cpu_nr, uint32_t domain, uint64_t gaddr)
+{
+    int ret = 0;
+    uint8_t mcg_status = mce->mcg_stat;
+
+    if ( lmce )
+    {
+        if ( mce->cmci )
+            err(xc_handle, "No support to inject CMCI as LMCE");
+        mcg_status |= MCG_STATUS_LMCE;
+    }
+    ret = inject_mcg_status(xc_handle, cpu_nr, mcg_status, domain);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCG_STATUS MSR");
+
+    ret = inject_mci_status(xc_handle, cpu_nr,
+                            mce->bank, mce->mci_stat, domain);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCi_STATUS MSR");
+
+    ret = inject_mci_misc(xc_handle, cpu_nr,
+                          mce->bank, mce->mci_misc, domain);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCi_MISC MSR");
+
+    ret = inject_mci_addr(xc_handle, cpu_nr, mce->bank, gaddr, domain);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCi_ADDR MSR");
+
+    ret = flush_msr_inj(xc_handle);
+    if ( ret )
+        err(xc_handle, "Failed to inject MSR");
+    if ( mce->cmci )
+        ret = inject_cmci(xc_handle, cpu_nr);
+    else if ( lmce )
+        ret = inject_lmce(xc_handle, cpu_nr);
+    else
+        ret = inject_mce(xc_handle, cpu_nr);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCE error");
+
+    return 0;
+}
+
+static long xs_get_dom_mem(int domid)
+{
+    char path[128];
+    char *memstr;
+    uint64_t mem;
+    unsigned int plen;
+    struct xs_handle *xs;
+
+    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_close(xs);
+
+    if (!memstr || !plen)
+        return -1;
+
+    mem = atoll(memstr) * 1024;
+    free(memstr);
+
+    return mem;
+}
+
+static struct option opts[] = {
+    {"cpu", 0, 0, 'c'},
+    {"domain", 0, 0, 'd'},
+    {"dump", 0, 0, 'D'},
+    {"help", 0, 0, 'h'},
+    {"page", 0, 0, 'p'},
+    {"lmce", 0, 0, 'l'},
+    {"", 0, 0, '\0'}
+};
+
+static void help(void)
+{
+    unsigned int i;
+
+    printf("Usage: xen-mceinj [OPTION]...\n"
+           "\n"
+           "Mandatory arguments to long options are mandatory"
+           "for short options too.\n"
+           "  -D, --dump           dump addr info without error injection\n"
+           "  -c, --cpu=CPU        target CPU\n"
+           "  -d, --domain=DOMID   target domain, the default is Xen itself\n"
+           "  -h, --help           print this page\n"
+           "  -p, --page=ADDR      physical address to report\n"
+           "  -l, --lmce           inject as LMCE (Intel only)\n"
+           "  -t, --type=ERROR     error type\n");
+
+    for ( i = 0; i < MCE_TABLE_SIZE; i++ )
+        printf("                       %2d : %s\n",
+               i, mce_table[i].description);
+}
+
+int main(int argc, char *argv[])
+{
+    int type = 0;
+    int c, opt_index;
+    uint32_t domid;
+    xc_interface *xc_handle;
+    unsigned int cpu_nr;
+    uint64_t gaddr, max_gpa;
+
+    /* Default Value */
+    domid = DOMID_XEN;
+    gaddr = 0x180020;
+    cpu_nr = 0;
+
+    init_msr_inj();
+    xc_handle = xc_interface_open(NULL, NULL, 0);
+    if ( !xc_handle )
+    {
+        Lprintf("Failed to get xc interface");
+        exit(EXIT_FAILURE);
+    }
+
+    while ( 1 )
+    {
+        c = getopt_long(argc, argv, "c:Dd:t:hp:l", opts, &opt_index);
+        if ( c == -1 )
+            break;
+        switch ( c )
+        {
+        case 'D':
+            dump=1;
+            break;
+        case 'c':
+            cpu_nr = strtoul(optarg, &optarg, 10);
+            if ( strlen(optarg) != 0 )
+                err(xc_handle, "Please input a digit parameter for CPU");
+            break;
+        case 'd':
+            domid = strtol(optarg, &optarg, 10);
+            if ( strlen(optarg) != 0 )
+                err(xc_handle, "Please input a digit parameter for domain");
+            break;
+        case 'p':
+            gaddr = strtol(optarg, &optarg, 0);
+            if ( strlen(optarg) != 0 )
+                err(xc_handle, "Please input correct page address");
+            break;
+        case 't':
+            type = strtol(optarg, NULL, 0);
+            break;
+        case 'l':
+            lmce = 1;
+            break;
+        case 'h':
+        default:
+            help();
+            return 0;
+        }
+    }
+
+    if ( domid != DOMID_XEN )
+    {
+        max_gpa = xs_get_dom_mem(domid);
+        Lprintf("get domain %d max gpa is: 0x%lx", domid, max_gpa);
+        if ( gaddr >= max_gpa )
+            err(xc_handle, "Fail: gaddr exceeds max_gpa 0x%lx", max_gpa);
+    }
+    Lprintf("get gaddr of error inject is: 0x%lx", gaddr);
+
+    if ( dump )
+    {
+        if ( domid == DOMID_XEN )
+            Lprintf("Xen: gaddr=0x%lx", gaddr);
+        else
+            Lprintf("Dom%d: gaddr=0x%lx", domid, gaddr);
+        goto out;
+    }
+
+    if ( type < 0 || type >= MCE_TABLE_SIZE )
+    {
+        err(xc_handle, "Unsupported error type");
+        goto out;
+    }
+
+    inject(xc_handle, &mce_table[type], cpu_nr, domid, gaddr);
+
+ out:
+    xc_interface_close(xc_handle);
+    return 0;
+}
diff --git a/tools/tests/Makefile b/tools/tests/Makefile
index 25531a984a..33e32730c4 100644
--- a/tools/tests/Makefile
+++ b/tools/tests/Makefile
@@ -4,7 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk
 SUBDIRS-y :=
 SUBDIRS-y += resource
 SUBDIRS-$(CONFIG_X86) += cpu-policy
-SUBDIRS-$(CONFIG_X86) += mce-test
 SUBDIRS-$(CONFIG_X86) += tsx
 ifneq ($(clang),y)
 SUBDIRS-$(CONFIG_X86) += x86_emulator
diff --git a/tools/tests/mce-test/Makefile b/tools/tests/mce-test/Makefile
deleted file mode 100644
index 1395df38ac..0000000000
--- a/tools/tests/mce-test/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-.PHONY: all clean distclean
-
-all: 
-	$(MAKE) -C tools
-
-clean:
-	$(MAKE) -C tools clean
-
-distclean:
-	$(MAKE) -C tools distclean
-
-install uninstall:
diff --git a/tools/tests/mce-test/README b/tools/tests/mce-test/README
deleted file mode 100644
index 65e6d1b045..0000000000
--- a/tools/tests/mce-test/README
+++ /dev/null
@@ -1,75 +0,0 @@
-Xen MCE test suite
----------------
-
-The Xen MCE test suite is a collection of tools and test scripts for
-testing the Xen MCE processing features. The goal is to cover
-most Xen MCE processing code paths and features with automation tests.
-
-
-In the Package
---------------
-
-Here is a short description of what is included in the package
-
-README
-	This is document
-
-Makefile
-	For compile
-
-cases/*
-	Contains all test cases, which may be organized in sub-directories, 
-	the interface of test case is a shell script under cases/, such as:
-	   -- cases/srao_mem/dom0/cases.sh
-
-config/*
-	Contains test configuration files, which specifies the parameters 
-	for test cases, etc.
-
-lib/*
-	Contains some shell scripts, in which some common shell
-	functions and variable definitions are defined to be used by
-	test cases.
-
-tools/*
-	Tools used by MCE test suites, now only xen-mceinj tool.
-
-results/
-	When test is done, the test result will be placed in this
-	directory, test results	of various cases may be in corresponding 
-	directory. 
-	For example, files in
-	    results/srao_mem_dom0/result
-	is the result for test case cases/srao_mem/dom0/cases.sh, there will
-	be 3 result conditions: PASSED/FAILED/NORESULT.
-		results/<test_case>/testlog   #the test log during testing
-		results/<test_case>/mcelog    #mcelog output during testing
-		results/<test_case>/xenlog    #Xen log during testing
-		results/<test_case>/gklog     #VM guest kernel log during testing
-		results/<test_case>/guest_config   #config file used to create guest
-
-
-Test Instruction
-----------------
-
-1.	make sure you have a dom0 with mce support
-	CONFIG_X86_MCE=y
-	CONFIG_X86_MCE_INTEL=y
-	CONFIG_X86_MCE_AMD=y
-	CONFIG_X86_MCE_THRESHOLD=y
-	CONFIG_X86_MCE_INJECT=y
-
-2.	run system at xen and start xend. A installed guest image is
-	necessary when do guest MCE error injection.
-3.	compile tools that used to test. in mce-test, $make.
-	Note: make sure compile xen/tools before do this step
-4.	run test cases that you want.
-	e.g. $sh cases/srao_mem/dom0/cases.sh -d 0 -p 0x0200 -c 2 -t 1
-5.	get test result in results directory
-
-
-Notes
-----------------
-All test cases fake a error and inject this error in 0x180020, For Xen
-test cases(e.g. cases/srao_mem/xen/cases.sh), error happen on every page 
-may cause a Xen panic. 
diff --git a/tools/tests/mce-test/cases/srao_llc/dom0/cases.sh b/tools/tests/mce-test/cases/srao_llc/dom0/cases.sh
deleted file mode 100644
index c540f64998..0000000000
--- a/tools/tests/mce-test/cases/srao_llc/dom0/cases.sh
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-sd=$(dirname $0)
-export ROOT=`(cd $sd/../../../; pwd)`
-export this_case=srao_llc_dom0
-
-. $ROOT/lib/xen-mceinj-tool.sh
-
-usage()
-{
-    echo "Usage: ./cases.sh [-options] [arguments]"
-    echo "================Below are the optional options================"
-    echo -e "\t-d domainID\t: 0"
-    echo -e "\t-c injcpu\t: which cpu to inject error"
-    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
-    echo -e "\t\t\tBy default, the GPA is 0x180020"
-    echo -e "\t-h help"
-    exit 0
-}
-
-while getopts ":c:d:p:h" option
-do
-    case "$option" in
-    c) injcpu=$OPTARG;;
-    d) domid=$OPTARG;;
-    p) pageaddr=$OPTARG;;
-    h) usage;;
-    *) echo "invalid option!"; usage;;
-    esac
-done
-
-[ -z $domid ] && domid=0
-
-inject()
-{
-    mce_inject_trigger $MCE_SRAO_LLC -d $domid -u $injcpu -p $pageaddr 
-    if [ $? -eq 0 ]; then
-        show "  Passed: Successfully to fake and inject a MCE error"
-    else
-        show "  Failed: Fake error and inject fail !!"
-        return 1
-    fi
-    return 0
-}
-
-do_main()
-{
-    ret_val=0
-    clean_env
-    inject || ret_val=1
-    xen_verify || ret_val=1
-    mcelog_verify $MCE_SRAO_LLC || ret_val=1
-    gen_result $ret_val
-}
-
-do_main "$@"
diff --git a/tools/tests/mce-test/cases/srao_llc/guest/cases.sh b/tools/tests/mce-test/cases/srao_llc/guest/cases.sh
deleted file mode 100644
index 47a7ee4ab9..0000000000
--- a/tools/tests/mce-test/cases/srao_llc/guest/cases.sh
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-sd=$(dirname $0)
-export ROOT=`(cd $sd/../../../; pwd)`
-export this_case=srao_llc_guest
-
-. $ROOT/lib/xen-mceinj-tool.sh
-
-usage()
-{
-    echo "Usage: ./cases.sh [-options] [arguments]"
-    echo "================Below are the must have options==============="
-    echo -e "\t-i image\t: guest image"
-    echo -e "\t-m memory\t: set guest virtual memory"
-    echo "========                                              ========"
-    echo "================Below are the optional options================"
-    echo -e "\t-u vcpus\t: set guest virtual cpus number"
-    echo -e "\t-c injcpu\t: which cpu to inject error"
-    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
-    echo -e "\t\t\tBy default, the GPA is 0x180020"
-    echo -e "\t-h help"
-    exit 0
-}
-
-[ $# -lt 1 ] && usage
-
-while getopts ":i:u:m:c:p:hl:" option
-do
-    case "$option" in
-    i) image=$OPTARG; offset=`kpartx -l $image | awk '{print $NF*512}'`;;
-    u) vcpus=$OPTARG;;
-    m) memory=$OPTARG;;
-    c) injcpu=$OPTARG;;
-    p) pageaddr=$OPTARG;;
-    l) early_kill="0";;
-    h) usage;;
-    *) echo "invalid option!"; usage;;
-    esac
-done
-
-
-start_guest()
-{
-    create_hvm_guest $image -u $vcpus -m $memory
-    if [ $? -ne 0 ]; then
-        echo "  Create guest fail!"
-        return 1
-    fi
-    return 0
-}
-
-inject()
-{
-    mce_inject_trigger $MCE_SRAO_LLC -u $injcpu -p $pageaddr 
-    if [ $? -eq 0 ]; then
-        show "  Passed: Successfully to fake and inject a MCE error"
-    else
-        show "  Failed: Fake error and inject fail !!"
-        return 1
-    fi
-    return 0
-}
-
-do_main()
-{
-    ret_val=0
-    clean_env
-    start_guest || ret_val=1
-    inject || ret_val=1
-    xen_verify || ret_val=1
-    guest_verify || ret_val=1
-    mcelog_verify $MCE_SRAO_LLC || ret_val=1
-    des_guest
-    gen_result $ret_val
-}
-
-do_main "$@"
diff --git a/tools/tests/mce-test/cases/srao_llc/xen/cases.sh b/tools/tests/mce-test/cases/srao_llc/xen/cases.sh
deleted file mode 100644
index 1d8e02ff65..0000000000
--- a/tools/tests/mce-test/cases/srao_llc/xen/cases.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-sd=$(dirname $0)
-export ROOT=`(cd $sd/../../../; pwd)`
-export this_case=srao_llc_xen
-
-. $ROOT/lib/xen-mceinj-tool.sh
-
-usage()
-{
-    echo "Usage: ./cases.sh [-options] [arguments]"
-    echo "================Below are the optional options================"
-    echo -e "\t-c injcpu\t: which cpu to inject error"
-    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
-    echo -e "\t\t\tBy default, the GPA is 0x180020"
-    echo -e "\t-h help"
-    exit 0
-}
-
-while getopts ":c:p:h" option
-do
-    case "$option" in
-    c) injcpu=$OPTARG;;
-    p) pageaddr=$OPTARG;;
-    h) usage;;
-    *) echo "invalid option!"; usage;;
-    esac
-done
-
-inject()
-{
-    mce_inject_trigger $MCE_SRAO_LLC -u $injcpu -p $pageaddr 
-    if [ $? -eq 0 ]; then
-        show "  Passed: Successfully to fake and inject a MCE error"
-    else
-        show "  Failed: Fake error and inject fail !!"
-        return 1
-    fi
-    return 0
-}
-
-do_main()
-{
-    ret_val=0
-    clean_env
-    inject || ret_val=1
-    xen_verify || ret_val=1
-    mcelog_verify $MCE_SRAO_LLC || ret_val=1
-    gen_result $ret_val
-}
-
-do_main "$@"
diff --git a/tools/tests/mce-test/cases/srao_mem/dom0/cases.sh b/tools/tests/mce-test/cases/srao_mem/dom0/cases.sh
deleted file mode 100644
index 22d4a00960..0000000000
--- a/tools/tests/mce-test/cases/srao_mem/dom0/cases.sh
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-sd=$(dirname $0)
-export ROOT=`(cd $sd/../../../; pwd)`
-export this_case=srao_mem_dom0
-
-. $ROOT/lib/xen-mceinj-tool.sh
-
-usage()
-{
-    echo "Usage: ./cases.sh [-options] [arguments]"
-    echo "================Below are the optional options================"
-    echo -e "\t-d domainID\t: 0"
-    echo -e "\t-c injcpu\t: which cpu to inject error"
-    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
-    echo -e "\t\t\tBy default, the GPA is 0x180020"
-    echo -e "\t-h help"
-    exit 0
-}
-
-while getopts ":c:d:p:h" option
-do
-    case "$option" in
-    c) injcpu=$OPTARG;;
-    d) domid=$OPTARG;;
-    p) pageaddr=$OPTARG;;
-    h) usage;;
-    *) echo "invalid option!"; usage;;
-    esac
-done
-
-[ -z $domid ] && domid=0
-
-inject()
-{
-    mce_inject_trigger $MCE_SRAO_MEM -d $domid -u $injcpu -p $pageaddr 
-    if [ $? -eq 0 ]; then
-        show "  Passed: Successfully to fake and inject a MCE error"
-    else
-        show "  Failed: Fake error and inject fail !!"
-        return 1
-    fi
-    return 0
-}
-
-do_main()
-{
-    ret_val=0
-    clean_env
-    inject || ret_val=1
-    xen_verify || ret_val=1
-    mcelog_verify $MCE_SRAO_MEM || ret_val=1
-    gen_result $ret_val
-}
-
-do_main "$@"
diff --git a/tools/tests/mce-test/cases/srao_mem/guest/cases.sh b/tools/tests/mce-test/cases/srao_mem/guest/cases.sh
deleted file mode 100644
index 7ab4523096..0000000000
--- a/tools/tests/mce-test/cases/srao_mem/guest/cases.sh
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-sd=$(dirname $0)
-export ROOT=`(cd $sd/../../../; pwd)`
-export this_case=srao_mem_guest
-
-. $ROOT/lib/xen-mceinj-tool.sh
-
-usage()
-{
-    echo "Usage: ./cases.sh [-options] [arguments]"
-    echo "================Below are the must have options==============="
-    echo -e "\t-i image\t: guest image"
-    echo -e "\t-m memory\t: set guest virtual memory"
-    echo "========                                              ========"
-    echo "================Below are the optional options================"
-    echo -e "\t-u vcpus\t: set guest virtual cpus number"
-    echo -e "\t-c injcpu\t: which cpu to inject error"
-    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
-    echo -e "\t\t\tBy default, the GPA is 0x180020"
-    echo -e "\t-h help"
-    exit 0
-}
-
-[ $# -lt 1 ] && usage
-
-while getopts ":i:u:m:c:p:hl:" option
-do
-    case "$option" in
-    i) image=$OPTARG; offset=`kpartx -l $image | awk '{print $NF*512}'`;;
-    u) vcpus=$OPTARG;;
-    m) memory=$OPTARG;;
-    c) injcpu=$OPTARG;;
-    p) pageaddr=$OPTARG;;
-    l) early_kill="0";;
-    h) usage;;
-    *) echo "invalid option!"; usage;;
-    esac
-done
-
-
-start_guest()
-{
-    create_hvm_guest $image -u $vcpus -m $memory
-    if [ $? -ne 0 ]; then
-        echo "  Create guest fail!"
-        return 1
-    fi
-    return 0
-}
-
-inject()
-{
-    mce_inject_trigger $MCE_SRAO_MEM -u $injcpu -p $pageaddr 
-    if [ $? -eq 0 ]; then
-        show "  Passed: Successfully to fake and inject a MCE error"
-    else
-        show "  Failed: Fake error and inject fail !!"
-        return 1
-    fi
-    return 0
-}
-
-do_main()
-{
-    ret_val=0
-    clean_env
-    start_guest || ret_val=1
-    inject || ret_val=1
-    xen_verify || ret_val=1
-    guest_verify || ret_val=1
-    mcelog_verify $MCE_SRAO_MEM || ret_val=1
-    des_guest
-    gen_result $ret_val
-}
-
-do_main "$@"
diff --git a/tools/tests/mce-test/cases/srao_mem/xen/cases.sh b/tools/tests/mce-test/cases/srao_mem/xen/cases.sh
deleted file mode 100644
index 7ae49a82ac..0000000000
--- a/tools/tests/mce-test/cases/srao_mem/xen/cases.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-sd=$(dirname $0)
-export ROOT=`(cd $sd/../../../; pwd)`
-export this_case=srao_mem_xen
-
-. $ROOT/lib/xen-mceinj-tool.sh
-
-usage()
-{
-    echo "Usage: ./cases.sh [-options] [arguments]"
-    echo "================Below are the optional options================"
-    echo -e "\t-c injcpu\t: which cpu to inject error"
-    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
-    echo -e "\t\t\tBy default, the GPA is 0x180020"
-    echo -e "\t-h help"
-    exit 0
-}
-
-while getopts ":c:p:h" option
-do
-    case "$option" in
-    c) injcpu=$OPTARG;;
-    p) pageaddr=$OPTARG;;
-    h) usage;;
-    *) echo "invalid option!"; usage;;
-    esac
-done
-
-inject()
-{
-    mce_inject_trigger $MCE_SRAO_MEM -u $injcpu -p $pageaddr 
-    if [ $? -eq 0 ]; then
-        show "  Passed: Successfully to fake and inject a MCE error"
-    else
-        show "  Failed: Fake error and inject fail !!"
-        return 1
-    fi
-    return 0
-}
-
-do_main()
-{
-    ret_val=0
-    clean_env
-    inject || ret_val=1
-    xen_verify || ret_val=1
-    mcelog_verify $MCE_SRAO_MEM || ret_val=1
-    gen_result $ret_val
-}
-
-do_main "$@"
diff --git a/tools/tests/mce-test/cases/ucna_llc/dom0/cases.sh b/tools/tests/mce-test/cases/ucna_llc/dom0/cases.sh
deleted file mode 100644
index 808f007708..0000000000
--- a/tools/tests/mce-test/cases/ucna_llc/dom0/cases.sh
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-sd=$(dirname $0)
-export ROOT=`(cd $sd/../../../; pwd)`
-export this_case=ucna_llc_dom0
-
-. $ROOT/lib/xen-mceinj-tool.sh
-
-usage()
-{
-    echo "Usage: ./cases.sh [-options] [arguments]"
-    echo "================Below are the optional options================"
-    echo -e "\t-d domainID\t: 0"
-    echo -e "\t-c injcpu\t: which cpu to inject error"
-    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
-    echo -e "\t\t\tBy default, the GPA is 0x180020"
-    echo -e "\t-h help"
-    exit 0
-}
-
-while getopts ":c:d:p:h" option
-do
-    case "$option" in
-    c) injcpu=$OPTARG;;
-    d) domid=$OPTARG;;
-    p) pageaddr=$OPTARG;;
-    h) usage;;
-    *) echo "invalid option!"; usage;;
-    esac
-done
-
-[ -z $domid ] && domid=0
-
-inject()
-{
-    mce_inject_trigger $CMCI_UCNA_LLC -d $domid -u $injcpu -p $pageaddr 
-    if [ $? -eq 0 ]; then
-        show "  Passed: Successfully to fake and inject a MCE error"
-    else
-        show "  Failed: Fake error and inject fail !!"
-        return 1
-    fi
-    return 0
-}
-
-do_main()
-{
-    ret_val=0
-    clean_env
-    inject || ret_val=1
-    mcelog_verify $CMCI_UCNA_LLC || ret_val=1
-    gen_result $ret_val
-}
-
-do_main "$@"
diff --git a/tools/tests/mce-test/cases/ucna_llc/guest/cases.sh b/tools/tests/mce-test/cases/ucna_llc/guest/cases.sh
deleted file mode 100644
index 0ca4e2c961..0000000000
--- a/tools/tests/mce-test/cases/ucna_llc/guest/cases.sh
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-sd=$(dirname $0)
-export ROOT=`(cd $sd/../../../; pwd)`
-export this_case=ucna_llc_guest
-
-. $ROOT/lib/xen-mceinj-tool.sh
-
-usage()
-{
-    echo "Usage: ./cases.sh [-options] [arguments]"
-    echo "================Below are the must have options==============="
-    echo -e "\t-i image\t: guest image"
-    echo -e "\t-m memory\t: set guest virtual memory"
-    echo "========                                              ========"
-    echo "================Below are the optional options================"
-    echo -e "\t-u vcpus\t: set guest virtual cpus number"
-    echo -e "\t-c injcpu\t: which cpu to inject error"
-    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
-    echo -e "\t\t\tBy default, the GPA is 0x180020"
-    echo -e "\t-h help"
-    exit 0
-}
-
-[ $# -lt 1 ] && usage
-
-while getopts ":i:u:m:c:p:hl:" option
-do
-    case "$option" in
-    i) image=$OPTARG; offset=`kpartx -l $image | awk '{print $NF*512}'`;;
-    u) vcpus=$OPTARG;;
-    m) memory=$OPTARG;;
-    c) injcpu=$OPTARG;;
-    p) pageaddr=$OPTARG;;
-    l) early_kill="0";;
-    h) usage;;
-    *) echo "invalid option!"; usage;;
-    esac
-done
-
-
-start_guest()
-{
-    create_hvm_guest $image -u $vcpus -m $memory
-    if [ $? -ne 0 ]; then
-        echo "  Create guest fail!"
-        return 1
-    fi
-    return 0
-}
-
-inject()
-{
-    mce_inject_trigger $CMCI_UCNA_LLC -u $injcpu -p $pageaddr 
-    if [ $? -eq 0 ]; then
-        show "  Passed: Successfully to fake and inject a MCE error"
-    else
-        show "  Failed: Fake error and inject fail !!"
-        return 1
-    fi
-    return 0
-}
-
-do_main()
-{
-    ret_val=0
-    clean_env
-    start_guest || ret_val=1
-    inject || ret_val=1
-    mcelog_verify $CMCI_UCNA_LLC || ret_val=1
-    des_guest
-    gen_result $ret_val
-}
-
-do_main "$@"
diff --git a/tools/tests/mce-test/cases/ucna_llc/xen/cases.sh b/tools/tests/mce-test/cases/ucna_llc/xen/cases.sh
deleted file mode 100644
index c73a2f6c16..0000000000
--- a/tools/tests/mce-test/cases/ucna_llc/xen/cases.sh
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-sd=$(dirname $0)
-export ROOT=`(cd $sd/../../../; pwd)`
-export this_case=ucna_llc_xen
-
-. $ROOT/lib/xen-mceinj-tool.sh
-
-usage()
-{
-    echo "Usage: ./cases.sh [-options] [arguments]"
-    echo "================Below are the optional options================"
-    echo -e "\t-c injcpu\t: which cpu to inject error"
-    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
-    echo -e "\t\t\tBy default, the GPA is 0x180020"
-    echo -e "\t-h help"
-    exit 0
-}
-
-while getopts ":c:p:h" option
-do
-    case "$option" in
-    c) injcpu=$OPTARG;;
-    p) pageaddr=$OPTARG;;
-    h) usage;;
-    *) echo "invalid option!"; usage;;
-    esac
-done
-
-inject()
-{
-    mce_inject_trigger $CMCI_UCNA_LLC -u $injcpu -p $pageaddr 
-    if [ $? -eq 0 ]; then
-        show "  Passed: Successfully to fake and inject a MCE error"
-    else
-        show "  Failed: Fake error and inject fail !!"
-        return 1
-    fi
-    return 0
-}
-
-do_main()
-{
-    ret_val=0
-    clean_env
-    inject || ret_val=1
-    mcelog_verify $CMCI_UCNA_LLC || ret_val=1
-    gen_result $ret_val
-}
-
-do_main "$@"
diff --git a/tools/tests/mce-test/config/setup.conf b/tools/tests/mce-test/config/setup.conf
deleted file mode 100644
index 05f754dfd6..0000000000
--- a/tools/tests/mce-test/config/setup.conf
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-#
-# Software injection based test cases: test cases are triggered via
-# mce-inject tool.
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-export MCE_SRAO_MEM=0
-export MCE_SRAO_LLC=1
-export CMCI_UCNA_LLC=2
diff --git a/tools/tests/mce-test/lib/xen-mceinj-tool.sh b/tools/tests/mce-test/lib/xen-mceinj-tool.sh
deleted file mode 100644
index c0a3b293c5..0000000000
--- a/tools/tests/mce-test/lib/xen-mceinj-tool.sh
+++ /dev/null
@@ -1,260 +0,0 @@
-#!/bin/bash
-#
-# Software injection based test cases: test cases are triggered via
-# mce-inject tool.
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-. $ROOT/config/setup.conf
-
-#Guest Image Preparation
-hvm_image_prepare()
-{
-    local image=$1
-    local tmpdir=`mktemp -d`
-    local tmpfile=`mktemp`
-    local offset=`kpartx -l $image | awk '{print $NF*512}'`
-    mount -oloop,offset=$offset $image $tmpdir && echo "mount image to $tmpdir"
-    local g_grub=$tmpdir/boot/grub/grub.conf
-    if [ $? -ne 0 ]; then
-        show "  Mount image failed!"
-        return 1
-    fi
-
-    if ! grep FLAG_CONSOLE $g_grub; then
-        sed -e '/kernel/s/$/ console=ttyS0,115200,8n1 console=tty0/g' \
-            $g_grub > $tmpfile
-        mv -f $tmpfile $g_grub
-        rm -f $tmpfile
-        echo "
-#### FLAG_CONSOLE #### " >> $g_grub
-    fi
-    umount $tmpdir
-    rm -fr $tmpdir
-
-    return 0
-}
-
-create_hvm_guest()
-{
-    local image=$1
-    local originconfig="/etc/xen/xmexample.hvm"
-    local TF=`mktemp`
-    local case_dir=$ROOT/results/$this_case
-    local config=$case_dir/guest_config
-    [ -d $case_dir ] || mkdir $case_dir
-    [ -f $logfile ] || touch $logfile
-    local File=`echo $image|sed "s/\//\\\\\\\\\\//g"`
-    local g_name="`basename $image`_`date +%H%M%S`"
-
-    hvm_image_prepare $image
-
-    while getopts ":u:m:" Option
-    do
-        case $Option in
-            u ) vcpus=$OPTARG;;
-            m ) memory=$OPTARG;;
-            e ) bridge_name=$OPTARG;;
-            * ) ;;
-        esac
-    done
-
-    cp $originconfig $config -f
-
-    if [ -z $image ]; then
-        show "Image file $image does not exist, Please input one valid file"
-        return 1
-    fi
-
-    sed -e "/^disk/s/file:.*,\(hda\)/file:${File},\1/" $config \
-          | sed -e "/^disk/s/phy:.*,\(hda\)/file:${File},\1/" >$TF
-    mv -f $TF $config
-
-    [ -z $memory ] || sed -i "/^memory/s/^.*$/memory = $memory/" $config
-    [ -z $vcpus ] || sed -i "1,/^#vcpus/s/^#vcpus.*$/vcpus=$vcpus/;1d" $config
-    sed -i "/^vif/s/vif/#vif/" $config
-    sed -i "/^name/s/^.*$/name = \"$g_name\"/" $config
-
-    string1=$(ls /dev/pts | sort)
-    xm cr $config
-    [ $? -eq 0 ] && domid=`xm list $g_name | tail -n1 | awk '{print $2}'`
-    if [ -z $domid ]; then
-        show "  Guest can not boot up"
-        return 1
-    fi
-    
-    sleep 10
-
-    string2=$(ls /dev/pts | sort)
-
-    get_guest_klog
-    sleep 40
-
-    return 0
-}
-
-get_guest_klog()
-{
-    local case_dir=$ROOT/results/$this_case
-    gklog=$case_dir/gklog
-    [ -d $case_dir ] || mkdir $case_dir
-    [ -f $gklog ] || touch $gklog
-    for fo in $string2; do
-        echo $string1 | grep $fo -wq
-        [ $? -eq 1 ] && num=$fo
-    done
-    cat /dev/pts/$num > $gklog &
-}
-
-mce_inject_trigger()
-{
-    local errtype=$1
-    local append=""
-    while getopts ":d:u:p:" Option
-    do
-        case $Option in
-            d ) domid=$OPTARG;;
-            u ) cpu=$OPTARG;;
-            p ) pageaddr=$OPTARG;;
-            * ) ;;
-        esac
-    done
-
-    [ -z $domid ] || append=$append" -d $domid"
-    [ -z $cpu ] || append=$append" -c $cpu"
-    [ -z $pageaddr ] || append=$append" -p $pageaddr"
-
-    [ -f $ROOT/tools/xen-mceinj ]
-    if [ $? -eq 0 ]; then
-        xm dmesg -c
-        $ROOT/tools/xen-mceinj -t $errtype $append
-        if [ $? -ne 0 ]; then
-            show "  Failed: Maybe the memory addr is out of range. \
-                      Please check whether used xen-mceinj tool correctlly"
-            return 1
-        fi
-    else
-        show "  Failed: please compile xen-mce inject tool firstly"
-        return 1
-    fi
-    return 0
-}
-
-xen_verify()
-{
-    local case_dir=$ROOT/results/$this_case
-    local xenlog=$case_dir/xenlog
-    [ -d $case_dir ] || mkdir $case_dir
-    [ -f $xenlog ] || touch $xenlog
-    xm dmesg > $xenlog
-    grep "Error is successfully recovered" $xenlog > /dev/null
-    if [ $? -eq 0 ]; then
-        show "  Passed: Xen handle this MCE error successfully"
-    else
-        show "  Failed: Xen does not handle MCE error correctly !!"
-        return 1
-    fi
-    return 0
-}
-
-guest_verify()
-{
-    grep "kernel page recovery" $gklog > /dev/null
-    if [ $? -eq 0 ]; then
-        show "  Passed: Guest recive MCE error and solved correctly"
-    else
-        show "  Failed: Guest fail to solve MCE error"
-        return 1
-    fi
-    return 0
-}
-
-mcelog_verify()
-{
-    local err_type=$1
-    local ret=0
-    local case_dir=$ROOT/results/$this_case
-    local mcelog=$case_dir/mcelog
-    [ -d $case_dir ] || mkdir $case_dir
-    [ -f $mcelog ] || touch $mcelog
-    mcelog > $mcelog
-    if [ -z $mcelog ]; then
-        show "  Failed: MCELOG does not catch anything"
-        return 1
-    else
-        if [ $err_type -eq 0 ]; then
-            grep "MEMORY CONTROLLER MS_CHANNELunspecified_ERR" $mcelog \
-                > /dev/null
-            ret=$?
-        elif [ $err_type -eq 1 ]; then
-            grep "Generic CACHE Level-2 Eviction Error" $mcelog > /dev/null
-            ret=$?
-        elif [ $err_type -eq 2 ]; then
-            grep "Data CACHE Level-2 Data-Read Error" $mcelog > /dev/null
-            ret=$?
-        fi
-
-        if [ $ret -eq 0 ]; then
-            show "  Passed: MCElog catch a correct error"
-        else 
-            show "  Failed: MCE log catch a incorrect error !!"
-            return 1
-        fi
-    fi
-
-    return 0
-}
-
-function des_guest()
-{
-    xm des $domid    
-}
-
-function clean_env()
-{
-    [ -d $ROOT/results ] || mkdir $ROOT/results
-    # clean logs and results of last test for this case
-    rm -fr $ROOT/results/$this_case/*
-}
-
-function show()
-{
-    local case_dir=$ROOT/results/$this_case
-    local logfile=$case_dir/testlog
-    [ -d $case_dir ] || mkdir $case_dir
-    [ -f $logfile ] || touch $logfile
-    echo -e $* | tee -a $logfile > /dev/null
-}
-
-function gen_result()
-{
-    local ret=$1
-    local case_dir=$ROOT/results/$this_case
-    local result=$case_dir/result
-    [ -d $case_dir ] || mkdir $case_dir
-    [ -f $result ] || touch $result
-    
-    if [ $ret -eq 0 ]; then
-        echo "PASSED" > $result
-    elif [ $ret -eq 1 ]; then
-        echo "FAILED" > $result
-        echo "   Please check testlog for details!!! " >> $result
-    else
-        echo "NORESULT" > $result
-        echo "   Please check testlog for details!!! " >> $result
-    fi
-}
diff --git a/tools/tests/mce-test/tools/Makefile b/tools/tests/mce-test/tools/Makefile
deleted file mode 100644
index 0e92ac2977..0000000000
--- a/tools/tests/mce-test/tools/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-XEN_ROOT=$(CURDIR)/../../../..
-include $(XEN_ROOT)/tools/Rules.mk
-
-CFLAGS += -Werror
-CFLAGS += $(CFLAGS_libxenctrl)
-CFLAGS += $(CFLAGS_libxenguest)
-CFLAGS += $(CFLAGS_libxenstore)
-CFLAGS += $(CFLAGS_xeninclude)
-
-.PHONY: all
-all: xen-mceinj
-
-install: xen-mceinj
-	$(INSTALL_PROG) xen-mceinj $(DESTDIR)$(sbindir)
-
-.PHONY: clean
-clean:
-	$(RM) *.o xen-mceinj
-
-.PHONY: distclean
-distclean: clean
-
-xen-mceinj: xen-mceinj.o Makefile
-	$(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore)
diff --git a/tools/tests/mce-test/tools/README b/tools/tests/mce-test/tools/README
deleted file mode 100644
index bd0d442bae..0000000000
--- a/tools/tests/mce-test/tools/README
+++ /dev/null
@@ -1,24 +0,0 @@
-Xen Machine Check Exception(MCE) error inject tool
-----------------------------------------------
-
-xen-mceinj is a software MCE injection tool, which is based on Xen 
-MCE injection mechanism. It allows to inject machine check errors on the
-software level into a running Xen/dom0/VM. This is intended for
-validation of the Xen machine check handler.
-
-With the help of the Makefile, it is possible to compile a binary file 
-named "xen-mceinj".
-
-Usage
------
-$make (make install) --Note: make sure compile xen/tools before do this step
-$./xen-mceinj [OPTION]...
-
-OPTION arguments can be:
-  -D, --dump           dump addr info without error injection
-  -c, --cpu=CPU_ID     target CPU, the default is CPU0
-  -d, --domain=DomID   target domain, the default is Xen itself
-  -p, --page           physical page address, the default is 0x180020
-  -t, --type=error     error type
-
-For detail help, please refer to "./xen-mceinj -h"
diff --git a/tools/tests/mce-test/tools/xen-mceinj.c b/tools/tests/mce-test/tools/xen-mceinj.c
deleted file mode 100644
index 1187d01e5f..0000000000
--- a/tools/tests/mce-test/tools/xen-mceinj.c
+++ /dev/null
@@ -1,545 +0,0 @@
-/*
- * xen-mceinj.c: utilities to inject fake MCE for x86.
- * Copyright (c) 2010, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; If not, see <http://www.gnu.org/licenses/>.
- *
- * Authors: Yunhong Jiang <yunhong.jiang@intel.com>
- *          Haicheng Li <haicheng.li@intel.com>
- *          Xudong Hao <xudong.hao@intel.com>
- */
-
-
-#define _GNU_SOURCE
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <getopt.h>
-#include <errno.h>
-#include <signal.h>
-#include <stdarg.h>
-
-#define XC_WANT_COMPAT_MAP_FOREIGN_API
-#include <xenctrl.h>
-#include <xenguest.h>
-#include <inttypes.h>
-#include <sys/time.h>
-#include <xen/arch-x86/xen-mca.h>
-#include <xenstore.h>
-
-#define MCi_type_CTL        0x0
-#define MCi_type_STATUS     0x1
-#define MCi_type_ADDR       0x2
-#define MCi_type_MISC       0x3
-#define MCi_type_CTL2       0x4
-
-#define INVALID_MSR         ~0UL
-
-/* Intel MSRs */
-#define MSR_IA32_MCG_CAP         0x00000179
-#define MSR_IA32_MCG_STATUS      0x0000017a
-#define MSR_IA32_MCG_CTL         0x0000017b
-#define MSR_IA32_MC0_CTL         0x00000400
-#define MSR_IA32_MC0_STATUS      0x00000401
-#define MSR_IA32_MC0_ADDR        0x00000402
-#define MSR_IA32_MC0_MISC        0x00000403
-#define MSR_IA32_MC0_CTL2        0x00000280
-
-#define MCG_STATUS_LMCE          0x8
-
-struct mce_info {
-    const char *description;
-    uint8_t mcg_stat;
-    unsigned int bank;
-    uint64_t mci_stat;
-    uint64_t mci_misc;
-    bool cmci;
-};
-
-static struct mce_info mce_table[] = {
-    /* LLC (Last Level Cache) EWB (Explicit Write Back) SRAO MCE */
-    {
-        .description = "MCE_SRAO_MEM",
-        .mcg_stat = 0x5,
-        .bank = 7,
-        .mci_stat = 0xBD2000008000017Aull,
-        .mci_misc = 0x86ull,
-    },
-    /* Memory Patrol Scrub SRAO MCE */
-    {
-        .description = "MCE_SRAO_LLC",
-        .mcg_stat = 0x5,
-        .bank = 8,
-        .mci_stat = 0xBD000000004000CFull,
-        .mci_misc = 0x86ull,
-    },
-    /* LLC EWB UCNA Error */
-    {
-        .description = "CMCI_UCNA_LLC",
-        .mcg_stat = 0x0,
-        .bank = 9,
-        .mci_stat = 0xBC20000080000136ull,
-        .mci_misc = 0x86ull,
-        .cmci = true,
-    },
-    /* AMD L1 instruction cache data or tag parity. */
-    {
-        .description = "AMD L1 icache parity",
-        .mcg_stat = 0x5,
-        .bank = 1,
-        .mci_stat = 0x9400000000000151ull,
-        .mci_misc = 0x86ull,
-    },
-    /* LLC (Last Level Cache) EWB (Explicit Write Back) SRAO MCE */
-    {
-        .description = "MCE_SRAO_MEM (Fatal)",
-        .mcg_stat = 0x5,
-        .bank = 7,
-        .mci_stat = 0xBF2000008000017Aull,
-        .mci_misc = 0x86ull,
-    },
-};
-#define MCE_TABLE_SIZE (sizeof(mce_table)/sizeof(mce_table[0]))
-
-#define LOGFILE stdout
-
-int dump;
-int lmce;
-struct xen_mc_msrinject msr_inj;
-
-static void Lprintf(const char *fmt, ...)
-{
-    char *buf;
-    va_list args;
-
-    va_start(args, fmt);
-    if (vasprintf(&buf, fmt, args) < 0)
-        abort();
-    fprintf(LOGFILE, "%s\n", buf);
-    va_end(args);
-    free(buf);
-}
-
-static void err(xc_interface *xc_handle, const char *fmt, ...)
-{
-    char *buf;
-    va_list args;
-
-    va_start(args, fmt);
-    if (vasprintf(&buf, fmt, args) < 0)
-        abort();
-    perror(buf);
-    va_end(args);
-    free(buf);
-
-    if ( xc_handle )
-        xc_interface_close(xc_handle);
-    exit(EXIT_FAILURE);
-}
-
-static void init_msr_inj(void)
-{
-    memset(&msr_inj, 0, sizeof(msr_inj));
-}
-
-static int flush_msr_inj(xc_interface *xc_handle)
-{
-    struct xen_mc mc;
-
-    mc.cmd = XEN_MC_msrinject;
-    mc.interface_version = XEN_MCA_INTERFACE_VERSION;
-    mc.u.mc_msrinject = msr_inj;
-
-    return xc_mca_op(xc_handle, &mc);
-}
-
-static unsigned int mca_cpuinfo(xc_interface *xc_handle)
-{
-    struct xen_mc mc;
-
-    memset(&mc, 0, sizeof(struct xen_mc));
-
-    mc.cmd = XEN_MC_physcpuinfo;
-    mc.interface_version = XEN_MCA_INTERFACE_VERSION;
-
-    if (!xc_mca_op(xc_handle, &mc))
-        return mc.u.mc_physcpuinfo.ncpus;
-    else
-        return 0;
-}
-
-static int inject_cmci(xc_interface *xc_handle, unsigned int cpu_nr)
-{
-    struct xen_mc mc;
-    unsigned int nr_cpus;
-
-    memset(&mc, 0, sizeof(struct xen_mc));
-
-    nr_cpus = mca_cpuinfo(xc_handle);
-    if (!nr_cpus)
-        err(xc_handle, "Failed to get mca_cpuinfo");
-    if (cpu_nr >= nr_cpus)
-        err(xc_handle, "-c %u is larger than %u", cpu_nr, nr_cpus - 1);
-
-    mc.cmd = XEN_MC_inject_v2;
-    mc.interface_version = XEN_MCA_INTERFACE_VERSION;
-
-    mc.u.mc_inject_v2.flags |= XEN_MC_INJECT_CPU_BROADCAST;
-    mc.u.mc_inject_v2.flags |= XEN_MC_INJECT_TYPE_CMCI;
-    mc.u.mc_inject_v2.cpumap.nr_bits = nr_cpus;
-
-    return xc_mca_op(xc_handle, &mc);
-}
-
-static int inject_mce(xc_interface *xc_handle, int cpu_nr)
-{
-    struct xen_mc mc;
-
-    memset(&mc, 0, sizeof(struct xen_mc));
-
-    mc.cmd = XEN_MC_mceinject;
-    mc.interface_version = XEN_MCA_INTERFACE_VERSION;
-    mc.u.mc_mceinject.mceinj_cpunr = cpu_nr;
-
-    return xc_mca_op(xc_handle, &mc);
-}
-
-static int inject_lmce(xc_interface *xc_handle, unsigned int cpu)
-{
-    uint8_t *cpumap = NULL;
-    size_t cpumap_size, line, shift;
-    unsigned int nr_cpus;
-    int ret;
-
-    nr_cpus = mca_cpuinfo(xc_handle);
-    if ( !nr_cpus )
-        err(xc_handle, "Failed to get mca_cpuinfo");
-    if ( cpu >= nr_cpus )
-        err(xc_handle, "-c %u is larger than %u", cpu, nr_cpus - 1);
-
-    cpumap_size = (nr_cpus + 7) / 8;
-    cpumap = malloc(cpumap_size);
-    if ( !cpumap )
-        err(xc_handle, "Failed to allocate cpumap\n");
-    memset(cpumap, 0, cpumap_size);
-    line = cpu / 8;
-    shift = cpu % 8;
-    memset(cpumap + line, 1 << shift, 1);
-
-    ret = xc_mca_op_inject_v2(xc_handle, XEN_MC_INJECT_TYPE_LMCE,
-                              cpumap, cpumap_size * 8);
-
-    free(cpumap);
-    return ret;
-}
-
-static uint64_t bank_addr(int bank, int type)
-{
-    uint64_t addr;
-
-    switch ( type )
-    {
-    case MCi_type_CTL:
-    case MCi_type_STATUS:
-    case MCi_type_ADDR:
-    case MCi_type_MISC:
-        addr = MSR_IA32_MC0_CTL + (bank * 4) + type;
-        break;
-    case MCi_type_CTL2:
-        addr = MSR_IA32_MC0_CTL2 + bank;
-        break;
-    default:
-        addr = INVALID_MSR;
-        break;
-    }
-
-    return addr;
-}
-
-static int add_msr_intpose(xc_interface *xc_handle,
-                           uint32_t cpu_nr,
-                           uint32_t flags,
-                           uint64_t msr,
-                           uint64_t val,
-                           domid_t domid)
-{
-    uint32_t count;
-
-    if ( (msr_inj.mcinj_count &&
-          (cpu_nr != msr_inj.mcinj_cpunr || flags != msr_inj.mcinj_flags ||
-           domid != msr_inj.mcinj_domid)) ||
-         msr_inj.mcinj_count == MC_MSRINJ_MAXMSRS )
-    {
-        flush_msr_inj(xc_handle);
-        init_msr_inj();
-    }
-    count= msr_inj.mcinj_count;
-
-    if ( !count )
-    {
-        msr_inj.mcinj_cpunr = cpu_nr;
-        msr_inj.mcinj_flags = flags;
-        msr_inj.mcinj_domid = domid;
-    }
-    msr_inj.mcinj_msr[count].reg = msr;
-    msr_inj.mcinj_msr[count].value = val;
-    msr_inj.mcinj_count++;
-
-    return 0;
-}
-
-static int add_msr_bank_intpose(xc_interface *xc_handle,
-                                uint32_t cpu_nr,
-                                uint32_t flags,
-                                uint32_t type,
-                                uint32_t bank,
-                                uint64_t val,
-                                domid_t domid)
-{
-    uint64_t msr;
-
-    msr = bank_addr(bank, type);
-    if ( msr == INVALID_MSR )
-        return -1;
-    return add_msr_intpose(xc_handle, cpu_nr, flags, msr, val, domid);
-}
-
-static int inject_mcg_status(xc_interface *xc_handle,
-                             uint32_t cpu_nr,
-                             uint64_t val,
-                             domid_t domid)
-{
-    return add_msr_intpose(xc_handle, cpu_nr, MC_MSRINJ_F_INTERPOSE,
-                           MSR_IA32_MCG_STATUS, val, domid);
-}
-
-static int inject_mci_status(xc_interface *xc_handle,
-                             uint32_t cpu_nr,
-                             uint64_t bank,
-                             uint64_t val,
-                             domid_t domid)
-{
-    return add_msr_bank_intpose(xc_handle, cpu_nr, MC_MSRINJ_F_INTERPOSE,
-                                MCi_type_STATUS, bank, val, domid);
-}
-
-static int inject_mci_misc(xc_interface *xc_handle,
-                           uint32_t cpu_nr,
-                           uint64_t bank,
-                           uint64_t val,
-                           domid_t domid)
-{
-    return add_msr_bank_intpose(xc_handle, cpu_nr, MC_MSRINJ_F_INTERPOSE,
-                                MCi_type_MISC, bank, val, domid);
-}
-
-static int inject_mci_addr(xc_interface *xc_handle,
-                           uint32_t cpu_nr,
-                           uint64_t bank,
-                           uint64_t val,
-                           domid_t domid)
-{
-    return add_msr_bank_intpose(xc_handle, cpu_nr,
-                                MC_MSRINJ_F_INTERPOSE |
-                                ((domid >= DOMID_FIRST_RESERVED &&
-                                  domid != DOMID_SELF) ?
-                                 0 : MC_MSRINJ_F_GPADDR),
-                                MCi_type_ADDR, bank, val, domid);
-}
-
-static int inject(xc_interface *xc_handle, struct mce_info *mce,
-                  uint32_t cpu_nr, uint32_t domain, uint64_t gaddr)
-{
-    int ret = 0;
-    uint8_t mcg_status = mce->mcg_stat;
-
-    if ( lmce )
-    {
-        if ( mce->cmci )
-            err(xc_handle, "No support to inject CMCI as LMCE");
-        mcg_status |= MCG_STATUS_LMCE;
-    }
-    ret = inject_mcg_status(xc_handle, cpu_nr, mcg_status, domain);
-    if ( ret )
-        err(xc_handle, "Failed to inject MCG_STATUS MSR");
-
-    ret = inject_mci_status(xc_handle, cpu_nr,
-                            mce->bank, mce->mci_stat, domain);
-    if ( ret )
-        err(xc_handle, "Failed to inject MCi_STATUS MSR");
-
-    ret = inject_mci_misc(xc_handle, cpu_nr,
-                          mce->bank, mce->mci_misc, domain);
-    if ( ret )
-        err(xc_handle, "Failed to inject MCi_MISC MSR");
-
-    ret = inject_mci_addr(xc_handle, cpu_nr, mce->bank, gaddr, domain);
-    if ( ret )
-        err(xc_handle, "Failed to inject MCi_ADDR MSR");
-
-    ret = flush_msr_inj(xc_handle);
-    if ( ret )
-        err(xc_handle, "Failed to inject MSR");
-    if ( mce->cmci )
-        ret = inject_cmci(xc_handle, cpu_nr);
-    else if ( lmce )
-        ret = inject_lmce(xc_handle, cpu_nr);
-    else
-        ret = inject_mce(xc_handle, cpu_nr);
-    if ( ret )
-        err(xc_handle, "Failed to inject MCE error");
-
-    return 0;
-}
-
-static long xs_get_dom_mem(int domid)
-{
-    char path[128];
-    char *memstr;
-    uint64_t mem;
-    unsigned int plen;
-    struct xs_handle *xs;
-
-    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_close(xs);
-
-    if (!memstr || !plen)
-        return -1;
-
-    mem = atoll(memstr)*1024;
-    free(memstr);
-
-    return mem;
-}
-
-static struct option opts[] = {
-    {"cpu", 0, 0, 'c'},
-    {"domain", 0, 0, 'd'},
-    {"dump", 0, 0, 'D'},
-    {"help", 0, 0, 'h'},
-    {"page", 0, 0, 'p'},
-    {"lmce", 0, 0, 'l'},
-    {"", 0, 0, '\0'}
-};
-
-static void help(void)
-{
-    unsigned int i;
-
-    printf("Usage: xen-mceinj [OPTION]...\n"
-           "\n"
-           "Mandatory arguments to long options are mandatory"
-           "for short options too.\n"
-           "  -D, --dump           dump addr info without error injection\n"
-           "  -c, --cpu=CPU        target CPU\n"
-           "  -d, --domain=DOMID   target domain, the default is Xen itself\n"
-           "  -h, --help           print this page\n"
-           "  -p, --page=ADDR      physical address to report\n"
-           "  -l, --lmce           inject as LMCE (Intel only)\n"
-           "  -t, --type=ERROR     error type\n");
-
-    for ( i = 0; i < MCE_TABLE_SIZE; i++ )
-        printf("                       %2d : %s\n",
-               i, mce_table[i].description);
-}
-
-int main(int argc, char *argv[])
-{
-    int type = 0;
-    int c, opt_index;
-    uint32_t domid;
-    xc_interface *xc_handle;
-    unsigned int cpu_nr;
-    uint64_t gaddr, max_gpa;
-
-    /* Default Value */
-    domid = DOMID_XEN;
-    gaddr = 0x180020;
-    cpu_nr = 0;
-
-    init_msr_inj();
-    xc_handle = xc_interface_open(0, 0, 0);
-    if ( !xc_handle ) {
-        Lprintf("Failed to get xc interface");
-        exit(EXIT_FAILURE);
-    }
-
-    while ( 1 ) {
-        c = getopt_long(argc, argv, "c:Dd:t:hp:l", opts, &opt_index);
-        if ( c == -1 )
-            break;
-        switch ( c ) {
-        case 'D':
-            dump=1;
-            break;
-        case 'c':
-            cpu_nr = strtoul(optarg, &optarg, 10);
-            if ( strlen(optarg) != 0 )
-                err(xc_handle, "Please input a digit parameter for CPU");
-            break;
-        case 'd':
-            domid = strtol(optarg, &optarg, 10);
-            if ( strlen(optarg) != 0 )
-                err(xc_handle, "Please input a digit parameter for domain");
-            break;
-        case 'p':
-            gaddr = strtol(optarg, &optarg, 0);
-            if ( strlen(optarg) != 0 )
-                err(xc_handle, "Please input correct page address");
-            break;
-        case 't':
-            type = strtol(optarg, NULL, 0);
-            break;
-        case 'l':
-            lmce = 1;
-            break;
-        case 'h':
-        default:
-            help();
-            return 0;
-        }
-    }
-
-    if ( domid != DOMID_XEN ) {
-        max_gpa = xs_get_dom_mem(domid);
-        Lprintf("get domain %d max gpa is: 0x%lx", domid, max_gpa);
-        if ( gaddr >= max_gpa )
-            err(xc_handle, "Fail: gaddr exceeds max_gpa 0x%lx", max_gpa);
-    }
-    Lprintf("get gaddr of error inject is: 0x%lx", gaddr);
-
-    if ( dump ) {
-        if ( domid == DOMID_XEN )
-            Lprintf("Xen: gaddr=0x%lx", gaddr);
-        else
-            Lprintf("Dom%d: gaddr=0x%lx", domid, gaddr);
-        goto out;
-    }
-
-    if ( type < 0 || type >= MCE_TABLE_SIZE ) {
-        err(xc_handle, "Unsupported error type");
-        goto out;
-    }
-
-    inject(xc_handle, &mce_table[type], cpu_nr, domid, gaddr);
-
- out:
-    xc_interface_close(xc_handle);
-    return 0;
-}
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 18:33:26 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 18:33:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153846.284232 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1vJW-0001ON-U8; Fri, 09 Jul 2021 18:33:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153846.284232; Fri, 09 Jul 2021 18:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1vJW-0001OF-Qv; Fri, 09 Jul 2021 18:33:26 +0000
Received: by outflank-mailman (input) for mailman id 153846;
 Fri, 09 Jul 2021 18:33:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1vJV-0001O2-9y
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 18:33:25 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1vJV-0006yM-98
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 18:33:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1vJV-00023g-8E
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 18: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kf+v/0enTgDQdoKUZhw6TlOCedDaHD8f+5pRDoE0qBQ=; b=JklQIEasOkx/xX/7ycfyP2NgGo
	BAuR2G6J83SVIqxdBkbl9hydtC5ZSCHug+8Q30Exh2fr1kzgWQ22HyyRd7xQF/QOnBFFgiMWVS8Jf
	XY+0XGIHba4LiS+hw+4EOi4dzUjsDkh7m1tXrisx9snwmKDR4HBnJuHqM2X7xyw40BeM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tests/resource: Rework Makefile
Message-Id: <E1m1vJV-00023g-8E@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 18:33:25 +0000

commit ff759953b32286f376fda7f3ff5a17eccb542b03
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 15 15:22:11 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 16:38:27 2021 +0100

    tests/resource: Rework Makefile
    
    In particular, fill in the install/uninstall rules so this test can be
    packaged to be automated sensibly.
    
    Make all object files depend on the Makefile, drop redundant -f's for $(RM),
    and use $(TARGET) when appropriate.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 tools/tests/resource/Makefile | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/tests/resource/Makefile b/tools/tests/resource/Makefile
index 4bef482966..1c3aee4ff7 100644
--- a/tools/tests/resource/Makefile
+++ b/tools/tests/resource/Makefile
@@ -12,17 +12,20 @@ run: $(TARGET)
 
 .PHONY: clean
 clean:
-	$(RM) -f -- *.o $(TARGET) $(DEPS_RM)
+	$(RM) -- *.o $(TARGET) $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
-	$(RM) -f -- *~
+	$(RM) -- *~
 
 .PHONY: install
 install: all
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_PROG) $(TARGET) $(DESTDIR)$(LIBEXEC_BIN)
 
 .PHONY: uninstall
 uninstall:
+	$(RM) -- $(DESTDIR)$(LIBEXEC_BIN)/$(TARGET)
 
 CFLAGS += -Werror
 CFLAGS += $(CFLAGS_xeninclude)
@@ -34,7 +37,9 @@ LDFLAGS += $(LDLIBS_libxenctrl)
 LDFLAGS += $(LDLIBS_libxenforeignmemory)
 LDFLAGS += $(APPEND_LDFLAGS)
 
-test-resource: test-resource.o
+%.o: Makefile
+
+$(TARGET): test-resource.o
 	$(CC) -o $@ $< $(LDFLAGS)
 
 -include $(DEPS_INCLUDE)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 18:33:36 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 18:33:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153847.284236 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1vJg-0001Rm-VS; Fri, 09 Jul 2021 18:33:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153847.284236; Fri, 09 Jul 2021 18:33:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1vJg-0001Re-ST; Fri, 09 Jul 2021 18:33:36 +0000
Received: by outflank-mailman (input) for mailman id 153847;
 Fri, 09 Jul 2021 18:33:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1vJf-0001RS-D4
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 18:33:35 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1vJf-0006yX-CH
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 18:33:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1vJf-00024J-BD
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UtBEiJUHgSLM56pIySqcYnUjBu9P3FVlBKoyrcMi61I=; b=udEnNwHRlIR+/2aNBFJDrHzZGD
	bVjUySnrOy7b4JtE3ei1VgCuG0X1ces3HljwdkGFyyAZi1AiQfkSqsVuqW545iGVn5gPlMgPFAdXE
	bcOsODFFd5WjkFb3iEZhrxKeHC9zqbJG0fFD6ETFt7r6E2sp4Iqu1PDioQillcbW4HF0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tests/cpu-policy: Rework Makefile
Message-Id: <E1m1vJf-00024J-BD@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 18:33:35 +0000

commit 6a9f5477637a9f2d1d61c0a065eeb01bf84f6484
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 15 15:37:49 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 16:38:27 2021 +0100

    tests/cpu-policy: Rework Makefile
    
    In particular, fill in the install/uninstall rules so this test can be
    packaged to be automated sensibly.
    
    Rework TARGET-y to be TARGETS, drop redundant -f's for $(RM), drop the
    unconditional -O3 and use the default instead, and drop CFLAGS from the link
    line but honour APPEND_LDFLAGS.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 tools/tests/cpu-policy/Makefile | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/tools/tests/cpu-policy/Makefile b/tools/tests/cpu-policy/Makefile
index 70ff154da6..93af9d76fa 100644
--- a/tools/tests/cpu-policy/Makefile
+++ b/tools/tests/cpu-policy/Makefile
@@ -1,21 +1,19 @@
 XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-TARGET-y := test-cpu-policy
+TARGETS :=
 
 # For brevity, these tests make extensive use of designated initialisers in
 # anonymous unions, but GCCs older than 4.6 can't cope.  Ignore the test in
 # this case.
-ifneq ($(clang),y)
-TARGET-$(call cc-ver,$(CC),lt,0x040600) :=
-endif
-
-ifeq ($(TARGET-y),)
+ifneq ($(gcc)$(call cc-ver,$(CC),lt,0x040600),yy)
+TARGETS += test-cpu-policy
+else
 $(warning Test harness not built, use newer compiler than "$(CC)" (version $(shell $(CC) -dumpversion)))
 endif
 
 .PHONY: all
-all: $(TARGET-y)
+all: $(TARGETS)
 
 .PHONY: run
 run: $(TARGET-y)
@@ -23,23 +21,32 @@ run: $(TARGET-y)
 
 .PHONY: clean
 clean:
-	$(RM) -f -- *.o .*.d .*.d2 test-cpu-policy
+	$(RM) -- *.o $(TARGETS) $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
-	$(RM) -f -- *~
+	$(RM) -- *~
 
 .PHONY: install
 install: all
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(if $(TARGETS),$(INSTALL_PROG) $(TARGETS) $(DESTDIR)$(LIBEXEC_BIN))
 
 .PHONY: uninstall
+uninstall:
+	$(RM) -- $(addprefix $(DESTDIR)$(LIBEXEC_BIN)/,$(TARGETS))
 
-CFLAGS += -Werror $(CFLAGS_xeninclude) -D__XEN_TOOLS__ -O3
+CFLAGS += -Werror -D__XEN_TOOLS__
+CFLAGS += $(CFLAGS_xeninclude)
 CFLAGS += $(APPEND_CFLAGS)
 
+LDFLAGS += $(APPEND_LDFLAGS)
+
 vpath %.c ../../../xen/lib/x86
 
+%.o: Makefile
+
 test-cpu-policy: test-cpu-policy.o msr.o cpuid.o policy.o
-	$(CC) $(CFLAGS) $^ -o $@
+	$(CC) $^ -o $@ $(LDFLAGS)
 
 -include $(DEPS_INCLUDE)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 09 18:33:47 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jul 2021 18:33:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.153848.284240 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1vJr-0001VQ-1w; Fri, 09 Jul 2021 18:33:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 153848.284240; Fri, 09 Jul 2021 18:33:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m1vJq-0001VI-UK; Fri, 09 Jul 2021 18:33:46 +0000
Received: by outflank-mailman (input) for mailman id 153848;
 Fri, 09 Jul 2021 18:33:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1vJp-0001V1-GC
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 18:33:45 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1vJp-0006yu-FP
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 18:33:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m1vJp-00025M-Ec
 for xen-changelog@lists.xenproject.org; Fri, 09 Jul 2021 18: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=V3dQfyFce6yhSUthvd53NMviGBdYm8g0oENnRYf5c40=; b=q/b46/0NXGMYfkWjliKOIEliXT
	C+h+QUwkLmzGfoIID+ne93hTmum3qbtqMqHYzToA+2daQCHeLy4ljdiTnVMsXqaznTc8//RnrrX7y
	M7D/07R7iHKmTpzBGKGN0veTUoEMbB48toSvApcnqIoX0trTrbIhmVrND8xPBRJYw00w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tests/xenstore: Rework Makefile
Message-Id: <E1m1vJp-00025M-Ec@xenbits.xenproject.org>
Date: Fri, 09 Jul 2021 18:33:45 +0000

commit 93c9edbef51b31056f93a37a778326c90a83158c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 15 16:02:29 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 16:38:27 2021 +0100

    tests/xenstore: Rework Makefile
    
    In particular, fill in the install/uninstall rules so this test can be
    packaged to be automated sensibly.
    
    This causes the code to be noticed by CI, which objects as follows:
    
      test-xenstore.c: In function 'main':
      test-xenstore.c:486:5: error: ignoring return value of 'asprintf', declared
      with attribute warn_unused_result [-Werror=unused-result]
           asprintf(&path, "%s/%u", TEST_PATH, getpid());
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Address the CI failure by checking the asprintf() return value and exiting.
    
    Rename xs-test to test-xenstore to be consistent with other tests.  Honour
    APPEND_FLAGS too.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 .gitignore                           |   1 -
 tools/tests/xenstore/.gitignore      |   1 +
 tools/tests/xenstore/Makefile        |  31 +-
 tools/tests/xenstore/test-xenstore.c | 541 +++++++++++++++++++++++++++++++++++
 tools/tests/xenstore/xs-test.c       | 537 ----------------------------------
 5 files changed, 564 insertions(+), 547 deletions(-)

diff --git a/.gitignore b/.gitignore
index d4b90303b2..8ebb51b6c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -275,7 +275,6 @@ tools/tests/x86_emulator/*sse*.[ch]
 tools/tests/x86_emulator/test_x86_emulator
 tools/tests/x86_emulator/x86_emulate
 tools/tests/x86_emulator/xop*.[ch]
-tools/tests/xenstore/xs-test
 tools/tests/vpci/list.h
 tools/tests/vpci/vpci.[hc]
 tools/tests/vpci/test_vpci
diff --git a/tools/tests/xenstore/.gitignore b/tools/tests/xenstore/.gitignore
new file mode 100644
index 0000000000..4b44f5dd60
--- /dev/null
+++ b/tools/tests/xenstore/.gitignore
@@ -0,0 +1 @@
+test-xenstore
diff --git a/tools/tests/xenstore/Makefile b/tools/tests/xenstore/Makefile
index a367d88803..b9969dd090 100644
--- a/tools/tests/xenstore/Makefile
+++ b/tools/tests/xenstore/Makefile
@@ -1,11 +1,7 @@
 XEN_ROOT=$(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += -Werror
-
-CFLAGS += $(CFLAGS_libxenstore)
-
-TARGETS-y := xs-test
+TARGETS-y := test-xenstore
 TARGETS := $(TARGETS-y)
 
 .PHONY: all
@@ -16,14 +12,31 @@ build: $(TARGETS)
 
 .PHONY: clean
 clean:
-	$(RM) *.o $(TARGETS) *~ $(DEPS_RM)
+	$(RM) -- *.o $(TARGETS) $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
+	$(RM) -- *~
+
+.PHONY: install
+install: all
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(if $(TARGETS),$(INSTALL_PROG) $(TARGETS) $(DESTDIR)$(LIBEXEC_BIN))
+
+.PHONY: uninstall
+uninstall:
+	$(RM) -- $(addprefix $(DESTDIR)$(LIBEXEC_BIN)/,$(TARGETS))
+
+CFLAGS += -Werror
+CFLAGS += $(CFLAGS_libxenstore)
+CFLAGS += $(APPEND_CFLAGS)
+
+LDFLAGS += $(LDLIBS_libxenstore)
+LDFLAGS += $(APPEND_LDFLAGS)
 
-xs-test: xs-test.o Makefile
-	$(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenstore)
+%.o: Makefile
 
-install uninstall:
+test-xenstore: test-xenstore.o
+	$(CC) -o $@ $< $(LDFLAGS)
 
 -include $(DEPS_INCLUDE)
diff --git a/tools/tests/xenstore/test-xenstore.c b/tools/tests/xenstore/test-xenstore.c
new file mode 100644
index 0000000000..d3574b3fa2
--- /dev/null
+++ b/tools/tests/xenstore/test-xenstore.c
@@ -0,0 +1,541 @@
+/*
+ * xs-test.c
+ *
+ * Do Xenstore tests.
+ *
+ * Copyright (C) 2016  Juergen Gross <jgross@suse.com>,
+ *                     SUSE Linux GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms and conditions of the GNU General Public
+ * License, version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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/>.
+ */
+
+#define _GNU_SOURCE
+#include <err.h>
+#include <getopt.h>
+#include <inttypes.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <time.h>
+#include <xenstore.h>
+
+#include <xen-tools/libs.h>
+
+#define TEST_PATH "xenstore-test"
+#define WRITE_BUFFERS_N    10
+#define WRITE_BUFFERS_SIZE 4000
+#define MAX_TA_LOOPS       100
+
+struct test {
+    char *name;
+    int (*func_init)(uintptr_t par);
+    int (*func)(uintptr_t par);
+    int (*func_deinit)(uintptr_t par);
+    uintptr_t par;
+    char *descr;
+};
+
+static struct xs_handle *xsh;
+static char *path;
+static char *paths[WRITE_BUFFERS_N];
+static char write_buffers[WRITE_BUFFERS_N][WRITE_BUFFERS_SIZE];
+static int ta_loops;
+
+static struct option options[] = {
+    { "list-tests", 0, NULL, 'l' },
+    { "test", 1, NULL, 't' },
+    { "random", 1, NULL, 'r' },
+    { "help", 0, NULL, 'h' },
+    { "iterations", 1, NULL, 'i' },
+    { NULL, 0, NULL, 0 }
+};
+
+static int call_test(struct test *tst, int iters, bool no_clock)
+{
+    char *stage = "?";
+    struct timespec tp1, tp2;
+    uint64_t nsec, nsec_min, nsec_max, nsec_sum;
+    int i, ret = 0;
+
+    nsec_min = -1;
+    nsec_max = 0;
+    nsec_sum = 0;
+
+    for ( i = 0; i < iters; i++ )
+    {
+        stage = "pre-init";
+        xs_rm(xsh, XBT_NULL, path);
+        if ( !xs_write(xsh, XBT_NULL, path, "", 0) )
+        {
+            ret = errno;
+            break;
+        }
+        stage = "init";
+        ret = tst->func_init(tst->par);
+        if ( ret )
+            break;
+        if ( clock_gettime(CLOCK_REALTIME, &tp1) )
+            no_clock = true;
+        stage = "run";
+        ret = tst->func(tst->par);
+        if ( ret )
+            break;
+        if ( clock_gettime(CLOCK_REALTIME, &tp2) )
+            no_clock = true;
+        if ( !no_clock )
+        {
+            nsec = tp2.tv_sec * 1000000000 + tp2.tv_nsec -
+                   tp1.tv_sec * 1000000000 - tp1.tv_nsec;
+            if ( nsec < nsec_min )
+                nsec_min = nsec;
+            if ( nsec > nsec_max )
+                nsec_max = nsec;
+            nsec_sum += nsec;
+        }
+        stage = "deinit";
+        ret = tst->func_deinit(tst->par);
+        if ( ret )
+            break;
+    }
+
+    if ( ret )
+        printf("%-10s: failed (ret = %d, stage %s)\n", tst->name, ret, stage);
+    else if ( !no_clock )
+    {
+        printf("%-10s:", tst->name);
+        if ( iters > 1 )
+            printf(" avg: %"PRIu64" ns (%"PRIu64" ns .. %"PRIu64" ns)",
+                   nsec_sum / iters, nsec_min, nsec_max);
+        else
+            printf(" %"PRIu64" ns", nsec_sum);
+        printf("\n");
+    }
+
+    return ret;
+}
+
+static void usage(int ret)
+{
+    FILE *out;
+
+    out = ret ? stderr : stdout;
+
+    fprintf(out, "usage: xs-test [<options>]\n");
+    fprintf(out, "  <options> are:\n");
+    fprintf(out, "  -i|--iterations <i>  perform each test <i> times (default 1)\n");
+    fprintf(out, "  -l|--list-tests      list available tests\n");
+    fprintf(out, "  -r|--random <time>   perform random tests for <time> seconds\n");
+    fprintf(out, "  -t|--test <test>     run <test> (default is all tests)\n");
+    fprintf(out, "  -h|--help            print this usage information\n");
+    exit(ret);
+}
+
+static int ret0(uintptr_t par)
+{
+    return 0;
+}
+
+static int verify_node(char *node, char *data, unsigned int size)
+{
+    char *buf;
+    unsigned int len;
+    int ret;
+
+    buf = xs_read(xsh, XBT_NULL, node, &len);
+    if ( !buf )
+        return errno;
+
+    ret = (len == size && !memcmp(buf, data, len)) ? 0 : ENOENT;
+    free(buf);
+
+    return ret;
+}
+
+static int test_read_init(uintptr_t par)
+{
+    if ( par > WRITE_BUFFERS_SIZE )
+        return EFBIG;
+    return xs_write(xsh, XBT_NULL, paths[0], write_buffers[0], par) ? 0 : errno;
+}
+
+static int test_read(uintptr_t par)
+{
+    char *buf;
+    unsigned int len;
+
+    buf = xs_read(xsh, XBT_NULL, paths[0], &len);
+    if ( !buf )
+        return errno;
+    free(buf);
+    return 0;
+}
+
+#define test_read_deinit ret0
+
+static int test_write_init(uintptr_t par)
+{
+    return (par > WRITE_BUFFERS_SIZE) ? EFBIG : 0;
+}
+
+static int test_write(uintptr_t par)
+{
+    return xs_write(xsh, XBT_NULL, paths[0], write_buffers[0], par) ? 0 : errno;
+}
+
+static int test_write_deinit(uintptr_t par)
+{
+    return verify_node(paths[0], write_buffers[0], par);
+}
+
+static int test_dir_init(uintptr_t par)
+{
+    unsigned int i;
+
+    for ( i = 0; i < WRITE_BUFFERS_N; i++ )
+        if ( !xs_write(xsh, XBT_NULL, paths[i], write_buffers[i], 1) )
+            return errno;
+
+    return 0;
+}
+
+static int test_dir(uintptr_t par)
+{
+    char **dir;
+    unsigned int num;
+
+    dir = xs_directory(xsh, XBT_NULL, path, &num);
+    if ( !dir )
+        return errno;
+
+    free(dir);
+    return 0;
+}
+
+static int test_dir_deinit(uintptr_t par)
+{
+    char **dir;
+    unsigned int i, j, num;
+    int rc = 0;
+
+    dir = xs_directory(xsh, XBT_NULL, path, &num);
+    if ( !dir )
+        return errno;
+
+    for ( j = 0; j < WRITE_BUFFERS_N; j++ )
+    {
+        for ( i = 0; i < num; i++ )
+            if ( dir[i][0] == 'a' + j && dir[i][1] == 0 )
+                break;
+        if ( i == num )
+            rc = ENOENT;
+    }
+    if ( num != WRITE_BUFFERS_N )
+            rc = ENOENT;
+    free(dir);
+    return rc;
+}
+
+static int test_rm_init(uintptr_t par)
+{
+    unsigned int i;
+
+    if ( par > WRITE_BUFFERS_N )
+        return EFBIG;
+
+    for ( i = 0; i < par; i++ )
+        if ( xs_write(xsh, XBT_NULL, paths[i], write_buffers[i], 1) )
+            return errno;
+
+    return 0;
+}
+
+static int test_rm(uintptr_t par)
+{
+    if ( !xs_rm(xsh, XBT_NULL, path) )
+        return errno;
+
+    return 0;
+}
+
+#define test_rm_deinit ret0
+
+#define test_ta1_init ret0
+
+static int test_ta1(uintptr_t par)
+{
+    xs_transaction_t t;
+    int l;
+
+    for ( l = 0; l < MAX_TA_LOOPS; l++ )
+    {
+        t = xs_transaction_start(xsh);
+        if ( t == XBT_NULL )
+            return errno;
+        if ( xs_transaction_end(xsh, t, par ? true : false) )
+            return 0;
+        if ( errno != EAGAIN )
+            return errno;
+    }
+
+    ta_loops++;
+    return 0;
+}
+
+#define test_ta1_deinit ret0
+
+static int test_ta2_init(uintptr_t par)
+{
+    return xs_write(xsh, XBT_NULL, paths[0], write_buffers[0], 1) ? 0 : errno;
+}
+
+static int test_ta2(uintptr_t par)
+{
+    xs_transaction_t t;
+    char *buf;
+    unsigned int len;
+    int ret;
+    int l;
+
+    for ( l = 0; l < MAX_TA_LOOPS; l++ )
+    {
+        t = xs_transaction_start(xsh);
+        if ( t == XBT_NULL )
+            return errno;
+        buf = xs_read(xsh, t, paths[0], &len);
+        if ( !buf )
+            goto out;
+        free(buf);
+        if ( !xs_write(xsh, t, paths[0], "b", 1) )
+            goto out;
+        buf = xs_read(xsh, t, paths[0], &len);
+        if ( !buf )
+            goto out;
+        errno = (len == 1 && buf[0] == 'b') ? 0 : ENOENT;
+        free(buf);
+        if ( errno )
+            goto out;
+        buf = xs_read(xsh, XBT_NULL, paths[0], &len);
+        if ( !buf )
+            goto out;
+        errno = (len == 1 && buf[0] == 'a') ? 0 : ENOENT;
+        free(buf);
+        if ( errno )
+            goto out;
+        if ( xs_transaction_end(xsh, t, par ? true : false) )
+            return 0;
+        if ( errno != EAGAIN )
+            return errno;
+    }
+
+    ta_loops++;
+    return 0;
+
+ out:
+    ret = errno;
+    xs_transaction_end(xsh, t, true);
+    return ret;
+}
+
+static int test_ta2_deinit(uintptr_t par)
+{
+    return verify_node(paths[0], par ? "a" : "b", 1);
+}
+
+static int test_ta3_init(uintptr_t par)
+{
+    return xs_write(xsh, XBT_NULL, paths[0], write_buffers[0], 1) ? 0 : errno;
+}
+
+static int test_ta3(uintptr_t par)
+{
+    xs_transaction_t t;
+    char *buf;
+    unsigned int len;
+    int ret;
+
+    t = xs_transaction_start(xsh);
+    if ( t == XBT_NULL )
+        return errno;
+    buf = xs_read(xsh, t, paths[0], &len);
+    if ( !buf )
+        goto out;
+    free(buf);
+    if ( !xs_write(xsh, XBT_NULL, paths[0], "b", 1) )
+        goto out;
+    buf = xs_read(xsh, t, paths[0], &len);
+    if ( !buf )
+        goto out;
+    errno = (len == 1 && buf[0] == 'a') ? 0 : ENOENT;
+    free(buf);
+    if ( errno )
+        goto out;
+    if ( !xs_write(xsh, t, paths[0], "c", 1) )
+        goto out;
+    buf = xs_read(xsh, t, paths[0], &len);
+    if ( !buf )
+        goto out;
+    errno = (len == 1 && buf[0] == 'c') ? 0 : ENOENT;
+    free(buf);
+    if ( errno )
+        goto out;
+    if ( xs_transaction_end(xsh, t, false) || errno != EAGAIN )
+        return ENOENT;
+    return 0;
+
+ out:
+    ret = errno;
+    xs_transaction_end(xsh, t, true);
+    return ret;
+}
+
+static int test_ta3_deinit(uintptr_t par)
+{
+    return verify_node(paths[0], "b", 1);
+}
+
+#define TEST(s, f, p, l) { s, f ## _init, f, f ## _deinit, (uintptr_t)(p), l }
+struct test tests[] = {
+TEST("read 1", test_read, 1, "Read node with 1 byte data"),
+TEST("read 3000", test_read, 3000, "Read node with 3000 bytes data"),
+TEST("write 1", test_write, 1, "Write node with 1 byte data"),
+TEST("write 3000", test_write, 3000, "Write node with 3000 bytes data"),
+TEST("dir", test_dir, 0, "List directory"),
+TEST("rm node", test_rm, 0, "Remove single node"),
+TEST("rm dir", test_rm, WRITE_BUFFERS_N, "Remove node with sub-nodes"),
+TEST("ta empty", test_ta1, 0, "Empty transaction"),
+TEST("ta empty x", test_ta1, 1, "Empty transaction abort"),
+TEST("ta rmw", test_ta2, 0, "Read-modify-write transaction"),
+TEST("ta rmw x", test_ta2, 1, "Read-modify-write transaction abort"),
+TEST("ta err", test_ta3, 0, "Transaction with conflict"),
+};
+
+static void cleanup(void)
+{
+    xs_transaction_t t;
+    char **dir;
+    unsigned int num;
+
+    xs_rm(xsh, XBT_NULL, path);
+
+    while ( true )
+    {
+        t = xs_transaction_start(xsh);
+        if ( t == XBT_NULL )
+            return;
+
+        dir = xs_directory(xsh, t, TEST_PATH, &num);
+        if ( dir && !num )
+            xs_rm(xsh, t, TEST_PATH);
+        free(dir);
+
+        if ( xs_transaction_end(xsh, t, false) || errno != EAGAIN )
+            return;
+    }
+}
+
+int main(int argc, char *argv[])
+{
+    int opt, t, iters = 1, ret = 0, randtime = 0;
+    char *test = NULL;
+    bool list = false;
+    time_t stop;
+
+    while ( (opt = getopt_long(argc, argv, "lr:t:hi:", options,
+                               NULL)) != -1 )
+    {
+        switch ( opt )
+        {
+        case 'i':
+            iters = atoi(optarg);
+            break;
+        case 'l':
+            list = true;
+            break;
+        case 'r':
+            randtime = atoi(optarg);
+            break;
+        case 't':
+            test = optarg;
+            break;
+        case 'h':
+            usage(0);
+            break;
+        }
+    }
+    if ( optind != argc )
+        usage(1);
+
+    if ( list )
+    {
+        for ( t = 0; t < ARRAY_SIZE(tests); t++ )
+            printf("%-10s: %s\n", tests[t].name, tests[t].descr);
+        return 0;
+    }
+
+    if ( asprintf(&path, "%s/%u", TEST_PATH, getpid()) < 0 )
+        err(2, "asprintf() malloc failure\n");
+
+    for ( t = 0; t < WRITE_BUFFERS_N; t++ )
+    {
+        memset(write_buffers[t], 'a' + t, WRITE_BUFFERS_SIZE);
+        if ( asprintf(&paths[t], "%s/%c", path, 'a' + t) < 0 )
+            err(2, "asprintf() malloc failure\n");
+    }
+
+    xsh = xs_open(0);
+    if ( !xsh )
+    {
+        fprintf(stderr, "could not connect to xenstore\n");
+        exit(2);
+    }
+
+    if ( randtime )
+    {
+        stop = time(NULL) + randtime;
+        srandom((unsigned int)stop);
+
+        while ( time(NULL) < stop )
+        {
+            t = random() % ARRAY_SIZE(tests);
+            ret = call_test(tests + t, iters, true);
+        }
+    }
+    else
+        for ( t = 0; t < ARRAY_SIZE(tests); t++ )
+        {
+            if ( !test || !strcmp(test, tests[t].name) )
+                ret = call_test(tests + t, iters, false);
+        }
+
+    if ( !ret )
+        cleanup();
+
+    xs_close(xsh);
+
+    if ( ta_loops )
+        printf("Exhaustive transaction retries (%d) occurrred %d times.\n",
+               MAX_TA_LOOPS, ta_loops);
+
+    return 0;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/tests/xenstore/xs-test.c b/tools/tests/xenstore/xs-test.c
deleted file mode 100644
index c4c99c0661..0000000000
--- a/tools/tests/xenstore/xs-test.c
+++ /dev/null
@@ -1,537 +0,0 @@
-/*
- * xs-test.c
- *
- * Do Xenstore tests.
- *
- * Copyright (C) 2016  Juergen Gross <jgross@suse.com>,
- *                     SUSE Linux GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms and conditions of the GNU General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope 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/>.
- */
-
-#define _GNU_SOURCE
-#include <getopt.h>
-#include <inttypes.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <time.h>
-#include <xenstore.h>
-
-#include <xen-tools/libs.h>
-
-#define TEST_PATH "xenstore-test"
-#define WRITE_BUFFERS_N    10
-#define WRITE_BUFFERS_SIZE 4000
-#define MAX_TA_LOOPS       100
-
-struct test {
-    char *name;
-    int (*func_init)(uintptr_t par);
-    int (*func)(uintptr_t par);
-    int (*func_deinit)(uintptr_t par);
-    uintptr_t par;
-    char *descr;
-};
-
-static struct xs_handle *xsh;
-static char *path;
-static char *paths[WRITE_BUFFERS_N];
-static char write_buffers[WRITE_BUFFERS_N][WRITE_BUFFERS_SIZE];
-static int ta_loops;
-
-static struct option options[] = {
-    { "list-tests", 0, NULL, 'l' },
-    { "test", 1, NULL, 't' },
-    { "random", 1, NULL, 'r' },
-    { "help", 0, NULL, 'h' },
-    { "iterations", 1, NULL, 'i' },
-    { NULL, 0, NULL, 0 }
-};
-
-static int call_test(struct test *tst, int iters, bool no_clock)
-{
-    char *stage = "?";
-    struct timespec tp1, tp2;
-    uint64_t nsec, nsec_min, nsec_max, nsec_sum;
-    int i, ret = 0;
-
-    nsec_min = -1;
-    nsec_max = 0;
-    nsec_sum = 0;
-
-    for ( i = 0; i < iters; i++ )
-    {
-        stage = "pre-init";
-        xs_rm(xsh, XBT_NULL, path);
-        if ( !xs_write(xsh, XBT_NULL, path, "", 0) )
-        {
-            ret = errno;
-            break;
-        }
-        stage = "init";
-        ret = tst->func_init(tst->par);
-        if ( ret )
-            break;
-        if ( clock_gettime(CLOCK_REALTIME, &tp1) )
-            no_clock = true;
-        stage = "run";
-        ret = tst->func(tst->par);
-        if ( ret )
-            break;
-        if ( clock_gettime(CLOCK_REALTIME, &tp2) )
-            no_clock = true;
-        if ( !no_clock )
-        {
-            nsec = tp2.tv_sec * 1000000000 + tp2.tv_nsec -
-                   tp1.tv_sec * 1000000000 - tp1.tv_nsec;
-            if ( nsec < nsec_min )
-                nsec_min = nsec;
-            if ( nsec > nsec_max )
-                nsec_max = nsec;
-            nsec_sum += nsec;
-        }
-        stage = "deinit";
-        ret = tst->func_deinit(tst->par);
-        if ( ret )
-            break;
-    }
-
-    if ( ret )
-        printf("%-10s: failed (ret = %d, stage %s)\n", tst->name, ret, stage);
-    else if ( !no_clock )
-    {
-        printf("%-10s:", tst->name);
-        if ( iters > 1 )
-            printf(" avg: %"PRIu64" ns (%"PRIu64" ns .. %"PRIu64" ns)",
-                   nsec_sum / iters, nsec_min, nsec_max);
-        else
-            printf(" %"PRIu64" ns", nsec_sum);
-        printf("\n");
-    }
-
-    return ret;
-}
-
-static void usage(int ret)
-{
-    FILE *out;
-
-    out = ret ? stderr : stdout;
-
-    fprintf(out, "usage: xs-test [<options>]\n");
-    fprintf(out, "  <options> are:\n");
-    fprintf(out, "  -i|--iterations <i>  perform each test <i> times (default 1)\n");
-    fprintf(out, "  -l|--list-tests      list available tests\n");
-    fprintf(out, "  -r|--random <time>   perform random tests for <time> seconds\n");
-    fprintf(out, "  -t|--test <test>     run <test> (default is all tests)\n");
-    fprintf(out, "  -h|--help            print this usage information\n");
-    exit(ret);
-}
-
-static int ret0(uintptr_t par)
-{
-    return 0;
-}
-
-static int verify_node(char *node, char *data, unsigned int size)
-{
-    char *buf;
-    unsigned int len;
-    int ret;
-
-    buf = xs_read(xsh, XBT_NULL, node, &len);
-    if ( !buf )
-        return errno;
-
-    ret = (len == size && !memcmp(buf, data, len)) ? 0 : ENOENT;
-    free(buf);
-
-    return ret;
-}
-
-static int test_read_init(uintptr_t par)
-{
-    if ( par > WRITE_BUFFERS_SIZE )
-        return EFBIG;
-    return xs_write(xsh, XBT_NULL, paths[0], write_buffers[0], par) ? 0 : errno;
-}
-
-static int test_read(uintptr_t par)
-{
-    char *buf;
-    unsigned int len;
-
-    buf = xs_read(xsh, XBT_NULL, paths[0], &len);
-    if ( !buf )
-        return errno;
-    free(buf);
-    return 0;
-}
-
-#define test_read_deinit ret0
-
-static int test_write_init(uintptr_t par)
-{
-    return (par > WRITE_BUFFERS_SIZE) ? EFBIG : 0;
-}
-
-static int test_write(uintptr_t par)
-{
-    return xs_write(xsh, XBT_NULL, paths[0], write_buffers[0], par) ? 0 : errno;
-}
-
-static int test_write_deinit(uintptr_t par)
-{
-    return verify_node(paths[0], write_buffers[0], par);
-}
-
-static int test_dir_init(uintptr_t par)
-{
-    unsigned int i;
-
-    for ( i = 0; i < WRITE_BUFFERS_N; i++ )
-        if ( !xs_write(xsh, XBT_NULL, paths[i], write_buffers[i], 1) )
-            return errno;
-
-    return 0;
-}
-
-static int test_dir(uintptr_t par)
-{
-    char **dir;
-    unsigned int num;
-
-    dir = xs_directory(xsh, XBT_NULL, path, &num);
-    if ( !dir )
-        return errno;
-
-    free(dir);
-    return 0;
-}
-
-static int test_dir_deinit(uintptr_t par)
-{
-    char **dir;
-    unsigned int i, j, num;
-    int rc = 0;
-
-    dir = xs_directory(xsh, XBT_NULL, path, &num);
-    if ( !dir )
-        return errno;
-
-    for ( j = 0; j < WRITE_BUFFERS_N; j++ )
-    {
-        for ( i = 0; i < num; i++ )
-            if ( dir[i][0] == 'a' + j && dir[i][1] == 0 )
-                break;
-        if ( i == num )
-            rc = ENOENT;
-    }
-    if ( num != WRITE_BUFFERS_N )
-            rc = ENOENT;
-    free(dir);
-    return rc;
-}
-
-static int test_rm_init(uintptr_t par)
-{
-    unsigned int i;
-
-    if ( par > WRITE_BUFFERS_N )
-        return EFBIG;
-
-    for ( i = 0; i < par; i++ )
-        if ( xs_write(xsh, XBT_NULL, paths[i], write_buffers[i], 1) )
-            return errno;
-
-    return 0;
-}
-
-static int test_rm(uintptr_t par)
-{
-    if ( !xs_rm(xsh, XBT_NULL, path) )
-        return errno;
-
-    return 0;
-}
-
-#define test_rm_deinit ret0
-
-#define test_ta1_init ret0
-
-static int test_ta1(uintptr_t par)
-{
-    xs_transaction_t t;
-    int l;
-
-    for ( l = 0; l < MAX_TA_LOOPS; l++ )
-    {
-        t = xs_transaction_start(xsh);
-        if ( t == XBT_NULL )
-            return errno;
-        if ( xs_transaction_end(xsh, t, par ? true : false) )
-            return 0;
-        if ( errno != EAGAIN )
-            return errno;
-    }
-
-    ta_loops++;
-    return 0;
-}
-
-#define test_ta1_deinit ret0
-
-static int test_ta2_init(uintptr_t par)
-{
-    return xs_write(xsh, XBT_NULL, paths[0], write_buffers[0], 1) ? 0 : errno;
-}
-
-static int test_ta2(uintptr_t par)
-{
-    xs_transaction_t t;
-    char *buf;
-    unsigned int len;
-    int ret;
-    int l;
-
-    for ( l = 0; l < MAX_TA_LOOPS; l++ )
-    {
-        t = xs_transaction_start(xsh);
-        if ( t == XBT_NULL )
-            return errno;
-        buf = xs_read(xsh, t, paths[0], &len);
-        if ( !buf )
-            goto out;
-        free(buf);
-        if ( !xs_write(xsh, t, paths[0], "b", 1) )
-            goto out;
-        buf = xs_read(xsh, t, paths[0], &len);
-        if ( !buf )
-            goto out;
-        errno = (len == 1 && buf[0] == 'b') ? 0 : ENOENT;
-        free(buf);
-        if ( errno )
-            goto out;
-        buf = xs_read(xsh, XBT_NULL, paths[0], &len);
-        if ( !buf )
-            goto out;
-        errno = (len == 1 && buf[0] == 'a') ? 0 : ENOENT;
-        free(buf);
-        if ( errno )
-            goto out;
-        if ( xs_transaction_end(xsh, t, par ? true : false) )
-            return 0;
-        if ( errno != EAGAIN )
-            return errno;
-    }
-
-    ta_loops++;
-    return 0;
-
- out:
-    ret = errno;
-    xs_transaction_end(xsh, t, true);
-    return ret;
-}
-
-static int test_ta2_deinit(uintptr_t par)
-{
-    return verify_node(paths[0], par ? "a" : "b", 1);
-}
-
-static int test_ta3_init(uintptr_t par)
-{
-    return xs_write(xsh, XBT_NULL, paths[0], write_buffers[0], 1) ? 0 : errno;
-}
-
-static int test_ta3(uintptr_t par)
-{
-    xs_transaction_t t;
-    char *buf;
-    unsigned int len;
-    int ret;
-
-    t = xs_transaction_start(xsh);
-    if ( t == XBT_NULL )
-        return errno;
-    buf = xs_read(xsh, t, paths[0], &len);
-    if ( !buf )
-        goto out;
-    free(buf);
-    if ( !xs_write(xsh, XBT_NULL, paths[0], "b", 1) )
-        goto out;
-    buf = xs_read(xsh, t, paths[0], &len);
-    if ( !buf )
-        goto out;
-    errno = (len == 1 && buf[0] == 'a') ? 0 : ENOENT;
-    free(buf);
-    if ( errno )
-        goto out;
-    if ( !xs_write(xsh, t, paths[0], "c", 1) )
-        goto out;
-    buf = xs_read(xsh, t, paths[0], &len);
-    if ( !buf )
-        goto out;
-    errno = (len == 1 && buf[0] == 'c') ? 0 : ENOENT;
-    free(buf);
-    if ( errno )
-        goto out;
-    if ( xs_transaction_end(xsh, t, false) || errno != EAGAIN )
-        return ENOENT;
-    return 0;
-
- out:
-    ret = errno;
-    xs_transaction_end(xsh, t, true);
-    return ret;
-}
-
-static int test_ta3_deinit(uintptr_t par)
-{
-    return verify_node(paths[0], "b", 1);
-}
-
-#define TEST(s, f, p, l) { s, f ## _init, f, f ## _deinit, (uintptr_t)(p), l }
-struct test tests[] = {
-TEST("read 1", test_read, 1, "Read node with 1 byte data"),
-TEST("read 3000", test_read, 3000, "Read node with 3000 bytes data"),
-TEST("write 1", test_write, 1, "Write node with 1 byte data"),
-TEST("write 3000", test_write, 3000, "Write node with 3000 bytes data"),
-TEST("dir", test_dir, 0, "List directory"),
-TEST("rm node", test_rm, 0, "Remove single node"),
-TEST("rm dir", test_rm, WRITE_BUFFERS_N, "Remove node with sub-nodes"),
-TEST("ta empty", test_ta1, 0, "Empty transaction"),
-TEST("ta empty x", test_ta1, 1, "Empty transaction abort"),
-TEST("ta rmw", test_ta2, 0, "Read-modify-write transaction"),
-TEST("ta rmw x", test_ta2, 1, "Read-modify-write transaction abort"),
-TEST("ta err", test_ta3, 0, "Transaction with conflict"),
-};
-
-static void cleanup(void)
-{
-    xs_transaction_t t;
-    char **dir;
-    unsigned int num;
-
-    xs_rm(xsh, XBT_NULL, path);
-
-    while ( true )
-    {
-        t = xs_transaction_start(xsh);
-        if ( t == XBT_NULL )
-            return;
-
-        dir = xs_directory(xsh, t, TEST_PATH, &num);
-        if ( dir && !num )
-            xs_rm(xsh, t, TEST_PATH);
-        free(dir);
-
-        if ( xs_transaction_end(xsh, t, false) || errno != EAGAIN )
-            return;
-    }
-}
-
-int main(int argc, char *argv[])
-{
-    int opt, t, iters = 1, ret = 0, randtime = 0;
-    char *test = NULL;
-    bool list = false;
-    time_t stop;
-
-    while ( (opt = getopt_long(argc, argv, "lr:t:hi:", options,
-                               NULL)) != -1 )
-    {
-        switch ( opt )
-        {
-        case 'i':
-            iters = atoi(optarg);
-            break;
-        case 'l':
-            list = true;
-            break;
-        case 'r':
-            randtime = atoi(optarg);
-            break;
-        case 't':
-            test = optarg;
-            break;
-        case 'h':
-            usage(0);
-            break;
-        }
-    }
-    if ( optind != argc )
-        usage(1);
-
-    if ( list )
-    {
-        for ( t = 0; t < ARRAY_SIZE(tests); t++ )
-            printf("%-10s: %s\n", tests[t].name, tests[t].descr);
-        return 0;
-    }
-
-    asprintf(&path, "%s/%u", TEST_PATH, getpid());
-    for ( t = 0; t < WRITE_BUFFERS_N; t++ )
-    {
-        memset(write_buffers[t], 'a' + t, WRITE_BUFFERS_SIZE);
-        asprintf(&paths[t], "%s/%c", path, 'a' + t);
-    }
-
-    xsh = xs_open(0);
-    if ( !xsh )
-    {
-        fprintf(stderr, "could not connect to xenstore\n");
-        exit(2);
-    }
-
-    if ( randtime )
-    {
-        stop = time(NULL) + randtime;
-        srandom((unsigned int)stop);
-
-        while ( time(NULL) < stop )
-        {
-            t = random() % ARRAY_SIZE(tests);
-            ret = call_test(tests + t, iters, true);
-        }
-    }
-    else
-        for ( t = 0; t < ARRAY_SIZE(tests); t++ )
-        {
-            if ( !test || !strcmp(test, tests[t].name) )
-                ret = call_test(tests + t, iters, false);
-        }
-
-    if ( !ret )
-        cleanup();
-
-    xs_close(xsh);
-
-    if ( ta_loops )
-        printf("Exhaustive transaction retries (%d) occurrred %d times.\n",
-               MAX_TA_LOOPS, ta_loops);
-
-    return 0;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jul 13 08:22:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jul 2021 08:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.155132.286485 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3Dg7-0001dA-9M; Tue, 13 Jul 2021 08:22:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 155132.286485; Tue, 13 Jul 2021 08:22:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3Dg7-0001d2-6R; Tue, 13 Jul 2021 08:22:07 +0000
Received: by outflank-mailman (input) for mailman id 155132;
 Tue, 13 Jul 2021 08:22:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3Dg5-0001cw-P4
 for xen-changelog@lists.xenproject.org; Tue, 13 Jul 2021 08:22:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3Dg5-0000gz-NL
 for xen-changelog@lists.xenproject.org; Tue, 13 Jul 2021 08:22:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3Dg5-0005XD-ML
 for xen-changelog@lists.xenproject.org; Tue, 13 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JIShbQbaPeOnu1CHmaejbGll9Oqc+YBQ78qhpqpk8rM=; b=GcsFktMaTRO4RzG2KPxqMCLXLx
	3WWaBmJWXANDF5pUFYLB8WBb1WoE+ZelBmS7FvNqzDk8dtuFq6pMxIju4Zdnt1XYlkl9e6IAVjhtn
	O/zNnrsFtqcPWvgEamSSuBQIoGXQK7ImjN5qfeFD+kVCqQi6DA+rQkcSmHQlPz/+2zzs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] IOMMU: correct parsing of "quarantine=scratch-page"
Message-Id: <E1m3Dg5-0005XD-ML@xenbits.xenproject.org>
Date: Tue, 13 Jul 2021 08:22:05 +0000

commit ec6e56359553e82fefa877fd221479847ffc93dd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jul 13 10:16:18 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 13 10:16:18 2021 +0200

    IOMMU: correct parsing of "quarantine=scratch-page"
    
    During the multiple renames of the sub-option I apparently forgot to
    update the left side of the &&, and this pretty consistently.
    
    Fixes: 980d6acf1517 ("IOMMU: make DMA containment of quarantined devices optional")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
---
 xen/drivers/passthrough/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index ab2ae61b11..fd2578d30a 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -82,7 +82,7 @@ static int __init parse_iommu_param(const char *s)
 #ifdef CONFIG_HAS_PCI
         else if ( (val = parse_boolean("quarantine", s, ss)) >= 0 )
             iommu_quarantine = val;
-        else if ( ss == s + 15 && !strncmp(s, "quarantine=scratch-page", 23) )
+        else if ( ss == s + 23 && !strncmp(s, "quarantine=scratch-page", 23) )
             iommu_quarantine = IOMMU_quarantine_scratch_page;
 #endif
 #ifdef CONFIG_X86
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jul 13 08:22:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jul 2021 08:22:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.155133.286489 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3DgH-0001f9-B8; Tue, 13 Jul 2021 08:22:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 155133.286489; Tue, 13 Jul 2021 08:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3DgH-0001ev-7z; Tue, 13 Jul 2021 08:22:17 +0000
Received: by outflank-mailman (input) for mailman id 155133;
 Tue, 13 Jul 2021 08:22:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3DgF-0001ei-RL
 for xen-changelog@lists.xenproject.org; Tue, 13 Jul 2021 08:22:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3DgF-0000hM-QV
 for xen-changelog@lists.xenproject.org; Tue, 13 Jul 2021 08:22:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3DgF-0005YG-Pe
 for xen-changelog@lists.xenproject.org; Tue, 13 Jul 2021 08: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=b82tleCEo8cIO80JqLp8kxBjEYDRdfap9LEbIepueUQ=; b=0LuFK9T89DxbUTYKOJeSIRv2D1
	MJCWMP43H2wFPprhuArRM20J5KRs+WXQBuIf0uTc/v9fNNt18ILRI8i4EWWSQ1AVlrPA9iE2e2REk
	c00G/leAIRWU+bDybt2FPCPn4EXgBEhrxAuXI5pVCpsknW96VQwYZ0WjztsHYTVg9avY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CHANGELOG: record changed PCI device quarantining default
Message-Id: <E1m3DgF-0005YG-Pe@xenbits.xenproject.org>
Date: Tue, 13 Jul 2021 08:22:15 +0000

commit 1d3250f8c4cb750bb0dcf9fdbe01f8de85780281
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jul 13 10:17:33 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 13 10:17:33 2021 +0200

    CHANGELOG: record changed PCI device quarantining default
    
    This amends commit 980d6acf1517 ("IOMMU: make DMA containment of
    quarantined devices optional").
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
---
 CHANGELOG.md | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6896d70757..22cfdb4298 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  - XENSTORED_ROOTDIR environment variable from configuartion files and
    initscripts, due to being unused.
 
+### Changed
+ - Quarantining of passed-through PCI devices no longer defaults to directing I/O to a scratch
+   page, matching original post-XSA-302 behavior (albeit the change was also backported, first
+   appearing in 4.12.2 and 4.11.4). Prior (4.13...4.15-like) behavior can be arranged for
+   either by enabling the IOMMU_QUARANTINE_SCRATCH_PAGE setting at build (configuration) time
+   or by passing "iommu=quarantine=scratch-page" on the hypervisor command line.
+
 ## [4.15.0 UNRELEASED](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.15.0) - TBD
 
 ### Added / support upgraded
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jul 13 12:00:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jul 2021 12:00:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.155348.286773 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3H54-0001FU-M2; Tue, 13 Jul 2021 12:00:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 155348.286773; Tue, 13 Jul 2021 12:00:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3H54-0001FL-I5; Tue, 13 Jul 2021 12:00:06 +0000
Received: by outflank-mailman (input) for mailman id 155348;
 Tue, 13 Jul 2021 12:00:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3H52-0000zh-PZ
 for xen-changelog@lists.xenproject.org; Tue, 13 Jul 2021 12:00:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3H52-0004YL-Ol
 for xen-changelog@lists.xenproject.org; Tue, 13 Jul 2021 12:00:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3H52-0003tZ-Nc
 for xen-changelog@lists.xenproject.org; Tue, 13 Jul 2021 12:00: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ae8KDbaxtUNDY00vt5bLOIi1D5jOz1yY8cR/L6QNJVk=; b=N1i94lAoZmFfWEb0q/5keevNUV
	NvAaqWZpm15xhezk8FCykCA30LuVEQOKx/wm70ieI9gf+JOPWUV6OQEidtbnxO1HD9JCaQLpFpkS3
	p+kV72gjMan1PGYQ3GdoZEZ5VwTEBNZJB/zrZ88Ss5p1EmaCobfIlbIB52FDCx2+gNhA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] stubdom: foreignmemory: Fix build after 0dbb4be739c5
Message-Id: <E1m3H52-0003tZ-Nc@xenbits.xenproject.org>
Date: Tue, 13 Jul 2021 12:00:04 +0000

commit 3a98c1a4cec1a302beaddf944ded240b61173f87
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Tue Jul 13 10:20:19 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Jul 13 12:58:29 2021 +0100

    stubdom: foreignmemory: Fix build after 0dbb4be739c5
    
    Commit 0dbb4be739c5 add the inclusion of xenctrl.h from private.h and
    wreck the build in an interesting way:
    
    In file included from xen/stubdom/include/xen/domctl.h:39:0,
                     from xen/tools/include/xenctrl.h:36,
                     from private.h:4,
                     from minios.c:29:
    xen/include/public/memory.h:407:5: error: expected specifier-qualifier-list before ‘XEN_GUEST_HANDLE_64’
         XEN_GUEST_HANDLE_64(const_uint8) buffer;
         ^~~~~~~~~~~~~~~~~~~
    
    This is happening because xenctrl.h defines __XEN_TOOLS__ and therefore
    the public headers will start to expose the non-stable ABI. However,
    xen.h has already been included by a mini-OS header before hand. So
    there is a mismatch in the way the headers are included.
    
    For now solve it in a very simple (and gross) way by including
    xenctrl.h before the mini-os headers.
    
    Fixes: 0dbb4be739c5 ("tools/libs/foreignmemory: Fix PAGE_SIZE redefinition error")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libs/foreignmemory/minios.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/libs/foreignmemory/minios.c b/tools/libs/foreignmemory/minios.c
index c5453736d5..f2f4dfb2be 100644
--- a/tools/libs/foreignmemory/minios.c
+++ b/tools/libs/foreignmemory/minios.c
@@ -17,6 +17,14 @@
  * Copyright 2007-2008 Samuel Thibault <samuel.thibault@eu.citrix.com>.
  */
 
+/*
+ * xenctrl.h currently defines __XEN_TOOLS__ which affects what is
+ * exposed by Xen headers. As the define needs to be set consistently,
+ * we want to include xenctrl.h before the mini-os headers (they include
+ * public headers).
+ */
+#include <xenctrl.h>
+
 #include <mini-os/types.h>
 #include <mini-os/os.h>
 #include <mini-os/mm.h>
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:33:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156415.288596 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vrm-0007u4-RU; Thu, 15 Jul 2021 07:33:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156415.288596; Thu, 15 Jul 2021 07:33:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vrm-0007tw-OU; Thu, 15 Jul 2021 07:33:06 +0000
Received: by outflank-mailman (input) for mailman id 156415;
 Thu, 15 Jul 2021 07:33:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vrl-0007tq-Oc
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:33:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vrl-00077r-LS
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vrl-0000l6-KP
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OCA2eCgCH0P3eaxXMC0io2Ogia+kE9ggX4u/gD2CQfo=; b=oo/fZW2uNyR0eGbj1O4MYwsCge
	U5qtKv15Yh9GoPcL5uTSOQ5mF9/L5b6w1BAWBNDaQSPKY+CBQhBHOiflmmvKDpTD8NijDIQ1Op1Hh
	ZuuHrikLEDVFK2sWtq5Di9nxL7GcdwNOtCND/SGHElINa3tpyJVQljteIakFY/P/GWxY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] SUPPORT.md: Un-shimmed 32-bit PV guests are no longer supported
Message-Id: <E1m3vrl-0000l6-KP@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:33:05 +0000

commit 77069ea825c883c4be98386367fbf466abd99128
Author:     George Dunlap <george.dunlap@citrix.com>
AuthorDate: Thu Jul 15 09:16:02 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:16:02 2021 +0200

    SUPPORT.md: Un-shimmed 32-bit PV guests are no longer supported
    
    The support status of 32-bit guests doesn't seem particularly useful.
    
    With it changed to fully unsupported outside of PV-shim, adjust the PV32
    Kconfig default accordingly.
    
    Reported-by: Jann Horn <jannh@google.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    tools/libs/guest: fix save and restore of pv domains after 32-bit de-support
    
    After 32-bit PV-guests have been security de-supported when not running
    under PV-shim, the hypervisor will no longer be configured to support
    those domains per default when not being built as PV-shim.
    
    Unfortunately libxenguest will fail saving or restoring a PV domain
    due to this restriction, as it is trying to get the compat MFN list
    even for 64 bit guests.
    
    Fix that by obtaining the compat MFN list only for 32-bit PV guests.
    
    Fixes: 1a0f2fe2297d122a08fe ("SUPPORT.md: Un-shimmed 32-bit PV guests are no longer supported")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 1a0f2fe2297d122a08fee2b26de5de995fdeca13
    master date: 2021-06-04 17:24:05 +0100
    master commit: d21121685fac829c988e432407fb0e4ef9b19331
    master date: 2021-06-07 15:43:35 +0100
---
 SUPPORT.md                             |  9 +--------
 tools/libs/guest/xg_sr_common.h        |  2 +-
 tools/libs/guest/xg_sr_common_x86_pv.c | 13 ++++++++-----
 xen/arch/x86/Kconfig                   |  7 +++++--
 4 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index 9024d8a056..0fb262f81f 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -86,14 +86,7 @@ No hardware requirements
 
     Status, x86_64: Supported
     Status, x86_32, shim: Supported
-    Status, x86_32, without shim: Supported, with caveats
-
-Due to architectural limitations,
-32-bit PV guests must be assumed to be able to read arbitrary host memory
-using speculative execution attacks.
-Advisories will continue to be issued
-for new vulnerabilities related to un-shimmed 32-bit PV guests
-enabling denial-of-service attacks or privilege escalation attacks.
+    Status, x86_32, without shim: Supported, not security supported
 
 ### x86/HVM
 
diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index cc3ad1c394..e2994e18ac 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -325,7 +325,7 @@ struct xc_sr_context
                 xen_pfn_t max_mfn;
                 /* Read-only machine to phys map */
                 xen_pfn_t *m2p;
-                /* first mfn of the compat m2p (Only needed for 32bit PV guests) */
+                /* first mfn of the compat m2p (Only set for 32bit PV guests) */
                 xen_pfn_t compat_m2p_mfn0;
                 /* Number of m2p frames mapped */
                 unsigned long nr_m2p_frames;
diff --git a/tools/libs/guest/xg_sr_common_x86_pv.c b/tools/libs/guest/xg_sr_common_x86_pv.c
index cd33406aab..c0acf00f90 100644
--- a/tools/libs/guest/xg_sr_common_x86_pv.c
+++ b/tools/libs/guest/xg_sr_common_x86_pv.c
@@ -149,12 +149,13 @@ int x86_pv_map_m2p(struct xc_sr_context *ctx)
 
     ctx->x86.pv.nr_m2p_frames = (M2P_CHUNK_SIZE >> PAGE_SHIFT) * m2p_chunks;
 
+    if ( ctx->x86.pv.levels == 3 )
+    {
 #ifdef __i386__
-    /* 32 bit toolstacks automatically get the compat m2p */
-    ctx->x86.pv.compat_m2p_mfn0 = entries[0].mfn;
+        /* 32 bit toolstacks automatically get the compat m2p */
+        ctx->x86.pv.compat_m2p_mfn0 = entries[0].mfn;
 #else
-    /* 64 bit toolstacks need to ask Xen specially for it */
-    {
+        /* 64 bit toolstacks need to ask Xen specially for it */
         struct xen_machphys_mfn_list xmml = {
             .max_extents = 1,
             .extent_start = { &ctx->x86.pv.compat_m2p_mfn0 },
@@ -168,8 +169,10 @@ int x86_pv_map_m2p(struct xc_sr_context *ctx)
             rc = -1;
             goto err;
         }
-    }
 #endif
+    }
+    else
+        ctx->x86.pv.compat_m2p_mfn0 = INVALID_MFN;
 
     /* All Done */
     rc = 0;
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index f79e6634db..27cb793165 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -56,7 +56,7 @@ config PV
 config PV32
 	bool "Support for 32bit PV guests"
 	depends on PV
-	default y
+	default PV_SHIM
 	---help---
 	  The 32bit PV ABI uses Ring1, an area of the x86 architecture which
 	  was deprecated and mostly removed in the AMD64 spec.  As a result,
@@ -67,7 +67,10 @@ config PV32
 	  reduction, or performance reasons.  Backwards compatibility can be
 	  provided via the PV Shim mechanism.
 
-	  If unsure, say Y.
+	  Note that outside of PV Shim, 32-bit PV guests are not security
+	  supported anymore.
+
+	  If unsure, use the default setting.
 
 config PV_LINEAR_PT
        bool "Support for PV linear pagetables"
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:33:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:33:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156416.288600 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vrw-0007xi-TK; Thu, 15 Jul 2021 07:33:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156416.288600; Thu, 15 Jul 2021 07:33:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vrw-0007xZ-QE; Thu, 15 Jul 2021 07:33:16 +0000
Received: by outflank-mailman (input) for mailman id 156416;
 Thu, 15 Jul 2021 07:33:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vrv-0007xI-QQ
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:33:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vrv-00079S-PJ
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:33:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vrv-0000m1-Nr
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YjE2zE4uQ50KpeurtV2bnnsWeQ6P7DVVk6g4srHj6D0=; b=GaLJ+Wyl7goGJgD1YgUbRhdRBu
	iUdFrx/hnum1drX4Hld0ndAeZp7e+4ebFRDaH/xVMw982N6I1SgQDF5EIC2aLX9nvfAPWAFKa+ZX4
	rGc8VYicwR7jxWj/+6ggwFkUeak5BYybzPAv/E7TAug1xsfrhrs6S+7z4Z3Ps4Hsrq+8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] credit2: make sure we pick a runnable unit from the runq if there is one
Message-Id: <E1m3vrv-0000m1-Nr@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:33:15 +0000

commit 13ea8afded421c60dd4a0a1cd7afc8600819a7dd
Author:     Dario Faggioli <dfaggioli@suse.com>
AuthorDate: Thu Jul 15 09:17:26 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:17:26 2021 +0200

    credit2: make sure we pick a runnable unit from the runq if there is one
    
    A !runnable unit (temporarily) present in the runq may cause us to
    stop scanning the runq itself too early. Of course, we don't run any
    non-runnable vCPUs, but we end the scan and we fallback to picking
    the idle unit. In other word, this prevent us to find there and pick
    the actual unit that we're meant to start running (which might be
    further ahead in the runq).
    
    Depending on the vCPU pinning configuration, this may lead to such
    unit to be stuck in the runq for long time, causing malfunctioning
    inside the guest.
    
    Fix this by checking runnable/non-runnable status up-front, in the runq
    scanning function.
    
    Reported-by: Michał Leszczyński <michal.leszczynski@cert.pl>
    Reported-by: Dion Kant <g.w.kant@hunenet.nl>
    Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 07b0eb5d0ef0be154606aa46b5b4c5c59b158505
    master date: 2021-06-07 13:16:36 +0100
---
 xen/common/sched/credit2.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index eb5e5a78c5..f5c1e5b944 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -3463,6 +3463,10 @@ runq_candidate(struct csched2_runqueue_data *rqd,
                         (unsigned char *)&d);
         }
 
+        /* Skip non runnable units that we (temporarily) have in the runq */
+        if ( unlikely(!unit_runnable_state(svc->unit)) )
+            continue;
+
         /* Only consider vcpus that are allowed to run on this processor. */
         if ( !cpumask_test_cpu(cpu, svc->unit->cpu_hard_affinity) )
             continue;
@@ -3496,8 +3500,7 @@ runq_candidate(struct csched2_runqueue_data *rqd,
          * some budget, then choose it.
          */
         if ( (yield || svc->credit > snext->credit) &&
-             (!has_cap(svc) || unit_grab_budget(svc)) &&
-             unit_runnable_state(svc->unit) )
+             (!has_cap(svc) || unit_grab_budget(svc)) )
             snext = svc;
 
         /* In any case, if we got this far, break. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:33:26 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:33:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156417.288605 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vs6-00080M-Ux; Thu, 15 Jul 2021 07:33:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156417.288605; Thu, 15 Jul 2021 07:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vs6-00080B-Rj; Thu, 15 Jul 2021 07:33:26 +0000
Received: by outflank-mailman (input) for mailman id 156417;
 Thu, 15 Jul 2021 07:33:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vs5-000800-TL
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:33:25 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vs5-00079d-SV
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:33:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vs5-0000mw-Rj
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nyzw+efOmhzuk6Fa9DyO9UopAc4XJ2g7523Ckd8OU0M=; b=CQFDdxDPCo+TPGz9BDNPyj6g7Q
	h42hrCk9wUeBGoEOHF+pT0JCTlja9Wfih0IIbY45LoPFkOqopgQStddO5L4YgHth+sCfRciQA+EIH
	/gNQd0JN+bRwuviN5K9+Tay+PuRsakgXrAeqbDYlmZ5GU7K2gSCbS/YhprII/93hf6nw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] xen: credit2: fix per-entity load tracking when continuing running
Message-Id: <E1m3vs5-0000mw-Rj@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:33:25 +0000

commit 3556dc6bfb27bb8ec8bc1df1f4813319ebec4e59
Author:     Dario Faggioli <dfaggioli@suse.com>
AuthorDate: Thu Jul 15 09:18:32 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:18:32 2021 +0200

    xen: credit2: fix per-entity load tracking when continuing running
    
    If we schedule, and the current vCPU continues to run, its statistical
    load is not properly updated, resulting in something like this, even if
    all the 8 vCPUs are 100% busy:
    
    (XEN) Runqueue 0:
    (XEN) [...]
    (XEN)   aveload            = 2097152 (~800%)
    (XEN) [...]
    (XEN)   Domain: 0 w 256 c 0 v 8
    (XEN)     1: [0.0] flags=2 cpu=4 credit=9996885 [w=256] load=35 (~0%)
    (XEN)     2: [0.1] flags=2 cpu=2 credit=9993725 [w=256] load=796 (~0%)
    (XEN)     3: [0.2] flags=2 cpu=1 credit=9995885 [w=256] load=883 (~0%)
    (XEN)     4: [0.3] flags=2 cpu=5 credit=9998833 [w=256] load=487 (~0%)
    (XEN)     5: [0.4] flags=2 cpu=6 credit=9998942 [w=256] load=1595 (~0%)
    (XEN)     6: [0.5] flags=2 cpu=0 credit=9994669 [w=256] load=22 (~0%)
    (XEN)     7: [0.6] flags=2 cpu=7 credit=9997706 [w=256] load=0 (~0%)
    (XEN)     8: [0.7] flags=2 cpu=3 credit=9992440 [w=256] load=0 (~0%)
    
    As we can see, the average load of the runqueue as a whole is, instead,
    computed properly.
    
    This issue would, in theory, potentially affect Credit2 load balancing
    logic. In practice, however, the problem only manifests (at least with
    these characteristics) when there is only 1 runqueue active in the
    cpupool, which also means there is no need to do any load-balancing.
    
    Hence its real impact is pretty much limited to wrong per-vCPU load
    percentages, when looking at the output of the 'r' debug-key.
    
    With this patch, the load is updated and displayed correctly:
    
    (XEN) Runqueue 0:
    (XEN) [...]
    (XEN)   aveload            = 2097152 (~800%)
    (XEN) [...]
    (XEN) Domain info:
    (XEN)   Domain: 0 w 256 c 0 v 8
    (XEN)     1: [0.0] flags=2 cpu=4 credit=9995584 [w=256] load=262144 (~100%)
    (XEN)     2: [0.1] flags=2 cpu=6 credit=9992992 [w=256] load=262144 (~100%)
    (XEN)     3: [0.2] flags=2 cpu=3 credit=9998918 [w=256] load=262118 (~99%)
    (XEN)     4: [0.3] flags=2 cpu=5 credit=9996867 [w=256] load=262144 (~100%)
    (XEN)     5: [0.4] flags=2 cpu=1 credit=9998912 [w=256] load=262144 (~100%)
    (XEN)     6: [0.5] flags=2 cpu=2 credit=9997842 [w=256] load=262144 (~100%)
    (XEN)     7: [0.6] flags=2 cpu=7 credit=9994623 [w=256] load=262144 (~100%)
    (XEN)     8: [0.7] flags=2 cpu=0 credit=9991815 [w=256] load=262144 (~100%)
    
    Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 89052b9fa24bf976924e40918fc9fa3b1b940e17
    master date: 2021-06-07 13:17:06 +0100
---
 xen/common/sched/credit2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index f5c1e5b944..ebb09ea43a 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -3649,6 +3649,8 @@ static void csched2_schedule(
             runq_remove(snext);
             __set_bit(__CSFLAG_scheduled, &snext->flags);
         }
+        else
+            update_load(ops, rqd, snext, 0, now);
 
         /* Clear the idle mask if necessary */
         if ( cpumask_test_cpu(sched_cpu, &rqd->idle) )
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:33:38 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:33:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156418.288608 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vsH-00084Q-W9; Thu, 15 Jul 2021 07:33:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156418.288608; Thu, 15 Jul 2021 07:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vsH-00084I-TB; Thu, 15 Jul 2021 07:33:37 +0000
Received: by outflank-mailman (input) for mailman id 156418;
 Thu, 15 Jul 2021 07:33:36 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vsG-000841-0A
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:33:36 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vsF-00079t-VV
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:33:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vsF-0000oA-Uk
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WnfgLN2BmdbyCnE022t6JRLjaj0kgRV1jqPbAEkfYiA=; b=hp3qTwMsmDGwqpPDkOka6biCON
	glv5zwb+JfqvaD1Rhw3dVqvOdCEy5N8+qfiSCGRpL9BlMoHEcSbBOVknYl/fztrBxh5n2y5AhKtHr
	GfS2HVpwtLR19rRNtsYq2TCiKaqpzFIyPqEqk/daFBY/4ZO5RHOj0Vi1Lqck1cFjLdko=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] x86/vpt: fully init timers before putting onto list
Message-Id: <E1m3vsF-0000oA-Uk@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:33:35 +0000

commit 98929010477a5d9e9fdd489a4f2e8ab8a64cac06
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:19:03 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:19:03 2021 +0200

    x86/vpt: fully init timers before putting onto list
    
    With pt_vcpu_lock() no longer acquiring the pt_migrate lock, parties
    iterating the list and acting on the timers of the list entries will no
    longer be kept from entering their loops by create_periodic_time()'s
    holding of that lock. Therefore at least init_timer() needs calling
    ahead of list insertion, but keep this and set_timer() together.
    
    Fixes: 8113b02f0bf8 ("x86/vpt: do not take pt_migrate rwlock in some cases")
    Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    master commit: 6d622f3a96bbd76ce8422c6e3805e6609417ec76
    master date: 2021-06-15 15:14:20 +0200
---
 xen/arch/x86/hvm/vpt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index 560fab9cfc..4d4d22b0e7 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -554,14 +554,14 @@ void create_periodic_time(
     pt->cb = cb;
     pt->priv = data;
 
+    init_timer(&pt->timer, pt_timer_fn, pt, v->processor);
+    set_timer(&pt->timer, pt->scheduled);
+
     pt_vcpu_lock(v);
     pt->on_list = 1;
     list_add(&pt->list, &v->arch.hvm.tm_list);
     pt_vcpu_unlock(v);
 
-    init_timer(&pt->timer, pt_timer_fn, pt, v->processor);
-    set_timer(&pt->timer, pt->scheduled);
-
     write_unlock(&v->domain->arch.hvm.pl_time->pt_migrate);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:33:48 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:33:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156419.288612 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vsS-00088A-1S; Thu, 15 Jul 2021 07:33:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156419.288612; Thu, 15 Jul 2021 07:33:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vsR-000882-Uf; Thu, 15 Jul 2021 07:33:47 +0000
Received: by outflank-mailman (input) for mailman id 156419;
 Thu, 15 Jul 2021 07:33:46 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vsQ-00087k-31
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:33:46 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vsQ-0007AL-2B
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:33:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vsQ-0000p0-1N
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Me4e8gohtzF6fjS1cNz1RRsmwj0ZiIR0Xgc16uQpYmQ=; b=sNUJT2TlFFiuZ48AU2b8FgxLiL
	kHr59hYOEJf+NyqhkgteHKwaLnW+pNe0M6cgSZUTe6lkLM1EZhV8FZFUFqX2WuBVXGRrDs/lR45WZ
	vmpJPLF95hYDvEijLCz7nMqWmuL7c5WP75VwSxzoT2Xf1haR6DvOVMJstHQbe2LDaJ7A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] libs/foreignmemory: Fix osdep_xenforeignmemory_map prototype
Message-Id: <E1m3vsQ-0000p0-1N@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:33:46 +0000

commit d8a530ebc36ab242ba3fa3d83baaf4f68b1029ab
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Jul 15 09:20:10 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:20:10 2021 +0200

    libs/foreignmemory: Fix osdep_xenforeignmemory_map prototype
    
    Commit cf8c4d3d13b8 made some preparation to have one day
    variable-length-array argument, but didn't declare the array in the
    function prototype the same way as in the function definition. And now
    GCC 11 complains about it.
    
    Fixes: cf8c4d3d13b8 ("tools/libs/foreignmemory: pull array length argument to map forward")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 5d3e4ebb5c71477d74a0c503438545a0126d3863
    master date: 2021-06-15 18:07:58 +0100
---
 tools/libs/foreignmemory/private.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/foreignmemory/private.h b/tools/libs/foreignmemory/private.h
index 1ee3626dd2..5bb0cefb09 100644
--- a/tools/libs/foreignmemory/private.h
+++ b/tools/libs/foreignmemory/private.h
@@ -32,7 +32,7 @@ int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem);
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, void *addr,
                                  int prot, int flags, size_t num,
-                                 const xen_pfn_t arr[num], int err[num]);
+                                 const xen_pfn_t arr[/*num*/], int err[/*num*/]);
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:33:58 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:33:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156420.288616 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vsc-0008B6-2k; Thu, 15 Jul 2021 07:33:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156420.288616; Thu, 15 Jul 2021 07:33:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vsb-0008Ay-W7; Thu, 15 Jul 2021 07:33:57 +0000
Received: by outflank-mailman (input) for mailman id 156420;
 Thu, 15 Jul 2021 07:33:56 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vsa-0008Ac-68
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:33:56 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vsa-0007AW-5H
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:33:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vsa-0000qH-4W
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=j2fuSGiKNt2ar+Dpg8i3q5a2WoFu+qQl1AO3i0XXb3w=; b=f0IJEJTgDtfn5bAXIWPUfjezPD
	Ye4zPDbxVhjFtUJYFkfTepRH9c1ia50DxV946WSrYLhebLGEJe4uhFQKdLuobrsIo7TM5EhgeNEqc
	F5sr6Scy+jutEpp72osBBXNWFgPN823qU4k+1CEznR6kbXzv51JWo1D42u2oTBGj63Xg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] VT-d: undo device mappings upon error
Message-Id: <E1m3vsa-0000qH-4W@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:33:56 +0000

commit 0b80b344b0c008286542fb361e059dca0790389b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:20:37 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:20:37 2021 +0200

    VT-d: undo device mappings upon error
    
    When
     - flushes (supposedly not possible anymore after XSA-373),
     - secondary mappings for legacy PCI devices behind bridges,
     - secondary mappings for chipset quirks, or
     - find_upstream_bridge() invocations
    fail, the successfully established device mappings should not be left
    around.
    
    Further, when (parts of) unmapping fail, simply returning an error is
    typically not enough. Crash the domain instead in such cases, arranging
    for domain cleanup to continue in a best effort manner despite such
    failures.
    
    Finally make domain_context_unmap()'s error behavior consistent in the
    legacy PCI device case: Don't bail from the function in one special
    case, but always just exit the switch statement.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: f3401d65d9f0dce508c3d7da55de4a093d748ae1
    master date: 2021-06-24 16:28:25 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 57 +++++++++++++++++++++++++++++++------
 1 file changed, 48 insertions(+), 9 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index c160a70688..c0070f1c99 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1450,9 +1450,15 @@ int domain_context_mapping_one(
     if ( !seg && !rc )
         rc = me_wifi_quirk(domain, bus, devfn, MAP_ME_PHANTOM_FUNC);
 
+    if ( rc )
+        domain_context_unmap_one(domain, iommu, bus, devfn);
+
     return rc;
 }
 
+static int domain_context_unmap(struct domain *d, uint8_t devfn,
+                                struct pci_dev *pdev);
+
 static int domain_context_mapping(struct domain *domain, u8 devfn,
                                   struct pci_dev *pdev)
 {
@@ -1513,16 +1519,21 @@ static int domain_context_mapping(struct domain *domain, u8 devfn,
         if ( ret )
             break;
 
-        if ( find_upstream_bridge(seg, &bus, &devfn, &secbus) < 1 )
-            break;
+        if ( (ret = find_upstream_bridge(seg, &bus, &devfn, &secbus)) < 1 )
+        {
+            if ( !ret )
+                break;
+            ret = -ENXIO;
+        }
 
         /*
          * Mapping a bridge should, if anything, pass the struct pci_dev of
          * that bridge. Since bridges don't normally get assigned to guests,
          * their owner would be the wrong one. Pass NULL instead.
          */
-        ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
-                                         NULL);
+        if ( ret >= 0 )
+            ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
+                                             NULL);
 
         /*
          * Devices behind PCIe-to-PCI/PCIx bridge may generate different
@@ -1539,6 +1550,9 @@ static int domain_context_mapping(struct domain *domain, u8 devfn,
             ret = domain_context_mapping_one(domain, drhd->iommu, secbus, 0,
                                              NULL);
 
+        if ( ret )
+            domain_context_unmap(domain, devfn, pdev);
+
         break;
 
     default:
@@ -1617,6 +1631,19 @@ int domain_context_unmap_one(
     if ( !iommu->drhd->segment && !rc )
         rc = me_wifi_quirk(domain, bus, devfn, UNMAP_ME_PHANTOM_FUNC);
 
+    if ( rc && !is_hardware_domain(domain) && domain != dom_io )
+    {
+        if ( domain->is_dying )
+        {
+            printk(XENLOG_ERR "%pd: error %d unmapping %04x:%02x:%02x.%u\n",
+                   domain, rc, iommu->drhd->segment, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
+            rc = 0; /* Make upper layers continue in a best effort manner. */
+        }
+        else
+            domain_crash(domain);
+    }
+
     return rc;
 }
 
@@ -1669,17 +1696,29 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
 
         tmp_bus = bus;
         tmp_devfn = devfn;
-        if ( find_upstream_bridge(seg, &tmp_bus, &tmp_devfn, &secbus) < 1 )
+        if ( (ret = find_upstream_bridge(seg, &tmp_bus, &tmp_devfn,
+                                         &secbus)) < 1 )
+        {
+            if ( ret )
+            {
+                ret = -ENXIO;
+                if ( !domain->is_dying &&
+                     !is_hardware_domain(domain) && domain != dom_io )
+                {
+                    domain_crash(domain);
+                    /* Make upper layers continue in a best effort manner. */
+                    ret = 0;
+                }
+            }
             break;
+        }
 
         /* PCIe to PCI/PCIx bridge */
         if ( pdev_type(seg, tmp_bus, tmp_devfn) == DEV_TYPE_PCIe2PCI_BRIDGE )
         {
             ret = domain_context_unmap_one(domain, iommu, tmp_bus, tmp_devfn);
-            if ( ret )
-                return ret;
-
-            ret = domain_context_unmap_one(domain, iommu, secbus, 0);
+            if ( !ret )
+                ret = domain_context_unmap_one(domain, iommu, secbus, 0);
         }
         else /* Legacy PCI bridge */
             ret = domain_context_unmap_one(domain, iommu, tmp_bus, tmp_devfn);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:34:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:34:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156421.288619 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vsm-0008Eo-5t; Thu, 15 Jul 2021 07:34:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156421.288619; Thu, 15 Jul 2021 07:34:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vsm-0008Eg-2x; Thu, 15 Jul 2021 07:34:08 +0000
Received: by outflank-mailman (input) for mailman id 156421;
 Thu, 15 Jul 2021 07:34:06 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vsk-0008ED-9F
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:34:06 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vsk-0007Au-8S
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:34:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vsk-0000rY-7b
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UJ3lDdA5iD0xvUj/i3Ayi3+dUsYU0yMQC4Ezvt4tKTQ=; b=KFd8DNs9qcIlsF6MH7SOnUgSTV
	jCSWsyXR6lmrFECfHELu3W/U7Ut+hbsQRLVLqmkYQ6wQPaSw9H+RXIazJG1itNG+1jscNGxQdoqV+
	8IRUJ196H8tS/aczu/9NnZX65+TuXwhQf57fHdMffK/uqKTUOL9UkskTi/cux5mFkaHA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] VT-d: adjust domid map updating when unmapping context
Message-Id: <E1m3vsk-0000rY-7b@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:34:06 +0000

commit 3581714729cf84df50d6831c4da076e21587408c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:21:04 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:21:04 2021 +0200

    VT-d: adjust domid map updating when unmapping context
    
    When an earlier error occurred, cleaning up the domid mapping data is
    wrong, as references likely still exist. The only exception to this is
    when the actual unmapping worked, but some flush failed (supposedly
    impossible after XSA-373). The guest will get crashed in such a case
    though, so add fallback cleanup to domain destruction to cover this
    case. This in turn makes it desirable to silence the dprintk() in
    domain_iommu_domid().
    
    Note that no error will be returned anymore when the lookup fails - in
    the common case lookup failure would already have caused
    domain_context_unmap_one() to fail, yet even from a more general
    perspective it doesn't look right to fail domain_context_unmap() in such
    a case when this was the last device, but not when any earlier unmap was
    otherwise successful.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 32655880057ce2829f962d46916ea6cec60f98d3
    master date: 2021-06-24 16:29:13 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 39 +++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 15 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index c0070f1c99..2b3609dae2 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -80,9 +80,11 @@ static int domain_iommu_domid(struct domain *d,
         i = find_next_bit(iommu->domid_bitmap, nr_dom, i+1);
     }
 
-    dprintk(XENLOG_ERR VTDPREFIX,
-            "Cannot get valid iommu domid: domid=%d iommu->index=%d\n",
-            d->domain_id, iommu->index);
+    if ( !d->is_dying )
+        dprintk(XENLOG_ERR VTDPREFIX,
+                "Cannot get valid iommu %u domid: %pd\n",
+                iommu->index, d);
+
     return -1;
 }
 
@@ -147,6 +149,17 @@ static int context_get_domain_id(struct context_entry *context,
     return domid;
 }
 
+static void cleanup_domid_map(struct domain *domain, struct vtd_iommu *iommu)
+{
+    int iommu_domid = domain_iommu_domid(domain, iommu);
+
+    if ( iommu_domid >= 0 )
+    {
+        clear_bit(iommu_domid, iommu->domid_bitmap);
+        iommu->domid_map[iommu_domid] = 0;
+    }
+}
+
 static void sync_cache(const void *addr, unsigned int size)
 {
     static unsigned long clflush_size = 0;
@@ -1732,6 +1745,9 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
         goto out;
     }
 
+    if ( ret )
+        goto out;
+
     /*
      * if no other devices under the same iommu owned by this domain,
      * clear iommu in iommu_bitmap and clear domain_id in domid_bitmp
@@ -1751,19 +1767,8 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
 
     if ( found == 0 )
     {
-        int iommu_domid;
-
         clear_bit(iommu->index, &dom_iommu(domain)->arch.vtd.iommu_bitmap);
-
-        iommu_domid = domain_iommu_domid(domain, iommu);
-        if ( iommu_domid == -1 )
-        {
-            ret = -EINVAL;
-            goto out;
-        }
-
-        clear_bit(iommu_domid, iommu->domid_bitmap);
-        iommu->domid_map[iommu_domid] = 0;
+        cleanup_domid_map(domain, iommu);
     }
 
 out:
@@ -1783,6 +1788,7 @@ static void iommu_domain_teardown(struct domain *d)
 {
     struct domain_iommu *hd = dom_iommu(d);
     struct mapped_rmrr *mrmrr, *tmp;
+    const struct acpi_drhd_unit *drhd;
 
     if ( list_empty(&acpi_drhd_units) )
         return;
@@ -1794,6 +1800,9 @@ static void iommu_domain_teardown(struct domain *d)
     }
 
     ASSERT(!hd->arch.vtd.pgd_maddr);
+
+    for_each_drhd_unit ( drhd )
+        cleanup_domid_map(d, drhd->iommu);
 }
 
 static int __must_check intel_iommu_map_page(struct domain *d, dfn_t dfn,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:34:18 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:34:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156422.288624 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vsw-0008Hy-7o; Thu, 15 Jul 2021 07:34:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156422.288624; Thu, 15 Jul 2021 07:34:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vsw-0008Hq-4a; Thu, 15 Jul 2021 07:34:18 +0000
Received: by outflank-mailman (input) for mailman id 156422;
 Thu, 15 Jul 2021 07:34:16 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vsu-0008HU-CX
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:34:16 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vsu-0007B6-BX
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:34:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vsu-0000tI-Ap
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cRw7FlJxjMYGDTRb9nregN+1bpgMGXJzzYicz87qegM=; b=dR8iNdAnSfco/5TKN48lVS6Mlh
	/VKaWJhYlJjo8NsflUha91owc84LoVvZdLEuw7nXq+6PapwNaNlAwE20xtcXFxDrM49P6aI8H7ihZ
	VD4T/97oVkonbuximYLKZIFnacfuwNQ2mQcWZCsXpi0V0g5paOTrVU/mQsH2BmlW6mys=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] VT-d: clear_fault_bits() should clear all fault bits
Message-Id: <E1m3vsu-0000tI-Ap@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:34:16 +0000

commit 2ba0d81bebe1f9521e407d1874f323564b6c2819
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:21:28 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:21:28 2021 +0200

    VT-d: clear_fault_bits() should clear all fault bits
    
    If there is any way for one fault to be left set in the recording
    registers, there's no reason there couldn't also be multiple ones. If
    PPF set set (being the OR or all F fields), simply loop over the entire
    range of fault recording registers, clearing F everywhere.
    
    Since PPF is a r/o bit, also remove it from DMA_FSTS_FAULTS (arguably
    the constant's name is ambiguous as well).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    
    master commit: 80589800ae62fce43fd3921e8fbd362465fe5ba3
    master date: 2021-06-24 16:29:42 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 16 +++++++++++++---
 xen/drivers/passthrough/vtd/iommu.h |  3 ++-
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 2b3609dae2..d5d3a25852 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2102,13 +2102,23 @@ static int __hwdom_init setup_hwdom_device(u8 devfn, struct pci_dev *pdev)
 
 void clear_fault_bits(struct vtd_iommu *iommu)
 {
-    u64 val;
     unsigned long flags;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
-    val = dmar_readq(iommu->reg, cap_fault_reg_offset(iommu->cap) + 8);
-    dmar_writeq(iommu->reg, cap_fault_reg_offset(iommu->cap) + 8, val);
+
+    if ( dmar_readl(iommu->reg, DMAR_FSTS_REG) & DMA_FSTS_PPF )
+    {
+        unsigned int reg = cap_fault_reg_offset(iommu->cap);
+        unsigned int end = reg + cap_num_fault_regs(iommu->cap);
+
+        do {
+           dmar_writel(iommu->reg, reg + 12, DMA_FRCD_F);
+           reg += PRIMARY_FAULT_REG_LEN;
+        } while ( reg < end );
+    }
+
     dmar_writel(iommu->reg, DMAR_FSTS_REG, DMA_FSTS_FAULTS);
+
     spin_unlock_irqrestore(&iommu->register_lock, flags);
 }
 
diff --git a/xen/drivers/passthrough/vtd/iommu.h b/xen/drivers/passthrough/vtd/iommu.h
index e002dc6f01..32b39c606a 100644
--- a/xen/drivers/passthrough/vtd/iommu.h
+++ b/xen/drivers/passthrough/vtd/iommu.h
@@ -174,7 +174,8 @@
 #define DMA_FSTS_IQE ((u64)1 << 4)
 #define DMA_FSTS_ICE ((u64)1 << 5)
 #define DMA_FSTS_ITE ((u64)1 << 6)
-#define DMA_FSTS_FAULTS    DMA_FSTS_PFO | DMA_FSTS_PPF | DMA_FSTS_AFO | DMA_FSTS_APF | DMA_FSTS_IQE | DMA_FSTS_ICE | DMA_FSTS_ITE
+#define DMA_FSTS_FAULTS (DMA_FSTS_PFO | DMA_FSTS_AFO | DMA_FSTS_APF | \
+                         DMA_FSTS_IQE | DMA_FSTS_ICE | DMA_FSTS_ITE)
 #define dma_fsts_fault_record_index(s) (((s) >> 8) & 0xff)
 
 /* FRCD_REG, 32 bits access */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:34:28 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:34:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156423.288629 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vt6-0008Kz-9f; Thu, 15 Jul 2021 07:34:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156423.288629; Thu, 15 Jul 2021 07:34:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vt6-0008Kr-6C; Thu, 15 Jul 2021 07:34:28 +0000
Received: by outflank-mailman (input) for mailman id 156423;
 Thu, 15 Jul 2021 07:34:26 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vt4-0008KI-FH
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:34:26 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vt4-0007BI-ES
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:34:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vt4-0000uc-Dn
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fF/VsVflTSmJfE8UlANka6h3v70auzdOPxiGngCt/jo=; b=RRdNt5jEm6zMRAd/vifYkJ1owR
	5DSy6b9QNIB6/4XHlqqq4IPQ0ca3O7dD0KVerk/9iWM8Hyfk1liMmu4sic2dipAX9aSNIT+WPc3AJ
	8E3HqQ09Y1RPyg7AERyQIaosEhD/AL6wvG60ftpy20oGGoH5gRWGB9DJnr3pSlIceACM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] VT-d: don't lose errors when flushing TLBs on multiple IOMMUs
Message-Id: <E1m3vt4-0000uc-Dn@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:34:26 +0000

commit 6ba107c3be5090e6c6391ad0133a865ff25a239c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:21:50 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:21:50 2021 +0200

    VT-d: don't lose errors when flushing TLBs on multiple IOMMUs
    
    While no longer an immediate problem with flushes no longer timing out,
    errors (if any) get properly reported by iommu_flush_iotlb_{dsi,psi}().
    Overwriting such an error with, perhaps, a success indicator received
    from another IOMMU will misguide callers. Record the first error, but
    don't bail from the loop (such that further necessary invalidation gets
    carried out on a best effort basis).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: e7059776f9755b989a992d229c68c3d7778412be
    master date: 2021-06-24 16:30:06 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index d5d3a25852..3fcd7208f0 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -643,7 +643,7 @@ static int __must_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
     struct vtd_iommu *iommu;
     bool_t flush_dev_iotlb;
     int iommu_domid;
-    int rc = 0;
+    int ret = 0;
 
     /*
      * No need pcideves_lock here because we have flush
@@ -651,6 +651,8 @@ static int __must_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
      */
     for_each_drhd_unit ( drhd )
     {
+        int rc;
+
         iommu = drhd->iommu;
 
         if ( !test_bit(iommu->index, &hd->arch.vtd.iommu_bitmap) )
@@ -673,13 +675,12 @@ static int __must_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
                                        flush_dev_iotlb);
 
         if ( rc > 0 )
-        {
             iommu_flush_write_buffer(iommu);
-            rc = 0;
-        }
+        else if ( !ret )
+            ret = rc;
     }
 
-    return rc;
+    return ret;
 }
 
 static int __must_check iommu_flush_iotlb_pages(struct domain *d,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:34:38 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:34:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156424.288632 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vtG-0008P0-Ae; Thu, 15 Jul 2021 07:34:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156424.288632; Thu, 15 Jul 2021 07:34:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vtG-0008Or-7f; Thu, 15 Jul 2021 07:34:38 +0000
Received: by outflank-mailman (input) for mailman id 156424;
 Thu, 15 Jul 2021 07:34:36 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vtE-0008OQ-IK
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:34:36 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vtE-0007Bv-HX
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:34:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vtE-0000vo-Gk
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=eHLPGBnp9lHru4VwljxqcL4S3cyGMKoGI4GG3vFZTac=; b=cJf2gTod1r2j8szLd9H4/uDZl4
	QGDEws5ojBo6uQYIps3L325bwWL87CDnv4Le+rFoJ6gPDxTmyrRuF63X39/3YzD9e1Y/QG4j+nm6D
	ppUUIPOGR7Ts9ntlkYQt7XQcW6//9cGNMinrRNlXi1anODN0gIEJDvWNCyULBHX5l79c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] IOMMU/PCI: don't let domain cleanup continue when device de-assignment failed
Message-Id: <E1m3vtE-0000vo-Gk@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:34:36 +0000

commit 7b658fd273f9697975572585e1c80685b287dce9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:22:18 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:22:18 2021 +0200

    IOMMU/PCI: don't let domain cleanup continue when device de-assignment failed
    
    Failure here could in principle mean the device may still be issuing DMA
    requests, which would continue to be translated by the page tables the
    device entry currently points at. With this we cannot allow the
    subsequent cleanup step of freeing the page tables to occur, to prevent
    use-after-free issues. We would need to accept, for the time being, that
    in such a case the remaining domain resources will all be leaked, and
    the domain will continue to exist as a zombie.
    
    However, with flushes no longer timing out (and with proper timeout
    detection for device I/O TLB flushing yet to be implemented), there's no
    way anymore for failures to occur, except due to bugs elsewhere. Hence
    the change here is merely a "just in case" one.
    
    In order to continue the loop in spite of an error, we can't use
    pci_get_pdev_by_domain() anymore. I have no idea why it was used here in
    the first place, instead of the cheaper list iteration.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: f591755823a7e94fc6b4b8ddce71f0421a94fa09
    master date: 2021-06-25 14:06:55 +0200
---
 xen/drivers/passthrough/pci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 705137f8be..a9e3ac906f 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -894,7 +894,7 @@ static int deassign_device(struct domain *d, uint16_t seg, uint8_t bus,
 
 int pci_release_devices(struct domain *d)
 {
-    struct pci_dev *pdev;
+    struct pci_dev *pdev, *tmp;
     u8 bus, devfn;
     int ret;
 
@@ -905,15 +905,15 @@ int pci_release_devices(struct domain *d)
         pcidevs_unlock();
         return ret;
     }
-    while ( (pdev = pci_get_pdev_by_domain(d, -1, -1, -1)) )
+    list_for_each_entry_safe ( pdev, tmp, &d->pdev_list, domain_list )
     {
         bus = pdev->bus;
         devfn = pdev->devfn;
-        deassign_device(d, pdev->seg, bus, devfn);
+        ret = deassign_device(d, pdev->seg, bus, devfn) ?: ret;
     }
     pcidevs_unlock();
 
-    return 0;
+    return ret;
 }
 
 #define PCI_CLASS_BRIDGE_HOST    0x0600
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:34:48 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:34:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156425.288636 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vtQ-0008SB-C9; Thu, 15 Jul 2021 07:34:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156425.288636; Thu, 15 Jul 2021 07:34:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vtQ-0008S3-95; Thu, 15 Jul 2021 07:34:48 +0000
Received: by outflank-mailman (input) for mailman id 156425;
 Thu, 15 Jul 2021 07:34:46 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vtO-0008Rn-LJ
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:34:46 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vtO-0007CB-KR
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:34:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vtO-0000x0-Jf
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=noNpxca2kkBWc0TDFuqDhhVefnHG/GRcb3fIPe5EJ5I=; b=MJMMP/I/wM0W8T6W+uL7dogp7e
	+ty/dCmKTgHodQtH/feOlVKiLER+TNxedBfR2SXoXX0dShCYwydyEpJ09TNKarWs2ujVeN28dVDXw
	pwYc612zzTm1kXFlraEC1cM17g1WAdrpVbV2+VHZa48uWqPB7NgB7AXk8+DInJjbK8h4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] build: fix %.s: %.S rule
Message-Id: <E1m3vtO-0000x0-Jf@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:34:46 +0000

commit 16d2641ddf8bcce8bf0d73df0d54bcd38ca32051
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Jul 15 09:22:43 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:22:43 2021 +0200

    build: fix %.s: %.S rule
    
    Fixes: e321576f4047 ("xen/build: start using if_changed")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: d468f9522174114ab06239894b6079c0a487e408
    master date: 2021-07-05 16:47:51 +0200
---
 xen/Rules.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index ceb3d204b8..d65d6a4899 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -227,8 +227,8 @@ cmd_cpp_i_c = $(CPP) $(filter-out -Wa$(comma)%,$(c_flags)) -MQ $@ -o $@ $<
 quiet_cmd_cc_s_c = CC      $@
 cmd_cc_s_c = $(CC) $(filter-out -Wa$(comma)%,$(c_flags)) -S $< -o $@
 
-quiet_cmd_s_S = CPP     $@
-cmd_s_S = $(CPP) $(filter-out -Wa$(comma)%,$(a_flags)) -MQ $@ -o $@ $<
+quiet_cmd_cpp_s_S = CPP     $@
+cmd_cpp_s_S = $(CPP) $(filter-out -Wa$(comma)%,$(a_flags)) -MQ $@ -o $@ $<
 
 %.i: %.c FORCE
 	$(call if_changed,cpp_i_c)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:34:57 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:34:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156426.288640 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vtZ-0008Uc-DV; Thu, 15 Jul 2021 07:34:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156426.288640; Thu, 15 Jul 2021 07:34:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vtZ-0008UU-AY; Thu, 15 Jul 2021 07:34:57 +0000
Received: by outflank-mailman (input) for mailman id 156426;
 Thu, 15 Jul 2021 07:34:56 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vtY-0008UM-OT
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:34:56 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vtY-0007CT-Nd
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:34:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vtY-0000zT-Mf
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=O3SrITnOIGPVIeHAZwyS6d3ZJMBixrbxvNxeQnw2az4=; b=pyJVDRR+kqQi2W1xEsgKbiktRf
	eRo3Z5xQLo08S7b9JzxMrVBOI/ywyW0gmDoWOPfud4zuDZ6U8wQLH4oTwVqBUm1JOurRIAcM4IPTt
	Xo/HIMR2tP9SAQPu7faENZSAADN9uCsvEJTX+d7wPkJjhgaZd5VowtoaNtz7tGlx1wnk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] x86/mem-sharing: ensure consistent lock order in get_two_gfns()
Message-Id: <E1m3vtY-0000zT-Mf@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:34:56 +0000

commit e6d098e4cd65149a71fd1a181e53185ec205efc6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:23:10 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:23:10 2021 +0200

    x86/mem-sharing: ensure consistent lock order in get_two_gfns()
    
    While the comment validly says "Sort by domain, if same domain by gfn",
    the implementation also included equal domain IDs in the first part of
    the check, thus rending the second part entirely dead and leaving
    deadlock potential when there's only a single domain involved.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
    master commit: 09af2d01a2fe6a0af08598bdfe12c9707f4d82ba
    master date: 2021-07-07 12:35:12 +0200
---
 xen/include/asm-x86/p2m.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 7d63f5787e..3514f1e1a3 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -576,7 +576,7 @@ do {                                                    \
     dest ## _t   = (source ## t)   ?: &scratch_t;       \
 } while (0)
 
-    if ( (rd->domain_id <= ld->domain_id) ||
+    if ( (rd->domain_id < ld->domain_id) ||
          ((rd == ld) && (gfn_x(rgfn) <= gfn_x(lgfn))) )
     {
         assign_pointers(first, r);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:35:07 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:35:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156427.288644 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vtj-00006D-FV; Thu, 15 Jul 2021 07:35:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156427.288644; Thu, 15 Jul 2021 07:35:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vtj-000065-CH; Thu, 15 Jul 2021 07:35:07 +0000
Received: by outflank-mailman (input) for mailman id 156427;
 Thu, 15 Jul 2021 07:35:06 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vti-00005t-RN
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:35:06 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vti-0007Cq-Qb
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:35:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vti-00011M-Pv
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:35: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wBeWowGou/4iAgIweiy7aIKJuZH8wI/4Ac+u+Eatpdw=; b=rJzIru7ke6yZcZplXtDY1pHMQm
	bOMVq4WclU7zuUlc+r//MM0zKE7cYuwQT8QlAC/ewlwyPBToFQw98K7l2MQs+XLioDm6yB+CWaB1i
	gt+DuK8fUTSXm9crxXSu/N09d3mzR2j07shQprNE41g1V8sxyn+ykx5sRVv8PKMQbHJY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] build: clean "lib.a"
Message-Id: <E1m3vti-00011M-Pv@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:35:06 +0000

commit 1a6824957d051bb94929a1c74a52c013bc2f388d
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Jul 15 09:23:41 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:23:41 2021 +0200

    build: clean "lib.a"
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 3ce2765ac21dbd739e8216694b025aaabf4afff3
    master date: 2021-07-07 17:51:18 +0200
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index d4a7014f59..ae2fa0fda3 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -339,7 +339,7 @@ _clean: delete-unfresh-files
 	$(MAKE) $(clean) test
 	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) clean
 	find . \( -name "*.o" -o -name ".*.d" -o -name ".*.d2" \
-		-o -name "*.gcno" -o -name ".*.cmd" \) -exec rm -f {} \;
+		-o -name "*.gcno" -o -name ".*.cmd" -o -name "lib.a" \) -exec rm -f {} \;
 	rm -f include/asm $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET).efi.map $(TARGET)-syms $(TARGET)-syms.map *~ core
 	rm -f include/asm-*/asm-offsets.h
 	rm -f .banner
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:35:18 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:35:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156428.288647 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vtu-00009j-Hy; Thu, 15 Jul 2021 07:35:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156428.288647; Thu, 15 Jul 2021 07:35:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vtu-00009b-F0; Thu, 15 Jul 2021 07:35:18 +0000
Received: by outflank-mailman (input) for mailman id 156428;
 Thu, 15 Jul 2021 07:35:17 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vtt-00009N-Bq
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:35:17 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vtt-0007D3-Ax
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:35:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vtt-00014L-AB
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uoNiOu9CjLwMuiW1qfUVvOhUUEYFUNFkGAip3LCEXSI=; b=ToHSEpoa067t1i7AnkPTmuA/c2
	ny421eB+/0Z7Enam/zjThJ7Um5AtVX/CD3r0sx6zQm6f/jOmfSh9uDSGAsUtICQ2ks5eWIV/d2SqR
	z2j2oJWsYEf3FxbxiPb1I5C7Nx34NMjWWWh/QlTQJn3/45CATeB3Dx4y7+S7ekPh4T9s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] SUPPORT.md: Un-shimmed 32-bit PV guests are no longer supported
Message-Id: <E1m3vtt-00014L-AB@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:35:17 +0000

commit c6ee6d4ec3c87d67e8fee58e28459c22c44b384b
Author:     George Dunlap <george.dunlap@citrix.com>
AuthorDate: Thu Jul 15 09:28:59 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:28:59 2021 +0200

    SUPPORT.md: Un-shimmed 32-bit PV guests are no longer supported
    
    The support status of 32-bit guests doesn't seem particularly useful.
    
    With it changed to fully unsupported outside of PV-shim, adjust the PV32
    Kconfig default accordingly.
    
    Reported-by: Jann Horn <jannh@google.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1a0f2fe2297d122a08fee2b26de5de995fdeca13
    master date: 2021-06-04 17:24:05 +0100
---
 SUPPORT.md           | 9 +--------
 xen/arch/x86/Kconfig | 7 +++++--
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index cd786ac0c1..c45390a245 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -82,14 +82,7 @@ No hardware requirements
 
     Status, x86_64: Supported
     Status, x86_32, shim: Supported
-    Status, x86_32, without shim: Supported, with caveats
-
-Due to architectural limitations,
-32-bit PV guests must be assumed to be able to read arbitrary host memory
-using speculative execution attacks.
-Advisories will continue to be issued
-for new vulnerabilities related to un-shimmed 32-bit PV guests
-enabling denial-of-service attacks or privilege escalation attacks.
+    Status, x86_32, without shim: Supported, not security supported
 
 ### x86/HVM
 
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index a636a4bb1e..8af5d6be80 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -56,7 +56,7 @@ config PV
 config PV32
 	bool "Support for 32bit PV guests"
 	depends on PV
-	default y
+	default PV_SHIM
 	---help---
 	  The 32bit PV ABI uses Ring1, an area of the x86 architecture which
 	  was deprecated and mostly removed in the AMD64 spec.  As a result,
@@ -67,7 +67,10 @@ config PV32
 	  reduction, or performance reasons.  Backwards compatibility can be
 	  provided via the PV Shim mechanism.
 
-	  If unsure, say Y.
+	  Note that outside of PV Shim, 32-bit PV guests are not security
+	  supported anymore.
+
+	  If unsure, use the default setting.
 
 config PV_LINEAR_PT
        bool "Support for PV linear pagetables"
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:35:28 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:35:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156429.288652 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vu4-0000DL-Jw; Thu, 15 Jul 2021 07:35:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156429.288652; Thu, 15 Jul 2021 07:35:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vu4-0000DC-GU; Thu, 15 Jul 2021 07:35:28 +0000
Received: by outflank-mailman (input) for mailman id 156429;
 Thu, 15 Jul 2021 07:35:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vu3-0000Cs-En
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:35:27 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vu3-0007DE-Dz
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:35:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vu3-00017C-DR
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:35: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sMpiwicZj7wpIBAThCclyLM8iJjoeM/4g0JaL6vtv8M=; b=eChyifL+YmuDvDFPu0RPsQXXn8
	rgAvtDyx7B8WUbznKnDWjae90pXLuHpDGhfV+l8/gMvIE20i3wbZW7AJ6KFZRmKZPLNLZGI2cWctB
	+RA2m0PH82Ve+a+JdNWi6yANBr2Dvag0UKw8VXSLO1D4I1mL6J/OrQQ6vSb9iyqQXNGU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] credit2: make sure we pick a runnable unit from the runq if there is one
Message-Id: <E1m3vu3-00017C-DR@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:35:27 +0000

commit ecd6b1770ff7a3e7b9f13013fc661790b553a743
Author:     Dario Faggioli <dfaggioli@suse.com>
AuthorDate: Thu Jul 15 09:29:34 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:29:34 2021 +0200

    credit2: make sure we pick a runnable unit from the runq if there is one
    
    A !runnable unit (temporarily) present in the runq may cause us to
    stop scanning the runq itself too early. Of course, we don't run any
    non-runnable vCPUs, but we end the scan and we fallback to picking
    the idle unit. In other word, this prevent us to find there and pick
    the actual unit that we're meant to start running (which might be
    further ahead in the runq).
    
    Depending on the vCPU pinning configuration, this may lead to such
    unit to be stuck in the runq for long time, causing malfunctioning
    inside the guest.
    
    Fix this by checking runnable/non-runnable status up-front, in the runq
    scanning function.
    
    Reported-by: Michał Leszczyński <michal.leszczynski@cert.pl>
    Reported-by: Dion Kant <g.w.kant@hunenet.nl>
    Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 07b0eb5d0ef0be154606aa46b5b4c5c59b158505
    master date: 2021-06-07 13:16:36 +0100
---
 xen/common/sched/credit2.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index eb5e5a78c5..f5c1e5b944 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -3463,6 +3463,10 @@ runq_candidate(struct csched2_runqueue_data *rqd,
                         (unsigned char *)&d);
         }
 
+        /* Skip non runnable units that we (temporarily) have in the runq */
+        if ( unlikely(!unit_runnable_state(svc->unit)) )
+            continue;
+
         /* Only consider vcpus that are allowed to run on this processor. */
         if ( !cpumask_test_cpu(cpu, svc->unit->cpu_hard_affinity) )
             continue;
@@ -3496,8 +3500,7 @@ runq_candidate(struct csched2_runqueue_data *rqd,
          * some budget, then choose it.
          */
         if ( (yield || svc->credit > snext->credit) &&
-             (!has_cap(svc) || unit_grab_budget(svc)) &&
-             unit_runnable_state(svc->unit) )
+             (!has_cap(svc) || unit_grab_budget(svc)) )
             snext = svc;
 
         /* In any case, if we got this far, break. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:35:38 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:35:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156430.288656 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vuE-0000Gt-Kx; Thu, 15 Jul 2021 07:35:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156430.288656; Thu, 15 Jul 2021 07:35:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vuE-0000Gk-I0; Thu, 15 Jul 2021 07:35:38 +0000
Received: by outflank-mailman (input) for mailman id 156430;
 Thu, 15 Jul 2021 07:35:37 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vuD-0000GY-HX
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:35:37 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vuD-0007De-Gp
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:35:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vuD-00018S-GG
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:35: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WzUd4PGdQpz9tKK1c70eFKK/kJQE/uD76C5OVi24cYU=; b=h9Jq8ECcaCa/210ebKbQ4SRKDw
	QYrDeuZYW/0w1vUoZ9mTCPKCe8VcOSAM1BK2OJGQujc2wowentTKh5eITNmc2r3Yiga6Q9SVx+BMQ
	bpOlvuDJ+HrCxhbdqOU3g7rfb3XwYeyNrZ2xxtHWKmCjNCVTjce12R3UqEJOJzP85kCA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] xen: credit2: fix per-entity load tracking when continuing running
Message-Id: <E1m3vuD-00018S-GG@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:35:37 +0000

commit 665024b4f40d5e18359afd72fc5cbd3a8cd3d0b0
Author:     Dario Faggioli <dfaggioli@suse.com>
AuthorDate: Thu Jul 15 09:30:18 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:30:18 2021 +0200

    xen: credit2: fix per-entity load tracking when continuing running
    
    If we schedule, and the current vCPU continues to run, its statistical
    load is not properly updated, resulting in something like this, even if
    all the 8 vCPUs are 100% busy:
    
    (XEN) Runqueue 0:
    (XEN) [...]
    (XEN)   aveload            = 2097152 (~800%)
    (XEN) [...]
    (XEN)   Domain: 0 w 256 c 0 v 8
    (XEN)     1: [0.0] flags=2 cpu=4 credit=9996885 [w=256] load=35 (~0%)
    (XEN)     2: [0.1] flags=2 cpu=2 credit=9993725 [w=256] load=796 (~0%)
    (XEN)     3: [0.2] flags=2 cpu=1 credit=9995885 [w=256] load=883 (~0%)
    (XEN)     4: [0.3] flags=2 cpu=5 credit=9998833 [w=256] load=487 (~0%)
    (XEN)     5: [0.4] flags=2 cpu=6 credit=9998942 [w=256] load=1595 (~0%)
    (XEN)     6: [0.5] flags=2 cpu=0 credit=9994669 [w=256] load=22 (~0%)
    (XEN)     7: [0.6] flags=2 cpu=7 credit=9997706 [w=256] load=0 (~0%)
    (XEN)     8: [0.7] flags=2 cpu=3 credit=9992440 [w=256] load=0 (~0%)
    
    As we can see, the average load of the runqueue as a whole is, instead,
    computed properly.
    
    This issue would, in theory, potentially affect Credit2 load balancing
    logic. In practice, however, the problem only manifests (at least with
    these characteristics) when there is only 1 runqueue active in the
    cpupool, which also means there is no need to do any load-balancing.
    
    Hence its real impact is pretty much limited to wrong per-vCPU load
    percentages, when looking at the output of the 'r' debug-key.
    
    With this patch, the load is updated and displayed correctly:
    
    (XEN) Runqueue 0:
    (XEN) [...]
    (XEN)   aveload            = 2097152 (~800%)
    (XEN) [...]
    (XEN) Domain info:
    (XEN)   Domain: 0 w 256 c 0 v 8
    (XEN)     1: [0.0] flags=2 cpu=4 credit=9995584 [w=256] load=262144 (~100%)
    (XEN)     2: [0.1] flags=2 cpu=6 credit=9992992 [w=256] load=262144 (~100%)
    (XEN)     3: [0.2] flags=2 cpu=3 credit=9998918 [w=256] load=262118 (~99%)
    (XEN)     4: [0.3] flags=2 cpu=5 credit=9996867 [w=256] load=262144 (~100%)
    (XEN)     5: [0.4] flags=2 cpu=1 credit=9998912 [w=256] load=262144 (~100%)
    (XEN)     6: [0.5] flags=2 cpu=2 credit=9997842 [w=256] load=262144 (~100%)
    (XEN)     7: [0.6] flags=2 cpu=7 credit=9994623 [w=256] load=262144 (~100%)
    (XEN)     8: [0.7] flags=2 cpu=0 credit=9991815 [w=256] load=262144 (~100%)
    
    Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 89052b9fa24bf976924e40918fc9fa3b1b940e17
    master date: 2021-06-07 13:17:06 +0100
---
 xen/common/sched/credit2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index f5c1e5b944..ebb09ea43a 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -3649,6 +3649,8 @@ static void csched2_schedule(
             runq_remove(snext);
             __set_bit(__CSFLAG_scheduled, &snext->flags);
         }
+        else
+            update_load(ops, rqd, snext, 0, now);
 
         /* Clear the idle mask if necessary */
         if ( cpumask_test_cpu(sched_cpu, &rqd->idle) )
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:35:48 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:35:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156432.288660 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vuO-0000Kg-MM; Thu, 15 Jul 2021 07:35:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156432.288660; Thu, 15 Jul 2021 07:35:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vuO-0000KW-JU; Thu, 15 Jul 2021 07:35:48 +0000
Received: by outflank-mailman (input) for mailman id 156432;
 Thu, 15 Jul 2021 07:35:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vuN-0000KC-KL
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:35:47 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vuN-0007Dr-Ja
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:35:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vuN-0001Ay-J0
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:35: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Y7aMpAekAbyB+ZySInP8iVkuxOmYII6bk3uhHDBOPKM=; b=Vyew75b0FeeR5J6Lexx6PgtAR1
	IALxzmM5cDdHC9xZKwzYmA3YC+gB+Y3AUaN5K3ZzEMYWZupzLNMQhydLqEZFTZHlQ4xIPZQFVr0Hv
	d9GYDgT5txGuwOWv9+/A27H1wE6gI6LEF8JYyT3hIvmV4S9KXCN9AKf1dOmF53e3/9xY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/vpt: fully init timers before putting onto list
Message-Id: <E1m3vuN-0001Ay-J0@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:35:47 +0000

commit 3ae25fc2b03cc583754098aaf80773a6e51832da
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:30:47 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:30:47 2021 +0200

    x86/vpt: fully init timers before putting onto list
    
    With pt_vcpu_lock() no longer acquiring the pt_migrate lock, parties
    iterating the list and acting on the timers of the list entries will no
    longer be kept from entering their loops by create_periodic_time()'s
    holding of that lock. Therefore at least init_timer() needs calling
    ahead of list insertion, but keep this and set_timer() together.
    
    Fixes: 8113b02f0bf8 ("x86/vpt: do not take pt_migrate rwlock in some cases")
    Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    master commit: 6d622f3a96bbd76ce8422c6e3805e6609417ec76
    master date: 2021-06-15 15:14:20 +0200
---
 xen/arch/x86/hvm/vpt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index 6a5458c8b7..efb5d53626 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -554,14 +554,14 @@ void create_periodic_time(
     pt->cb = cb;
     pt->priv = data;
 
+    init_timer(&pt->timer, pt_timer_fn, pt, v->processor);
+    set_timer(&pt->timer, pt->scheduled);
+
     pt_vcpu_lock(v);
     pt->on_list = 1;
     list_add(&pt->list, &v->arch.hvm.tm_list);
     pt_vcpu_unlock(v);
 
-    init_timer(&pt->timer, pt_timer_fn, pt, v->processor);
-    set_timer(&pt->timer, pt->scheduled);
-
     write_unlock(&v->domain->arch.hvm.pl_time->pt_migrate);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:35:58 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:35:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156433.288664 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vuY-0000Oq-Nt; Thu, 15 Jul 2021 07:35:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156433.288664; Thu, 15 Jul 2021 07:35:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vuY-0000Oi-Kz; Thu, 15 Jul 2021 07:35:58 +0000
Received: by outflank-mailman (input) for mailman id 156433;
 Thu, 15 Jul 2021 07:35:57 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vuX-0000ND-NK
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:35:57 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vuX-0007EQ-Ma
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:35:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vuX-0001DE-Ln
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:35: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1J1OgerlIIl3Lb61NcdONVvVp0ZyIyNLQusWuiutUCM=; b=CF9sxRMCtXAAVavFmssSHVZint
	IvJME6qjIbXw0fzkj4WwScj/DD0hD2ihiNaj7LCyTM//KNrS7ybDTm0vLJW/xAYVInSvfzscDDjQ9
	lwyLo7rHBgRwCTVFl0fhO9bIj+6IxRF8313ey9Qhr4qetRqE8OUL4PCUvYDi/58Af3fo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] libs/foreignmemory: Fix osdep_xenforeignmemory_map prototype
Message-Id: <E1m3vuX-0001DE-Ln@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:35:57 +0000

commit 64d93d6d414c8cb8d88afd08c544773f1c13d9aa
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Jul 15 09:31:12 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:31:12 2021 +0200

    libs/foreignmemory: Fix osdep_xenforeignmemory_map prototype
    
    Commit cf8c4d3d13b8 made some preparation to have one day
    variable-length-array argument, but didn't declare the array in the
    function prototype the same way as in the function definition. And now
    GCC 11 complains about it.
    
    Fixes: cf8c4d3d13b8 ("tools/libs/foreignmemory: pull array length argument to map forward")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 5d3e4ebb5c71477d74a0c503438545a0126d3863
    master date: 2021-06-15 18:07:58 +0100
---
 tools/libs/foreignmemory/private.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/foreignmemory/private.h b/tools/libs/foreignmemory/private.h
index 8f1bf081ed..e7b2cfa28a 100644
--- a/tools/libs/foreignmemory/private.h
+++ b/tools/libs/foreignmemory/private.h
@@ -32,7 +32,7 @@ int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem);
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, void *addr,
                                  int prot, int flags, size_t num,
-                                 const xen_pfn_t arr[num], int err[num]);
+                                 const xen_pfn_t arr[/*num*/], int err[/*num*/]);
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:36:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:36:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156434.288668 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vui-0000TO-PY; Thu, 15 Jul 2021 07:36:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156434.288668; Thu, 15 Jul 2021 07:36:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vui-0000TE-MQ; Thu, 15 Jul 2021 07:36:08 +0000
Received: by outflank-mailman (input) for mailman id 156434;
 Thu, 15 Jul 2021 07:36:07 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vuh-0000Sy-Q8
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:36:07 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vuh-0007Eo-PP
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:36:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vuh-0001Ef-Oo
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:36: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>
DKIM-Signature: v=1; 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+0ORjM/viOTKkJk5x2j81FQ77gKqgW+hjbn/zmMKOA=; b=JW03LT1ZN5fj++t/sdGH33NAkg
	i4UwILtpwekpCrYVqqqFPh8vE+y/ipSzA4dA9FNkgAGqLujbdtDbj9gUlK8XLYwbq1WmJKVf1F6na
	Fb45p40TXeqUuP0ox5cqY81s+IW3EkJ2p/SQKvl+aEAlhhp83faZLIDOCDvDHjasTKoI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] VT-d: undo device mappings upon error
Message-Id: <E1m3vuh-0001Ef-Oo@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:36:07 +0000

commit 1dae9fd19fd44e5912169bb916192438be1b4479
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:31:55 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:31:55 2021 +0200

    VT-d: undo device mappings upon error
    
    When
     - flushes (supposedly not possible anymore after XSA-373),
     - secondary mappings for legacy PCI devices behind bridges,
     - secondary mappings for chipset quirks, or
     - find_upstream_bridge() invocations
    fail, the successfully established device mappings should not be left
    around.
    
    Further, when (parts of) unmapping fail, simply returning an error is
    typically not enough. Crash the domain instead in such cases, arranging
    for domain cleanup to continue in a best effort manner despite such
    failures.
    
    Finally make domain_context_unmap()'s error behavior consistent in the
    legacy PCI device case: Don't bail from the function in one special
    case, but always just exit the switch statement.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: f3401d65d9f0dce508c3d7da55de4a093d748ae1
    master date: 2021-06-24 16:28:25 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 57 +++++++++++++++++++++++++++++++------
 1 file changed, 48 insertions(+), 9 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index bef3d594c9..7d1813a615 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1464,9 +1464,15 @@ int domain_context_mapping_one(
     if ( !seg && !rc )
         rc = me_wifi_quirk(domain, bus, devfn, MAP_ME_PHANTOM_FUNC);
 
+    if ( rc )
+        domain_context_unmap_one(domain, iommu, bus, devfn);
+
     return rc;
 }
 
+static int domain_context_unmap(struct domain *d, uint8_t devfn,
+                                struct pci_dev *pdev);
+
 static int domain_context_mapping(struct domain *domain, u8 devfn,
                                   struct pci_dev *pdev)
 {
@@ -1530,16 +1536,21 @@ static int domain_context_mapping(struct domain *domain, u8 devfn,
         if ( ret )
             break;
 
-        if ( find_upstream_bridge(seg, &bus, &devfn, &secbus) < 1 )
-            break;
+        if ( (ret = find_upstream_bridge(seg, &bus, &devfn, &secbus)) < 1 )
+        {
+            if ( !ret )
+                break;
+            ret = -ENXIO;
+        }
 
         /*
          * Mapping a bridge should, if anything, pass the struct pci_dev of
          * that bridge. Since bridges don't normally get assigned to guests,
          * their owner would be the wrong one. Pass NULL instead.
          */
-        ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
-                                         NULL);
+        if ( ret >= 0 )
+            ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
+                                             NULL);
 
         /*
          * Devices behind PCIe-to-PCI/PCIx bridge may generate different
@@ -1556,6 +1567,9 @@ static int domain_context_mapping(struct domain *domain, u8 devfn,
             ret = domain_context_mapping_one(domain, drhd->iommu, secbus, 0,
                                              NULL);
 
+        if ( ret )
+            domain_context_unmap(domain, devfn, pdev);
+
         break;
 
     default:
@@ -1635,6 +1649,19 @@ int domain_context_unmap_one(
     if ( !iommu->drhd->segment && !rc )
         rc = me_wifi_quirk(domain, bus, devfn, UNMAP_ME_PHANTOM_FUNC);
 
+    if ( rc && !is_hardware_domain(domain) && domain != dom_io )
+    {
+        if ( domain->is_dying )
+        {
+            printk(XENLOG_ERR "%pd: error %d unmapping %04x:%02x:%02x.%u\n",
+                   domain, rc, iommu->drhd->segment, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
+            rc = 0; /* Make upper layers continue in a best effort manner. */
+        }
+        else
+            domain_crash(domain);
+    }
+
     return rc;
 }
 
@@ -1689,17 +1716,29 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
 
         tmp_bus = bus;
         tmp_devfn = devfn;
-        if ( find_upstream_bridge(seg, &tmp_bus, &tmp_devfn, &secbus) < 1 )
+        if ( (ret = find_upstream_bridge(seg, &tmp_bus, &tmp_devfn,
+                                         &secbus)) < 1 )
+        {
+            if ( ret )
+            {
+                ret = -ENXIO;
+                if ( !domain->is_dying &&
+                     !is_hardware_domain(domain) && domain != dom_io )
+                {
+                    domain_crash(domain);
+                    /* Make upper layers continue in a best effort manner. */
+                    ret = 0;
+                }
+            }
             break;
+        }
 
         /* PCIe to PCI/PCIx bridge */
         if ( pdev_type(seg, tmp_bus, tmp_devfn) == DEV_TYPE_PCIe2PCI_BRIDGE )
         {
             ret = domain_context_unmap_one(domain, iommu, tmp_bus, tmp_devfn);
-            if ( ret )
-                return ret;
-
-            ret = domain_context_unmap_one(domain, iommu, secbus, 0);
+            if ( !ret )
+                ret = domain_context_unmap_one(domain, iommu, secbus, 0);
         }
         else /* Legacy PCI bridge */
             ret = domain_context_unmap_one(domain, iommu, tmp_bus, tmp_devfn);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:36:18 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:36:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156435.288672 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vus-0000X9-RJ; Thu, 15 Jul 2021 07:36:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156435.288672; Thu, 15 Jul 2021 07:36:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vus-0000X1-O0; Thu, 15 Jul 2021 07:36:18 +0000
Received: by outflank-mailman (input) for mailman id 156435;
 Thu, 15 Jul 2021 07:36:17 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vur-0000Wp-TA
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:36:17 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vur-0007F0-SJ
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:36:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vur-0001G9-Rh
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:36: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2V6LNAK0PIEYHYzWFg2TkCyRaRAHPkRxfLlUL7v12P4=; b=cw5LTSVjD+TRLdvuKTB80OcnRt
	LC8mvOIplP5fkpcEHLPMq7Icae1T9qTg7f7Dvd6L6NcodF5zb4U1+ogb4OQV8JeLosfy4DzUP2iVP
	wGdvo/NeJhwAEDah92kNMyS/t1ohBvzl8SFEW+K4Wr3PvM8qCZsl1SwYNGCpIEz3KbqE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] VT-d: adjust domid map updating when unmapping context
Message-Id: <E1m3vur-0001G9-Rh@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:36:17 +0000

commit e06d0c113e0067b86186db94aabae9c91aa09f35
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:32:21 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:32:21 2021 +0200

    VT-d: adjust domid map updating when unmapping context
    
    When an earlier error occurred, cleaning up the domid mapping data is
    wrong, as references likely still exist. The only exception to this is
    when the actual unmapping worked, but some flush failed (supposedly
    impossible after XSA-373). The guest will get crashed in such a case
    though, so add fallback cleanup to domain destruction to cover this
    case. This in turn makes it desirable to silence the dprintk() in
    domain_iommu_domid().
    
    Note that no error will be returned anymore when the lookup fails - in
    the common case lookup failure would already have caused
    domain_context_unmap_one() to fail, yet even from a more general
    perspective it doesn't look right to fail domain_context_unmap() in such
    a case when this was the last device, but not when any earlier unmap was
    otherwise successful.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 32655880057ce2829f962d46916ea6cec60f98d3
    master date: 2021-06-24 16:29:13 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 39 +++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 15 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 7d1813a615..e4c0e4368e 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -79,9 +79,11 @@ static int domain_iommu_domid(struct domain *d,
         i = find_next_bit(iommu->domid_bitmap, nr_dom, i+1);
     }
 
-    dprintk(XENLOG_ERR VTDPREFIX,
-            "Cannot get valid iommu domid: domid=%d iommu->index=%d\n",
-            d->domain_id, iommu->index);
+    if ( !d->is_dying )
+        dprintk(XENLOG_ERR VTDPREFIX,
+                "Cannot get valid iommu %u domid: %pd\n",
+                iommu->index, d);
+
     return -1;
 }
 
@@ -146,6 +148,17 @@ static int context_get_domain_id(struct context_entry *context,
     return domid;
 }
 
+static void cleanup_domid_map(struct domain *domain, struct vtd_iommu *iommu)
+{
+    int iommu_domid = domain_iommu_domid(domain, iommu);
+
+    if ( iommu_domid >= 0 )
+    {
+        clear_bit(iommu_domid, iommu->domid_bitmap);
+        iommu->domid_map[iommu_domid] = 0;
+    }
+}
+
 static int iommus_incoherent;
 
 static void sync_cache(const void *addr, unsigned int size)
@@ -1753,6 +1766,9 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
         goto out;
     }
 
+    if ( ret )
+        goto out;
+
     /*
      * if no other devices under the same iommu owned by this domain,
      * clear iommu in iommu_bitmap and clear domain_id in domid_bitmp
@@ -1772,19 +1788,8 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
 
     if ( found == 0 )
     {
-        int iommu_domid;
-
         clear_bit(iommu->index, &dom_iommu(domain)->arch.iommu_bitmap);
-
-        iommu_domid = domain_iommu_domid(domain, iommu);
-        if ( iommu_domid == -1 )
-        {
-            ret = -EINVAL;
-            goto out;
-        }
-
-        clear_bit(iommu_domid, iommu->domid_bitmap);
-        iommu->domid_map[iommu_domid] = 0;
+        cleanup_domid_map(domain, iommu);
     }
 
 out:
@@ -1795,6 +1800,7 @@ static void iommu_domain_teardown(struct domain *d)
 {
     struct domain_iommu *hd = dom_iommu(d);
     struct mapped_rmrr *mrmrr, *tmp;
+    const struct acpi_drhd_unit *drhd;
 
     if ( list_empty(&acpi_drhd_units) )
         return;
@@ -1814,6 +1820,9 @@ static void iommu_domain_teardown(struct domain *d)
     iommu_free_pagetable(hd->arch.pgd_maddr, agaw_to_level(hd->arch.agaw));
     hd->arch.pgd_maddr = 0;
     spin_unlock(&hd->arch.mapping_lock);
+
+    for_each_drhd_unit ( drhd )
+        cleanup_domid_map(d, drhd->iommu);
 }
 
 static int __must_check intel_iommu_map_page(struct domain *d, dfn_t dfn,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:36:28 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:36:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156436.288676 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vv2-0000dz-Tz; Thu, 15 Jul 2021 07:36:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156436.288676; Thu, 15 Jul 2021 07:36:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vv2-0000dq-Qw; Thu, 15 Jul 2021 07:36:28 +0000
Received: by outflank-mailman (input) for mailman id 156436;
 Thu, 15 Jul 2021 07:36:28 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vv1-0000dY-Vs
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:36:27 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vv1-0007FA-VA
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:36:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vv1-0001HT-UY
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:36: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qLseuh0Zlwy0E04T2Tej3E5kCnL5IZItr/sDizFcr6A=; b=Ge3BgcaUf7M5j4lnBNbkDumV7s
	o0jYarO3kkYCG6ngvD2u7VQBgwV/M8Nzwz/q4reoc29ZPm4ar8QYE04eCNvvI8u0dEZqdfjSVglNr
	dCZVUCttw8AILY7ESO5F9CqIgCwWx977Y98lEbBviF4JAvQ6FcofZSORmuEnzQ8KRGi0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] VT-d: clear_fault_bits() should clear all fault bits
Message-Id: <E1m3vv1-0001HT-UY@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:36:27 +0000

commit 79774e0df8be2d27fe79740acce6d1614b45bacc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:32:46 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:32:46 2021 +0200

    VT-d: clear_fault_bits() should clear all fault bits
    
    If there is any way for one fault to be left set in the recording
    registers, there's no reason there couldn't also be multiple ones. If
    PPF set set (being the OR or all F fields), simply loop over the entire
    range of fault recording registers, clearing F everywhere.
    
    Since PPF is a r/o bit, also remove it from DMA_FSTS_FAULTS (arguably
    the constant's name is ambiguous as well).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 80589800ae62fce43fd3921e8fbd362465fe5ba3
    master date: 2021-06-24 16:29:42 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 16 +++++++++++++---
 xen/drivers/passthrough/vtd/iommu.h |  3 ++-
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index e4c0e4368e..69eba4acf5 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2122,13 +2122,23 @@ static int __hwdom_init setup_hwdom_device(u8 devfn, struct pci_dev *pdev)
 
 void clear_fault_bits(struct vtd_iommu *iommu)
 {
-    u64 val;
     unsigned long flags;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
-    val = dmar_readq(iommu->reg, cap_fault_reg_offset(iommu->cap) + 8);
-    dmar_writeq(iommu->reg, cap_fault_reg_offset(iommu->cap) + 8, val);
+
+    if ( dmar_readl(iommu->reg, DMAR_FSTS_REG) & DMA_FSTS_PPF )
+    {
+        unsigned int reg = cap_fault_reg_offset(iommu->cap);
+        unsigned int end = reg + cap_num_fault_regs(iommu->cap);
+
+        do {
+           dmar_writel(iommu->reg, reg + 12, DMA_FRCD_F);
+           reg += PRIMARY_FAULT_REG_LEN;
+        } while ( reg < end );
+    }
+
     dmar_writel(iommu->reg, DMAR_FSTS_REG, DMA_FSTS_FAULTS);
+
     spin_unlock_irqrestore(&iommu->register_lock, flags);
 }
 
diff --git a/xen/drivers/passthrough/vtd/iommu.h b/xen/drivers/passthrough/vtd/iommu.h
index e002dc6f01..32b39c606a 100644
--- a/xen/drivers/passthrough/vtd/iommu.h
+++ b/xen/drivers/passthrough/vtd/iommu.h
@@ -174,7 +174,8 @@
 #define DMA_FSTS_IQE ((u64)1 << 4)
 #define DMA_FSTS_ICE ((u64)1 << 5)
 #define DMA_FSTS_ITE ((u64)1 << 6)
-#define DMA_FSTS_FAULTS    DMA_FSTS_PFO | DMA_FSTS_PPF | DMA_FSTS_AFO | DMA_FSTS_APF | DMA_FSTS_IQE | DMA_FSTS_ICE | DMA_FSTS_ITE
+#define DMA_FSTS_FAULTS (DMA_FSTS_PFO | DMA_FSTS_AFO | DMA_FSTS_APF | \
+                         DMA_FSTS_IQE | DMA_FSTS_ICE | DMA_FSTS_ITE)
 #define dma_fsts_fault_record_index(s) (((s) >> 8) & 0xff)
 
 /* FRCD_REG, 32 bits access */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:36:39 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:36:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156437.288680 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vvC-0000lM-Vq; Thu, 15 Jul 2021 07:36:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156437.288680; Thu, 15 Jul 2021 07:36:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vvC-0000lE-SO; Thu, 15 Jul 2021 07:36:38 +0000
Received: by outflank-mailman (input) for mailman id 156437;
 Thu, 15 Jul 2021 07:36:38 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vvC-0000kw-2N
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:36:38 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vvC-0007Fd-1g
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:36:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vvC-0001KB-17
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LgjC+MGdWD1NsARKZbSqLln8lxjJ58HKA1GJT215KmM=; b=5oy2B4zFNdfJSrhA+Qk4KgiYmp
	VXyICRRl9FavIpRVcY+WSniZCMj+ZgeeJQJexLska/rUGMOe/k6chLCr9DaD8s9WOhOaEXNJaD1lR
	GaObDpPzzmBltxcomcXJBG651gc3PO0g40KnbI5qjaJIaV9nh/7xjz7vv45Py/zYNgDc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] VT-d: don't lose errors when flushing TLBs on multiple IOMMUs
Message-Id: <E1m3vvC-0001KB-17@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:36:38 +0000

commit 86c223c9818d23b92f84494389e5b76c7fc0ad29
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:33:11 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:33:11 2021 +0200

    VT-d: don't lose errors when flushing TLBs on multiple IOMMUs
    
    While no longer an immediate problem with flushes no longer timing out,
    errors (if any) get properly reported by iommu_flush_iotlb_{dsi,psi}().
    Overwriting such an error with, perhaps, a success indicator received
    from another IOMMU will misguide callers. Record the first error, but
    don't bail from the loop (such that further necessary invalidation gets
    carried out on a best effort basis).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: e7059776f9755b989a992d229c68c3d7778412be
    master date: 2021-06-24 16:30:06 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 69eba4acf5..e125e3188a 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -596,7 +596,7 @@ static int __must_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
     struct vtd_iommu *iommu;
     bool_t flush_dev_iotlb;
     int iommu_domid;
-    int rc = 0;
+    int ret = 0;
 
     /*
      * No need pcideves_lock here because we have flush
@@ -604,6 +604,8 @@ static int __must_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
      */
     for_each_drhd_unit ( drhd )
     {
+        int rc;
+
         iommu = drhd->iommu;
 
         if ( !test_bit(iommu->index, &hd->arch.iommu_bitmap) )
@@ -626,13 +628,12 @@ static int __must_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
                                        flush_dev_iotlb);
 
         if ( rc > 0 )
-        {
             iommu_flush_write_buffer(iommu);
-            rc = 0;
-        }
+        else if ( !ret )
+            ret = rc;
     }
 
-    return rc;
+    return ret;
 }
 
 static int __must_check iommu_flush_iotlb_pages(struct domain *d,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:36:49 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:36:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156438.288684 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vvN-0000qL-0i; Thu, 15 Jul 2021 07:36:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156438.288684; Thu, 15 Jul 2021 07:36:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vvM-0000qD-U1; Thu, 15 Jul 2021 07:36:48 +0000
Received: by outflank-mailman (input) for mailman id 156438;
 Thu, 15 Jul 2021 07:36:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vvM-0000ot-5B
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:36:48 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vvM-0007Fq-4S
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:36:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vvM-0001Lm-3p
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07: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>
DKIM-Signature: v=1; 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+TRbNtz70WxNEZPLSDNeoAXk9JYIkKc+grxEQomgUo=; b=pysA1s49tM7o+o2wehNR4yKRer
	LKIr8O7iYNor87KUmd6mMbECt4zr2q+PH8/kgXZsd2tG/uBtjyiK92f2gkbb4V/leOY5mJFsFFPYG
	2dqa+BpUhLFBqMFrN1kV+gIYhtD4G+zryHuu9PuH+ps2e6uPFMABHraxpNNzP78gFS4o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] IOMMU/PCI: don't let domain cleanup continue when device de-assignment failed
Message-Id: <E1m3vvM-0001Lm-3p@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:36:48 +0000

commit 645fcf8a96d706b6037b7a772557213479be9a06
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:33:35 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:33:35 2021 +0200

    IOMMU/PCI: don't let domain cleanup continue when device de-assignment failed
    
    Failure here could in principle mean the device may still be issuing DMA
    requests, which would continue to be translated by the page tables the
    device entry currently points at. With this we cannot allow the
    subsequent cleanup step of freeing the page tables to occur, to prevent
    use-after-free issues. We would need to accept, for the time being, that
    in such a case the remaining domain resources will all be leaked, and
    the domain will continue to exist as a zombie.
    
    However, with flushes no longer timing out (and with proper timeout
    detection for device I/O TLB flushing yet to be implemented), there's no
    way anymore for failures to occur, except due to bugs elsewhere. Hence
    the change here is merely a "just in case" one.
    
    In order to continue the loop in spite of an error, we can't use
    pci_get_pdev_by_domain() anymore. I have no idea why it was used here in
    the first place, instead of the cheaper list iteration.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: f591755823a7e94fc6b4b8ddce71f0421a94fa09
    master date: 2021-06-25 14:06:55 +0200
---
 xen/drivers/passthrough/pci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 418b2cdf04..981e63061d 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -965,7 +965,7 @@ static int deassign_device(struct domain *d, uint16_t seg, uint8_t bus,
 
 int pci_release_devices(struct domain *d)
 {
-    struct pci_dev *pdev;
+    struct pci_dev *pdev, *tmp;
     u8 bus, devfn;
     int ret;
 
@@ -976,15 +976,15 @@ int pci_release_devices(struct domain *d)
         pcidevs_unlock();
         return ret;
     }
-    while ( (pdev = pci_get_pdev_by_domain(d, -1, -1, -1)) )
+    list_for_each_entry_safe ( pdev, tmp, &d->pdev_list, domain_list )
     {
         bus = pdev->bus;
         devfn = pdev->devfn;
-        deassign_device(d, pdev->seg, bus, devfn);
+        ret = deassign_device(d, pdev->seg, bus, devfn) ?: ret;
     }
     pcidevs_unlock();
 
-    return 0;
+    return ret;
 }
 
 #define PCI_CLASS_BRIDGE_HOST    0x0600
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:36:59 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:36:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156439.288688 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vvX-0000tl-2B; Thu, 15 Jul 2021 07:36:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156439.288688; Thu, 15 Jul 2021 07:36:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vvW-0000td-VU; Thu, 15 Jul 2021 07:36:58 +0000
Received: by outflank-mailman (input) for mailman id 156439;
 Thu, 15 Jul 2021 07:36:58 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vvW-0000tT-9M
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:36:58 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vvW-0007G4-8U
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:36:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vvW-0001QY-7K
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NbsOs6LQwDlYB4V3EMcZCgF9R/hMaRhnOMMA4n9L5ks=; b=JXUBdQbCtF/Jy7ggNEXqr6gBum
	9U1sAbusv0PCr6Ho2mcAzuqv4AXDhrz8l5sf87Y4FlIb0ZWEdBl40dhHR2ksYFSPAcfz1xL4OBFIJ
	WbIcMs6iS49B9Z8WMC83CDvz0oG9DD4phX5ukDIWlHtW5wIV+nyIzKJT/juNaNMLrxxs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] build: fix %.s: %.S rule
Message-Id: <E1m3vvW-0001QY-7K@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:36:58 +0000

commit 1ed3661879ce85188b8ef295f4e388221292b3f9
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Jul 15 09:34:03 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:34:03 2021 +0200

    build: fix %.s: %.S rule
    
    Fixes: e321576f4047 ("xen/build: start using if_changed")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: d468f9522174114ab06239894b6079c0a487e408
    master date: 2021-07-05 16:47:51 +0200
---
 xen/Rules.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index 62e9fabe7a..93f49af2eb 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -206,8 +206,8 @@ cmd_cpp_i_c = $(CPP) $(filter-out -Wa$(comma)%,$(c_flags)) -MQ $@ -o $@ $<
 quiet_cmd_cc_s_c = CC      $@
 cmd_cc_s_c = $(CC) $(filter-out -Wa$(comma)%,$(c_flags)) -S $< -o $@
 
-quiet_cmd_s_S = CPP     $@
-cmd_s_S = $(CPP) $(filter-out -Wa$(comma)%,$(a_flags)) -MQ $@ -o $@ $<
+quiet_cmd_cpp_s_S = CPP     $@
+cmd_cpp_s_S = $(CPP) $(filter-out -Wa$(comma)%,$(a_flags)) -MQ $@ -o $@ $<
 
 %.i: %.c FORCE
 	$(call if_changed,cpp_i_c)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:37:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:37:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156440.288692 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vvi-0000wx-3g; Thu, 15 Jul 2021 07:37:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156440.288692; Thu, 15 Jul 2021 07:37:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3vvi-0000wp-0l; Thu, 15 Jul 2021 07:37:10 +0000
Received: by outflank-mailman (input) for mailman id 156440;
 Thu, 15 Jul 2021 07:37:08 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vvg-0000wS-Le
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:37:08 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vvg-0007GS-Kw
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:37:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3vvg-0001S5-Ip
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fBIHS6vAlqIRdCM7aw46fbkKJ3bHWyFzkfpa51u+5Cg=; b=JAW4X97RlBNn0AbWMdZAbzKN8p
	85cGpMBPLOWFLDq23+tZU/QB/oGCqQ7mKXpf7wkh5/D8Mr80OdDjOKzxKt3i8+AqrUdvG5GBl9zDX
	4yl+MfklTIhOeWU+ht0spYmy/bYclh2t4vLHQ6oOT3fSy0rLVcFhfd+H24rD6WshTCNI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/mem-sharing: ensure consistent lock order in get_two_gfns()
Message-Id: <E1m3vvg-0001S5-Ip@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:37:08 +0000

commit 3cfccd70992b3d2b739e3febfceb99fdf6283be0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:34:28 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:34:28 2021 +0200

    x86/mem-sharing: ensure consistent lock order in get_two_gfns()
    
    While the comment validly says "Sort by domain, if same domain by gfn",
    the implementation also included equal domain IDs in the first part of
    the check, thus rending the second part entirely dead and leaving
    deadlock potential when there's only a single domain involved.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
    master commit: 09af2d01a2fe6a0af08598bdfe12c9707f4d82ba
    master date: 2021-07-07 12:35:12 +0200
---
 xen/include/asm-x86/p2m.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 8abae345e8..2883d8a2f0 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -552,7 +552,7 @@ do {                                                    \
     dest ## _t   = (source ## t)   ?: &scratch_t;       \
 } while (0)
 
-    if ( (rd->domain_id <= ld->domain_id) ||
+    if ( (rd->domain_id < ld->domain_id) ||
          ((rd == ld) && (gfn_x(rgfn) <= gfn_x(lgfn))) )
     {
         assign_pointers(first, r);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:55:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156448.288707 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wD3-0003SR-Kt; Thu, 15 Jul 2021 07:55:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156448.288707; Thu, 15 Jul 2021 07:55:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wD3-0003SJ-I4; Thu, 15 Jul 2021 07:55:05 +0000
Received: by outflank-mailman (input) for mailman id 156448;
 Thu, 15 Jul 2021 07:55:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wD2-0003SD-J0
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:55:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wD2-0007YU-HM
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:55:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wD2-00049C-GL
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:55: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hFKs8FfnTt1GEdmuAjpRSosDHSLwd7Tn2rbDbHvCAAY=; b=mx2N65eE0csy1OPYMijnVJd9Wj
	4FJak0mWWK5GzpdlkmbMaUNmS96q47IEAqDy4hCVJc4+s85NClmTbBA/Cyb/ip9B28vFt7FzuzO25
	M2n+CbmrPD4l8MfPPL1hD8LV5CVP0KdIStdjzNU6D1HPyXl/dFTdZKk1TsQgjmoXvQsA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] there's no CONFIG_GCC_VERSION
Message-Id: <E1m3wD2-00049C-GL@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:55:04 +0000

commit 948b7c859d9fede2c4296777343635ac6c341fa8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:37:11 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:37:11 2021 +0200

    there's no CONFIG_GCC_VERSION
    
    This was introduced in 4.14 only.
    
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/compiler.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h
index 85cbd1ab00..b1c0374dfe 100644
--- a/xen/include/xen/compiler.h
+++ b/xen/include/xen/compiler.h
@@ -99,7 +99,7 @@
     __asm__ ("" : "=r"(__ptr) : "0"(ptr));      \
     (typeof(ptr)) (__ptr + (off)); })
 
-#if CONFIG_GCC_VERSION >= 110000 /* See gcc bug 100680. */
+#if __GNUC__ >= 11 /* See gcc bug 100680. */
 # define gcc11_wrap(x) RELOC_HIDE(x, 0)
 #else
 # define gcc11_wrap(x) (x)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:55:15 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:55:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156449.288711 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wDD-0003UN-MP; Thu, 15 Jul 2021 07:55:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156449.288711; Thu, 15 Jul 2021 07:55:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wDD-0003UF-JV; Thu, 15 Jul 2021 07:55:15 +0000
Received: by outflank-mailman (input) for mailman id 156449;
 Thu, 15 Jul 2021 07:55:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wDC-0003U5-Lm
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:55:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wDC-0007Ye-Ks
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:55:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wDC-0004AZ-Jj
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=miIBjVIbXzk9QwGPZU+jp86GoXqK6Z3ggEUVK/SDEvk=; b=e2Yh2GYTw/a+zXORziR/LUfA+J
	vGOrC+rZWMYIzP5ItXaML3tRA2cAQdH7vGR+k0pn/K9fyvTFaLGELq/jNZpMDAgnc6mEXY8s3mSuN
	BnYqgtQ7TAqbD1uj2kIJO6Y8ajBOAnhkHOFeN2VZ8hDUVRQLixgcTSLXD6EwpwodbYm4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] SUPPORT.md: Un-shimmed 32-bit PV guests are no longer supported
Message-Id: <E1m3wDC-0004AZ-Jj@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:55:14 +0000

commit 64752a9bda8dc80a02456405607aba2d085dd3f2
Author:     George Dunlap <george.dunlap@citrix.com>
AuthorDate: Thu Jul 15 09:37:34 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:37:34 2021 +0200

    SUPPORT.md: Un-shimmed 32-bit PV guests are no longer supported
    
    The support status of 32-bit guests doesn't seem particularly useful.
    
    Reported-by: Jann Horn <jannh@google.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 1a0f2fe2297d122a08fee2b26de5de995fdeca13
    master date: 2021-06-04 17:24:05 +0100
---
 SUPPORT.md | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index b8fc04e934..3f4a01101e 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -82,14 +82,7 @@ No hardware requirements
 
     Status, x86_64: Supported
     Status, x86_32, shim: Supported
-    Status, x86_32, without shim: Supported, with caveats
-
-Due to architectural limitations,
-32-bit PV guests must be assumed to be able to read arbitrary host memory
-using speculative execution attacks.
-Advisories will continue to be issued
-for new vulnerabilities related to un-shimmed 32-bit PV guests
-enabling denial-of-service attacks or privilege escalation attacks.
+    Status, x86_32, without shim: Supported, not security supported
 
 ### x86/HVM
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:55:25 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:55:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156450.288715 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wDN-0003XB-Oe; Thu, 15 Jul 2021 07:55:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156450.288715; Thu, 15 Jul 2021 07:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wDN-0003X3-Kv; Thu, 15 Jul 2021 07:55:25 +0000
Received: by outflank-mailman (input) for mailman id 156450;
 Thu, 15 Jul 2021 07:55:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wDM-0003Wm-Oo
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:55:24 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wDM-0007Yr-Nv
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:55:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wDM-0004BZ-NM
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:55: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WlzUK9FxR6wMueUDfoBCuXLWOtyEdPcrmzcjI5atnAU=; b=2cbiZZAioPjZ2GYOFXGAFOZcIY
	iEMFVsU1ZTniC8yiNFU6Z/JhpZklxzZRlY9qijOFwNviVclPRN911fRIY1aW4GWtdULupHyy03xpn
	TkcCgSQqT5HImomfVsX0B1sL32H4GKAf4WBCauvV6jlzKrXzmV87+mvCpKTXRE2QkIc4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] credit2: make sure we pick a runnable unit from the runq if there is one
Message-Id: <E1m3wDM-0004BZ-NM@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:55:24 +0000

commit 5aacd077c40c14995850736be956e3094e55964b
Author:     Dario Faggioli <dfaggioli@suse.com>
AuthorDate: Thu Jul 15 09:38:47 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:38:47 2021 +0200

    credit2: make sure we pick a runnable unit from the runq if there is one
    
    A !runnable unit (temporarily) present in the runq may cause us to
    stop scanning the runq itself too early. Of course, we don't run any
    non-runnable vCPUs, but we end the scan and we fallback to picking
    the idle unit. In other word, this prevent us to find there and pick
    the actual unit that we're meant to start running (which might be
    further ahead in the runq).
    
    Depending on the vCPU pinning configuration, this may lead to such
    unit to be stuck in the runq for long time, causing malfunctioning
    inside the guest.
    
    Fix this by checking runnable/non-runnable status up-front, in the runq
    scanning function.
    
    Reported-by: Michał Leszczyński <michal.leszczynski@cert.pl>
    Reported-by: Dion Kant <g.w.kant@hunenet.nl>
    Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 07b0eb5d0ef0be154606aa46b5b4c5c59b158505
    master date: 2021-06-07 13:16:36 +0100
---
 xen/common/sched_credit2.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index ce7c56147b..fab6ac7aff 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -3368,6 +3368,10 @@ runq_candidate(struct csched2_runqueue_data *rqd,
                         (unsigned char *)&d);
         }
 
+        /* Skip non runnable units that we (temporarily) have in the runq */
+        if ( unlikely(!unit_runnable_state(svc->unit)) )
+            continue;
+
         /* Only consider vcpus that are allowed to run on this processor. */
         if ( !cpumask_test_cpu(cpu, svc->unit->cpu_hard_affinity) )
             continue;
@@ -3401,8 +3405,7 @@ runq_candidate(struct csched2_runqueue_data *rqd,
          * some budget, then choose it.
          */
         if ( (yield || svc->credit > snext->credit) &&
-             (!has_cap(svc) || unit_grab_budget(svc)) &&
-             unit_runnable_state(svc->unit) )
+             (!has_cap(svc) || unit_grab_budget(svc)) )
             snext = svc;
 
         /* In any case, if we got this far, break. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:55:36 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:55:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156451.288719 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wDY-0003bE-RT; Thu, 15 Jul 2021 07:55:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156451.288719; Thu, 15 Jul 2021 07:55:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wDY-0003b5-OD; Thu, 15 Jul 2021 07:55:36 +0000
Received: by outflank-mailman (input) for mailman id 156451;
 Thu, 15 Jul 2021 07:55:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wDW-0003al-SB
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:55:34 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wDW-0007Z3-R1
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:55:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wDW-0004CZ-QI
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:55: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aXH8xz+lRAl97FCmWmPBpiDAwdPB3VKMlY7IZqz6m04=; b=27tqkg40aOLnXLdhUE90bYMKCn
	Yeo++v3YUGEvs8MXG9kQNQ6xslz1Sre2PQX9CeWpQg1YpA0jwCTkZcZVpN8Nv4Gkvf3uuzGJKOol8
	qP26oVj31bPhgUa0z1z3pv3pKzFtYjku4IDFIO7k7AqUCIrZr5pVdvDfNurfAQTQOd4U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] xen: credit2: fix per-entity load tracking when continuing running
Message-Id: <E1m3wDW-0004CZ-QI@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:55:34 +0000

commit 2c9da5f73c3a2378036c982bf0b189b34befc403
Author:     Dario Faggioli <dfaggioli@suse.com>
AuthorDate: Thu Jul 15 09:39:32 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:39:32 2021 +0200

    xen: credit2: fix per-entity load tracking when continuing running
    
    If we schedule, and the current vCPU continues to run, its statistical
    load is not properly updated, resulting in something like this, even if
    all the 8 vCPUs are 100% busy:
    
    (XEN) Runqueue 0:
    (XEN) [...]
    (XEN)   aveload            = 2097152 (~800%)
    (XEN) [...]
    (XEN)   Domain: 0 w 256 c 0 v 8
    (XEN)     1: [0.0] flags=2 cpu=4 credit=9996885 [w=256] load=35 (~0%)
    (XEN)     2: [0.1] flags=2 cpu=2 credit=9993725 [w=256] load=796 (~0%)
    (XEN)     3: [0.2] flags=2 cpu=1 credit=9995885 [w=256] load=883 (~0%)
    (XEN)     4: [0.3] flags=2 cpu=5 credit=9998833 [w=256] load=487 (~0%)
    (XEN)     5: [0.4] flags=2 cpu=6 credit=9998942 [w=256] load=1595 (~0%)
    (XEN)     6: [0.5] flags=2 cpu=0 credit=9994669 [w=256] load=22 (~0%)
    (XEN)     7: [0.6] flags=2 cpu=7 credit=9997706 [w=256] load=0 (~0%)
    (XEN)     8: [0.7] flags=2 cpu=3 credit=9992440 [w=256] load=0 (~0%)
    
    As we can see, the average load of the runqueue as a whole is, instead,
    computed properly.
    
    This issue would, in theory, potentially affect Credit2 load balancing
    logic. In practice, however, the problem only manifests (at least with
    these characteristics) when there is only 1 runqueue active in the
    cpupool, which also means there is no need to do any load-balancing.
    
    Hence its real impact is pretty much limited to wrong per-vCPU load
    percentages, when looking at the output of the 'r' debug-key.
    
    With this patch, the load is updated and displayed correctly:
    
    (XEN) Runqueue 0:
    (XEN) [...]
    (XEN)   aveload            = 2097152 (~800%)
    (XEN) [...]
    (XEN) Domain info:
    (XEN)   Domain: 0 w 256 c 0 v 8
    (XEN)     1: [0.0] flags=2 cpu=4 credit=9995584 [w=256] load=262144 (~100%)
    (XEN)     2: [0.1] flags=2 cpu=6 credit=9992992 [w=256] load=262144 (~100%)
    (XEN)     3: [0.2] flags=2 cpu=3 credit=9998918 [w=256] load=262118 (~99%)
    (XEN)     4: [0.3] flags=2 cpu=5 credit=9996867 [w=256] load=262144 (~100%)
    (XEN)     5: [0.4] flags=2 cpu=1 credit=9998912 [w=256] load=262144 (~100%)
    (XEN)     6: [0.5] flags=2 cpu=2 credit=9997842 [w=256] load=262144 (~100%)
    (XEN)     7: [0.6] flags=2 cpu=7 credit=9994623 [w=256] load=262144 (~100%)
    (XEN)     8: [0.7] flags=2 cpu=0 credit=9991815 [w=256] load=262144 (~100%)
    
    Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 89052b9fa24bf976924e40918fc9fa3b1b940e17
    master date: 2021-06-07 13:17:06 +0100
---
 xen/common/sched_credit2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index fab6ac7aff..8ba741e379 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -3554,6 +3554,8 @@ static void csched2_schedule(
             runq_remove(snext);
             __set_bit(__CSFLAG_scheduled, &snext->flags);
         }
+        else
+            update_load(ops, rqd, snext, 0, now);
 
         /* Clear the idle mask if necessary */
         if ( cpumask_test_cpu(sched_cpu, &rqd->idle) )
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:55:46 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:55:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156452.288723 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wDi-0003eI-T8; Thu, 15 Jul 2021 07:55:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156452.288723; Thu, 15 Jul 2021 07:55:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wDi-0003eA-Pn; Thu, 15 Jul 2021 07:55:46 +0000
Received: by outflank-mailman (input) for mailman id 156452;
 Thu, 15 Jul 2021 07:55:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wDg-0003ds-VJ
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:55:44 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wDg-0007ZT-UU
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:55:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wDg-0004Dz-TQ
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:55: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ifCMGUPZmaF2lzYsh285NPCJKZRwC2gSdWqWNn/kqSk=; b=Ym+9LljduBu2cHufU7Nv4rFyYf
	1XhbARh0UP/MhiTa/nFWJ2oQDWEgYyhtdgO/txMr4X6WMyZxUlLDYJV+PYpJSP+oWF0Qhaeg+DZYL
	thPp0ar/gkQoe3E8eoGFCLrOVB37za6rbK1trBJEY8afHwQBPzKjZ7uat95pDxS8/t4U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/cpuid: Fix HLE and RTM handling (again)
Message-Id: <E1m3wDg-0004Dz-TQ@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:55:44 +0000

commit 9eece400c626655b826d5b1b4933e65af3073ab8
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jul 15 09:40:02 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:40:02 2021 +0200

    x86/cpuid: Fix HLE and RTM handling (again)
    
    For reasons which are my fault, but I don't recall why, the
    FDP_EXCP_ONLY/NO_FPU_SEL adjustment uses the whole special_features[] array
    element, not the two relevant bits.
    
    HLE and RTM were recently added to the list of special features, causing them
    to be always set in guest view, irrespective of the toolstacks choice on the
    matter.
    
    Rewrite the logic to refer to the features specifically, rather than relying
    on the contents of the special_features[] array.
    
    Fixes: 8fe24090d9 ("x86/cpuid: Rework HLE and RTM handling")
    Reported-by: Edwin Török <edvin.torok@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 60fa12dbf1d4d2c4ffe1ef34b495b24aa7e41aa0
    master date: 2021-06-07 15:43:35 +0100
---
 xen/arch/x86/cpuid.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c
index 27132f91a6..18bb0faf34 100644
--- a/xen/arch/x86/cpuid.c
+++ b/xen/arch/x86/cpuid.c
@@ -563,9 +563,11 @@ void recalculate_cpuid_policy(struct domain *d)
     sanitise_featureset(fs);
 
     /* Fold host's FDP_EXCP_ONLY and NO_FPU_SEL into guest's view. */
-    fs[FEATURESET_7b0] &= ~special_features[FEATURESET_7b0];
+    fs[FEATURESET_7b0] &= ~(cpufeat_mask(X86_FEATURE_FDP_EXCP_ONLY) |
+                            cpufeat_mask(X86_FEATURE_NO_FPU_SEL));
     fs[FEATURESET_7b0] |= (host_cpuid_policy.feat._7b0 &
-                           special_features[FEATURESET_7b0]);
+                           (cpufeat_mask(X86_FEATURE_FDP_EXCP_ONLY) |
+                            cpufeat_mask(X86_FEATURE_NO_FPU_SEL)));
 
     cpuid_featureset_to_policy(fs, p);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:55:56 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:55:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156453.288727 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wDs-0003ha-UM; Thu, 15 Jul 2021 07:55:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156453.288727; Thu, 15 Jul 2021 07:55:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wDs-0003hS-RU; Thu, 15 Jul 2021 07:55:56 +0000
Received: by outflank-mailman (input) for mailman id 156453;
 Thu, 15 Jul 2021 07:55:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wDr-0003gz-20
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:55:55 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wDr-0007Zj-1I
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:55:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wDr-0004FJ-0T
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4xTqp+sK7ErNqFQfl0XVzyzFTZzljbww/mn2kdWHdvw=; b=sdS8hOPPu09VEnUSj2hEdtPVpD
	Tm84cOrRzoDD6VPQLTyOZAvHCtYlE1yi9wSo8fNfy1l5jD3ao71+En7ch7zKe4CZk2ZYRK1wZDAW5
	prIaa1nF1fiT9JByqdjx/zEOjs/OgKoXGX74alSOuT4qOWk4rQx+QRZ4QriM1tQOP5UY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/vpt: fully init timers before putting onto list
Message-Id: <E1m3wDr-0004FJ-0T@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:55:55 +0000

commit 84bc28f8fa4b9c18107f8704257bab34190998b3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:40:29 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:40:29 2021 +0200

    x86/vpt: fully init timers before putting onto list
    
    With pt_vcpu_lock() no longer acquiring the pt_migrate lock, parties
    iterating the list and acting on the timers of the list entries will no
    longer be kept from entering their loops by create_periodic_time()'s
    holding of that lock. Therefore at least init_timer() needs calling
    ahead of list insertion, but keep this and set_timer() together.
    
    Fixes: 8113b02f0bf8 ("x86/vpt: do not take pt_migrate rwlock in some cases")
    Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    master commit: 6d622f3a96bbd76ce8422c6e3805e6609417ec76
    master date: 2021-06-15 15:14:20 +0200
---
 xen/arch/x86/hvm/vpt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index a644e3ce53..af92dfbae2 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -553,14 +553,14 @@ void create_periodic_time(
     pt->cb = cb;
     pt->priv = data;
 
+    init_timer(&pt->timer, pt_timer_fn, pt, v->processor);
+    set_timer(&pt->timer, pt->scheduled);
+
     pt_vcpu_lock(v);
     pt->on_list = 1;
     list_add(&pt->list, &v->arch.hvm.tm_list);
     pt_vcpu_unlock(v);
 
-    init_timer(&pt->timer, pt_timer_fn, pt, v->processor);
-    set_timer(&pt->timer, pt->scheduled);
-
     write_unlock(&v->domain->arch.hvm.pl_time->pt_migrate);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:56:07 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:56:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156454.288731 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wE2-0003kH-Vx; Thu, 15 Jul 2021 07:56:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156454.288731; Thu, 15 Jul 2021 07:56:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wE2-0003k9-T6; Thu, 15 Jul 2021 07:56:06 +0000
Received: by outflank-mailman (input) for mailman id 156454;
 Thu, 15 Jul 2021 07:56:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wE1-0003jw-58
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:56:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wE1-0007a6-4I
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:56:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wE1-0004IR-3Q
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MjUtcgfg2y9NnuOWnUiEpft9q7G2qa5StTfLBWvqqCA=; b=NSFEK68rVJBD7MQ+sbOGF8a0LA
	MtT7hNB6MMwHqWORfIyKYp7+D0uihFJREcd29MJDlieU5XakDCBDqMNcx0IDUJylaGHw3dwxUjJpU
	e+mZJwvWwb5EOOEw9+feZlFAJUtU+wRWkgi0UdcIJ7SPdXmH9P5t2xu+zWklbIndY2O8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] libs/foreignmemory: Fix osdep_xenforeignmemory_map prototype
Message-Id: <E1m3wE1-0004IR-3Q@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:56:05 +0000

commit 235bfe81f8ced3bba8d74adef02ac92e8d031a55
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Jul 15 09:40:57 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:40:57 2021 +0200

    libs/foreignmemory: Fix osdep_xenforeignmemory_map prototype
    
    Commit cf8c4d3d13b8 made some preparation to have one day
    variable-length-array argument, but didn't declare the array in the
    function prototype the same way as in the function definition. And now
    GCC 11 complains about it.
    
    Fixes: cf8c4d3d13b8 ("tools/libs/foreignmemory: pull array length argument to map forward")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 5d3e4ebb5c71477d74a0c503438545a0126d3863
    master date: 2021-06-15 18:07:58 +0100
---
 tools/libs/foreignmemory/private.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/foreignmemory/private.h b/tools/libs/foreignmemory/private.h
index 8f1bf081ed..e7b2cfa28a 100644
--- a/tools/libs/foreignmemory/private.h
+++ b/tools/libs/foreignmemory/private.h
@@ -32,7 +32,7 @@ int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem);
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, void *addr,
                                  int prot, int flags, size_t num,
-                                 const xen_pfn_t arr[num], int err[num]);
+                                 const xen_pfn_t arr[/*num*/], int err[/*num*/]);
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:56:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:56:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156455.288735 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wED-0003pj-1c; Thu, 15 Jul 2021 07:56:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156455.288735; Thu, 15 Jul 2021 07:56:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wEC-0003pY-UW; Thu, 15 Jul 2021 07:56:16 +0000
Received: by outflank-mailman (input) for mailman id 156455;
 Thu, 15 Jul 2021 07:56:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wEB-0003pE-88
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:56:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wEB-0007aI-7M
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:56:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wEB-0004Jf-6e
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Yu/MhDluSvxkjyT3IwOYsAcHLprJDcyDvGi8OYHCMUs=; b=0NNjIGGI4pFcMAic4Uej62WFF7
	gu1bIGrXvuMYdkpsskIuXZxNjYKOQC0hbvZhM3Q1TDivfMxv96yNyC++pLLZz9BAhVTfvUGAvKFnt
	k3SaQ6pzxDRfbjz57QpUDWXQrMOJIA4tXxgBwJQn8T0qVFTRomblBGENkkNlLFGvP62E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] VT-d: undo device mappings upon error
Message-Id: <E1m3wEB-0004Jf-6e@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:56:15 +0000

commit e39050c566f4b2cdca2354dc8de27d6dc58e703d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:41:48 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:41:48 2021 +0200

    VT-d: undo device mappings upon error
    
    When
     - flushes (supposedly not possible anymore after XSA-373),
     - secondary mappings for legacy PCI devices behind bridges,
     - secondary mappings for chipset quirks, or
     - find_upstream_bridge() invocations
    fail, the successfully established device mappings should not be left
    around.
    
    Further, when (parts of) unmapping fail, simply returning an error is
    typically not enough. Crash the domain instead in such cases, arranging
    for domain cleanup to continue in a best effort manner despite such
    failures.
    
    Finally make domain_context_unmap()'s error behavior consistent in the
    legacy PCI device case: Don't bail from the function in one special
    case, but always just exit the switch statement.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: f3401d65d9f0dce508c3d7da55de4a093d748ae1
    master date: 2021-06-24 16:28:25 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 57 +++++++++++++++++++++++++++++++------
 1 file changed, 48 insertions(+), 9 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index dfd867d40b..77aaef596a 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1463,9 +1463,15 @@ int domain_context_mapping_one(
     if ( !seg && !rc )
         rc = me_wifi_quirk(domain, bus, devfn, MAP_ME_PHANTOM_FUNC);
 
+    if ( rc )
+        domain_context_unmap_one(domain, iommu, bus, devfn);
+
     return rc;
 }
 
+static int domain_context_unmap(struct domain *d, uint8_t devfn,
+                                struct pci_dev *pdev);
+
 static int domain_context_mapping(struct domain *domain, u8 devfn,
                                   struct pci_dev *pdev)
 {
@@ -1529,16 +1535,21 @@ static int domain_context_mapping(struct domain *domain, u8 devfn,
         if ( ret )
             break;
 
-        if ( find_upstream_bridge(seg, &bus, &devfn, &secbus) < 1 )
-            break;
+        if ( (ret = find_upstream_bridge(seg, &bus, &devfn, &secbus)) < 1 )
+        {
+            if ( !ret )
+                break;
+            ret = -ENXIO;
+        }
 
         /*
          * Mapping a bridge should, if anything, pass the struct pci_dev of
          * that bridge. Since bridges don't normally get assigned to guests,
          * their owner would be the wrong one. Pass NULL instead.
          */
-        ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
-                                         NULL);
+        if ( ret >= 0 )
+            ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
+                                             NULL);
 
         /*
          * Devices behind PCIe-to-PCI/PCIx bridge may generate different
@@ -1555,6 +1566,9 @@ static int domain_context_mapping(struct domain *domain, u8 devfn,
             ret = domain_context_mapping_one(domain, drhd->iommu, secbus, 0,
                                              NULL);
 
+        if ( ret )
+            domain_context_unmap(domain, devfn, pdev);
+
         break;
 
     default:
@@ -1634,6 +1648,19 @@ int domain_context_unmap_one(
     if ( !iommu->drhd->segment && !rc )
         rc = me_wifi_quirk(domain, bus, devfn, UNMAP_ME_PHANTOM_FUNC);
 
+    if ( rc && !is_hardware_domain(domain) && domain != dom_io )
+    {
+        if ( domain->is_dying )
+        {
+            printk(XENLOG_ERR "%pd: error %d unmapping %04x:%02x:%02x.%u\n",
+                   domain, rc, iommu->drhd->segment, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
+            rc = 0; /* Make upper layers continue in a best effort manner. */
+        }
+        else
+            domain_crash(domain);
+    }
+
     return rc;
 }
 
@@ -1688,17 +1715,29 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
 
         tmp_bus = bus;
         tmp_devfn = devfn;
-        if ( find_upstream_bridge(seg, &tmp_bus, &tmp_devfn, &secbus) < 1 )
+        if ( (ret = find_upstream_bridge(seg, &tmp_bus, &tmp_devfn,
+                                         &secbus)) < 1 )
+        {
+            if ( ret )
+            {
+                ret = -ENXIO;
+                if ( !domain->is_dying &&
+                     !is_hardware_domain(domain) && domain != dom_io )
+                {
+                    domain_crash(domain);
+                    /* Make upper layers continue in a best effort manner. */
+                    ret = 0;
+                }
+            }
             break;
+        }
 
         /* PCIe to PCI/PCIx bridge */
         if ( pdev_type(seg, tmp_bus, tmp_devfn) == DEV_TYPE_PCIe2PCI_BRIDGE )
         {
             ret = domain_context_unmap_one(domain, iommu, tmp_bus, tmp_devfn);
-            if ( ret )
-                return ret;
-
-            ret = domain_context_unmap_one(domain, iommu, secbus, 0);
+            if ( !ret )
+                ret = domain_context_unmap_one(domain, iommu, secbus, 0);
         }
         else /* Legacy PCI bridge */
             ret = domain_context_unmap_one(domain, iommu, tmp_bus, tmp_devfn);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:56:27 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:56:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156456.288741 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wEN-0003ti-4Z; Thu, 15 Jul 2021 07:56:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156456.288741; Thu, 15 Jul 2021 07:56:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wEN-0003tY-03; Thu, 15 Jul 2021 07:56:27 +0000
Received: by outflank-mailman (input) for mailman id 156456;
 Thu, 15 Jul 2021 07:56:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wEL-0003tN-BG
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:56:25 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wEL-0007aT-AQ
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:56:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wEL-0004MK-9e
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gPMdD6UgdqWSagscGq5MjfSbjWFXpMtXnlGyYoHtpdg=; b=FY4psNTqKACbCqL2y07mzVsVZt
	pF85w9LTkV1tRlavWFqvkQmaQ8d/m0S7FqISDD2DuewkxZa2vrA6J1QJn5vLf8f5FsCupsA1cAb+P
	ys5N7wJxTXpWsseRqi9t4wMNZm9aqqQYq/Czu69giknt6SC6Pt1Lp2qWd/hXOqdn/PYo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] VT-d: adjust domid map updating when unmapping context
Message-Id: <E1m3wEL-0004MK-9e@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:56:25 +0000

commit ddb3edbc9f063a2b798393ca52c236686a11cce6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:42:18 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:42:18 2021 +0200

    VT-d: adjust domid map updating when unmapping context
    
    When an earlier error occurred, cleaning up the domid mapping data is
    wrong, as references likely still exist. The only exception to this is
    when the actual unmapping worked, but some flush failed (supposedly
    impossible after XSA-373). The guest will get crashed in such a case
    though, so add fallback cleanup to domain destruction to cover this
    case. This in turn makes it desirable to silence the dprintk() in
    domain_iommu_domid().
    
    Note that no error will be returned anymore when the lookup fails - in
    the common case lookup failure would already have caused
    domain_context_unmap_one() to fail, yet even from a more general
    perspective it doesn't look right to fail domain_context_unmap() in such
    a case when this was the last device, but not when any earlier unmap was
    otherwise successful.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 32655880057ce2829f962d46916ea6cec60f98d3
    master date: 2021-06-24 16:29:13 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 39 +++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 15 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 77aaef596a..0ee18bdcc3 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -73,9 +73,11 @@ static int domain_iommu_domid(struct domain *d,
         i = find_next_bit(iommu->domid_bitmap, nr_dom, i+1);
     }
 
-    dprintk(XENLOG_ERR VTDPREFIX,
-            "Cannot get valid iommu domid: domid=%d iommu->index=%d\n",
-            d->domain_id, iommu->index);
+    if ( !d->is_dying )
+        dprintk(XENLOG_ERR VTDPREFIX,
+                "Cannot get valid iommu %u domid: %pd\n",
+                iommu->index, d);
+
     return -1;
 }
 
@@ -140,6 +142,17 @@ static int context_get_domain_id(struct context_entry *context,
     return domid;
 }
 
+static void cleanup_domid_map(struct domain *domain, struct vtd_iommu *iommu)
+{
+    int iommu_domid = domain_iommu_domid(domain, iommu);
+
+    if ( iommu_domid >= 0 )
+    {
+        clear_bit(iommu_domid, iommu->domid_bitmap);
+        iommu->domid_map[iommu_domid] = 0;
+    }
+}
+
 static int iommus_incoherent;
 
 static void sync_cache(const void *addr, unsigned int size)
@@ -1752,6 +1765,9 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
         goto out;
     }
 
+    if ( ret )
+        goto out;
+
     /*
      * if no other devices under the same iommu owned by this domain,
      * clear iommu in iommu_bitmap and clear domain_id in domid_bitmp
@@ -1771,19 +1787,8 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
 
     if ( found == 0 )
     {
-        int iommu_domid;
-
         clear_bit(iommu->index, &dom_iommu(domain)->arch.iommu_bitmap);
-
-        iommu_domid = domain_iommu_domid(domain, iommu);
-        if ( iommu_domid == -1 )
-        {
-            ret = -EINVAL;
-            goto out;
-        }
-
-        clear_bit(iommu_domid, iommu->domid_bitmap);
-        iommu->domid_map[iommu_domid] = 0;
+        cleanup_domid_map(domain, iommu);
     }
 
 out:
@@ -1794,6 +1799,7 @@ static void iommu_domain_teardown(struct domain *d)
 {
     struct domain_iommu *hd = dom_iommu(d);
     struct mapped_rmrr *mrmrr, *tmp;
+    const struct acpi_drhd_unit *drhd;
 
     if ( list_empty(&acpi_drhd_units) )
         return;
@@ -1813,6 +1819,9 @@ static void iommu_domain_teardown(struct domain *d)
     iommu_free_pagetable(hd->arch.pgd_maddr, agaw_to_level(hd->arch.agaw));
     hd->arch.pgd_maddr = 0;
     spin_unlock(&hd->arch.mapping_lock);
+
+    for_each_drhd_unit ( drhd )
+        cleanup_domid_map(d, drhd->iommu);
 }
 
 static int __must_check intel_iommu_map_page(struct domain *d, dfn_t dfn,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:56:37 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:56:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156457.288743 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wEX-0003xa-6b; Thu, 15 Jul 2021 07:56:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156457.288743; Thu, 15 Jul 2021 07:56:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wEX-0003xS-3B; Thu, 15 Jul 2021 07:56:37 +0000
Received: by outflank-mailman (input) for mailman id 156457;
 Thu, 15 Jul 2021 07:56:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wEV-0003xC-ED
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:56:35 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wEV-0007ai-DT
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:56:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wEV-0004NW-Cg
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dFzuwwOaQEjXBmNvP21l45GgeKDCFgOX5byVp8Z/qxU=; b=KwSOUE0y0iyhaWwg0ne3UaoCPV
	93FbmIHyKJys3+ejWbMl8JrsSrR+5hjTsGJueJms6SJ7Bufg1JxtHjYRHC1fBy1ztIVFlefDauOCU
	esLM5ZxJtf8oFQnKVZ3hmHGgDQeFBnapZVO50LLAx1dmNj61kyHeAL/jFZYkSS/F0h2A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] VT-d: clear_fault_bits() should clear all fault bits
Message-Id: <E1m3wEV-0004NW-Cg@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:56:35 +0000

commit 7907ab8a4f63d7f1d20ede8c91125976496f4f92
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:42:47 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:42:47 2021 +0200

    VT-d: clear_fault_bits() should clear all fault bits
    
    If there is any way for one fault to be left set in the recording
    registers, there's no reason there couldn't also be multiple ones. If
    PPF set set (being the OR or all F fields), simply loop over the entire
    range of fault recording registers, clearing F everywhere.
    
    Since PPF is a r/o bit, also remove it from DMA_FSTS_FAULTS (arguably
    the constant's name is ambiguous as well).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 80589800ae62fce43fd3921e8fbd362465fe5ba3
    master date: 2021-06-24 16:29:42 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 16 +++++++++++++---
 xen/drivers/passthrough/vtd/iommu.h |  3 ++-
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 0ee18bdcc3..2804d0b1b7 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2119,13 +2119,23 @@ static int __hwdom_init setup_hwdom_device(u8 devfn, struct pci_dev *pdev)
 
 void clear_fault_bits(struct vtd_iommu *iommu)
 {
-    u64 val;
     unsigned long flags;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
-    val = dmar_readq(iommu->reg, cap_fault_reg_offset(iommu->cap) + 8);
-    dmar_writeq(iommu->reg, cap_fault_reg_offset(iommu->cap) + 8, val);
+
+    if ( dmar_readl(iommu->reg, DMAR_FSTS_REG) & DMA_FSTS_PPF )
+    {
+        unsigned int reg = cap_fault_reg_offset(iommu->cap);
+        unsigned int end = reg + cap_num_fault_regs(iommu->cap);
+
+        do {
+           dmar_writel(iommu->reg, reg + 12, DMA_FRCD_F);
+           reg += PRIMARY_FAULT_REG_LEN;
+        } while ( reg < end );
+    }
+
     dmar_writel(iommu->reg, DMAR_FSTS_REG, DMA_FSTS_FAULTS);
+
     spin_unlock_irqrestore(&iommu->register_lock, flags);
 }
 
diff --git a/xen/drivers/passthrough/vtd/iommu.h b/xen/drivers/passthrough/vtd/iommu.h
index e002dc6f01..32b39c606a 100644
--- a/xen/drivers/passthrough/vtd/iommu.h
+++ b/xen/drivers/passthrough/vtd/iommu.h
@@ -174,7 +174,8 @@
 #define DMA_FSTS_IQE ((u64)1 << 4)
 #define DMA_FSTS_ICE ((u64)1 << 5)
 #define DMA_FSTS_ITE ((u64)1 << 6)
-#define DMA_FSTS_FAULTS    DMA_FSTS_PFO | DMA_FSTS_PPF | DMA_FSTS_AFO | DMA_FSTS_APF | DMA_FSTS_IQE | DMA_FSTS_ICE | DMA_FSTS_ITE
+#define DMA_FSTS_FAULTS (DMA_FSTS_PFO | DMA_FSTS_AFO | DMA_FSTS_APF | \
+                         DMA_FSTS_IQE | DMA_FSTS_ICE | DMA_FSTS_ITE)
 #define dma_fsts_fault_record_index(s) (((s) >> 8) & 0xff)
 
 /* FRCD_REG, 32 bits access */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:56:47 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:56:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156458.288747 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wEh-000407-7u; Thu, 15 Jul 2021 07:56:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156458.288747; Thu, 15 Jul 2021 07:56:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wEh-0003zz-4n; Thu, 15 Jul 2021 07:56:47 +0000
Received: by outflank-mailman (input) for mailman id 156458;
 Thu, 15 Jul 2021 07:56:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wEf-0003zj-Gx
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:56:45 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wEf-0007bD-GB
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:56:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wEf-0004PP-Fe
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rICsWhilKyMeUeW5f4iEZ0GJG1SR7aKY4zKSBymGjtQ=; b=zvTlch3T8oaFMeUm15pdDL/PLr
	9ZVhT3obcsspqlJdoh2gFDvdeTYGmv3e3+GuSV73SwwJ3bi/HhZ69ox0nrr7jkfw++AUc2g+o5AQn
	+Ip3Y7kj6Yw3DDfnuWZEllEL1BHYE4Il3jGn6DbJnM4j+FTdw2VyCZLyT+Lr5cxDFJ6U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] VT-d: don't lose errors when flushing TLBs on multiple IOMMUs
Message-Id: <E1m3wEf-0004PP-Fe@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:56:45 +0000

commit 3f3ebda3ccbea1e8a5663693247017015fc79b68
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:43:11 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:43:11 2021 +0200

    VT-d: don't lose errors when flushing TLBs on multiple IOMMUs
    
    While no longer an immediate problem with flushes no longer timing out,
    errors (if any) get properly reported by iommu_flush_iotlb_{dsi,psi}().
    Overwriting such an error with, perhaps, a success indicator received
    from another IOMMU will misguide callers. Record the first error, but
    don't bail from the loop (such that further necessary invalidation gets
    carried out on a best effort basis).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: e7059776f9755b989a992d229c68c3d7778412be
    master date: 2021-06-24 16:30:06 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 2804d0b1b7..38719cf8ec 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -590,7 +590,7 @@ static int __must_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
     struct vtd_iommu *iommu;
     bool_t flush_dev_iotlb;
     int iommu_domid;
-    int rc = 0;
+    int ret = 0;
 
     /*
      * No need pcideves_lock here because we have flush
@@ -598,6 +598,8 @@ static int __must_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
      */
     for_each_drhd_unit ( drhd )
     {
+        int rc;
+
         iommu = drhd->iommu;
 
         if ( !test_bit(iommu->index, &hd->arch.iommu_bitmap) )
@@ -620,13 +622,12 @@ static int __must_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
                                        flush_dev_iotlb);
 
         if ( rc > 0 )
-        {
             iommu_flush_write_buffer(iommu);
-            rc = 0;
-        }
+        else if ( !ret )
+            ret = rc;
     }
 
-    return rc;
+    return ret;
 }
 
 static int __must_check iommu_flush_iotlb_pages(struct domain *d,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:56:57 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:56:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156459.288751 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wEr-00043V-9O; Thu, 15 Jul 2021 07:56:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156459.288751; Thu, 15 Jul 2021 07:56:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wEr-00043N-6K; Thu, 15 Jul 2021 07:56:57 +0000
Received: by outflank-mailman (input) for mailman id 156459;
 Thu, 15 Jul 2021 07:56:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wEp-00043A-Jy
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:56:55 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wEp-0007bR-J3
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:56:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wEp-0004QP-IK
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4mxYu+jmloOz721PYw4CmydRMdELyvzrHqKF2cU7aCQ=; b=CfDTKKeVwqhf3s+0XFYSU1DXMQ
	FnEaSNk1Mi7LCGTit4D50Y9K4l4vL3WPCfnoQcjacDfYYf3ZznZqrAujefQH5m5r0GkN47nMfGKTq
	Tl/4mKZefBDJZfkl9ETGFHoLpY49JYKN75nGQzfhUJeQnZGdplN8nTD1Fndnf40h+fjw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] IOMMU/PCI: don't let domain cleanup continue when device de-assignment failed
Message-Id: <E1m3wEp-0004QP-IK@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:56:55 +0000

commit 351c890c4ade59b52dd4822a2d5176fe435d21ed
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:43:38 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:43:38 2021 +0200

    IOMMU/PCI: don't let domain cleanup continue when device de-assignment failed
    
    Failure here could in principle mean the device may still be issuing DMA
    requests, which would continue to be translated by the page tables the
    device entry currently points at. With this we cannot allow the
    subsequent cleanup step of freeing the page tables to occur, to prevent
    use-after-free issues. We would need to accept, for the time being, that
    in such a case the remaining domain resources will all be leaked, and
    the domain will continue to exist as a zombie.
    
    However, with flushes no longer timing out (and with proper timeout
    detection for device I/O TLB flushing yet to be implemented), there's no
    way anymore for failures to occur, except due to bugs elsewhere. Hence
    the change here is merely a "just in case" one.
    
    In order to continue the loop in spite of an error, we can't use
    pci_get_pdev_by_domain() anymore. I have no idea why it was used here in
    the first place, instead of the cheaper list iteration.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: f591755823a7e94fc6b4b8ddce71f0421a94fa09
    master date: 2021-06-25 14:06:55 +0200
---
 xen/drivers/passthrough/pci.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 4385a6760b..32510351cf 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -968,7 +968,7 @@ static int deassign_device(struct domain *d, uint16_t seg, uint8_t bus,
 
 int pci_release_devices(struct domain *d)
 {
-    struct pci_dev *pdev;
+    struct pci_dev *pdev, *tmp;
     u8 bus, devfn;
     int ret;
 
@@ -979,18 +979,15 @@ int pci_release_devices(struct domain *d)
         pcidevs_unlock();
         return ret;
     }
-    while ( (pdev = pci_get_pdev_by_domain(d, -1, -1, -1)) )
+    list_for_each_entry_safe ( pdev, tmp, &d->pdev_list, domain_list )
     {
         bus = pdev->bus;
         devfn = pdev->devfn;
-        if ( deassign_device(d, pdev->seg, bus, devfn) )
-            printk("domain %d: deassign device (%04x:%02x:%02x.%u) failed!\n",
-                   d->domain_id, pdev->seg, bus,
-                   PCI_SLOT(devfn), PCI_FUNC(devfn));
+        ret = deassign_device(d, pdev->seg, bus, devfn) ?: ret;
     }
     pcidevs_unlock();
 
-    return 0;
+    return ret;
 }
 
 #define PCI_CLASS_BRIDGE_HOST    0x0600
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 07:57:06 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 07:57:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156460.288756 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wF0-00046U-B2; Thu, 15 Jul 2021 07:57:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156460.288756; Thu, 15 Jul 2021 07:57:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3wF0-00046L-7l; Thu, 15 Jul 2021 07:57:06 +0000
Received: by outflank-mailman (input) for mailman id 156460;
 Thu, 15 Jul 2021 07:57:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wEz-00046F-Ml
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:57:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wEz-0007bo-Lx
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 07:57:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3wEz-0004T8-LE
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5hbQe6EDV+U5Vm9y4WAkvTKNUyGgLLJ5ZxWCuaX483M=; b=Wrj+z4NcSuwGBmg4+HNMYeIyms
	CPn5KFI5UZx7AuLmCqmZTZ9zdLvEjHbM1tF6AlfzRvrUKzUtLArVGVdCklPJ8sU+jHxMhKZUsv4Wq
	ZlHqw3vRCYpbQdMhTn8D0BflAQuSwSZ7i6kw8JkkO+N/XQ01T2dSsZ98VULxFX7441gc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/mem-sharing: ensure consistent lock order in get_two_gfns()
Message-Id: <E1m3wEz-0004T8-LE@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 07:57:05 +0000

commit 1540a9a20dd0c049345a00bfed0a3e8ea98d104b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:44:20 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:44:20 2021 +0200

    x86/mem-sharing: ensure consistent lock order in get_two_gfns()
    
    While the comment validly says "Sort by domain, if same domain by gfn",
    the implementation also included equal domain IDs in the first part of
    the check, thus rending the second part entirely dead and leaving
    deadlock potential when there's only a single domain involved.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
    master commit: 09af2d01a2fe6a0af08598bdfe12c9707f4d82ba
    master date: 2021-07-07 12:35:12 +0200
---
 xen/include/asm-x86/p2m.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 94285db1b4..2358954039 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -556,7 +556,7 @@ do {                                                    \
     dest ## _t   = (source ## t)   ?: &scratch_t;       \
 } while (0)
 
-    if ( (rd->domain_id <= ld->domain_id) ||
+    if ( (rd->domain_id < ld->domain_id) ||
          ((rd == ld) && (gfn_x(rgfn) <= gfn_x(lgfn))) )
     {
         assign_pointers(first, r);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 11:33:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 11:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156556.288932 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3zc1-0003Il-LN; Thu, 15 Jul 2021 11:33:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156556.288932; Thu, 15 Jul 2021 11:33:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3zc1-0003Id-Ie; Thu, 15 Jul 2021 11:33:05 +0000
Received: by outflank-mailman (input) for mailman id 156556;
 Thu, 15 Jul 2021 11:33:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zc0-0003IX-D0
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 11:33:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zc0-0003PK-As
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 11:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zc0-0000Vt-9s
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LRWgx+ogzYwcPeUCfrhkUNlh44qYh4ragbAr46fHpCQ=; b=hsDPv8MLi41tfmTa5/5GF06nMM
	TX1e/XiG4uu7Z54ipClIaizhySQs2/E0ny/GjiIWDyvUvWwCY2yRen94ypCQffqlzyfp2xS4/6x2T
	w0la8h4w/IOkMmrvBVnjbGAgCZaIpMKvE22Z/NxsqNPswQWQXWNXYLyFb6rHvBW0n7wA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] tools: use integer division in convert-legacy-stream
Message-Id: <E1m3zc0-0000Vt-9s@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 11:33:04 +0000

commit e9709a83490f5d6fa7247087ec1084c381cfe956
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:55:59 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 15 11:55:50 2021 +0100

    tools: use integer division in convert-legacy-stream
    
    A single slash gives a float, a double slash gives an int.
    
        bitmap = unpack_exact("Q" * ((max_id/64) + 1))
    TypeError: can't multiply sequence by non-int of type 'float'
    
    Use future division to remain compatible with python 2.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 74d044d51b19bb697eac5c3deafa140f6afafec8)
---
 tools/python/scripts/convert-legacy-stream | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/python/scripts/convert-legacy-stream b/tools/python/scripts/convert-legacy-stream
index ca93a93848..66ee3d2f5d 100755
--- a/tools/python/scripts/convert-legacy-stream
+++ b/tools/python/scripts/convert-legacy-stream
@@ -6,6 +6,7 @@ Convert a legacy migration stream to a v2 stream.
 """
 
 from __future__ import print_function
+from __future__ import division
 
 import sys
 import os, os.path
@@ -163,7 +164,7 @@ def write_libxc_hvm_params(params):
         raise RuntimeError("Expected even length list of hvm parameters")
 
     write_record(libxc.REC_TYPE_hvm_params,
-                 pack(libxc.HVM_PARAMS_FORMAT, len(params) / 2, 0),
+                 pack(libxc.HVM_PARAMS_FORMAT, len(params) // 2, 0),
                  pack("Q" * len(params), *params))
 
 def write_libxc_static_data_end():
@@ -264,8 +265,8 @@ def read_pv_extended_info(vm):
                           (so_far - total_length, ))
 
 def read_pv_p2m_frames(vm):
-    fpp = 4096 / vm.width
-    p2m_frame_len = (vm.p2m_size - 1) / fpp + 1
+    fpp = 4096 // vm.width
+    p2m_frame_len = (vm.p2m_size - 1) // fpp + 1
 
     info("P2M frames: fpp %d, p2m_frame_len %d" % (fpp, p2m_frame_len))
     write_libxc_pv_p2m_frames(vm, unpack_ulongs(p2m_frame_len))
@@ -405,7 +406,7 @@ def read_chunks(vm):
                                   (max_id, legacy.MAX_VCPU_ID))
 
             vm.max_vcpu_id = max_id
-            bitmap = unpack_exact("Q" * ((max_id/64) + 1))
+            bitmap = unpack_exact("Q" * ((max_id // 64) + 1))
 
             for idx, word in enumerate(bitmap):
                 bit_idx = 0
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 11:33:15 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 11:33:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156557.288936 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3zcB-0003M5-NJ; Thu, 15 Jul 2021 11:33:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156557.288936; Thu, 15 Jul 2021 11:33:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3zcB-0003Lx-K5; Thu, 15 Jul 2021 11:33:15 +0000
Received: by outflank-mailman (input) for mailman id 156557;
 Thu, 15 Jul 2021 11:33:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zcA-0003Ll-Ey
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 11:33:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zcA-0003Qv-E5
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 11:33:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zcA-0000X7-D1
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=42ZfmjN/5sFbSz2NRqqGoQR2er48M0CK+o5zfEzdanY=; b=kknMk0lk0l3qmdkLkYw4wWyXRa
	+8qa15Q3aK0Zww7x2Q8fr8ScUFFyB19Oq23SpsuP/FyLPbvYodotqQ/J9z2PDQyas1XldFrkU1b0s
	N/AKx1YZmkhhcvtQyaBVEkxDk0xHU8SGGCtlHFI3ckvf6OC6fOTTz52pE5vWWA+7Jyng=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] tools/python: handle libxl__physmap_info.name properly in convert-legacy-stream
Message-Id: <E1m3zcA-0000X7-D1@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 11:33:14 +0000

commit 67f798942caffc3c399c8b6ab609fed7e3f529db
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:56:00 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 15 11:55:50 2021 +0100

    tools/python: handle libxl__physmap_info.name properly in convert-legacy-stream
    
    The trailing member name[] in libxl__physmap_info is written as a
    cstring into the stream. The current code does a sanity check if the
    last byte is zero. This attempt fails with python3 because name[-1]
    returns a type int. As a result the comparison with byte(\00) fails:
    
      File "/usr/lib/xen/bin/convert-legacy-stream", line 347, in read_libxl_toolstack
        raise StreamError("physmap name not NUL terminated")
      StreamError: physmap name not NUL terminated
    
    To handle both python variants, cast to bytearray().
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    (cherry picked from commit c8f88810db2a25d6aacf65c1c60bc4f5d848a483)
---
 tools/python/scripts/convert-legacy-stream | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/python/scripts/convert-legacy-stream b/tools/python/scripts/convert-legacy-stream
index 66ee3d2f5d..227e1b5c3f 100755
--- a/tools/python/scripts/convert-legacy-stream
+++ b/tools/python/scripts/convert-legacy-stream
@@ -343,7 +343,7 @@ def read_libxl_toolstack(vm, data):
         if twidth == 64:
             name = name[:-4]
 
-        if name[-1] != b'\x00':
+        if bytearray(name)[-1] != 0:
             raise StreamError("physmap name not NUL terminated")
 
         root = b"physmap/%x" % (phys, )
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 11:33:25 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 11:33:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156558.288940 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3zcL-0003OT-Oi; Thu, 15 Jul 2021 11:33:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156558.288940; Thu, 15 Jul 2021 11:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3zcL-0003OM-Lb; Thu, 15 Jul 2021 11:33:25 +0000
Received: by outflank-mailman (input) for mailman id 156558;
 Thu, 15 Jul 2021 11:33:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zcK-0003OB-Ip
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 11:33:24 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zcK-0003RB-Hz
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 11:33:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zcK-0000Yr-GC
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kVfdVPHTtuMgM6UDFSPy1RirliaXEzS+eazElmFARog=; b=l8vILLH5F0+MXpKWIRjBz6PjlC
	JgENkCKwikKbzMHTdTr5yonVr0JLuT6/ql9U/6K+DP9J8ADSCT8hX6YuCTY7I56gC9m2VUC33/a59
	Slm6BnW4/Dp3Af5aoZUOyqVMUd+DU0T1UAeeioO0fMgxw2eOhEsu0wrlRcvFsLY8J5QA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] tools/python: fix Python3.4 TypeError in format string
Message-Id: <E1m3zcK-0000Yr-GC@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 11:33:24 +0000

commit 41f0903e16326e4aef52347e46de2e3f71bb6022
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:56:01 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 15 11:55:50 2021 +0100

    tools/python: fix Python3.4 TypeError in format string
    
    Using the first element of a tuple for a format specifier fails with
    python3.4 as included in SLE12:
        b = b"string/%x" % (i, )
    TypeError: unsupported operand type(s) for %: 'bytes' and 'tuple'
    
    It happens to work with python 2.7 and 3.6.
    To support older Py3, format as strings and explicitly encode as ASCII.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    (cherry picked from commit a27976a1080d537fb1f212a8f9133d60daa0025b)
---
 tools/python/scripts/convert-legacy-stream | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/python/scripts/convert-legacy-stream b/tools/python/scripts/convert-legacy-stream
index 227e1b5c3f..7fe375a668 100755
--- a/tools/python/scripts/convert-legacy-stream
+++ b/tools/python/scripts/convert-legacy-stream
@@ -346,9 +346,9 @@ def read_libxl_toolstack(vm, data):
         if bytearray(name)[-1] != 0:
             raise StreamError("physmap name not NUL terminated")
 
-        root = b"physmap/%x" % (phys, )
-        kv = [root + b"/start_addr", b"%x" % (start, ),
-              root + b"/size",       b"%x" % (size, ),
+        root = ("physmap/%x" % (phys, )).encode('ascii')
+        kv = [root + b"/start_addr", ("%x" % (start, )).encode('ascii'),
+              root + b"/size",       ("%x" % (size, )).encode('ascii'),
               root + b"/name",       name[:-1]]
 
         for key, val in zip(kv[0::2], kv[1::2]):
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 11:33:35 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 11:33:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156559.288944 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3zcV-0003Se-Rx; Thu, 15 Jul 2021 11:33:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156559.288944; Thu, 15 Jul 2021 11:33:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3zcV-0003SW-Oz; Thu, 15 Jul 2021 11:33:35 +0000
Received: by outflank-mailman (input) for mailman id 156559;
 Thu, 15 Jul 2021 11:33:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zcU-0003SK-Lk
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 11:33:34 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zcU-0003RO-Kx
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 11:33:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zcU-0000aG-KC
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cQ48QFYZdS4yZZB2+TzK/C3+zrHlT3JBPPJvW2PVyfQ=; b=SxT1qSX5+wCWBr5Y5EDo5OOTH3
	YXPG2gaGfQ/lNuDHfVWYgIQn/RfSBz7wgOg+KI+42WBJL1CUUQ7GVtbOfdAAygbBgkX6/GhRlKQab
	7o7r1iyDSyy1Q2MusaAwGPi21Z2Su4tpDk8E/CD622wQFZ3sU2M96p24c9JZU7m6B0Vw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] tools/libxenstat: fix populating vbd.rd_sect
Message-Id: <E1m3zcU-0000aG-KC@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 11:33:34 +0000

commit 429b0a5c62b9e9faf96456aefb5a176b6eb02921
Author:     Richard Kojedzinszky <richard@kojedz.in>
AuthorDate: Fri Jul 9 10:06:45 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 15 11:55:50 2021 +0100

    tools/libxenstat: fix populating vbd.rd_sect
    
    Fixes: 91c3e3dc91d6 ("tools/xentop: Display '-' when stats are not available.")
    Signed-off-by: Richard Kojedzinszky <richard@kojedz.in>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 89d57f291e37b4769ab26db919eba46548f2e13e)
---
 tools/libs/stat/xenstat_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/stat/xenstat_linux.c b/tools/libs/stat/xenstat_linux.c
index c00b26d4d8..1745be4285 100644
--- a/tools/libs/stat/xenstat_linux.c
+++ b/tools/libs/stat/xenstat_linux.c
@@ -475,7 +475,7 @@ int xenstat_collect_vbds(xenstat_node * node)
 				(read_attributes_vbd(dp->d_name, "statistics/wr_req", buf, 256)<=0) ||
 				((ret = sscanf(buf, "%llu", &vbd.wr_reqs)) != 1) ||
 				(read_attributes_vbd(dp->d_name, "statistics/rd_sect", buf, 256)<=0) ||
-				((ret = sscanf(buf, "%llu", &vbd.wr_sects)) != 1) ||
+				((ret = sscanf(buf, "%llu", &vbd.rd_sects)) != 1) ||
 				(read_attributes_vbd(dp->d_name, "statistics/wr_sect", buf, 256)<=0) ||
 				((ret = sscanf(buf, "%llu", &vbd.wr_sects)) != 1))
 			{
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 11:33:46 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 11:33:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156560.288948 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3zcg-0003WS-TU; Thu, 15 Jul 2021 11:33:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156560.288948; Thu, 15 Jul 2021 11:33:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3zcg-0003WK-Qh; Thu, 15 Jul 2021 11:33:46 +0000
Received: by outflank-mailman (input) for mailman id 156560;
 Thu, 15 Jul 2021 11:33:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zcf-0003W2-34
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 11:33:45 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zcf-0003Rq-2K
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 11:33:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zcf-0000c8-1T
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DwfHSdZTYoLZ1Vcbg/5rL5NHHbIPfNvkfry7DdZDkQg=; b=pMa+PHJfS23z/AqBd8w+ebKUCt
	Ae6p2OBuO+2OvPNAPVySxeftgpz9xg6Nc4IC+dBB0c94SfJr65D7F7Rh5wbH7cd6bBRDOSaMzIo1U
	vVN703ICLQyoeZz36++F85mcqZM7SMN1V9/i7V2m+YWASF3XJWIT9AOTwQYfEmoaTxLE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] tools: use integer division in convert-legacy-stream
Message-Id: <E1m3zcf-0000c8-1T@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 11:33:45 +0000

commit 23d5e3d42cbf1673aa8c9c2d9601009e24077afc
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:55:59 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 15 11:59:32 2021 +0100

    tools: use integer division in convert-legacy-stream
    
    A single slash gives a float, a double slash gives an int.
    
        bitmap = unpack_exact("Q" * ((max_id/64) + 1))
    TypeError: can't multiply sequence by non-int of type 'float'
    
    Use future division to remain compatible with python 2.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 74d044d51b19bb697eac5c3deafa140f6afafec8)
---
 tools/python/scripts/convert-legacy-stream | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/python/scripts/convert-legacy-stream b/tools/python/scripts/convert-legacy-stream
index ca93a93848..66ee3d2f5d 100755
--- a/tools/python/scripts/convert-legacy-stream
+++ b/tools/python/scripts/convert-legacy-stream
@@ -6,6 +6,7 @@ Convert a legacy migration stream to a v2 stream.
 """
 
 from __future__ import print_function
+from __future__ import division
 
 import sys
 import os, os.path
@@ -163,7 +164,7 @@ def write_libxc_hvm_params(params):
         raise RuntimeError("Expected even length list of hvm parameters")
 
     write_record(libxc.REC_TYPE_hvm_params,
-                 pack(libxc.HVM_PARAMS_FORMAT, len(params) / 2, 0),
+                 pack(libxc.HVM_PARAMS_FORMAT, len(params) // 2, 0),
                  pack("Q" * len(params), *params))
 
 def write_libxc_static_data_end():
@@ -264,8 +265,8 @@ def read_pv_extended_info(vm):
                           (so_far - total_length, ))
 
 def read_pv_p2m_frames(vm):
-    fpp = 4096 / vm.width
-    p2m_frame_len = (vm.p2m_size - 1) / fpp + 1
+    fpp = 4096 // vm.width
+    p2m_frame_len = (vm.p2m_size - 1) // fpp + 1
 
     info("P2M frames: fpp %d, p2m_frame_len %d" % (fpp, p2m_frame_len))
     write_libxc_pv_p2m_frames(vm, unpack_ulongs(p2m_frame_len))
@@ -405,7 +406,7 @@ def read_chunks(vm):
                                   (max_id, legacy.MAX_VCPU_ID))
 
             vm.max_vcpu_id = max_id
-            bitmap = unpack_exact("Q" * ((max_id/64) + 1))
+            bitmap = unpack_exact("Q" * ((max_id // 64) + 1))
 
             for idx, word in enumerate(bitmap):
                 bit_idx = 0
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 11:33:56 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 11:33:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156561.288952 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3zcq-0003ZF-VB; Thu, 15 Jul 2021 11:33:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156561.288952; Thu, 15 Jul 2021 11:33:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3zcq-0003Z7-SA; Thu, 15 Jul 2021 11:33:56 +0000
Received: by outflank-mailman (input) for mailman id 156561;
 Thu, 15 Jul 2021 11:33:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zcp-0003Yv-6D
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 11:33:55 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zcp-0003S1-5L
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 11:33:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zcp-0000dQ-4R
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1G5fRq1uSpVtjoQhTSvQLcauuIn8KP1FMGgwpdMbH0Q=; b=XVbvXsX53/XIq5QQj8GivJx5zb
	vpMhe8EJCf21jtwaipqpCBe3eg6m10SnhZb+n33a4u7pB9P5F7RxS85T9+mxVFLN90CUWWDmVFE8o
	nJSeRk0YgikSM/xYnr7B5vse1MFyt2+ckYT1jpYJEnGybSGIP1YjD7Rvq+srAWjCmH20=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] tools/python: handle libxl__physmap_info.name properly in convert-legacy-stream
Message-Id: <E1m3zcp-0000dQ-4R@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 11:33:55 +0000

commit f6aec84fe7076d03ac8509de97275e9ef3da37cd
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:56:00 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 15 11:59:32 2021 +0100

    tools/python: handle libxl__physmap_info.name properly in convert-legacy-stream
    
    The trailing member name[] in libxl__physmap_info is written as a
    cstring into the stream. The current code does a sanity check if the
    last byte is zero. This attempt fails with python3 because name[-1]
    returns a type int. As a result the comparison with byte(\00) fails:
    
      File "/usr/lib/xen/bin/convert-legacy-stream", line 347, in read_libxl_toolstack
        raise StreamError("physmap name not NUL terminated")
      StreamError: physmap name not NUL terminated
    
    To handle both python variants, cast to bytearray().
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    (cherry picked from commit c8f88810db2a25d6aacf65c1c60bc4f5d848a483)
---
 tools/python/scripts/convert-legacy-stream | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/python/scripts/convert-legacy-stream b/tools/python/scripts/convert-legacy-stream
index 66ee3d2f5d..227e1b5c3f 100755
--- a/tools/python/scripts/convert-legacy-stream
+++ b/tools/python/scripts/convert-legacy-stream
@@ -343,7 +343,7 @@ def read_libxl_toolstack(vm, data):
         if twidth == 64:
             name = name[:-4]
 
-        if name[-1] != b'\x00':
+        if bytearray(name)[-1] != 0:
             raise StreamError("physmap name not NUL terminated")
 
         root = b"physmap/%x" % (phys, )
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 11:34:07 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 11:34:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156562.288956 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3zd1-0003cF-0T; Thu, 15 Jul 2021 11:34:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156562.288956; Thu, 15 Jul 2021 11:34:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3zd0-0003c7-Tn; Thu, 15 Jul 2021 11:34:06 +0000
Received: by outflank-mailman (input) for mailman id 156562;
 Thu, 15 Jul 2021 11:34:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zcz-0003bm-92
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 11:34:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zcz-0003SP-8I
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 11:34:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zcz-0000ee-7U
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4vWRSSfnbyOTHKnaglWjU8fCud8lXiT4CHPVA/USy00=; b=B/unYQmVs+mYqo6e8ofiBZx77Y
	2kE0jirjcaVa4g1wMmO+f85w0Mn7xgvdkibSUzHIGfJRvrTIS4cFEAPtBKDoyFgy+Tl1reWG7KDk2
	oHA8EGODdEZqoRbCOKqofu/zxbidHHRL+WT62ZQQAUFnSceCaaDvee0dH3ePADl62U/I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] tools/python: fix Python3.4 TypeError in format string
Message-Id: <E1m3zcz-0000ee-7U@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 11:34:05 +0000

commit bb9377a20559de07e1dbe91399902c70cfafccea
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:56:01 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 15 11:59:32 2021 +0100

    tools/python: fix Python3.4 TypeError in format string
    
    Using the first element of a tuple for a format specifier fails with
    python3.4 as included in SLE12:
        b = b"string/%x" % (i, )
    TypeError: unsupported operand type(s) for %: 'bytes' and 'tuple'
    
    It happens to work with python 2.7 and 3.6.
    To support older Py3, format as strings and explicitly encode as ASCII.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    (cherry picked from commit a27976a1080d537fb1f212a8f9133d60daa0025b)
---
 tools/python/scripts/convert-legacy-stream | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/python/scripts/convert-legacy-stream b/tools/python/scripts/convert-legacy-stream
index 227e1b5c3f..7fe375a668 100755
--- a/tools/python/scripts/convert-legacy-stream
+++ b/tools/python/scripts/convert-legacy-stream
@@ -346,9 +346,9 @@ def read_libxl_toolstack(vm, data):
         if bytearray(name)[-1] != 0:
             raise StreamError("physmap name not NUL terminated")
 
-        root = b"physmap/%x" % (phys, )
-        kv = [root + b"/start_addr", b"%x" % (start, ),
-              root + b"/size",       b"%x" % (size, ),
+        root = ("physmap/%x" % (phys, )).encode('ascii')
+        kv = [root + b"/start_addr", ("%x" % (start, )).encode('ascii'),
+              root + b"/size",       ("%x" % (size, )).encode('ascii'),
               root + b"/name",       name[:-1]]
 
         for key, val in zip(kv[0::2], kv[1::2]):
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 11:34:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 11:34:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156563.288960 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3zdB-0003f2-1z; Thu, 15 Jul 2021 11:34:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156563.288960; Thu, 15 Jul 2021 11:34:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3zdA-0003eu-VH; Thu, 15 Jul 2021 11:34:16 +0000
Received: by outflank-mailman (input) for mailman id 156563;
 Thu, 15 Jul 2021 11:34:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zd9-0003ec-Bs
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 11:34:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zd9-0003Sb-B9
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 11:34:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zd9-0000gE-AN
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/TdMgYRTSMDZHLQRkyBR8wDYo0JxeNEy8dl4Cujh/wM=; b=Kt8cr4dYVI6+6C1PVTJoSVttYQ
	6HVWd+oLwZCefCfpdP3BEkyZmyZAlPFWY49VYBOzROY92pST4+L96837s3+m3S4xWUtLyGcMPha8N
	qJ4f8aqJI6R65mqJ4NtCN6uaXDLtuMKGVRknIWTDFkwmpF8wxiIJk2WVAMDaIb/ogn6k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] tools/libxenstat: fix populating vbd.rd_sect
Message-Id: <E1m3zd9-0000gE-AN@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 11:34:15 +0000

commit c3cc6e206ff79c6117b841891d832694597bd5af
Author:     Richard Kojedzinszky <richard@kojedz.in>
AuthorDate: Fri Jul 9 10:06:45 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 15 11:59:32 2021 +0100

    tools/libxenstat: fix populating vbd.rd_sect
    
    Fixes: 91c3e3dc91d6 ("tools/xentop: Display '-' when stats are not available.")
    Signed-off-by: Richard Kojedzinszky <richard@kojedz.in>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 89d57f291e37b4769ab26db919eba46548f2e13e)
---
 tools/xenstat/libxenstat/src/xenstat_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xenstat/libxenstat/src/xenstat_linux.c b/tools/xenstat/libxenstat/src/xenstat_linux.c
index 9c0cb277c5..ed7a02ab52 100644
--- a/tools/xenstat/libxenstat/src/xenstat_linux.c
+++ b/tools/xenstat/libxenstat/src/xenstat_linux.c
@@ -474,7 +474,7 @@ int xenstat_collect_vbds(xenstat_node * node)
 				(read_attributes_vbd(dp->d_name, "statistics/wr_req", buf, 256)<=0) ||
 				((ret = sscanf(buf, "%llu", &vbd.wr_reqs)) != 1) ||
 				(read_attributes_vbd(dp->d_name, "statistics/rd_sect", buf, 256)<=0) ||
-				((ret = sscanf(buf, "%llu", &vbd.wr_sects)) != 1) ||
+				((ret = sscanf(buf, "%llu", &vbd.rd_sects)) != 1) ||
 				(read_attributes_vbd(dp->d_name, "statistics/wr_sect", buf, 256)<=0) ||
 				((ret = sscanf(buf, "%llu", &vbd.wr_sects)) != 1))
 			{
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 11:34:27 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 11:34:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156564.288964 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3zdL-0003iB-3O; Thu, 15 Jul 2021 11:34:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156564.288964; Thu, 15 Jul 2021 11:34:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m3zdL-0003i3-0W; Thu, 15 Jul 2021 11:34:27 +0000
Received: by outflank-mailman (input) for mailman id 156564;
 Thu, 15 Jul 2021 11:34:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zdJ-0003hp-K2
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 11:34:25 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zdJ-0003Sm-JI
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 11:34:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m3zdJ-0000i1-IZ
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fyDx3y56Xd0o2BoU4Nr8GTGoRefibGcNeryvGBkeu4Q=; b=IZdmvaY2HIQqkiQMoakGFU1XqL
	HY7xtdM+bEbFBEsq6slxkqOtiyk4FT3mBlq1FHdNdky4JgcHX5KHKC3Da9IId+uUn5WTwgyhy0GFp
	/rAAa2nZyvI46kTNyseZTudcUuPxgFGxzjlLZkXg8HmuTnxBvNRYVZG9Q5lYrX474ywY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] tools/libxenstat: fix populating vbd.rd_sect
Message-Id: <E1m3zdJ-0000i1-IZ@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 11:34:25 +0000

commit a7de7608da1e4d29607b4a36a15eaa58b0e451fc
Author:     Richard Kojedzinszky <richard@kojedz.in>
AuthorDate: Fri Jul 9 10:06:45 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 15 12:03:48 2021 +0100

    tools/libxenstat: fix populating vbd.rd_sect
    
    Fixes: 91c3e3dc91d6 ("tools/xentop: Display '-' when stats are not available.")
    Signed-off-by: Richard Kojedzinszky <richard@kojedz.in>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 89d57f291e37b4769ab26db919eba46548f2e13e)
---
 tools/xenstat/libxenstat/src/xenstat_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xenstat/libxenstat/src/xenstat_linux.c b/tools/xenstat/libxenstat/src/xenstat_linux.c
index 9c0cb277c5..ed7a02ab52 100644
--- a/tools/xenstat/libxenstat/src/xenstat_linux.c
+++ b/tools/xenstat/libxenstat/src/xenstat_linux.c
@@ -474,7 +474,7 @@ int xenstat_collect_vbds(xenstat_node * node)
 				(read_attributes_vbd(dp->d_name, "statistics/wr_req", buf, 256)<=0) ||
 				((ret = sscanf(buf, "%llu", &vbd.wr_reqs)) != 1) ||
 				(read_attributes_vbd(dp->d_name, "statistics/rd_sect", buf, 256)<=0) ||
-				((ret = sscanf(buf, "%llu", &vbd.wr_sects)) != 1) ||
+				((ret = sscanf(buf, "%llu", &vbd.rd_sects)) != 1) ||
 				(read_attributes_vbd(dp->d_name, "statistics/wr_sect", buf, 256)<=0) ||
 				((ret = sscanf(buf, "%llu", &vbd.wr_sects)) != 1))
 			{
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 20:55:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 20:55:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156936.289556 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48Nr-0004QV-OU; Thu, 15 Jul 2021 20:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156936.289556; Thu, 15 Jul 2021 20:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48Nr-0004QN-LJ; Thu, 15 Jul 2021 20:55:03 +0000
Received: by outflank-mailman (input) for mailman id 156936;
 Thu, 15 Jul 2021 20:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48Nq-0004QG-Bf
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48Nq-0005Dq-89
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48Nq-0001QB-70
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:55: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/ppQYJ/WDOxX+TCM6vVws0dbqicPtlb0PK1qKX9aVdg=; b=Mm2aSG1zBvzrnBFKjCIUmLXMSW
	hzC1lIFUu9C5TJJbQ5Dvmqc+/WiBiydPg5j5l9vSMEL8a8FYM8wHCAFCzB0rCVi9n4hrHEBTscilm
	0hj57natPMeGVF9e0EU0DAeaVbdukritRk233Zvi/ZBYrUPsFYFbqc15Q3zBYk6LkUdM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] SUPPORT.md: Un-shimmed 32-bit PV guests are no longer supported
Message-Id: <E1m48Nq-0001QB-70@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 20:55:02 +0000

commit c6ee6d4ec3c87d67e8fee58e28459c22c44b384b
Author:     George Dunlap <george.dunlap@citrix.com>
AuthorDate: Thu Jul 15 09:28:59 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:28:59 2021 +0200

    SUPPORT.md: Un-shimmed 32-bit PV guests are no longer supported
    
    The support status of 32-bit guests doesn't seem particularly useful.
    
    With it changed to fully unsupported outside of PV-shim, adjust the PV32
    Kconfig default accordingly.
    
    Reported-by: Jann Horn <jannh@google.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1a0f2fe2297d122a08fee2b26de5de995fdeca13
    master date: 2021-06-04 17:24:05 +0100
---
 SUPPORT.md           | 9 +--------
 xen/arch/x86/Kconfig | 7 +++++--
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index cd786ac0c1..c45390a245 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -82,14 +82,7 @@ No hardware requirements
 
     Status, x86_64: Supported
     Status, x86_32, shim: Supported
-    Status, x86_32, without shim: Supported, with caveats
-
-Due to architectural limitations,
-32-bit PV guests must be assumed to be able to read arbitrary host memory
-using speculative execution attacks.
-Advisories will continue to be issued
-for new vulnerabilities related to un-shimmed 32-bit PV guests
-enabling denial-of-service attacks or privilege escalation attacks.
+    Status, x86_32, without shim: Supported, not security supported
 
 ### x86/HVM
 
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index a636a4bb1e..8af5d6be80 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -56,7 +56,7 @@ config PV
 config PV32
 	bool "Support for 32bit PV guests"
 	depends on PV
-	default y
+	default PV_SHIM
 	---help---
 	  The 32bit PV ABI uses Ring1, an area of the x86 architecture which
 	  was deprecated and mostly removed in the AMD64 spec.  As a result,
@@ -67,7 +67,10 @@ config PV32
 	  reduction, or performance reasons.  Backwards compatibility can be
 	  provided via the PV Shim mechanism.
 
-	  If unsure, say Y.
+	  Note that outside of PV Shim, 32-bit PV guests are not security
+	  supported anymore.
+
+	  If unsure, use the default setting.
 
 config PV_LINEAR_PT
        bool "Support for PV linear pagetables"
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 20:55:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 20:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156937.289560 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48O1-0004SZ-Pk; Thu, 15 Jul 2021 20:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156937.289560; Thu, 15 Jul 2021 20:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48O1-0004SR-Mv; Thu, 15 Jul 2021 20:55:13 +0000
Received: by outflank-mailman (input) for mailman id 156937;
 Thu, 15 Jul 2021 20:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48O0-0004SG-CD
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48O0-0005Du-BS
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48O0-0001RM-AW
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:55: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dAOdpIknDOmRviSeieBCvw2ZnA+sv1z/9/wAxP9LE8s=; b=tFfstAxhWdxDk1GmN64aLMl5Fl
	r74ha2G3bX87dfqQQiB7sSQBgky92Fh/yE7QznLI71IEk3z23Y2MEMq7zMRzFAFSYiJL71WMAYmyb
	1Iq/hgD1YV+uk99NNCiUyo9nr3BcziYQRrwg9A+lR2N7/hVvmA71cNfG1Tumi94MC2Mw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] credit2: make sure we pick a runnable unit from the runq if there is one
Message-Id: <E1m48O0-0001RM-AW@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 20:55:12 +0000

commit ecd6b1770ff7a3e7b9f13013fc661790b553a743
Author:     Dario Faggioli <dfaggioli@suse.com>
AuthorDate: Thu Jul 15 09:29:34 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:29:34 2021 +0200

    credit2: make sure we pick a runnable unit from the runq if there is one
    
    A !runnable unit (temporarily) present in the runq may cause us to
    stop scanning the runq itself too early. Of course, we don't run any
    non-runnable vCPUs, but we end the scan and we fallback to picking
    the idle unit. In other word, this prevent us to find there and pick
    the actual unit that we're meant to start running (which might be
    further ahead in the runq).
    
    Depending on the vCPU pinning configuration, this may lead to such
    unit to be stuck in the runq for long time, causing malfunctioning
    inside the guest.
    
    Fix this by checking runnable/non-runnable status up-front, in the runq
    scanning function.
    
    Reported-by: Michał Leszczyński <michal.leszczynski@cert.pl>
    Reported-by: Dion Kant <g.w.kant@hunenet.nl>
    Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 07b0eb5d0ef0be154606aa46b5b4c5c59b158505
    master date: 2021-06-07 13:16:36 +0100
---
 xen/common/sched/credit2.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index eb5e5a78c5..f5c1e5b944 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -3463,6 +3463,10 @@ runq_candidate(struct csched2_runqueue_data *rqd,
                         (unsigned char *)&d);
         }
 
+        /* Skip non runnable units that we (temporarily) have in the runq */
+        if ( unlikely(!unit_runnable_state(svc->unit)) )
+            continue;
+
         /* Only consider vcpus that are allowed to run on this processor. */
         if ( !cpumask_test_cpu(cpu, svc->unit->cpu_hard_affinity) )
             continue;
@@ -3496,8 +3500,7 @@ runq_candidate(struct csched2_runqueue_data *rqd,
          * some budget, then choose it.
          */
         if ( (yield || svc->credit > snext->credit) &&
-             (!has_cap(svc) || unit_grab_budget(svc)) &&
-             unit_runnable_state(svc->unit) )
+             (!has_cap(svc) || unit_grab_budget(svc)) )
             snext = svc;
 
         /* In any case, if we got this far, break. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 20:55:23 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 20:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156938.289563 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48OB-0004VX-RO; Thu, 15 Jul 2021 20:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156938.289563; Thu, 15 Jul 2021 20:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48OB-0004VP-OT; Thu, 15 Jul 2021 20:55:23 +0000
Received: by outflank-mailman (input) for mailman id 156938;
 Thu, 15 Jul 2021 20:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48OA-0004V4-Fa
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48OA-0005E7-Er
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48OA-0001SG-Dl
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:55: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=elPHMIOeC7HJzhMH3WCd6El+G8lfyBmIMHZCLhVYJ9Q=; b=xBpZH6P09wThDWt2uv8Xu5NDCC
	2HZMyqx+Mp/a92rxCMEkJNLEEha7yjXdi1RN7TBeaFmwX/drIDdAf9RAFgygONp5ATZXgwld70rk/
	obvu6Gj8xRLZrqZ4D2W8SJzzAyirXKnqYJxSswuDSjNL9PhezIBzbmb+d/F79wTJxoz4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] xen: credit2: fix per-entity load tracking when continuing running
Message-Id: <E1m48OA-0001SG-Dl@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 20:55:22 +0000

commit 665024b4f40d5e18359afd72fc5cbd3a8cd3d0b0
Author:     Dario Faggioli <dfaggioli@suse.com>
AuthorDate: Thu Jul 15 09:30:18 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:30:18 2021 +0200

    xen: credit2: fix per-entity load tracking when continuing running
    
    If we schedule, and the current vCPU continues to run, its statistical
    load is not properly updated, resulting in something like this, even if
    all the 8 vCPUs are 100% busy:
    
    (XEN) Runqueue 0:
    (XEN) [...]
    (XEN)   aveload            = 2097152 (~800%)
    (XEN) [...]
    (XEN)   Domain: 0 w 256 c 0 v 8
    (XEN)     1: [0.0] flags=2 cpu=4 credit=9996885 [w=256] load=35 (~0%)
    (XEN)     2: [0.1] flags=2 cpu=2 credit=9993725 [w=256] load=796 (~0%)
    (XEN)     3: [0.2] flags=2 cpu=1 credit=9995885 [w=256] load=883 (~0%)
    (XEN)     4: [0.3] flags=2 cpu=5 credit=9998833 [w=256] load=487 (~0%)
    (XEN)     5: [0.4] flags=2 cpu=6 credit=9998942 [w=256] load=1595 (~0%)
    (XEN)     6: [0.5] flags=2 cpu=0 credit=9994669 [w=256] load=22 (~0%)
    (XEN)     7: [0.6] flags=2 cpu=7 credit=9997706 [w=256] load=0 (~0%)
    (XEN)     8: [0.7] flags=2 cpu=3 credit=9992440 [w=256] load=0 (~0%)
    
    As we can see, the average load of the runqueue as a whole is, instead,
    computed properly.
    
    This issue would, in theory, potentially affect Credit2 load balancing
    logic. In practice, however, the problem only manifests (at least with
    these characteristics) when there is only 1 runqueue active in the
    cpupool, which also means there is no need to do any load-balancing.
    
    Hence its real impact is pretty much limited to wrong per-vCPU load
    percentages, when looking at the output of the 'r' debug-key.
    
    With this patch, the load is updated and displayed correctly:
    
    (XEN) Runqueue 0:
    (XEN) [...]
    (XEN)   aveload            = 2097152 (~800%)
    (XEN) [...]
    (XEN) Domain info:
    (XEN)   Domain: 0 w 256 c 0 v 8
    (XEN)     1: [0.0] flags=2 cpu=4 credit=9995584 [w=256] load=262144 (~100%)
    (XEN)     2: [0.1] flags=2 cpu=6 credit=9992992 [w=256] load=262144 (~100%)
    (XEN)     3: [0.2] flags=2 cpu=3 credit=9998918 [w=256] load=262118 (~99%)
    (XEN)     4: [0.3] flags=2 cpu=5 credit=9996867 [w=256] load=262144 (~100%)
    (XEN)     5: [0.4] flags=2 cpu=1 credit=9998912 [w=256] load=262144 (~100%)
    (XEN)     6: [0.5] flags=2 cpu=2 credit=9997842 [w=256] load=262144 (~100%)
    (XEN)     7: [0.6] flags=2 cpu=7 credit=9994623 [w=256] load=262144 (~100%)
    (XEN)     8: [0.7] flags=2 cpu=0 credit=9991815 [w=256] load=262144 (~100%)
    
    Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 89052b9fa24bf976924e40918fc9fa3b1b940e17
    master date: 2021-06-07 13:17:06 +0100
---
 xen/common/sched/credit2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index f5c1e5b944..ebb09ea43a 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -3649,6 +3649,8 @@ static void csched2_schedule(
             runq_remove(snext);
             __set_bit(__CSFLAG_scheduled, &snext->flags);
         }
+        else
+            update_load(ops, rqd, snext, 0, now);
 
         /* Clear the idle mask if necessary */
         if ( cpumask_test_cpu(sched_cpu, &rqd->idle) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 20:55:33 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 20:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156939.289568 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48OL-0004Yb-Sz; Thu, 15 Jul 2021 20:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156939.289568; Thu, 15 Jul 2021 20:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48OL-0004YT-Q4; Thu, 15 Jul 2021 20:55:33 +0000
Received: by outflank-mailman (input) for mailman id 156939;
 Thu, 15 Jul 2021 20:55:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48OK-0004YC-Ik
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:55:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48OK-0005EH-Hx
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48OK-0001T8-Gy
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:55: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8LwLHUae8VpYzBmCdSYwfpIjpXR9NPxTtgmUB9XtOlo=; b=Y9ZZHn9IGsAvitLg6fVVXINp2D
	yua4lH6v/ff32FUjimjAXuy5IT4Wujj/k68Q47jVcP3WiskUh/G71EDU837uredKsKyUJlUokyawl
	ycfVGA/laPotr9cDNrEGXy2sKeSUcwHEY2jGnHhW0PdukkAv+6aSKesgkugGKuqrENno=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/vpt: fully init timers before putting onto list
Message-Id: <E1m48OK-0001T8-Gy@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 20:55:32 +0000

commit 3ae25fc2b03cc583754098aaf80773a6e51832da
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:30:47 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:30:47 2021 +0200

    x86/vpt: fully init timers before putting onto list
    
    With pt_vcpu_lock() no longer acquiring the pt_migrate lock, parties
    iterating the list and acting on the timers of the list entries will no
    longer be kept from entering their loops by create_periodic_time()'s
    holding of that lock. Therefore at least init_timer() needs calling
    ahead of list insertion, but keep this and set_timer() together.
    
    Fixes: 8113b02f0bf8 ("x86/vpt: do not take pt_migrate rwlock in some cases")
    Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    master commit: 6d622f3a96bbd76ce8422c6e3805e6609417ec76
    master date: 2021-06-15 15:14:20 +0200
---
 xen/arch/x86/hvm/vpt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index 6a5458c8b7..efb5d53626 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -554,14 +554,14 @@ void create_periodic_time(
     pt->cb = cb;
     pt->priv = data;
 
+    init_timer(&pt->timer, pt_timer_fn, pt, v->processor);
+    set_timer(&pt->timer, pt->scheduled);
+
     pt_vcpu_lock(v);
     pt->on_list = 1;
     list_add(&pt->list, &v->arch.hvm.tm_list);
     pt_vcpu_unlock(v);
 
-    init_timer(&pt->timer, pt_timer_fn, pt, v->processor);
-    set_timer(&pt->timer, pt->scheduled);
-
     write_unlock(&v->domain->arch.hvm.pl_time->pt_migrate);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 20:55:43 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 20:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156940.289572 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48OV-0004cA-Up; Thu, 15 Jul 2021 20:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156940.289572; Thu, 15 Jul 2021 20:55:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48OV-0004c3-Ri; Thu, 15 Jul 2021 20:55:43 +0000
Received: by outflank-mailman (input) for mailman id 156940;
 Thu, 15 Jul 2021 20:55:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48OU-0004bb-Ln
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:55:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48OU-0005Ea-L3
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48OU-0001U5-K5
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:55: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Rlh1MD+NVX8RQ++B6gohHB3EVfVqDqU867+gBSflqfg=; b=lOzEj4MeOha5nWcUq+HbhBp3Gj
	vSUw6FFWY9YHKc5CcN0rqbjND0FuniVVc+AQiztNfxGQLvv7e5QGHFXYkbXeYLD9CYHHmvKjZ6sUx
	3irhSnqRgSjtmbOJrWwtBhDm2mtmOWUAVV4AfNshMBDGQgfGUNJun7piw4zWSqNoHicE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] libs/foreignmemory: Fix osdep_xenforeignmemory_map prototype
Message-Id: <E1m48OU-0001U5-K5@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 20:55:42 +0000

commit 64d93d6d414c8cb8d88afd08c544773f1c13d9aa
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Jul 15 09:31:12 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:31:12 2021 +0200

    libs/foreignmemory: Fix osdep_xenforeignmemory_map prototype
    
    Commit cf8c4d3d13b8 made some preparation to have one day
    variable-length-array argument, but didn't declare the array in the
    function prototype the same way as in the function definition. And now
    GCC 11 complains about it.
    
    Fixes: cf8c4d3d13b8 ("tools/libs/foreignmemory: pull array length argument to map forward")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 5d3e4ebb5c71477d74a0c503438545a0126d3863
    master date: 2021-06-15 18:07:58 +0100
---
 tools/libs/foreignmemory/private.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/foreignmemory/private.h b/tools/libs/foreignmemory/private.h
index 8f1bf081ed..e7b2cfa28a 100644
--- a/tools/libs/foreignmemory/private.h
+++ b/tools/libs/foreignmemory/private.h
@@ -32,7 +32,7 @@ int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem);
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, void *addr,
                                  int prot, int flags, size_t num,
-                                 const xen_pfn_t arr[num], int err[num]);
+                                 const xen_pfn_t arr[/*num*/], int err[/*num*/]);
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 20:55:54 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 20:55:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156941.289576 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48Og-0004w4-06; Thu, 15 Jul 2021 20:55:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156941.289576; Thu, 15 Jul 2021 20:55:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48Of-0004vw-TH; Thu, 15 Jul 2021 20:55:53 +0000
Received: by outflank-mailman (input) for mailman id 156941;
 Thu, 15 Jul 2021 20:55:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48Oe-0004vn-P5
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:55:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48Oe-0005F4-OH
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48Oe-0001V0-NJ
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:55: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/JYpA8ngqE2mFxtT6517BBAflmdzwzOL01qc/Ip5Im0=; b=eXpYvcZ5xq5iMXGepOx7j/e36A
	8M5oPFwKWEyT0JVZlgkCfDBKKFp5M8UG+8rG+h9QdoXdpJj53XFgy9m4BKgn06R5/35osKqkvKNF5
	0L8476BkCiPOItlNifgabl1BNtiLEOovYNZTIa0+y7D0pOTTyyrIiIpJE2b3kBgDl9F4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] VT-d: undo device mappings upon error
Message-Id: <E1m48Oe-0001V0-NJ@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 20:55:52 +0000

commit 1dae9fd19fd44e5912169bb916192438be1b4479
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:31:55 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:31:55 2021 +0200

    VT-d: undo device mappings upon error
    
    When
     - flushes (supposedly not possible anymore after XSA-373),
     - secondary mappings for legacy PCI devices behind bridges,
     - secondary mappings for chipset quirks, or
     - find_upstream_bridge() invocations
    fail, the successfully established device mappings should not be left
    around.
    
    Further, when (parts of) unmapping fail, simply returning an error is
    typically not enough. Crash the domain instead in such cases, arranging
    for domain cleanup to continue in a best effort manner despite such
    failures.
    
    Finally make domain_context_unmap()'s error behavior consistent in the
    legacy PCI device case: Don't bail from the function in one special
    case, but always just exit the switch statement.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: f3401d65d9f0dce508c3d7da55de4a093d748ae1
    master date: 2021-06-24 16:28:25 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 57 +++++++++++++++++++++++++++++++------
 1 file changed, 48 insertions(+), 9 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index bef3d594c9..7d1813a615 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1464,9 +1464,15 @@ int domain_context_mapping_one(
     if ( !seg && !rc )
         rc = me_wifi_quirk(domain, bus, devfn, MAP_ME_PHANTOM_FUNC);
 
+    if ( rc )
+        domain_context_unmap_one(domain, iommu, bus, devfn);
+
     return rc;
 }
 
+static int domain_context_unmap(struct domain *d, uint8_t devfn,
+                                struct pci_dev *pdev);
+
 static int domain_context_mapping(struct domain *domain, u8 devfn,
                                   struct pci_dev *pdev)
 {
@@ -1530,16 +1536,21 @@ static int domain_context_mapping(struct domain *domain, u8 devfn,
         if ( ret )
             break;
 
-        if ( find_upstream_bridge(seg, &bus, &devfn, &secbus) < 1 )
-            break;
+        if ( (ret = find_upstream_bridge(seg, &bus, &devfn, &secbus)) < 1 )
+        {
+            if ( !ret )
+                break;
+            ret = -ENXIO;
+        }
 
         /*
          * Mapping a bridge should, if anything, pass the struct pci_dev of
          * that bridge. Since bridges don't normally get assigned to guests,
          * their owner would be the wrong one. Pass NULL instead.
          */
-        ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
-                                         NULL);
+        if ( ret >= 0 )
+            ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
+                                             NULL);
 
         /*
          * Devices behind PCIe-to-PCI/PCIx bridge may generate different
@@ -1556,6 +1567,9 @@ static int domain_context_mapping(struct domain *domain, u8 devfn,
             ret = domain_context_mapping_one(domain, drhd->iommu, secbus, 0,
                                              NULL);
 
+        if ( ret )
+            domain_context_unmap(domain, devfn, pdev);
+
         break;
 
     default:
@@ -1635,6 +1649,19 @@ int domain_context_unmap_one(
     if ( !iommu->drhd->segment && !rc )
         rc = me_wifi_quirk(domain, bus, devfn, UNMAP_ME_PHANTOM_FUNC);
 
+    if ( rc && !is_hardware_domain(domain) && domain != dom_io )
+    {
+        if ( domain->is_dying )
+        {
+            printk(XENLOG_ERR "%pd: error %d unmapping %04x:%02x:%02x.%u\n",
+                   domain, rc, iommu->drhd->segment, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
+            rc = 0; /* Make upper layers continue in a best effort manner. */
+        }
+        else
+            domain_crash(domain);
+    }
+
     return rc;
 }
 
@@ -1689,17 +1716,29 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
 
         tmp_bus = bus;
         tmp_devfn = devfn;
-        if ( find_upstream_bridge(seg, &tmp_bus, &tmp_devfn, &secbus) < 1 )
+        if ( (ret = find_upstream_bridge(seg, &tmp_bus, &tmp_devfn,
+                                         &secbus)) < 1 )
+        {
+            if ( ret )
+            {
+                ret = -ENXIO;
+                if ( !domain->is_dying &&
+                     !is_hardware_domain(domain) && domain != dom_io )
+                {
+                    domain_crash(domain);
+                    /* Make upper layers continue in a best effort manner. */
+                    ret = 0;
+                }
+            }
             break;
+        }
 
         /* PCIe to PCI/PCIx bridge */
         if ( pdev_type(seg, tmp_bus, tmp_devfn) == DEV_TYPE_PCIe2PCI_BRIDGE )
         {
             ret = domain_context_unmap_one(domain, iommu, tmp_bus, tmp_devfn);
-            if ( ret )
-                return ret;
-
-            ret = domain_context_unmap_one(domain, iommu, secbus, 0);
+            if ( !ret )
+                ret = domain_context_unmap_one(domain, iommu, secbus, 0);
         }
         else /* Legacy PCI bridge */
             ret = domain_context_unmap_one(domain, iommu, tmp_bus, tmp_devfn);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 20:56:04 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 20:56:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156942.289580 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48Oq-0004yp-21; Thu, 15 Jul 2021 20:56:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156942.289580; Thu, 15 Jul 2021 20:56:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48Op-0004yg-Up; Thu, 15 Jul 2021 20:56:03 +0000
Received: by outflank-mailman (input) for mailman id 156942;
 Thu, 15 Jul 2021 20:56:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48Oo-0004yT-Rx
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:56:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48Oo-0005FS-RF
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:56:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48Oo-0001W8-QW
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7tPQr4j1pWHq38Q7ghPUsN3YEjzflV8iISPQa92NXBo=; b=brmut87xkc+7il+FcutXDbwRwC
	ZB46syYhS9GnfppLV7CASjWPjxrFuet4n98ErtjdAMEuWRggdFDq/wd809EKZ29rEqzWOn2ddvYvN
	Ra6Yhp3oFw+qt17S6wg1c1EQOlFymAWdIuOY0hihEC8kYPljGRkfPMv2skblZPwLRwDY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] VT-d: adjust domid map updating when unmapping context
Message-Id: <E1m48Oo-0001W8-QW@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 20:56:02 +0000

commit e06d0c113e0067b86186db94aabae9c91aa09f35
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:32:21 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:32:21 2021 +0200

    VT-d: adjust domid map updating when unmapping context
    
    When an earlier error occurred, cleaning up the domid mapping data is
    wrong, as references likely still exist. The only exception to this is
    when the actual unmapping worked, but some flush failed (supposedly
    impossible after XSA-373). The guest will get crashed in such a case
    though, so add fallback cleanup to domain destruction to cover this
    case. This in turn makes it desirable to silence the dprintk() in
    domain_iommu_domid().
    
    Note that no error will be returned anymore when the lookup fails - in
    the common case lookup failure would already have caused
    domain_context_unmap_one() to fail, yet even from a more general
    perspective it doesn't look right to fail domain_context_unmap() in such
    a case when this was the last device, but not when any earlier unmap was
    otherwise successful.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 32655880057ce2829f962d46916ea6cec60f98d3
    master date: 2021-06-24 16:29:13 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 39 +++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 15 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 7d1813a615..e4c0e4368e 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -79,9 +79,11 @@ static int domain_iommu_domid(struct domain *d,
         i = find_next_bit(iommu->domid_bitmap, nr_dom, i+1);
     }
 
-    dprintk(XENLOG_ERR VTDPREFIX,
-            "Cannot get valid iommu domid: domid=%d iommu->index=%d\n",
-            d->domain_id, iommu->index);
+    if ( !d->is_dying )
+        dprintk(XENLOG_ERR VTDPREFIX,
+                "Cannot get valid iommu %u domid: %pd\n",
+                iommu->index, d);
+
     return -1;
 }
 
@@ -146,6 +148,17 @@ static int context_get_domain_id(struct context_entry *context,
     return domid;
 }
 
+static void cleanup_domid_map(struct domain *domain, struct vtd_iommu *iommu)
+{
+    int iommu_domid = domain_iommu_domid(domain, iommu);
+
+    if ( iommu_domid >= 0 )
+    {
+        clear_bit(iommu_domid, iommu->domid_bitmap);
+        iommu->domid_map[iommu_domid] = 0;
+    }
+}
+
 static int iommus_incoherent;
 
 static void sync_cache(const void *addr, unsigned int size)
@@ -1753,6 +1766,9 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
         goto out;
     }
 
+    if ( ret )
+        goto out;
+
     /*
      * if no other devices under the same iommu owned by this domain,
      * clear iommu in iommu_bitmap and clear domain_id in domid_bitmp
@@ -1772,19 +1788,8 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
 
     if ( found == 0 )
     {
-        int iommu_domid;
-
         clear_bit(iommu->index, &dom_iommu(domain)->arch.iommu_bitmap);
-
-        iommu_domid = domain_iommu_domid(domain, iommu);
-        if ( iommu_domid == -1 )
-        {
-            ret = -EINVAL;
-            goto out;
-        }
-
-        clear_bit(iommu_domid, iommu->domid_bitmap);
-        iommu->domid_map[iommu_domid] = 0;
+        cleanup_domid_map(domain, iommu);
     }
 
 out:
@@ -1795,6 +1800,7 @@ static void iommu_domain_teardown(struct domain *d)
 {
     struct domain_iommu *hd = dom_iommu(d);
     struct mapped_rmrr *mrmrr, *tmp;
+    const struct acpi_drhd_unit *drhd;
 
     if ( list_empty(&acpi_drhd_units) )
         return;
@@ -1814,6 +1820,9 @@ static void iommu_domain_teardown(struct domain *d)
     iommu_free_pagetable(hd->arch.pgd_maddr, agaw_to_level(hd->arch.agaw));
     hd->arch.pgd_maddr = 0;
     spin_unlock(&hd->arch.mapping_lock);
+
+    for_each_drhd_unit ( drhd )
+        cleanup_domid_map(d, drhd->iommu);
 }
 
 static int __must_check intel_iommu_map_page(struct domain *d, dfn_t dfn,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 20:56:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 20:56:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156943.289584 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48P0-00052E-5J; Thu, 15 Jul 2021 20:56:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156943.289584; Thu, 15 Jul 2021 20:56:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48P0-000526-1h; Thu, 15 Jul 2021 20:56:14 +0000
Received: by outflank-mailman (input) for mailman id 156943;
 Thu, 15 Jul 2021 20:56:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48Oy-00051s-VF
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:56:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48Oy-0005Fe-UP
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:56:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48Oy-0001Wx-TY
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:56: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=l4VgebqmAsfKJuomNdEhGfVFa4SsFUVXGm2SkJT45Z4=; b=iVvCEpepqqcc+ZGwnAwfkW2EvH
	ljA52rW+QeWlhXaLUxUhCDN7RDE4gs1fa5voz8dOu5aDIZPTYAFM2CLp7hYqpYJsewhrjkbv/SyhV
	gwWlp2ylRLUNXphw/ML5GmFk+WfsRDCPyuEq+hj7gmlzRHYNYSm/+nTV7w2icw0GQ5v8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] VT-d: clear_fault_bits() should clear all fault bits
Message-Id: <E1m48Oy-0001Wx-TY@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 20:56:12 +0000

commit 79774e0df8be2d27fe79740acce6d1614b45bacc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:32:46 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:32:46 2021 +0200

    VT-d: clear_fault_bits() should clear all fault bits
    
    If there is any way for one fault to be left set in the recording
    registers, there's no reason there couldn't also be multiple ones. If
    PPF set set (being the OR or all F fields), simply loop over the entire
    range of fault recording registers, clearing F everywhere.
    
    Since PPF is a r/o bit, also remove it from DMA_FSTS_FAULTS (arguably
    the constant's name is ambiguous as well).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 80589800ae62fce43fd3921e8fbd362465fe5ba3
    master date: 2021-06-24 16:29:42 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 16 +++++++++++++---
 xen/drivers/passthrough/vtd/iommu.h |  3 ++-
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index e4c0e4368e..69eba4acf5 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2122,13 +2122,23 @@ static int __hwdom_init setup_hwdom_device(u8 devfn, struct pci_dev *pdev)
 
 void clear_fault_bits(struct vtd_iommu *iommu)
 {
-    u64 val;
     unsigned long flags;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
-    val = dmar_readq(iommu->reg, cap_fault_reg_offset(iommu->cap) + 8);
-    dmar_writeq(iommu->reg, cap_fault_reg_offset(iommu->cap) + 8, val);
+
+    if ( dmar_readl(iommu->reg, DMAR_FSTS_REG) & DMA_FSTS_PPF )
+    {
+        unsigned int reg = cap_fault_reg_offset(iommu->cap);
+        unsigned int end = reg + cap_num_fault_regs(iommu->cap);
+
+        do {
+           dmar_writel(iommu->reg, reg + 12, DMA_FRCD_F);
+           reg += PRIMARY_FAULT_REG_LEN;
+        } while ( reg < end );
+    }
+
     dmar_writel(iommu->reg, DMAR_FSTS_REG, DMA_FSTS_FAULTS);
+
     spin_unlock_irqrestore(&iommu->register_lock, flags);
 }
 
diff --git a/xen/drivers/passthrough/vtd/iommu.h b/xen/drivers/passthrough/vtd/iommu.h
index e002dc6f01..32b39c606a 100644
--- a/xen/drivers/passthrough/vtd/iommu.h
+++ b/xen/drivers/passthrough/vtd/iommu.h
@@ -174,7 +174,8 @@
 #define DMA_FSTS_IQE ((u64)1 << 4)
 #define DMA_FSTS_ICE ((u64)1 << 5)
 #define DMA_FSTS_ITE ((u64)1 << 6)
-#define DMA_FSTS_FAULTS    DMA_FSTS_PFO | DMA_FSTS_PPF | DMA_FSTS_AFO | DMA_FSTS_APF | DMA_FSTS_IQE | DMA_FSTS_ICE | DMA_FSTS_ITE
+#define DMA_FSTS_FAULTS (DMA_FSTS_PFO | DMA_FSTS_AFO | DMA_FSTS_APF | \
+                         DMA_FSTS_IQE | DMA_FSTS_ICE | DMA_FSTS_ITE)
 #define dma_fsts_fault_record_index(s) (((s) >> 8) & 0xff)
 
 /* FRCD_REG, 32 bits access */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 20:56:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 20:56:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156944.289587 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48PA-000557-6A; Thu, 15 Jul 2021 20:56:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156944.289587; Thu, 15 Jul 2021 20:56:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48PA-000550-3I; Thu, 15 Jul 2021 20:56:24 +0000
Received: by outflank-mailman (input) for mailman id 156944;
 Thu, 15 Jul 2021 20:56:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48P9-00054r-2n
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:56:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48P9-0005Fp-25
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:56:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48P9-0001YE-0d
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:56: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=63HbOz1o57PERQhFWXxg248Dc9wu1ggPJdJxMSF569U=; b=c1AyjoCF4Oq00CmB3jPcR+gpFS
	/T5wHLztYkYH5mwLYxsGXZpdmhDmv9OF8ajl573gkTetk+QcJWNj+penzrsVRxQAQQcS4/qjG+iRS
	+5vDsvfycU7WC/Cr+V89+w+zrsoahoxpJuuVIhYW1/nSoeipq2VpIUcYG60dq1Xcg77Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] VT-d: don't lose errors when flushing TLBs on multiple IOMMUs
Message-Id: <E1m48P9-0001YE-0d@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 20:56:23 +0000

commit 86c223c9818d23b92f84494389e5b76c7fc0ad29
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:33:11 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:33:11 2021 +0200

    VT-d: don't lose errors when flushing TLBs on multiple IOMMUs
    
    While no longer an immediate problem with flushes no longer timing out,
    errors (if any) get properly reported by iommu_flush_iotlb_{dsi,psi}().
    Overwriting such an error with, perhaps, a success indicator received
    from another IOMMU will misguide callers. Record the first error, but
    don't bail from the loop (such that further necessary invalidation gets
    carried out on a best effort basis).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: e7059776f9755b989a992d229c68c3d7778412be
    master date: 2021-06-24 16:30:06 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 69eba4acf5..e125e3188a 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -596,7 +596,7 @@ static int __must_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
     struct vtd_iommu *iommu;
     bool_t flush_dev_iotlb;
     int iommu_domid;
-    int rc = 0;
+    int ret = 0;
 
     /*
      * No need pcideves_lock here because we have flush
@@ -604,6 +604,8 @@ static int __must_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
      */
     for_each_drhd_unit ( drhd )
     {
+        int rc;
+
         iommu = drhd->iommu;
 
         if ( !test_bit(iommu->index, &hd->arch.iommu_bitmap) )
@@ -626,13 +628,12 @@ static int __must_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
                                        flush_dev_iotlb);
 
         if ( rc > 0 )
-        {
             iommu_flush_write_buffer(iommu);
-            rc = 0;
-        }
+        else if ( !ret )
+            ret = rc;
     }
 
-    return rc;
+    return ret;
 }
 
 static int __must_check iommu_flush_iotlb_pages(struct domain *d,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 20:56:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 20:56:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156945.289591 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48PK-00057q-87; Thu, 15 Jul 2021 20:56:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156945.289591; Thu, 15 Jul 2021 20:56:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48PK-00057i-4z; Thu, 15 Jul 2021 20:56:34 +0000
Received: by outflank-mailman (input) for mailman id 156945;
 Thu, 15 Jul 2021 20:56:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48PJ-00057Y-69
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:56:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48PJ-0005Fz-5O
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:56:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48PJ-0001ZA-4S
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:56: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=p5ibtI0Mm5mnGNOVHvURaItCJ1PmyDR3yylRwITzBfM=; b=yyMp0dOkK7Tp6sySj8DtLxmJJn
	xd4PIiPtKKaBgS6MtT0w2WhVQ9UBxEvy7hmSk9W2xPg9morKdbKTYptZVAakXHwKGOqEbGQtIzj4M
	l7Xyu5NwET8grgiUHwgCKKHzsIDU4lJs6OFjYSrDzPfPqYAYm+td8dr0kGnvuqPSiSn4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] IOMMU/PCI: don't let domain cleanup continue when device de-assignment failed
Message-Id: <E1m48PJ-0001ZA-4S@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 20:56:33 +0000

commit 645fcf8a96d706b6037b7a772557213479be9a06
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:33:35 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:33:35 2021 +0200

    IOMMU/PCI: don't let domain cleanup continue when device de-assignment failed
    
    Failure here could in principle mean the device may still be issuing DMA
    requests, which would continue to be translated by the page tables the
    device entry currently points at. With this we cannot allow the
    subsequent cleanup step of freeing the page tables to occur, to prevent
    use-after-free issues. We would need to accept, for the time being, that
    in such a case the remaining domain resources will all be leaked, and
    the domain will continue to exist as a zombie.
    
    However, with flushes no longer timing out (and with proper timeout
    detection for device I/O TLB flushing yet to be implemented), there's no
    way anymore for failures to occur, except due to bugs elsewhere. Hence
    the change here is merely a "just in case" one.
    
    In order to continue the loop in spite of an error, we can't use
    pci_get_pdev_by_domain() anymore. I have no idea why it was used here in
    the first place, instead of the cheaper list iteration.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: f591755823a7e94fc6b4b8ddce71f0421a94fa09
    master date: 2021-06-25 14:06:55 +0200
---
 xen/drivers/passthrough/pci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 418b2cdf04..981e63061d 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -965,7 +965,7 @@ static int deassign_device(struct domain *d, uint16_t seg, uint8_t bus,
 
 int pci_release_devices(struct domain *d)
 {
-    struct pci_dev *pdev;
+    struct pci_dev *pdev, *tmp;
     u8 bus, devfn;
     int ret;
 
@@ -976,15 +976,15 @@ int pci_release_devices(struct domain *d)
         pcidevs_unlock();
         return ret;
     }
-    while ( (pdev = pci_get_pdev_by_domain(d, -1, -1, -1)) )
+    list_for_each_entry_safe ( pdev, tmp, &d->pdev_list, domain_list )
     {
         bus = pdev->bus;
         devfn = pdev->devfn;
-        deassign_device(d, pdev->seg, bus, devfn);
+        ret = deassign_device(d, pdev->seg, bus, devfn) ?: ret;
     }
     pcidevs_unlock();
 
-    return 0;
+    return ret;
 }
 
 #define PCI_CLASS_BRIDGE_HOST    0x0600
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 20:56:45 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 20:56:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156946.289596 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48PV-0005BZ-9J; Thu, 15 Jul 2021 20:56:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156946.289596; Thu, 15 Jul 2021 20:56:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48PV-0005BR-6U; Thu, 15 Jul 2021 20:56:45 +0000
Received: by outflank-mailman (input) for mailman id 156946;
 Thu, 15 Jul 2021 20:56:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48PT-0005Ao-8u
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:56:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48PT-0005GB-8D
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:56:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48PT-0001a4-7U
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:56: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3CJsndvhE13pclWDkWjatWNcY5daUNKgqIMIwie0hzM=; b=iRjD5fQeN4vN5NtNn366iKIoYI
	hhrSo3QeMdCyKbNxcFT9Rc7Z+mRTVy0JACaRAKSeX4uofqocLnbAEktAoZMVLmdvDKoog2z7SMn0Q
	54caQvja1iK99BT9DpnGahGt3Kx0iOcfAV8NCoIcbS5rqvXqid9HPIxtPTNY1FWqBwmQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] build: fix %.s: %.S rule
Message-Id: <E1m48PT-0001a4-7U@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 20:56:43 +0000

commit 1ed3661879ce85188b8ef295f4e388221292b3f9
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Jul 15 09:34:03 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:34:03 2021 +0200

    build: fix %.s: %.S rule
    
    Fixes: e321576f4047 ("xen/build: start using if_changed")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: d468f9522174114ab06239894b6079c0a487e408
    master date: 2021-07-05 16:47:51 +0200
---
 xen/Rules.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index 62e9fabe7a..93f49af2eb 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -206,8 +206,8 @@ cmd_cpp_i_c = $(CPP) $(filter-out -Wa$(comma)%,$(c_flags)) -MQ $@ -o $@ $<
 quiet_cmd_cc_s_c = CC      $@
 cmd_cc_s_c = $(CC) $(filter-out -Wa$(comma)%,$(c_flags)) -S $< -o $@
 
-quiet_cmd_s_S = CPP     $@
-cmd_s_S = $(CPP) $(filter-out -Wa$(comma)%,$(a_flags)) -MQ $@ -o $@ $<
+quiet_cmd_cpp_s_S = CPP     $@
+cmd_cpp_s_S = $(CPP) $(filter-out -Wa$(comma)%,$(a_flags)) -MQ $@ -o $@ $<
 
 %.i: %.c FORCE
 	$(call if_changed,cpp_i_c)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Jul 15 20:56:55 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jul 2021 20:56:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156947.289600 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48Pf-0005E1-An; Thu, 15 Jul 2021 20:56:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156947.289600; Thu, 15 Jul 2021 20:56:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m48Pf-0005Dt-7y; Thu, 15 Jul 2021 20:56:55 +0000
Received: by outflank-mailman (input) for mailman id 156947;
 Thu, 15 Jul 2021 20:56:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48Pd-0005Dj-Bo
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:56:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48Pd-0005Gk-BA
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:56:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m48Pd-0001ay-AO
 for xen-changelog@lists.xenproject.org; Thu, 15 Jul 2021 20:56: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jzL0Pd62p/1qgeiiSl3kGaCI89ThfxzlwDHAx3iBZGg=; b=67H5WmxvSMKA4p4/ReWKTnCf5c
	gwzVHMfuhm1MHOEyRH5N1OYuj4GrgqkPmNZHalv2+pkHKhQEi9gxRrWdqnitLPH7ILpK4XdSX6BYU
	Zw/CbNen+1NEUNFQlrfFkuQ7+a16ASRr45omjAFuwtmuYoBT3SmQOp8RKwmXr3zRYaBg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/mem-sharing: ensure consistent lock order in get_two_gfns()
Message-Id: <E1m48Pd-0001ay-AO@xenbits.xenproject.org>
Date: Thu, 15 Jul 2021 20:56:53 +0000

commit 3cfccd70992b3d2b739e3febfceb99fdf6283be0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:34:28 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:34:28 2021 +0200

    x86/mem-sharing: ensure consistent lock order in get_two_gfns()
    
    While the comment validly says "Sort by domain, if same domain by gfn",
    the implementation also included equal domain IDs in the first part of
    the check, thus rending the second part entirely dead and leaving
    deadlock potential when there's only a single domain involved.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
    master commit: 09af2d01a2fe6a0af08598bdfe12c9707f4d82ba
    master date: 2021-07-07 12:35:12 +0200
---
 xen/include/asm-x86/p2m.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 8abae345e8..2883d8a2f0 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -552,7 +552,7 @@ do {                                                    \
     dest ## _t   = (source ## t)   ?: &scratch_t;       \
 } while (0)
 
-    if ( (rd->domain_id <= ld->domain_id) ||
+    if ( (rd->domain_id < ld->domain_id) ||
          ((rd == ld) && (gfn_x(rgfn) <= gfn_x(lgfn))) )
     {
         assign_pointers(first, r);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 01:11:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 01:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156955.289615 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4CNb-000825-P9; Fri, 16 Jul 2021 01:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156955.289615; Fri, 16 Jul 2021 01:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4CNb-00081x-MF; Fri, 16 Jul 2021 01:11:03 +0000
Received: by outflank-mailman (input) for mailman id 156955;
 Fri, 16 Jul 2021 01:11:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CNZ-00081r-Sv
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CNZ-0007nD-Ql
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CNZ-0007vz-Ox
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Q21naFAC3l0NEtauuauuy1jdyI5exifAjPJZknOdF0M=; b=12qjAYg24VTQr6tVQSOX0FHXnS
	X1qhdMSf76GKiIiQry1nHC7N+2feEeDhBHgfS3avOjEEC68qj15M3iX4Hlv+oGSrG8Vntm5owZEVi
	+4laFZtX3h9YW8JVT/WWDk3plyD3SQPo4QHy3m+cdDK4qboh+OhGRY08jdZlIKa7rSnc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] SUPPORT.md: Un-shimmed 32-bit PV guests are no longer supported
Message-Id: <E1m4CNZ-0007vz-Ox@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 01:11:01 +0000

commit 77069ea825c883c4be98386367fbf466abd99128
Author:     George Dunlap <george.dunlap@citrix.com>
AuthorDate: Thu Jul 15 09:16:02 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:16:02 2021 +0200

    SUPPORT.md: Un-shimmed 32-bit PV guests are no longer supported
    
    The support status of 32-bit guests doesn't seem particularly useful.
    
    With it changed to fully unsupported outside of PV-shim, adjust the PV32
    Kconfig default accordingly.
    
    Reported-by: Jann Horn <jannh@google.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    tools/libs/guest: fix save and restore of pv domains after 32-bit de-support
    
    After 32-bit PV-guests have been security de-supported when not running
    under PV-shim, the hypervisor will no longer be configured to support
    those domains per default when not being built as PV-shim.
    
    Unfortunately libxenguest will fail saving or restoring a PV domain
    due to this restriction, as it is trying to get the compat MFN list
    even for 64 bit guests.
    
    Fix that by obtaining the compat MFN list only for 32-bit PV guests.
    
    Fixes: 1a0f2fe2297d122a08fe ("SUPPORT.md: Un-shimmed 32-bit PV guests are no longer supported")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 1a0f2fe2297d122a08fee2b26de5de995fdeca13
    master date: 2021-06-04 17:24:05 +0100
    master commit: d21121685fac829c988e432407fb0e4ef9b19331
    master date: 2021-06-07 15:43:35 +0100
---
 SUPPORT.md                             |  9 +--------
 tools/libs/guest/xg_sr_common.h        |  2 +-
 tools/libs/guest/xg_sr_common_x86_pv.c | 13 ++++++++-----
 xen/arch/x86/Kconfig                   |  7 +++++--
 4 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index 9024d8a056..0fb262f81f 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -86,14 +86,7 @@ No hardware requirements
 
     Status, x86_64: Supported
     Status, x86_32, shim: Supported
-    Status, x86_32, without shim: Supported, with caveats
-
-Due to architectural limitations,
-32-bit PV guests must be assumed to be able to read arbitrary host memory
-using speculative execution attacks.
-Advisories will continue to be issued
-for new vulnerabilities related to un-shimmed 32-bit PV guests
-enabling denial-of-service attacks or privilege escalation attacks.
+    Status, x86_32, without shim: Supported, not security supported
 
 ### x86/HVM
 
diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index cc3ad1c394..e2994e18ac 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -325,7 +325,7 @@ struct xc_sr_context
                 xen_pfn_t max_mfn;
                 /* Read-only machine to phys map */
                 xen_pfn_t *m2p;
-                /* first mfn of the compat m2p (Only needed for 32bit PV guests) */
+                /* first mfn of the compat m2p (Only set for 32bit PV guests) */
                 xen_pfn_t compat_m2p_mfn0;
                 /* Number of m2p frames mapped */
                 unsigned long nr_m2p_frames;
diff --git a/tools/libs/guest/xg_sr_common_x86_pv.c b/tools/libs/guest/xg_sr_common_x86_pv.c
index cd33406aab..c0acf00f90 100644
--- a/tools/libs/guest/xg_sr_common_x86_pv.c
+++ b/tools/libs/guest/xg_sr_common_x86_pv.c
@@ -149,12 +149,13 @@ int x86_pv_map_m2p(struct xc_sr_context *ctx)
 
     ctx->x86.pv.nr_m2p_frames = (M2P_CHUNK_SIZE >> PAGE_SHIFT) * m2p_chunks;
 
+    if ( ctx->x86.pv.levels == 3 )
+    {
 #ifdef __i386__
-    /* 32 bit toolstacks automatically get the compat m2p */
-    ctx->x86.pv.compat_m2p_mfn0 = entries[0].mfn;
+        /* 32 bit toolstacks automatically get the compat m2p */
+        ctx->x86.pv.compat_m2p_mfn0 = entries[0].mfn;
 #else
-    /* 64 bit toolstacks need to ask Xen specially for it */
-    {
+        /* 64 bit toolstacks need to ask Xen specially for it */
         struct xen_machphys_mfn_list xmml = {
             .max_extents = 1,
             .extent_start = { &ctx->x86.pv.compat_m2p_mfn0 },
@@ -168,8 +169,10 @@ int x86_pv_map_m2p(struct xc_sr_context *ctx)
             rc = -1;
             goto err;
         }
-    }
 #endif
+    }
+    else
+        ctx->x86.pv.compat_m2p_mfn0 = INVALID_MFN;
 
     /* All Done */
     rc = 0;
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index f79e6634db..27cb793165 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -56,7 +56,7 @@ config PV
 config PV32
 	bool "Support for 32bit PV guests"
 	depends on PV
-	default y
+	default PV_SHIM
 	---help---
 	  The 32bit PV ABI uses Ring1, an area of the x86 architecture which
 	  was deprecated and mostly removed in the AMD64 spec.  As a result,
@@ -67,7 +67,10 @@ config PV32
 	  reduction, or performance reasons.  Backwards compatibility can be
 	  provided via the PV Shim mechanism.
 
-	  If unsure, say Y.
+	  Note that outside of PV Shim, 32-bit PV guests are not security
+	  supported anymore.
+
+	  If unsure, use the default setting.
 
 config PV_LINEAR_PT
        bool "Support for PV linear pagetables"
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 01:11:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 01:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156956.289620 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4CNk-00083W-Qp; Fri, 16 Jul 2021 01:11:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156956.289620; Fri, 16 Jul 2021 01:11:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4CNk-00083N-Nk; Fri, 16 Jul 2021 01:11:12 +0000
Received: by outflank-mailman (input) for mailman id 156956;
 Fri, 16 Jul 2021 01:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CNj-00083H-Vv
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:11:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CNj-0007nI-V1
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CNj-0007wv-TH
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tfLqHX3etwDfW6xFgPh0IuiDNvsE/bJZxW/qWJ8Ku+Q=; b=c4Kjgb3xvvAkv8D0KhRsBkXceG
	xxEA4fUYJUPKw16G6kgvuEx+PBV6OivGCLIVmMoIeCNhzyZmiUY5eyY4PxyBaGnZeJrI6iN+iIKeM
	wX7Jq/tHr0i8/xUQWFIVJ1WNpREqIGlfnNuGPerzeY8JiwLtA7s0VVhxfbw/rpd9XP5Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] credit2: make sure we pick a runnable unit from the runq if there is one
Message-Id: <E1m4CNj-0007wv-TH@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 01:11:11 +0000

commit 13ea8afded421c60dd4a0a1cd7afc8600819a7dd
Author:     Dario Faggioli <dfaggioli@suse.com>
AuthorDate: Thu Jul 15 09:17:26 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:17:26 2021 +0200

    credit2: make sure we pick a runnable unit from the runq if there is one
    
    A !runnable unit (temporarily) present in the runq may cause us to
    stop scanning the runq itself too early. Of course, we don't run any
    non-runnable vCPUs, but we end the scan and we fallback to picking
    the idle unit. In other word, this prevent us to find there and pick
    the actual unit that we're meant to start running (which might be
    further ahead in the runq).
    
    Depending on the vCPU pinning configuration, this may lead to such
    unit to be stuck in the runq for long time, causing malfunctioning
    inside the guest.
    
    Fix this by checking runnable/non-runnable status up-front, in the runq
    scanning function.
    
    Reported-by: Michał Leszczyński <michal.leszczynski@cert.pl>
    Reported-by: Dion Kant <g.w.kant@hunenet.nl>
    Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 07b0eb5d0ef0be154606aa46b5b4c5c59b158505
    master date: 2021-06-07 13:16:36 +0100
---
 xen/common/sched/credit2.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index eb5e5a78c5..f5c1e5b944 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -3463,6 +3463,10 @@ runq_candidate(struct csched2_runqueue_data *rqd,
                         (unsigned char *)&d);
         }
 
+        /* Skip non runnable units that we (temporarily) have in the runq */
+        if ( unlikely(!unit_runnable_state(svc->unit)) )
+            continue;
+
         /* Only consider vcpus that are allowed to run on this processor. */
         if ( !cpumask_test_cpu(cpu, svc->unit->cpu_hard_affinity) )
             continue;
@@ -3496,8 +3500,7 @@ runq_candidate(struct csched2_runqueue_data *rqd,
          * some budget, then choose it.
          */
         if ( (yield || svc->credit > snext->credit) &&
-             (!has_cap(svc) || unit_grab_budget(svc)) &&
-             unit_runnable_state(svc->unit) )
+             (!has_cap(svc) || unit_grab_budget(svc)) )
             snext = svc;
 
         /* In any case, if we got this far, break. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 01:11:22 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 01:11:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156957.289624 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4CNu-00086q-Tg; Fri, 16 Jul 2021 01:11:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156957.289624; Fri, 16 Jul 2021 01:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4CNu-00086j-Qa; Fri, 16 Jul 2021 01:11:22 +0000
Received: by outflank-mailman (input) for mailman id 156957;
 Fri, 16 Jul 2021 01:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CNu-00086R-2g
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:11:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CNu-0007nS-1s
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CNu-0007xr-14
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XAwo8cFNMdJqu8CbNmWOHhWu83OJo3HO3D5TzmBRDwA=; b=4zE53iZnAROG3magl1Zxxhf7Zx
	ybuhVdNlFybteqAhO3HkocvePLjSB7ezSYxjCSC98LJc9kMVk8Q5GiuWbbS8ddGDi403fFoec+7Au
	O3q+4eYExQQ6TVATMBlVUhVS6zzQymOyhS+oMGHQ5FwJHWmvzqMAc4Wp37frcwXLdDFY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] xen: credit2: fix per-entity load tracking when continuing running
Message-Id: <E1m4CNu-0007xr-14@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 01:11:22 +0000

commit 3556dc6bfb27bb8ec8bc1df1f4813319ebec4e59
Author:     Dario Faggioli <dfaggioli@suse.com>
AuthorDate: Thu Jul 15 09:18:32 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:18:32 2021 +0200

    xen: credit2: fix per-entity load tracking when continuing running
    
    If we schedule, and the current vCPU continues to run, its statistical
    load is not properly updated, resulting in something like this, even if
    all the 8 vCPUs are 100% busy:
    
    (XEN) Runqueue 0:
    (XEN) [...]
    (XEN)   aveload            = 2097152 (~800%)
    (XEN) [...]
    (XEN)   Domain: 0 w 256 c 0 v 8
    (XEN)     1: [0.0] flags=2 cpu=4 credit=9996885 [w=256] load=35 (~0%)
    (XEN)     2: [0.1] flags=2 cpu=2 credit=9993725 [w=256] load=796 (~0%)
    (XEN)     3: [0.2] flags=2 cpu=1 credit=9995885 [w=256] load=883 (~0%)
    (XEN)     4: [0.3] flags=2 cpu=5 credit=9998833 [w=256] load=487 (~0%)
    (XEN)     5: [0.4] flags=2 cpu=6 credit=9998942 [w=256] load=1595 (~0%)
    (XEN)     6: [0.5] flags=2 cpu=0 credit=9994669 [w=256] load=22 (~0%)
    (XEN)     7: [0.6] flags=2 cpu=7 credit=9997706 [w=256] load=0 (~0%)
    (XEN)     8: [0.7] flags=2 cpu=3 credit=9992440 [w=256] load=0 (~0%)
    
    As we can see, the average load of the runqueue as a whole is, instead,
    computed properly.
    
    This issue would, in theory, potentially affect Credit2 load balancing
    logic. In practice, however, the problem only manifests (at least with
    these characteristics) when there is only 1 runqueue active in the
    cpupool, which also means there is no need to do any load-balancing.
    
    Hence its real impact is pretty much limited to wrong per-vCPU load
    percentages, when looking at the output of the 'r' debug-key.
    
    With this patch, the load is updated and displayed correctly:
    
    (XEN) Runqueue 0:
    (XEN) [...]
    (XEN)   aveload            = 2097152 (~800%)
    (XEN) [...]
    (XEN) Domain info:
    (XEN)   Domain: 0 w 256 c 0 v 8
    (XEN)     1: [0.0] flags=2 cpu=4 credit=9995584 [w=256] load=262144 (~100%)
    (XEN)     2: [0.1] flags=2 cpu=6 credit=9992992 [w=256] load=262144 (~100%)
    (XEN)     3: [0.2] flags=2 cpu=3 credit=9998918 [w=256] load=262118 (~99%)
    (XEN)     4: [0.3] flags=2 cpu=5 credit=9996867 [w=256] load=262144 (~100%)
    (XEN)     5: [0.4] flags=2 cpu=1 credit=9998912 [w=256] load=262144 (~100%)
    (XEN)     6: [0.5] flags=2 cpu=2 credit=9997842 [w=256] load=262144 (~100%)
    (XEN)     7: [0.6] flags=2 cpu=7 credit=9994623 [w=256] load=262144 (~100%)
    (XEN)     8: [0.7] flags=2 cpu=0 credit=9991815 [w=256] load=262144 (~100%)
    
    Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 89052b9fa24bf976924e40918fc9fa3b1b940e17
    master date: 2021-06-07 13:17:06 +0100
---
 xen/common/sched/credit2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index f5c1e5b944..ebb09ea43a 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -3649,6 +3649,8 @@ static void csched2_schedule(
             runq_remove(snext);
             __set_bit(__CSFLAG_scheduled, &snext->flags);
         }
+        else
+            update_load(ops, rqd, snext, 0, now);
 
         /* Clear the idle mask if necessary */
         if ( cpumask_test_cpu(sched_cpu, &rqd->idle) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 01:11:33 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 01:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156958.289629 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4CO4-00089q-Va; Fri, 16 Jul 2021 01:11:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156958.289629; Fri, 16 Jul 2021 01:11:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4CO4-00089i-SE; Fri, 16 Jul 2021 01:11:32 +0000
Received: by outflank-mailman (input) for mailman id 156958;
 Fri, 16 Jul 2021 01:11:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CO4-00089M-5V
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:11:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CO4-0007ni-4f
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CO4-0007z3-3v
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aioXWVyWgMT5q0m9Z11SL8CxmNTuUHXVA3H/OsuDt60=; b=LLzNZqu/1qcXBw9iVUKq84qiCq
	y3MmkXuSCh4fDQpox2gjkHa9ZwCSL+jySIvXQYVP/b1OMd1Fc71fZ969uklJSzuQn43cRgUlhEaSM
	xNlBuZ8vvza6W5CRJq4BGDXI+kBgG7qZ6H3B/mLjlHRD6JRvjpKmAQFLbpHo1t0US/cE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] x86/vpt: fully init timers before putting onto list
Message-Id: <E1m4CO4-0007z3-3v@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 01:11:32 +0000

commit 98929010477a5d9e9fdd489a4f2e8ab8a64cac06
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:19:03 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:19:03 2021 +0200

    x86/vpt: fully init timers before putting onto list
    
    With pt_vcpu_lock() no longer acquiring the pt_migrate lock, parties
    iterating the list and acting on the timers of the list entries will no
    longer be kept from entering their loops by create_periodic_time()'s
    holding of that lock. Therefore at least init_timer() needs calling
    ahead of list insertion, but keep this and set_timer() together.
    
    Fixes: 8113b02f0bf8 ("x86/vpt: do not take pt_migrate rwlock in some cases")
    Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    master commit: 6d622f3a96bbd76ce8422c6e3805e6609417ec76
    master date: 2021-06-15 15:14:20 +0200
---
 xen/arch/x86/hvm/vpt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index 560fab9cfc..4d4d22b0e7 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -554,14 +554,14 @@ void create_periodic_time(
     pt->cb = cb;
     pt->priv = data;
 
+    init_timer(&pt->timer, pt_timer_fn, pt, v->processor);
+    set_timer(&pt->timer, pt->scheduled);
+
     pt_vcpu_lock(v);
     pt->on_list = 1;
     list_add(&pt->list, &v->arch.hvm.tm_list);
     pt_vcpu_unlock(v);
 
-    init_timer(&pt->timer, pt_timer_fn, pt, v->processor);
-    set_timer(&pt->timer, pt->scheduled);
-
     write_unlock(&v->domain->arch.hvm.pl_time->pt_migrate);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 01:11:43 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 01:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156959.289632 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4COF-0008Cs-0I; Fri, 16 Jul 2021 01:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156959.289632; Fri, 16 Jul 2021 01:11:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4COE-0008Ck-Tf; Fri, 16 Jul 2021 01:11:42 +0000
Received: by outflank-mailman (input) for mailman id 156959;
 Fri, 16 Jul 2021 01:11:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4COE-0008Cd-8P
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:11:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4COE-0007nt-7W
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4COE-000803-6j
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WFhoQx9hf16QMgYmd1TuUCq9xCtfWd6JD1OdB/cFSHI=; b=HgwpgLbeQbqQ9jUIrKCConLxNj
	EiY9j3WdtbQtGTPdayeb9I+V/34+i3ui/nqUh8d6ia5h9Q1dvYAgQPXtapdwIVATy4SpkTdI0Rn+g
	r8loyUM6Bt5GMkdaI3WW2ofpDe1BHFJ0GjFrS+Sx9jMuhnTqKTVyMc6ZnGI+8YQNwX8c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] libs/foreignmemory: Fix osdep_xenforeignmemory_map prototype
Message-Id: <E1m4COE-000803-6j@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 01:11:42 +0000

commit d8a530ebc36ab242ba3fa3d83baaf4f68b1029ab
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Jul 15 09:20:10 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:20:10 2021 +0200

    libs/foreignmemory: Fix osdep_xenforeignmemory_map prototype
    
    Commit cf8c4d3d13b8 made some preparation to have one day
    variable-length-array argument, but didn't declare the array in the
    function prototype the same way as in the function definition. And now
    GCC 11 complains about it.
    
    Fixes: cf8c4d3d13b8 ("tools/libs/foreignmemory: pull array length argument to map forward")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 5d3e4ebb5c71477d74a0c503438545a0126d3863
    master date: 2021-06-15 18:07:58 +0100
---
 tools/libs/foreignmemory/private.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/foreignmemory/private.h b/tools/libs/foreignmemory/private.h
index 1ee3626dd2..5bb0cefb09 100644
--- a/tools/libs/foreignmemory/private.h
+++ b/tools/libs/foreignmemory/private.h
@@ -32,7 +32,7 @@ int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem);
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, void *addr,
                                  int prot, int flags, size_t num,
-                                 const xen_pfn_t arr[num], int err[num]);
+                                 const xen_pfn_t arr[/*num*/], int err[/*num*/]);
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 01:11:53 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 01:11:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156960.289636 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4COP-0008GI-22; Fri, 16 Jul 2021 01:11:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156960.289636; Fri, 16 Jul 2021 01:11:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4COO-0008GA-VB; Fri, 16 Jul 2021 01:11:52 +0000
Received: by outflank-mailman (input) for mailman id 156960;
 Fri, 16 Jul 2021 01:11:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4COO-0008Fy-BZ
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:11:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4COO-0007oM-Ac
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4COO-00081A-9m
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HE+yqhLYpEBPA5mE+UkDFhTiMZlIpG9RO8KLZIybDoQ=; b=hkQwa/Ve/MjVlKD9OpTquNwzn9
	gTBacmuk6uLXYsngrf6m9ODdYE/Nt1+voSGxA3PMU2C1JvQ1xjmOQHf56ETrG4K3DGUYPGKrLtpDE
	xWq4OynH8NtIz45yIY+bkypfpPNVL4K7grZK45D4SpT1KBI92+Xl09ne8Dp9C3I8uHFo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] VT-d: undo device mappings upon error
Message-Id: <E1m4COO-00081A-9m@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 01:11:52 +0000

commit 0b80b344b0c008286542fb361e059dca0790389b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:20:37 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:20:37 2021 +0200

    VT-d: undo device mappings upon error
    
    When
     - flushes (supposedly not possible anymore after XSA-373),
     - secondary mappings for legacy PCI devices behind bridges,
     - secondary mappings for chipset quirks, or
     - find_upstream_bridge() invocations
    fail, the successfully established device mappings should not be left
    around.
    
    Further, when (parts of) unmapping fail, simply returning an error is
    typically not enough. Crash the domain instead in such cases, arranging
    for domain cleanup to continue in a best effort manner despite such
    failures.
    
    Finally make domain_context_unmap()'s error behavior consistent in the
    legacy PCI device case: Don't bail from the function in one special
    case, but always just exit the switch statement.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: f3401d65d9f0dce508c3d7da55de4a093d748ae1
    master date: 2021-06-24 16:28:25 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 57 +++++++++++++++++++++++++++++++------
 1 file changed, 48 insertions(+), 9 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index c160a70688..c0070f1c99 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1450,9 +1450,15 @@ int domain_context_mapping_one(
     if ( !seg && !rc )
         rc = me_wifi_quirk(domain, bus, devfn, MAP_ME_PHANTOM_FUNC);
 
+    if ( rc )
+        domain_context_unmap_one(domain, iommu, bus, devfn);
+
     return rc;
 }
 
+static int domain_context_unmap(struct domain *d, uint8_t devfn,
+                                struct pci_dev *pdev);
+
 static int domain_context_mapping(struct domain *domain, u8 devfn,
                                   struct pci_dev *pdev)
 {
@@ -1513,16 +1519,21 @@ static int domain_context_mapping(struct domain *domain, u8 devfn,
         if ( ret )
             break;
 
-        if ( find_upstream_bridge(seg, &bus, &devfn, &secbus) < 1 )
-            break;
+        if ( (ret = find_upstream_bridge(seg, &bus, &devfn, &secbus)) < 1 )
+        {
+            if ( !ret )
+                break;
+            ret = -ENXIO;
+        }
 
         /*
          * Mapping a bridge should, if anything, pass the struct pci_dev of
          * that bridge. Since bridges don't normally get assigned to guests,
          * their owner would be the wrong one. Pass NULL instead.
          */
-        ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
-                                         NULL);
+        if ( ret >= 0 )
+            ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
+                                             NULL);
 
         /*
          * Devices behind PCIe-to-PCI/PCIx bridge may generate different
@@ -1539,6 +1550,9 @@ static int domain_context_mapping(struct domain *domain, u8 devfn,
             ret = domain_context_mapping_one(domain, drhd->iommu, secbus, 0,
                                              NULL);
 
+        if ( ret )
+            domain_context_unmap(domain, devfn, pdev);
+
         break;
 
     default:
@@ -1617,6 +1631,19 @@ int domain_context_unmap_one(
     if ( !iommu->drhd->segment && !rc )
         rc = me_wifi_quirk(domain, bus, devfn, UNMAP_ME_PHANTOM_FUNC);
 
+    if ( rc && !is_hardware_domain(domain) && domain != dom_io )
+    {
+        if ( domain->is_dying )
+        {
+            printk(XENLOG_ERR "%pd: error %d unmapping %04x:%02x:%02x.%u\n",
+                   domain, rc, iommu->drhd->segment, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
+            rc = 0; /* Make upper layers continue in a best effort manner. */
+        }
+        else
+            domain_crash(domain);
+    }
+
     return rc;
 }
 
@@ -1669,17 +1696,29 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
 
         tmp_bus = bus;
         tmp_devfn = devfn;
-        if ( find_upstream_bridge(seg, &tmp_bus, &tmp_devfn, &secbus) < 1 )
+        if ( (ret = find_upstream_bridge(seg, &tmp_bus, &tmp_devfn,
+                                         &secbus)) < 1 )
+        {
+            if ( ret )
+            {
+                ret = -ENXIO;
+                if ( !domain->is_dying &&
+                     !is_hardware_domain(domain) && domain != dom_io )
+                {
+                    domain_crash(domain);
+                    /* Make upper layers continue in a best effort manner. */
+                    ret = 0;
+                }
+            }
             break;
+        }
 
         /* PCIe to PCI/PCIx bridge */
         if ( pdev_type(seg, tmp_bus, tmp_devfn) == DEV_TYPE_PCIe2PCI_BRIDGE )
         {
             ret = domain_context_unmap_one(domain, iommu, tmp_bus, tmp_devfn);
-            if ( ret )
-                return ret;
-
-            ret = domain_context_unmap_one(domain, iommu, secbus, 0);
+            if ( !ret )
+                ret = domain_context_unmap_one(domain, iommu, secbus, 0);
         }
         else /* Legacy PCI bridge */
             ret = domain_context_unmap_one(domain, iommu, tmp_bus, tmp_devfn);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 01:12:03 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 01:12:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156961.289640 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4COZ-0008JU-3U; Fri, 16 Jul 2021 01:12:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156961.289640; Fri, 16 Jul 2021 01:12:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4COZ-0008JM-0T; Fri, 16 Jul 2021 01:12:03 +0000
Received: by outflank-mailman (input) for mailman id 156961;
 Fri, 16 Jul 2021 01:12:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4COY-0008JE-Ei
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:12:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4COY-0007oj-Dl
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:12:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4COY-00082M-Cu
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:12: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XokxfLXJE0YmniV1W3YAc3SDy38lr/17GwfQUbLHsXo=; b=cu23A0BC/g1XbQ4SOoNHvXFwNn
	hhAeqDEf9F6nWHTMXGAmt1UnGTrP9SU9OmHBcpu5JzfX7+T6RlBRpMYbDkI1DNLkpd3pz5LIBeKRv
	eIXz1G5XEtW97TWpdZwkhRLWeg+K2RSNniu7/8eMmHomZ1Dz7M8f88nSL65j/RP9iPCI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] VT-d: adjust domid map updating when unmapping context
Message-Id: <E1m4COY-00082M-Cu@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 01:12:02 +0000

commit 3581714729cf84df50d6831c4da076e21587408c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:21:04 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:21:04 2021 +0200

    VT-d: adjust domid map updating when unmapping context
    
    When an earlier error occurred, cleaning up the domid mapping data is
    wrong, as references likely still exist. The only exception to this is
    when the actual unmapping worked, but some flush failed (supposedly
    impossible after XSA-373). The guest will get crashed in such a case
    though, so add fallback cleanup to domain destruction to cover this
    case. This in turn makes it desirable to silence the dprintk() in
    domain_iommu_domid().
    
    Note that no error will be returned anymore when the lookup fails - in
    the common case lookup failure would already have caused
    domain_context_unmap_one() to fail, yet even from a more general
    perspective it doesn't look right to fail domain_context_unmap() in such
    a case when this was the last device, but not when any earlier unmap was
    otherwise successful.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 32655880057ce2829f962d46916ea6cec60f98d3
    master date: 2021-06-24 16:29:13 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 39 +++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 15 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index c0070f1c99..2b3609dae2 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -80,9 +80,11 @@ static int domain_iommu_domid(struct domain *d,
         i = find_next_bit(iommu->domid_bitmap, nr_dom, i+1);
     }
 
-    dprintk(XENLOG_ERR VTDPREFIX,
-            "Cannot get valid iommu domid: domid=%d iommu->index=%d\n",
-            d->domain_id, iommu->index);
+    if ( !d->is_dying )
+        dprintk(XENLOG_ERR VTDPREFIX,
+                "Cannot get valid iommu %u domid: %pd\n",
+                iommu->index, d);
+
     return -1;
 }
 
@@ -147,6 +149,17 @@ static int context_get_domain_id(struct context_entry *context,
     return domid;
 }
 
+static void cleanup_domid_map(struct domain *domain, struct vtd_iommu *iommu)
+{
+    int iommu_domid = domain_iommu_domid(domain, iommu);
+
+    if ( iommu_domid >= 0 )
+    {
+        clear_bit(iommu_domid, iommu->domid_bitmap);
+        iommu->domid_map[iommu_domid] = 0;
+    }
+}
+
 static void sync_cache(const void *addr, unsigned int size)
 {
     static unsigned long clflush_size = 0;
@@ -1732,6 +1745,9 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
         goto out;
     }
 
+    if ( ret )
+        goto out;
+
     /*
      * if no other devices under the same iommu owned by this domain,
      * clear iommu in iommu_bitmap and clear domain_id in domid_bitmp
@@ -1751,19 +1767,8 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
 
     if ( found == 0 )
     {
-        int iommu_domid;
-
         clear_bit(iommu->index, &dom_iommu(domain)->arch.vtd.iommu_bitmap);
-
-        iommu_domid = domain_iommu_domid(domain, iommu);
-        if ( iommu_domid == -1 )
-        {
-            ret = -EINVAL;
-            goto out;
-        }
-
-        clear_bit(iommu_domid, iommu->domid_bitmap);
-        iommu->domid_map[iommu_domid] = 0;
+        cleanup_domid_map(domain, iommu);
     }
 
 out:
@@ -1783,6 +1788,7 @@ static void iommu_domain_teardown(struct domain *d)
 {
     struct domain_iommu *hd = dom_iommu(d);
     struct mapped_rmrr *mrmrr, *tmp;
+    const struct acpi_drhd_unit *drhd;
 
     if ( list_empty(&acpi_drhd_units) )
         return;
@@ -1794,6 +1800,9 @@ static void iommu_domain_teardown(struct domain *d)
     }
 
     ASSERT(!hd->arch.vtd.pgd_maddr);
+
+    for_each_drhd_unit ( drhd )
+        cleanup_domid_map(d, drhd->iommu);
 }
 
 static int __must_check intel_iommu_map_page(struct domain *d, dfn_t dfn,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 01:12:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 01:12:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156962.289644 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4COj-0008Mh-4x; Fri, 16 Jul 2021 01:12:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156962.289644; Fri, 16 Jul 2021 01:12:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4COj-0008MZ-22; Fri, 16 Jul 2021 01:12:13 +0000
Received: by outflank-mailman (input) for mailman id 156962;
 Fri, 16 Jul 2021 01:12:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4COi-0008MO-Hn
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:12:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4COi-0007ov-Gq
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:12:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4COi-00083T-G2
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:12: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wxNexCHQEcVFJQB+i/e7eY4+qGqF+gXeXcweLw3XGI0=; b=p4N3RLvCZz7B6lJVgqaoZa3+yk
	8SfyH+8V2wSNiMIDGSCddAbvLcOdNAb8P8WdbTTIeWh4KYuv5qj/Uel011293AV+/n0FsbCW1PJ7e
	DpVNHq+CjgPxHHkVzFuhW/tA9pIFd8On3DP8zfZbnVbQ1IECHw0HQKdxQCpSQMcLP36c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] VT-d: clear_fault_bits() should clear all fault bits
Message-Id: <E1m4COi-00083T-G2@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 01:12:12 +0000

commit 2ba0d81bebe1f9521e407d1874f323564b6c2819
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:21:28 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:21:28 2021 +0200

    VT-d: clear_fault_bits() should clear all fault bits
    
    If there is any way for one fault to be left set in the recording
    registers, there's no reason there couldn't also be multiple ones. If
    PPF set set (being the OR or all F fields), simply loop over the entire
    range of fault recording registers, clearing F everywhere.
    
    Since PPF is a r/o bit, also remove it from DMA_FSTS_FAULTS (arguably
    the constant's name is ambiguous as well).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    
    master commit: 80589800ae62fce43fd3921e8fbd362465fe5ba3
    master date: 2021-06-24 16:29:42 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 16 +++++++++++++---
 xen/drivers/passthrough/vtd/iommu.h |  3 ++-
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 2b3609dae2..d5d3a25852 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2102,13 +2102,23 @@ static int __hwdom_init setup_hwdom_device(u8 devfn, struct pci_dev *pdev)
 
 void clear_fault_bits(struct vtd_iommu *iommu)
 {
-    u64 val;
     unsigned long flags;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
-    val = dmar_readq(iommu->reg, cap_fault_reg_offset(iommu->cap) + 8);
-    dmar_writeq(iommu->reg, cap_fault_reg_offset(iommu->cap) + 8, val);
+
+    if ( dmar_readl(iommu->reg, DMAR_FSTS_REG) & DMA_FSTS_PPF )
+    {
+        unsigned int reg = cap_fault_reg_offset(iommu->cap);
+        unsigned int end = reg + cap_num_fault_regs(iommu->cap);
+
+        do {
+           dmar_writel(iommu->reg, reg + 12, DMA_FRCD_F);
+           reg += PRIMARY_FAULT_REG_LEN;
+        } while ( reg < end );
+    }
+
     dmar_writel(iommu->reg, DMAR_FSTS_REG, DMA_FSTS_FAULTS);
+
     spin_unlock_irqrestore(&iommu->register_lock, flags);
 }
 
diff --git a/xen/drivers/passthrough/vtd/iommu.h b/xen/drivers/passthrough/vtd/iommu.h
index e002dc6f01..32b39c606a 100644
--- a/xen/drivers/passthrough/vtd/iommu.h
+++ b/xen/drivers/passthrough/vtd/iommu.h
@@ -174,7 +174,8 @@
 #define DMA_FSTS_IQE ((u64)1 << 4)
 #define DMA_FSTS_ICE ((u64)1 << 5)
 #define DMA_FSTS_ITE ((u64)1 << 6)
-#define DMA_FSTS_FAULTS    DMA_FSTS_PFO | DMA_FSTS_PPF | DMA_FSTS_AFO | DMA_FSTS_APF | DMA_FSTS_IQE | DMA_FSTS_ICE | DMA_FSTS_ITE
+#define DMA_FSTS_FAULTS (DMA_FSTS_PFO | DMA_FSTS_AFO | DMA_FSTS_APF | \
+                         DMA_FSTS_IQE | DMA_FSTS_ICE | DMA_FSTS_ITE)
 #define dma_fsts_fault_record_index(s) (((s) >> 8) & 0xff)
 
 /* FRCD_REG, 32 bits access */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 01:12:23 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 01:12:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156963.289649 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4COt-0008Pt-8K; Fri, 16 Jul 2021 01:12:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156963.289649; Fri, 16 Jul 2021 01:12:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4COt-0008Pk-4x; Fri, 16 Jul 2021 01:12:23 +0000
Received: by outflank-mailman (input) for mailman id 156963;
 Fri, 16 Jul 2021 01:12:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4COs-0008Pc-Ks
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:12:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4COs-0007p6-K5
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:12:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4COs-00084P-J6
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:12: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=m2pHJmScgX2bfbriB2MqsFtIGL8rzhJgTX/EVtPTpkk=; b=0xcZZQ2yBo5calvajBU/IZOrAd
	4sJQ9xuTVSK9NaTRjW2se56q8FKOLEds/EI8k+kgrw0EC+koU6Kkas41975bvkCP7a+qBAwIhS4vQ
	2vtMlfeiQR/5rM3bU4Q082YbPF2GbZobuTlSXXhFEajfenhXZjNR/hU+kUacu7JVwsEg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] VT-d: don't lose errors when flushing TLBs on multiple IOMMUs
Message-Id: <E1m4COs-00084P-J6@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 01:12:22 +0000

commit 6ba107c3be5090e6c6391ad0133a865ff25a239c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:21:50 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:21:50 2021 +0200

    VT-d: don't lose errors when flushing TLBs on multiple IOMMUs
    
    While no longer an immediate problem with flushes no longer timing out,
    errors (if any) get properly reported by iommu_flush_iotlb_{dsi,psi}().
    Overwriting such an error with, perhaps, a success indicator received
    from another IOMMU will misguide callers. Record the first error, but
    don't bail from the loop (such that further necessary invalidation gets
    carried out on a best effort basis).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: e7059776f9755b989a992d229c68c3d7778412be
    master date: 2021-06-24 16:30:06 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index d5d3a25852..3fcd7208f0 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -643,7 +643,7 @@ static int __must_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
     struct vtd_iommu *iommu;
     bool_t flush_dev_iotlb;
     int iommu_domid;
-    int rc = 0;
+    int ret = 0;
 
     /*
      * No need pcideves_lock here because we have flush
@@ -651,6 +651,8 @@ static int __must_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
      */
     for_each_drhd_unit ( drhd )
     {
+        int rc;
+
         iommu = drhd->iommu;
 
         if ( !test_bit(iommu->index, &hd->arch.vtd.iommu_bitmap) )
@@ -673,13 +675,12 @@ static int __must_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
                                        flush_dev_iotlb);
 
         if ( rc > 0 )
-        {
             iommu_flush_write_buffer(iommu);
-            rc = 0;
-        }
+        else if ( !ret )
+            ret = rc;
     }
 
-    return rc;
+    return ret;
 }
 
 static int __must_check iommu_flush_iotlb_pages(struct domain *d,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 01:12:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 01:12:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156964.289652 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4CP4-0008Sy-9S; Fri, 16 Jul 2021 01:12:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156964.289652; Fri, 16 Jul 2021 01:12:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4CP4-0008Sq-6Z; Fri, 16 Jul 2021 01:12:34 +0000
Received: by outflank-mailman (input) for mailman id 156964;
 Fri, 16 Jul 2021 01:12:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CP2-0008Sg-Ny
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:12:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CP2-0007pM-NC
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:12:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CP2-000858-MR
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:12: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JEMLRxqQvqLMIZGM8ohojJWJ04IB4fdc9pthjadhb+w=; b=34AfqYib5RlvxelEdri9GA58LK
	s4FudNmefp53Cwlq9OnR9MYtx6c+q4mvOpNMxaFepdDzwzOEU70sFIZMG8D3KS5s2pPtDPNvUWBhD
	wdS8DjeG18qABq9yMs17fFNN9/T+117W8QpdvN91cBpFFPHLPBeVq6mH33TTleURprNc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] IOMMU/PCI: don't let domain cleanup continue when device de-assignment failed
Message-Id: <E1m4CP2-000858-MR@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 01:12:32 +0000

commit 7b658fd273f9697975572585e1c80685b287dce9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:22:18 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:22:18 2021 +0200

    IOMMU/PCI: don't let domain cleanup continue when device de-assignment failed
    
    Failure here could in principle mean the device may still be issuing DMA
    requests, which would continue to be translated by the page tables the
    device entry currently points at. With this we cannot allow the
    subsequent cleanup step of freeing the page tables to occur, to prevent
    use-after-free issues. We would need to accept, for the time being, that
    in such a case the remaining domain resources will all be leaked, and
    the domain will continue to exist as a zombie.
    
    However, with flushes no longer timing out (and with proper timeout
    detection for device I/O TLB flushing yet to be implemented), there's no
    way anymore for failures to occur, except due to bugs elsewhere. Hence
    the change here is merely a "just in case" one.
    
    In order to continue the loop in spite of an error, we can't use
    pci_get_pdev_by_domain() anymore. I have no idea why it was used here in
    the first place, instead of the cheaper list iteration.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: f591755823a7e94fc6b4b8ddce71f0421a94fa09
    master date: 2021-06-25 14:06:55 +0200
---
 xen/drivers/passthrough/pci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 705137f8be..a9e3ac906f 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -894,7 +894,7 @@ static int deassign_device(struct domain *d, uint16_t seg, uint8_t bus,
 
 int pci_release_devices(struct domain *d)
 {
-    struct pci_dev *pdev;
+    struct pci_dev *pdev, *tmp;
     u8 bus, devfn;
     int ret;
 
@@ -905,15 +905,15 @@ int pci_release_devices(struct domain *d)
         pcidevs_unlock();
         return ret;
     }
-    while ( (pdev = pci_get_pdev_by_domain(d, -1, -1, -1)) )
+    list_for_each_entry_safe ( pdev, tmp, &d->pdev_list, domain_list )
     {
         bus = pdev->bus;
         devfn = pdev->devfn;
-        deassign_device(d, pdev->seg, bus, devfn);
+        ret = deassign_device(d, pdev->seg, bus, devfn) ?: ret;
     }
     pcidevs_unlock();
 
-    return 0;
+    return ret;
 }
 
 #define PCI_CLASS_BRIDGE_HOST    0x0600
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 01:12:44 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 01:12:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156965.289656 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4CPE-0008Vv-B7; Fri, 16 Jul 2021 01:12:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156965.289656; Fri, 16 Jul 2021 01:12:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4CPE-0008Vl-84; Fri, 16 Jul 2021 01:12:44 +0000
Received: by outflank-mailman (input) for mailman id 156965;
 Fri, 16 Jul 2021 01:12:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CPC-0008Vb-R2
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:12:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CPC-0007pX-QI
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:12:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CPC-00086H-PO
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:12: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yg3GPQ1g86EWN2nx7lPJKZhJVgVcKoknsqbidlAZAZg=; b=P667n97XwiZEDebJMm83caW4QZ
	bC8UC4xp7laE8wCdtRgqBO9lLVt341kPr0pa0S7lc4B5MwmzLk60UopQKjv+EAUGcAQmrRchfJI8O
	5DmjsagIODmvqghITMaY2oC+7vfVrJmlfT1GVufkTIkSsy8s28Qrs4UjwGrWLMOAGOqc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] build: fix %.s: %.S rule
Message-Id: <E1m4CPC-00086H-PO@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 01:12:42 +0000

commit 16d2641ddf8bcce8bf0d73df0d54bcd38ca32051
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Jul 15 09:22:43 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:22:43 2021 +0200

    build: fix %.s: %.S rule
    
    Fixes: e321576f4047 ("xen/build: start using if_changed")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: d468f9522174114ab06239894b6079c0a487e408
    master date: 2021-07-05 16:47:51 +0200
---
 xen/Rules.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index ceb3d204b8..d65d6a4899 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -227,8 +227,8 @@ cmd_cpp_i_c = $(CPP) $(filter-out -Wa$(comma)%,$(c_flags)) -MQ $@ -o $@ $<
 quiet_cmd_cc_s_c = CC      $@
 cmd_cc_s_c = $(CC) $(filter-out -Wa$(comma)%,$(c_flags)) -S $< -o $@
 
-quiet_cmd_s_S = CPP     $@
-cmd_s_S = $(CPP) $(filter-out -Wa$(comma)%,$(a_flags)) -MQ $@ -o $@ $<
+quiet_cmd_cpp_s_S = CPP     $@
+cmd_cpp_s_S = $(CPP) $(filter-out -Wa$(comma)%,$(a_flags)) -MQ $@ -o $@ $<
 
 %.i: %.c FORCE
 	$(call if_changed,cpp_i_c)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 01:12:54 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 01:12:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156966.289660 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4CPO-00007Z-CQ; Fri, 16 Jul 2021 01:12:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156966.289660; Fri, 16 Jul 2021 01:12:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4CPO-00007R-9Y; Fri, 16 Jul 2021 01:12:54 +0000
Received: by outflank-mailman (input) for mailman id 156966;
 Fri, 16 Jul 2021 01:12:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CPM-00007H-Tv
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:12:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CPM-0007q5-TA
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:12:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CPM-000873-SX
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9RIZjkke5833oW9m09T75gFW9BNccH51d/QtQRGdF9E=; b=gz/O7kLBtfqnVnSNiBsvOeBz1Y
	GPohOAM0zCVMnsW0aA8zB+Qapo3bDUl8vL1alQ+swPgKy2RHGlZUHyPNe8JlgrwQMGlTzX5VGYzzV
	aebmu8XMwcbQmoJa+eqsA0/kk2nX9vpvm9v0F8BZ0UzFVscDoiVLA9NKpOafABDX8/Kc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] x86/mem-sharing: ensure consistent lock order in get_two_gfns()
Message-Id: <E1m4CPM-000873-SX@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 01:12:52 +0000

commit e6d098e4cd65149a71fd1a181e53185ec205efc6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:23:10 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:23:10 2021 +0200

    x86/mem-sharing: ensure consistent lock order in get_two_gfns()
    
    While the comment validly says "Sort by domain, if same domain by gfn",
    the implementation also included equal domain IDs in the first part of
    the check, thus rending the second part entirely dead and leaving
    deadlock potential when there's only a single domain involved.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
    master commit: 09af2d01a2fe6a0af08598bdfe12c9707f4d82ba
    master date: 2021-07-07 12:35:12 +0200
---
 xen/include/asm-x86/p2m.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 7d63f5787e..3514f1e1a3 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -576,7 +576,7 @@ do {                                                    \
     dest ## _t   = (source ## t)   ?: &scratch_t;       \
 } while (0)
 
-    if ( (rd->domain_id <= ld->domain_id) ||
+    if ( (rd->domain_id < ld->domain_id) ||
          ((rd == ld) && (gfn_x(rgfn) <= gfn_x(lgfn))) )
     {
         assign_pointers(first, r);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 01:13:04 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 01:13:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.156967.289663 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4CPY-0000AX-ER; Fri, 16 Jul 2021 01:13:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 156967.289663; Fri, 16 Jul 2021 01:13:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4CPY-0000AP-B5; Fri, 16 Jul 2021 01:13:04 +0000
Received: by outflank-mailman (input) for mailman id 156967;
 Fri, 16 Jul 2021 01:13:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CPX-00009t-0X
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:13:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CPW-0007qY-Vv
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:13:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4CPW-00088p-VJ
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 01:13: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ztMMGLzv9cM/ibJelxnYIXY+1UoJomITnf27c6GhxV4=; b=1lzs7sKn9KZtxynWCHLc/D88bT
	RD4s5LrBoHLMTyLJpMVJ4b0Bv3I80RkxYCfxQNTSpyNkjaYgxjLdjTlFXYtJ4UkZmvc0rBD1gRYw7
	N/WtMPiqKSwyTEsl83QhfD8HsKDzVPhXzM6xGVPmqWA3CteCSU3c354kzPwuIrQ2cWsE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] build: clean "lib.a"
Message-Id: <E1m4CPW-00088p-VJ@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 01:13:02 +0000

commit 1a6824957d051bb94929a1c74a52c013bc2f388d
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Jul 15 09:23:41 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:23:41 2021 +0200

    build: clean "lib.a"
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 3ce2765ac21dbd739e8216694b025aaabf4afff3
    master date: 2021-07-07 17:51:18 +0200
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index d4a7014f59..ae2fa0fda3 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -339,7 +339,7 @@ _clean: delete-unfresh-files
 	$(MAKE) $(clean) test
 	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) clean
 	find . \( -name "*.o" -o -name ".*.d" -o -name ".*.d2" \
-		-o -name "*.gcno" -o -name ".*.cmd" \) -exec rm -f {} \;
+		-o -name "*.gcno" -o -name ".*.cmd" -o -name "lib.a" \) -exec rm -f {} \;
 	rm -f include/asm $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET).efi.map $(TARGET)-syms $(TARGET)-syms.map *~ core
 	rm -f include/asm-*/asm-offsets.h
 	rm -f .banner
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 06:33:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 06:33:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157002.289747 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4HPF-0006m3-Bs; Fri, 16 Jul 2021 06:33:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157002.289747; Fri, 16 Jul 2021 06:33:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4HPF-0006lt-8U; Fri, 16 Jul 2021 06:33:05 +0000
Received: by outflank-mailman (input) for mailman id 157002;
 Fri, 16 Jul 2021 06:33:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HPE-0006kT-2h
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:33:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HPE-0005go-1j
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HPE-0006jE-0j
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qvt0K9h8Z3tIciZX41V/H+Luc8BdXBCmPM66THjF2Qc=; b=fZbHaMRzKsNPo5vCYIk2jEtxG/
	iuoPWUmmU+ABCnkHC/cYy8Pting58vZ3k/l5dpVbhQrBFf17ElBQuzcrmhiSKXQX/QwKloxAZLRbK
	99tVi8Zxg0WOEbeUyGAR3DigBBLjgDBEaqkaRppMyICUcH/fJX9rusyqnKUgKJutm3F0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/tsx: Fix backport of "x86/cpuid: Rework HLE and RTM handling"
Message-Id: <E1m4HPE-0006jE-0j@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 06:33:04 +0000

commit 1f27fc448bc6898ffd7628b42c0847548b54d2fb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jul 16 08:26:33 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 16 08:26:33 2021 +0200

    x86/tsx: Fix backport of "x86/cpuid: Rework HLE and RTM handling"
    
    The backport dropped the hunk deleting the setup_clear_cpu_cap() for HLE/RTM,
    but retained the hunk adding setup_force_cpu_cap().
    
    Calling both force and clear on the same feature elicits an error, and clear
    takes precedence, which breaks the part of the bugfix which makes migration
    from older versions of Xen function safe for VMs using TSX.
    
    Fixes: f17d848c4caa ("x86/cpuid: Rework HLE and RTM handling")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/spec_ctrl.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
index 33343062a7..1cfd02d7d7 100644
--- a/xen/arch/x86/spec_ctrl.c
+++ b/xen/arch/x86/spec_ctrl.c
@@ -1150,9 +1150,6 @@ void __init init_speculation_mitigations(void)
          ((hw_smt_enabled && opt_smt) ||
           !boot_cpu_has(X86_FEATURE_SC_VERW_IDLE)) )
     {
-        setup_clear_cpu_cap(X86_FEATURE_HLE);
-        setup_clear_cpu_cap(X86_FEATURE_RTM);
-
         opt_tsx = 0;
         tsx_init();
     }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 06:44:06 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 06:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157023.289777 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4HZr-0000yJ-Rx; Fri, 16 Jul 2021 06:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157023.289777; Fri, 16 Jul 2021 06:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4HZr-0000yB-Ow; Fri, 16 Jul 2021 06:44:03 +0000
Received: by outflank-mailman (input) for mailman id 157023;
 Fri, 16 Jul 2021 06:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HZq-0000y5-3Y
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HZq-0005xT-1h
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HZq-0007eY-0m
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4IrphRruXJixn9tYBFkEx09qHpKiwvVYwQ9OOf6TlXE=; b=Rg5d84L8a91WQRIpmeof4/zdrD
	4Deapm5A8oOWQPGBcmzz3wUWfzuTzJ4msIt/pbCymsq3pWFDSZu1qT4i7INoJ8KuS2loEQ6iZzLz7
	S+bkZK362hS4Z1O7ZmdwGxhxczqnw2YP01PgaEj2NiQx9gptfGEAVqh6JPcaI2rZmPLo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] there's no CONFIG_GCC_VERSION
Message-Id: <E1m4HZq-0007eY-0m@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 06:44:02 +0000

commit 948b7c859d9fede2c4296777343635ac6c341fa8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:37:11 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:37:11 2021 +0200

    there's no CONFIG_GCC_VERSION
    
    This was introduced in 4.14 only.
    
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/compiler.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h
index 85cbd1ab00..b1c0374dfe 100644
--- a/xen/include/xen/compiler.h
+++ b/xen/include/xen/compiler.h
@@ -99,7 +99,7 @@
     __asm__ ("" : "=r"(__ptr) : "0"(ptr));      \
     (typeof(ptr)) (__ptr + (off)); })
 
-#if CONFIG_GCC_VERSION >= 110000 /* See gcc bug 100680. */
+#if __GNUC__ >= 11 /* See gcc bug 100680. */
 # define gcc11_wrap(x) RELOC_HIDE(x, 0)
 #else
 # define gcc11_wrap(x) (x)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 06:44:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 06:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157024.289782 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4Ha1-00011U-UA; Fri, 16 Jul 2021 06:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157024.289782; Fri, 16 Jul 2021 06:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4Ha1-00011M-QQ; Fri, 16 Jul 2021 06:44:13 +0000
Received: by outflank-mailman (input) for mailman id 157024;
 Fri, 16 Jul 2021 06:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Ha0-000118-5i
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Ha0-0005xg-4z
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Ha0-0007fH-3z
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=iTPbLECOvPyXe1mIKw6pHQQ4iEWCHWbFNaTwSlsXgLU=; b=keVOIqhZfbwGoMpu9s2H3sD/dH
	tf6jOxqiBONgifCM52RVa7aqVd8M1PZ8To9ua7/AS4ko9f3qWcdRrgu6kYKSNw55MLUnkNDcBn6jY
	4j5mQDkwqSmO1dSepqZIWO23YTz1ghAoZrknx7aoFtyUL6AbppJOdscvVMDTyKkRNvBY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] SUPPORT.md: Un-shimmed 32-bit PV guests are no longer supported
Message-Id: <E1m4Ha0-0007fH-3z@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 06:44:12 +0000

commit 64752a9bda8dc80a02456405607aba2d085dd3f2
Author:     George Dunlap <george.dunlap@citrix.com>
AuthorDate: Thu Jul 15 09:37:34 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:37:34 2021 +0200

    SUPPORT.md: Un-shimmed 32-bit PV guests are no longer supported
    
    The support status of 32-bit guests doesn't seem particularly useful.
    
    Reported-by: Jann Horn <jannh@google.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 1a0f2fe2297d122a08fee2b26de5de995fdeca13
    master date: 2021-06-04 17:24:05 +0100
---
 SUPPORT.md | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index b8fc04e934..3f4a01101e 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -82,14 +82,7 @@ No hardware requirements
 
     Status, x86_64: Supported
     Status, x86_32, shim: Supported
-    Status, x86_32, without shim: Supported, with caveats
-
-Due to architectural limitations,
-32-bit PV guests must be assumed to be able to read arbitrary host memory
-using speculative execution attacks.
-Advisories will continue to be issued
-for new vulnerabilities related to un-shimmed 32-bit PV guests
-enabling denial-of-service attacks or privilege escalation attacks.
+    Status, x86_32, without shim: Supported, not security supported
 
 ### x86/HVM
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 06:44:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 06:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157025.289785 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4HaB-00014Z-W4; Fri, 16 Jul 2021 06:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157025.289785; Fri, 16 Jul 2021 06:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4HaB-00014R-SF; Fri, 16 Jul 2021 06:44:23 +0000
Received: by outflank-mailman (input) for mailman id 157025;
 Fri, 16 Jul 2021 06:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HaA-000143-8y
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HaA-0005xs-8F
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HaA-0007g5-7L
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:44: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nb3XlIrr7roliohsvezWjpNSeIS5AqjrfyAOJrMgtz4=; b=W7i7M0LCX0lLmUuRWOUHTK99/w
	I35u5BXRV37CCgYnisTwq91IgnT4gEnR565OYnlhU80IZmwxQq/ix5xBulVe1PN4uXdTAkVKpeOIK
	pHCZZFXbp42z5bLAfhWfDznRBiICZ1RlKLU9k0kf6L3FFdfDL0gkR3Mf7BVpu8nvFBtM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] credit2: make sure we pick a runnable unit from the runq if there is one
Message-Id: <E1m4HaA-0007g5-7L@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 06:44:22 +0000

commit 5aacd077c40c14995850736be956e3094e55964b
Author:     Dario Faggioli <dfaggioli@suse.com>
AuthorDate: Thu Jul 15 09:38:47 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:38:47 2021 +0200

    credit2: make sure we pick a runnable unit from the runq if there is one
    
    A !runnable unit (temporarily) present in the runq may cause us to
    stop scanning the runq itself too early. Of course, we don't run any
    non-runnable vCPUs, but we end the scan and we fallback to picking
    the idle unit. In other word, this prevent us to find there and pick
    the actual unit that we're meant to start running (which might be
    further ahead in the runq).
    
    Depending on the vCPU pinning configuration, this may lead to such
    unit to be stuck in the runq for long time, causing malfunctioning
    inside the guest.
    
    Fix this by checking runnable/non-runnable status up-front, in the runq
    scanning function.
    
    Reported-by: Michał Leszczyński <michal.leszczynski@cert.pl>
    Reported-by: Dion Kant <g.w.kant@hunenet.nl>
    Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 07b0eb5d0ef0be154606aa46b5b4c5c59b158505
    master date: 2021-06-07 13:16:36 +0100
---
 xen/common/sched_credit2.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index ce7c56147b..fab6ac7aff 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -3368,6 +3368,10 @@ runq_candidate(struct csched2_runqueue_data *rqd,
                         (unsigned char *)&d);
         }
 
+        /* Skip non runnable units that we (temporarily) have in the runq */
+        if ( unlikely(!unit_runnable_state(svc->unit)) )
+            continue;
+
         /* Only consider vcpus that are allowed to run on this processor. */
         if ( !cpumask_test_cpu(cpu, svc->unit->cpu_hard_affinity) )
             continue;
@@ -3401,8 +3405,7 @@ runq_candidate(struct csched2_runqueue_data *rqd,
          * some budget, then choose it.
          */
         if ( (yield || svc->credit > snext->credit) &&
-             (!has_cap(svc) || unit_grab_budget(svc)) &&
-             unit_runnable_state(svc->unit) )
+             (!has_cap(svc) || unit_grab_budget(svc)) )
             snext = svc;
 
         /* In any case, if we got this far, break. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 06:44:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 06:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157026.289790 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4HaM-00017r-3K; Fri, 16 Jul 2021 06:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157026.289790; Fri, 16 Jul 2021 06:44:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4HaL-00017e-Vt; Fri, 16 Jul 2021 06:44:33 +0000
Received: by outflank-mailman (input) for mailman id 157026;
 Fri, 16 Jul 2021 06:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HaK-00017P-Cd
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HaK-0005yA-Bq
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HaK-0007h8-Ao
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:44: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=g6tuk0ZX6OUh7kFeAuA74uaPeTCyUIXuFPzUInZyw/s=; b=guluIEuhH7P8ajmUu/dsUr/4KA
	vQ5f2szrNW6lnrgeiQbaCWLavB7DEf7eKGf13d4l5eQIZmEAqLX63c6m52TksnpB5iw/dLY3cNV+9
	Wl0/l2C3/g5v2e0PdekaZ7VdkueROil069NRHHBvGGr+XRtkjI+ZO34c0Ye/5LpRn6xg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen: credit2: fix per-entity load tracking when continuing running
Message-Id: <E1m4HaK-0007h8-Ao@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 06:44:32 +0000

commit 2c9da5f73c3a2378036c982bf0b189b34befc403
Author:     Dario Faggioli <dfaggioli@suse.com>
AuthorDate: Thu Jul 15 09:39:32 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:39:32 2021 +0200

    xen: credit2: fix per-entity load tracking when continuing running
    
    If we schedule, and the current vCPU continues to run, its statistical
    load is not properly updated, resulting in something like this, even if
    all the 8 vCPUs are 100% busy:
    
    (XEN) Runqueue 0:
    (XEN) [...]
    (XEN)   aveload            = 2097152 (~800%)
    (XEN) [...]
    (XEN)   Domain: 0 w 256 c 0 v 8
    (XEN)     1: [0.0] flags=2 cpu=4 credit=9996885 [w=256] load=35 (~0%)
    (XEN)     2: [0.1] flags=2 cpu=2 credit=9993725 [w=256] load=796 (~0%)
    (XEN)     3: [0.2] flags=2 cpu=1 credit=9995885 [w=256] load=883 (~0%)
    (XEN)     4: [0.3] flags=2 cpu=5 credit=9998833 [w=256] load=487 (~0%)
    (XEN)     5: [0.4] flags=2 cpu=6 credit=9998942 [w=256] load=1595 (~0%)
    (XEN)     6: [0.5] flags=2 cpu=0 credit=9994669 [w=256] load=22 (~0%)
    (XEN)     7: [0.6] flags=2 cpu=7 credit=9997706 [w=256] load=0 (~0%)
    (XEN)     8: [0.7] flags=2 cpu=3 credit=9992440 [w=256] load=0 (~0%)
    
    As we can see, the average load of the runqueue as a whole is, instead,
    computed properly.
    
    This issue would, in theory, potentially affect Credit2 load balancing
    logic. In practice, however, the problem only manifests (at least with
    these characteristics) when there is only 1 runqueue active in the
    cpupool, which also means there is no need to do any load-balancing.
    
    Hence its real impact is pretty much limited to wrong per-vCPU load
    percentages, when looking at the output of the 'r' debug-key.
    
    With this patch, the load is updated and displayed correctly:
    
    (XEN) Runqueue 0:
    (XEN) [...]
    (XEN)   aveload            = 2097152 (~800%)
    (XEN) [...]
    (XEN) Domain info:
    (XEN)   Domain: 0 w 256 c 0 v 8
    (XEN)     1: [0.0] flags=2 cpu=4 credit=9995584 [w=256] load=262144 (~100%)
    (XEN)     2: [0.1] flags=2 cpu=6 credit=9992992 [w=256] load=262144 (~100%)
    (XEN)     3: [0.2] flags=2 cpu=3 credit=9998918 [w=256] load=262118 (~99%)
    (XEN)     4: [0.3] flags=2 cpu=5 credit=9996867 [w=256] load=262144 (~100%)
    (XEN)     5: [0.4] flags=2 cpu=1 credit=9998912 [w=256] load=262144 (~100%)
    (XEN)     6: [0.5] flags=2 cpu=2 credit=9997842 [w=256] load=262144 (~100%)
    (XEN)     7: [0.6] flags=2 cpu=7 credit=9994623 [w=256] load=262144 (~100%)
    (XEN)     8: [0.7] flags=2 cpu=0 credit=9991815 [w=256] load=262144 (~100%)
    
    Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 89052b9fa24bf976924e40918fc9fa3b1b940e17
    master date: 2021-06-07 13:17:06 +0100
---
 xen/common/sched_credit2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index fab6ac7aff..8ba741e379 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -3554,6 +3554,8 @@ static void csched2_schedule(
             runq_remove(snext);
             __set_bit(__CSFLAG_scheduled, &snext->flags);
         }
+        else
+            update_load(ops, rqd, snext, 0, now);
 
         /* Clear the idle mask if necessary */
         if ( cpumask_test_cpu(sched_cpu, &rqd->idle) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 06:44:43 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 06:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157027.289794 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4HaV-0001B1-4N; Fri, 16 Jul 2021 06:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157027.289794; Fri, 16 Jul 2021 06:44:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4HaV-0001Aq-16; Fri, 16 Jul 2021 06:44:43 +0000
Received: by outflank-mailman (input) for mailman id 157027;
 Fri, 16 Jul 2021 06:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HaU-0001Ak-FZ
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:44:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HaU-0005yT-En
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HaU-0007hq-E0
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:44: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1JUn6ti8EuWQGOFnSVSDbwpABjvbH6mbZqWCLMN+q3c=; b=m3FmCHFpnI6LZwaaIK9yhvXs3j
	/gIX/fqtYCgdns3o0OgP8FbC+yp/leH4pkCFn1p+gaevcUdu9BSdOrBPWNhPpWdCmWtmowzWnD8xB
	eSJ0CnXvjZZOM1oQzSNNaInwXakRjnOdFXN5lUZMiPI1LOmyFTUVY799asq5mYRnPQU0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/cpuid: Fix HLE and RTM handling (again)
Message-Id: <E1m4HaU-0007hq-E0@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 06:44:42 +0000

commit 9eece400c626655b826d5b1b4933e65af3073ab8
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jul 15 09:40:02 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:40:02 2021 +0200

    x86/cpuid: Fix HLE and RTM handling (again)
    
    For reasons which are my fault, but I don't recall why, the
    FDP_EXCP_ONLY/NO_FPU_SEL adjustment uses the whole special_features[] array
    element, not the two relevant bits.
    
    HLE and RTM were recently added to the list of special features, causing them
    to be always set in guest view, irrespective of the toolstacks choice on the
    matter.
    
    Rewrite the logic to refer to the features specifically, rather than relying
    on the contents of the special_features[] array.
    
    Fixes: 8fe24090d9 ("x86/cpuid: Rework HLE and RTM handling")
    Reported-by: Edwin Török <edvin.torok@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 60fa12dbf1d4d2c4ffe1ef34b495b24aa7e41aa0
    master date: 2021-06-07 15:43:35 +0100
---
 xen/arch/x86/cpuid.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c
index 27132f91a6..18bb0faf34 100644
--- a/xen/arch/x86/cpuid.c
+++ b/xen/arch/x86/cpuid.c
@@ -563,9 +563,11 @@ void recalculate_cpuid_policy(struct domain *d)
     sanitise_featureset(fs);
 
     /* Fold host's FDP_EXCP_ONLY and NO_FPU_SEL into guest's view. */
-    fs[FEATURESET_7b0] &= ~special_features[FEATURESET_7b0];
+    fs[FEATURESET_7b0] &= ~(cpufeat_mask(X86_FEATURE_FDP_EXCP_ONLY) |
+                            cpufeat_mask(X86_FEATURE_NO_FPU_SEL));
     fs[FEATURESET_7b0] |= (host_cpuid_policy.feat._7b0 &
-                           special_features[FEATURESET_7b0]);
+                           (cpufeat_mask(X86_FEATURE_FDP_EXCP_ONLY) |
+                            cpufeat_mask(X86_FEATURE_NO_FPU_SEL)));
 
     cpuid_featureset_to_policy(fs, p);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 06:44:53 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 06:44:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157028.289796 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4Haf-0001Dv-5s; Fri, 16 Jul 2021 06:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157028.289796; Fri, 16 Jul 2021 06:44:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4Haf-0001Dn-2f; Fri, 16 Jul 2021 06:44:53 +0000
Received: by outflank-mailman (input) for mailman id 157028;
 Fri, 16 Jul 2021 06:44:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Hae-0001Df-IZ
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:44:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Hae-0005yy-Ht
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Hae-0007im-Gw
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:44: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sBqANExoUevL3WmPUsKwh5uRwgClees9BhL390ZUPQU=; b=0Fc8TNsevk8jF3xSwigD+lig57
	jYsky7303P7//bQoUckmaKPL567ekgw0Pzb5fAvz+1k/YVEKFZcZu/e0CRaq7WrSEiMjWGkfHGadC
	9OPqH1K1fNzPkCF4cYMvVoJcX2rgolPa2teo25QkosHB+e/F8ut/VBd8Alxj7g98Glvs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/vpt: fully init timers before putting onto list
Message-Id: <E1m4Hae-0007im-Gw@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 06:44:52 +0000

commit 84bc28f8fa4b9c18107f8704257bab34190998b3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:40:29 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:40:29 2021 +0200

    x86/vpt: fully init timers before putting onto list
    
    With pt_vcpu_lock() no longer acquiring the pt_migrate lock, parties
    iterating the list and acting on the timers of the list entries will no
    longer be kept from entering their loops by create_periodic_time()'s
    holding of that lock. Therefore at least init_timer() needs calling
    ahead of list insertion, but keep this and set_timer() together.
    
    Fixes: 8113b02f0bf8 ("x86/vpt: do not take pt_migrate rwlock in some cases")
    Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    master commit: 6d622f3a96bbd76ce8422c6e3805e6609417ec76
    master date: 2021-06-15 15:14:20 +0200
---
 xen/arch/x86/hvm/vpt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index a644e3ce53..af92dfbae2 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -553,14 +553,14 @@ void create_periodic_time(
     pt->cb = cb;
     pt->priv = data;
 
+    init_timer(&pt->timer, pt_timer_fn, pt, v->processor);
+    set_timer(&pt->timer, pt->scheduled);
+
     pt_vcpu_lock(v);
     pt->on_list = 1;
     list_add(&pt->list, &v->arch.hvm.tm_list);
     pt_vcpu_unlock(v);
 
-    init_timer(&pt->timer, pt_timer_fn, pt, v->processor);
-    set_timer(&pt->timer, pt->scheduled);
-
     write_unlock(&v->domain->arch.hvm.pl_time->pt_migrate);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 06:45:03 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 06:45:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157029.289801 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4Hap-0001Gj-7S; Fri, 16 Jul 2021 06:45:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157029.289801; Fri, 16 Jul 2021 06:45:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4Hap-0001Ga-4B; Fri, 16 Jul 2021 06:45:03 +0000
Received: by outflank-mailman (input) for mailman id 157029;
 Fri, 16 Jul 2021 06:45:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Hao-0001GS-M2
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:45:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Hao-0005za-L9
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Hao-0007jl-KA
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:45: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cLLyE/c6p+Ajd1d4ydU+TLm5ax0OxuhaQAjUo6EpxnM=; b=Y25iOlO3iHh9wiegReppHBmxm0
	J4FqJfPtUZ9enqin/tskVJ2/YirMF7pnbkd8A0ohZFG1tqIWQEuezc3mP4SSiYkIevVXp6gOj1CPY
	VXC87wuEdHQ69Mh66x7TUMWZrWSdArZm5bR21cTsBO2A7Yt3N4kRkOGgrXV6M/Bk7lxQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] libs/foreignmemory: Fix osdep_xenforeignmemory_map prototype
Message-Id: <E1m4Hao-0007jl-KA@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 06:45:02 +0000

commit 235bfe81f8ced3bba8d74adef02ac92e8d031a55
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Jul 15 09:40:57 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:40:57 2021 +0200

    libs/foreignmemory: Fix osdep_xenforeignmemory_map prototype
    
    Commit cf8c4d3d13b8 made some preparation to have one day
    variable-length-array argument, but didn't declare the array in the
    function prototype the same way as in the function definition. And now
    GCC 11 complains about it.
    
    Fixes: cf8c4d3d13b8 ("tools/libs/foreignmemory: pull array length argument to map forward")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 5d3e4ebb5c71477d74a0c503438545a0126d3863
    master date: 2021-06-15 18:07:58 +0100
---
 tools/libs/foreignmemory/private.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/foreignmemory/private.h b/tools/libs/foreignmemory/private.h
index 8f1bf081ed..e7b2cfa28a 100644
--- a/tools/libs/foreignmemory/private.h
+++ b/tools/libs/foreignmemory/private.h
@@ -32,7 +32,7 @@ int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem);
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, void *addr,
                                  int prot, int flags, size_t num,
-                                 const xen_pfn_t arr[num], int err[num]);
+                                 const xen_pfn_t arr[/*num*/], int err[/*num*/]);
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 06:45:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 06:45:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157030.289805 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4Haz-0001Jy-8n; Fri, 16 Jul 2021 06:45:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157030.289805; Fri, 16 Jul 2021 06:45:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4Haz-0001Jr-5p; Fri, 16 Jul 2021 06:45:13 +0000
Received: by outflank-mailman (input) for mailman id 157030;
 Fri, 16 Jul 2021 06:45:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Hay-0001Jl-P5
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:45:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Hay-0005zr-OL
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:45:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Hay-0007kN-NW
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:45: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=awDxg/Vsu2mxCPmJsHCD0N2SO/ik6zBNc5bKQ/EurtY=; b=Z5TgD0u/9kQ8dOQQEogXYpOBAE
	v8eOFoy/uRspIsEgtUuO5YsA4ZRSds4ewZjZSz5G/1weMddOS3fRdy1a4VEu16CYLhsisUdZ0COUL
	841stw9IKDipLXE42e81Ln42+FhYOs4PuO7HCMWSZqag8A6EUvNPTFKV1eXTrt+HVe00=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] VT-d: undo device mappings upon error
Message-Id: <E1m4Hay-0007kN-NW@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 06:45:12 +0000

commit e39050c566f4b2cdca2354dc8de27d6dc58e703d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:41:48 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:41:48 2021 +0200

    VT-d: undo device mappings upon error
    
    When
     - flushes (supposedly not possible anymore after XSA-373),
     - secondary mappings for legacy PCI devices behind bridges,
     - secondary mappings for chipset quirks, or
     - find_upstream_bridge() invocations
    fail, the successfully established device mappings should not be left
    around.
    
    Further, when (parts of) unmapping fail, simply returning an error is
    typically not enough. Crash the domain instead in such cases, arranging
    for domain cleanup to continue in a best effort manner despite such
    failures.
    
    Finally make domain_context_unmap()'s error behavior consistent in the
    legacy PCI device case: Don't bail from the function in one special
    case, but always just exit the switch statement.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: f3401d65d9f0dce508c3d7da55de4a093d748ae1
    master date: 2021-06-24 16:28:25 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 57 +++++++++++++++++++++++++++++++------
 1 file changed, 48 insertions(+), 9 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index dfd867d40b..77aaef596a 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1463,9 +1463,15 @@ int domain_context_mapping_one(
     if ( !seg && !rc )
         rc = me_wifi_quirk(domain, bus, devfn, MAP_ME_PHANTOM_FUNC);
 
+    if ( rc )
+        domain_context_unmap_one(domain, iommu, bus, devfn);
+
     return rc;
 }
 
+static int domain_context_unmap(struct domain *d, uint8_t devfn,
+                                struct pci_dev *pdev);
+
 static int domain_context_mapping(struct domain *domain, u8 devfn,
                                   struct pci_dev *pdev)
 {
@@ -1529,16 +1535,21 @@ static int domain_context_mapping(struct domain *domain, u8 devfn,
         if ( ret )
             break;
 
-        if ( find_upstream_bridge(seg, &bus, &devfn, &secbus) < 1 )
-            break;
+        if ( (ret = find_upstream_bridge(seg, &bus, &devfn, &secbus)) < 1 )
+        {
+            if ( !ret )
+                break;
+            ret = -ENXIO;
+        }
 
         /*
          * Mapping a bridge should, if anything, pass the struct pci_dev of
          * that bridge. Since bridges don't normally get assigned to guests,
          * their owner would be the wrong one. Pass NULL instead.
          */
-        ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
-                                         NULL);
+        if ( ret >= 0 )
+            ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
+                                             NULL);
 
         /*
          * Devices behind PCIe-to-PCI/PCIx bridge may generate different
@@ -1555,6 +1566,9 @@ static int domain_context_mapping(struct domain *domain, u8 devfn,
             ret = domain_context_mapping_one(domain, drhd->iommu, secbus, 0,
                                              NULL);
 
+        if ( ret )
+            domain_context_unmap(domain, devfn, pdev);
+
         break;
 
     default:
@@ -1634,6 +1648,19 @@ int domain_context_unmap_one(
     if ( !iommu->drhd->segment && !rc )
         rc = me_wifi_quirk(domain, bus, devfn, UNMAP_ME_PHANTOM_FUNC);
 
+    if ( rc && !is_hardware_domain(domain) && domain != dom_io )
+    {
+        if ( domain->is_dying )
+        {
+            printk(XENLOG_ERR "%pd: error %d unmapping %04x:%02x:%02x.%u\n",
+                   domain, rc, iommu->drhd->segment, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
+            rc = 0; /* Make upper layers continue in a best effort manner. */
+        }
+        else
+            domain_crash(domain);
+    }
+
     return rc;
 }
 
@@ -1688,17 +1715,29 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
 
         tmp_bus = bus;
         tmp_devfn = devfn;
-        if ( find_upstream_bridge(seg, &tmp_bus, &tmp_devfn, &secbus) < 1 )
+        if ( (ret = find_upstream_bridge(seg, &tmp_bus, &tmp_devfn,
+                                         &secbus)) < 1 )
+        {
+            if ( ret )
+            {
+                ret = -ENXIO;
+                if ( !domain->is_dying &&
+                     !is_hardware_domain(domain) && domain != dom_io )
+                {
+                    domain_crash(domain);
+                    /* Make upper layers continue in a best effort manner. */
+                    ret = 0;
+                }
+            }
             break;
+        }
 
         /* PCIe to PCI/PCIx bridge */
         if ( pdev_type(seg, tmp_bus, tmp_devfn) == DEV_TYPE_PCIe2PCI_BRIDGE )
         {
             ret = domain_context_unmap_one(domain, iommu, tmp_bus, tmp_devfn);
-            if ( ret )
-                return ret;
-
-            ret = domain_context_unmap_one(domain, iommu, secbus, 0);
+            if ( !ret )
+                ret = domain_context_unmap_one(domain, iommu, secbus, 0);
         }
         else /* Legacy PCI bridge */
             ret = domain_context_unmap_one(domain, iommu, tmp_bus, tmp_devfn);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 06:45:23 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 06:45:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157031.289809 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4Hb9-0001Mp-B5; Fri, 16 Jul 2021 06:45:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157031.289809; Fri, 16 Jul 2021 06:45:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4Hb9-0001Mh-7g; Fri, 16 Jul 2021 06:45:23 +0000
Received: by outflank-mailman (input) for mailman id 157031;
 Fri, 16 Jul 2021 06:45:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Hb8-0001MY-S6
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:45:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Hb8-000603-RN
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:45:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Hb8-0007lX-QW
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:45: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Hk5wom85JTVh/OOWmvDaPw9si/5J39eDXA4jtWkdnfY=; b=lTWZdLCW2qHy7/mFQkZ4AINxRh
	M2NTXJ5PeGJurzO9OYaL4LHl8pe/Tck5H0CARaBaurRa3T+V9i3ArrZc5/CS9IBfJO8MAHZ7uT5km
	4GF9dWfn86Ch96M80QMBiDw16I4a1G9jqfiHZebh1Keb/oHooHsUDT5wwcQ3PSFkkg0c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] VT-d: adjust domid map updating when unmapping context
Message-Id: <E1m4Hb8-0007lX-QW@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 06:45:22 +0000

commit ddb3edbc9f063a2b798393ca52c236686a11cce6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:42:18 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:42:18 2021 +0200

    VT-d: adjust domid map updating when unmapping context
    
    When an earlier error occurred, cleaning up the domid mapping data is
    wrong, as references likely still exist. The only exception to this is
    when the actual unmapping worked, but some flush failed (supposedly
    impossible after XSA-373). The guest will get crashed in such a case
    though, so add fallback cleanup to domain destruction to cover this
    case. This in turn makes it desirable to silence the dprintk() in
    domain_iommu_domid().
    
    Note that no error will be returned anymore when the lookup fails - in
    the common case lookup failure would already have caused
    domain_context_unmap_one() to fail, yet even from a more general
    perspective it doesn't look right to fail domain_context_unmap() in such
    a case when this was the last device, but not when any earlier unmap was
    otherwise successful.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 32655880057ce2829f962d46916ea6cec60f98d3
    master date: 2021-06-24 16:29:13 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 39 +++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 15 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 77aaef596a..0ee18bdcc3 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -73,9 +73,11 @@ static int domain_iommu_domid(struct domain *d,
         i = find_next_bit(iommu->domid_bitmap, nr_dom, i+1);
     }
 
-    dprintk(XENLOG_ERR VTDPREFIX,
-            "Cannot get valid iommu domid: domid=%d iommu->index=%d\n",
-            d->domain_id, iommu->index);
+    if ( !d->is_dying )
+        dprintk(XENLOG_ERR VTDPREFIX,
+                "Cannot get valid iommu %u domid: %pd\n",
+                iommu->index, d);
+
     return -1;
 }
 
@@ -140,6 +142,17 @@ static int context_get_domain_id(struct context_entry *context,
     return domid;
 }
 
+static void cleanup_domid_map(struct domain *domain, struct vtd_iommu *iommu)
+{
+    int iommu_domid = domain_iommu_domid(domain, iommu);
+
+    if ( iommu_domid >= 0 )
+    {
+        clear_bit(iommu_domid, iommu->domid_bitmap);
+        iommu->domid_map[iommu_domid] = 0;
+    }
+}
+
 static int iommus_incoherent;
 
 static void sync_cache(const void *addr, unsigned int size)
@@ -1752,6 +1765,9 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
         goto out;
     }
 
+    if ( ret )
+        goto out;
+
     /*
      * if no other devices under the same iommu owned by this domain,
      * clear iommu in iommu_bitmap and clear domain_id in domid_bitmp
@@ -1771,19 +1787,8 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
 
     if ( found == 0 )
     {
-        int iommu_domid;
-
         clear_bit(iommu->index, &dom_iommu(domain)->arch.iommu_bitmap);
-
-        iommu_domid = domain_iommu_domid(domain, iommu);
-        if ( iommu_domid == -1 )
-        {
-            ret = -EINVAL;
-            goto out;
-        }
-
-        clear_bit(iommu_domid, iommu->domid_bitmap);
-        iommu->domid_map[iommu_domid] = 0;
+        cleanup_domid_map(domain, iommu);
     }
 
 out:
@@ -1794,6 +1799,7 @@ static void iommu_domain_teardown(struct domain *d)
 {
     struct domain_iommu *hd = dom_iommu(d);
     struct mapped_rmrr *mrmrr, *tmp;
+    const struct acpi_drhd_unit *drhd;
 
     if ( list_empty(&acpi_drhd_units) )
         return;
@@ -1813,6 +1819,9 @@ static void iommu_domain_teardown(struct domain *d)
     iommu_free_pagetable(hd->arch.pgd_maddr, agaw_to_level(hd->arch.agaw));
     hd->arch.pgd_maddr = 0;
     spin_unlock(&hd->arch.mapping_lock);
+
+    for_each_drhd_unit ( drhd )
+        cleanup_domid_map(d, drhd->iommu);
 }
 
 static int __must_check intel_iommu_map_page(struct domain *d, dfn_t dfn,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 06:45:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 06:45:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157032.289814 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4HbK-0001QY-Ev; Fri, 16 Jul 2021 06:45:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157032.289814; Fri, 16 Jul 2021 06:45:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4HbK-0001QQ-Ay; Fri, 16 Jul 2021 06:45:34 +0000
Received: by outflank-mailman (input) for mailman id 157032;
 Fri, 16 Jul 2021 06:45:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HbJ-0001QE-07
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:45:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HbI-000609-UV
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:45:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HbI-0007mK-Tg
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:45: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zmRapFMrYEd0q0ZctZzNOlVKCupUZDJd+CWajHQpimU=; b=oD32O8KhQ8eq6Qd7DJk/4aCyK7
	1GUiVDSxpsEMaLO8dScddzLEUtEuiDhbCxIRCD1FASAzN+a3GnTl7HKs02bPMT5Bqf6O61skN0PS/
	zLR2yWvRPLXBM1qe1n8MntZ0tmLBG1HwNJnBVGA7cXcq4Gn4c+7zUUT4xrLdTwLd6k7o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] VT-d: clear_fault_bits() should clear all fault bits
Message-Id: <E1m4HbI-0007mK-Tg@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 06:45:32 +0000

commit 7907ab8a4f63d7f1d20ede8c91125976496f4f92
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:42:47 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:42:47 2021 +0200

    VT-d: clear_fault_bits() should clear all fault bits
    
    If there is any way for one fault to be left set in the recording
    registers, there's no reason there couldn't also be multiple ones. If
    PPF set set (being the OR or all F fields), simply loop over the entire
    range of fault recording registers, clearing F everywhere.
    
    Since PPF is a r/o bit, also remove it from DMA_FSTS_FAULTS (arguably
    the constant's name is ambiguous as well).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 80589800ae62fce43fd3921e8fbd362465fe5ba3
    master date: 2021-06-24 16:29:42 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 16 +++++++++++++---
 xen/drivers/passthrough/vtd/iommu.h |  3 ++-
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 0ee18bdcc3..2804d0b1b7 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2119,13 +2119,23 @@ static int __hwdom_init setup_hwdom_device(u8 devfn, struct pci_dev *pdev)
 
 void clear_fault_bits(struct vtd_iommu *iommu)
 {
-    u64 val;
     unsigned long flags;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
-    val = dmar_readq(iommu->reg, cap_fault_reg_offset(iommu->cap) + 8);
-    dmar_writeq(iommu->reg, cap_fault_reg_offset(iommu->cap) + 8, val);
+
+    if ( dmar_readl(iommu->reg, DMAR_FSTS_REG) & DMA_FSTS_PPF )
+    {
+        unsigned int reg = cap_fault_reg_offset(iommu->cap);
+        unsigned int end = reg + cap_num_fault_regs(iommu->cap);
+
+        do {
+           dmar_writel(iommu->reg, reg + 12, DMA_FRCD_F);
+           reg += PRIMARY_FAULT_REG_LEN;
+        } while ( reg < end );
+    }
+
     dmar_writel(iommu->reg, DMAR_FSTS_REG, DMA_FSTS_FAULTS);
+
     spin_unlock_irqrestore(&iommu->register_lock, flags);
 }
 
diff --git a/xen/drivers/passthrough/vtd/iommu.h b/xen/drivers/passthrough/vtd/iommu.h
index e002dc6f01..32b39c606a 100644
--- a/xen/drivers/passthrough/vtd/iommu.h
+++ b/xen/drivers/passthrough/vtd/iommu.h
@@ -174,7 +174,8 @@
 #define DMA_FSTS_IQE ((u64)1 << 4)
 #define DMA_FSTS_ICE ((u64)1 << 5)
 #define DMA_FSTS_ITE ((u64)1 << 6)
-#define DMA_FSTS_FAULTS    DMA_FSTS_PFO | DMA_FSTS_PPF | DMA_FSTS_AFO | DMA_FSTS_APF | DMA_FSTS_IQE | DMA_FSTS_ICE | DMA_FSTS_ITE
+#define DMA_FSTS_FAULTS (DMA_FSTS_PFO | DMA_FSTS_AFO | DMA_FSTS_APF | \
+                         DMA_FSTS_IQE | DMA_FSTS_ICE | DMA_FSTS_ITE)
 #define dma_fsts_fault_record_index(s) (((s) >> 8) & 0xff)
 
 /* FRCD_REG, 32 bits access */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 06:45:44 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 06:45:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157033.289817 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4HbU-0001TB-Fb; Fri, 16 Jul 2021 06:45:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157033.289817; Fri, 16 Jul 2021 06:45:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4HbU-0001T3-CT; Fri, 16 Jul 2021 06:45:44 +0000
Received: by outflank-mailman (input) for mailman id 157033;
 Fri, 16 Jul 2021 06:45:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HbT-0001Sp-21
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:45:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HbT-00060P-1F
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:45:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4HbT-0007nJ-0V
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:45: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RdoT6rIlsS7yH3BgFGQr4a2tsZb/R0HREUV9ifWn++w=; b=a0D1qz4ln9QkX+QNmMkRrc2UoI
	anztZqrVnHooHFVLTYrThh11/teSuNm0tLf9unCbhJC7ypsSKj4+cpZHYr3EdvY8VaTEdMl5m2iiy
	JCWfxgcMPboQr5ya1/3W/kagA0FRm+tTqvBgR0qqWETTGRjaO8jN9+hK6ie3pPYb9s80=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] VT-d: don't lose errors when flushing TLBs on multiple IOMMUs
Message-Id: <E1m4HbT-0007nJ-0V@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 06:45:43 +0000

commit 3f3ebda3ccbea1e8a5663693247017015fc79b68
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:43:11 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:43:11 2021 +0200

    VT-d: don't lose errors when flushing TLBs on multiple IOMMUs
    
    While no longer an immediate problem with flushes no longer timing out,
    errors (if any) get properly reported by iommu_flush_iotlb_{dsi,psi}().
    Overwriting such an error with, perhaps, a success indicator received
    from another IOMMU will misguide callers. Record the first error, but
    don't bail from the loop (such that further necessary invalidation gets
    carried out on a best effort basis).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: e7059776f9755b989a992d229c68c3d7778412be
    master date: 2021-06-24 16:30:06 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 2804d0b1b7..38719cf8ec 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -590,7 +590,7 @@ static int __must_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
     struct vtd_iommu *iommu;
     bool_t flush_dev_iotlb;
     int iommu_domid;
-    int rc = 0;
+    int ret = 0;
 
     /*
      * No need pcideves_lock here because we have flush
@@ -598,6 +598,8 @@ static int __must_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
      */
     for_each_drhd_unit ( drhd )
     {
+        int rc;
+
         iommu = drhd->iommu;
 
         if ( !test_bit(iommu->index, &hd->arch.iommu_bitmap) )
@@ -620,13 +622,12 @@ static int __must_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
                                        flush_dev_iotlb);
 
         if ( rc > 0 )
-        {
             iommu_flush_write_buffer(iommu);
-            rc = 0;
-        }
+        else if ( !ret )
+            ret = rc;
     }
 
-    return rc;
+    return ret;
 }
 
 static int __must_check iommu_flush_iotlb_pages(struct domain *d,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 06:45:54 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 06:45:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157034.289821 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4Hbe-0001WI-H0; Fri, 16 Jul 2021 06:45:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157034.289821; Fri, 16 Jul 2021 06:45:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4Hbe-0001WA-EB; Fri, 16 Jul 2021 06:45:54 +0000
Received: by outflank-mailman (input) for mailman id 157034;
 Fri, 16 Jul 2021 06:45:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Hbd-0001W0-4o
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:45:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Hbd-00060u-45
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:45:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Hbd-0007oU-3M
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:45: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EVBqFyueIxQXfwpL0fEQjcwQM5gpcy7RFyAYooSTttg=; b=mzv92wk1MU+RzujOUyt6yegup+
	RTt1VVnkGnKc2zdOgD4wuUEDf0SZu+gwxyKCJ1CVfe4z+9HMvsnQGL4AEmYh3T8fX7m1jwEg3tvBk
	phu8sUlJP7itA3SjlKm/3KPFPxM+zED3Fv16aniqfDXUrmrIMoVCuVMH+/o1lBBGAJA0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] IOMMU/PCI: don't let domain cleanup continue when device de-assignment failed
Message-Id: <E1m4Hbd-0007oU-3M@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 06:45:53 +0000

commit 351c890c4ade59b52dd4822a2d5176fe435d21ed
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:43:38 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:43:38 2021 +0200

    IOMMU/PCI: don't let domain cleanup continue when device de-assignment failed
    
    Failure here could in principle mean the device may still be issuing DMA
    requests, which would continue to be translated by the page tables the
    device entry currently points at. With this we cannot allow the
    subsequent cleanup step of freeing the page tables to occur, to prevent
    use-after-free issues. We would need to accept, for the time being, that
    in such a case the remaining domain resources will all be leaked, and
    the domain will continue to exist as a zombie.
    
    However, with flushes no longer timing out (and with proper timeout
    detection for device I/O TLB flushing yet to be implemented), there's no
    way anymore for failures to occur, except due to bugs elsewhere. Hence
    the change here is merely a "just in case" one.
    
    In order to continue the loop in spite of an error, we can't use
    pci_get_pdev_by_domain() anymore. I have no idea why it was used here in
    the first place, instead of the cheaper list iteration.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: f591755823a7e94fc6b4b8ddce71f0421a94fa09
    master date: 2021-06-25 14:06:55 +0200
---
 xen/drivers/passthrough/pci.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 4385a6760b..32510351cf 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -968,7 +968,7 @@ static int deassign_device(struct domain *d, uint16_t seg, uint8_t bus,
 
 int pci_release_devices(struct domain *d)
 {
-    struct pci_dev *pdev;
+    struct pci_dev *pdev, *tmp;
     u8 bus, devfn;
     int ret;
 
@@ -979,18 +979,15 @@ int pci_release_devices(struct domain *d)
         pcidevs_unlock();
         return ret;
     }
-    while ( (pdev = pci_get_pdev_by_domain(d, -1, -1, -1)) )
+    list_for_each_entry_safe ( pdev, tmp, &d->pdev_list, domain_list )
     {
         bus = pdev->bus;
         devfn = pdev->devfn;
-        if ( deassign_device(d, pdev->seg, bus, devfn) )
-            printk("domain %d: deassign device (%04x:%02x:%02x.%u) failed!\n",
-                   d->domain_id, pdev->seg, bus,
-                   PCI_SLOT(devfn), PCI_FUNC(devfn));
+        ret = deassign_device(d, pdev->seg, bus, devfn) ?: ret;
     }
     pcidevs_unlock();
 
-    return 0;
+    return ret;
 }
 
 #define PCI_CLASS_BRIDGE_HOST    0x0600
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 06:46:04 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 06:46:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157035.289824 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4Hbo-0001ro-Id; Fri, 16 Jul 2021 06:46:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157035.289824; Fri, 16 Jul 2021 06:46:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4Hbo-0001rg-Fh; Fri, 16 Jul 2021 06:46:04 +0000
Received: by outflank-mailman (input) for mailman id 157035;
 Fri, 16 Jul 2021 06:46:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Hbn-0001rU-7j
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:46:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Hbn-00061J-75
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06:46:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4Hbn-0007pc-6F
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 06: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ho2bfcIhzHpVmpzK8xBgNCn0eXa0SCCQT55YXFWdLkw=; b=uERH44XObh2HUoDC0OllGNb3RG
	lzMjwtUoDjfTZE3laSRdDkXQyuv0F58Vq+wP7fzNU+w2FnTYpsc/yx7C5qxZPx+uxA0ij3Ihgysl+
	+tFdeCqiLwkx435g0NFwcNHQ7/pQmIcD1C8K55yRmUIwFZ4htYlIIpJrUQvcOgs7fs4c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/mem-sharing: ensure consistent lock order in get_two_gfns()
Message-Id: <E1m4Hbn-0007pc-6F@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 06:46:03 +0000

commit 1540a9a20dd0c049345a00bfed0a3e8ea98d104b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 15 09:44:20 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jul 15 09:44:20 2021 +0200

    x86/mem-sharing: ensure consistent lock order in get_two_gfns()
    
    While the comment validly says "Sort by domain, if same domain by gfn",
    the implementation also included equal domain IDs in the first part of
    the check, thus rending the second part entirely dead and leaving
    deadlock potential when there's only a single domain involved.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
    master commit: 09af2d01a2fe6a0af08598bdfe12c9707f4d82ba
    master date: 2021-07-07 12:35:12 +0200
---
 xen/include/asm-x86/p2m.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 94285db1b4..2358954039 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -556,7 +556,7 @@ do {                                                    \
     dest ## _t   = (source ## t)   ?: &scratch_t;       \
 } while (0)
 
-    if ( (rd->domain_id <= ld->domain_id) ||
+    if ( (rd->domain_id < ld->domain_id) ||
          ((rd == ld) && (gfn_x(rgfn) <= gfn_x(lgfn))) )
     {
         assign_pointers(first, r);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 20:11:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 20:11:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157699.290432 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4UAr-0005gt-Gx; Fri, 16 Jul 2021 20:11:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157699.290432; Fri, 16 Jul 2021 20:11:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4UAr-0005gk-Dj; Fri, 16 Jul 2021 20:11:05 +0000
Received: by outflank-mailman (input) for mailman id 157699;
 Fri, 16 Jul 2021 20:11:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UAq-0005gc-P2
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:11:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UAq-0003sf-LW
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:11:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UAq-0003ym-KT
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rZXOeT8VdLgx4STAXjakHJe7HgTf98h6nhTci5zAVI8=; b=p0U7IQKXU+wtcNKmj9RmhP36OJ
	ooRXENGD7twgFUip8BO+Hoapp5D3YzNKV/fRl9CjL8JzJ8k93MXvMTjzBT9Vn0KGGIpHbyCSaeek2
	ufHKGfuPxzQ0Ghq9r5YXnhhE3/IGx7eh4bJ7Tl55rcdXaCDHdS483wjKfX2SRqycaqSc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] xen/arm32: SPSR_hyp/SPSR
Message-Id: <E1m4UAq-0003ym-KT@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 20:11:04 +0000

commit 61dea454ba87d4f5c2b900e6dff4f72805d3198c
Author:     Stefano Stabellini <sstabellini@kernel.org>
AuthorDate: Wed Jun 9 10:37:59 2021 -0700
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:07:34 2021 -0700

    xen/arm32: SPSR_hyp/SPSR
    
    SPSR_hyp is not meant to be accessed from Hyp mode (EL2); accesses
    trigger UNPREDICTABLE behaviour. Xen should read/write SPSR instead.
    See: ARM DDI 0487D.b page G8-5993.
    
    This fixes booting Xen/arm32 on QEMU.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
    Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
    (cherry picked from commit dfcffb128be46a3e413eaa941744536fe53c94b6)
---
 xen/arch/arm/arm32/entry.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S
index b228d44b19..8d1327ffe4 100644
--- a/xen/arch/arm/arm32/entry.S
+++ b/xen/arch/arm/arm32/entry.S
@@ -171,7 +171,7 @@ ENDPROC(prepare_context_from_guest)
         mrc     CP32(r11, HSR)                 /* Save exception syndrome */
         str     r11, [sp, #UREGS_hsr]
 
-        mrs     r11, SPSR_hyp
+        mrs     r11, SPSR
         str     r11, [sp, #UREGS_cpsr]
 
         /*
@@ -396,7 +396,7 @@ return_to_hypervisor:
         ldr r11, [sp, #UREGS_pc]
         msr ELR_hyp, r11
         ldr r11, [sp, #UREGS_cpsr]
-        msr SPSR_hyp, r11
+        msr SPSR, r11
 #ifdef CONFIG_ARM32_HARDEN_BRANCH_PREDICTOR
         /*
          * Hardening branch predictor may require to setup a different
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 20:11:15 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 20:11:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157700.290436 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4UB1-0005ip-IB; Fri, 16 Jul 2021 20:11:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157700.290436; Fri, 16 Jul 2021 20:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4UB1-0005ih-FF; Fri, 16 Jul 2021 20:11:15 +0000
Received: by outflank-mailman (input) for mailman id 157700;
 Fri, 16 Jul 2021 20:11:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UB0-0005iZ-PN
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:11:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UB0-0003so-Od
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:11:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UB0-0003zf-NZ
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hpra+MCEcebNnAJvAH3uYlq0U9K7cH9laiOg20nysEs=; b=tR7EZB8xtBcSKDBYeQnp3Jy1Qr
	rl3KEvCHekm4OB/BADQqlQJjD43fatM01YLWwajzMjevQ0zMF2ARr5YcgtnPvrL1IBKIojLBKakvI
	naInKOyjQfaZ1ZJsYSFn/bSnQ6MngCUCQSVugeVjjXGq2NGYoLd6AukvTbg47R29af6s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] Arm32: MSR to SPSR needs qualification
Message-Id: <E1m4UB0-0003zf-NZ@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 20:11:14 +0000

commit 0e1407fc43b2c81de9956eb45251129aa5b92a89
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jun 11 15:04:24 2021 +0200
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:07:39 2021 -0700

    Arm32: MSR to SPSR needs qualification
    
    The Arm ARM's description of MSR (ARM DDI 0406C.d section B9.3.12)
    doesn't even allow for plain "SPSR" here, and while gas accepts this, it
    takes it to mean SPSR_cf. Yet surely all of SPSR wants updating on this
    path, not just the lowest and highest 8 bits.
    
    Fixes: dfcffb128be4 ("xen/arm32: SPSR_hyp/SPSR")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 93031fbe9f4c341a2e7950a088025ea550291433)
---
 xen/arch/arm/arm32/entry.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S
index 8d1327ffe4..b7c70f6e8f 100644
--- a/xen/arch/arm/arm32/entry.S
+++ b/xen/arch/arm/arm32/entry.S
@@ -396,7 +396,7 @@ return_to_hypervisor:
         ldr r11, [sp, #UREGS_pc]
         msr ELR_hyp, r11
         ldr r11, [sp, #UREGS_cpsr]
-        msr SPSR, r11
+        msr SPSR_cxsf, r11
 #ifdef CONFIG_ARM32_HARDEN_BRANCH_PREDICTOR
         /*
          * Hardening branch predictor may require to setup a different
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 20:11:25 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 20:11:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157701.290439 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4UBB-0005li-Je; Fri, 16 Jul 2021 20:11:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157701.290439; Fri, 16 Jul 2021 20:11:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4UBB-0005la-Gk; Fri, 16 Jul 2021 20:11:25 +0000
Received: by outflank-mailman (input) for mailman id 157701;
 Fri, 16 Jul 2021 20:11:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UBA-0005lT-SS
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:11:24 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UBA-0003t5-Rh
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:11:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UBA-00040c-Qi
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=szlRqKgiaF0UVSMeyyuPfrm2w/RfMCBVMBBObt1aXbU=; b=6c8bwzg7B6C93Nw5s88feJpsPK
	VZnidUk0TrSy2P7IEHVUcOuX/ZKT/CDY0bnTPejvdJOvAXJymyTa21IQZten2eRWjYEZkuZMo1h33
	cnV3gQLlTtr+1KWjzlLwujzgiEqwNvExMeX+oTLGg6/oJO56ROUPOZ9NmPLGN8//GRpA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] arm: Modify type of actlr to register_t
Message-Id: <E1m4UBA-00040c-Qi@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 20:11:24 +0000

commit e98cacfaaf157cf11257993b75225e6d0028f433
Author:     Michal Orzel <michal.orzel@arm.com>
AuthorDate: Wed May 5 09:43:01 2021 +0200
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:07:43 2021 -0700

    arm: Modify type of actlr to register_t
    
    AArch64 registers are 64bit whereas AArch32 registers
    are 32bit or 64bit. MSR/MRS are expecting 64bit values thus
    we should get rid of helpers READ/WRITE_SYSREG32
    in favour of using READ/WRITE_SYSREG.
    We should also use register_t type when reading sysregs
    which can correspond to uint64_t or uint32_t.
    Even though many AArch64 registers have upper 32bit reserved
    it does not mean that they can't be widen in the future.
    
    ACTLR_EL1 system register bits are implementation defined
    which means it is possibly a latent bug on current HW as the CPU
    implementer may already have decided to use the top 32bit.
    
    Signed-off-by: Michal Orzel <michal.orzel@arm.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit b80470c84553808fef3a6803000ceee8a100e63c)
---
 xen/arch/arm/domain.c        | 2 +-
 xen/include/asm-arm/domain.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index bdd3d3e5b5..5eaf4c718e 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -330,7 +330,7 @@ static void schedule_tail(struct vcpu *prev)
 
 static void continue_new_vcpu(struct vcpu *prev)
 {
-    current->arch.actlr = READ_SYSREG32(ACTLR_EL1);
+    current->arch.actlr = READ_SYSREG(ACTLR_EL1);
     processor_vcpu_initialise(current);
 
     schedule_tail(prev);
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 1da90f207d..bb0a6adbe0 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -156,7 +156,7 @@ struct arch_vcpu
 
     /* Control Registers */
     register_t sctlr;
-    uint32_t actlr;
+    register_t actlr;
     uint32_t cpacr;
 
     uint32_t contextidr;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 20:11:35 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 20:11:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157702.290444 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4UBL-0005oj-Lg; Fri, 16 Jul 2021 20:11:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157702.290444; Fri, 16 Jul 2021 20:11:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4UBL-0005ob-IN; Fri, 16 Jul 2021 20:11:35 +0000
Received: by outflank-mailman (input) for mailman id 157702;
 Fri, 16 Jul 2021 20:11:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UBK-0005oR-VU
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:11:34 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UBK-0003tG-Uk
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:11:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UBK-00041j-Ti
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fACIuApQT9ut5r5bD1z6tj0MsCX7yMqu4tgTUfmBEhI=; b=7D/nHG33sbADbyg7ZrVOT/qvPM
	e2uIN9OzDgclM1GyUi2rSYOYt2wGQX7IMFeATYEOkg43F4jCFxmFKpz6PF7xSmmmCHH8VAGkrpGIY
	GBOkaoBA3+80uFbf6Idyf5WkCcxbE2u1Cx5hyrxLjewlDDf1a+sWmpbG+pldCej5L2cU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] xen/arm: bootfdt: Always sort memory banks
Message-Id: <E1m4UBK-00041j-Ti@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 20:11:34 +0000

commit dba774896f7dd74773c14d537643b7d7477fefcd
Author:     Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
AuthorDate: Mon Jul 5 20:48:51 2021 +0300
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:08:01 2021 -0700

    xen/arm: bootfdt: Always sort memory banks
    
    At the moment, Xen on Arm64 expects the memory banks to be ordered.
    Unfortunately, there may be a case when updated by firmware
    device tree contains unordered banks. This means Xen will panic
    when setting xenheap mappings for the subsequent bank with start
    address being less than xenheap_mfn_start (start address of
    the first bank).
    
    As there is no clear requirement regarding ordering in the device
    tree, update code to be able to deal with by sorting memory
    banks. There is only one heap region on Arm32, so the sorting
    is fine to be done in the common code.
    
    Suggested-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit 4473f3601098a2c3cf5ab89d5a29504772985e3a)
---
 xen/arch/arm/bootfdt.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
index dcff512648..476e32e0f5 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/arch/arm/bootfdt.c
@@ -13,6 +13,7 @@
 #include <xen/init.h>
 #include <xen/device_tree.h>
 #include <xen/libfdt/libfdt.h>
+#include <xen/sort.h>
 #include <xsm/xsm.h>
 #include <asm/setup.h>
 
@@ -395,6 +396,21 @@ static void __init early_print_info(void)
     printk("\n");
 }
 
+/* This function assumes that memory regions are not overlapped */
+static int __init cmp_memory_node(const void *key, const void *elem)
+{
+    const struct membank *handler0 = key;
+    const struct membank *handler1 = elem;
+
+    if ( handler0->start < handler1->start )
+        return -1;
+
+    if ( handler0->start >= (handler1->start + handler1->size) )
+        return 1;
+
+    return 0;
+}
+
 /**
  * boot_fdt_info - initialize bootinfo from a DTB
  * @fdt: flattened device tree binary
@@ -412,6 +428,15 @@ size_t __init boot_fdt_info(const void *fdt, paddr_t paddr)
     add_boot_module(BOOTMOD_FDT, paddr, fdt_totalsize(fdt), false);
 
     device_tree_for_each_node((void *)fdt, 0, early_scan_node, NULL);
+
+    /*
+     * On Arm64 setup_xenheap_mappings() expects to be called with the lowest
+     * bank in memory first. There is no requirement that the DT will provide
+     * the banks sorted in ascending order. So sort them through.
+     */
+    sort(bootinfo.mem.bank, bootinfo.mem.nr_banks, sizeof(struct membank),
+         cmp_memory_node, NULL);
+
     early_print_info();
 
     return fdt_totalsize(fdt);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 20:22:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 20:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157711.290460 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4ULb-0007Of-O0; Fri, 16 Jul 2021 20:22:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157711.290460; Fri, 16 Jul 2021 20:22:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4ULb-0007OX-L7; Fri, 16 Jul 2021 20:22:11 +0000
Received: by outflank-mailman (input) for mailman id 157711;
 Fri, 16 Jul 2021 20:22:10 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4ULa-0007OR-G8
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:22:10 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4ULa-00043t-Dm
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:22:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4ULa-0004nK-CP
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dL7WpdjLRDMPvflBbVVm7b6Z3Wm6m/LEwkBhzLQa/OU=; b=fqvHTQebr+HQPlNchNVzWIaPbk
	cbbf76nNlTqADWScDDf/gDxf4qJe+fV8Wzw5i9nu72/5fWfyHzSN8NTkUCIUqatafFeWYY3nQ/iKp
	f0tQFV2u4TY6ptjR9+U7J64bFBsR9JZRWK5T+wZMw+MInvy3/fLS07q6Fa5OWUQxS++M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] xen/arm32: SPSR_hyp/SPSR
Message-Id: <E1m4ULa-0004nK-CP@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 20:22:10 +0000

commit bb731fdb76ccf18836990b3235c75a262d9511cd
Author:     Stefano Stabellini <sstabellini@kernel.org>
AuthorDate: Wed Jun 9 10:37:59 2021 -0700
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:11:20 2021 -0700

    xen/arm32: SPSR_hyp/SPSR
    
    SPSR_hyp is not meant to be accessed from Hyp mode (EL2); accesses
    trigger UNPREDICTABLE behaviour. Xen should read/write SPSR instead.
    See: ARM DDI 0487D.b page G8-5993.
    
    This fixes booting Xen/arm32 on QEMU.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
    Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
    (cherry picked from commit dfcffb128be46a3e413eaa941744536fe53c94b6)
---
 xen/arch/arm/arm32/entry.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S
index b228d44b19..8d1327ffe4 100644
--- a/xen/arch/arm/arm32/entry.S
+++ b/xen/arch/arm/arm32/entry.S
@@ -171,7 +171,7 @@ ENDPROC(prepare_context_from_guest)
         mrc     CP32(r11, HSR)                 /* Save exception syndrome */
         str     r11, [sp, #UREGS_hsr]
 
-        mrs     r11, SPSR_hyp
+        mrs     r11, SPSR
         str     r11, [sp, #UREGS_cpsr]
 
         /*
@@ -396,7 +396,7 @@ return_to_hypervisor:
         ldr r11, [sp, #UREGS_pc]
         msr ELR_hyp, r11
         ldr r11, [sp, #UREGS_cpsr]
-        msr SPSR_hyp, r11
+        msr SPSR, r11
 #ifdef CONFIG_ARM32_HARDEN_BRANCH_PREDICTOR
         /*
          * Hardening branch predictor may require to setup a different
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 20:22:21 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 20:22:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157712.290463 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4ULl-0007QZ-PQ; Fri, 16 Jul 2021 20:22:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157712.290463; Fri, 16 Jul 2021 20:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4ULl-0007QS-Md; Fri, 16 Jul 2021 20:22:21 +0000
Received: by outflank-mailman (input) for mailman id 157712;
 Fri, 16 Jul 2021 20:22:20 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4ULk-0007QK-Ht
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:22:20 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4ULk-000441-H8
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:22:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4ULk-0004oc-G0
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GRbzPcuC4fuKCI9QxaM0yxSVXJzMpYMA02cPpZDbMB8=; b=adbjdgC+vyd+lwRlzukRB7qfPA
	QqHITRrQ3XtWkAeg1+fumP2KVzRg07Nk5gFq5D009N8S40qayTmyAeGUasM5QpuVm+rFSAx1ilJPi
	hxxMYx5h8gzLoZ5FogWY05X0jknLMj+kisBpPkepeeXL+vVkxEp9qmhnu2GS0U1iR47s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] Arm32: MSR to SPSR needs qualification
Message-Id: <E1m4ULk-0004oc-G0@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 20:22:20 +0000

commit e32e184d023ffd186a0ef1b2538902e42926c3d2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jun 11 15:04:24 2021 +0200
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:11:37 2021 -0700

    Arm32: MSR to SPSR needs qualification
    
    The Arm ARM's description of MSR (ARM DDI 0406C.d section B9.3.12)
    doesn't even allow for plain "SPSR" here, and while gas accepts this, it
    takes it to mean SPSR_cf. Yet surely all of SPSR wants updating on this
    path, not just the lowest and highest 8 bits.
    
    Fixes: dfcffb128be4 ("xen/arm32: SPSR_hyp/SPSR")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 93031fbe9f4c341a2e7950a088025ea550291433)
---
 xen/arch/arm/arm32/entry.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S
index 8d1327ffe4..b7c70f6e8f 100644
--- a/xen/arch/arm/arm32/entry.S
+++ b/xen/arch/arm/arm32/entry.S
@@ -396,7 +396,7 @@ return_to_hypervisor:
         ldr r11, [sp, #UREGS_pc]
         msr ELR_hyp, r11
         ldr r11, [sp, #UREGS_cpsr]
-        msr SPSR, r11
+        msr SPSR_cxsf, r11
 #ifdef CONFIG_ARM32_HARDEN_BRANCH_PREDICTOR
         /*
          * Hardening branch predictor may require to setup a different
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 20:22:31 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 20:22:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157713.290468 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4ULv-0007Tn-RK; Fri, 16 Jul 2021 20:22:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157713.290468; Fri, 16 Jul 2021 20:22:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4ULv-0007Tf-OJ; Fri, 16 Jul 2021 20:22:31 +0000
Received: by outflank-mailman (input) for mailman id 157713;
 Fri, 16 Jul 2021 20:22:30 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4ULu-0007TS-LE
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:22:30 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4ULu-00044K-KQ
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:22:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4ULu-0004pi-JN
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=z1D9TtGeez39iUPBRdOOWoIVjpRCUgW6R7HFNHy7ezI=; b=FsTuu5jKsJB3//+vP7caNphWJW
	5dbgAI3/neqfx7q25f3dQK4DPat2EzKOFAgL96Q0jYeleZLfNjJ8fKdjC2nOnwPn5vBr36RNgDeHN
	q/NB1RTrpzjHalZbxW0AP9cOPnqeRVbKO5nqhY6ghs/K8gDLDPa3Hia60XRCBcUGgwNg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] arm: Modify type of actlr to register_t
Message-Id: <E1m4ULu-0004pi-JN@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 20:22:30 +0000

commit b46af13fa1241ed5d443315313c2f1fd081c0813
Author:     Michal Orzel <michal.orzel@arm.com>
AuthorDate: Wed May 5 09:43:01 2021 +0200
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:11:43 2021 -0700

    arm: Modify type of actlr to register_t
    
    AArch64 registers are 64bit whereas AArch32 registers
    are 32bit or 64bit. MSR/MRS are expecting 64bit values thus
    we should get rid of helpers READ/WRITE_SYSREG32
    in favour of using READ/WRITE_SYSREG.
    We should also use register_t type when reading sysregs
    which can correspond to uint64_t or uint32_t.
    Even though many AArch64 registers have upper 32bit reserved
    it does not mean that they can't be widen in the future.
    
    ACTLR_EL1 system register bits are implementation defined
    which means it is possibly a latent bug on current HW as the CPU
    implementer may already have decided to use the top 32bit.
    
    Signed-off-by: Michal Orzel <michal.orzel@arm.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit b80470c84553808fef3a6803000ceee8a100e63c)
---
 xen/arch/arm/domain.c        | 2 +-
 xen/include/asm-arm/domain.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index c94d2f48f1..849fef2f1e 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -329,7 +329,7 @@ static void schedule_tail(struct vcpu *prev)
 
 static void continue_new_vcpu(struct vcpu *prev)
 {
-    current->arch.actlr = READ_SYSREG32(ACTLR_EL1);
+    current->arch.actlr = READ_SYSREG(ACTLR_EL1);
     processor_vcpu_initialise(current);
 
     schedule_tail(prev);
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 4e2f582006..9c4db75f08 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -158,7 +158,7 @@ struct arch_vcpu
 
     /* Control Registers */
     register_t sctlr;
-    uint32_t actlr;
+    register_t actlr;
     uint32_t cpacr;
 
     uint32_t contextidr;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 20:22:41 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 20:22:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157714.290472 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4UM5-0007Wh-T0; Fri, 16 Jul 2021 20:22:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157714.290472; Fri, 16 Jul 2021 20:22:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4UM5-0007WZ-Q3; Fri, 16 Jul 2021 20:22:41 +0000
Received: by outflank-mailman (input) for mailman id 157714;
 Fri, 16 Jul 2021 20:22:40 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UM4-0007WO-OD
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:22:40 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UM4-00044V-NR
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:22:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UM4-0004r1-MY
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:22: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yIwOpuCp6iqKp79/824WBoExpkKAZNCObOiHAyn2BNA=; b=toohzcvVMbxnhFxvmdyMQqexDn
	tycMGFKE1CRIWE7iGU3vn18xChaLKnC5CApiIFldyD8R98nATk8Pc6S5IHDtlPIzL3wLMvO68fGGZ
	eIFnwy4Ojmpr2L1dD7QsbBQFuTikynY0Wga+LUyLQHGJeVz36ND+xQlVPI+IAq10Bw7g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] xen/arm: bootfdt: Always sort memory banks
Message-Id: <E1m4UM4-0004r1-MY@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 20:22:40 +0000

commit 49299c4813b7847d29df07bf790f5489060f2a9c
Author:     Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
AuthorDate: Mon Jul 5 20:48:51 2021 +0300
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:11:51 2021 -0700

    xen/arm: bootfdt: Always sort memory banks
    
    At the moment, Xen on Arm64 expects the memory banks to be ordered.
    Unfortunately, there may be a case when updated by firmware
    device tree contains unordered banks. This means Xen will panic
    when setting xenheap mappings for the subsequent bank with start
    address being less than xenheap_mfn_start (start address of
    the first bank).
    
    As there is no clear requirement regarding ordering in the device
    tree, update code to be able to deal with by sorting memory
    banks. There is only one heap region on Arm32, so the sorting
    is fine to be done in the common code.
    
    Suggested-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit 4473f3601098a2c3cf5ab89d5a29504772985e3a)
---
 xen/arch/arm/bootfdt.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
index dcff512648..476e32e0f5 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/arch/arm/bootfdt.c
@@ -13,6 +13,7 @@
 #include <xen/init.h>
 #include <xen/device_tree.h>
 #include <xen/libfdt/libfdt.h>
+#include <xen/sort.h>
 #include <xsm/xsm.h>
 #include <asm/setup.h>
 
@@ -395,6 +396,21 @@ static void __init early_print_info(void)
     printk("\n");
 }
 
+/* This function assumes that memory regions are not overlapped */
+static int __init cmp_memory_node(const void *key, const void *elem)
+{
+    const struct membank *handler0 = key;
+    const struct membank *handler1 = elem;
+
+    if ( handler0->start < handler1->start )
+        return -1;
+
+    if ( handler0->start >= (handler1->start + handler1->size) )
+        return 1;
+
+    return 0;
+}
+
 /**
  * boot_fdt_info - initialize bootinfo from a DTB
  * @fdt: flattened device tree binary
@@ -412,6 +428,15 @@ size_t __init boot_fdt_info(const void *fdt, paddr_t paddr)
     add_boot_module(BOOTMOD_FDT, paddr, fdt_totalsize(fdt), false);
 
     device_tree_for_each_node((void *)fdt, 0, early_scan_node, NULL);
+
+    /*
+     * On Arm64 setup_xenheap_mappings() expects to be called with the lowest
+     * bank in memory first. There is no requirement that the DT will provide
+     * the banks sorted in ascending order. So sort them through.
+     */
+    sort(bootinfo.mem.bank, bootinfo.mem.nr_banks, sizeof(struct membank),
+         cmp_memory_node, NULL);
+
     early_print_info();
 
     return fdt_totalsize(fdt);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 20:22:53 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 20:22:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157715.290476 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4UMG-0007aT-Vv; Fri, 16 Jul 2021 20:22:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157715.290476; Fri, 16 Jul 2021 20:22:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4UMG-0007aL-T8; Fri, 16 Jul 2021 20:22:52 +0000
Received: by outflank-mailman (input) for mailman id 157715;
 Fri, 16 Jul 2021 20:22:51 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UMF-0007a7-6Z
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:22:51 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UMF-00044k-5l
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:22:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UMF-0004so-4l
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=x56oCbRI66+1+zRvV/RCOICWSkmqfCc1+eoTrN0S+QE=; b=VNFbyJTspH5T5fej626Um/Pakw
	pFP91qYoBr5ePtYDK0tC6/w6RP/F/nfd17lbjBxuPKlBhep9emLXy1QaCiE6uwWXDnRQ1CzsP/X7D
	XxSODVMGXutCQK2wAcgWZlysE26Z8PvEopUIP0o79/AkPMhxZy+Ik47NJ9ZQ0ReREzs4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] xen/arm32: SPSR_hyp/SPSR
Message-Id: <E1m4UMF-0004so-4l@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 20:22:51 +0000

commit f6f76903e3406b61cdb566583b6f1495fe248691
Author:     Stefano Stabellini <sstabellini@kernel.org>
AuthorDate: Wed Jun 9 10:37:59 2021 -0700
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:14:02 2021 -0700

    xen/arm32: SPSR_hyp/SPSR
    
    SPSR_hyp is not meant to be accessed from Hyp mode (EL2); accesses
    trigger UNPREDICTABLE behaviour. Xen should read/write SPSR instead.
    See: ARM DDI 0487D.b page G8-5993.
    
    This fixes booting Xen/arm32 on QEMU.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
    Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
    (cherry picked from commit dfcffb128be46a3e413eaa941744536fe53c94b6)
---
 xen/arch/arm/arm32/entry.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S
index b228d44b19..8d1327ffe4 100644
--- a/xen/arch/arm/arm32/entry.S
+++ b/xen/arch/arm/arm32/entry.S
@@ -171,7 +171,7 @@ ENDPROC(prepare_context_from_guest)
         mrc     CP32(r11, HSR)                 /* Save exception syndrome */
         str     r11, [sp, #UREGS_hsr]
 
-        mrs     r11, SPSR_hyp
+        mrs     r11, SPSR
         str     r11, [sp, #UREGS_cpsr]
 
         /*
@@ -396,7 +396,7 @@ return_to_hypervisor:
         ldr r11, [sp, #UREGS_pc]
         msr ELR_hyp, r11
         ldr r11, [sp, #UREGS_cpsr]
-        msr SPSR_hyp, r11
+        msr SPSR, r11
 #ifdef CONFIG_ARM32_HARDEN_BRANCH_PREDICTOR
         /*
          * Hardening branch predictor may require to setup a different
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 20:23:03 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 20:23:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157716.290480 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4UMR-0007dJ-1F; Fri, 16 Jul 2021 20:23:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157716.290480; Fri, 16 Jul 2021 20:23:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4UMQ-0007dB-Uf; Fri, 16 Jul 2021 20:23:02 +0000
Received: by outflank-mailman (input) for mailman id 157716;
 Fri, 16 Jul 2021 20:23:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UMP-0007d0-9C
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:23:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UMP-00045H-8V
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:23:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UMP-0004uK-7m
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yZ/B/Fw2JpKyV2knVoll3dibhZVhNK+8nYpdIEqdBlc=; b=UdiRe4qNwt5enwYNKLV+7GKbAq
	/U6lN6CRFSbnMPlhjOCa6arrV3W9koQ/igz9mJ7KYrILFnrKdJHrMxRf/Ss1E4CaOyTfguk+veN/o
	aTKgdHXYwbLvSQIWB6oQ7TxQnr5F3z1DEXgMg+m8LiaCzCRJMowUssTtfmGKkwg9wxsg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] Arm32: MSR to SPSR needs qualification
Message-Id: <E1m4UMP-0004uK-7m@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 20:23:01 +0000

commit 27e08cb549500ef8e7ba112cf39bff0ad1e096a3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jun 11 15:04:24 2021 +0200
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:14:11 2021 -0700

    Arm32: MSR to SPSR needs qualification
    
    The Arm ARM's description of MSR (ARM DDI 0406C.d section B9.3.12)
    doesn't even allow for plain "SPSR" here, and while gas accepts this, it
    takes it to mean SPSR_cf. Yet surely all of SPSR wants updating on this
    path, not just the lowest and highest 8 bits.
    
    Fixes: dfcffb128be4 ("xen/arm32: SPSR_hyp/SPSR")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 93031fbe9f4c341a2e7950a088025ea550291433)
---
 xen/arch/arm/arm32/entry.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S
index 8d1327ffe4..b7c70f6e8f 100644
--- a/xen/arch/arm/arm32/entry.S
+++ b/xen/arch/arm/arm32/entry.S
@@ -396,7 +396,7 @@ return_to_hypervisor:
         ldr r11, [sp, #UREGS_pc]
         msr ELR_hyp, r11
         ldr r11, [sp, #UREGS_cpsr]
-        msr SPSR, r11
+        msr SPSR_cxsf, r11
 #ifdef CONFIG_ARM32_HARDEN_BRANCH_PREDICTOR
         /*
          * Hardening branch predictor may require to setup a different
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 20:23:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 20:23:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157717.290484 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4UMb-0007hk-3M; Fri, 16 Jul 2021 20:23:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157717.290484; Fri, 16 Jul 2021 20:23:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4UMa-0007ha-W9; Fri, 16 Jul 2021 20:23:12 +0000
Received: by outflank-mailman (input) for mailman id 157717;
 Fri, 16 Jul 2021 20:23:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UMZ-0007g3-CK
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:23:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UMZ-00047F-BY
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:23:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UMZ-0004x1-Ae
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QUNMtVyP2eTRIHOxQ5MpNIj/SL/QUx+tTzT82nGF+1o=; b=hfF7APjrKw1UfA92s1VS2vOsaX
	uysoVwCl4fH0sXD9hdSiZcj38QNPIOhkAdxGepLpSIC5rNI/HLnwkYXpBWiEOGqTvs1k+ozlZOdBo
	kozNkCY3I3FqjHpjKl76CpfK1c6Y/wm7gjghMNAvQ9nb0IltObGeo/gOniXGZcHOb6Fs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] arm: Modify type of actlr to register_t
Message-Id: <E1m4UMZ-0004x1-Ae@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 20:23:11 +0000

commit 41e8d5d47f17a59b752aa2f47e45ff47a39fe485
Author:     Michal Orzel <michal.orzel@arm.com>
AuthorDate: Wed May 5 09:43:01 2021 +0200
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:14:15 2021 -0700

    arm: Modify type of actlr to register_t
    
    AArch64 registers are 64bit whereas AArch32 registers
    are 32bit or 64bit. MSR/MRS are expecting 64bit values thus
    we should get rid of helpers READ/WRITE_SYSREG32
    in favour of using READ/WRITE_SYSREG.
    We should also use register_t type when reading sysregs
    which can correspond to uint64_t or uint32_t.
    Even though many AArch64 registers have upper 32bit reserved
    it does not mean that they can't be widen in the future.
    
    ACTLR_EL1 system register bits are implementation defined
    which means it is possibly a latent bug on current HW as the CPU
    implementer may already have decided to use the top 32bit.
    
    Signed-off-by: Michal Orzel <michal.orzel@arm.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit b80470c84553808fef3a6803000ceee8a100e63c)
---
 xen/arch/arm/domain.c        | 2 +-
 xen/include/asm-arm/domain.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index dfbd711325..ddeccb992c 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -329,7 +329,7 @@ static void schedule_tail(struct vcpu *prev)
 
 static void continue_new_vcpu(struct vcpu *prev)
 {
-    current->arch.actlr = READ_SYSREG32(ACTLR_EL1);
+    current->arch.actlr = READ_SYSREG(ACTLR_EL1);
     processor_vcpu_initialise(current);
 
     schedule_tail(prev);
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index b405cd539e..f1776c6c08 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -165,7 +165,7 @@ struct arch_vcpu
 
     /* Control Registers */
     register_t sctlr;
-    uint32_t actlr;
+    register_t actlr;
     uint32_t cpacr;
 
     uint32_t contextidr;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 20:23:23 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 20:23:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157718.290488 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4UMl-0007kl-4F; Fri, 16 Jul 2021 20:23:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157718.290488; Fri, 16 Jul 2021 20:23:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4UMl-0007kd-1P; Fri, 16 Jul 2021 20:23:23 +0000
Received: by outflank-mailman (input) for mailman id 157718;
 Fri, 16 Jul 2021 20:23:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UMj-0007kO-F3
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:23:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UMj-00047S-EN
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:23:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4UMj-0004yQ-Dd
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 20:23: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=A2BDarCpJTRcBJfI5CFupdWSjfSvexiIoJ8JzfzcWm4=; b=I0VE+AbT933vgjSTJ48zQiCIKT
	/sl9kh82Wc5dCPtISruzbD4hvYKlvPduAhI+lLEqSoDXn3SRIzH41tb7sKAIDVcW1FGbHJTAhlZ+2
	onIo+UuWp6MRKDJWXtTMCAmsY1uqq7vcxQZtW3zaWDw+vVduzRZU/tU0Jk/K6hASfVYE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] xen/arm: bootfdt: Always sort memory banks
Message-Id: <E1m4UMj-0004yQ-Dd@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 20:23:21 +0000

commit 32d580902b959000d79d51dff03a3560653c4fcb
Author:     Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
AuthorDate: Mon Jul 5 20:48:51 2021 +0300
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:14:19 2021 -0700

    xen/arm: bootfdt: Always sort memory banks
    
    At the moment, Xen on Arm64 expects the memory banks to be ordered.
    Unfortunately, there may be a case when updated by firmware
    device tree contains unordered banks. This means Xen will panic
    when setting xenheap mappings for the subsequent bank with start
    address being less than xenheap_mfn_start (start address of
    the first bank).
    
    As there is no clear requirement regarding ordering in the device
    tree, update code to be able to deal with by sorting memory
    banks. There is only one heap region on Arm32, so the sorting
    is fine to be done in the common code.
    
    Suggested-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit 4473f3601098a2c3cf5ab89d5a29504772985e3a)
---
 xen/arch/arm/bootfdt.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
index 08fb59f4e7..41fb4dc872 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/arch/arm/bootfdt.c
@@ -13,6 +13,7 @@
 #include <xen/init.h>
 #include <xen/device_tree.h>
 #include <xen/libfdt/libfdt.h>
+#include <xen/sort.h>
 #include <xsm/xsm.h>
 #include <asm/setup.h>
 
@@ -394,6 +395,21 @@ static void __init early_print_info(void)
     printk("\n");
 }
 
+/* This function assumes that memory regions are not overlapped */
+static int __init cmp_memory_node(const void *key, const void *elem)
+{
+    const struct membank *handler0 = key;
+    const struct membank *handler1 = elem;
+
+    if ( handler0->start < handler1->start )
+        return -1;
+
+    if ( handler0->start >= (handler1->start + handler1->size) )
+        return 1;
+
+    return 0;
+}
+
 /**
  * boot_fdt_info - initialize bootinfo from a DTB
  * @fdt: flattened device tree binary
@@ -411,6 +427,15 @@ size_t __init boot_fdt_info(const void *fdt, paddr_t paddr)
     add_boot_module(BOOTMOD_FDT, paddr, fdt_totalsize(fdt), false);
 
     device_tree_for_each_node((void *)fdt, 0, early_scan_node, NULL);
+
+    /*
+     * On Arm64 setup_xenheap_mappings() expects to be called with the lowest
+     * bank in memory first. There is no requirement that the DT will provide
+     * the banks sorted in ascending order. So sort them through.
+     */
+    sort(bootinfo.mem.bank, bootinfo.mem.nr_banks, sizeof(struct membank),
+         cmp_memory_node, NULL);
+
     early_print_info();
 
     return fdt_totalsize(fdt);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 21:11:07 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 21:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157736.290524 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4V6t-00054B-4y; Fri, 16 Jul 2021 21:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157736.290524; Fri, 16 Jul 2021 21:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4V6t-000543-24; Fri, 16 Jul 2021 21:11:03 +0000
Received: by outflank-mailman (input) for mailman id 157736;
 Fri, 16 Jul 2021 21:11:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4V6r-00053x-TU
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 21:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4V6r-0004v7-Qq
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 21:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4V6r-0000Gh-Pf
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 21:11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dcE7Woio8xjGxrlf11k/rwwOxltUCP9VWN40IVUgsGc=; b=uMhIGo/xEDvs02VWaVvFtT/2Ly
	xEJLVa/zbHAE7erfYBW+JMgojVJVqVWqzJQKE8oa7p3/qybN2/tKK5gYVEmF2xZs34nMOtjJ+Spmh
	Lplp5C674Wt7FX2IPJzCxUFyKf7FWYl4h/Ly6w2v9kd4CGptmc0YwfQ6A897h14aiuVY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] tools: use integer division in convert-legacy-stream
Message-Id: <E1m4V6r-0000Gh-Pf@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 21:11:01 +0000

commit 23d5e3d42cbf1673aa8c9c2d9601009e24077afc
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:55:59 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 15 11:59:32 2021 +0100

    tools: use integer division in convert-legacy-stream
    
    A single slash gives a float, a double slash gives an int.
    
        bitmap = unpack_exact("Q" * ((max_id/64) + 1))
    TypeError: can't multiply sequence by non-int of type 'float'
    
    Use future division to remain compatible with python 2.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 74d044d51b19bb697eac5c3deafa140f6afafec8)
---
 tools/python/scripts/convert-legacy-stream | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/python/scripts/convert-legacy-stream b/tools/python/scripts/convert-legacy-stream
index ca93a93848..66ee3d2f5d 100755
--- a/tools/python/scripts/convert-legacy-stream
+++ b/tools/python/scripts/convert-legacy-stream
@@ -6,6 +6,7 @@ Convert a legacy migration stream to a v2 stream.
 """
 
 from __future__ import print_function
+from __future__ import division
 
 import sys
 import os, os.path
@@ -163,7 +164,7 @@ def write_libxc_hvm_params(params):
         raise RuntimeError("Expected even length list of hvm parameters")
 
     write_record(libxc.REC_TYPE_hvm_params,
-                 pack(libxc.HVM_PARAMS_FORMAT, len(params) / 2, 0),
+                 pack(libxc.HVM_PARAMS_FORMAT, len(params) // 2, 0),
                  pack("Q" * len(params), *params))
 
 def write_libxc_static_data_end():
@@ -264,8 +265,8 @@ def read_pv_extended_info(vm):
                           (so_far - total_length, ))
 
 def read_pv_p2m_frames(vm):
-    fpp = 4096 / vm.width
-    p2m_frame_len = (vm.p2m_size - 1) / fpp + 1
+    fpp = 4096 // vm.width
+    p2m_frame_len = (vm.p2m_size - 1) // fpp + 1
 
     info("P2M frames: fpp %d, p2m_frame_len %d" % (fpp, p2m_frame_len))
     write_libxc_pv_p2m_frames(vm, unpack_ulongs(p2m_frame_len))
@@ -405,7 +406,7 @@ def read_chunks(vm):
                                   (max_id, legacy.MAX_VCPU_ID))
 
             vm.max_vcpu_id = max_id
-            bitmap = unpack_exact("Q" * ((max_id/64) + 1))
+            bitmap = unpack_exact("Q" * ((max_id // 64) + 1))
 
             for idx, word in enumerate(bitmap):
                 bit_idx = 0
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 21:11:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 21:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157737.290529 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4V73-00056A-6V; Fri, 16 Jul 2021 21:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157737.290529; Fri, 16 Jul 2021 21:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4V73-000562-3e; Fri, 16 Jul 2021 21:11:13 +0000
Received: by outflank-mailman (input) for mailman id 157737;
 Fri, 16 Jul 2021 21:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4V71-00055t-Uc
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 21:11:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4V71-0004vC-To
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 21:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4V71-0000Hi-Sw
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 21: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cjSyqx44k9DPcoxMDOTdBo9X0vTMFU1fpKuyHtbEoAw=; b=tc+mIe1WAq1RGmt8pQ7jqRzTt9
	aJ7Hx8QtASKpspHkB4EEe8UDEM1LOiWJxoRJdP5PT4fx+/u6aEb6REW1fxhiaF1N2mR0QpDLCKwUx
	wHdXf+G8aQpvcz40ZW5VOHjRdaMWfjdReiMphl6nEOJrXq8FQYYb3qbsNHFfSlqOpeeE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] tools/python: handle libxl__physmap_info.name properly in convert-legacy-stream
Message-Id: <E1m4V71-0000Hi-Sw@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 21:11:11 +0000

commit f6aec84fe7076d03ac8509de97275e9ef3da37cd
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:56:00 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 15 11:59:32 2021 +0100

    tools/python: handle libxl__physmap_info.name properly in convert-legacy-stream
    
    The trailing member name[] in libxl__physmap_info is written as a
    cstring into the stream. The current code does a sanity check if the
    last byte is zero. This attempt fails with python3 because name[-1]
    returns a type int. As a result the comparison with byte(\00) fails:
    
      File "/usr/lib/xen/bin/convert-legacy-stream", line 347, in read_libxl_toolstack
        raise StreamError("physmap name not NUL terminated")
      StreamError: physmap name not NUL terminated
    
    To handle both python variants, cast to bytearray().
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    (cherry picked from commit c8f88810db2a25d6aacf65c1c60bc4f5d848a483)
---
 tools/python/scripts/convert-legacy-stream | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/python/scripts/convert-legacy-stream b/tools/python/scripts/convert-legacy-stream
index 66ee3d2f5d..227e1b5c3f 100755
--- a/tools/python/scripts/convert-legacy-stream
+++ b/tools/python/scripts/convert-legacy-stream
@@ -343,7 +343,7 @@ def read_libxl_toolstack(vm, data):
         if twidth == 64:
             name = name[:-4]
 
-        if name[-1] != b'\x00':
+        if bytearray(name)[-1] != 0:
             raise StreamError("physmap name not NUL terminated")
 
         root = b"physmap/%x" % (phys, )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 21:11:23 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 21:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157738.290533 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4V7D-00058q-87; Fri, 16 Jul 2021 21:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157738.290533; Fri, 16 Jul 2021 21:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4V7D-00058j-57; Fri, 16 Jul 2021 21:11:23 +0000
Received: by outflank-mailman (input) for mailman id 157738;
 Fri, 16 Jul 2021 21:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4V7C-00058Q-1V
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 21:11:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4V7C-0004vN-0k
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 21:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4V7B-0000Ir-Vr
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 21:11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=adpQJWI/O2AGf44rh+/l5nWO9jLmjdEzDOSL5U1Yl5A=; b=Tv2TfJcSUuUe18qP8zCNy7N777
	iE9Vbih7x76ORG72i1wzfKKP47REqKssKtxK/2wvaRCA9RxHdyMxIKseS35/jIxTj172LHl8dqaEB
	yez5WZWhI8aBkfiCZ9Gfd/kTLZH73mG/Fmy/UlA/3165ImuFFyFdqG762BmNbTZ8mGeU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] tools/python: fix Python3.4 TypeError in format string
Message-Id: <E1m4V7B-0000Ir-Vr@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 21:11:21 +0000

commit bb9377a20559de07e1dbe91399902c70cfafccea
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:56:01 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 15 11:59:32 2021 +0100

    tools/python: fix Python3.4 TypeError in format string
    
    Using the first element of a tuple for a format specifier fails with
    python3.4 as included in SLE12:
        b = b"string/%x" % (i, )
    TypeError: unsupported operand type(s) for %: 'bytes' and 'tuple'
    
    It happens to work with python 2.7 and 3.6.
    To support older Py3, format as strings and explicitly encode as ASCII.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    (cherry picked from commit a27976a1080d537fb1f212a8f9133d60daa0025b)
---
 tools/python/scripts/convert-legacy-stream | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/python/scripts/convert-legacy-stream b/tools/python/scripts/convert-legacy-stream
index 227e1b5c3f..7fe375a668 100755
--- a/tools/python/scripts/convert-legacy-stream
+++ b/tools/python/scripts/convert-legacy-stream
@@ -346,9 +346,9 @@ def read_libxl_toolstack(vm, data):
         if bytearray(name)[-1] != 0:
             raise StreamError("physmap name not NUL terminated")
 
-        root = b"physmap/%x" % (phys, )
-        kv = [root + b"/start_addr", b"%x" % (start, ),
-              root + b"/size",       b"%x" % (size, ),
+        root = ("physmap/%x" % (phys, )).encode('ascii')
+        kv = [root + b"/start_addr", ("%x" % (start, )).encode('ascii'),
+              root + b"/size",       ("%x" % (size, )).encode('ascii'),
               root + b"/name",       name[:-1]]
 
         for key, val in zip(kv[0::2], kv[1::2]):
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Jul 16 21:11:33 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jul 2021 21:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157739.290537 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4V7N-0005BS-9j; Fri, 16 Jul 2021 21:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157739.290537; Fri, 16 Jul 2021 21:11:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4V7N-0005BK-6u; Fri, 16 Jul 2021 21:11:33 +0000
Received: by outflank-mailman (input) for mailman id 157739;
 Fri, 16 Jul 2021 21:11:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4V7M-0005BB-4I
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 21:11:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4V7M-0004vd-3e
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 21:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4V7M-0000Jj-2n
 for xen-changelog@lists.xenproject.org; Fri, 16 Jul 2021 21:11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+fwQn9fJdyFUXefwK/BzT52lvI+hK8gzbwY9E3M2nuI=; b=3BZ+7WWPW4Seiopzh3qnEu2rUb
	HWkUmmMY5nk8c9IYa2QQnIDO2wtVa9j+V+1zbw7RUrrCJ/CSHDO1a0WVMNFoA6j0zpKrLTAgPqoi8
	KT8aMZlJ9rJGtmKlldStN/eON2eOIF3nzb9Tx6sd9fbCqpVM32avofM/2ut2aeNswfl0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] tools/libxenstat: fix populating vbd.rd_sect
Message-Id: <E1m4V7M-0000Jj-2n@xenbits.xenproject.org>
Date: Fri, 16 Jul 2021 21:11:32 +0000

commit c3cc6e206ff79c6117b841891d832694597bd5af
Author:     Richard Kojedzinszky <richard@kojedz.in>
AuthorDate: Fri Jul 9 10:06:45 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 15 11:59:32 2021 +0100

    tools/libxenstat: fix populating vbd.rd_sect
    
    Fixes: 91c3e3dc91d6 ("tools/xentop: Display '-' when stats are not available.")
    Signed-off-by: Richard Kojedzinszky <richard@kojedz.in>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 89d57f291e37b4769ab26db919eba46548f2e13e)
---
 tools/xenstat/libxenstat/src/xenstat_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xenstat/libxenstat/src/xenstat_linux.c b/tools/xenstat/libxenstat/src/xenstat_linux.c
index 9c0cb277c5..ed7a02ab52 100644
--- a/tools/xenstat/libxenstat/src/xenstat_linux.c
+++ b/tools/xenstat/libxenstat/src/xenstat_linux.c
@@ -474,7 +474,7 @@ int xenstat_collect_vbds(xenstat_node * node)
 				(read_attributes_vbd(dp->d_name, "statistics/wr_req", buf, 256)<=0) ||
 				((ret = sscanf(buf, "%llu", &vbd.wr_reqs)) != 1) ||
 				(read_attributes_vbd(dp->d_name, "statistics/rd_sect", buf, 256)<=0) ||
-				((ret = sscanf(buf, "%llu", &vbd.wr_sects)) != 1) ||
+				((ret = sscanf(buf, "%llu", &vbd.rd_sects)) != 1) ||
 				(read_attributes_vbd(dp->d_name, "statistics/wr_sect", buf, 256)<=0) ||
 				((ret = sscanf(buf, "%llu", &vbd.wr_sects)) != 1))
 			{
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Jul 17 04:11:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Jul 2021 04:11:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157821.290700 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4bfK-0006er-I8; Sat, 17 Jul 2021 04:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157821.290700; Sat, 17 Jul 2021 04:11:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4bfK-0006ei-Ew; Sat, 17 Jul 2021 04:11:02 +0000
Received: by outflank-mailman (input) for mailman id 157821;
 Sat, 17 Jul 2021 04:11:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4bfJ-0006ec-PS
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 04:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4bfJ-0002Jh-Oc
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 04:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4bfJ-00040G-N8
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 04:11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TZGzX+H/2Z6PI6WJ0SsJ0vjc22Bb/dcoqF1aRB+sLYA=; b=YUsSgTCfSNG99lvxJXasj5meMz
	lYnW7l8HyLuytASrxaI2nUz6EbNXjpPpJ/WFzQCgodG14xiB65RizRBvXp+ZNnd126+LJr812DR7a
	W6O+XUIZ/Ck7lkBi2jaEI3lhVSbSZzU0J+rLdZPfC3X+Bcs11hT5YrKTbPndpNZKES9g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] tools: use integer division in convert-legacy-stream
Message-Id: <E1m4bfJ-00040G-N8@xenbits.xenproject.org>
Date: Sat, 17 Jul 2021 04:11:01 +0000

commit e9709a83490f5d6fa7247087ec1084c381cfe956
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:55:59 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 15 11:55:50 2021 +0100

    tools: use integer division in convert-legacy-stream
    
    A single slash gives a float, a double slash gives an int.
    
        bitmap = unpack_exact("Q" * ((max_id/64) + 1))
    TypeError: can't multiply sequence by non-int of type 'float'
    
    Use future division to remain compatible with python 2.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 74d044d51b19bb697eac5c3deafa140f6afafec8)
---
 tools/python/scripts/convert-legacy-stream | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/python/scripts/convert-legacy-stream b/tools/python/scripts/convert-legacy-stream
index ca93a93848..66ee3d2f5d 100755
--- a/tools/python/scripts/convert-legacy-stream
+++ b/tools/python/scripts/convert-legacy-stream
@@ -6,6 +6,7 @@ Convert a legacy migration stream to a v2 stream.
 """
 
 from __future__ import print_function
+from __future__ import division
 
 import sys
 import os, os.path
@@ -163,7 +164,7 @@ def write_libxc_hvm_params(params):
         raise RuntimeError("Expected even length list of hvm parameters")
 
     write_record(libxc.REC_TYPE_hvm_params,
-                 pack(libxc.HVM_PARAMS_FORMAT, len(params) / 2, 0),
+                 pack(libxc.HVM_PARAMS_FORMAT, len(params) // 2, 0),
                  pack("Q" * len(params), *params))
 
 def write_libxc_static_data_end():
@@ -264,8 +265,8 @@ def read_pv_extended_info(vm):
                           (so_far - total_length, ))
 
 def read_pv_p2m_frames(vm):
-    fpp = 4096 / vm.width
-    p2m_frame_len = (vm.p2m_size - 1) / fpp + 1
+    fpp = 4096 // vm.width
+    p2m_frame_len = (vm.p2m_size - 1) // fpp + 1
 
     info("P2M frames: fpp %d, p2m_frame_len %d" % (fpp, p2m_frame_len))
     write_libxc_pv_p2m_frames(vm, unpack_ulongs(p2m_frame_len))
@@ -405,7 +406,7 @@ def read_chunks(vm):
                                   (max_id, legacy.MAX_VCPU_ID))
 
             vm.max_vcpu_id = max_id
-            bitmap = unpack_exact("Q" * ((max_id/64) + 1))
+            bitmap = unpack_exact("Q" * ((max_id // 64) + 1))
 
             for idx, word in enumerate(bitmap):
                 bit_idx = 0
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Sat Jul 17 04:11:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Jul 2021 04:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157824.290705 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4bfU-0006jh-KD; Sat, 17 Jul 2021 04:11:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157824.290705; Sat, 17 Jul 2021 04:11:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4bfU-0006jX-GY; Sat, 17 Jul 2021 04:11:12 +0000
Received: by outflank-mailman (input) for mailman id 157824;
 Sat, 17 Jul 2021 04:11:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4bfT-0006jM-Sh
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 04:11:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4bfT-0002K5-Rq
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 04:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4bfT-00040v-Qt
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 04: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nJNRkmEg7xG0HucoCj8zvElrYokQ+8zttY/DDLLDvPM=; b=R/ZqY7YyYXGJKYl6zUfzwHRUbg
	B45QR1RBNlXkrt1xabUiHOAcTpHoh/skPOUeA55B4y2XTP9tBb+VcJuImM4CoGX+gnNjs8/21dKJC
	xr08QD/PdaEORp/7/bA1OGZ55Rc1+YPSWc/CZtYzcvmHMOMelO4xflcBINX+u47z1VwQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] tools/python: handle libxl__physmap_info.name properly in convert-legacy-stream
Message-Id: <E1m4bfT-00040v-Qt@xenbits.xenproject.org>
Date: Sat, 17 Jul 2021 04:11:11 +0000

commit 67f798942caffc3c399c8b6ab609fed7e3f529db
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:56:00 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 15 11:55:50 2021 +0100

    tools/python: handle libxl__physmap_info.name properly in convert-legacy-stream
    
    The trailing member name[] in libxl__physmap_info is written as a
    cstring into the stream. The current code does a sanity check if the
    last byte is zero. This attempt fails with python3 because name[-1]
    returns a type int. As a result the comparison with byte(\00) fails:
    
      File "/usr/lib/xen/bin/convert-legacy-stream", line 347, in read_libxl_toolstack
        raise StreamError("physmap name not NUL terminated")
      StreamError: physmap name not NUL terminated
    
    To handle both python variants, cast to bytearray().
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    (cherry picked from commit c8f88810db2a25d6aacf65c1c60bc4f5d848a483)
---
 tools/python/scripts/convert-legacy-stream | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/python/scripts/convert-legacy-stream b/tools/python/scripts/convert-legacy-stream
index 66ee3d2f5d..227e1b5c3f 100755
--- a/tools/python/scripts/convert-legacy-stream
+++ b/tools/python/scripts/convert-legacy-stream
@@ -343,7 +343,7 @@ def read_libxl_toolstack(vm, data):
         if twidth == 64:
             name = name[:-4]
 
-        if name[-1] != b'\x00':
+        if bytearray(name)[-1] != 0:
             raise StreamError("physmap name not NUL terminated")
 
         root = b"physmap/%x" % (phys, )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Sat Jul 17 04:11:22 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Jul 2021 04:11:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157827.290708 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4bfe-0006qE-Kz; Sat, 17 Jul 2021 04:11:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157827.290708; Sat, 17 Jul 2021 04:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4bfe-0006q6-I8; Sat, 17 Jul 2021 04:11:22 +0000
Received: by outflank-mailman (input) for mailman id 157827;
 Sat, 17 Jul 2021 04:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4bfd-0006nu-Vi
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 04:11:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4bfd-0002KG-Ut
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 04:11:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4bfd-00041t-Tt
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 04:11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GbYFPOzysH2tFxNdrNlGCq/zN4GTjml/u8hmk33EfgQ=; b=yhR8f209ncfscpny/lR1tJ01mH
	aouH686rukXUfGGaofowPwmItNaiI1Vvz8G9pPvnRR5abngir4CMOo1iXhH9EEUNOkbYWmh8MYnjj
	8I9MVcVXRLYzC3CKetf1lpqRtVF+n/5sWMCMt/Upd5rOo9+i5DlfmAjXD3fo6PriV7wc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] tools/python: fix Python3.4 TypeError in format string
Message-Id: <E1m4bfd-00041t-Tt@xenbits.xenproject.org>
Date: Sat, 17 Jul 2021 04:11:21 +0000

commit 41f0903e16326e4aef52347e46de2e3f71bb6022
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 1 11:56:01 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 15 11:55:50 2021 +0100

    tools/python: fix Python3.4 TypeError in format string
    
    Using the first element of a tuple for a format specifier fails with
    python3.4 as included in SLE12:
        b = b"string/%x" % (i, )
    TypeError: unsupported operand type(s) for %: 'bytes' and 'tuple'
    
    It happens to work with python 2.7 and 3.6.
    To support older Py3, format as strings and explicitly encode as ASCII.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    (cherry picked from commit a27976a1080d537fb1f212a8f9133d60daa0025b)
---
 tools/python/scripts/convert-legacy-stream | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/python/scripts/convert-legacy-stream b/tools/python/scripts/convert-legacy-stream
index 227e1b5c3f..7fe375a668 100755
--- a/tools/python/scripts/convert-legacy-stream
+++ b/tools/python/scripts/convert-legacy-stream
@@ -346,9 +346,9 @@ def read_libxl_toolstack(vm, data):
         if bytearray(name)[-1] != 0:
             raise StreamError("physmap name not NUL terminated")
 
-        root = b"physmap/%x" % (phys, )
-        kv = [root + b"/start_addr", b"%x" % (start, ),
-              root + b"/size",       b"%x" % (size, ),
+        root = ("physmap/%x" % (phys, )).encode('ascii')
+        kv = [root + b"/start_addr", ("%x" % (start, )).encode('ascii'),
+              root + b"/size",       ("%x" % (size, )).encode('ascii'),
               root + b"/name",       name[:-1]]
 
         for key, val in zip(kv[0::2], kv[1::2]):
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Sat Jul 17 04:11:33 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Jul 2021 04:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157828.290711 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4bfp-0006tl-Mj; Sat, 17 Jul 2021 04:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157828.290711; Sat, 17 Jul 2021 04:11:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4bfp-0006td-Jk; Sat, 17 Jul 2021 04:11:33 +0000
Received: by outflank-mailman (input) for mailman id 157828;
 Sat, 17 Jul 2021 04:11:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4bfo-0006tK-2V
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 04:11:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4bfo-0002KX-1g
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 04:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4bfo-00049r-0l
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 04:11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=eCqPqFaTGVbqlbfl+PoAaJ7n2TJYNg6FC5MLVLYOuWw=; b=xSU4RO+MM8qweTdLl0WGK83Epm
	vaZ2yM3acxD3QY3oLiq/RKhYdcTBaCsYaD8M2ZrYOcU6XQpgnehu46P4sh4W2Nt46opldnALfPCML
	QJ6DMHSzJrNU6gQM34UZ3gcEflunI7fiUhK+qRdJzWxtu3jKWBXR6EXvwRUD6jhtjErg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] tools/libxenstat: fix populating vbd.rd_sect
Message-Id: <E1m4bfo-00049r-0l@xenbits.xenproject.org>
Date: Sat, 17 Jul 2021 04:11:32 +0000

commit 429b0a5c62b9e9faf96456aefb5a176b6eb02921
Author:     Richard Kojedzinszky <richard@kojedz.in>
AuthorDate: Fri Jul 9 10:06:45 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 15 11:55:50 2021 +0100

    tools/libxenstat: fix populating vbd.rd_sect
    
    Fixes: 91c3e3dc91d6 ("tools/xentop: Display '-' when stats are not available.")
    Signed-off-by: Richard Kojedzinszky <richard@kojedz.in>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 89d57f291e37b4769ab26db919eba46548f2e13e)
---
 tools/libs/stat/xenstat_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/stat/xenstat_linux.c b/tools/libs/stat/xenstat_linux.c
index c00b26d4d8..1745be4285 100644
--- a/tools/libs/stat/xenstat_linux.c
+++ b/tools/libs/stat/xenstat_linux.c
@@ -475,7 +475,7 @@ int xenstat_collect_vbds(xenstat_node * node)
 				(read_attributes_vbd(dp->d_name, "statistics/wr_req", buf, 256)<=0) ||
 				((ret = sscanf(buf, "%llu", &vbd.wr_reqs)) != 1) ||
 				(read_attributes_vbd(dp->d_name, "statistics/rd_sect", buf, 256)<=0) ||
-				((ret = sscanf(buf, "%llu", &vbd.wr_sects)) != 1) ||
+				((ret = sscanf(buf, "%llu", &vbd.rd_sects)) != 1) ||
 				(read_attributes_vbd(dp->d_name, "statistics/wr_sect", buf, 256)<=0) ||
 				((ret = sscanf(buf, "%llu", &vbd.wr_sects)) != 1))
 			{
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Sat Jul 17 07:55:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Jul 2021 07:55:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157837.290731 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4fA8-00032u-41; Sat, 17 Jul 2021 07:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157837.290731; Sat, 17 Jul 2021 07:55:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4fA8-00032m-0c; Sat, 17 Jul 2021 07:55:04 +0000
Received: by outflank-mailman (input) for mailman id 157837;
 Sat, 17 Jul 2021 07:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4fA6-00031F-6X
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 07:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4fA6-0006PW-5d
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 07:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4fA6-0002Ku-4Z
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 07:55: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wHMHD/xea338U4/807ZG0UQ1GyyaflslfY566eZwPQI=; b=Gphjm6hJcajcKLZQA5hM8akWUz
	HpfIyZ90jJXxARhv5PFVjTOlafonw3ucpnwzvfoiac+RQLUPnd6+4knYKawsCWciqaJmn50V10yHH
	ELM2HjX0xTL6wIFaKVaBmaeO1B/J3vmltSTpIj+DKAOFnS6/n44w7PsC1cAOe+qy45mA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] tools/libxenstat: fix populating vbd.rd_sect
Message-Id: <E1m4fA6-0002Ku-4Z@xenbits.xenproject.org>
Date: Sat, 17 Jul 2021 07:55:02 +0000

commit a7de7608da1e4d29607b4a36a15eaa58b0e451fc
Author:     Richard Kojedzinszky <richard@kojedz.in>
AuthorDate: Fri Jul 9 10:06:45 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jul 15 12:03:48 2021 +0100

    tools/libxenstat: fix populating vbd.rd_sect
    
    Fixes: 91c3e3dc91d6 ("tools/xentop: Display '-' when stats are not available.")
    Signed-off-by: Richard Kojedzinszky <richard@kojedz.in>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 89d57f291e37b4769ab26db919eba46548f2e13e)
---
 tools/xenstat/libxenstat/src/xenstat_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xenstat/libxenstat/src/xenstat_linux.c b/tools/xenstat/libxenstat/src/xenstat_linux.c
index 9c0cb277c5..ed7a02ab52 100644
--- a/tools/xenstat/libxenstat/src/xenstat_linux.c
+++ b/tools/xenstat/libxenstat/src/xenstat_linux.c
@@ -474,7 +474,7 @@ int xenstat_collect_vbds(xenstat_node * node)
 				(read_attributes_vbd(dp->d_name, "statistics/wr_req", buf, 256)<=0) ||
 				((ret = sscanf(buf, "%llu", &vbd.wr_reqs)) != 1) ||
 				(read_attributes_vbd(dp->d_name, "statistics/rd_sect", buf, 256)<=0) ||
-				((ret = sscanf(buf, "%llu", &vbd.wr_sects)) != 1) ||
+				((ret = sscanf(buf, "%llu", &vbd.rd_sects)) != 1) ||
 				(read_attributes_vbd(dp->d_name, "statistics/wr_sect", buf, 256)<=0) ||
 				((ret = sscanf(buf, "%llu", &vbd.wr_sects)) != 1))
 			{
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Jul 17 07:55:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Jul 2021 07:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157840.290734 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4fAH-00035C-55; Sat, 17 Jul 2021 07:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157840.290734; Sat, 17 Jul 2021 07:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4fAH-000355-2G; Sat, 17 Jul 2021 07:55:13 +0000
Received: by outflank-mailman (input) for mailman id 157840;
 Sat, 17 Jul 2021 07:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4fAG-00034v-9q
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 07:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4fAG-0006Pt-8v
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 07:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4fAG-0002LT-7s
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 07:55: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aA3Npf/BJOFsiPfGQrLGiGtxXPCWoQ3xBndXJHOn1bk=; b=fvYe0AEZv/3sOonw58/Q/XPt5u
	TvxIwnkwl63df4PRVRoYmQTYesB8Rgorw0i++LFZiqj5Mw9clA+LQoZL3H7uJae1EAAVyWN2D7N6/
	Z7aizOfCBtNtvwP1Jmmpi5JOHUQDsmsVd0WBdETeYTesF7rJPognXv6oqpYq2GPmmdzo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/tsx: Fix backport of "x86/cpuid: Rework HLE and RTM handling"
Message-Id: <E1m4fAG-0002LT-7s@xenbits.xenproject.org>
Date: Sat, 17 Jul 2021 07:55:12 +0000

commit 1f27fc448bc6898ffd7628b42c0847548b54d2fb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jul 16 08:26:33 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 16 08:26:33 2021 +0200

    x86/tsx: Fix backport of "x86/cpuid: Rework HLE and RTM handling"
    
    The backport dropped the hunk deleting the setup_clear_cpu_cap() for HLE/RTM,
    but retained the hunk adding setup_force_cpu_cap().
    
    Calling both force and clear on the same feature elicits an error, and clear
    takes precedence, which breaks the part of the bugfix which makes migration
    from older versions of Xen function safe for VMs using TSX.
    
    Fixes: f17d848c4caa ("x86/cpuid: Rework HLE and RTM handling")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/spec_ctrl.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
index 33343062a7..1cfd02d7d7 100644
--- a/xen/arch/x86/spec_ctrl.c
+++ b/xen/arch/x86/spec_ctrl.c
@@ -1150,9 +1150,6 @@ void __init init_speculation_mitigations(void)
          ((hw_smt_enabled && opt_smt) ||
           !boot_cpu_has(X86_FEATURE_SC_VERW_IDLE)) )
     {
-        setup_clear_cpu_cap(X86_FEATURE_HLE);
-        setup_clear_cpu_cap(X86_FEATURE_RTM);
-
         opt_tsx = 0;
         tsx_init();
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Jul 17 22:44:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Jul 2021 22:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157909.290859 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4t2R-0006xU-B1; Sat, 17 Jul 2021 22:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157909.290859; Sat, 17 Jul 2021 22:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4t2R-0006xM-8A; Sat, 17 Jul 2021 22:44:03 +0000
Received: by outflank-mailman (input) for mailman id 157909;
 Sat, 17 Jul 2021 22:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4t2Q-0006xE-0Z
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 22:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4t2P-0005FU-VJ
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 22:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4t2P-0002R5-UI
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 22:44: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=frpJKDdyGMWUF/Z+/tpsdb56S2QgDBZSlNNbmft7t/4=; b=xE7nYGqbba/gEDO/GFqUg55N1d
	f+7xBmAHemodndHYyvzmDbtCa6ltqlhY/uHY/eTge5zM+ffXbjhmO+dQGrNaOoAJF+UPWNAAyw06m
	Pnryy8Pawdit3zPUzSMW0v7kvqM2KOiZY3g23Y0aNIE0GMPF5Wt7DUIb5VjoAzK0d8Yg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] xen/arm32: SPSR_hyp/SPSR
Message-Id: <E1m4t2P-0002R5-UI@xenbits.xenproject.org>
Date: Sat, 17 Jul 2021 22:44:01 +0000

commit bb731fdb76ccf18836990b3235c75a262d9511cd
Author:     Stefano Stabellini <sstabellini@kernel.org>
AuthorDate: Wed Jun 9 10:37:59 2021 -0700
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:11:20 2021 -0700

    xen/arm32: SPSR_hyp/SPSR
    
    SPSR_hyp is not meant to be accessed from Hyp mode (EL2); accesses
    trigger UNPREDICTABLE behaviour. Xen should read/write SPSR instead.
    See: ARM DDI 0487D.b page G8-5993.
    
    This fixes booting Xen/arm32 on QEMU.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
    Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
    (cherry picked from commit dfcffb128be46a3e413eaa941744536fe53c94b6)
---
 xen/arch/arm/arm32/entry.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S
index b228d44b19..8d1327ffe4 100644
--- a/xen/arch/arm/arm32/entry.S
+++ b/xen/arch/arm/arm32/entry.S
@@ -171,7 +171,7 @@ ENDPROC(prepare_context_from_guest)
         mrc     CP32(r11, HSR)                 /* Save exception syndrome */
         str     r11, [sp, #UREGS_hsr]
 
-        mrs     r11, SPSR_hyp
+        mrs     r11, SPSR
         str     r11, [sp, #UREGS_cpsr]
 
         /*
@@ -396,7 +396,7 @@ return_to_hypervisor:
         ldr r11, [sp, #UREGS_pc]
         msr ELR_hyp, r11
         ldr r11, [sp, #UREGS_cpsr]
-        msr SPSR_hyp, r11
+        msr SPSR, r11
 #ifdef CONFIG_ARM32_HARDEN_BRANCH_PREDICTOR
         /*
          * Hardening branch predictor may require to setup a different
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Jul 17 22:44:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Jul 2021 22:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157910.290863 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4t2b-0006zI-Ca; Sat, 17 Jul 2021 22:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157910.290863; Sat, 17 Jul 2021 22:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4t2b-0006zA-9g; Sat, 17 Jul 2021 22:44:13 +0000
Received: by outflank-mailman (input) for mailman id 157910;
 Sat, 17 Jul 2021 22:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4t2a-0006z4-3z
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 22:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4t2a-0005Fc-3D
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 22:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4t2a-0002S5-1t
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 22: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KaHU3ynwZSKPt5wptbKKOlrl5NUBo4vbLIQMP43xHf0=; b=RF7cupgLH/vUG4Kvn4b28WxkvK
	q7OXaiYzmxcJI3OzpPCwnXh7e5+fIfoYxyGvX/sn1L+OS7lfDmdciRxftV+/TdKXw/E5ZjEHmn45+
	sFNxGKPg7Vr80bNnNeJabZaZ03IHISdyF4owaLkpiluxEISf1NBeOUJ78Lt/WTW7xTYI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] Arm32: MSR to SPSR needs qualification
Message-Id: <E1m4t2a-0002S5-1t@xenbits.xenproject.org>
Date: Sat, 17 Jul 2021 22:44:12 +0000

commit e32e184d023ffd186a0ef1b2538902e42926c3d2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jun 11 15:04:24 2021 +0200
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:11:37 2021 -0700

    Arm32: MSR to SPSR needs qualification
    
    The Arm ARM's description of MSR (ARM DDI 0406C.d section B9.3.12)
    doesn't even allow for plain "SPSR" here, and while gas accepts this, it
    takes it to mean SPSR_cf. Yet surely all of SPSR wants updating on this
    path, not just the lowest and highest 8 bits.
    
    Fixes: dfcffb128be4 ("xen/arm32: SPSR_hyp/SPSR")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 93031fbe9f4c341a2e7950a088025ea550291433)
---
 xen/arch/arm/arm32/entry.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S
index 8d1327ffe4..b7c70f6e8f 100644
--- a/xen/arch/arm/arm32/entry.S
+++ b/xen/arch/arm/arm32/entry.S
@@ -396,7 +396,7 @@ return_to_hypervisor:
         ldr r11, [sp, #UREGS_pc]
         msr ELR_hyp, r11
         ldr r11, [sp, #UREGS_cpsr]
-        msr SPSR, r11
+        msr SPSR_cxsf, r11
 #ifdef CONFIG_ARM32_HARDEN_BRANCH_PREDICTOR
         /*
          * Hardening branch predictor may require to setup a different
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Jul 17 22:44:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Jul 2021 22:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157911.290868 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4t2m-00072x-EP; Sat, 17 Jul 2021 22:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157911.290868; Sat, 17 Jul 2021 22:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4t2m-00072l-B9; Sat, 17 Jul 2021 22:44:24 +0000
Received: by outflank-mailman (input) for mailman id 157911;
 Sat, 17 Jul 2021 22:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4t2k-000728-7N
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 22:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4t2k-0005G7-6X
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 22:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4t2k-0002Sn-5e
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 22:44: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RtHG4M9zdivVk4x9IfbuAkHMgpT7eI2VdXM+IRikWnU=; b=Wtx8cb6DfzJ0tGLn0oQBJ89CmI
	NjVneTxeBKgW+zDAZdsZlhX+6ZNQoVE6OQ2D1iRc65K0aadlgervRfUQ5LCfa9eThru7oSnpPpO9D
	EA3ihblBsBoVQlvlj6a16Hb/U70JlbnwI5D0KCyX0VuZhnGrouyn7tBHPE8LgVUtWgto=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] arm: Modify type of actlr to register_t
Message-Id: <E1m4t2k-0002Sn-5e@xenbits.xenproject.org>
Date: Sat, 17 Jul 2021 22:44:22 +0000

commit b46af13fa1241ed5d443315313c2f1fd081c0813
Author:     Michal Orzel <michal.orzel@arm.com>
AuthorDate: Wed May 5 09:43:01 2021 +0200
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:11:43 2021 -0700

    arm: Modify type of actlr to register_t
    
    AArch64 registers are 64bit whereas AArch32 registers
    are 32bit or 64bit. MSR/MRS are expecting 64bit values thus
    we should get rid of helpers READ/WRITE_SYSREG32
    in favour of using READ/WRITE_SYSREG.
    We should also use register_t type when reading sysregs
    which can correspond to uint64_t or uint32_t.
    Even though many AArch64 registers have upper 32bit reserved
    it does not mean that they can't be widen in the future.
    
    ACTLR_EL1 system register bits are implementation defined
    which means it is possibly a latent bug on current HW as the CPU
    implementer may already have decided to use the top 32bit.
    
    Signed-off-by: Michal Orzel <michal.orzel@arm.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit b80470c84553808fef3a6803000ceee8a100e63c)
---
 xen/arch/arm/domain.c        | 2 +-
 xen/include/asm-arm/domain.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index c94d2f48f1..849fef2f1e 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -329,7 +329,7 @@ static void schedule_tail(struct vcpu *prev)
 
 static void continue_new_vcpu(struct vcpu *prev)
 {
-    current->arch.actlr = READ_SYSREG32(ACTLR_EL1);
+    current->arch.actlr = READ_SYSREG(ACTLR_EL1);
     processor_vcpu_initialise(current);
 
     schedule_tail(prev);
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 4e2f582006..9c4db75f08 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -158,7 +158,7 @@ struct arch_vcpu
 
     /* Control Registers */
     register_t sctlr;
-    uint32_t actlr;
+    register_t actlr;
     uint32_t cpacr;
 
     uint32_t contextidr;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Jul 17 22:44:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Jul 2021 22:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157912.290871 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4t2w-00076C-FX; Sat, 17 Jul 2021 22:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157912.290871; Sat, 17 Jul 2021 22:44:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4t2w-000764-Ca; Sat, 17 Jul 2021 22:44:34 +0000
Received: by outflank-mailman (input) for mailman id 157912;
 Sat, 17 Jul 2021 22:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4t2u-00075g-A9
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 22:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4t2u-0005GO-9P
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 22:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4t2u-0002TQ-8k
 for xen-changelog@lists.xenproject.org; Sat, 17 Jul 2021 22:44: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tRDhgcsV0Ra3VFLSvyY/T7fuk2XD/uN0vaYhReWRUhA=; b=tPQgeSoYusUN/aOfZFT5LYyqM8
	jtWcYST6ZXB3HvXT/83PlCdulfy1BQxuum0BGcoY3qejlzIHJkyFF0zjFq0Qrs4KVZ67Yf4XV8n2c
	bF9Q9KxinFGP3HgNPW3P0qd+fU9GFRPFJ8YT0n1IwNd5BY8R+ZQak3saK1x5cEMnuSGw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] xen/arm: bootfdt: Always sort memory banks
Message-Id: <E1m4t2u-0002TQ-8k@xenbits.xenproject.org>
Date: Sat, 17 Jul 2021 22:44:32 +0000

commit 49299c4813b7847d29df07bf790f5489060f2a9c
Author:     Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
AuthorDate: Mon Jul 5 20:48:51 2021 +0300
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:11:51 2021 -0700

    xen/arm: bootfdt: Always sort memory banks
    
    At the moment, Xen on Arm64 expects the memory banks to be ordered.
    Unfortunately, there may be a case when updated by firmware
    device tree contains unordered banks. This means Xen will panic
    when setting xenheap mappings for the subsequent bank with start
    address being less than xenheap_mfn_start (start address of
    the first bank).
    
    As there is no clear requirement regarding ordering in the device
    tree, update code to be able to deal with by sorting memory
    banks. There is only one heap region on Arm32, so the sorting
    is fine to be done in the common code.
    
    Suggested-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit 4473f3601098a2c3cf5ab89d5a29504772985e3a)
---
 xen/arch/arm/bootfdt.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
index dcff512648..476e32e0f5 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/arch/arm/bootfdt.c
@@ -13,6 +13,7 @@
 #include <xen/init.h>
 #include <xen/device_tree.h>
 #include <xen/libfdt/libfdt.h>
+#include <xen/sort.h>
 #include <xsm/xsm.h>
 #include <asm/setup.h>
 
@@ -395,6 +396,21 @@ static void __init early_print_info(void)
     printk("\n");
 }
 
+/* This function assumes that memory regions are not overlapped */
+static int __init cmp_memory_node(const void *key, const void *elem)
+{
+    const struct membank *handler0 = key;
+    const struct membank *handler1 = elem;
+
+    if ( handler0->start < handler1->start )
+        return -1;
+
+    if ( handler0->start >= (handler1->start + handler1->size) )
+        return 1;
+
+    return 0;
+}
+
 /**
  * boot_fdt_info - initialize bootinfo from a DTB
  * @fdt: flattened device tree binary
@@ -412,6 +428,15 @@ size_t __init boot_fdt_info(const void *fdt, paddr_t paddr)
     add_boot_module(BOOTMOD_FDT, paddr, fdt_totalsize(fdt), false);
 
     device_tree_for_each_node((void *)fdt, 0, early_scan_node, NULL);
+
+    /*
+     * On Arm64 setup_xenheap_mappings() expects to be called with the lowest
+     * bank in memory first. There is no requirement that the DT will provide
+     * the banks sorted in ascending order. So sort them through.
+     */
+    sort(bootinfo.mem.bank, bootinfo.mem.nr_banks, sizeof(struct membank),
+         cmp_memory_node, NULL);
+
     early_print_info();
 
     return fdt_totalsize(fdt);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sun Jul 18 04:22:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Jul 2021 04:22:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157933.290917 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4yJY-0005RM-5F; Sun, 18 Jul 2021 04:22:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157933.290917; Sun, 18 Jul 2021 04:22:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4yJY-0005RD-1i; Sun, 18 Jul 2021 04:22:04 +0000
Received: by outflank-mailman (input) for mailman id 157933;
 Sun, 18 Jul 2021 04:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4yJW-0005R0-33
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 04:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4yJW-00019Z-26
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 04:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4yJW-00062z-10
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 04:22: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dAZXu/meRcgKVZ8kegN+HqZFcQm/sE4zpPUJetRGvik=; b=NCm/dGa/90HuhI56uNs8neF49H
	dwqd5wgyvLO2UakjJarDXkNzAl5vaJ93ASTdQvjTUCnzk9BZ6fXKU41PxLxwl5Cp5sxg0sqh46g1v
	IRFiWg5eDxS/Pgx/q5oc2COiTQmuY284LROhgaeVNGgYrokaKb47V6KjXn+ujqWnFgnM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] xen/arm32: SPSR_hyp/SPSR
Message-Id: <E1m4yJW-00062z-10@xenbits.xenproject.org>
Date: Sun, 18 Jul 2021 04:22:02 +0000

commit 61dea454ba87d4f5c2b900e6dff4f72805d3198c
Author:     Stefano Stabellini <sstabellini@kernel.org>
AuthorDate: Wed Jun 9 10:37:59 2021 -0700
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:07:34 2021 -0700

    xen/arm32: SPSR_hyp/SPSR
    
    SPSR_hyp is not meant to be accessed from Hyp mode (EL2); accesses
    trigger UNPREDICTABLE behaviour. Xen should read/write SPSR instead.
    See: ARM DDI 0487D.b page G8-5993.
    
    This fixes booting Xen/arm32 on QEMU.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
    Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
    (cherry picked from commit dfcffb128be46a3e413eaa941744536fe53c94b6)
---
 xen/arch/arm/arm32/entry.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S
index b228d44b19..8d1327ffe4 100644
--- a/xen/arch/arm/arm32/entry.S
+++ b/xen/arch/arm/arm32/entry.S
@@ -171,7 +171,7 @@ ENDPROC(prepare_context_from_guest)
         mrc     CP32(r11, HSR)                 /* Save exception syndrome */
         str     r11, [sp, #UREGS_hsr]
 
-        mrs     r11, SPSR_hyp
+        mrs     r11, SPSR
         str     r11, [sp, #UREGS_cpsr]
 
         /*
@@ -396,7 +396,7 @@ return_to_hypervisor:
         ldr r11, [sp, #UREGS_pc]
         msr ELR_hyp, r11
         ldr r11, [sp, #UREGS_cpsr]
-        msr SPSR_hyp, r11
+        msr SPSR, r11
 #ifdef CONFIG_ARM32_HARDEN_BRANCH_PREDICTOR
         /*
          * Hardening branch predictor may require to setup a different
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Sun Jul 18 04:22:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Jul 2021 04:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157935.290921 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4yJi-0005TL-6Y; Sun, 18 Jul 2021 04:22:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157935.290921; Sun, 18 Jul 2021 04:22:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4yJi-0005TD-3H; Sun, 18 Jul 2021 04:22:14 +0000
Received: by outflank-mailman (input) for mailman id 157935;
 Sun, 18 Jul 2021 04:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4yJg-0005Sy-62
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 04:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4yJg-00019d-59
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 04:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4yJg-000642-4H
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 04: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dPDLBk4R/un1sgUZTgPxe5yqx6zwdcHy/pwJq6tYF58=; b=lzhvqHylF2bETKDF6sF8Pve3M3
	Hqt9BFXM4SCej+YpN6lXT3e3JxMdFAsHSchGmaRUVabNWntyDCZuipC8tpOtDsCO7Yqdn+qgK1WMy
	DF+L8tCAXUK1Ym5UVKh2md0NA3btLA1FBwSCxOeD7LhqtePu7pmT2RnyLIE915RrIlDQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] Arm32: MSR to SPSR needs qualification
Message-Id: <E1m4yJg-000642-4H@xenbits.xenproject.org>
Date: Sun, 18 Jul 2021 04:22:12 +0000

commit 0e1407fc43b2c81de9956eb45251129aa5b92a89
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jun 11 15:04:24 2021 +0200
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:07:39 2021 -0700

    Arm32: MSR to SPSR needs qualification
    
    The Arm ARM's description of MSR (ARM DDI 0406C.d section B9.3.12)
    doesn't even allow for plain "SPSR" here, and while gas accepts this, it
    takes it to mean SPSR_cf. Yet surely all of SPSR wants updating on this
    path, not just the lowest and highest 8 bits.
    
    Fixes: dfcffb128be4 ("xen/arm32: SPSR_hyp/SPSR")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 93031fbe9f4c341a2e7950a088025ea550291433)
---
 xen/arch/arm/arm32/entry.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S
index 8d1327ffe4..b7c70f6e8f 100644
--- a/xen/arch/arm/arm32/entry.S
+++ b/xen/arch/arm/arm32/entry.S
@@ -396,7 +396,7 @@ return_to_hypervisor:
         ldr r11, [sp, #UREGS_pc]
         msr ELR_hyp, r11
         ldr r11, [sp, #UREGS_cpsr]
-        msr SPSR, r11
+        msr SPSR_cxsf, r11
 #ifdef CONFIG_ARM32_HARDEN_BRANCH_PREDICTOR
         /*
          * Hardening branch predictor may require to setup a different
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Sun Jul 18 04:22:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Jul 2021 04:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157936.290925 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4yJs-0005Y3-7x; Sun, 18 Jul 2021 04:22:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157936.290925; Sun, 18 Jul 2021 04:22:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4yJs-0005Xv-4s; Sun, 18 Jul 2021 04:22:24 +0000
Received: by outflank-mailman (input) for mailman id 157936;
 Sun, 18 Jul 2021 04:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4yJq-0005Xe-9O
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 04:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4yJq-0001A4-8W
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 04:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4yJq-000657-7S
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 04:22: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yr48zOLxCvjgMsqb4jfloq0J4fj92Lmj8NKyzEX83vg=; b=3s12uGbNaQ6n6plbUK5Fe+S2CY
	AdGYJ45yhI4oKhJ/YpLBhQPIPAI+YV4JLODRC67hdrlD5xxyzSni+gj5ig2Gu5AdCGifCePAdRTdI
	w/jczGhCam50FfRCa5rvqkwgnN20RsSycT3DJU8LpvIjSg11Wf33E5w+4MPIkT7EQGCU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] arm: Modify type of actlr to register_t
Message-Id: <E1m4yJq-000657-7S@xenbits.xenproject.org>
Date: Sun, 18 Jul 2021 04:22:22 +0000

commit e98cacfaaf157cf11257993b75225e6d0028f433
Author:     Michal Orzel <michal.orzel@arm.com>
AuthorDate: Wed May 5 09:43:01 2021 +0200
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:07:43 2021 -0700

    arm: Modify type of actlr to register_t
    
    AArch64 registers are 64bit whereas AArch32 registers
    are 32bit or 64bit. MSR/MRS are expecting 64bit values thus
    we should get rid of helpers READ/WRITE_SYSREG32
    in favour of using READ/WRITE_SYSREG.
    We should also use register_t type when reading sysregs
    which can correspond to uint64_t or uint32_t.
    Even though many AArch64 registers have upper 32bit reserved
    it does not mean that they can't be widen in the future.
    
    ACTLR_EL1 system register bits are implementation defined
    which means it is possibly a latent bug on current HW as the CPU
    implementer may already have decided to use the top 32bit.
    
    Signed-off-by: Michal Orzel <michal.orzel@arm.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit b80470c84553808fef3a6803000ceee8a100e63c)
---
 xen/arch/arm/domain.c        | 2 +-
 xen/include/asm-arm/domain.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index bdd3d3e5b5..5eaf4c718e 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -330,7 +330,7 @@ static void schedule_tail(struct vcpu *prev)
 
 static void continue_new_vcpu(struct vcpu *prev)
 {
-    current->arch.actlr = READ_SYSREG32(ACTLR_EL1);
+    current->arch.actlr = READ_SYSREG(ACTLR_EL1);
     processor_vcpu_initialise(current);
 
     schedule_tail(prev);
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 1da90f207d..bb0a6adbe0 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -156,7 +156,7 @@ struct arch_vcpu
 
     /* Control Registers */
     register_t sctlr;
-    uint32_t actlr;
+    register_t actlr;
     uint32_t cpacr;
 
     uint32_t contextidr;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Sun Jul 18 04:22:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Jul 2021 04:22:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157937.290929 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4yK2-0005b5-9m; Sun, 18 Jul 2021 04:22:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157937.290929; Sun, 18 Jul 2021 04:22:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m4yK2-0005ax-6V; Sun, 18 Jul 2021 04:22:34 +0000
Received: by outflank-mailman (input) for mailman id 157937;
 Sun, 18 Jul 2021 04:22:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4yK0-0005ai-CH
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 04:22:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4yK0-0001AJ-BO
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 04:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m4yK0-00066L-Ag
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 04:22: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mozNA4PcWB21+l7pFaL9/TqWOFQlV8dXIq33wnBu9pE=; b=H401m9Xfw0CrTTB1gnwNZP0p+n
	OMu1LANzs+vNJLtj/GkghEuYtEb4a1uDIoqU7cLoVsJDB8jAJdmMdasx8jW+F1iEuVcB+Mfx98ehN
	FwN2nL6IBUVoHvq4CFmvc8IscY2be06gEQfkWtZ5HQOL+bAaTDslGeful0/XvGwmh6bI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] xen/arm: bootfdt: Always sort memory banks
Message-Id: <E1m4yK0-00066L-Ag@xenbits.xenproject.org>
Date: Sun, 18 Jul 2021 04:22:32 +0000

commit dba774896f7dd74773c14d537643b7d7477fefcd
Author:     Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
AuthorDate: Mon Jul 5 20:48:51 2021 +0300
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:08:01 2021 -0700

    xen/arm: bootfdt: Always sort memory banks
    
    At the moment, Xen on Arm64 expects the memory banks to be ordered.
    Unfortunately, there may be a case when updated by firmware
    device tree contains unordered banks. This means Xen will panic
    when setting xenheap mappings for the subsequent bank with start
    address being less than xenheap_mfn_start (start address of
    the first bank).
    
    As there is no clear requirement regarding ordering in the device
    tree, update code to be able to deal with by sorting memory
    banks. There is only one heap region on Arm32, so the sorting
    is fine to be done in the common code.
    
    Suggested-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit 4473f3601098a2c3cf5ab89d5a29504772985e3a)
---
 xen/arch/arm/bootfdt.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
index dcff512648..476e32e0f5 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/arch/arm/bootfdt.c
@@ -13,6 +13,7 @@
 #include <xen/init.h>
 #include <xen/device_tree.h>
 #include <xen/libfdt/libfdt.h>
+#include <xen/sort.h>
 #include <xsm/xsm.h>
 #include <asm/setup.h>
 
@@ -395,6 +396,21 @@ static void __init early_print_info(void)
     printk("\n");
 }
 
+/* This function assumes that memory regions are not overlapped */
+static int __init cmp_memory_node(const void *key, const void *elem)
+{
+    const struct membank *handler0 = key;
+    const struct membank *handler1 = elem;
+
+    if ( handler0->start < handler1->start )
+        return -1;
+
+    if ( handler0->start >= (handler1->start + handler1->size) )
+        return 1;
+
+    return 0;
+}
+
 /**
  * boot_fdt_info - initialize bootinfo from a DTB
  * @fdt: flattened device tree binary
@@ -412,6 +428,15 @@ size_t __init boot_fdt_info(const void *fdt, paddr_t paddr)
     add_boot_module(BOOTMOD_FDT, paddr, fdt_totalsize(fdt), false);
 
     device_tree_for_each_node((void *)fdt, 0, early_scan_node, NULL);
+
+    /*
+     * On Arm64 setup_xenheap_mappings() expects to be called with the lowest
+     * bank in memory first. There is no requirement that the DT will provide
+     * the banks sorted in ascending order. So sort them through.
+     */
+    sort(bootinfo.mem.bank, bootinfo.mem.nr_banks, sizeof(struct membank),
+         cmp_memory_node, NULL);
+
     early_print_info();
 
     return fdt_totalsize(fdt);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Sun Jul 18 08:44:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Jul 2021 08:44:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157956.290968 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m52P5-0006CM-Hr; Sun, 18 Jul 2021 08:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157956.290968; Sun, 18 Jul 2021 08:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m52P5-0006CD-Ej; Sun, 18 Jul 2021 08:44:03 +0000
Received: by outflank-mailman (input) for mailman id 157956;
 Sun, 18 Jul 2021 08:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m52P4-0006Br-5X
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 08:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m52P4-0006ec-4V
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 08:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m52P4-0005Dp-3S
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 08: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BEQy0BDloj8P30Qv2QptZmmkBcUAZOaCgjKbjIEj91E=; b=adnt//fXFqJqO2acBLP0QgRzk+
	jiCl/jNaqK/6k0/H2Edu9mI/nFVtvfIcJvQ0CvAIb6Zeya74k8MVvNQm4792xsPO+cUhP6p+MI1eM
	4bjrwQ1q22CKBCI79k49+ceW49gYMbD8bj73uivkf9jAxRCMqjj5LZ9SMdIQhXIWDF4I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/arm32: SPSR_hyp/SPSR
Message-Id: <E1m52P4-0005Dp-3S@xenbits.xenproject.org>
Date: Sun, 18 Jul 2021 08:44:02 +0000

commit f6f76903e3406b61cdb566583b6f1495fe248691
Author:     Stefano Stabellini <sstabellini@kernel.org>
AuthorDate: Wed Jun 9 10:37:59 2021 -0700
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:14:02 2021 -0700

    xen/arm32: SPSR_hyp/SPSR
    
    SPSR_hyp is not meant to be accessed from Hyp mode (EL2); accesses
    trigger UNPREDICTABLE behaviour. Xen should read/write SPSR instead.
    See: ARM DDI 0487D.b page G8-5993.
    
    This fixes booting Xen/arm32 on QEMU.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
    Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
    (cherry picked from commit dfcffb128be46a3e413eaa941744536fe53c94b6)
---
 xen/arch/arm/arm32/entry.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S
index b228d44b19..8d1327ffe4 100644
--- a/xen/arch/arm/arm32/entry.S
+++ b/xen/arch/arm/arm32/entry.S
@@ -171,7 +171,7 @@ ENDPROC(prepare_context_from_guest)
         mrc     CP32(r11, HSR)                 /* Save exception syndrome */
         str     r11, [sp, #UREGS_hsr]
 
-        mrs     r11, SPSR_hyp
+        mrs     r11, SPSR
         str     r11, [sp, #UREGS_cpsr]
 
         /*
@@ -396,7 +396,7 @@ return_to_hypervisor:
         ldr r11, [sp, #UREGS_pc]
         msr ELR_hyp, r11
         ldr r11, [sp, #UREGS_cpsr]
-        msr SPSR_hyp, r11
+        msr SPSR, r11
 #ifdef CONFIG_ARM32_HARDEN_BRANCH_PREDICTOR
         /*
          * Hardening branch predictor may require to setup a different
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sun Jul 18 08:44:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Jul 2021 08:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157959.290973 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m52PF-0006L0-JG; Sun, 18 Jul 2021 08:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157959.290973; Sun, 18 Jul 2021 08:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m52PF-0006Ks-GL; Sun, 18 Jul 2021 08:44:13 +0000
Received: by outflank-mailman (input) for mailman id 157959;
 Sun, 18 Jul 2021 08:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m52PE-0006KQ-8l
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 08:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m52PE-0006eh-7g
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 08:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m52PE-0005Ei-6s
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 08: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4Qu92IGrx815YtuxI+QRGPXFQDN1F7WOmh7F6otC5lk=; b=A802buYODmHHSl9LMwSXiZXzJV
	NKyIP5bJ5eZxkuuikuEU0aonhMSuH7UiuEK1uNh1iyD2mnsbOXSb3P9VY/YWrCRqi2JCGifuLyQYk
	mzyHASTTcKM63S4DXHUhlI5gSfqDd0lgqX137I1sMkrM/FVNvvZcwBMEi2/yPa0Zt23k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] Arm32: MSR to SPSR needs qualification
Message-Id: <E1m52PE-0005Ei-6s@xenbits.xenproject.org>
Date: Sun, 18 Jul 2021 08:44:12 +0000

commit 27e08cb549500ef8e7ba112cf39bff0ad1e096a3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jun 11 15:04:24 2021 +0200
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:14:11 2021 -0700

    Arm32: MSR to SPSR needs qualification
    
    The Arm ARM's description of MSR (ARM DDI 0406C.d section B9.3.12)
    doesn't even allow for plain "SPSR" here, and while gas accepts this, it
    takes it to mean SPSR_cf. Yet surely all of SPSR wants updating on this
    path, not just the lowest and highest 8 bits.
    
    Fixes: dfcffb128be4 ("xen/arm32: SPSR_hyp/SPSR")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 93031fbe9f4c341a2e7950a088025ea550291433)
---
 xen/arch/arm/arm32/entry.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S
index 8d1327ffe4..b7c70f6e8f 100644
--- a/xen/arch/arm/arm32/entry.S
+++ b/xen/arch/arm/arm32/entry.S
@@ -396,7 +396,7 @@ return_to_hypervisor:
         ldr r11, [sp, #UREGS_pc]
         msr ELR_hyp, r11
         ldr r11, [sp, #UREGS_cpsr]
-        msr SPSR, r11
+        msr SPSR_cxsf, r11
 #ifdef CONFIG_ARM32_HARDEN_BRANCH_PREDICTOR
         /*
          * Hardening branch predictor may require to setup a different
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sun Jul 18 08:44:23 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Jul 2021 08:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157962.290976 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m52PP-0006Ph-L0; Sun, 18 Jul 2021 08:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157962.290976; Sun, 18 Jul 2021 08:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m52PP-0006PZ-Hq; Sun, 18 Jul 2021 08:44:23 +0000
Received: by outflank-mailman (input) for mailman id 157962;
 Sun, 18 Jul 2021 08:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m52PO-0006PA-BZ
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 08:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m52PO-0006es-Af
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 08:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m52PO-0005Fc-9s
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 08:44: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PEQz0K1FoY1t6tq7F6FDAxgCwYvDmwxU1VcNfz47QdM=; b=4/MY6EMTTRy6DsmYzNWm+2ri8/
	ZkEADGEV0GcHpKfQFOh/pOo7BUeJmoSyVlEYT12xCEq1mTAss4bSv7cT6CmdcDVtpE5mHIWQJNhOc
	aZU9bZdV4EnDn0FTekP9MfP6S30eYqbw2r09ePCaV5gHFjaBUt+g+Z5nLGntKFlHnrhI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] arm: Modify type of actlr to register_t
Message-Id: <E1m52PO-0005Fc-9s@xenbits.xenproject.org>
Date: Sun, 18 Jul 2021 08:44:22 +0000

commit 41e8d5d47f17a59b752aa2f47e45ff47a39fe485
Author:     Michal Orzel <michal.orzel@arm.com>
AuthorDate: Wed May 5 09:43:01 2021 +0200
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:14:15 2021 -0700

    arm: Modify type of actlr to register_t
    
    AArch64 registers are 64bit whereas AArch32 registers
    are 32bit or 64bit. MSR/MRS are expecting 64bit values thus
    we should get rid of helpers READ/WRITE_SYSREG32
    in favour of using READ/WRITE_SYSREG.
    We should also use register_t type when reading sysregs
    which can correspond to uint64_t or uint32_t.
    Even though many AArch64 registers have upper 32bit reserved
    it does not mean that they can't be widen in the future.
    
    ACTLR_EL1 system register bits are implementation defined
    which means it is possibly a latent bug on current HW as the CPU
    implementer may already have decided to use the top 32bit.
    
    Signed-off-by: Michal Orzel <michal.orzel@arm.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit b80470c84553808fef3a6803000ceee8a100e63c)
---
 xen/arch/arm/domain.c        | 2 +-
 xen/include/asm-arm/domain.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index dfbd711325..ddeccb992c 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -329,7 +329,7 @@ static void schedule_tail(struct vcpu *prev)
 
 static void continue_new_vcpu(struct vcpu *prev)
 {
-    current->arch.actlr = READ_SYSREG32(ACTLR_EL1);
+    current->arch.actlr = READ_SYSREG(ACTLR_EL1);
     processor_vcpu_initialise(current);
 
     schedule_tail(prev);
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index b405cd539e..f1776c6c08 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -165,7 +165,7 @@ struct arch_vcpu
 
     /* Control Registers */
     register_t sctlr;
-    uint32_t actlr;
+    register_t actlr;
     uint32_t cpacr;
 
     uint32_t contextidr;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sun Jul 18 08:44:33 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Jul 2021 08:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.157963.290981 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m52PZ-0006U1-Ma; Sun, 18 Jul 2021 08:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 157963.290981; Sun, 18 Jul 2021 08:44:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m52PZ-0006Tt-JS; Sun, 18 Jul 2021 08:44:33 +0000
Received: by outflank-mailman (input) for mailman id 157963;
 Sun, 18 Jul 2021 08:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m52PY-0006Ta-EQ
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 08:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m52PY-0006fO-DZ
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 08:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m52PY-0005GR-Cp
 for xen-changelog@lists.xenproject.org; Sun, 18 Jul 2021 08:44: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=49rMLof1hhkvU2WO9Xl0mzXFdToImDjbsr54f0Ovw4I=; b=Uhj3gTCpNJ8leFw02D1ZBZLhWv
	PSr1qhDnXtgBFVTIM9QuYr0iAoZZ4Fbu4tPh1dHKzikPI7l5aDwb0O6suUGCEapb/8cJJ3C2sbKtM
	Rgzl1QvYXNd6Rp6X+MAwmG1FcjlblHviuG3za8VToi45zqAo3RhmQ4DGoamp8P8dm8MM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/arm: bootfdt: Always sort memory banks
Message-Id: <E1m52PY-0005GR-Cp@xenbits.xenproject.org>
Date: Sun, 18 Jul 2021 08:44:32 +0000

commit 32d580902b959000d79d51dff03a3560653c4fcb
Author:     Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
AuthorDate: Mon Jul 5 20:48:51 2021 +0300
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Jul 16 13:14:19 2021 -0700

    xen/arm: bootfdt: Always sort memory banks
    
    At the moment, Xen on Arm64 expects the memory banks to be ordered.
    Unfortunately, there may be a case when updated by firmware
    device tree contains unordered banks. This means Xen will panic
    when setting xenheap mappings for the subsequent bank with start
    address being less than xenheap_mfn_start (start address of
    the first bank).
    
    As there is no clear requirement regarding ordering in the device
    tree, update code to be able to deal with by sorting memory
    banks. There is only one heap region on Arm32, so the sorting
    is fine to be done in the common code.
    
    Suggested-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit 4473f3601098a2c3cf5ab89d5a29504772985e3a)
---
 xen/arch/arm/bootfdt.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
index 08fb59f4e7..41fb4dc872 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/arch/arm/bootfdt.c
@@ -13,6 +13,7 @@
 #include <xen/init.h>
 #include <xen/device_tree.h>
 #include <xen/libfdt/libfdt.h>
+#include <xen/sort.h>
 #include <xsm/xsm.h>
 #include <asm/setup.h>
 
@@ -394,6 +395,21 @@ static void __init early_print_info(void)
     printk("\n");
 }
 
+/* This function assumes that memory regions are not overlapped */
+static int __init cmp_memory_node(const void *key, const void *elem)
+{
+    const struct membank *handler0 = key;
+    const struct membank *handler1 = elem;
+
+    if ( handler0->start < handler1->start )
+        return -1;
+
+    if ( handler0->start >= (handler1->start + handler1->size) )
+        return 1;
+
+    return 0;
+}
+
 /**
  * boot_fdt_info - initialize bootinfo from a DTB
  * @fdt: flattened device tree binary
@@ -411,6 +427,15 @@ size_t __init boot_fdt_info(const void *fdt, paddr_t paddr)
     add_boot_module(BOOTMOD_FDT, paddr, fdt_totalsize(fdt), false);
 
     device_tree_for_each_node((void *)fdt, 0, early_scan_node, NULL);
+
+    /*
+     * On Arm64 setup_xenheap_mappings() expects to be called with the lowest
+     * bank in memory first. There is no requirement that the DT will provide
+     * the banks sorted in ascending order. So sort them through.
+     */
+    sort(bootinfo.mem.bank, bootinfo.mem.nr_banks, sizeof(struct membank),
+         cmp_memory_node, NULL);
+
     early_print_info();
 
     return fdt_totalsize(fdt);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Jul 19 10:33:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Jul 2021 10:33:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158300.291508 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5Qa9-00071i-KA; Mon, 19 Jul 2021 10:33:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158300.291508; Mon, 19 Jul 2021 10:33:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5Qa9-00071c-H0; Mon, 19 Jul 2021 10:33:05 +0000
Received: by outflank-mailman (input) for mailman id 158300;
 Mon, 19 Jul 2021 10:33:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5Qa8-00070y-JY
 for xen-changelog@lists.xenproject.org; Mon, 19 Jul 2021 10:33:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5Qa8-0008CR-GN
 for xen-changelog@lists.xenproject.org; Mon, 19 Jul 2021 10:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5Qa8-0008GG-FI
 for xen-changelog@lists.xenproject.org; Mon, 19 Jul 2021 10: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NrkmQ7ceSt1eoDqqoKYBeADun8BCyamLzR19OO1u/Bk=; b=SBLkGb0aDdOxM5Nj/pXopkN81Z
	p5ijThgLTo7MvdL3JEvwKW+3AS6yU6rNOu+CQTRrKRJj3oOjz4MU1NzyeRMyTl5Gz2O0cAcYh+Q1n
	CAQQYei3zzh+mwWkjIe8F+vUf3lLsTZjJ7wasu133/JBR9/1g8UOkdBc1QecG8tFcYsQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libxl/x86: check return value of SHADOW_OP_SET_ALLOCATION domctl
Message-Id: <E1m5Qa8-0008GG-FI@xenbits.xenproject.org>
Date: Mon, 19 Jul 2021 10:33:04 +0000

commit 0be5a00af590c97ea553aadb60f1e0b3af53d8f6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jul 19 12:28:09 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 19 12:28:09 2021 +0200

    libxl/x86: check return value of SHADOW_OP_SET_ALLOCATION domctl
    
    The hypervisor may not have enough memory to satisfy the request. While
    there, make the unit of the value clear by renaming the local variable.
    
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/light/libxl_x86.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/tools/libs/light/libxl_x86.c b/tools/libs/light/libxl_x86.c
index ac09897a63..18c3c77ccd 100644
--- a/tools/libs/light/libxl_x86.c
+++ b/tools/libs/light/libxl_x86.c
@@ -529,10 +529,20 @@ int libxl__arch_domain_create(libxl__gc *gc,
         xc_domain_set_time_offset(ctx->xch, domid, rtc_timeoffset);
 
     if (d_config->b_info.type != LIBXL_DOMAIN_TYPE_PV) {
-        unsigned long shadow = DIV_ROUNDUP(d_config->b_info.shadow_memkb,
-                                           1024);
-        xc_shadow_control(ctx->xch, domid, XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION,
-                          NULL, 0, &shadow, 0, NULL);
+        unsigned long shadow_mb = DIV_ROUNDUP(d_config->b_info.shadow_memkb,
+                                              1024);
+        int r = xc_shadow_control(ctx->xch, domid,
+                                  XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION,
+                                  NULL, 0, &shadow_mb, 0, NULL);
+
+        if (r) {
+            LOGED(ERROR, domid,
+                  "Failed to set %lu MiB %s allocation",
+                  shadow_mb,
+                  libxl_defbool_val(d_config->c_info.hap) ? "HAP" : "shadow");
+            ret = ERROR_FAIL;
+            goto out;
+        }
     }
 
     if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_PV &&
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jul 19 10:33:15 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Jul 2021 10:33:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158301.291512 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5QaJ-0007DL-Ld; Mon, 19 Jul 2021 10:33:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158301.291512; Mon, 19 Jul 2021 10:33:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5QaJ-0007DD-IR; Mon, 19 Jul 2021 10:33:15 +0000
Received: by outflank-mailman (input) for mailman id 158301;
 Mon, 19 Jul 2021 10:33:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5QaI-0007BY-KJ
 for xen-changelog@lists.xenproject.org; Mon, 19 Jul 2021 10:33:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5QaI-0008E2-JX
 for xen-changelog@lists.xenproject.org; Mon, 19 Jul 2021 10:33:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5QaI-0008H9-IS
 for xen-changelog@lists.xenproject.org; Mon, 19 Jul 2021 10: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7/dLXQ3QMl3JQE2KGm2mq/gW739/6F8bWilZ8ScNcN0=; b=kq2OFYIHxerK7H+kY1+f+uxlms
	g+7TeA1LEYKeVbnfD6DutkrgPWhPggBYIGgpg651br22LNV7BJab3gU0mAfqS8rx1vt8I77Y2kBkW
	Kw+eNiecm8aZO/LW7DTPzB3HYVi0JyDZ3JjlJzm1svJmpYXAhNEyYYcI+fzFd2T5kyf8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/AMD: adjust SYSCFG, TOM, etc exposure to deal with running nested
Message-Id: <E1m5QaI-0008H9-IS@xenbits.xenproject.org>
Date: Mon, 19 Jul 2021 10:33:14 +0000

commit 471383ddd1843700fdd7d74242ba0e5f314dc678
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jul 19 12:28:50 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 19 12:28:50 2021 +0200

    x86/AMD: adjust SYSCFG, TOM, etc exposure to deal with running nested
    
    In the original change I neglected to consider the case of us running as
    L1 under another Xen. In this case we're not Dom0, so the underlying Xen
    wouldn't permit us access to these MSRs. As an immediate workaround use
    rdmsr_safe(); I don't view this as the final solution though, as the
    original problem the earlier change tried to address also applies when
    running nested. Yet it is then unclear to me how to properly address the
    issue: We shouldn't generally expose the MSR values, but handing back
    zero (or effectively any other static value) doesn't look appropriate
    either.
    
    Fixes: bfcdaae9c210 ("x86/AMD: expose SYSCFG, TOM, TOM2, and IORRs to Dom0")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/x86/msr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index 650d060b12..b834456c7b 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -367,7 +367,8 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
             goto gp_fault;
         if ( !is_hardware_domain(d) )
             return X86EMUL_UNHANDLEABLE;
-        rdmsrl(msr, *val);
+        if ( rdmsr_safe(msr, *val) )
+            goto gp_fault;
         if ( msr == MSR_K8_SYSCFG )
             *val &= (SYSCFG_TOM2_FORCE_WB | SYSCFG_MTRR_TOM2_EN |
                      SYSCFG_MTRR_VAR_DRAM_EN | SYSCFG_MTRR_FIX_DRAM_EN);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jul 19 13:44:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Jul 2021 13:44:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158448.291683 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5TYz-0007Mz-ST; Mon, 19 Jul 2021 13:44:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158448.291683; Mon, 19 Jul 2021 13:44:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5TYz-0007Mr-PQ; Mon, 19 Jul 2021 13:44:05 +0000
Received: by outflank-mailman (input) for mailman id 158448;
 Mon, 19 Jul 2021 13:44:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5TYy-0007Ml-Q3
 for xen-changelog@lists.xenproject.org; Mon, 19 Jul 2021 13:44:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5TYy-0002zs-P9
 for xen-changelog@lists.xenproject.org; Mon, 19 Jul 2021 13:44:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5TYy-0003zc-OB
 for xen-changelog@lists.xenproject.org; Mon, 19 Jul 2021 13: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ghg+kTCWMUQL0ehPDum5CkVgv2yg9Wb9BaELvsWYqRk=; b=KJCyJ6oAdocBCIkTHXswh0faej
	3JRVMf8W8XG+zH3jDHtahziobeiO1ZlCZQiSUhMtvwGYSyqZrns/8fkYd7I1RuYgw4FydmPXTqdTQ
	EV9aVCpivOomLAyna7ZeKpW5vvb3Bs66VWYRTEor5A0pJpTjt5OzlZuKjbn1YGhfa170=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/hvm: Propagate real error information up through hvm_load()
Message-Id: <E1m5TYy-0003zc-OB@xenbits.xenproject.org>
Date: Mon, 19 Jul 2021 13:44:04 +0000

commit 96e5ad4c476e70688295b3cfb537847a3351d6fd
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 19 11:44:06 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Jul 19 14:34:38 2021 +0100

    x86/hvm: Propagate real error information up through hvm_load()
    
    hvm_load() is currently a mix of -errno and -1 style error handling, which
    aliases -EPERM.  This leads to the following confusing diagnostics:
    
    From userspace:
      xc: info: Restoring domain
      xc: error: Unable to restore HVM context (1 = Operation not permitted): Internal error
      xc: error: Restore failed (1 = Operation not permitted): Internal error
      xc_domain_restore: [1] Restore failed (1 = Operation not permitted)
    
    From Xen:
      (XEN) HVM10.0 restore: inconsistent xsave state (feat=0x2ff accum=0x21f xcr0=0x7 bv=0x3 err=-22)
      (XEN) HVM10 restore: failed to load entry 16/0
    
    The actual error was a bad backport, but the -EINVAL got converted to -EPERM
    on the way out of the hypercall.
    
    The overwhelming majority of *_load() handlers already use -errno consistenty.
    Fix up the rest to be consistent, and fix a few other errors noticed along the
    way.
    
     * Failures of hvm_load_entry() indicate a truncated record or other bad data
       size.  Use -ENODATA.
     * Don't use {g,}dprintk().  Omitting diagnostics in release builds is rude,
       and almost everything uses unconditional printk()'s.
     * Switch some errors for more appropriate ones.
    
    Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/mcheck/vmce.c |  6 +++---
 xen/arch/x86/emul-i8254.c      |  9 +++++----
 xen/arch/x86/hvm/irq.c         |  6 +++---
 xen/arch/x86/hvm/save.c        | 25 ++++++++++++++-----------
 xen/arch/x86/hvm/vioapic.c     |  5 ++++-
 xen/arch/x86/hvm/vpic.c        |  2 +-
 6 files changed, 30 insertions(+), 23 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/vmce.c b/xen/arch/x86/cpu/mcheck/vmce.c
index b1df9e9efd..eb6434a3ba 100644
--- a/xen/arch/x86/cpu/mcheck/vmce.c
+++ b/xen/arch/x86/cpu/mcheck/vmce.c
@@ -82,11 +82,11 @@ int vmce_restore_vcpu(struct vcpu *v, const struct hvm_vmce_vcpu *ctxt)
 
     if ( ctxt->caps & ~guest_mcg_cap & ~MCG_CAP_COUNT & ~MCG_CTL_P )
     {
-        dprintk(XENLOG_G_ERR, "%s restore: unsupported MCA capabilities"
-                " %#" PRIx64 " for %pv (supported: %#Lx)\n",
+        printk(XENLOG_G_ERR
+               "%s restore: unsupported MCA capabilities %#"PRIx64" for %pv (supported: %#Lx)\n",
                 is_hvm_vcpu(v) ? "HVM" : "PV", ctxt->caps,
                 v, guest_mcg_cap & ~MCG_CAP_COUNT);
-        return -EPERM;
+        return -EINVAL;
     }
 
     v->arch.vmce.mcg_cap = ctxt->caps;
diff --git a/xen/arch/x86/emul-i8254.c b/xen/arch/x86/emul-i8254.c
index 73be4188ad..050c784702 100644
--- a/xen/arch/x86/emul-i8254.c
+++ b/xen/arch/x86/emul-i8254.c
@@ -412,7 +412,7 @@ static int pit_save(struct vcpu *v, hvm_domain_context_t *h)
 static int pit_load(struct domain *d, hvm_domain_context_t *h)
 {
     PITState *pit = domain_vpit(d);
-    int i;
+    int i, rc = 0;
 
     if ( !has_vpit(d) )
         return -ENODEV;
@@ -421,8 +421,8 @@ static int pit_load(struct domain *d, hvm_domain_context_t *h)
 
     if ( hvm_load_entry(PIT, h, &pit->hw) )
     {
-        spin_unlock(&pit->lock);
-        return 1;
+        rc = -ENODATA;
+        goto out;
     }
     
     /*
@@ -434,9 +434,10 @@ static int pit_load(struct domain *d, hvm_domain_context_t *h)
     for ( i = 0; i < 3; i++ )
         pit_load_count(pit, i, pit->hw.channels[i].count);
 
+ out:
     spin_unlock(&pit->lock);
 
-    return 0;
+    return rc;
 }
 
 HVM_REGISTER_SAVE_RESTORE(PIT, pit_save, pit_load, 1, HVMSR_PER_DOM);
diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index 38ac5fb6c7..52aae4565f 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -773,9 +773,9 @@ static int irq_load_link(struct domain *d, hvm_domain_context_t *h)
     for ( link = 0; link < 4; link++ )
         if ( hvm_irq->pci_link.route[link] > 15 )
         {
-            gdprintk(XENLOG_ERR, 
-                     "HVM restore: PCI-ISA link %u out of range (%u)\n",
-                     link, hvm_irq->pci_link.route[link]);
+            printk(XENLOG_G_ERR
+                   "HVM restore: PCI-ISA link %u out of range (%u)\n",
+                   link, hvm_irq->pci_link.route[link]);
             return -EINVAL;
         }
 
diff --git a/xen/arch/x86/hvm/save.c b/xen/arch/x86/hvm/save.c
index 584620985b..86c82cbd74 100644
--- a/xen/arch/x86/hvm/save.c
+++ b/xen/arch/x86/hvm/save.c
@@ -51,14 +51,14 @@ int arch_hvm_load(struct domain *d, struct hvm_save_header *hdr)
     {
         printk(XENLOG_G_ERR "HVM%d restore: bad magic number %#"PRIx32"\n",
                d->domain_id, hdr->magic);
-        return -1;
+        return -EINVAL;
     }
 
     if ( hdr->version != HVM_FILE_VERSION )
     {
         printk(XENLOG_G_ERR "HVM%d restore: unsupported version %u\n",
                d->domain_id, hdr->version);
-        return -1;
+        return -EINVAL;
     }
 
     cpuid(1, &eax, &ebx, &ecx, &edx);
@@ -294,16 +294,18 @@ int hvm_load(struct domain *d, hvm_domain_context_t *h)
     struct hvm_save_descriptor *desc;
     hvm_load_handler handler;
     struct vcpu *v;
+    int rc;
 
     if ( d->is_dying )
         return -EINVAL;
 
     /* Read the save header, which must be first */
     if ( hvm_load_entry(HEADER, h, &hdr) != 0 )
-        return -1;
+        return -ENODATA;
 
-    if ( arch_hvm_load(d, &hdr) )
-        return -1;
+    rc = arch_hvm_load(d, &hdr);
+    if ( rc )
+        return rc;
 
     /* Down all the vcpus: we only re-enable the ones that had state saved. */
     for_each_vcpu(d, v)
@@ -318,7 +320,7 @@ int hvm_load(struct domain *d, hvm_domain_context_t *h)
             printk(XENLOG_G_ERR
                    "HVM%d restore: save did not end with a null entry\n",
                    d->domain_id);
-            return -1;
+            return -ENODATA;
         }
 
         /* Read the typecode of the next entry  and check for the end-marker */
@@ -332,17 +334,18 @@ int hvm_load(struct domain *d, hvm_domain_context_t *h)
         {
             printk(XENLOG_G_ERR "HVM%d restore: unknown entry typecode %u\n",
                    d->domain_id, desc->typecode);
-            return -1;
+            return -EINVAL;
         }
 
         /* Load the entry */
         printk(XENLOG_G_INFO "HVM%d restore: %s %"PRIu16"\n", d->domain_id,
                hvm_sr_handlers[desc->typecode].name, desc->instance);
-        if ( handler(d, h) != 0 )
+        rc = handler(d, h);
+        if ( rc )
         {
-            printk(XENLOG_G_ERR "HVM%d restore: failed to load entry %u/%u\n",
-                   d->domain_id, desc->typecode, desc->instance);
-            return -1;
+            printk(XENLOG_G_ERR "HVM%d restore: failed to load entry %u/%u rc %d\n",
+                   d->domain_id, desc->typecode, desc->instance, rc);
+            return rc;
         }
         process_pending_softirqs();
     }
diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index 87370dd417..553c0f76ef 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -620,7 +620,10 @@ static int ioapic_load(struct domain *d, hvm_domain_context_t *h)
          d->arch.hvm.nr_vioapics != 1 )
         return -EOPNOTSUPP;
 
-    return hvm_load_entry(IOAPIC, h, &s->domU);
+    if ( hvm_load_entry(IOAPIC, h, &s->domU) )
+        return -ENODATA;
+
+    return 0;
 }
 
 HVM_REGISTER_SAVE_RESTORE(IOAPIC, ioapic_save, ioapic_load, 1, HVMSR_PER_DOM);
diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
index f465b7f997..af988a868c 100644
--- a/xen/arch/x86/hvm/vpic.c
+++ b/xen/arch/x86/hvm/vpic.c
@@ -430,7 +430,7 @@ static int vpic_load(struct domain *d, hvm_domain_context_t *h)
 
     /* Which PIC is this? */
     if ( inst > 1 )
-        return -EINVAL;
+        return -ENOENT;
     s = &d->arch.hvm.vpic[inst];
 
     /* Load the state */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:44:06 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158859.292247 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rud-0003g7-So; Tue, 20 Jul 2021 15:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158859.292247; Tue, 20 Jul 2021 15:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rud-0003fy-OJ; Tue, 20 Jul 2021 15:44:03 +0000
Received: by outflank-mailman (input) for mailman id 158859;
 Tue, 20 Jul 2021 15:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ruc-0003ff-9Z
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ruc-0004J6-8d
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ruc-00019s-7b
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jV4zFgejN5ggXhDZNOkp+DQjzWV1opEoRr+3Ut44cLU=; b=0HyI8RZNj6TmMBzJB8WK7cog5e
	TvEbP4mRuIu6PM5q0QYOUsGADezj3hZzGB2T+ZNw0A1EZBhVvhF63d6s2fhXs5tFLdZVRu7NvAE0F
	gFgL6mlN0ZIV0tUvUvMCvLiqgTo2cp42/HPV4X9EMnwIhNafMQAVlrP6CxsrjcqOGHUw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/designs/launch: Hyperlaunch design document
Message-Id: <E1m5ruc-00019s-7b@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:44:02 +0000

commit d4f3125f1bb4683a61a47d281ac5effa0740e79b
Author:     Daniel P. Smith <dpsmith@apertussolutions.com>
AuthorDate: Fri Jul 9 08:19:47 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 9 08:21:45 2021 +0200

    docs/designs/launch: Hyperlaunch design document
    
    Adds a design document for Hyperlaunch, formerly DomB mode of dom0less.
    
    Signed-off-by: Christopher Clark <christopher.clark@starlab.io>
    Signed-off by: Daniel P. Smith <dpsmith@apertussolutions.com>
    Reviewed-by: Rich Persaud <rp@stacktrust.org>
---
 docs/designs/launch/hyperlaunch.rst | 1004 +++++++++++++++++++++++++++++++++++
 1 file changed, 1004 insertions(+)

diff --git a/docs/designs/launch/hyperlaunch.rst b/docs/designs/launch/hyperlaunch.rst
new file mode 100644
index 0000000000..4c138da884
--- /dev/null
+++ b/docs/designs/launch/hyperlaunch.rst
@@ -0,0 +1,1004 @@
+###########################
+Hyperlaunch Design Document
+###########################
+
+.. sectnum:: :depth: 4
+
+This post is a Request for Comment on the included v4 of a design document that
+describes Hyperlaunch: a new method of launching the Xen hypervisor, relating
+to dom0less and work from the Hyperlaunch project. We invite discussion of this
+on this list, at the monthly Xen Community Calls, and at dedicated meetings on
+this topic in the Xen Working Group which will be announced in advance on the
+Xen Development mailing list.
+
+
+.. contents:: :depth: 3
+
+
+Introduction
+============
+
+This document describes the design and motivation for the funded development of
+a new, flexible system for launching the Xen hypervisor and virtual machines
+named: "Hyperlaunch".
+
+The design enables seamless transition for existing systems that require a
+dom0, and provides a new general capability to build and launch alternative
+configurations of virtual machines, including support for static partitioning
+and accelerated start of VMs during host boot, while adhering to the principles
+of least privilege. It incorporates the existing dom0less functionality,
+extended to fold in the new developments from the Hyperlaunch project, with
+support for both x86 and Arm platform architectures, building upon and
+replacing the earlier 'late hardware domain' feature for disaggregation of
+dom0.
+
+Hyperlaunch is designed to be flexible and reusable across multiple use cases,
+and our aim is to ensure that it is capable, widely exercised, comprehensively
+tested, and well understood by the Xen community.
+
+Document Structure
+==================
+
+This is the primary design document for Hyperlaunch, to provide an overview of
+the feature. Separate additional documents will cover specific aspects of
+Hyperlaunch in further detail, including:
+
+  - The Device Tree specification for Hyperlaunch metadata
+  - New Domain Roles for Xen and the Xen Security Modules (XSM) policy
+  - Passthrough of PCI devices with Hyperlaunch
+
+Approach
+========
+
+Born out of improving support for Dynamic Root of Trust for Measurement (DRTM),
+the Hyperlaunch project is focused on restructuring the system launch of Xen.
+The Hyperlaunch design provides a security architecture that builds on the
+principles of Least Privilege and Strong Isolation, achieving this through the
+disaggregation of system functions. It enables this with the introduction of a
+boot domain that works in conjunction with the hypervisor to provide the
+ability to launch multiple domains as part of host boot while maintaining a
+least privilege implementation.
+
+While the Hyperlaunch project inception was and continues to be driven by a
+focus on security through disaggregation, there are multiple use cases with a
+non-security focus that require or benefit from the ability to launch multiple
+domains at host boot. This was proven by the need that drove the implementation
+of the dom0less capability in the Arm branch of Xen.
+
+Hyperlaunch is designed to be flexible and reusable across multiple use cases,
+and our aim is to ensure that it is capable, widely exercised, comprehensively
+tested, and provides a robust foundation for current and emerging system launch
+requirements of the Xen community.
+
+
+Objectives
+----------
+
+* In general strive to maintain compatibility with existing Xen behavior
+* A default build of the hypervisor should be capable of booting both legacy-compatible and new styles of launch:
+
+        * classic Xen boot: starting a single, privileged Dom0
+        * classic Xen boot with late hardware domain: starting a Dom0 that transitions hardware access/control to another domain
+        * a dom0less boot: starting multiple domains without privilege assignment controls
+        * Hyperlaunch: starting one or more VMs, with flexible configuration
+
+* Preferred that it be managed via KCONFIG options to govern inclusion of support for each style
+* The selection between classic boot and Hyperlaunch boot should be automatic
+
+        * Preferred that it not require a kernel command line parameter for selection
+
+* It should not require modification to boot loaders
+* It should provide a user friendly interface for its configuration and management
+* It must provide a method for building systems that fallback to console access in the event of misconfiguration
+* It should be able to boot an x86 Xen environment without the need for a Dom0 domain
+
+
+Requirements and Design
+=======================
+
+Hyperlaunch is defined as the ability of a hypervisor to construct and start
+one or more virtual machines at system launch in a specific way. A hypervisor
+can support one or both modes of configuration, Hyperlaunch Static and
+Hyperlaunch Dynamic. The Hyperlaunch Static mode functions as a static
+partitioning hypervisor ensuring only the virtual machines started at system
+launch are running on the system. The Hyperlaunch Dynamic mode functions as a
+dynamic hypervisor allowing for additional virtual machines to be started after
+the initial virtual machines have started. The Xen hypervisor is capable of
+both modes of configuration from the same binary and when paired with its XSM
+flask, provides strong controls that enable fine grained system partitioning.
+
+Hypervisor Launch Landscape
+---------
+
+This comparison table presents the distinctive capabilities of Hyperlaunch with
+reference to existing launch configurations currently available in Xen and
+other hypervisors.
+
+::
+
+ +---------------+-----------+------------+-----------+-------------+---------------------+
+ | **Xen Dom0**  | **Linux** | **Late**   | **Jail**  | **Xen**     | **Xen Hyperlaunch** |
+ | **(Classic)** | **KVM**   | **HW Dom** | **house** | **dom0less**+---------+-----------+
+ |               |           |            |           |             | Static  | Dynamic   |
+ +===============+===========+============+===========+=============+=========+===========+
+ | Hypervisor able to launch multiple VMs during host boot                                |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |            |     Y     |       Y     |    Y    |     Y     |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | Hypervisor supports Static Partitioning                                                |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |            |     Y     |       Y     |    Y    |           |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | Able to launch VMs dynamically after host boot                                         |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |       Y       |     Y     |      Y*    |     Y     |       Y*    |         |     Y     |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | Supports strong isolation between all VMs started at host boot                         |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |            |     Y     |       Y     |    Y    |     Y     |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | Enables flexible sequencing of VM start during host boot                               |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |            |           |             |    Y    |     Y     |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | Prevent all-powerful static root domain being launched at boot                         |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |            |           |       Y*    |    Y    |     Y     |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | Operates without a Highly-privileged management VM (eg. Dom0)                          |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |      Y*    |           |       Y*    |    Y    |     Y     |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | Operates without a privileged toolstack VM (Control Domain)                            |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |            |           |       Y*    |    Y    |           |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | Extensible VM configuration applied before launch of VMs at host boot                  |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |            |           |             |    Y    |     Y     |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | Flexible granular assignment of permissions and functions to VMs                       |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |            |           |             |    Y    |     Y     |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | Supports extensible VM measurement architecture for DRTM and attestation               |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |            |           |             |    Y    |     Y     |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ | PCI passthrough configured at host boot                                                |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+ |               |           |            |           |             |    Y    |     Y     |
+ +---------------+-----------+------------+-----------+-------------+---------+-----------+
+
+
+Domain Construction
+-------------------
+
+An important aspect of the Hyperlaunch architecture is that the hypervisor
+performs domain construction for all the Initial Domains,  ie. it builds each
+domain that is described in the Launch Control Module. More specifically, the
+hypervisor will perform the function of *domain creation* for each Initial
+Domain: it allocates the unique domain identifier assigned to the virtual
+machine and records essential metadata about it in the internal data structure
+that enables scheduling the domain to run. It will also perform *basic domain
+construction*: build the initial page tables with data from the kernel and
+initial ramdisk supplied, and as appropriate for the domain type, populate the
+p2m table and ACPI tables.
+
+Subsequent to this, the boot domain can apply additional configuration to the
+initial domains from the data in the LCM, in *extended domain construction*.
+
+The benefits of this structure include:
+
+* Security: Contrains the permissions required by the boot domain: it does not
+  require the capability to create domains in this structure. This aligns with
+  the principles of least privilege.
+* Flexibility: Enables policy-based dynamic assignment of hardware by the boot
+  domain, customizable according to use-case and able to adapt to hardware
+  discovery
+* Compatibility: Supports reuse of familiar tools with use-case customized boot
+  domains.
+* Commonality: Reuses the same logic for initial basic domain building across
+  diverse Xen deployments.
+	* It aligns the x86 initial domain construction with the existing Arm
+	  dom0less feature for construction of multiple domains at boot.
+	* The boot domain implementation may vary significantly with different
+	  deployment use cases, whereas the hypervisor implementation is
+	  common.
+* Correctness: Increases confidence in the implementation of domain
+  construction, since it is performed by the hypervisor in well maintained and
+  centrally tested logic.
+* Performance: Enables launch for configurations where a fast start of
+  multiple domains at boot is a requirement.
+* Capability: Supports launch of advanced configurations where a sequenced
+  start of multiple domains is required, or multiple domains are involved in
+  startup of the running system configuration
+	* eg. for PCI passthrough on systems where the toolstack runs in a
+	  separate domain to the hardware management.
+
+Please, see the ‘Hyperlaunch Device Tree’ design document, which describes the
+configuration module that is provided to the hypervisor by the bootloader.
+
+The hypervisor determines how these domains are started as host boot completes:
+in some systems the Boot Domain acts upon the extended boot configuration
+supplied as part of launch, performing configuration tasks for preparing the
+other domains for the hypervisor to commence running them.
+
+Common Boot Configurations
+--------------------------
+
+When looking across those that have expressed interest or discussed a need for
+launching multiple domains at host boot, the Hyperlaunch approach is to provide
+the means to start nearly any combination of domains. Below is an enumerated
+selection of common boot configurations for reference in the following section.
+
+Dynamic Launch with a Highly-Privileged Domain 0
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Hyperlaunch Classic: Dom0
+        This configuration mimics the classic Xen start and domain construction
+        where a single domain is constructed with all privileges and functions for
+        managing hardware and running virtualization toolstack software.
+
+Hyperlaunch Classic: Extended Launch Dom0
+        This configuration is where a Dom0 is started via a Boot Domain that runs
+        first. This is for cases where some preprocessing in a less privileged domain
+        is required before starting the all-privileged Domain 0.
+
+Hyperlaunch Classic: Basic Cloud
+        This configuration constructs a Dom0 that is started in parallel with some
+        number of workload domains.
+
+Hyperlaunch Classic: Cloud
+        This configuration builds a Dom0 and some number of workload domains, launched
+        via a Boot Domain that runs first.
+
+
+Static Launch Configurations: without a Domain 0 or a Control Domain
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Hyperlaunch Static: Basic
+        Simple static partitioning where all domains that can be run on this system are
+        built and started during host boot and where no domain is started with the
+        Control Domain permissions, thus making it not possible to create/start any
+        further new domains.
+
+Hyperlaunch Static: Standard
+        This is a variation of the “Hyperlaunch Static: Basic” static partitioning
+        configuration with the introduction of a Boot Domain. This configuration allows
+        for use of a Boot Domain to be able to apply extended configuration
+        to the Initial Domains before they are started and
+        sequence the order in which they start.
+
+Hyperlaunch Static: Disaggregated
+        This is a variation of the “Hyperlaunch Static: Standard” configuration with
+        the introduction of a Boot Domain and an illustration that some functions can
+        be disaggregated to dedicated domains.
+
+Dynamic Launch of Disaggregated System Configurations
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Hyperlaunch Dynamic: Hardware Domain
+        This configuration mimics the existing Xen feature late hardware domain with
+        the one difference being that the hardware domain is constructed by the
+        hypervisor at startup instead of later by Dom0.
+
+Hyperlaunch Dynamic: Flexible Disaggregation
+        This configuration is similar to the “Hyperlaunch Classic: Dom0” configuration
+        except that it includes starting a separate hardware domain during Xen startup.
+        It is also similar to “Hyperlaunch Dynamic: Hardware Domain” configuration, but
+        it launches via a Boot Domain that runs first.
+
+Hyperlaunch Dynamic: Full Disaggregation
+        In this configuration it is demonstrated how it is possible to start a fully
+        disaggregated system: the virtualization toolstack runs in a Control Domain,
+        separate from the domains responsible for managing hardware, XenStore, the Xen
+        Console and Crash functions, each launched via a Boot Domain.
+
+
+Example Use Cases and Configurations
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The following example use cases can be matched to configurations listed in the
+previous section.
+
+Use case: Modern cloud hypervisor
+"""""""""""""""""""""""""""""""""
+
+**Option:** Hyperlaunch Classic: Cloud
+
+This configuration will support strong isolation for virtual TPM domains and
+measured launch in support of attestation to infrastructure management, while
+allowing the use of existing Dom0 virtualization toolstack software.
+
+Use case: Edge device with security or safety requirements
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+**Option:** Hyperlaunch Static: Boot
+
+This configuration runs without requiring a highly-privileged Dom0, and enables
+extended VM configuration to be applied to the Initial VMs prior to launching
+them, optionally in a sequenced start.
+
+Use case: Client hypervisor
+"""""""""""""""""""""""""""
+
+**Option:** Hyperlaunch Dynamic: Flexible Disaggregation
+
+**Option:** Hyperlaunch Dynamic: Full Disaggregation
+
+These configurations enable dynamic client workloads, strong isolation for the
+domain running the virtualization toolstack software and each domain managing
+hardware, with PCI passthrough performed during host boot and support for
+measured launch.
+
+Hyperlaunch Disaggregated Launch
+--------------------------------
+
+
+Existing in Xen today are two primary permissions, *control domain* and
+*hardware domain*, and two functions, *console domain* and *xenstore domain*,
+that can be assigned to a domain. Traditionally all of these permissions and
+functions are all assigned to Dom0 at start and can then be delegated to other
+domains created by the toolstack in Dom0. With Hyperlaunch it becomes possible
+to assign these permissions and functions to any domain for which there is a
+definition provided at startup.
+
+Additionally, two further functions are introduced: the *recovery domain*,
+intended to assist with recovery from failures encountered starting VMs during
+host boot, and the *boot domain*, for performing aspects of domain construction
+during startup.
+
+Supporting the booting of each of the above common boot configurations is
+accomplished by considering the set of initial domains and the assignment of
+Xen’s permissions and functions, including the ones introduced by Hyperlaunch,
+to these domains. A discussion of these will be covered later but for now they
+are laid out in a table with a mapping to the common boot configurations. This
+table is not intended to be an exhaustive list of configurations and does not
+account for flask policy specified functions that are use case specific.
+
+In the table each number represents a separate domain being
+constructed by the Hyperlaunch construction path as Xen starts, and the
+designator, ``{n}`` signifies that there may be “n” additional domains that may
+be constructed that do not have any special role for a general Xen system.
+
+::
+
+ +-------------------+------------------+-----------------------------------+
+ | Configuration     |    Permission    |            Function               |
+ |                   +------+------+----+------+--------+--------+----------+
+ |                   | None | Ctrl | HW | Boot |Recovery| Console| Xenstore |
+ +===================+======+======+====+======+========+========+==========+
+ | Classic: Dom0     |      |  0   | 0  |      |   0    |   0    |    0     |
+ +-------------------+------+------+----+------+--------+--------+----------+
+ | Classic: Extended |      |  1   | 1  |  0   |   1    |   1    |    1     |
+ | Launch Dom0       |      |      |    |      |        |        |          |
+ +-------------------+------+------+----+------+--------+--------+----------+
+ | Classic:          | {n}  |  0   | 0  |      |   0    |   0    |    0     |
+ | Basic Cloud       |      |      |    |      |        |        |          |
+ +-------------------+------+------+----+------+--------+--------+----------+
+ | Classic: Cloud    | {n}  |  1   | 1  |  0   |   1    |   1    |    1     |
+ +-------------------+------+------+----+------+--------+--------+----------+
+ | Static: Basic     | {n}  |      | 0  |      |   0    |   0    |    0     |
+ +-------------------+------+------+----+------+--------+--------+----------+
+ | Static: Standard  | {n}  |      | 1  |  0   |   1    |   1    |    1     |
+ +-------------------+------+------+----+------+--------+--------+----------+
+ | Static:           | {n}  |      | 2  |  0   |   3    |   4    |    1     |
+ | Disaggregated     |      |      |    |      |        |        |          |
+ +-------------------+------+------+----+------+--------+--------+----------+
+ | Dynamic:          |      |  0   | 1  |      |   0    |   0    |    0     |
+ | Hardware Domain   |      |      |    |      |        |        |          |
+ +-------------------+------+------+----+------+--------+--------+----------+
+ | Dynamic: Flexible | {n}  |  1   | 2  |  0   |   1    |   1    |    1     |
+ | Disaggregation    |      |      |    |      |        |        |          |
+ +-------------------+------+------+----+------+--------+--------+----------+
+ | Dynamic: Full     | {n}  |  2   | 3  |  0   |   4    |   5    |    1     |
+ | Disaggregation    |      |      |    |      |        |        |          |
+ +-------------------+------+------+----+------+--------+--------+----------+
+
+Overview of Hyperlaunch Flow
+----------------------------
+
+Before delving into Hyperlaunch, a good basis to start with is an understanding
+of the current process to create a domain. A way to view this process starts
+with the core configuration which is the information the hypervisor requires to
+make the call to `domain_create`, followed by basic construction to provide the
+memory image to run, including the kernel and ramdisk. A subsequent step
+applies the extended configuration used by the toolstack to provide a domain
+with any additional configuration information. Until the extended configuration
+is completed, a domain has access to no resources except its allocated vcpus
+and memory. The exception to this is Dom0, which the hypervisor explicitly
+grants control and access to all system resources, except for those that only
+the hypervisor should have control over.  This exception for Dom0 is driven by
+the system structure with a monolithic Dom0 domain predating introduction of
+support for disaggregation into Xen, and the corresponding default assignment
+of multiple roles within the Xen system to Dom0.
+
+While not a different domain creation path, there does exist the Hardware
+Domain (hwdom), sometimes also referred to as late-Dom0. It is an early effort
+to disaggregate Dom0’s roles into a separate control domain and hardware
+domain. This capability is activated by the passing of a domain id to the
+`hardware_dom` kernel command line parameter, and the Xen hypervisor will then
+flag that domain id as the hardware domain. Later when the toolstack constructs
+a domain with that domain id as the requested domid, the hypervisor will
+transfer all device I/O from Dom0 to this domain. In addition it will also
+transfer the “host shutdown on domain shutdown” flag from Dom0 to the hardware
+domain. It is worth mentioning that this approach for disaggregation was
+created in this manner due to the inability of Xen to launch more than one
+domain at startup.
+
+Hyperlaunch Xen startup
+^^^^^^^^^^^^^^^^^^^^^^^
+
+The Hyperlaunch approach’s primary focus is on how to assign the roles
+traditionally granted to Dom0 to one or more domains at host boot. While the
+statement is simple to make, the implications are not trivial by any means.
+This also explains why the Hyperlaunch approach is orthogonal to the existing
+dom0less capability. The dom0less capability focuses on enabling the launch of
+multiple domains in parallel with Dom0 at host boot. A corollary for dom0less
+is that for systems that don’t require Dom0 after all guest domains have
+started, they are able to do the host boot without a Dom0. Though it should be
+noted that it may be possible to start  Dom0 at a later point. Whereas with
+Hyperlaunch, its approach of separating Dom0’s roles requires the ability to
+launch multiple domains at host boot. The direct consequences from this
+approach are profound and provide a myriad of possible configurations for which
+a sample of common boot configurations were already presented.
+
+To enable the Hyperlaunch approach a new alternative path for host boot within
+the hypervisor must be introduced. This alternative path effectively branches
+just before the current point of Dom0 construction and begins an alternate
+means of system construction. The determination if this alternate path should
+be taken is through the inspection of the boot chain. If the bootloader has
+loaded a specific configuration, as described later, it will enable Xen to
+detect that a Hyperlaunch configuration has been provided. Once a Hyperlaunch
+configuration is detected, this alternate path can be thought of as occurring
+in phases: domain creation, domain preparation, and launch finalization.
+
+Domain Creation
+"""""""""""""""
+
+The domain creation phase begins with Xen parsing the bootloader provided
+material, to understand the content of the modules provided. It will then load
+any microcode or XSM policy it discovers. For each domain configuration Xen
+finds, it parses the configuration to construct the necessary domain definition
+to instantiate an instance of the domain and leave it in a paused state. When
+all domain configurations have been instantiated as domains, if one of them is
+flagged as the Boot Domain, that domain will be unpaused starting the domain
+preparation phase. If there is no Boot Domain defined, then the domain
+preparation phase will be skipped and Xen will trigger the launch finalization
+phase.
+
+Domain Preparation Phase
+""""""""""""""""""""""""
+
+The domain preparation phase is an optional check point for the execution of a
+workload specific domain, the Boot Domain. While the Boot Domain is the first
+domain to run and has some degree of control over the system, it is extremely
+restricted in both system resource access and hypervisor operations. Its
+purpose is to:
+
+* Access the configuration provided by the bootloader
+* Finalize the configuration of the domains
+* Conduct any setup and launch related operations
+* Do an ordered unpause of domains that require an ordered start
+
+When the Boot Domain has completed, it will notify the hypervisor that it is
+done triggering the launch finalization phase.
+
+
+Launch Finalization
+"""""""""""""""""""
+
+The hypervisor handles the launch finalization phase which is equivalent to the
+clean up phase. As such the steps taken by the hypervisor, not necessarily in
+implementation order, are as follows,
+
+* Free the boot module chain
+* If a Boot Domain was used, reclaim Boot Domain resources
+* Unpause any domains still in a paused state
+* Boot Domain uses a reserved function thus can never be respawned
+
+While the focus thus far has been on how the Hyperlaunch capability will work,
+it is worth mentioning what it does not do or limit from occurring. It does not
+stop or inhibit the assigning of the control domain role which gives the domain
+the ability to create, start, stop, restart, and destroy domains or the
+hardware domain role which gives access to all I/O devices except those that
+the hypervisor has reserved for itself. In particular it is still possible to
+construct a domain with all the privileged roles, i.e. a Dom0, with or without
+the domain id being zero. In fact what limitations are imposed now become fully
+configurable without the risk of circumvention by an all privileged domain.
+
+Structuring of Hyperlaunch
+--------------------------
+
+The structure of Hyperlaunch is built around the existing capabilities of the
+host boot protocol. This approach was driven by the objective not to require
+modifications to the boot loader. The only requirement is that the boot loader
+supports the Multiboot2 (MB2) protocol. For UEFI boot, our recommendation is to
+use GRUB.efi to load Xen and the initial domain materials via the multiboot2
+method. On Arm platforms, Hyperlaunch is compatible with the existing interface
+for boot into the hypervisor.
+
+
+x86 Multiboot2
+^^^^^^^^^^^^^^
+
+The MB2 protocol has no concept of a manifest to tell the initial kernel what
+is contained in the chain, leaving it to the kernel to impose a loading
+convention, use magic number identification, or both. When considering the
+passing of multiple kernels, ramdisks, and domain configuration along with any
+existing modules already passed, there is no sane convention that could be
+imposed and magic number identification is nearly impossible when considering
+the objective not to impose unnecessary complication to the hypervisor.
+
+As it was alluded to previously, a manifest describing the contents in the MB2
+chain and how they relate within a Xen context is needed. To address this need
+the Launch Control Module (LCM) was designed to provide such a manifest. The
+LCM was designed to have a specific set of properties,
+
+* minimize the complexity of the parsing logic required by the hypervisor
+* allow for expanding and optional configuration fragments without breaking
+  backwards compatibility
+
+To enable automatic detection of a Hyperlaunch configuration, the LCM must be
+the first MB2 module in the MB2 module chain. The LCM is implemented using the
+Device Tree as defined in the Hyperlaunch Device Tree design document. With the
+LCM implemented in Device Tree, it has a magic number that enables the
+hypervisor to detect its presence when used in a Multiboot2 module chain. The
+hypervisor can confirm that it is a proper LCM Device Tree by checking for a
+compliant Hyperlaunch Device Tree. The Hyperlaunch Device Tree nodes are
+designed to allow,
+
+* for the hypervisor to parse only those entries it understands,
+* for packing custom information for a custom boot domain,
+* the ability to use a new LCM with an older hypervisor,
+* and the ability to use an older LCM with a new hypervisor.
+
+Arm Device Tree
+^^^^^^^^^^^^^^^
+
+As discussed the LCM is in Device Tree format and was designed to co-exist in
+the Device Tree ecosystem, and in particular in parallel with dom0less Device
+Tree entries. On Arm, Xen is already designed to boot from a host Device Tree
+description (dtb) file and the LCM entries can be embedded into this host dtb
+file. This makes detecting the LCM entries and supporting Hyperlaunch on Arm
+relatively straight forward. Relative to the described x86 approach, at the
+point where Xen inspects the first MB2 module, on Arm Xen will check if the top
+level LCM node exists in the host dtb file. If the LCM node does exist, then at
+that point it will enter into the same code path as the x86 entry would go.
+
+Xen hypervisor
+^^^^^^^^^^^^^^
+
+It was previously discussed at a higher level of the new host boot flow that
+will be introduced. Within this new flow is the configuration parsing and
+domain creation phase which will be expanded upon here. The hypervisor will
+inspect the LCM for a config node and if found will iterate through all modules
+nodes. The module nodes are used to identify if any modules contain microcode
+or an XSM policy. As it processes domain nodes, it will construct the domain
+using the node properties and the modules nodes. Once it has completed
+iterating through all the entries in the LCM, if a constructed domain has the
+Boot Domain attribute, it will then be unpaused. Otherwise the hypervisor will
+start the launch finalization phase.
+
+Boot Domain
+^^^^^^^^^^^
+
+Traditionally domain creation was controlled by the user within the Dom0
+environment whereby custom toolstacks could be implemented to impose
+requirements on the process. The Boot Domain is a means to enable the user to
+continue to maintain a degree of that control over domain creation but within a
+limited privilege environment. The Boot Domain will have access to the LCM and
+the boot chain along with access to a subset of the hypercall operations. When
+the Boot Domain is finished it will notify the hypervisor through a hypercall
+op.
+
+Recovery Domain
+^^^^^^^^^^^^^^^
+
+With the existing Dom0 host boot path, when a failure occurs there are several
+assumptions that can safely be made to get the user to a console for
+troubleshooting. With the Hyperlaunch host boot path those assumptions can no
+longer be made, thus a means is needed to get the user to a console in the case
+of a recoverable failure. The recovery domain is configured by a domain
+configuration entry in the LCM, in the same manner as the other initial
+domains, and it will not be unpaused at launch finalization unless a failure is
+encountered starting the initial domains.
+
+Xen has existing support for a Crash Environment where memory can be reserved
+at host boot and a kernel loaded into it, to be jumped into at any point while
+the system is running when a crash is detected. The Recovery Domain
+functionality is a separate, complementary capability. The Crash Environment
+replaces the previously active hypervisor and running guests, and enables a
+process for mounting disks to write out log information prior to rebooting the
+system. In contrast, the Recovery Domain is able to use the functionality of
+the Xen hypervisor, that is still present and running, to perform recovery
+handling for errors encountered with starting the initial domains.
+
+Deferred Design
+"""""""""""""""
+
+To be determined:
+
+* Define what is detected as a crash
+* Explain how crash detection is performed and which components are involved
+* Explain how the recovery domain is unpaused
+* Explain how and when the resources assigned to the recovery domain are reclaimed
+* Define what the recovery domain is able to do
+* Determine what permissions the recovery domain requires to perform its job
+
+
+Control Domain
+^^^^^^^^^^^^^^
+
+The concept of the Control Domain already exists within Xen as a boolean,
+`is_privileged`, that governs access to many of the privileged interfaces of
+the hypervisor that support a domain running a virtualization system toolstack.
+Hyperlaunch will allow the `is_privileged` flag to be set on any domain that is
+created at launch, rather than only a Dom0. It may potentially be set on
+multiple domains.
+
+Hardware Domain
+^^^^^^^^^^^^^^^
+
+The Hardware Domain is also an existing concept for Xen that is enabled through
+the `is_hardware_domain` check. With Hyperlaunch the previous process of I/O
+accesses being assigned to Dom0 for later transfer to the hardware domain would
+no longer be required. Instead during the configuration phase the Xen
+hypervisor would directly assign the I/O accesses to the domain with the
+hardware domain permission bit enabled.
+
+Console Domain
+^^^^^^^^^^^^^^
+
+Traditionally the Xen console is assigned to the control domain and then
+reassignable by the toolstack to another domain. With Hyperlaunch it becomes
+possible to construct a boot configuration where there is no control domain or
+have a use case where the Xen console needs to be isolated. As such it becomes
+necessary to be able to designate which of the initial domains should be
+assigned the Xen console. Therefore Hyperlaunch introduces the ability to
+specify an initial domain which the console is assigned along with a convention
+of ordered assignment for when there is no explicit assignment.
+
+Communication of Domain Configurations
+======================================
+
+There are several standard methods for an Operating System to access machine
+configuration and environment information: ACPI is common on x86 systems,
+whereas Device Tree is more typical on Arm platforms. There are currently
+implementations of both in Xen.
+
+* For dom0less, guest Device Trees are dynamically constructed by the
+  hypervisor to convey domain configuration data
+
+* For PVH dom0 on x86, ACPI tables are built by the hypervisor before the
+  domain is started
+
+Note that both of these mechanisms convey static data that is fixed prior to
+the point of domain construction. Hyperlaunch will retain both the existing
+ACPI and Device Tree methods.
+
+Communication of data between a Boot Domain and a Control Domain is of note
+since they may not be running concurrently: the method used will depend on
+their specific implementations, but one option available is to use Xen’s hypfs
+for transfer of basic data to support system bootstrap.
+
+-------------------------------------------------------------------------------
+
+Appendix
+========
+
+Appendix 1: Flow Sequence of Steps of a Hyperlaunch Boot
+--------------------------------------------------------
+
+Provided here is an ordered flow of a Hyperlaunch with a highlight logic
+decision points. Not all branch points are recorded, specifically for the
+variety of error conditions that may occur. ::
+
+  1. Hypervisor Startup:
+  2a. (x86) Inspect first module provided by the bootloader
+      a. Is the module an LCM
+          i. YES: proceed with the Hyperlaunch host boot path
+          ii. NO: proceed with a Dom0 host boot path
+  2b. (Arm) Inspect host dtb for `/chosen/hypervisor` node
+      a. Is the LCM present
+          i. YES: proceed with the Hyperlaunch host boot path
+          ii. NO: proceed with a Dom0/dom0less host boot path
+  3. Iterate through the LCM entries looking for the module description
+     entry
+      a. Check if any of the modules are microcode or policy and if so,
+         load
+  4. Iterate through the LCM entries processing all domain description
+     entries
+      a. Use the details from the Basic Configuration to call
+         `domain_create`
+      b. Record if a domain is flagged as the Boot Domain
+      c. Record if a domain is flagged as the Recovery Domain
+  5. Was a Boot Domain created
+      a. YES:
+          i. Attach console to Boot Domain
+          ii. Unpause Boot Domain
+          iii. Goto Boot Domain (step 6)
+      b. NO: Goto Launch Finalization (step 10)
+  6. Boot Domain:
+  7. Boot Domain comes online and may do any of the following actions
+      a. Process the LCM
+      b. Validate the MB2 chain
+      c. Make additional configuration settings for staged domains
+      d. Unpause any precursor domains
+      e. Set any runtime configurations
+  8. Boot Domain does any necessary cleanup
+  9. Boot Domain make hypercall op call to signal it is finished
+      i. Hypervisor reclaims all Boot Domain resources
+      ii. Hypervisor records that the Boot Domain ran
+      ii. Goto Launch Finalization (step 9)
+  10. Launch Finalization
+  11. If a configured domain was flagged to have the console, the
+      hypervisor assigns it
+  12. The hypervisor clears the LCM and bootloader loaded module,
+      reclaiming the memory
+  13. The hypervisor iterates through domains unpausing any domain not
+      flagged as the recovery domain
+
+
+Appendix 2: Considerations in Naming the Hyperlaunch Feature
+------------------------------------------------------------
+
+* The term “Launch” is preferred over “Boot”
+
+        * Multiple individual component boots can occur in the new system start
+          process; Launch is preferable for describing the whole process
+        * Fortunately there is consensus in the current group of stakeholders
+          that the term “Launch” is good and appropriate
+
+* The names we define must support becoming meaningful and simple to use
+  outside the Xen community
+
+        * They must be able to be resolved quickly via search engine to a clear
+          explanation (eg. Xen marketing material, documentation or wiki)
+        * We prefer that the terms be helpful for marketing communications
+        * Consequence: avoid the term “domain” which is Xen-specific and
+          requires a definition to be provided each time when used elsewhere
+
+
+* There is a need to communicate that Xen is  capable of being used as a Static
+  Partitioning hypervisor
+
+        * The community members using and maintaining dom0less are the current
+          primary stakeholders for this
+
+* There is a need to communicate that the new launch functionality provides new
+  capabilities not available elsewhere, and is more than just supporting Static
+  Partitioning
+
+        * No other hypervisor known to the authors of this document is capable
+          of providing what Hyperlaunch will be able to do. The launch sequence is
+          designed to:
+
+                * Remove dependency on a single, highly-privileged initial domain
+                * Allow the initial domains started to be independent and fully
+                  isolated from each other
+                * Support configurations where no further VMs can be launched
+                  once the initial domains have started
+                * Use a standard, extensible format for conveying VM
+                  configuration data
+                * Ensure that domain building of all initial domains is
+                  performed by the hypervisor from materials supplied by the
+                  bootloader
+                * Enable flexible configuration to be applied to all initial
+                  domains by an optional Boot Domain, that runs with limited
+                  privilege, before any other domain starts and obtains the VM
+                  configuration data from the bootloader materials via the
+                  hypervisor
+                * Enable measurements of all of the boot materials prior to
+                  their use, in a sequence with minimized privilege
+                * Support use-case-specific customized Boot Domains
+                * Complement the hypervisor’s existing ability to enforce
+                  policy-based Mandatory Access Control
+
+
+* “Static” and “Dynamic” have different and important meanings in different
+  communities
+
+        * Static and Dynamic Partitioning describe the ability to create new
+          virtual machines, or not, after the initial host boot process
+          completes
+        * Static and Dynamic Root of Trust describe the nature of the trust
+          chain for a measured launch. In this case Static is referring to the
+          fact that the trust chain is fixed and non-repeatable until the next
+          host reboot or shutdown. Whereas Dynamic in this case refers to the
+          ability to conduct the measured launch at any time and potentially
+          multiple times before the next host reboot or shutdown.
+
+                * We will be using Hyperlaunch with both Static and Dynamic
+                  Roots of Trust, to launch both Static and Dynamically
+                  Partitioned Systems, and being clear about exactly which
+                  combination is being started will be very important (eg. for
+                  certification processes)
+
+        * Consequence: uses of “Static” and “Dynamic” need to be qualified if
+          they are incorporated into the naming of this functionality
+
+                * This can be done by adding the preceding, stronger branded
+                  term: “Hyperlaunch”, before “Static” or “Dynamic”
+                * ie. “Hyperlaunch Static” describes launch of a
+                  Statically Partitioned system
+                * and “Hyperlaunch Dynamic” describes launch of a
+                  Dynamically Partitioned system.
+                * In practice, this means that “Hyperlaunch Static” describes
+                  starting a Static Partitioned system where no new domains can
+                  be started later (ie. no VM has the Control Domain
+                  permission), whereas “Hyperlaunch Dynamic” will launch some
+                  VM with the Control Domain permission, able to create VMs
+                  dynamically at a later point.
+
+**Naming Proposal:**
+
+* New Term: “Hyperlaunch” : the ability of a hypervisor to construct and start
+  one or more virtual machines at system launch, in the following manner:
+
+        * The hypervisor must build all of the domains that it starts at host
+          boot
+
+                * Similar to the way the dom0 domain is built by the hypervisor
+                  today, and how dom0less works: it will run a loop to build
+                  them all, driven from the configuration provided
+                * This is a requirement for ensuring that there is Strong
+                  Isolation between each of the initial VMs
+
+        * A single file contains the VM configs (“Launch Control Module”: LCM,
+          in Device Tree binary format) is provided to the hypervisor
+
+                * The hypervisor parses it and builds domains
+                * If the LCM config says that a Boot Domain should run first,
+                  then the LCM file itself is made available to the Boot Domain
+                  for it to parse and act on, to invoke operations via the
+                  hypervisor to apply additional configuration to the other VMs
+                  (ie. executing a privilege-constrained toolstack)
+
+* New Term: “Hyperlaunch Static”: starts a Static Partitioned system, where
+  only the virtual machines started at system launch are running on the system
+
+* New Term: “Hyperlaunch Dynamic”: starts a system where virtual machines may
+  be dynamically added after the initial virtual machines have started.
+
+
+In the default configuration, Xen will be capable of both styles of Hyperlaunch
+from the same hypervisor binary, when paired with its XSM flask, provides
+strong controls that enable fine grained system partitioning.
+
+
+* Retiring Term: “DomB”: will no longer be used to describe the optional first
+  domain that is started. It is replaced with the more general term: “Boot
+  Domain”.
+
+* Retiring Term: “Dom0less”: it is to be replaced with “Hyperlaunch Static”
+
+
+Appendix 3: Terminology
+-----------------------
+
+To help ensure clarity in reading this document, the following is the
+definition of terminology used within this document.
+
+
+Basic Configuration
+    the minimal information the hypervisor requires to instantiate a domain instance
+
+
+Boot Domain
+    a domain with limited privileges launched by the hypervisor during a
+    Multiple Domain Boot that runs as the first domain started. In the Hyperlaunch
+    architecture, it is responsible for assisting with higher level operations of
+    the domain setup process.
+
+
+Classic Launch
+    a backwards-compatible host boot that ends with the launch of a single domain (Dom0)
+
+
+Console Domain
+    a domain that has the Xen console assigned to it
+
+
+Control Domain
+    a privileged domain that has been granted Control Domain permissions which
+    are those that are required by the Xen toolstack for managing other domains.
+    These permissions are a subset of those that are granted to Dom0.
+
+
+Device Tree
+    a standardized data structure, with defined file formats, for describing
+    initial system configuration
+
+
+Disaggregation
+    the separation of system roles and responsibilities across multiple
+    connected components that work together to provide functionality
+
+
+Dom0
+    the highly-privileged, first and only domain started at host boot on a
+    conventional Xen system
+
+
+Dom0less
+    an existing feature of Xen on Arm that provides Multiple Domain Boot
+
+
+Domain
+    a running instance of a virtual machine; (as the term is commonly used in
+    the Xen Community)
+
+DomB
+     the former name for Hyperlaunch
+
+
+Extended Configuration
+    any configuration options for a domain beyond its Basic Configuration
+
+
+Hardware Domain
+    a privileged domain that has been granted permissions to access and manage
+    host hardware. These permissions are a subset of those that are granted to
+    Dom0.
+
+
+Host Boot
+    the system startup of Xen using the configuration provided by the bootloader
+
+
+Hyperlaunch
+    a flexible host boot that ends with the launch of one or more domains
+
+
+Initial Domain
+    a domain that is described in the LCM that is run as part of a multiple
+    domain boot. This includes the Boot Domain, Recovery Domain and all Launched
+    Domains.
+
+
+Late Hardware Domain
+    a Hardware Domain that is launched after host boot has already completed
+    with a running Dom0. When the Late Hardware Domain is started, Dom0
+    relinquishes and transfers the permissions to access and manage host hardware
+    to it..
+
+
+Launch Control Module (LCM)
+    A file supplied to the hypervisor by the bootloader that contains
+    configuration data for the hypervisor and the initial set of virtual machines
+    to be run at boot
+
+
+Launched Domain
+    a domain, aside from the boot domain and recovery domain, that is started as
+    part of a multiple domain boot and remains running once the boot process is
+    complete
+
+
+Multiple Domain Boot
+    a system configuration where the hypervisor and multiple virtual machines
+    are all launched when the host system hardware boots
+
+
+Recovery Domain
+    an optional fallback domain that the hypervisor may start in the event of a
+    detectable error encountered during the multiple domain boot process
+
+
+System Device Tree
+    this is the product of an Arm community project to extend Device Tree to
+    cover more aspects of initial system configuration
+
+
+Appendix 4: Copyright License
+-----------------------------
+
+This work is licensed under a Creative Commons Attribution 4.0 International
+License. A copy of this license may be obtained from the Creative Commons
+website (https://creativecommons.org/licenses/by/4.0/legalcode).
+
+| Contributions by:
+| Christopher Clark are Copyright © 2021 Star Lab Corporation
+| Daniel P. Smith are Copyright  © 2021 Apertus Solutions, LLC
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:44:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158862.292249 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5run-0003iz-Uq; Tue, 20 Jul 2021 15:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158862.292249; Tue, 20 Jul 2021 15:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5run-0003ir-Rr; Tue, 20 Jul 2021 15:44:13 +0000
Received: by outflank-mailman (input) for mailman id 158862;
 Tue, 20 Jul 2021 15:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rum-0003ie-Cw
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rum-0004JB-C7
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rum-0001B3-B6
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15: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>
DKIM-Signature: v=1; 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+sCjv9+wq5a/1E/aNAlzh42fVZXK8cq1/HJGGGY+Ho=; b=PvW5WBSB55GZOAQ0WFH8FyFEPb
	H34s8rzlcKa4NjK/ke/UwFULNkq/yjesg/2+UYfdxELxEu1yj0jC6D/qwm8HR9NUOGX6ZuVkPl2YN
	eRVjP5A8lIIcn9gScZQaAe1w0xLWg5M998xr/NFKtRP3WKslf4umi3f1hrjhqsALQEqY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/designs/launch: Hyperlaunch device tree
Message-Id: <E1m5rum-0001B3-B6@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:44:12 +0000

commit 0cbed4f0fd94a7fd40662fb0b4b82a58abeca111
Author:     Daniel P. Smith <dpsmith@apertussolutions.com>
AuthorDate: Fri Jul 9 08:26:42 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 9 08:26:42 2021 +0200

    docs/designs/launch: Hyperlaunch device tree
    
    Adds a design document for Hyperlaunch device tree structure.
    
    Signed-off-by: Christopher Clark <christopher.clark@starlab.io>
    Signed-off by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 docs/designs/launch/hyperlaunch-devicetree.rst | 343 +++++++++++++++++++++++++
 1 file changed, 343 insertions(+)

diff --git a/docs/designs/launch/hyperlaunch-devicetree.rst b/docs/designs/launch/hyperlaunch-devicetree.rst
new file mode 100644
index 0000000000..b49c98cfbd
--- /dev/null
+++ b/docs/designs/launch/hyperlaunch-devicetree.rst
@@ -0,0 +1,343 @@
+-------------------------------------
+Xen Hyperlaunch Device Tree Bindings
+-------------------------------------
+
+The Xen Hyperlaunch device tree adopts the dom0less device tree structure and
+extends it to meet the requirements for the Hyperlaunch capability. The primary
+difference is the introduction of the ``hypervisor`` node that is under the
+``/chosen`` node. The move to a dedicated node was driven by:
+
+1. Reduces the need to walk over nodes that are not of interest, e.g. only
+   nodes of interest should be in ``/chosen/hypervisor``
+
+2. Allows for the domain construction information to easily be sanitized by
+   simple removing the ``/chosen/hypervisor`` node.
+
+Example Configuration
+---------------------
+
+Below are two example device tree definitions for the hypervisor node. The
+first is an example of a multiboot-based configuration for x86 and the second
+is a module-based configuration for Arm.
+
+Multiboot x86 Configuration:
+""""""""""""""""""""""""""""
+
+::
+
+    hypervisor {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        compatible = “hypervisor,xen”
+
+        // Configuration container
+        config {
+            compatible = "xen,config";
+
+            module {
+                compatible = "module,microcode", "multiboot,module";
+                mb-index = <1>;
+            };
+
+            module {
+                compatible = "module,xsm-policy", "multiboot,module";
+                mb-index = <2>;
+            };
+        };
+
+        // Boot Domain definition
+        domain {
+            compatible = "xen,domain";
+
+            domid = <0x7FF5>;
+
+            // FUNCTION_NONE            (0)
+            // FUNCTION_BOOT            (1 << 0)
+            // FUNCTION_CRASH           (1 << 1)
+            // FUNCTION_CONSOLE         (1 << 2)
+            // FUNCTION_XENSTORE        (1 << 30)
+            // FUNCTION_LEGACY_DOM0     (1 << 31)
+            functions = <0x00000001>;
+
+            memory = <0x0 0x20000>;
+            cpus = <1>;
+            module {
+                compatible = "module,kernel", "multiboot,module";
+                mb-index = <3>;
+            };
+
+            module {
+                compatible = "module,ramdisk", "multiboot,module";
+                mb-index = <4>;
+            };
+            module {
+                compatible = "module,config", "multiboot,module";
+                mb-index = <5>;
+            };
+
+        // Classic Dom0 definition
+        domain {
+            compatible = "xen,domain";
+
+            domid = <0>;
+
+            // PERMISSION_NONE          (0)
+            // PERMISSION_CONTROL       (1 << 0)
+            // PERMISSION_HARDWARE      (1 << 1)
+            permissions = <3>;
+
+            // FUNCTION_NONE            (0)
+            // FUNCTION_BOOT            (1 << 0)
+            // FUNCTION_CRASH           (1 << 1)
+            // FUNCTION_CONSOLE         (1 << 2)
+            // FUNCTION_XENSTORE        (1 << 30)
+            // FUNCTION_LEGACY_DOM0     (1 << 31)
+            functions = <0xC0000006>;
+
+            // MODE_PARAVIRTUALIZED     (1 << 0) /* PV | PVH/HVM */
+            // MODE_ENABLE_DEVICE_MODEL (1 << 1) /* HVM | PVH */
+            // MODE_LONG                (1 << 2) /* 64 BIT | 32 BIT */
+            mode = <5>; /* 64 BIT, PV */
+
+            // UUID
+            domain-uuid = [B3 FB 98 FB 8F 9F 67 A3];
+
+            cpus = <1>;
+            memory = <0x0 0x20000>;
+            security-id = “dom0_t;
+
+            module {
+                compatible = "module,kernel", "multiboot,module";
+                mb-index = <6>;
+                bootargs = "console=hvc0";
+            };
+            module {
+                compatible = "module,ramdisk", "multiboot,module";
+                mb-index = <7>;
+            };
+    };
+
+The multiboot modules supplied when using the above config would be, in order:
+
+* (the above config, compiled)
+* CPU microcode
+* XSM policy
+* kernel for boot domain
+* ramdisk for boot domain
+* boot domain configuration file
+* kernel for the classic dom0 domain
+* ramdisk for the classic dom0 domain
+
+Module Arm Configuration:
+"""""""""""""""""""""""""
+
+::
+
+    hypervisor {
+        compatible = “hypervisor,xen”
+
+        // Configuration container
+        config {
+            compatible = "xen,config";
+
+            module {
+                compatible = "module,microcode”;
+                module-addr = <0x0000ff00 0x80>;
+            };
+
+            module {
+                compatible = "module,xsm-policy";
+                module-addr = <0x0000ff00 0x80>;
+
+            };
+        };
+
+        // Boot Domain definition
+        domain {
+            compatible = "xen,domain";
+
+            domid = <0x7FF5>;
+
+            // FUNCTION_NONE            (0)
+            // FUNCTION_BOOT            (1 << 0)
+            // FUNCTION_CRASH           (1 << 1)
+            // FUNCTION_CONSOLE         (1 << 2)
+            // FUNCTION_XENSTORE        (1 << 30)
+            // FUNCTION_LEGACY_DOM0     (1 << 31)
+            functions = <0x00000001>;
+
+            memory = <0x0 0x20000>;
+            cpus = <1>;
+            module {
+                compatible = "module,kernel";
+                module-addr = <0x0000ff00 0x80>;
+            };
+
+            module {
+                compatible = "module,ramdisk";
+                module-addr = <0x0000ff00 0x80>;
+            };
+            module {
+                compatible = "module,config";
+                module-addr = <0x0000ff00 0x80>;
+            };
+
+        // Classic Dom0 definition
+        domain@0 {
+            compatible = "xen,domain";
+
+            domid = <0>;
+
+            // PERMISSION_NONE          (0)
+            // PERMISSION_CONTROL       (1 << 0)
+            // PERMISSION_HARDWARE      (1 << 1)
+            permissions = <3>;
+
+            // FUNCTION_NONE            (0)
+            // FUNCTION_BOOT            (1 << 0)
+            // FUNCTION_CRASH           (1 << 1)
+            // FUNCTION_CONSOLE         (1 << 2)
+            // FUNCTION_XENSTORE        (1 << 30)
+            // FUNCTION_LEGACY_DOM0     (1 << 31)
+            functions = <0xC0000006>;
+
+            // MODE_PARAVIRTUALIZED     (1 << 0) /* PV | PVH/HVM */
+            // MODE_ENABLE_DEVICE_MODEL (1 << 1) /* HVM | PVH */
+            // MODE_LONG                (1 << 2) /* 64 BIT | 32 BIT */
+            mode = <5>; /* 64 BIT, PV */
+
+            // UUID
+            domain-uuid = [B3 FB 98 FB 8F 9F 67 A3];
+
+            cpus = <1>;
+            memory = <0x0 0x20000>;
+            security-id = “dom0_t”;
+
+            module {
+                compatible = "module,kernel";
+                module-addr = <0x0000ff00 0x80>;
+                bootargs = "console=hvc0";
+            };
+            module {
+                compatible = "module,ramdisk";
+                module-addr = <0x0000ff00 0x80>;
+            };
+    };
+
+The modules that would be supplied when using the above config would be:
+
+* (the above config, compiled into hardware tree)
+* CPU microcode
+* XSM policy
+* kernel for boot domain
+* ramdisk for boot domain
+* boot domain configuration file
+* kernel for the classic dom0 domain
+* ramdisk for the classic dom0 domain
+
+The hypervisor device tree would be compiled into the hardware device tree and
+provided to Xen using the standard method currently in use. The remaining
+modules would need to be loaded in the respective addresses specified in the
+`module-addr` property.
+
+
+The Hypervisor node
+-------------------
+
+The hypervisor node is a top level container for the domains that will be built
+by hypervisor on start up. On the ``hypervisor`` node the ``compatible``
+property is used to identify the type of hypervisor node present..
+
+compatible
+  Identifies the type of node. Required.
+
+The Config node
+---------------
+
+A config node is for detailing any modules that are of interest to Xen itself.
+For example this would be where Xen would be informed of microcode or XSM
+policy locations. If the modules are multiboot modules and are able to be
+located by index within the module chain, the ``mb-index`` property should be
+used to specify the index in the multiboot module chain.. If the module will be
+located by physical memory address, then the ``module-addr`` property should be
+used to identify the location and size of the module.
+
+compatible
+  Identifies the type of node. Required.
+
+The Domain node
+---------------
+
+A domain node is for describing the construction of a domain. It may provide a
+domid property which will be used as the requested domain id for the domain
+with a value of “0” signifying to use the next available domain id, which is
+the default behavior if omitted. A domain configuration is not able to request
+a domid of “0”. After that a domain node may have any of the following
+parameters,
+
+compatible
+  Identifies the type of node. Required.
+
+domid
+  Identifies the domid requested to assign to the domain. Required.
+
+permissions
+  This sets what Discretionary Access Control permissions
+  a domain is assigned. Optional, default is none.
+
+functions
+  This identifies what system functions a domain will fulfill.
+  Optional, the default is none.
+
+.. note::  The `functions` bits that have been selected to indicate
+   ``FUNCTION_XENSTORE`` and ``FUNCTION_LEGACY_DOM0`` are the last two bits
+   (30, 31) such that should these features ever be fully retired, the flags may
+   be dropped without leaving a gap in the flag set.
+
+mode
+  The mode the domain will be executed under. Required.
+
+domain-uuid
+  A globally unique identifier for the domain. Optional,
+  the default is NULL.
+
+cpus
+  The number of vCPUs to be assigned to the domain. Optional,
+  the default is “1”.
+
+memory
+  The amount of memory to assign to the domain, in KBs.
+  Required.
+
+security-id
+  The security identity to be assigned to the domain when XSM
+  is the access control mechanism being used. Optional,
+  the default is “domu_t”.
+
+The Module node
+---------------
+
+This node describes a boot module loaded by the boot loader. The required
+compatible property follows the format: module,<type> where type can be
+“kernel”, “ramdisk”, “device-tree”, “microcode”, “xsm-policy” or “config”. In
+the case the module is a multiboot module, the additional property string
+“multiboot,module” may be present. One of two properties is required and
+identifies how to locate the module. They are the mb-index, used for multiboot
+modules, and the module-addr for memory address based location.
+
+compatible
+  This identifies what the module is and thus what the hypervisor
+  should use the module for during domain construction. Required.
+
+mb-index
+  This identifies the index for this module in the multiboot module chain.
+  Required for multiboot environments.
+
+module-addr
+  This identifies where in memory this module is located. Required for
+  non-multiboot environments.
+
+bootargs
+  This is used to provide the boot params to kernel modules.
+
+.. note::  The bootargs property is intended for situations where the same kernel multiboot module is used for more than one domain.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:44:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158864.292253 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5ruy-0003mD-0J; Tue, 20 Jul 2021 15:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158864.292253; Tue, 20 Jul 2021 15:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rux-0003m6-TU; Tue, 20 Jul 2021 15:44:23 +0000
Received: by outflank-mailman (input) for mailman id 158864;
 Tue, 20 Jul 2021 15:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ruw-0003lo-GD
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ruw-0004JQ-FQ
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ruw-0001Bl-Ea
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:44: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LwELpMwfi31zD+HaJ0gwSKjTuvFBZlXeI/T43mSb6Uw=; b=LHrtWKNX8zPu86fZWZ+UwjuS3G
	K15X7UEWqPs8sOQp4FIMRck+si0e1tHW0Hzlc60/HX/H6wKwV0ASyr2gECkUG8eQmEtFym8minzv3
	BVZOX51teKoT/OQHjkdzJgKsX5kLk3oBznO2WxyXe9kv5xH3EZNo9AaMl6ujQs04UyH8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/AMD: expose SYSCFG, TOM, TOM2, and IORRs to Dom0
Message-Id: <E1m5ruw-0001Bl-Ea@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:44:22 +0000

commit bfcdaae9c210bd7984d7691285aaf43deb1b0604
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jul 9 08:28:14 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 9 08:28:14 2021 +0200

    x86/AMD: expose SYSCFG, TOM, TOM2, and IORRs to Dom0
    
    Sufficiently old Linux (3.12-ish) accesses these MSRs (with the
    exception of IORRs) in an unguarded manner. Furthermore these same MSRs,
    at least on Fam11 and older CPUs, are also consulted by modern Linux,
    and their (bogus) built-in zapping of #GP faults from MSR accesses leads
    to it effectively reading zero instead of the intended values, which are
    relevant for PCI BAR placement (which ought to all live in MMIO-type
    space, not in DRAM-type one).
    
    For SYSCFG, only certain bits get exposed. Since MtrrVarDramEn also
    covers the IORRs, expose them as well. Introduce (consistently named)
    constants for the bits we're interested in and use them in pre-existing
    code as well. While there also drop the unused and somewhat questionable
    K8_MTRR_RDMEM_WRMEM_MASK. To complete the set of memory type and DRAM vs
    MMIO controlling MSRs, also expose TSEG_{BASE,MASK} (the former also
    gets read by Linux, dealing with which was already the subject of
    6eef0a99262c ["x86/PV: conditionally avoid raising #GP for early guest
    MSR reads"]).
    
    As a welcome side effect, verbosity on/of debug builds gets (perhaps
    significantly) reduced.
    
    Note that at least as far as those MSR accesses by Linux are concerned,
    there's no similar issue for DomU-s, as the accesses sit behind PCI
    device matching logic. The checked for devices would never be exposed to
    DomU-s in the first place. Nevertheless I think that at least for HVM we
    should return sensible values, not 0 (as svm_msr_read_intercept() does
    right now). The intended values may, however, need to be determined by
    hvmloader, and then get made known to Xen.
    
    Fixes: 322ec7c89f66 ("x86/pv: disallow access to unknown MSRs")
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/amd.c              |  4 ++--
 xen/arch/x86/cpu/mtrr/generic.c     |  2 +-
 xen/arch/x86/msr.c                  | 19 +++++++++++++++++++
 xen/arch/x86/x86_64/mmconf-fam10h.c |  2 +-
 xen/include/asm-x86/msr-index.h     | 20 +++++++++++++++-----
 5 files changed, 38 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 169f80d635..83b33047b7 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -468,14 +468,14 @@ static void check_syscfg_dram_mod_en(void)
 		return;
 
 	rdmsrl(MSR_K8_SYSCFG, syscfg);
-	if (!(syscfg & K8_MTRRFIXRANGE_DRAM_MODIFY))
+	if (!(syscfg & SYSCFG_MTRR_FIX_DRAM_MOD_EN))
 		return;
 
 	if (!test_and_set_bool(printed))
 		printk(KERN_ERR "MTRR: SYSCFG[MtrrFixDramModEn] not "
 			"cleared by BIOS, clearing this bit\n");
 
-	syscfg &= ~K8_MTRRFIXRANGE_DRAM_MODIFY;
+	syscfg &= ~SYSCFG_MTRR_FIX_DRAM_MOD_EN;
 	wrmsrl(MSR_K8_SYSCFG, syscfg);
 }
 
diff --git a/xen/arch/x86/cpu/mtrr/generic.c b/xen/arch/x86/cpu/mtrr/generic.c
index 06fa0c0420..883e3398ff 100644
--- a/xen/arch/x86/cpu/mtrr/generic.c
+++ b/xen/arch/x86/cpu/mtrr/generic.c
@@ -224,7 +224,7 @@ static void __init print_mtrr_state(const char *level)
 		uint64_t syscfg, tom2;
 
 		rdmsrl(MSR_K8_SYSCFG, syscfg);
-		if (syscfg & (1 << 21)) {
+		if (syscfg & SYSCFG_MTRR_TOM2_EN) {
 			rdmsrl(MSR_K8_TOP_MEM2, tom2);
 			printk("%sTOM2: %012"PRIx64"%s\n", level, tom2,
 			       syscfg & (1 << 22) ? " (WB)" : "");
diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index 72bbe46949..650d060b12 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -354,6 +354,25 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
         *val = msrs->tsc_aux;
         break;
 
+    case MSR_K8_SYSCFG:
+    case MSR_K8_TOP_MEM1:
+    case MSR_K8_TOP_MEM2:
+    case MSR_K8_IORR_BASE0:
+    case MSR_K8_IORR_MASK0:
+    case MSR_K8_IORR_BASE1:
+    case MSR_K8_IORR_MASK1:
+    case MSR_K8_TSEG_BASE:
+    case MSR_K8_TSEG_MASK:
+        if ( !(cp->x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
+            goto gp_fault;
+        if ( !is_hardware_domain(d) )
+            return X86EMUL_UNHANDLEABLE;
+        rdmsrl(msr, *val);
+        if ( msr == MSR_K8_SYSCFG )
+            *val &= (SYSCFG_TOM2_FORCE_WB | SYSCFG_MTRR_TOM2_EN |
+                     SYSCFG_MTRR_VAR_DRAM_EN | SYSCFG_MTRR_FIX_DRAM_EN);
+        break;
+
     case MSR_K8_HWCR:
         if ( !(cp->x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
             goto gp_fault;
diff --git a/xen/arch/x86/x86_64/mmconf-fam10h.c b/xen/arch/x86/x86_64/mmconf-fam10h.c
index 3b57d2b5ca..a834ab3149 100644
--- a/xen/arch/x86/x86_64/mmconf-fam10h.c
+++ b/xen/arch/x86/x86_64/mmconf-fam10h.c
@@ -69,7 +69,7 @@ static void __init get_fam10h_pci_mmconf_base(void)
 	rdmsrl(address, val);
 
 	/* TOP_MEM2 is not enabled? */
-	if (!(val & (1<<21))) {
+	if (!(val & SYSCFG_MTRR_TOM2_EN)) {
 		tom2 = 1ULL << 32;
 	} else {
 		/* TOP_MEM2 */
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 9a772c12b8..7e38c257d8 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -118,6 +118,21 @@
 #define  PASID_PASID_MASK                   0x000fffff
 #define  PASID_VALID                        (_AC(1, ULL) << 31)
 
+#define MSR_K8_SYSCFG                       0xc0010010
+#define  SYSCFG_MTRR_FIX_DRAM_EN            (_AC(1, ULL) << 18)
+#define  SYSCFG_MTRR_FIX_DRAM_MOD_EN        (_AC(1, ULL) << 19)
+#define  SYSCFG_MTRR_VAR_DRAM_EN            (_AC(1, ULL) << 20)
+#define  SYSCFG_MTRR_TOM2_EN                (_AC(1, ULL) << 21)
+#define  SYSCFG_TOM2_FORCE_WB               (_AC(1, ULL) << 22)
+
+#define MSR_K8_IORR_BASE0                   0xc0010016
+#define MSR_K8_IORR_MASK0                   0xc0010017
+#define MSR_K8_IORR_BASE1                   0xc0010018
+#define MSR_K8_IORR_MASK1                   0xc0010019
+
+#define MSR_K8_TSEG_BASE                    0xc0010112 /* AMD doc: SMMAddr */
+#define MSR_K8_TSEG_MASK                    0xc0010113 /* AMD doc: SMMMask */
+
 #define MSR_K8_VM_CR                        0xc0010114
 #define  VM_CR_INIT_REDIRECTION             (_AC(1, ULL) <<  1)
 #define  VM_CR_SVM_DISABLE                  (_AC(1, ULL) <<  4)
@@ -281,11 +296,6 @@
 #define MSR_K8_TOP_MEM1			0xc001001a
 #define MSR_K7_CLK_CTL			0xc001001b
 #define MSR_K8_TOP_MEM2			0xc001001d
-#define MSR_K8_SYSCFG			0xc0010010
-
-#define K8_MTRRFIXRANGE_DRAM_ENABLE	0x00040000 /* MtrrFixDramEn bit    */
-#define K8_MTRRFIXRANGE_DRAM_MODIFY	0x00080000 /* MtrrFixDramModEn bit */
-#define K8_MTRR_RDMEM_WRMEM_MASK	0x18181818 /* Mask: RdMem|WrMem    */
 
 #define MSR_K7_HWCR			0xc0010015
 #define MSR_K8_HWCR			0xc0010015
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:44:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158865.292256 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rv8-0003pZ-25; Tue, 20 Jul 2021 15:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158865.292256; Tue, 20 Jul 2021 15:44:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rv7-0003pT-VD; Tue, 20 Jul 2021 15:44:33 +0000
Received: by outflank-mailman (input) for mailman id 158865;
 Tue, 20 Jul 2021 15:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rv6-0003p8-J8
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rv6-0004Jg-IN
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rv6-0001CS-Hf
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:44: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3m2n6+sVzE3pxD1zxu4sWeln5Us3oFnJNgloUCAdHNg=; b=i3OYAzEZ7d8ROGU+Eex6kOUSM8
	iHrib1SI6FDQKA43IgO3VubjA+EqffOH7re43wEGac8sjRa1EeST4rSUifCbCaAXT2wayej26fgGx
	jee4Z8lpEog89pJ7OB+2ZfYcWJlSUqB0MP5aleg8G5auJBimuT3KkjpPik6eE+HLOrg8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/AMD: drop MSR_K7_HWCR
Message-Id: <E1m5rv6-0001CS-Hf@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:44:32 +0000

commit 836314747b0fd1688fc9526f7c73fd9313ba82f3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jul 9 08:30:35 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 9 08:30:35 2021 +0200

    x86/AMD: drop MSR_K7_HWCR
    
    We don't support any K7 (32-bit only) hardware anymore, and the MSR is
    accessible as MSR_K8_HWCR as well. Using the K7 name was particularly
    odd for Hygon as well as in a Fam0F-specific piece of code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/amd.c          | 8 ++++----
 xen/arch/x86/cpu/hygon.c        | 4 ++--
 xen/include/asm-x86/msr-index.h | 1 -
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 83b33047b7..2260eef3aa 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -694,9 +694,9 @@ static void init_amd(struct cpuinfo_x86 *c)
 	 * Errata 122 for all steppings (F+ have it disabled by default)
 	 */
 	if (c->x86 == 15) {
-		rdmsrl(MSR_K7_HWCR, value);
+		rdmsrl(MSR_K8_HWCR, value);
 		value |= 1 << 6;
-		wrmsrl(MSR_K7_HWCR, value);
+		wrmsrl(MSR_K8_HWCR, value);
 	}
 
 	/*
@@ -928,9 +928,9 @@ static void init_amd(struct cpuinfo_x86 *c)
 	}
 
 	if (cpu_has(c, X86_FEATURE_EFRO)) {
-		rdmsr(MSR_K7_HWCR, l, h);
+		rdmsr(MSR_K8_HWCR, l, h);
 		l |= (1 << 27); /* Enable read-only APERF/MPERF bit */
-		wrmsr(MSR_K7_HWCR, l, h);
+		wrmsr(MSR_K8_HWCR, l, h);
 	}
 
 	/* Prevent TSC drift in non single-processor, single-core platforms. */
diff --git a/xen/arch/x86/cpu/hygon.c b/xen/arch/x86/cpu/hygon.c
index 2272e1113f..67e23c5df9 100644
--- a/xen/arch/x86/cpu/hygon.c
+++ b/xen/arch/x86/cpu/hygon.c
@@ -70,9 +70,9 @@ static void init_hygon(struct cpuinfo_x86 *c)
 		__set_bit(X86_FEATURE_ARAT, c->x86_capability);
 
 	if (cpu_has(c, X86_FEATURE_EFRO)) {
-		rdmsrl(MSR_K7_HWCR, value);
+		rdmsrl(MSR_K8_HWCR, value);
 		value |= (1 << 27); /* Enable read-only APERF/MPERF bit */
-		wrmsrl(MSR_K7_HWCR, value);
+		wrmsrl(MSR_K8_HWCR, value);
 	}
 
 	amd_log_freq(c);
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 7e38c257d8..a14841055f 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -297,7 +297,6 @@
 #define MSR_K7_CLK_CTL			0xc001001b
 #define MSR_K8_TOP_MEM2			0xc001001d
 
-#define MSR_K7_HWCR			0xc0010015
 #define MSR_K8_HWCR			0xc0010015
 #define K8_HWCR_TSC_FREQ_SEL		(1ULL << 24)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:44:44 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158866.292260 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rvI-0003tV-3Y; Tue, 20 Jul 2021 15:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158866.292260; Tue, 20 Jul 2021 15:44:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rvI-0003tO-0X; Tue, 20 Jul 2021 15:44:44 +0000
Received: by outflank-mailman (input) for mailman id 158866;
 Tue, 20 Jul 2021 15:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rvG-0003su-MV
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:44:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rvG-0004Jv-Li
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rvG-0001DB-Kp
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:44: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YJE/WKEMUG+bOOFbFIjGnClSaY8mYUOvfP3UTuQvrUY=; b=TBj0VXfV2RhDi0N4i0u3vVoopd
	iLuOBjdVSZ3MpwZj+jdBXmzcGskBZnyqEOx6pujMV6XXx0V82uUEsgysaM2J4HIpMDv+tWCZtSBmp
	Zqo6vLSRsZh5b2BTzevZc6hkGGEFwlHLor8uSgw+dK+B2vp/gkggHCvi4AHdWQefFKXg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86emul: pad blob-execution "okay" messages
Message-Id: <E1m5rvG-0001DB-Kp@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:44:42 +0000

commit 10cf9035d29c4b35fbecc02a73c285a4183dfa34
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jul 9 08:31:28 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 9 08:31:28 2021 +0200

    x86emul: pad blob-execution "okay" messages
    
    We already do so in the native execution case, and a few descriptions (I
    did notice this with SHA ones) are short enough for the output to look
    slightly odd.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 tools/tests/x86_emulator/test_x86_emulator.c | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/tools/tests/x86_emulator/test_x86_emulator.c b/tools/tests/x86_emulator/test_x86_emulator.c
index 9677476db0..9b3e98a1a5 100644
--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -5181,6 +5181,8 @@ int main(int argc, char **argv)
 
     for ( j = 0; j < ARRAY_SIZE(blobs); j++ )
     {
+        unsigned int nr;
+
         if ( blobs[j].check_cpu && !blobs[j].check_cpu() )
             continue;
 
@@ -5196,7 +5198,8 @@ int main(int argc, char **argv)
 
         if ( ctxt.addr_size == sizeof(void *) * CHAR_BIT )
         {
-            i = printf("Testing %s native execution...", blobs[j].name);
+            nr = printf("Testing %s native execution...", blobs[j].name);
+
             if ( blobs[j].set_regs )
                 blobs[j].set_regs(&regs);
             asm volatile (
@@ -5212,11 +5215,13 @@ int main(int argc, char **argv)
             );
             if ( !blobs[j].check_regs(&regs) )
                 goto fail;
-            printf("%*sokay\n", i < 40 ? 40 - i : 0, "");
+
+            printf("%*sokay\n", nr < 40 ? 40 - nr : 0, "");
         }
 
-        printf("Testing %s %u-bit code sequence",
-               blobs[j].name, ctxt.addr_size);
+        nr = printf("Testing %s %u-bit code sequence",
+                    blobs[j].name, ctxt.addr_size);
+
         if ( blobs[j].set_regs )
             blobs[j].set_regs(&regs);
         regs.eip = (unsigned long)res;
@@ -5233,7 +5238,10 @@ int main(int argc, char **argv)
                 regs.eip < (unsigned long)res + blobs[j].size )
         {
             if ( (i++ & 8191) == 0 )
+            {
                 printf(".");
+                ++nr;
+            }
             rc = x86_emulate(&ctxt, &emulops);
             if ( rc != X86EMUL_OKAY )
             {
@@ -5242,13 +5250,17 @@ int main(int argc, char **argv)
                 return 1;
             }
         }
-        for ( ; i < 2 * 8192; i += 8192 )
+        for ( ; i < 2 * 8192; i += 8192 ) {
             printf(".");
+            ++nr;
+        }
+
         if ( (regs.eip != 0x12345678) ||
              (regs.esp != ((unsigned long)res + MMAP_SZ)) ||
              !blobs[j].check_regs(&regs) )
             goto fail;
-        printf("okay\n");
+
+        printf("%*sokay\n", nr < 40 ? 40 - nr : 0, "");
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:44:54 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158867.292264 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rvS-0003wy-6X; Tue, 20 Jul 2021 15:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158867.292264; Tue, 20 Jul 2021 15:44:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rvS-0003wq-3U; Tue, 20 Jul 2021 15:44:54 +0000
Received: by outflank-mailman (input) for mailman id 158867;
 Tue, 20 Jul 2021 15:44:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rvQ-0003we-Pc
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:44:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rvQ-0004K5-Oo
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rvQ-0001Dq-O1
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:44: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7e19+wNad+L34ILHP+oHm5mYq5lqVNG9R6fexY29r+4=; b=QKqpOijXTB8uIYS7pSJzRyQSuS
	xQhG4+uZwmWvQYwBpQPdMuh4hlhSGRHsPr7g7QgGS274NKApZK0oTtQJk20Hx733q6bpjNWb7Cu81
	cSDKnCzBfRmHJtLePWTLmkahGcZGgKH2JPQ4plrS9vOqdlU4NVbP/2RteYm80BsTYweE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: mark hypercall argument regs clobbering for intended fall-through
Message-Id: <E1m5rvQ-0001Dq-O1@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:44:52 +0000

commit 140931aa2894991d9d6f1b2ba6ca275e1bc56259
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jul 9 08:32:07 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jul 9 08:32:07 2021 +0200

    x86: mark hypercall argument regs clobbering for intended fall-through
    
    The CIDs below are all for the PV side of things, yet while at it take
    care of the HVM side as well.
    
    Coverity-ID: 1485896, 1485901, 1485906, 1485910, 1485911,
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hypercall.c | 20 ++++++++++----------
 xen/arch/x86/pv/hypercall.c  | 20 ++++++++++----------
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index 9e1f7249f3..263d5407ea 100644
--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen/arch/x86/hvm/hypercall.c
@@ -248,11 +248,11 @@ int hvm_hypercall(struct cpu_user_regs *regs)
         /* Deliberately corrupt parameter regs not used by this hypercall. */
         switch ( hypercall_args_table[eax].native )
         {
-        case 0: rdi = 0xdeadbeefdeadf00dUL;
-        case 1: rsi = 0xdeadbeefdeadf00dUL;
-        case 2: rdx = 0xdeadbeefdeadf00dUL;
-        case 3: r10 = 0xdeadbeefdeadf00dUL;
-        case 4: r8 = 0xdeadbeefdeadf00dUL;
+        case 0: rdi = 0xdeadbeefdeadf00dUL; fallthrough;
+        case 1: rsi = 0xdeadbeefdeadf00dUL; fallthrough;
+        case 2: rdx = 0xdeadbeefdeadf00dUL; fallthrough;
+        case 3: r10 = 0xdeadbeefdeadf00dUL; fallthrough;
+        case 4: r8 = 0xdeadbeefdeadf00dUL; fallthrough;
         case 5: r9 = 0xdeadbeefdeadf00dUL;
         }
 #endif
@@ -266,11 +266,11 @@ int hvm_hypercall(struct cpu_user_regs *regs)
             /* Deliberately corrupt parameter regs used by this hypercall. */
             switch ( hypercall_args_table[eax].native )
             {
-            case 6: regs->r9  = 0xdeadbeefdeadf00dUL;
-            case 5: regs->r8  = 0xdeadbeefdeadf00dUL;
-            case 4: regs->r10 = 0xdeadbeefdeadf00dUL;
-            case 3: regs->rdx = 0xdeadbeefdeadf00dUL;
-            case 2: regs->rsi = 0xdeadbeefdeadf00dUL;
+            case 6: regs->r9  = 0xdeadbeefdeadf00dUL; fallthrough;
+            case 5: regs->r8  = 0xdeadbeefdeadf00dUL; fallthrough;
+            case 4: regs->r10 = 0xdeadbeefdeadf00dUL; fallthrough;
+            case 3: regs->rdx = 0xdeadbeefdeadf00dUL; fallthrough;
+            case 2: regs->rsi = 0xdeadbeefdeadf00dUL; fallthrough;
             case 1: regs->rdi = 0xdeadbeefdeadf00dUL;
             }
         }
diff --git a/xen/arch/x86/pv/hypercall.c b/xen/arch/x86/pv/hypercall.c
index 200b8a05b0..03939bdfcf 100644
--- a/xen/arch/x86/pv/hypercall.c
+++ b/xen/arch/x86/pv/hypercall.c
@@ -150,11 +150,11 @@ void pv_hypercall(struct cpu_user_regs *regs)
         /* Deliberately corrupt parameter regs not used by this hypercall. */
         switch ( hypercall_args_table[eax].native )
         {
-        case 0: rdi = 0xdeadbeefdeadf00dUL;
-        case 1: rsi = 0xdeadbeefdeadf00dUL;
-        case 2: rdx = 0xdeadbeefdeadf00dUL;
-        case 3: r10 = 0xdeadbeefdeadf00dUL;
-        case 4: r8 = 0xdeadbeefdeadf00dUL;
+        case 0: rdi = 0xdeadbeefdeadf00dUL; fallthrough;
+        case 1: rsi = 0xdeadbeefdeadf00dUL; fallthrough;
+        case 2: rdx = 0xdeadbeefdeadf00dUL; fallthrough;
+        case 3: r10 = 0xdeadbeefdeadf00dUL; fallthrough;
+        case 4: r8 = 0xdeadbeefdeadf00dUL; fallthrough;
         case 5: r9 = 0xdeadbeefdeadf00dUL;
         }
 #endif
@@ -173,11 +173,11 @@ void pv_hypercall(struct cpu_user_regs *regs)
             /* Deliberately corrupt parameter regs used by this hypercall. */
             switch ( hypercall_args_table[eax].native )
             {
-            case 6: regs->r9  = 0xdeadbeefdeadf00dUL;
-            case 5: regs->r8  = 0xdeadbeefdeadf00dUL;
-            case 4: regs->r10 = 0xdeadbeefdeadf00dUL;
-            case 3: regs->rdx = 0xdeadbeefdeadf00dUL;
-            case 2: regs->rsi = 0xdeadbeefdeadf00dUL;
+            case 6: regs->r9  = 0xdeadbeefdeadf00dUL; fallthrough;
+            case 5: regs->r8  = 0xdeadbeefdeadf00dUL; fallthrough;
+            case 4: regs->r10 = 0xdeadbeefdeadf00dUL; fallthrough;
+            case 3: regs->rdx = 0xdeadbeefdeadf00dUL; fallthrough;
+            case 2: regs->rsi = 0xdeadbeefdeadf00dUL; fallthrough;
             case 1: regs->rdi = 0xdeadbeefdeadf00dUL;
             }
         }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:45:04 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158868.292268 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rvc-00040C-7x; Tue, 20 Jul 2021 15:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158868.292268; Tue, 20 Jul 2021 15:45:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rvc-000404-4x; Tue, 20 Jul 2021 15:45:04 +0000
Received: by outflank-mailman (input) for mailman id 158868;
 Tue, 20 Jul 2021 15:45:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rva-0003zm-SW
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:45:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rva-0004Kw-Rm
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rva-0001F1-Qz
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:45: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FlAfVsmshA8or7QojKtI3cxNlDefrHlb1hdjsXNeIMU=; b=DZlVvNLvl3xPbIIQDmrFW+QlN4
	5zcm+2EuWADpuuNGLMPqYJH5f2yXLqpQPGR4SzGZtMeJeh5vy1iRzUHC4IsM7+smgh3nKWYELPFmQ
	Gtug91BSc8YrVnvp+qjvjZEoCxSHqe/P1G6W5lvIFjzjAi972OGzEqdd1oCSM6JJCWYY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools: ipxe: update for fixing build with GCC11
Message-Id: <E1m5rva-0001F1-Qz@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:45:02 +0000

commit ab50c903e5d550bf6545a636c9a23144b54d0eb5
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Wed Jun 16 15:14:35 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 11:12:27 2021 +0100

    tools: ipxe: update for fixing build with GCC11
    
    Use a snapshot which includes commit
    f3f568e382a5f19824b3bfc6081cde39eee661e8 ("[crypto] Add
    memory output constraints for big-integer inline assembly"),
    which fixes build with gcc11.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/firmware/etherboot/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/firmware/etherboot/Makefile b/tools/firmware/etherboot/Makefile
index ed9e11305f..4bc3633ba3 100644
--- a/tools/firmware/etherboot/Makefile
+++ b/tools/firmware/etherboot/Makefile
@@ -10,7 +10,8 @@ else
 IPXE_GIT_URL ?= git://git.ipxe.org/ipxe.git
 endif
 
-IPXE_GIT_TAG := 988d2c13cdf0f0b4140685af35ced70ac5b3283c
+# put an updated tar.gz on xenbits after changes to this variable
+IPXE_GIT_TAG := 3c040ad387099483102708bb1839110bc788cefb
 
 IPXE_TARBALL_URL ?= $(XEN_EXTFILES_URL)/ipxe-git-$(IPXE_GIT_TAG).tar.gz
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:45:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158869.292273 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rvm-00043D-9f; Tue, 20 Jul 2021 15:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158869.292273; Tue, 20 Jul 2021 15:45:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rvm-000435-6S; Tue, 20 Jul 2021 15:45:14 +0000
Received: by outflank-mailman (input) for mailman id 158869;
 Tue, 20 Jul 2021 15:45:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rvk-00042f-Vs
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:45:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rvk-0004LH-Uv
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:45:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rvk-0001FY-UE
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:45: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uEp7UH8LgJj+HmtcafehD62A7jtr34IpSFCRA9pEDig=; b=ZY54v4vdWTibuwV7Vs+Wu6ifDY
	RWJ5hH7g+lRAvruz5O8vXxtr+sD1Ocf50Oqyxlz+MjP+2zFiZ0W+RwdwQLOgVnTiERPY38peqpKlp
	gcaexwWp1NxzOqS0aq3+3ocNmzCmDSdmgN6rRqlmghhsYU6+xxt1gnTKhM+SOje6aFDQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxenstat: fix populating vbd.rd_sect
Message-Id: <E1m5rvk-0001FY-UE@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:45:12 +0000

commit 89d57f291e37b4769ab26db919eba46548f2e13e
Author:     Richard Kojedzinszky <richard@kojedz.in>
AuthorDate: Fri Jul 9 10:06:45 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 11:12:27 2021 +0100

    tools/libxenstat: fix populating vbd.rd_sect
    
    Fixes: 91c3e3dc91d6 ("tools/xentop: Display '-' when stats are not available.")
    Signed-off-by: Richard Kojedzinszky <richard@kojedz.in>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libs/stat/xenstat_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/stat/xenstat_linux.c b/tools/libs/stat/xenstat_linux.c
index 875a0617ad..ebcd65f24a 100644
--- a/tools/libs/stat/xenstat_linux.c
+++ b/tools/libs/stat/xenstat_linux.c
@@ -475,7 +475,7 @@ int xenstat_collect_vbds(xenstat_node * node)
 				(read_attributes_vbd(dp->d_name, "statistics/wr_req", buf, 256)<=0) ||
 				((ret = sscanf(buf, "%llu", &vbd.wr_reqs)) != 1) ||
 				(read_attributes_vbd(dp->d_name, "statistics/rd_sect", buf, 256)<=0) ||
-				((ret = sscanf(buf, "%llu", &vbd.wr_sects)) != 1) ||
+				((ret = sscanf(buf, "%llu", &vbd.rd_sects)) != 1) ||
 				(read_attributes_vbd(dp->d_name, "statistics/wr_sect", buf, 256)<=0) ||
 				((ret = sscanf(buf, "%llu", &vbd.wr_sects)) != 1))
 			{
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:45:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:45:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158870.292277 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rvw-00046X-Aw; Tue, 20 Jul 2021 15:45:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158870.292277; Tue, 20 Jul 2021 15:45:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rvw-00046O-80; Tue, 20 Jul 2021 15:45:24 +0000
Received: by outflank-mailman (input) for mailman id 158870;
 Tue, 20 Jul 2021 15:45:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rvv-00046B-2d
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:45:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rvv-0004LY-1s
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:45:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rvv-0001GD-11
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:45: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CNe+r73okrlsmZDzVFgl+Ac9OvPMfmC+kgURpqUtnbo=; b=kWSvcI1v+csWCTY1Kdz7iVpMpU
	NBy3JEwchzlC5ghEnk9BhoeLfy7itrKJd9Nd/e9jQZDJVvX2vnWT5w2T0j89I3sP8fGo/UKrOtEgY
	W/zDUIXXgdxqTRkTqAStAyb8j27PoRvrYR09Y3h7qZp+C5+Vm46NlnmL47PJ6ISMC8X8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] cirrus-ci: Fix FreeBSD build following QEMU update
Message-Id: <E1m5rvv-0001GD-11@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:45:23 +0000

commit 6de3e5fce5e2a3c5f438e8e214168dd3a474cbbf
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jul 8 12:52:14 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 11:12:27 2021 +0100

    cirrus-ci: Fix FreeBSD build following QEMU update
    
    QEMU requires ninja and bash to build now.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index fdb1c9c94d..b17f0b6369 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -4,7 +4,7 @@ freebsd_template: &FREEBSD_TEMPLATE
     APPEND_LIB: /usr/local/lib
     APPEND_INCLUDES: /usr/local/include
 
-  install_script: pkg install -y seabios gmake
+  install_script: pkg install -y seabios gmake ninja bash
                                  pkgconf python libiconv bison perl5
                                  yajl lzo2 pixman argp-standalone
                                  libxml2 glib git
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:45:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:45:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158871.292282 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rw6-00049k-Cs; Tue, 20 Jul 2021 15:45:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158871.292282; Tue, 20 Jul 2021 15:45:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rw6-00049a-9Q; Tue, 20 Jul 2021 15:45:34 +0000
Received: by outflank-mailman (input) for mailman id 158871;
 Tue, 20 Jul 2021 15:45:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rw5-00049B-5X
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:45:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rw5-0004Lj-4p
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:45:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rw5-0001Gv-4A
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jd5wOg02gNiNBp8aEc2GsY0e7jNhq6qbJ8F0uQlCeoQ=; b=lO9usbCtG8MgAYT5+MVlpA6BHF
	xo1KF4OpLhhlDhynI/YG7K9F68hZwpDw489rRL5rbMOM/7OQALwCJa8SQVJixL4lC54x189RQVTM+
	F8aJYxsxMvvlOr+RIjU+ZxXUJbyEF6n6Txda+4vCsx0NCpfNwS5IskmTGppSD/Gs9y7I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: use zypper dup in tumbleweed dockerfile
Message-Id: <E1m5rw5-0001Gv-4A@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:45:33 +0000

commit ea7f91ded56e6de1fbf79b8a7c0985a5f5de5740
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 8 15:57:04 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 13:28:52 2021 +0100

    automation: use zypper dup in tumbleweed dockerfile
    
    The 'dup' command aligns the installed packages with the packages
    found in the enabled repositories, taking the repository priorities
    into account. Using this command is generally a safe thing to do.
    
    In the context of Tumbleweed using 'dup' is essential, because package
    versions might be downgraded, and package names occasionally change.
    Only 'dup' will do the correct thing in such cases.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/build/suse/opensuse-tumbleweed.dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/build/suse/opensuse-tumbleweed.dockerfile b/automation/build/suse/opensuse-tumbleweed.dockerfile
index a33ab0d870..3965e7f9cd 100644
--- a/automation/build/suse/opensuse-tumbleweed.dockerfile
+++ b/automation/build/suse/opensuse-tumbleweed.dockerfile
@@ -7,7 +7,7 @@ ENV USER root
 RUN mkdir /build
 WORKDIR /build
 
-RUN zypper ref && zypper up -y --no-recommends
+RUN zypper ref && zypper dup -y --no-recommends
 RUN zypper install -y --no-recommends \
         acpica \
         bc \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:45:44 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:45:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158872.292285 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rwG-0004C1-Dm; Tue, 20 Jul 2021 15:45:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158872.292285; Tue, 20 Jul 2021 15:45:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rwG-0004Bt-As; Tue, 20 Jul 2021 15:45:44 +0000
Received: by outflank-mailman (input) for mailman id 158872;
 Tue, 20 Jul 2021 15:45:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rwF-0004Bl-8b
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:45:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rwF-0004Lw-7j
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:45:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rwF-0001HU-74
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:45: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3HXrNO7O9VJULJo8zPO1hMOkppjTpekXvmT6yhEShOo=; b=6tN7CnKlxKLFFgN/jqDiIFUdik
	jhUvc85qhb78drZjgjYN3Cpv4SQCTwwKmPvUFYv5j+X0fNSpmIL/KLGRo97xCERdjxIw9GUfJV8Au
	0aDJ9N0gcEbZLxF9Nlb067uvJ1DUvkKQYiq/ZXk5YGX/l1dDRN2/81ogayn8VLLQ6eUE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: avoid globbering the docker run args
Message-Id: <E1m5rwF-0001HU-74@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:45:43 +0000

commit 4905c2da20e2d95ff577033b0513d4bb57a9c086
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 8 16:56:49 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 13:28:52 2021 +0100

    automation: avoid globbering the docker run args
    
    containerize bash -c './configure && make' fails due to shell expansion.
    
    Collect all arguments for the script and pass them verbatim to the
    docker run command.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andew.cooper3@citrix.com>
---
 automation/scripts/containerize | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/automation/scripts/containerize b/automation/scripts/containerize
index 59edf0ba40..7682ccd347 100755
--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -47,10 +47,10 @@ case "_${CONTAINER_UID0}" in
 esac
 
 # Save the commands for future use
-cmd=$@
+cmd=("$@")
 
 # If no command was specified, just drop us into a shell if we're interactive
-[ $# -eq 0 ] && tty -s && cmd="/bin/bash"
+[ $# -eq 0 ] && tty -s && cmd=("/bin/bash")
 
 # Are we in an interactive terminal?
 tty -s && termint=t
@@ -104,4 +104,4 @@ exec ${docker_cmd} run \
     ${CONTAINER_ARGS} \
     -${termint}i --rm -- \
     ${CONTAINER} \
-    ${cmd}
+    "${cmd[@]}"
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:45:54 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:45:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158873.292289 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rwQ-0004GQ-FV; Tue, 20 Jul 2021 15:45:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158873.292289; Tue, 20 Jul 2021 15:45:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rwQ-0004GF-CO; Tue, 20 Jul 2021 15:45:54 +0000
Received: by outflank-mailman (input) for mailman id 158873;
 Tue, 20 Jul 2021 15:45:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rwP-0004G5-BN
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:45:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rwP-0004MA-Ae
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:45:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rwP-0001I3-9z
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:45: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=e2Z65a3cor+rLEFqwobeOvNLrt9bMC7ZF0boARG8QWc=; b=p1NqRYPkgQ5rQFuOh+RwbjY9Lu
	EMu6zq4HSW2PXgi2uMJAPrTRKaaQrjY9dX9mZx/YgiE8I0Fc6ZzqfNC3XSfNUa6SdyIqKgyFAyowm
	sF0d6nH3i/u2YkOZRU2leOHT+jajrDID1GdAIUKxqghUFPk1l9nJCWSlfwvr4n4OOMpU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: document how to refresh a container
Message-Id: <E1m5rwP-0001I3-9z@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:45:53 +0000

commit cf4aa8dfb201a7db3e9ec2d4a2ff56961c7719fb
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Jul 8 16:56:28 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 13:28:52 2021 +0100

    automation: document how to refresh a container
    
    The Tumbleweed container should be updated often.
    Describe the neccessary steps how to refresh and test it before
    pushing the new image to gitlab.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/build/README.md | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/automation/build/README.md b/automation/build/README.md
index e1fb3124de..2137957408 100644
--- a/automation/build/README.md
+++ b/automation/build/README.md
@@ -91,5 +91,17 @@ you have access to do so and have your Docker logged into the registry.
 To login you must run `docker login registry.gitlab.com`. For more
 information see the [registry help].
 
+This example shows how to refresh a container for a rolling release
+such as openSUSE Tumbleweed. Login with the gitlab.com credentials.
+
+```
+docker login registry.gitlab.com/xen-project/xen
+make -C automation/build suse/opensuse-tumbleweed
+env CONTAINER_NO_PULL=1 \
+  CONTAINER=tumbleweed \
+  automation/scripts/containerize bash -exc './configure && make'
+make -C automation/build suse/opensuse-tumbleweed PUSH=1
+```
+
 [registry]: https://gitlab.com/xen-project/xen/container_registry
 [registry help]: https://gitlab.com/help/user/project/container_registry
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:46:04 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:46:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158874.292293 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rwa-0004Ja-Ha; Tue, 20 Jul 2021 15:46:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158874.292293; Tue, 20 Jul 2021 15:46:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rwa-0004JS-Dw; Tue, 20 Jul 2021 15:46:04 +0000
Received: by outflank-mailman (input) for mailman id 158874;
 Tue, 20 Jul 2021 15:46:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rwZ-0004JI-Eb
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:46:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rwZ-0004Mr-Dp
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:46:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rwZ-0001J6-D1
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ei+kMg/bNLtwg1aHxiu9y8JAUab+Pf6GwZZtEYjCBwc=; b=qdm2RE4s0srk4mQktB+VBYUFkI
	GEivHY9cdtrSHfyZfHNnV5ZbzVHp+uJtycixjrYOlFtNLjZxAX2bzPEngT8e90YeywFSGbPCMJTh3
	kBlVyC5YzSfITdv2GnltQCnvxB00rWnaV5sLNoAbxI84htFE1cvCZP+25WQnlOTyAcaA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/debugger: Fix PAGE_SIZE redefinition error
Message-Id: <E1m5rwZ-0001J6-D1@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:46:03 +0000

commit 37588941a249a0b45a44a6385b187d7d10132e7d
Author:     Costin Lupu <costin.lupu@cs.pub.ro>
AuthorDate: Tue Jun 8 15:35:25 2021 +0300
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Jul 9 15:59:36 2021 +0100

    tools/debugger: Fix PAGE_SIZE redefinition error
    
    If PAGE_SIZE is already defined in the system (e.g. in /usr/include/limits.h
    header) then gcc will trigger a redefinition error because of -Werror. This
    patch replaces usage of PAGE_* macros with KDD_PAGE_* macros in order to avoid
    confusion between control domain page granularity (PAGE_* definitions) and
    guest domain page granularity (which is what we are dealing with here).
    
    We chose to define the KDD_PAGE_* macros instead of using XC_PAGE_* macros
    because (1) the code in kdd.c should not include any Xen headers and (2) to add
    consistency for code in both kdd.c and kdd-xen.c.
    
    Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/debugger/kdd/kdd-xen.c | 15 ++++++---------
 tools/debugger/kdd/kdd.c     | 19 ++++++++-----------
 tools/debugger/kdd/kdd.h     |  7 +++++++
 3 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/tools/debugger/kdd/kdd-xen.c b/tools/debugger/kdd/kdd-xen.c
index f3f9529f9f..e78c9311c4 100644
--- a/tools/debugger/kdd/kdd-xen.c
+++ b/tools/debugger/kdd/kdd-xen.c
@@ -48,9 +48,6 @@
 
 #define MAPSIZE 4093 /* Prime */
 
-#define PAGE_SHIFT 12
-#define PAGE_SIZE (1U << PAGE_SHIFT)
-
 struct kdd_guest {
     struct xentoollog_logger xc_log; /* Must be first for xc log callbacks */
     xc_interface *xc_handle;
@@ -72,7 +69,7 @@ static void flush_maps(kdd_guest *g)
     int i;
     for (i = 0; i < MAPSIZE; i++) {
         if (g->maps[i] != NULL)
-            munmap(g->maps[i], PAGE_SIZE);
+            munmap(g->maps[i], KDD_PAGE_SIZE);
         g->maps[i] = NULL;
     }
 }
@@ -490,13 +487,13 @@ static uint32_t kdd_access_physical_page(kdd_guest *g, uint64_t addr,
     uint32_t map_pfn, map_offset;
     uint8_t *map;
 
-    map_pfn = (addr >> PAGE_SHIFT);
-    map_offset = addr & (PAGE_SIZE - 1);
+    map_pfn = (addr >> KDD_PAGE_SHIFT);
+    map_offset = addr & (KDD_PAGE_SIZE - 1);
 
     /* Evict any mapping of the wrong frame from our slot */ 
     if (g->pfns[map_pfn % MAPSIZE] != map_pfn
         && g->maps[map_pfn % MAPSIZE] != NULL) {
-        munmap(g->maps[map_pfn % MAPSIZE], PAGE_SIZE);
+        munmap(g->maps[map_pfn % MAPSIZE], KDD_PAGE_SIZE);
         g->maps[map_pfn % MAPSIZE] = NULL;
     }
     g->pfns[map_pfn % MAPSIZE] = map_pfn;
@@ -507,7 +504,7 @@ static uint32_t kdd_access_physical_page(kdd_guest *g, uint64_t addr,
     else {
         map = xc_map_foreign_range(g->xc_handle,
                                    g->domid,
-                                   PAGE_SIZE,
+                                   KDD_PAGE_SIZE,
                                    PROT_READ|PROT_WRITE,
                                    map_pfn);
 
@@ -533,7 +530,7 @@ uint32_t kdd_access_physical(kdd_guest *g, uint64_t addr,
 {
     uint32_t chunk, rv, done = 0;
     while (len > 0) {
-        chunk = PAGE_SIZE - (addr & (PAGE_SIZE - 1));
+        chunk = KDD_PAGE_SIZE - (addr & (KDD_PAGE_SIZE - 1));
         if (chunk > len) 
             chunk = len;
         rv = kdd_access_physical_page(g, addr, chunk, buf, write);
diff --git a/tools/debugger/kdd/kdd.c b/tools/debugger/kdd/kdd.c
index 17513c2650..320c623eda 100644
--- a/tools/debugger/kdd/kdd.c
+++ b/tools/debugger/kdd/kdd.c
@@ -288,9 +288,6 @@ static void kdd_log_pkt(kdd_state *s, const char *name, kdd_pkt *p)
  *  Memory access: virtual addresses and syntactic sugar.
  */
 
-#define PAGE_SHIFT (12)
-#define PAGE_SIZE (1ULL << PAGE_SHIFT) 
-
 static uint32_t kdd_read_physical(kdd_state *s, uint64_t addr, 
                                   uint32_t len, void *buf)
 {
@@ -352,7 +349,7 @@ static uint64_t v2p(kdd_state *s, int cpuid, uint64_t va)
 
     /* Walk the appropriate number of levels */
     for (i = levels; i > 0; i--) {
-        shift = PAGE_SHIFT + bits * (i-1);
+        shift = KDD_PAGE_SHIFT + bits * (i-1);
         mask = ((1ULL << bits) - 1) << shift;
         offset = ((va & mask) >> shift) * width;
         KDD_DEBUG(s, "level %i: mask 0x%16.16"PRIx64" pa 0x%16.16"PRIx64
@@ -364,12 +361,12 @@ static uint64_t v2p(kdd_state *s, int cpuid, uint64_t va)
             return -1ULL; // Not present
         pa = entry & 0x000ffffffffff000ULL;
         if (pse && (i == 2) && (entry & 0x80)) { // Superpage
-            mask = ((1ULL << (PAGE_SHIFT + bits)) - 1);
+            mask = ((1ULL << (KDD_PAGE_SHIFT + bits)) - 1);
             return (pa & ~mask) + (va & mask);
         }
     }
 
-    return pa + (va & (PAGE_SIZE - 1));
+    return pa + (va & (KDD_PAGE_SIZE - 1));
 }
 
 static uint32_t kdd_access_virtual(kdd_state *s, int cpuid, uint64_t addr,
@@ -380,7 +377,7 @@ static uint32_t kdd_access_virtual(kdd_state *s, int cpuid, uint64_t addr,
     
     /* Process one page at a time */
     while (len > 0) {
-        chunk = PAGE_SIZE - (addr & (PAGE_SIZE - 1));
+        chunk = KDD_PAGE_SIZE - (addr & (KDD_PAGE_SIZE - 1));
         if (chunk > len) 
             chunk = len;
         pa = v2p(s, cpuid, addr);
@@ -591,7 +588,7 @@ static void get_os_info_64(kdd_state *s)
     uint64_t dbgkd_addr;
     DBGKD_GET_VERSION64 dbgkd_get_version64;
     /* Maybe 1GB is too big for the limit to search? */
-    uint32_t search_limit = (1024 * 1024 * 1024) / PAGE_SIZE; /*1GB/PageSize*/
+    uint32_t search_limit = (1024 * 1024 * 1024) / KDD_PAGE_SIZE; /*1GB/PageSize*/
     uint64_t efer;
 
     /* if we are not in 64-bit mode, fail */
@@ -620,7 +617,7 @@ static void get_os_info_64(kdd_state *s)
      * in 1GB range above the current page base address
      */
 
-    base = idt0_addr & ~(PAGE_SIZE - 1);
+    base = idt0_addr & ~(KDD_PAGE_SIZE - 1);
 
     while (search_limit) {
         uint16_t val;
@@ -633,7 +630,7 @@ static void get_os_info_64(kdd_state *s)
         if (val == MZ_HEADER) // MZ
             break;
 
-        base -= PAGE_SIZE;
+        base -= KDD_PAGE_SIZE;
         search_limit -= 1;
     }
 
@@ -720,7 +717,7 @@ static void find_os(kdd_state *s)
         /* Try each page in the potential range of kernel load addresses */
         for (limit = s->os.base + s->os.range;
              s->os.base <= limit;
-             s->os.base += PAGE_SIZE)
+             s->os.base += KDD_PAGE_SIZE)
             if (check_os(s))
                 return;
     }
diff --git a/tools/debugger/kdd/kdd.h b/tools/debugger/kdd/kdd.h
index b9a17440df..b476a76d93 100644
--- a/tools/debugger/kdd/kdd.h
+++ b/tools/debugger/kdd/kdd.h
@@ -39,6 +39,13 @@
 
 #define PACKED __attribute__((packed))
 
+/* We define our page related constants here in order to specifically
+ * avoid using the Xen page macros (this is a restriction for the code
+ * in kdd.c which should not include any Xen headers) and to add
+ * consistency for code in both kdd.c and kdd-xen.c. */
+#define KDD_PAGE_SHIFT 12
+#define KDD_PAGE_SIZE (1U << KDD_PAGE_SHIFT)
+
 /*****************************************************************************
  * Serial line protocol: Sender sends a 16-byte header with an optional
  * payload following it.  Receiver responds to each packet with an
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:46:15 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:46:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158875.292297 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rwl-0004Mu-KM; Tue, 20 Jul 2021 15:46:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158875.292297; Tue, 20 Jul 2021 15:46:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rwl-0004Mm-HS; Tue, 20 Jul 2021 15:46:15 +0000
Received: by outflank-mailman (input) for mailman id 158875;
 Tue, 20 Jul 2021 15:46:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rwj-0004MZ-Hr
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:46:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rwj-0004N3-Gy
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:46:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rwj-0001Jn-GG
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:46: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nU57xD/BnJixkjrNdxe2Xn4OK52Oy568zGSqkjqtNGM=; b=u924PBqrNkE+oHp7CvNqnBLCNa
	pddy59x/qYbJY/dXzBk4ifYoAnpLmct1r4wVOWQj3EtIfawv6v6ZJV9iMbUHsqrwgiFzlzEKwjmew
	kR21E7hzCK6ktmllGxY3PoZirdU2HXnHWA1GNu5FVMHCBqG6cqYNkcZTcHw1qJaNfT4E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libfsimage: Fix PATH_MAX redefinition error
Message-Id: <E1m5rwj-0001Jn-GG@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:46:13 +0000

commit d276e0f3f14f2d46f27989008770eb2b9c678bc4
Author:     Costin Lupu <costin.lupu@cs.pub.ro>
AuthorDate: Tue Jun 8 15:35:26 2021 +0300
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Jul 9 15:59:59 2021 +0100

    tools/libfsimage: Fix PATH_MAX redefinition error
    
    If PATH_MAX is already defined in the system (e.g. in /usr/include/limits.h
    header) then gcc will trigger a redefinition error because of -Werror.
    
    Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libfsimage/ext2fs/fsys_ext2fs.c     | 2 ++
 tools/libfsimage/reiserfs/fsys_reiserfs.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/tools/libfsimage/ext2fs/fsys_ext2fs.c b/tools/libfsimage/ext2fs/fsys_ext2fs.c
index a4ed10419c..5ed8fce90e 100644
--- a/tools/libfsimage/ext2fs/fsys_ext2fs.c
+++ b/tools/libfsimage/ext2fs/fsys_ext2fs.c
@@ -278,7 +278,9 @@ struct ext4_extent_header {
 
 #define EXT2_SUPER_MAGIC      0xEF53	/* include/linux/ext2_fs.h */
 #define EXT2_ROOT_INO              2	/* include/linux/ext2_fs.h */
+#ifndef PATH_MAX
 #define PATH_MAX                1024	/* include/linux/limits.h */
+#endif
 #define MAX_LINK_COUNT             5	/* number of symbolic links to follow */
 
 /* made up, these are pointers into FSYS_BUF */
diff --git a/tools/libfsimage/reiserfs/fsys_reiserfs.c b/tools/libfsimage/reiserfs/fsys_reiserfs.c
index 916eb15292..10ca657476 100644
--- a/tools/libfsimage/reiserfs/fsys_reiserfs.c
+++ b/tools/libfsimage/reiserfs/fsys_reiserfs.c
@@ -284,7 +284,9 @@ struct reiserfs_de_head
 #define S_ISDIR(mode) (((mode) & 0170000) == 0040000)
 #define S_ISLNK(mode) (((mode) & 0170000) == 0120000)
 
+#ifndef PATH_MAX
 #define PATH_MAX       1024	/* include/linux/limits.h */
+#endif
 #define MAX_LINK_COUNT    5	/* number of symbolic links to follow */
 
 /* The size of the node cache */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:46:25 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:46:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158876.292301 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rwv-0004Pt-Lw; Tue, 20 Jul 2021 15:46:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158876.292301; Tue, 20 Jul 2021 15:46:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rwv-0004Pl-Ir; Tue, 20 Jul 2021 15:46:25 +0000
Received: by outflank-mailman (input) for mailman id 158876;
 Tue, 20 Jul 2021 15:46:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rwt-0004PJ-Kl
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:46:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rwt-0004NE-Jz
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:46:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rwt-0001Ke-JQ
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:46: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IiUwGYwBFTSbeaIHSRqn45y40xlLpiT8PKtdqxxrSVE=; b=bJR2bnpLk4bo03I8J0taXWrhL1
	/VxuegLRX02bw7KDM4Hul2yPkaaYY/q+PGLDVDI6uFr6yKhDJKv+rDpSjigANfJnQzxWntjYk5RhQ
	7RmBb3GLZ+8e56rSFcl60moq3apdkuAcFD70FBXbE6iqXFtuFaHVzcj/G7ZUtjymomSQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libs/foreignmemory: Fix PAGE_SIZE redefinition error
Message-Id: <E1m5rwt-0001Ke-JQ@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:46:23 +0000

commit 0dbb4be739c50b8018aeeb285ef290bf7962a28e
Author:     Costin Lupu <costin.lupu@cs.pub.ro>
AuthorDate: Tue Jun 8 15:35:27 2021 +0300
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Jul 9 16:00:02 2021 +0100

    tools/libs/foreignmemory: Fix PAGE_SIZE redefinition error
    
    If PAGE_SIZE is already defined in the system (e.g. in /usr/include/limits.h
    header) then gcc will trigger a redefinition error because of -Werror. This
    patch replaces usage of PAGE_* macros with XC_PAGE_* macros in order to avoid
    confusion between control domain page granularity (PAGE_* definitions) and
    guest domain page granularity.
    
    The exception is in osdep_xenforeignmemory_map() where we need the system page
    size to check whether the PFN array should be allocated with mmap() or with
    dynamic allocation.
    
    Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libs/foreignmemory/core.c    |  2 +-
 tools/libs/foreignmemory/freebsd.c | 10 +++++-----
 tools/libs/foreignmemory/linux.c   | 23 ++++++++++++-----------
 tools/libs/foreignmemory/minios.c  |  2 +-
 tools/libs/foreignmemory/netbsd.c  | 10 +++++-----
 tools/libs/foreignmemory/private.h |  9 +--------
 6 files changed, 25 insertions(+), 31 deletions(-)

diff --git a/tools/libs/foreignmemory/core.c b/tools/libs/foreignmemory/core.c
index 28ec311af1..7edc6f0dbf 100644
--- a/tools/libs/foreignmemory/core.c
+++ b/tools/libs/foreignmemory/core.c
@@ -202,7 +202,7 @@ int xenforeignmemory_resource_size(
     if ( rc )
         return rc;
 
-    *size = fres.nr_frames << PAGE_SHIFT;
+    *size = fres.nr_frames << XC_PAGE_SHIFT;
     return 0;
 }
 
diff --git a/tools/libs/foreignmemory/freebsd.c b/tools/libs/foreignmemory/freebsd.c
index d94ea07862..2cf0fa1c38 100644
--- a/tools/libs/foreignmemory/freebsd.c
+++ b/tools/libs/foreignmemory/freebsd.c
@@ -63,7 +63,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
     privcmd_mmapbatch_t ioctlx;
     int rc;
 
-    addr = mmap(addr, num << PAGE_SHIFT, prot, flags | MAP_SHARED, fd, 0);
+    addr = mmap(addr, num << XC_PAGE_SHIFT, prot, flags | MAP_SHARED, fd, 0);
     if ( addr == MAP_FAILED )
         return NULL;
 
@@ -78,7 +78,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
     {
         int saved_errno = errno;
 
-        (void)munmap(addr, num << PAGE_SHIFT);
+        (void)munmap(addr, num << XC_PAGE_SHIFT);
         errno = saved_errno;
         return NULL;
     }
@@ -89,7 +89,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num)
 {
-    return munmap(addr, num << PAGE_SHIFT);
+    return munmap(addr, num << XC_PAGE_SHIFT);
 }
 
 int osdep_xenforeignmemory_restrict(xenforeignmemory_handle *fmem,
@@ -101,7 +101,7 @@ int osdep_xenforeignmemory_restrict(xenforeignmemory_handle *fmem,
 int osdep_xenforeignmemory_unmap_resource(xenforeignmemory_handle *fmem,
                                         xenforeignmemory_resource_handle *fres)
 {
-    return fres ? munmap(fres->addr, fres->nr_frames << PAGE_SHIFT) : 0;
+    return fres ? munmap(fres->addr, fres->nr_frames << XC_PAGE_SHIFT) : 0;
 }
 
 int osdep_xenforeignmemory_map_resource(xenforeignmemory_handle *fmem,
@@ -120,7 +120,7 @@ int osdep_xenforeignmemory_map_resource(xenforeignmemory_handle *fmem,
         /* Request for resource size.  Skip mmap(). */
         goto skip_mmap;
 
-    fres->addr = mmap(fres->addr, fres->nr_frames << PAGE_SHIFT,
+    fres->addr = mmap(fres->addr, fres->nr_frames << XC_PAGE_SHIFT,
                       fres->prot, fres->flags | MAP_SHARED, fmem->fd, 0);
     if ( fres->addr == MAP_FAILED )
         return -1;
diff --git a/tools/libs/foreignmemory/linux.c b/tools/libs/foreignmemory/linux.c
index c1f35e2db7..9062117407 100644
--- a/tools/libs/foreignmemory/linux.c
+++ b/tools/libs/foreignmemory/linux.c
@@ -134,7 +134,7 @@ static int retry_paged(int fd, uint32_t dom, void *addr,
         /* At least one gfn is still in paging state */
         ioctlx.num = 1;
         ioctlx.dom = dom;
-        ioctlx.addr = (unsigned long)addr + (i<<PAGE_SHIFT);
+        ioctlx.addr = (unsigned long)addr + (i<<XC_PAGE_SHIFT);
         ioctlx.arr = arr + i;
         ioctlx.err = err + i;
 
@@ -168,7 +168,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
     size_t i;
     int rc;
 
-    addr = mmap(addr, num << PAGE_SHIFT, prot, flags | MAP_SHARED,
+    addr = mmap(addr, num << XC_PAGE_SHIFT, prot, flags | MAP_SHARED,
                 fd, 0);
     if ( addr == MAP_FAILED )
         return NULL;
@@ -198,9 +198,10 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
          */
         privcmd_mmapbatch_t ioctlx;
         xen_pfn_t *pfn;
-        unsigned int pfn_arr_size = ROUNDUP((num * sizeof(*pfn)), PAGE_SHIFT);
+        unsigned int pfn_arr_size = ROUNDUP((num * sizeof(*pfn)), XC_PAGE_SHIFT);
+        int os_page_size = sysconf(_SC_PAGESIZE);
 
-        if ( pfn_arr_size <= PAGE_SIZE )
+        if ( pfn_arr_size <= os_page_size )
             pfn = alloca(num * sizeof(*pfn));
         else
         {
@@ -209,7 +210,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
             if ( pfn == MAP_FAILED )
             {
                 PERROR("mmap of pfn array failed");
-                (void)munmap(addr, num << PAGE_SHIFT);
+                (void)munmap(addr, num << XC_PAGE_SHIFT);
                 return NULL;
             }
         }
@@ -242,7 +243,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                     continue;
                 }
                 rc = map_foreign_batch_single(fd, dom, pfn + i,
-                        (unsigned long)addr + (i<<PAGE_SHIFT));
+                        (unsigned long)addr + (i<<XC_PAGE_SHIFT));
                 if ( rc < 0 )
                 {
                     rc = -errno;
@@ -254,7 +255,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
             break;
         }
 
-        if ( pfn_arr_size > PAGE_SIZE )
+        if ( pfn_arr_size > os_page_size )
             munmap(pfn, pfn_arr_size);
 
         if ( rc == -ENOENT && i == num )
@@ -270,7 +271,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
     {
         int saved_errno = errno;
 
-        (void)munmap(addr, num << PAGE_SHIFT);
+        (void)munmap(addr, num << XC_PAGE_SHIFT);
         errno = saved_errno;
         return NULL;
     }
@@ -281,7 +282,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num)
 {
-    return munmap(addr, num << PAGE_SHIFT);
+    return munmap(addr, num << XC_PAGE_SHIFT);
 }
 
 int osdep_xenforeignmemory_restrict(xenforeignmemory_handle *fmem,
@@ -293,7 +294,7 @@ int osdep_xenforeignmemory_restrict(xenforeignmemory_handle *fmem,
 int osdep_xenforeignmemory_unmap_resource(
     xenforeignmemory_handle *fmem, xenforeignmemory_resource_handle *fres)
 {
-    return fres ? munmap(fres->addr, fres->nr_frames << PAGE_SHIFT) : 0;
+    return fres ? munmap(fres->addr, fres->nr_frames << XC_PAGE_SHIFT) : 0;
 }
 
 int osdep_xenforeignmemory_map_resource(
@@ -312,7 +313,7 @@ int osdep_xenforeignmemory_map_resource(
         /* Request for resource size.  Skip mmap(). */
         goto skip_mmap;
 
-    fres->addr = mmap(fres->addr, fres->nr_frames << PAGE_SHIFT,
+    fres->addr = mmap(fres->addr, fres->nr_frames << XC_PAGE_SHIFT,
                       fres->prot, fres->flags | MAP_SHARED, fmem->fd, 0);
     if ( fres->addr == MAP_FAILED )
         return -1;
diff --git a/tools/libs/foreignmemory/minios.c b/tools/libs/foreignmemory/minios.c
index 43341ca301..c5453736d5 100644
--- a/tools/libs/foreignmemory/minios.c
+++ b/tools/libs/foreignmemory/minios.c
@@ -55,7 +55,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num)
 {
-    return munmap(addr, num << PAGE_SHIFT);
+    return munmap(addr, num << XC_PAGE_SHIFT);
 }
 
 /*
diff --git a/tools/libs/foreignmemory/netbsd.c b/tools/libs/foreignmemory/netbsd.c
index c0b1b8f79d..597db775d7 100644
--- a/tools/libs/foreignmemory/netbsd.c
+++ b/tools/libs/foreignmemory/netbsd.c
@@ -76,7 +76,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
 {
     int fd = fmem->fd;
     privcmd_mmapbatch_v2_t ioctlx;
-    addr = mmap(addr, num * PAGE_SIZE, prot,
+    addr = mmap(addr, num * XC_PAGE_SIZE, prot,
                 flags | MAP_ANON | MAP_SHARED, -1, 0);
     if ( addr == MAP_FAILED ) {
         PERROR("osdep_xenforeignmemory_map: mmap failed");
@@ -93,7 +93,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
     {
         int saved_errno = errno;
         PERROR("osdep_xenforeignmemory_map: ioctl failed");
-        munmap(addr, num * PAGE_SIZE);
+        munmap(addr, num * XC_PAGE_SIZE);
         errno = saved_errno;
         return NULL;
     }
@@ -104,7 +104,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num)
 {
-    return munmap(addr, num * PAGE_SIZE);
+    return munmap(addr, num * XC_PAGE_SIZE);
 }
 
 int osdep_xenforeignmemory_restrict(xenforeignmemory_handle *fmem,
@@ -117,7 +117,7 @@ int osdep_xenforeignmemory_restrict(xenforeignmemory_handle *fmem,
 int osdep_xenforeignmemory_unmap_resource(
     xenforeignmemory_handle *fmem, xenforeignmemory_resource_handle *fres)
 {
-    return fres ? munmap(fres->addr, fres->nr_frames << PAGE_SHIFT) : 0;
+    return fres ? munmap(fres->addr, fres->nr_frames << XC_PAGE_SHIFT) : 0;
 }
 
 int osdep_xenforeignmemory_map_resource(
@@ -136,7 +136,7 @@ int osdep_xenforeignmemory_map_resource(
         /* Request for resource size.  Skip mmap(). */
         goto skip_mmap;
 
-    fres->addr = mmap(fres->addr, fres->nr_frames << PAGE_SHIFT,
+    fres->addr = mmap(fres->addr, fres->nr_frames << XC_PAGE_SHIFT,
                       fres->prot, fres->flags | MAP_ANON | MAP_SHARED, -1, 0);
     if ( fres->addr == MAP_FAILED )
         return -1;
diff --git a/tools/libs/foreignmemory/private.h b/tools/libs/foreignmemory/private.h
index 5bb0cefb09..8540303adc 100644
--- a/tools/libs/foreignmemory/private.h
+++ b/tools/libs/foreignmemory/private.h
@@ -1,6 +1,7 @@
 #ifndef XENFOREIGNMEMORY_PRIVATE_H
 #define XENFOREIGNMEMORY_PRIVATE_H
 
+#include <xenctrl.h>
 #include <xentoollog.h>
 
 #include <xenforeignmemory.h>
@@ -10,14 +11,6 @@
 #include <xen/xen.h>
 #include <xen/sys/privcmd.h>
 
-#ifndef PAGE_SHIFT /* Mini-os, Yukk */
-#define PAGE_SHIFT           12
-#endif
-#ifndef __MINIOS__ /* Yukk */
-#define PAGE_SIZE            (1UL << PAGE_SHIFT)
-#define PAGE_MASK            (~(PAGE_SIZE-1))
-#endif
-
 struct xenforeignmemory_handle {
     xentoollog_logger *logger, *logger_tofree;
     unsigned flags;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:46:36 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:46:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158878.292304 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rx5-0004dA-O9; Tue, 20 Jul 2021 15:46:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158878.292304; Tue, 20 Jul 2021 15:46:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rx5-0004d2-Kc; Tue, 20 Jul 2021 15:46:35 +0000
Received: by outflank-mailman (input) for mailman id 158878;
 Tue, 20 Jul 2021 15:46:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rx3-0004cq-Nk
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:46:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rx3-0004NP-Mx
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:46:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rx3-0001LF-MP
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:46: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=POKIRlet3CHeZGnlwGVtphiqjcBySGhImVtBP5rYEu8=; b=GfXs0kk3CTU+KjfpR2lExpsvPz
	njEbrLGJLul3c1MsKIyt7icd4wEnUJI5sLiIOUA8GMZq3uqGHRwKs9SJwtHQ+LGXflo6lDMGIN9Gb
	F6PapHtkVZ8leYczw62z7lHwUW8eRd5v+rAlaBzMDdtUv3y2JesUYxT0Mi8eEmhfSl4M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libs/gnttab: Fix PAGE_SIZE redefinition error
Message-Id: <E1m5rx3-0001LF-MP@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:46:33 +0000

commit d1b32abd94b620db05dfff0f4ce9cc17b9da0ccf
Author:     Costin Lupu <costin.lupu@cs.pub.ro>
AuthorDate: Tue Jun 8 15:35:28 2021 +0300
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Jul 9 16:00:05 2021 +0100

    tools/libs/gnttab: Fix PAGE_SIZE redefinition error
    
    If PAGE_SIZE is already defined in the system (e.g. in /usr/include/limits.h
    header) then gcc will trigger a redefinition error because of -Werror. This
    patch replaces usage of PAGE_* macros with XC_PAGE_* macros in order to avoid
    confusion between control domain page granularity (PAGE_* definitions) and
    guest domain page granularity.
    
    The exception is in osdep_xenforeignmemory_map() where we need the system page
    size to check whether the PFN array should be allocated with mmap() or with
    dynamic allocation.
    
    Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libs/gnttab/freebsd.c | 28 +++++++++++++---------------
 tools/libs/gnttab/linux.c   | 28 +++++++++++++---------------
 tools/libs/gnttab/netbsd.c  | 23 ++++++++++-------------
 3 files changed, 36 insertions(+), 43 deletions(-)

diff --git a/tools/libs/gnttab/freebsd.c b/tools/libs/gnttab/freebsd.c
index 768af701c6..e42ac3fbf3 100644
--- a/tools/libs/gnttab/freebsd.c
+++ b/tools/libs/gnttab/freebsd.c
@@ -30,14 +30,11 @@
 
 #include <xen/sys/gntdev.h>
 
+#include <xenctrl.h>
 #include <xen-tools/libs.h>
 
 #include "private.h"
 
-#define PAGE_SHIFT           12
-#define PAGE_SIZE            (1UL << PAGE_SHIFT)
-#define PAGE_MASK            (~(PAGE_SIZE-1))
-
 #define DEVXEN "/dev/xen/gntdev"
 
 int osdep_gnttab_open(xengnttab_handle *xgt)
@@ -77,10 +74,11 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
     int domids_stride;
     unsigned int refs_size = ROUNDUP(count *
                                      sizeof(struct ioctl_gntdev_grant_ref),
-                                     PAGE_SHIFT);
+                                     XC_PAGE_SHIFT);
+    int os_page_size = getpagesize();
 
     domids_stride = (flags & XENGNTTAB_GRANT_MAP_SINGLE_DOMAIN) ? 0 : 1;
-    if ( refs_size <= PAGE_SIZE )
+    if ( refs_size <= os_page_size )
         map.refs = malloc(refs_size);
     else
     {
@@ -107,7 +105,7 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
         goto out;
     }
 
-    addr = mmap(NULL, PAGE_SIZE * count, prot, MAP_SHARED, fd,
+    addr = mmap(NULL, XC_PAGE_SIZE * count, prot, MAP_SHARED, fd,
                 map.index);
     if ( addr != MAP_FAILED )
     {
@@ -116,7 +114,7 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
 
         notify.index = map.index;
         notify.action = 0;
-        if ( notify_offset < PAGE_SIZE * count )
+        if ( notify_offset < XC_PAGE_SIZE * count )
         {
             notify.index += notify_offset;
             notify.action |= UNMAP_NOTIFY_CLEAR_BYTE;
@@ -131,7 +129,7 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
         if ( rv )
         {
             GTERROR(xgt->logger, "ioctl SET_UNMAP_NOTIFY failed");
-            munmap(addr, count * PAGE_SIZE);
+            munmap(addr, count * XC_PAGE_SIZE);
             addr = MAP_FAILED;
         }
     }
@@ -150,7 +148,7 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
     }
 
  out:
-    if ( refs_size > PAGE_SIZE )
+    if ( refs_size > os_page_size )
         munmap(map.refs, refs_size);
     else
         free(map.refs);
@@ -189,7 +187,7 @@ int osdep_gnttab_unmap(xengnttab_handle *xgt,
     }
 
     /* Next, unmap the memory. */
-    if ( (rc = munmap(start_address, count * PAGE_SIZE)) )
+    if ( (rc = munmap(start_address, count * XC_PAGE_SIZE)) )
         return rc;
 
     /* Finally, unmap the driver slots used to store the grant information. */
@@ -256,7 +254,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
         goto out;
     }
 
-    area = mmap(NULL, count * PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED,
+    area = mmap(NULL, count * XC_PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED,
                 fd, gref_info.index);
 
     if ( area == MAP_FAILED )
@@ -268,7 +266,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
 
     notify.index = gref_info.index;
     notify.action = 0;
-    if ( notify_offset < PAGE_SIZE * count )
+    if ( notify_offset < XC_PAGE_SIZE * count )
     {
         notify.index += notify_offset;
         notify.action |= UNMAP_NOTIFY_CLEAR_BYTE;
@@ -283,7 +281,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
     if ( err )
     {
         GSERROR(xgs->logger, "ioctl SET_UNMAP_NOTIFY failed");
-        munmap(area, count * PAGE_SIZE);
+        munmap(area, count * XC_PAGE_SIZE);
         area = NULL;
     }
 
@@ -306,7 +304,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
 int osdep_gntshr_unshare(xengntshr_handle *xgs,
                          void *start_address, uint32_t count)
 {
-    return munmap(start_address, count * PAGE_SIZE);
+    return munmap(start_address, count * XC_PAGE_SIZE);
 }
 
 /*
diff --git a/tools/libs/gnttab/linux.c b/tools/libs/gnttab/linux.c
index 74331a4c7b..5628fd5719 100644
--- a/tools/libs/gnttab/linux.c
+++ b/tools/libs/gnttab/linux.c
@@ -32,14 +32,11 @@
 #include <xen/sys/gntdev.h>
 #include <xen/sys/gntalloc.h>
 
+#include <xenctrl.h>
 #include <xen-tools/libs.h>
 
 #include "private.h"
 
-#define PAGE_SHIFT           12
-#define PAGE_SIZE            (1UL << PAGE_SHIFT)
-#define PAGE_MASK            (~(PAGE_SIZE-1))
-
 #define DEVXEN "/dev/xen/"
 
 #ifndef O_CLOEXEC
@@ -92,6 +89,7 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
     int fd = xgt->fd;
     struct ioctl_gntdev_map_grant_ref *map;
     unsigned int map_size = sizeof(*map) + (count - 1) * sizeof(map->refs[0]);
+    int os_page_size = sysconf(_SC_PAGESIZE);
     void *addr = NULL;
     int domids_stride = 1;
     int i;
@@ -99,11 +97,11 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
     if (flags & XENGNTTAB_GRANT_MAP_SINGLE_DOMAIN)
         domids_stride = 0;
 
-    if ( map_size <= PAGE_SIZE )
+    if ( map_size <= os_page_size )
         map = alloca(map_size);
     else
     {
-        map_size = ROUNDUP(map_size, PAGE_SHIFT);
+        map_size = ROUNDUP(map_size, XC_PAGE_SHIFT);
         map = mmap(NULL, map_size, PROT_READ | PROT_WRITE,
                    MAP_PRIVATE | MAP_ANON | MAP_POPULATE, -1, 0);
         if ( map == MAP_FAILED )
@@ -127,7 +125,7 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
     }
 
  retry:
-    addr = mmap(NULL, PAGE_SIZE * count, prot, MAP_SHARED, fd,
+    addr = mmap(NULL, XC_PAGE_SIZE * count, prot, MAP_SHARED, fd,
                 map->index);
 
     if (addr == MAP_FAILED && errno == EAGAIN)
@@ -152,7 +150,7 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
         struct ioctl_gntdev_unmap_notify notify;
         notify.index = map->index;
         notify.action = 0;
-        if (notify_offset < PAGE_SIZE * count) {
+        if (notify_offset < XC_PAGE_SIZE * count) {
             notify.index += notify_offset;
             notify.action |= UNMAP_NOTIFY_CLEAR_BYTE;
         }
@@ -164,7 +162,7 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
             rv = ioctl(fd, IOCTL_GNTDEV_SET_UNMAP_NOTIFY, &notify);
         if (rv) {
             GTERROR(xgt->logger, "ioctl SET_UNMAP_NOTIFY failed");
-            munmap(addr, count * PAGE_SIZE);
+            munmap(addr, count * XC_PAGE_SIZE);
             addr = MAP_FAILED;
         }
     }
@@ -184,7 +182,7 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
     }
 
  out:
-    if ( map_size > PAGE_SIZE )
+    if ( map_size > os_page_size )
         munmap(map, map_size);
 
     return addr;
@@ -220,7 +218,7 @@ int osdep_gnttab_unmap(xengnttab_handle *xgt,
     }
 
     /* Next, unmap the memory. */
-    if ( (rc = munmap(start_address, count * PAGE_SIZE)) )
+    if ( (rc = munmap(start_address, count * XC_PAGE_SIZE)) )
         return rc;
 
     /* Finally, unmap the driver slots used to store the grant information. */
@@ -466,7 +464,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
         goto out;
     }
 
-    area = mmap(NULL, count * PAGE_SIZE, PROT_READ | PROT_WRITE,
+    area = mmap(NULL, count * XC_PAGE_SIZE, PROT_READ | PROT_WRITE,
         MAP_SHARED, fd, gref_info->index);
 
     if (area == MAP_FAILED) {
@@ -477,7 +475,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
 
     notify.index = gref_info->index;
     notify.action = 0;
-    if (notify_offset < PAGE_SIZE * count) {
+    if (notify_offset < XC_PAGE_SIZE * count) {
         notify.index += notify_offset;
         notify.action |= UNMAP_NOTIFY_CLEAR_BYTE;
     }
@@ -489,7 +487,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
         err = ioctl(fd, IOCTL_GNTALLOC_SET_UNMAP_NOTIFY, &notify);
     if (err) {
         GSERROR(xgs->logger, "ioctl SET_UNMAP_NOTIFY failed");
-        munmap(area, count * PAGE_SIZE);
+        munmap(area, count * XC_PAGE_SIZE);
         area = NULL;
     }
 
@@ -510,7 +508,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
 int osdep_gntshr_unshare(xengntshr_handle *xgs,
                          void *start_address, uint32_t count)
 {
-    return munmap(start_address, count * PAGE_SIZE);
+    return munmap(start_address, count * XC_PAGE_SIZE);
 }
 
 /*
diff --git a/tools/libs/gnttab/netbsd.c b/tools/libs/gnttab/netbsd.c
index f8d7c356eb..a4ad624b54 100644
--- a/tools/libs/gnttab/netbsd.c
+++ b/tools/libs/gnttab/netbsd.c
@@ -28,15 +28,12 @@
 #include <sys/ioctl.h>
 #include <sys/mman.h>
 
+#include <xenctrl.h>
 #include <xen/xen.h>
 #include <xen/xenio.h>
 
 #include "private.h"
 
-#define PAGE_SHIFT           12
-#define PAGE_SIZE            (1UL << PAGE_SHIFT)
-#define PAGE_MASK            (~(PAGE_SIZE-1))
-
 #define DEVXEN "/kern/xen/privcmd"
 
 int osdep_gnttab_open(xengnttab_handle *xgt)
@@ -87,19 +84,19 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
     }
 
     map.count = count;
-    addr = mmap(NULL, count * PAGE_SIZE,
+    addr = mmap(NULL, count * XC_PAGE_SIZE,
                 prot, flags | MAP_ANON | MAP_SHARED, -1, 0);
     if ( map.va == MAP_FAILED )
     {
         GTERROR(xgt->logger, "osdep_gnttab_grant_map: mmap failed");
-        munmap((void *)map.va, count * PAGE_SIZE);
+        munmap((void *)map.va, count * XC_PAGE_SIZE);
         addr = MAP_FAILED;
     }
     map.va = addr;
 
     map.notify.offset = 0;
     map.notify.action = 0;
-    if ( notify_offset < PAGE_SIZE * count )
+    if ( notify_offset < XC_PAGE_SIZE * count )
     {
         map.notify.offset = notify_offset;
         map.notify.action |= UNMAP_NOTIFY_CLEAR_BYTE;
@@ -115,7 +112,7 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
     {
         GTERROR(xgt->logger,
             "ioctl IOCTL_GNTDEV_MMAP_GRANT_REF failed: %d", rv);
-        munmap(addr, count * PAGE_SIZE);
+        munmap(addr, count * XC_PAGE_SIZE);
         addr = MAP_FAILED;
     }
 
@@ -136,7 +133,7 @@ int osdep_gnttab_unmap(xengnttab_handle *xgt,
     }
 
     /* Next, unmap the memory. */
-    rc = munmap(start_address, count * PAGE_SIZE);
+    rc = munmap(start_address, count * XC_PAGE_SIZE);
 
     return rc;
 }
@@ -187,7 +184,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
     alloc.domid = domid;
     alloc.flags = writable ? GNTDEV_ALLOC_FLAG_WRITABLE : 0;
     alloc.count = count;
-    area = mmap(NULL, count * PAGE_SIZE,
+    area = mmap(NULL, count * XC_PAGE_SIZE,
                 PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0);
 
     if ( area == MAP_FAILED )
@@ -200,7 +197,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
 
     alloc.notify.offset = 0;
     alloc.notify.action = 0;
-    if ( notify_offset < PAGE_SIZE * count )
+    if ( notify_offset < XC_PAGE_SIZE * count )
     {
         alloc.notify.offset = notify_offset;
         alloc.notify.action |= UNMAP_NOTIFY_CLEAR_BYTE;
@@ -215,7 +212,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
     if ( err )
     {
         GSERROR(xgs->logger, "IOCTL_GNTDEV_ALLOC_GRANT_REF failed");
-        munmap(area, count * PAGE_SIZE);
+        munmap(area, count * XC_PAGE_SIZE);
         area = MAP_FAILED;
         goto out;
     }
@@ -230,7 +227,7 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
 int osdep_gntshr_unshare(xengntshr_handle *xgs,
                          void *start_address, uint32_t count)
 {
-    return munmap(start_address, count * PAGE_SIZE);
+    return munmap(start_address, count * XC_PAGE_SIZE);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:46:45 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:46:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158879.292308 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rxF-0004gD-R7; Tue, 20 Jul 2021 15:46:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158879.292308; Tue, 20 Jul 2021 15:46:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rxF-0004g5-OC; Tue, 20 Jul 2021 15:46:45 +0000
Received: by outflank-mailman (input) for mailman id 158879;
 Tue, 20 Jul 2021 15:46:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rxD-0004fc-R1
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:46:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rxD-0004Na-QD
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:46:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rxD-0001Li-PW
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:46: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5UiaHVf//pFjdLLEQ1zGGawH7Z7CxS7Og+923QBebTc=; b=BqePGvvJU/z+EIr/CXslh5+/2l
	eISpT4L/swR2iTRAVy9n2a085X8pa7b4Y+uM3OUv05AGq3aWfJI6lz1xWsfWZ+HXURArrCOvf2skT
	+ypPr1HjfZxuBeU/zDqIwKD51+14y1T1uRzTWlX7hPIz38Yix+QlcoGX8DGgJ1JtQL7k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/ocaml: Fix redefinition errors
Message-Id: <E1m5rxD-0001Li-PW@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:46:43 +0000

commit 2d1a35f1e6c2113a6322fdb758a198608c90e4bd
Author:     Costin Lupu <costin.lupu@cs.pub.ro>
AuthorDate: Tue Jun 8 15:35:29 2021 +0300
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Jul 9 16:00:09 2021 +0100

    tools/ocaml: Fix redefinition errors
    
    If PAGE_SIZE is already defined in the system (e.g. in /usr/include/limits.h
    header) then gcc will trigger a redefinition error because of -Werror. This
    patch replaces usage of PAGE_* macros with XC_PAGE_* macros in order to avoid
    confusion between control domain page granularity (PAGE_* definitions) and
    guest domain page granularity (which is what we are dealing with here).
    
    Same issue applies for redefinitions of Val_none and Some_val macros which
    can be already define in the OCaml system headers (e.g.
    /usr/lib/ocaml/caml/mlvalues.h).
    
    Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
    Tested-by: Dario Faggioli <dfaggioli@suse.com>
---
 tools/ocaml/libs/xc/xenctrl_stubs.c            | 10 ++++------
 tools/ocaml/libs/xentoollog/xentoollog_stubs.c |  4 ++++
 tools/ocaml/libs/xl/xenlight_stubs.c           |  4 ++++
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 6e4bc567f5..a6756c4a8c 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -37,14 +37,12 @@
 
 #include "mmap_stubs.h"
 
-#define PAGE_SHIFT		12
-#define PAGE_SIZE               (1UL << PAGE_SHIFT)
-#define PAGE_MASK               (~(PAGE_SIZE-1))
-
 #define _H(__h) ((xc_interface *)(__h))
 #define _D(__d) ((uint32_t)Int_val(__d))
 
+#ifndef Val_none
 #define Val_none (Val_int(0))
+#endif
 
 #define string_of_option_array(array, index) \
 	((Field(array, index) == Val_none) ? NULL : String_val(Field(Field(array, index), 0)))
@@ -819,7 +817,7 @@ CAMLprim value stub_xc_domain_memory_increase_reservation(value xch,
 	CAMLparam3(xch, domid, mem_kb);
 	int retval;
 
-	unsigned long nr_extents = ((unsigned long)(Int64_val(mem_kb))) >> (PAGE_SHIFT - 10);
+	unsigned long nr_extents = ((unsigned long)(Int64_val(mem_kb))) >> (XC_PAGE_SHIFT - 10);
 
 	uint32_t c_domid = _D(domid);
 	caml_enter_blocking_section();
@@ -925,7 +923,7 @@ CAMLprim value stub_pages_to_kib(value pages)
 {
 	CAMLparam1(pages);
 
-	CAMLreturn(caml_copy_int64(Int64_val(pages) << (PAGE_SHIFT - 10)));
+	CAMLreturn(caml_copy_int64(Int64_val(pages) << (XC_PAGE_SHIFT - 10)));
 }
 
 
diff --git a/tools/ocaml/libs/xentoollog/xentoollog_stubs.c b/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
index bf64b211c2..e4306a0c2f 100644
--- a/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
+++ b/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
@@ -53,8 +53,12 @@ static char * dup_String_val(value s)
 #include "_xtl_levels.inc"
 
 /* Option type support as per http://www.linux-nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php */
+#ifndef Val_none
 #define Val_none Val_int(0)
+#endif
+#ifndef Some_val
 #define Some_val(v) Field(v,0)
+#endif
 
 static value Val_some(value v)
 {
diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index 352a00134d..45b8af61c7 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -227,8 +227,12 @@ static value Val_string_list(libxl_string_list *c_val)
 }
 
 /* Option type support as per http://www.linux-nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php */
+#ifndef Val_none
 #define Val_none Val_int(0)
+#endif
+#ifndef Some_val
 #define Some_val(v) Field(v,0)
+#endif
 
 static value Val_some(value v)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:46:54 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:46:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158880.292313 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rxO-0004ip-Sr; Tue, 20 Jul 2021 15:46:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158880.292313; Tue, 20 Jul 2021 15:46:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rxO-0004iY-Ph; Tue, 20 Jul 2021 15:46:54 +0000
Received: by outflank-mailman (input) for mailman id 158880;
 Tue, 20 Jul 2021 15:46:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rxN-0004iN-Tx
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:46:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rxN-0004No-T3
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:46:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rxN-0001MV-SQ
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:46: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lvWDLnfkt3KEGZY4R+CWe7DCdU43Z4PiR6vaUpQeWCU=; b=v47alSZdPy9z2K603OsfpSISUm
	/2PwnCr3TflCLKY/ER4iVu4Q5gV3xrQ3YDq2xF9wD4Dl/3JEx210o7Oqfa6OlLsUOcJulLCoGWijM
	vqoEBIqjmNBo9VGdHdTBE9GnfkkXCg/hRJogmH18aKFazOHXLwtcpaCbNeV8/ozf9KEI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: add meson and ninja to tumbleweed container
Message-Id: <E1m5rxN-0001MV-SQ@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:46:53 +0000

commit 303c857a2701fe7c180744faca3507efd3edbb1d
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Jul 9 16:06:53 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 16:06:03 2021 +0100

    automation: add meson and ninja to tumbleweed container
    
    qemu uses meson as for configuration, and requires ninja for building.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/build/suse/opensuse-tumbleweed.dockerfile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/automation/build/suse/opensuse-tumbleweed.dockerfile b/automation/build/suse/opensuse-tumbleweed.dockerfile
index 3965e7f9cd..be5ddb0d98 100644
--- a/automation/build/suse/opensuse-tumbleweed.dockerfile
+++ b/automation/build/suse/opensuse-tumbleweed.dockerfile
@@ -48,8 +48,10 @@ RUN zypper install -y --no-recommends \
         libzstd-devel \
         lzo-devel \
         make \
+        meson \
         nasm \
         ncurses-devel \
+        ninja \
         ocaml \
         ocaml-findlib-devel \
         ocaml-ocamlbuild \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:47:04 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:47:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158881.292317 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rxY-0004mR-U9; Tue, 20 Jul 2021 15:47:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158881.292317; Tue, 20 Jul 2021 15:47:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rxY-0004mJ-RB; Tue, 20 Jul 2021 15:47:04 +0000
Received: by outflank-mailman (input) for mailman id 158881;
 Tue, 20 Jul 2021 15:47:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rxY-0004m4-0Z
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:47:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rxX-0004OV-Vz
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:47:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rxX-0001NG-VJ
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3tpTZ6utJCZGudAY5VYgK90ePbnihbTQZgIRhIAL+vA=; b=ac1sLTmYoEkaIfEm6ZID6hVgKk
	ccLnGGccwpJAY3/smo1tX1uKbLsdNbEPZZK6VMwtqLHSqjRGnpvM+llALpgl4LClLby9vHjfXH76L
	Dzdjg0wFZTXpnlkygawAmBOPM2MxHqXONDZNK9PZ7Q4lKznggCNTWLmxS2XEXyS/JgkU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: provide SDL and SDL2 in opensuse images
Message-Id: <E1m5rxX-0001NG-VJ@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:47:03 +0000

commit 4ad75403625111bdd60571c3caaaefd3a84c574e
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Jul 9 16:32:47 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 16:06:03 2021 +0100

    automation: provide SDL and SDL2 in opensuse images
    
    qemu-xen-traditional may make use of SDL, qemu-xen may make use of SDL2.
    Use pkgconfig() as resolvable instead of a rpm name, the latter may change.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/build/suse/opensuse-leap.dockerfile       | 3 ++-
 automation/build/suse/opensuse-tumbleweed.dockerfile | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/automation/build/suse/opensuse-leap.dockerfile b/automation/build/suse/opensuse-leap.dockerfile
index 03f8a7acad..2f92392d76 100644
--- a/automation/build/suse/opensuse-leap.dockerfile
+++ b/automation/build/suse/opensuse-leap.dockerfile
@@ -31,7 +31,6 @@ RUN zypper install -y --no-recommends \
         glibc-devel-32bit \
         gzip \
         hostname \
-        libSDL2-devel \
         libaio-devel \
         libbz2-devel \
         libext2fs-devel \
@@ -56,6 +55,8 @@ RUN zypper install -y --no-recommends \
         pandoc \
         patch \
         pkg-config \
+        'pkgconfig(sdl)' \
+        'pkgconfig(sdl2)' \
         python \
         python-devel \
         python3-devel \
diff --git a/automation/build/suse/opensuse-tumbleweed.dockerfile b/automation/build/suse/opensuse-tumbleweed.dockerfile
index be5ddb0d98..ed10cd8a22 100644
--- a/automation/build/suse/opensuse-tumbleweed.dockerfile
+++ b/automation/build/suse/opensuse-tumbleweed.dockerfile
@@ -31,7 +31,6 @@ RUN zypper install -y --no-recommends \
         glibc-devel-32bit \
         gzip \
         hostname \
-        libSDL2-devel \
         libaio-devel \
         libbz2-devel \
         libext2fs-devel \
@@ -59,6 +58,8 @@ RUN zypper install -y --no-recommends \
         pandoc \
         patch \
         pkg-config \
+        'pkgconfig(sdl)' \
+        'pkgconfig(sdl2)' \
         python-devel \
         python3-devel \
         systemd-devel \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:47:15 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:47:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158882.292321 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rxi-0004p7-Vl; Tue, 20 Jul 2021 15:47:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158882.292321; Tue, 20 Jul 2021 15:47:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rxi-0004oz-St; Tue, 20 Jul 2021 15:47:14 +0000
Received: by outflank-mailman (input) for mailman id 158882;
 Tue, 20 Jul 2021 15:47:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rxi-0004os-3Y
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:47:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rxi-0004Og-2h
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:47:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rxi-0001OQ-23
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:47: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=A3a9fKgIEF4pNGq6MgswuXIkZ1V+6l6vXwr/VJ8Dr68=; b=TZcspSkii0J+1tyM39fLWNLrjY
	JgsEevn6ZnVreGPGozjl3/zjp6nGbLz3FgP0FXROiernYHo6+mThqObHCwjVu6L1ei8LsqTY7i9Nz
	z326zrMNL15dtJ1fkRgprrFMAgEQePjZfHWWEwzkTucdSzsc2iKkec9QTin7z5m8XyJI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: provide pciutils in opensuse packages
Message-Id: <E1m5rxi-0001OQ-23@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:47:14 +0000

commit e6917412628d11986f0e6fc028851c8181b24fb8
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Jul 9 16:32:48 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 16:06:03 2021 +0100

    automation: provide pciutils in opensuse packages
    
    qemu-xen-traditional may make use of pciutils-devel, for PCI passthrough.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/build/suse/opensuse-leap.dockerfile       | 1 +
 automation/build/suse/opensuse-tumbleweed.dockerfile | 1 +
 2 files changed, 2 insertions(+)

diff --git a/automation/build/suse/opensuse-leap.dockerfile b/automation/build/suse/opensuse-leap.dockerfile
index 2f92392d76..5e8111f40b 100644
--- a/automation/build/suse/opensuse-leap.dockerfile
+++ b/automation/build/suse/opensuse-leap.dockerfile
@@ -55,6 +55,7 @@ RUN zypper install -y --no-recommends \
         pandoc \
         patch \
         pkg-config \
+        'pkgconfig(libpci)' \
         'pkgconfig(sdl)' \
         'pkgconfig(sdl2)' \
         python \
diff --git a/automation/build/suse/opensuse-tumbleweed.dockerfile b/automation/build/suse/opensuse-tumbleweed.dockerfile
index ed10cd8a22..b165c48245 100644
--- a/automation/build/suse/opensuse-tumbleweed.dockerfile
+++ b/automation/build/suse/opensuse-tumbleweed.dockerfile
@@ -58,6 +58,7 @@ RUN zypper install -y --no-recommends \
         pandoc \
         patch \
         pkg-config \
+        'pkgconfig(libpci)' \
         'pkgconfig(sdl)' \
         'pkgconfig(sdl2)' \
         python-devel \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:47:25 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:47:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158883.292324 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rxt-0004rm-13; Tue, 20 Jul 2021 15:47:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158883.292324; Tue, 20 Jul 2021 15:47:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rxs-0004re-UL; Tue, 20 Jul 2021 15:47:24 +0000
Received: by outflank-mailman (input) for mailman id 158883;
 Tue, 20 Jul 2021 15:47:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rxs-0004rU-6X
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:47:24 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rxs-0004Or-5e
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:47:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rxs-0001P7-4w
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:47: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kOA4MOcj5FNgu6KzDZ0mxpxDQitd0PAaLkBSqQCec+Y=; b=HnVj4vG/kV0t3a5c7NKYca0fBC
	XPhq8Hr2NnSo8+xjVnvwNrmzCU5Ufu4NCOi9YdEpWthpRI0Rj/SKKulAqqwF2MSSmHl77J6j4m6hE
	MYZ/NmZCgZ6P9aD/mFqWzbAz3/lYu5Z7YLJNeNJqmA0AvKJ0a5IlRHg9zyuSjI/SVgqQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/misc/xen-vmtrace: handle more signals and install by default
Message-Id: <E1m5rxs-0001P7-4w@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:47:24 +0000

commit 2c7242bb2a11c027921b7f153841e59457edacc3
Author:     Tamas K Lengyel <tamas@tklengyel.com>
AuthorDate: Fri May 7 11:28:36 2021 -0400
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 16:38:25 2021 +0100

    tools/misc/xen-vmtrace: handle more signals and install by default
    
    Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/misc/Makefile      |  2 +-
 tools/misc/xen-vmtrace.c | 12 +++++++++---
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index 2b683819d4..c32c42d546 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -25,6 +25,7 @@ INSTALL_SBIN-$(CONFIG_X86)     += xen-lowmemd
 INSTALL_SBIN-$(CONFIG_X86)     += xen-memshare
 INSTALL_SBIN-$(CONFIG_X86)     += xen-mfndump
 INSTALL_SBIN-$(CONFIG_X86)     += xen-ucode
+INSTALL_SBIN-$(CONFIG_X86)     += xen-vmtrace
 INSTALL_SBIN                   += xencov
 INSTALL_SBIN                   += xenhypfs
 INSTALL_SBIN                   += xenlockprof
@@ -51,7 +52,6 @@ TARGETS_COPY += xenpvnetboot
 TARGETS_BUILD := $(filter-out $(TARGETS_COPY),$(TARGETS_ALL))
 
 # ... including build-only targets
-TARGETS_BUILD-$(CONFIG_X86)    += xen-vmtrace
 TARGETS_BUILD += $(TARGETS_BUILD-y)
 
 .PHONY: all build
diff --git a/tools/misc/xen-vmtrace.c b/tools/misc/xen-vmtrace.c
index 35d14c6a9b..5b688a54af 100644
--- a/tools/misc/xen-vmtrace.c
+++ b/tools/misc/xen-vmtrace.c
@@ -44,7 +44,7 @@ static size_t size;
 static char *buf;
 
 static sig_atomic_t interrupted;
-static void int_handler(int signum)
+static void close_handler(int signum)
 {
     interrupted = 1;
 }
@@ -78,8 +78,14 @@ int main(int argc, char **argv)
     int rc, exit = 1;
     xenforeignmemory_resource_handle *fres = NULL;
 
-    if ( signal(SIGINT, int_handler) == SIG_ERR )
-        err(1, "Failed to register signal handler\n");
+    struct sigaction act;
+    act.sa_handler = close_handler;
+    act.sa_flags = 0;
+    sigemptyset(&act.sa_mask);
+    sigaction(SIGHUP,  &act, NULL);
+    sigaction(SIGTERM, &act, NULL);
+    sigaction(SIGINT,  &act, NULL);
+    sigaction(SIGALRM, &act, NULL);
 
     if ( argc != 3 )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:47:35 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:47:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158884.292328 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5ry3-0004uU-2z; Tue, 20 Jul 2021 15:47:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158884.292328; Tue, 20 Jul 2021 15:47:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5ry2-0004uN-Vw; Tue, 20 Jul 2021 15:47:34 +0000
Received: by outflank-mailman (input) for mailman id 158884;
 Tue, 20 Jul 2021 15:47:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ry2-0004u9-9c
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:47:34 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ry2-0004P6-8k
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:47:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ry2-0001Pk-8B
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:47: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3DAz1hNUEzUGKKXzrgxFPIjTtnLzYs3QOlgq6hp7Pvc=; b=HvQX3oUJXCWAt06C1a1cYWat5Q
	iRhhuYqquMuBHQtMyLyfWq1YvEWBoCUX6chXEAp+wUFLQjjdE4WQLrKn9FpgojxaryFrJjYinB9OP
	UTtt1zaIob4kvJhPraeAqoAW7lvOq1XVwosu/6pKNopohh2qJm+Xd2pXR/WmA6ExGfJo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/tests: Drop obsolete mce-test infrastructure
Message-Id: <E1m5ry2-0001Pk-8B@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:47:34 +0000

commit 79ca512a1fa68e0170a85cb71b8a8e8f4a34fb11
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 15 14:19:15 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 16:38:27 2021 +0100

    tools/tests: Drop obsolete mce-test infrastructure
    
    mce-test has a test suite, but it depends on xend, needs to run in-tree, and
    requires manual setup of at least one guest, and manual parameters to pass
    into cases.  Drop the test infrasturcture.
    
    Move the one useful remaining item, xen-mceinj, into misc/, fixing some minor
    style issues as it goes.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 .gitignore                                         |   1 -
 tools/misc/.gitignore                              |   1 +
 tools/misc/Makefile                                |   4 +
 tools/misc/xen-mceinj.c                            | 551 +++++++++++++++++++++
 tools/tests/Makefile                               |   1 -
 tools/tests/mce-test/Makefile                      |  12 -
 tools/tests/mce-test/README                        |  75 ---
 tools/tests/mce-test/cases/srao_llc/dom0/cases.sh  |  73 ---
 tools/tests/mce-test/cases/srao_llc/guest/cases.sh |  94 ----
 tools/tests/mce-test/cases/srao_llc/xen/cases.sh   |  69 ---
 tools/tests/mce-test/cases/srao_mem/dom0/cases.sh  |  73 ---
 tools/tests/mce-test/cases/srao_mem/guest/cases.sh |  94 ----
 tools/tests/mce-test/cases/srao_mem/xen/cases.sh   |  69 ---
 tools/tests/mce-test/cases/ucna_llc/dom0/cases.sh  |  72 ---
 tools/tests/mce-test/cases/ucna_llc/guest/cases.sh |  92 ----
 tools/tests/mce-test/cases/ucna_llc/xen/cases.sh   |  68 ---
 tools/tests/mce-test/config/setup.conf             |  24 -
 tools/tests/mce-test/lib/xen-mceinj-tool.sh        | 260 ----------
 tools/tests/mce-test/tools/Makefile                |  24 -
 tools/tests/mce-test/tools/README                  |  24 -
 tools/tests/mce-test/tools/xen-mceinj.c            | 545 --------------------
 21 files changed, 556 insertions(+), 1670 deletions(-)

diff --git a/.gitignore b/.gitignore
index 38a085e398..d4b90303b2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -276,7 +276,6 @@ tools/tests/x86_emulator/test_x86_emulator
 tools/tests/x86_emulator/x86_emulate
 tools/tests/x86_emulator/xop*.[ch]
 tools/tests/xenstore/xs-test
-tools/tests/mce-test/tools/xen-mceinj
 tools/tests/vpci/list.h
 tools/tests/vpci/vpci.[hc]
 tools/tests/vpci/test_vpci
diff --git a/tools/misc/.gitignore b/tools/misc/.gitignore
index ce6f937d0c..73ce95e6d7 100644
--- a/tools/misc/.gitignore
+++ b/tools/misc/.gitignore
@@ -1,4 +1,5 @@
 xen-access
+xen-mceinj
 xen-memshare
 xen-ucode
 xen-vmtrace
diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index c32c42d546..8b9558b93f 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -22,6 +22,7 @@ INSTALL_SBIN-$(CONFIG_MIGRATE) += xen-hptool
 INSTALL_SBIN-$(CONFIG_X86)     += xen-hvmcrash
 INSTALL_SBIN-$(CONFIG_X86)     += xen-hvmctx
 INSTALL_SBIN-$(CONFIG_X86)     += xen-lowmemd
+INSTALL_SBIN-$(CONFIG_X86)     += xen-mceinj
 INSTALL_SBIN-$(CONFIG_X86)     += xen-memshare
 INSTALL_SBIN-$(CONFIG_X86)     += xen-mfndump
 INSTALL_SBIN-$(CONFIG_X86)     += xen-ucode
@@ -97,6 +98,9 @@ xen-memshare: xen-memshare.o
 xen-vmtrace: xen-vmtrace.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(LDLIBS_libxenforeignmemory) $(APPEND_LDFLAGS)
 
+xen-mceinj: xen-mceinj.o
+	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) $(APPEND_LDFLAGS)
+
 xenperf: xenperf.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
diff --git a/tools/misc/xen-mceinj.c b/tools/misc/xen-mceinj.c
new file mode 100644
index 0000000000..df55eefbac
--- /dev/null
+++ b/tools/misc/xen-mceinj.c
@@ -0,0 +1,551 @@
+/*
+ * xen-mceinj.c: utilities to inject fake MCE for x86.
+ * Copyright (c) 2010, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Yunhong Jiang <yunhong.jiang@intel.com>
+ *          Haicheng Li <haicheng.li@intel.com>
+ *          Xudong Hao <xudong.hao@intel.com>
+ */
+
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <getopt.h>
+#include <errno.h>
+#include <signal.h>
+#include <stdarg.h>
+
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
+#include <xenctrl.h>
+#include <xenguest.h>
+#include <inttypes.h>
+#include <sys/time.h>
+#include <xen/arch-x86/xen-mca.h>
+#include <xenstore.h>
+
+#define MCi_type_CTL        0x0
+#define MCi_type_STATUS     0x1
+#define MCi_type_ADDR       0x2
+#define MCi_type_MISC       0x3
+#define MCi_type_CTL2       0x4
+
+#define INVALID_MSR         ~0UL
+
+/* Intel MSRs */
+#define MSR_IA32_MCG_CAP         0x00000179
+#define MSR_IA32_MCG_STATUS      0x0000017a
+#define MSR_IA32_MCG_CTL         0x0000017b
+#define MSR_IA32_MC0_CTL         0x00000400
+#define MSR_IA32_MC0_STATUS      0x00000401
+#define MSR_IA32_MC0_ADDR        0x00000402
+#define MSR_IA32_MC0_MISC        0x00000403
+#define MSR_IA32_MC0_CTL2        0x00000280
+
+#define MCG_STATUS_LMCE          0x8
+
+struct mce_info {
+    const char *description;
+    uint8_t mcg_stat;
+    unsigned int bank;
+    uint64_t mci_stat;
+    uint64_t mci_misc;
+    bool cmci;
+};
+
+static struct mce_info mce_table[] = {
+    /* LLC (Last Level Cache) EWB (Explicit Write Back) SRAO MCE */
+    {
+        .description = "MCE_SRAO_MEM",
+        .mcg_stat = 0x5,
+        .bank = 7,
+        .mci_stat = 0xBD2000008000017Aull,
+        .mci_misc = 0x86ull,
+    },
+    /* Memory Patrol Scrub SRAO MCE */
+    {
+        .description = "MCE_SRAO_LLC",
+        .mcg_stat = 0x5,
+        .bank = 8,
+        .mci_stat = 0xBD000000004000CFull,
+        .mci_misc = 0x86ull,
+    },
+    /* LLC EWB UCNA Error */
+    {
+        .description = "CMCI_UCNA_LLC",
+        .mcg_stat = 0x0,
+        .bank = 9,
+        .mci_stat = 0xBC20000080000136ull,
+        .mci_misc = 0x86ull,
+        .cmci = true,
+    },
+    /* AMD L1 instruction cache data or tag parity. */
+    {
+        .description = "AMD L1 icache parity",
+        .mcg_stat = 0x5,
+        .bank = 1,
+        .mci_stat = 0x9400000000000151ull,
+        .mci_misc = 0x86ull,
+    },
+    /* LLC (Last Level Cache) EWB (Explicit Write Back) SRAO MCE */
+    {
+        .description = "MCE_SRAO_MEM (Fatal)",
+        .mcg_stat = 0x5,
+        .bank = 7,
+        .mci_stat = 0xBF2000008000017Aull,
+        .mci_misc = 0x86ull,
+    },
+};
+#define MCE_TABLE_SIZE (sizeof(mce_table)/sizeof(mce_table[0]))
+
+#define LOGFILE stdout
+
+int dump;
+int lmce;
+struct xen_mc_msrinject msr_inj;
+
+static void Lprintf(const char *fmt, ...)
+{
+    char *buf;
+    va_list args;
+
+    va_start(args, fmt);
+    if (vasprintf(&buf, fmt, args) < 0)
+        abort();
+    fprintf(LOGFILE, "%s\n", buf);
+    va_end(args);
+    free(buf);
+}
+
+static void err(xc_interface *xc_handle, const char *fmt, ...)
+{
+    char *buf;
+    va_list args;
+
+    va_start(args, fmt);
+    if ( vasprintf(&buf, fmt, args) < 0 )
+        abort();
+    perror(buf);
+    va_end(args);
+    free(buf);
+
+    if ( xc_handle )
+        xc_interface_close(xc_handle);
+    exit(EXIT_FAILURE);
+}
+
+static void init_msr_inj(void)
+{
+    memset(&msr_inj, 0, sizeof(msr_inj));
+}
+
+static int flush_msr_inj(xc_interface *xc_handle)
+{
+    struct xen_mc mc;
+
+    mc.cmd = XEN_MC_msrinject;
+    mc.interface_version = XEN_MCA_INTERFACE_VERSION;
+    mc.u.mc_msrinject = msr_inj;
+
+    return xc_mca_op(xc_handle, &mc);
+}
+
+static unsigned int mca_cpuinfo(xc_interface *xc_handle)
+{
+    struct xen_mc mc;
+
+    memset(&mc, 0, sizeof(struct xen_mc));
+
+    mc.cmd = XEN_MC_physcpuinfo;
+    mc.interface_version = XEN_MCA_INTERFACE_VERSION;
+
+    if ( !xc_mca_op(xc_handle, &mc) )
+        return mc.u.mc_physcpuinfo.ncpus;
+    else
+        return 0;
+}
+
+static int inject_cmci(xc_interface *xc_handle, unsigned int cpu_nr)
+{
+    struct xen_mc mc;
+    unsigned int nr_cpus;
+
+    memset(&mc, 0, sizeof(struct xen_mc));
+
+    nr_cpus = mca_cpuinfo(xc_handle);
+    if ( !nr_cpus )
+        err(xc_handle, "Failed to get mca_cpuinfo");
+    if ( cpu_nr >= nr_cpus )
+        err(xc_handle, "-c %u is larger than %u", cpu_nr, nr_cpus - 1);
+
+    mc.cmd = XEN_MC_inject_v2;
+    mc.interface_version = XEN_MCA_INTERFACE_VERSION;
+
+    mc.u.mc_inject_v2.flags |= XEN_MC_INJECT_CPU_BROADCAST;
+    mc.u.mc_inject_v2.flags |= XEN_MC_INJECT_TYPE_CMCI;
+    mc.u.mc_inject_v2.cpumap.nr_bits = nr_cpus;
+
+    return xc_mca_op(xc_handle, &mc);
+}
+
+static int inject_mce(xc_interface *xc_handle, int cpu_nr)
+{
+    struct xen_mc mc;
+
+    memset(&mc, 0, sizeof(struct xen_mc));
+
+    mc.cmd = XEN_MC_mceinject;
+    mc.interface_version = XEN_MCA_INTERFACE_VERSION;
+    mc.u.mc_mceinject.mceinj_cpunr = cpu_nr;
+
+    return xc_mca_op(xc_handle, &mc);
+}
+
+static int inject_lmce(xc_interface *xc_handle, unsigned int cpu)
+{
+    uint8_t *cpumap = NULL;
+    size_t cpumap_size, line, shift;
+    unsigned int nr_cpus;
+    int ret;
+
+    nr_cpus = mca_cpuinfo(xc_handle);
+    if ( !nr_cpus )
+        err(xc_handle, "Failed to get mca_cpuinfo");
+    if ( cpu >= nr_cpus )
+        err(xc_handle, "-c %u is larger than %u", cpu, nr_cpus - 1);
+
+    cpumap_size = (nr_cpus + 7) / 8;
+    cpumap = malloc(cpumap_size);
+    if ( !cpumap )
+        err(xc_handle, "Failed to allocate cpumap\n");
+    memset(cpumap, 0, cpumap_size);
+    line = cpu / 8;
+    shift = cpu % 8;
+    memset(cpumap + line, 1 << shift, 1);
+
+    ret = xc_mca_op_inject_v2(xc_handle, XEN_MC_INJECT_TYPE_LMCE,
+                              cpumap, cpumap_size * 8);
+
+    free(cpumap);
+    return ret;
+}
+
+static uint64_t bank_addr(int bank, int type)
+{
+    uint64_t addr;
+
+    switch ( type )
+    {
+    case MCi_type_CTL:
+    case MCi_type_STATUS:
+    case MCi_type_ADDR:
+    case MCi_type_MISC:
+        addr = MSR_IA32_MC0_CTL + (bank * 4) + type;
+        break;
+    case MCi_type_CTL2:
+        addr = MSR_IA32_MC0_CTL2 + bank;
+        break;
+    default:
+        addr = INVALID_MSR;
+        break;
+    }
+
+    return addr;
+}
+
+static int add_msr_intpose(xc_interface *xc_handle,
+                           uint32_t cpu_nr,
+                           uint32_t flags,
+                           uint64_t msr,
+                           uint64_t val,
+                           domid_t domid)
+{
+    uint32_t count;
+
+    if ( (msr_inj.mcinj_count &&
+          (cpu_nr != msr_inj.mcinj_cpunr || flags != msr_inj.mcinj_flags ||
+           domid != msr_inj.mcinj_domid)) ||
+         msr_inj.mcinj_count == MC_MSRINJ_MAXMSRS )
+    {
+        flush_msr_inj(xc_handle);
+        init_msr_inj();
+    }
+    count = msr_inj.mcinj_count;
+
+    if ( !count )
+    {
+        msr_inj.mcinj_cpunr = cpu_nr;
+        msr_inj.mcinj_flags = flags;
+        msr_inj.mcinj_domid = domid;
+    }
+    msr_inj.mcinj_msr[count].reg = msr;
+    msr_inj.mcinj_msr[count].value = val;
+    msr_inj.mcinj_count++;
+
+    return 0;
+}
+
+static int add_msr_bank_intpose(xc_interface *xc_handle,
+                                uint32_t cpu_nr,
+                                uint32_t flags,
+                                uint32_t type,
+                                uint32_t bank,
+                                uint64_t val,
+                                domid_t domid)
+{
+    uint64_t msr;
+
+    msr = bank_addr(bank, type);
+    if ( msr == INVALID_MSR )
+        return -1;
+    return add_msr_intpose(xc_handle, cpu_nr, flags, msr, val, domid);
+}
+
+static int inject_mcg_status(xc_interface *xc_handle,
+                             uint32_t cpu_nr,
+                             uint64_t val,
+                             domid_t domid)
+{
+    return add_msr_intpose(xc_handle, cpu_nr, MC_MSRINJ_F_INTERPOSE,
+                           MSR_IA32_MCG_STATUS, val, domid);
+}
+
+static int inject_mci_status(xc_interface *xc_handle,
+                             uint32_t cpu_nr,
+                             uint64_t bank,
+                             uint64_t val,
+                             domid_t domid)
+{
+    return add_msr_bank_intpose(xc_handle, cpu_nr, MC_MSRINJ_F_INTERPOSE,
+                                MCi_type_STATUS, bank, val, domid);
+}
+
+static int inject_mci_misc(xc_interface *xc_handle,
+                           uint32_t cpu_nr,
+                           uint64_t bank,
+                           uint64_t val,
+                           domid_t domid)
+{
+    return add_msr_bank_intpose(xc_handle, cpu_nr, MC_MSRINJ_F_INTERPOSE,
+                                MCi_type_MISC, bank, val, domid);
+}
+
+static int inject_mci_addr(xc_interface *xc_handle,
+                           uint32_t cpu_nr,
+                           uint64_t bank,
+                           uint64_t val,
+                           domid_t domid)
+{
+    return add_msr_bank_intpose(xc_handle, cpu_nr,
+                                MC_MSRINJ_F_INTERPOSE |
+                                ((domid >= DOMID_FIRST_RESERVED &&
+                                  domid != DOMID_SELF) ?
+                                 0 : MC_MSRINJ_F_GPADDR),
+                                MCi_type_ADDR, bank, val, domid);
+}
+
+static int inject(xc_interface *xc_handle, struct mce_info *mce,
+                  uint32_t cpu_nr, uint32_t domain, uint64_t gaddr)
+{
+    int ret = 0;
+    uint8_t mcg_status = mce->mcg_stat;
+
+    if ( lmce )
+    {
+        if ( mce->cmci )
+            err(xc_handle, "No support to inject CMCI as LMCE");
+        mcg_status |= MCG_STATUS_LMCE;
+    }
+    ret = inject_mcg_status(xc_handle, cpu_nr, mcg_status, domain);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCG_STATUS MSR");
+
+    ret = inject_mci_status(xc_handle, cpu_nr,
+                            mce->bank, mce->mci_stat, domain);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCi_STATUS MSR");
+
+    ret = inject_mci_misc(xc_handle, cpu_nr,
+                          mce->bank, mce->mci_misc, domain);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCi_MISC MSR");
+
+    ret = inject_mci_addr(xc_handle, cpu_nr, mce->bank, gaddr, domain);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCi_ADDR MSR");
+
+    ret = flush_msr_inj(xc_handle);
+    if ( ret )
+        err(xc_handle, "Failed to inject MSR");
+    if ( mce->cmci )
+        ret = inject_cmci(xc_handle, cpu_nr);
+    else if ( lmce )
+        ret = inject_lmce(xc_handle, cpu_nr);
+    else
+        ret = inject_mce(xc_handle, cpu_nr);
+    if ( ret )
+        err(xc_handle, "Failed to inject MCE error");
+
+    return 0;
+}
+
+static long xs_get_dom_mem(int domid)
+{
+    char path[128];
+    char *memstr;
+    uint64_t mem;
+    unsigned int plen;
+    struct xs_handle *xs;
+
+    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_close(xs);
+
+    if (!memstr || !plen)
+        return -1;
+
+    mem = atoll(memstr) * 1024;
+    free(memstr);
+
+    return mem;
+}
+
+static struct option opts[] = {
+    {"cpu", 0, 0, 'c'},
+    {"domain", 0, 0, 'd'},
+    {"dump", 0, 0, 'D'},
+    {"help", 0, 0, 'h'},
+    {"page", 0, 0, 'p'},
+    {"lmce", 0, 0, 'l'},
+    {"", 0, 0, '\0'}
+};
+
+static void help(void)
+{
+    unsigned int i;
+
+    printf("Usage: xen-mceinj [OPTION]...\n"
+           "\n"
+           "Mandatory arguments to long options are mandatory"
+           "for short options too.\n"
+           "  -D, --dump           dump addr info without error injection\n"
+           "  -c, --cpu=CPU        target CPU\n"
+           "  -d, --domain=DOMID   target domain, the default is Xen itself\n"
+           "  -h, --help           print this page\n"
+           "  -p, --page=ADDR      physical address to report\n"
+           "  -l, --lmce           inject as LMCE (Intel only)\n"
+           "  -t, --type=ERROR     error type\n");
+
+    for ( i = 0; i < MCE_TABLE_SIZE; i++ )
+        printf("                       %2d : %s\n",
+               i, mce_table[i].description);
+}
+
+int main(int argc, char *argv[])
+{
+    int type = 0;
+    int c, opt_index;
+    uint32_t domid;
+    xc_interface *xc_handle;
+    unsigned int cpu_nr;
+    uint64_t gaddr, max_gpa;
+
+    /* Default Value */
+    domid = DOMID_XEN;
+    gaddr = 0x180020;
+    cpu_nr = 0;
+
+    init_msr_inj();
+    xc_handle = xc_interface_open(NULL, NULL, 0);
+    if ( !xc_handle )
+    {
+        Lprintf("Failed to get xc interface");
+        exit(EXIT_FAILURE);
+    }
+
+    while ( 1 )
+    {
+        c = getopt_long(argc, argv, "c:Dd:t:hp:l", opts, &opt_index);
+        if ( c == -1 )
+            break;
+        switch ( c )
+        {
+        case 'D':
+            dump=1;
+            break;
+        case 'c':
+            cpu_nr = strtoul(optarg, &optarg, 10);
+            if ( strlen(optarg) != 0 )
+                err(xc_handle, "Please input a digit parameter for CPU");
+            break;
+        case 'd':
+            domid = strtol(optarg, &optarg, 10);
+            if ( strlen(optarg) != 0 )
+                err(xc_handle, "Please input a digit parameter for domain");
+            break;
+        case 'p':
+            gaddr = strtol(optarg, &optarg, 0);
+            if ( strlen(optarg) != 0 )
+                err(xc_handle, "Please input correct page address");
+            break;
+        case 't':
+            type = strtol(optarg, NULL, 0);
+            break;
+        case 'l':
+            lmce = 1;
+            break;
+        case 'h':
+        default:
+            help();
+            return 0;
+        }
+    }
+
+    if ( domid != DOMID_XEN )
+    {
+        max_gpa = xs_get_dom_mem(domid);
+        Lprintf("get domain %d max gpa is: 0x%lx", domid, max_gpa);
+        if ( gaddr >= max_gpa )
+            err(xc_handle, "Fail: gaddr exceeds max_gpa 0x%lx", max_gpa);
+    }
+    Lprintf("get gaddr of error inject is: 0x%lx", gaddr);
+
+    if ( dump )
+    {
+        if ( domid == DOMID_XEN )
+            Lprintf("Xen: gaddr=0x%lx", gaddr);
+        else
+            Lprintf("Dom%d: gaddr=0x%lx", domid, gaddr);
+        goto out;
+    }
+
+    if ( type < 0 || type >= MCE_TABLE_SIZE )
+    {
+        err(xc_handle, "Unsupported error type");
+        goto out;
+    }
+
+    inject(xc_handle, &mce_table[type], cpu_nr, domid, gaddr);
+
+ out:
+    xc_interface_close(xc_handle);
+    return 0;
+}
diff --git a/tools/tests/Makefile b/tools/tests/Makefile
index 25531a984a..33e32730c4 100644
--- a/tools/tests/Makefile
+++ b/tools/tests/Makefile
@@ -4,7 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk
 SUBDIRS-y :=
 SUBDIRS-y += resource
 SUBDIRS-$(CONFIG_X86) += cpu-policy
-SUBDIRS-$(CONFIG_X86) += mce-test
 SUBDIRS-$(CONFIG_X86) += tsx
 ifneq ($(clang),y)
 SUBDIRS-$(CONFIG_X86) += x86_emulator
diff --git a/tools/tests/mce-test/Makefile b/tools/tests/mce-test/Makefile
deleted file mode 100644
index 1395df38ac..0000000000
--- a/tools/tests/mce-test/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-.PHONY: all clean distclean
-
-all: 
-	$(MAKE) -C tools
-
-clean:
-	$(MAKE) -C tools clean
-
-distclean:
-	$(MAKE) -C tools distclean
-
-install uninstall:
diff --git a/tools/tests/mce-test/README b/tools/tests/mce-test/README
deleted file mode 100644
index 65e6d1b045..0000000000
--- a/tools/tests/mce-test/README
+++ /dev/null
@@ -1,75 +0,0 @@
-Xen MCE test suite
----------------
-
-The Xen MCE test suite is a collection of tools and test scripts for
-testing the Xen MCE processing features. The goal is to cover
-most Xen MCE processing code paths and features with automation tests.
-
-
-In the Package
---------------
-
-Here is a short description of what is included in the package
-
-README
-	This is document
-
-Makefile
-	For compile
-
-cases/*
-	Contains all test cases, which may be organized in sub-directories, 
-	the interface of test case is a shell script under cases/, such as:
-	   -- cases/srao_mem/dom0/cases.sh
-
-config/*
-	Contains test configuration files, which specifies the parameters 
-	for test cases, etc.
-
-lib/*
-	Contains some shell scripts, in which some common shell
-	functions and variable definitions are defined to be used by
-	test cases.
-
-tools/*
-	Tools used by MCE test suites, now only xen-mceinj tool.
-
-results/
-	When test is done, the test result will be placed in this
-	directory, test results	of various cases may be in corresponding 
-	directory. 
-	For example, files in
-	    results/srao_mem_dom0/result
-	is the result for test case cases/srao_mem/dom0/cases.sh, there will
-	be 3 result conditions: PASSED/FAILED/NORESULT.
-		results/<test_case>/testlog   #the test log during testing
-		results/<test_case>/mcelog    #mcelog output during testing
-		results/<test_case>/xenlog    #Xen log during testing
-		results/<test_case>/gklog     #VM guest kernel log during testing
-		results/<test_case>/guest_config   #config file used to create guest
-
-
-Test Instruction
-----------------
-
-1.	make sure you have a dom0 with mce support
-	CONFIG_X86_MCE=y
-	CONFIG_X86_MCE_INTEL=y
-	CONFIG_X86_MCE_AMD=y
-	CONFIG_X86_MCE_THRESHOLD=y
-	CONFIG_X86_MCE_INJECT=y
-
-2.	run system at xen and start xend. A installed guest image is
-	necessary when do guest MCE error injection.
-3.	compile tools that used to test. in mce-test, $make.
-	Note: make sure compile xen/tools before do this step
-4.	run test cases that you want.
-	e.g. $sh cases/srao_mem/dom0/cases.sh -d 0 -p 0x0200 -c 2 -t 1
-5.	get test result in results directory
-
-
-Notes
-----------------
-All test cases fake a error and inject this error in 0x180020, For Xen
-test cases(e.g. cases/srao_mem/xen/cases.sh), error happen on every page 
-may cause a Xen panic. 
diff --git a/tools/tests/mce-test/cases/srao_llc/dom0/cases.sh b/tools/tests/mce-test/cases/srao_llc/dom0/cases.sh
deleted file mode 100644
index c540f64998..0000000000
--- a/tools/tests/mce-test/cases/srao_llc/dom0/cases.sh
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-sd=$(dirname $0)
-export ROOT=`(cd $sd/../../../; pwd)`
-export this_case=srao_llc_dom0
-
-. $ROOT/lib/xen-mceinj-tool.sh
-
-usage()
-{
-    echo "Usage: ./cases.sh [-options] [arguments]"
-    echo "================Below are the optional options================"
-    echo -e "\t-d domainID\t: 0"
-    echo -e "\t-c injcpu\t: which cpu to inject error"
-    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
-    echo -e "\t\t\tBy default, the GPA is 0x180020"
-    echo -e "\t-h help"
-    exit 0
-}
-
-while getopts ":c:d:p:h" option
-do
-    case "$option" in
-    c) injcpu=$OPTARG;;
-    d) domid=$OPTARG;;
-    p) pageaddr=$OPTARG;;
-    h) usage;;
-    *) echo "invalid option!"; usage;;
-    esac
-done
-
-[ -z $domid ] && domid=0
-
-inject()
-{
-    mce_inject_trigger $MCE_SRAO_LLC -d $domid -u $injcpu -p $pageaddr 
-    if [ $? -eq 0 ]; then
-        show "  Passed: Successfully to fake and inject a MCE error"
-    else
-        show "  Failed: Fake error and inject fail !!"
-        return 1
-    fi
-    return 0
-}
-
-do_main()
-{
-    ret_val=0
-    clean_env
-    inject || ret_val=1
-    xen_verify || ret_val=1
-    mcelog_verify $MCE_SRAO_LLC || ret_val=1
-    gen_result $ret_val
-}
-
-do_main "$@"
diff --git a/tools/tests/mce-test/cases/srao_llc/guest/cases.sh b/tools/tests/mce-test/cases/srao_llc/guest/cases.sh
deleted file mode 100644
index 47a7ee4ab9..0000000000
--- a/tools/tests/mce-test/cases/srao_llc/guest/cases.sh
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-sd=$(dirname $0)
-export ROOT=`(cd $sd/../../../; pwd)`
-export this_case=srao_llc_guest
-
-. $ROOT/lib/xen-mceinj-tool.sh
-
-usage()
-{
-    echo "Usage: ./cases.sh [-options] [arguments]"
-    echo "================Below are the must have options==============="
-    echo -e "\t-i image\t: guest image"
-    echo -e "\t-m memory\t: set guest virtual memory"
-    echo "========                                              ========"
-    echo "================Below are the optional options================"
-    echo -e "\t-u vcpus\t: set guest virtual cpus number"
-    echo -e "\t-c injcpu\t: which cpu to inject error"
-    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
-    echo -e "\t\t\tBy default, the GPA is 0x180020"
-    echo -e "\t-h help"
-    exit 0
-}
-
-[ $# -lt 1 ] && usage
-
-while getopts ":i:u:m:c:p:hl:" option
-do
-    case "$option" in
-    i) image=$OPTARG; offset=`kpartx -l $image | awk '{print $NF*512}'`;;
-    u) vcpus=$OPTARG;;
-    m) memory=$OPTARG;;
-    c) injcpu=$OPTARG;;
-    p) pageaddr=$OPTARG;;
-    l) early_kill="0";;
-    h) usage;;
-    *) echo "invalid option!"; usage;;
-    esac
-done
-
-
-start_guest()
-{
-    create_hvm_guest $image -u $vcpus -m $memory
-    if [ $? -ne 0 ]; then
-        echo "  Create guest fail!"
-        return 1
-    fi
-    return 0
-}
-
-inject()
-{
-    mce_inject_trigger $MCE_SRAO_LLC -u $injcpu -p $pageaddr 
-    if [ $? -eq 0 ]; then
-        show "  Passed: Successfully to fake and inject a MCE error"
-    else
-        show "  Failed: Fake error and inject fail !!"
-        return 1
-    fi
-    return 0
-}
-
-do_main()
-{
-    ret_val=0
-    clean_env
-    start_guest || ret_val=1
-    inject || ret_val=1
-    xen_verify || ret_val=1
-    guest_verify || ret_val=1
-    mcelog_verify $MCE_SRAO_LLC || ret_val=1
-    des_guest
-    gen_result $ret_val
-}
-
-do_main "$@"
diff --git a/tools/tests/mce-test/cases/srao_llc/xen/cases.sh b/tools/tests/mce-test/cases/srao_llc/xen/cases.sh
deleted file mode 100644
index 1d8e02ff65..0000000000
--- a/tools/tests/mce-test/cases/srao_llc/xen/cases.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-sd=$(dirname $0)
-export ROOT=`(cd $sd/../../../; pwd)`
-export this_case=srao_llc_xen
-
-. $ROOT/lib/xen-mceinj-tool.sh
-
-usage()
-{
-    echo "Usage: ./cases.sh [-options] [arguments]"
-    echo "================Below are the optional options================"
-    echo -e "\t-c injcpu\t: which cpu to inject error"
-    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
-    echo -e "\t\t\tBy default, the GPA is 0x180020"
-    echo -e "\t-h help"
-    exit 0
-}
-
-while getopts ":c:p:h" option
-do
-    case "$option" in
-    c) injcpu=$OPTARG;;
-    p) pageaddr=$OPTARG;;
-    h) usage;;
-    *) echo "invalid option!"; usage;;
-    esac
-done
-
-inject()
-{
-    mce_inject_trigger $MCE_SRAO_LLC -u $injcpu -p $pageaddr 
-    if [ $? -eq 0 ]; then
-        show "  Passed: Successfully to fake and inject a MCE error"
-    else
-        show "  Failed: Fake error and inject fail !!"
-        return 1
-    fi
-    return 0
-}
-
-do_main()
-{
-    ret_val=0
-    clean_env
-    inject || ret_val=1
-    xen_verify || ret_val=1
-    mcelog_verify $MCE_SRAO_LLC || ret_val=1
-    gen_result $ret_val
-}
-
-do_main "$@"
diff --git a/tools/tests/mce-test/cases/srao_mem/dom0/cases.sh b/tools/tests/mce-test/cases/srao_mem/dom0/cases.sh
deleted file mode 100644
index 22d4a00960..0000000000
--- a/tools/tests/mce-test/cases/srao_mem/dom0/cases.sh
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-sd=$(dirname $0)
-export ROOT=`(cd $sd/../../../; pwd)`
-export this_case=srao_mem_dom0
-
-. $ROOT/lib/xen-mceinj-tool.sh
-
-usage()
-{
-    echo "Usage: ./cases.sh [-options] [arguments]"
-    echo "================Below are the optional options================"
-    echo -e "\t-d domainID\t: 0"
-    echo -e "\t-c injcpu\t: which cpu to inject error"
-    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
-    echo -e "\t\t\tBy default, the GPA is 0x180020"
-    echo -e "\t-h help"
-    exit 0
-}
-
-while getopts ":c:d:p:h" option
-do
-    case "$option" in
-    c) injcpu=$OPTARG;;
-    d) domid=$OPTARG;;
-    p) pageaddr=$OPTARG;;
-    h) usage;;
-    *) echo "invalid option!"; usage;;
-    esac
-done
-
-[ -z $domid ] && domid=0
-
-inject()
-{
-    mce_inject_trigger $MCE_SRAO_MEM -d $domid -u $injcpu -p $pageaddr 
-    if [ $? -eq 0 ]; then
-        show "  Passed: Successfully to fake and inject a MCE error"
-    else
-        show "  Failed: Fake error and inject fail !!"
-        return 1
-    fi
-    return 0
-}
-
-do_main()
-{
-    ret_val=0
-    clean_env
-    inject || ret_val=1
-    xen_verify || ret_val=1
-    mcelog_verify $MCE_SRAO_MEM || ret_val=1
-    gen_result $ret_val
-}
-
-do_main "$@"
diff --git a/tools/tests/mce-test/cases/srao_mem/guest/cases.sh b/tools/tests/mce-test/cases/srao_mem/guest/cases.sh
deleted file mode 100644
index 7ab4523096..0000000000
--- a/tools/tests/mce-test/cases/srao_mem/guest/cases.sh
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-sd=$(dirname $0)
-export ROOT=`(cd $sd/../../../; pwd)`
-export this_case=srao_mem_guest
-
-. $ROOT/lib/xen-mceinj-tool.sh
-
-usage()
-{
-    echo "Usage: ./cases.sh [-options] [arguments]"
-    echo "================Below are the must have options==============="
-    echo -e "\t-i image\t: guest image"
-    echo -e "\t-m memory\t: set guest virtual memory"
-    echo "========                                              ========"
-    echo "================Below are the optional options================"
-    echo -e "\t-u vcpus\t: set guest virtual cpus number"
-    echo -e "\t-c injcpu\t: which cpu to inject error"
-    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
-    echo -e "\t\t\tBy default, the GPA is 0x180020"
-    echo -e "\t-h help"
-    exit 0
-}
-
-[ $# -lt 1 ] && usage
-
-while getopts ":i:u:m:c:p:hl:" option
-do
-    case "$option" in
-    i) image=$OPTARG; offset=`kpartx -l $image | awk '{print $NF*512}'`;;
-    u) vcpus=$OPTARG;;
-    m) memory=$OPTARG;;
-    c) injcpu=$OPTARG;;
-    p) pageaddr=$OPTARG;;
-    l) early_kill="0";;
-    h) usage;;
-    *) echo "invalid option!"; usage;;
-    esac
-done
-
-
-start_guest()
-{
-    create_hvm_guest $image -u $vcpus -m $memory
-    if [ $? -ne 0 ]; then
-        echo "  Create guest fail!"
-        return 1
-    fi
-    return 0
-}
-
-inject()
-{
-    mce_inject_trigger $MCE_SRAO_MEM -u $injcpu -p $pageaddr 
-    if [ $? -eq 0 ]; then
-        show "  Passed: Successfully to fake and inject a MCE error"
-    else
-        show "  Failed: Fake error and inject fail !!"
-        return 1
-    fi
-    return 0
-}
-
-do_main()
-{
-    ret_val=0
-    clean_env
-    start_guest || ret_val=1
-    inject || ret_val=1
-    xen_verify || ret_val=1
-    guest_verify || ret_val=1
-    mcelog_verify $MCE_SRAO_MEM || ret_val=1
-    des_guest
-    gen_result $ret_val
-}
-
-do_main "$@"
diff --git a/tools/tests/mce-test/cases/srao_mem/xen/cases.sh b/tools/tests/mce-test/cases/srao_mem/xen/cases.sh
deleted file mode 100644
index 7ae49a82ac..0000000000
--- a/tools/tests/mce-test/cases/srao_mem/xen/cases.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-sd=$(dirname $0)
-export ROOT=`(cd $sd/../../../; pwd)`
-export this_case=srao_mem_xen
-
-. $ROOT/lib/xen-mceinj-tool.sh
-
-usage()
-{
-    echo "Usage: ./cases.sh [-options] [arguments]"
-    echo "================Below are the optional options================"
-    echo -e "\t-c injcpu\t: which cpu to inject error"
-    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
-    echo -e "\t\t\tBy default, the GPA is 0x180020"
-    echo -e "\t-h help"
-    exit 0
-}
-
-while getopts ":c:p:h" option
-do
-    case "$option" in
-    c) injcpu=$OPTARG;;
-    p) pageaddr=$OPTARG;;
-    h) usage;;
-    *) echo "invalid option!"; usage;;
-    esac
-done
-
-inject()
-{
-    mce_inject_trigger $MCE_SRAO_MEM -u $injcpu -p $pageaddr 
-    if [ $? -eq 0 ]; then
-        show "  Passed: Successfully to fake and inject a MCE error"
-    else
-        show "  Failed: Fake error and inject fail !!"
-        return 1
-    fi
-    return 0
-}
-
-do_main()
-{
-    ret_val=0
-    clean_env
-    inject || ret_val=1
-    xen_verify || ret_val=1
-    mcelog_verify $MCE_SRAO_MEM || ret_val=1
-    gen_result $ret_val
-}
-
-do_main "$@"
diff --git a/tools/tests/mce-test/cases/ucna_llc/dom0/cases.sh b/tools/tests/mce-test/cases/ucna_llc/dom0/cases.sh
deleted file mode 100644
index 808f007708..0000000000
--- a/tools/tests/mce-test/cases/ucna_llc/dom0/cases.sh
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-sd=$(dirname $0)
-export ROOT=`(cd $sd/../../../; pwd)`
-export this_case=ucna_llc_dom0
-
-. $ROOT/lib/xen-mceinj-tool.sh
-
-usage()
-{
-    echo "Usage: ./cases.sh [-options] [arguments]"
-    echo "================Below are the optional options================"
-    echo -e "\t-d domainID\t: 0"
-    echo -e "\t-c injcpu\t: which cpu to inject error"
-    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
-    echo -e "\t\t\tBy default, the GPA is 0x180020"
-    echo -e "\t-h help"
-    exit 0
-}
-
-while getopts ":c:d:p:h" option
-do
-    case "$option" in
-    c) injcpu=$OPTARG;;
-    d) domid=$OPTARG;;
-    p) pageaddr=$OPTARG;;
-    h) usage;;
-    *) echo "invalid option!"; usage;;
-    esac
-done
-
-[ -z $domid ] && domid=0
-
-inject()
-{
-    mce_inject_trigger $CMCI_UCNA_LLC -d $domid -u $injcpu -p $pageaddr 
-    if [ $? -eq 0 ]; then
-        show "  Passed: Successfully to fake and inject a MCE error"
-    else
-        show "  Failed: Fake error and inject fail !!"
-        return 1
-    fi
-    return 0
-}
-
-do_main()
-{
-    ret_val=0
-    clean_env
-    inject || ret_val=1
-    mcelog_verify $CMCI_UCNA_LLC || ret_val=1
-    gen_result $ret_val
-}
-
-do_main "$@"
diff --git a/tools/tests/mce-test/cases/ucna_llc/guest/cases.sh b/tools/tests/mce-test/cases/ucna_llc/guest/cases.sh
deleted file mode 100644
index 0ca4e2c961..0000000000
--- a/tools/tests/mce-test/cases/ucna_llc/guest/cases.sh
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-sd=$(dirname $0)
-export ROOT=`(cd $sd/../../../; pwd)`
-export this_case=ucna_llc_guest
-
-. $ROOT/lib/xen-mceinj-tool.sh
-
-usage()
-{
-    echo "Usage: ./cases.sh [-options] [arguments]"
-    echo "================Below are the must have options==============="
-    echo -e "\t-i image\t: guest image"
-    echo -e "\t-m memory\t: set guest virtual memory"
-    echo "========                                              ========"
-    echo "================Below are the optional options================"
-    echo -e "\t-u vcpus\t: set guest virtual cpus number"
-    echo -e "\t-c injcpu\t: which cpu to inject error"
-    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
-    echo -e "\t\t\tBy default, the GPA is 0x180020"
-    echo -e "\t-h help"
-    exit 0
-}
-
-[ $# -lt 1 ] && usage
-
-while getopts ":i:u:m:c:p:hl:" option
-do
-    case "$option" in
-    i) image=$OPTARG; offset=`kpartx -l $image | awk '{print $NF*512}'`;;
-    u) vcpus=$OPTARG;;
-    m) memory=$OPTARG;;
-    c) injcpu=$OPTARG;;
-    p) pageaddr=$OPTARG;;
-    l) early_kill="0";;
-    h) usage;;
-    *) echo "invalid option!"; usage;;
-    esac
-done
-
-
-start_guest()
-{
-    create_hvm_guest $image -u $vcpus -m $memory
-    if [ $? -ne 0 ]; then
-        echo "  Create guest fail!"
-        return 1
-    fi
-    return 0
-}
-
-inject()
-{
-    mce_inject_trigger $CMCI_UCNA_LLC -u $injcpu -p $pageaddr 
-    if [ $? -eq 0 ]; then
-        show "  Passed: Successfully to fake and inject a MCE error"
-    else
-        show "  Failed: Fake error and inject fail !!"
-        return 1
-    fi
-    return 0
-}
-
-do_main()
-{
-    ret_val=0
-    clean_env
-    start_guest || ret_val=1
-    inject || ret_val=1
-    mcelog_verify $CMCI_UCNA_LLC || ret_val=1
-    des_guest
-    gen_result $ret_val
-}
-
-do_main "$@"
diff --git a/tools/tests/mce-test/cases/ucna_llc/xen/cases.sh b/tools/tests/mce-test/cases/ucna_llc/xen/cases.sh
deleted file mode 100644
index c73a2f6c16..0000000000
--- a/tools/tests/mce-test/cases/ucna_llc/xen/cases.sh
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-sd=$(dirname $0)
-export ROOT=`(cd $sd/../../../; pwd)`
-export this_case=ucna_llc_xen
-
-. $ROOT/lib/xen-mceinj-tool.sh
-
-usage()
-{
-    echo "Usage: ./cases.sh [-options] [arguments]"
-    echo "================Below are the optional options================"
-    echo -e "\t-c injcpu\t: which cpu to inject error"
-    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
-    echo -e "\t\t\tBy default, the GPA is 0x180020"
-    echo -e "\t-h help"
-    exit 0
-}
-
-while getopts ":c:p:h" option
-do
-    case "$option" in
-    c) injcpu=$OPTARG;;
-    p) pageaddr=$OPTARG;;
-    h) usage;;
-    *) echo "invalid option!"; usage;;
-    esac
-done
-
-inject()
-{
-    mce_inject_trigger $CMCI_UCNA_LLC -u $injcpu -p $pageaddr 
-    if [ $? -eq 0 ]; then
-        show "  Passed: Successfully to fake and inject a MCE error"
-    else
-        show "  Failed: Fake error and inject fail !!"
-        return 1
-    fi
-    return 0
-}
-
-do_main()
-{
-    ret_val=0
-    clean_env
-    inject || ret_val=1
-    mcelog_verify $CMCI_UCNA_LLC || ret_val=1
-    gen_result $ret_val
-}
-
-do_main "$@"
diff --git a/tools/tests/mce-test/config/setup.conf b/tools/tests/mce-test/config/setup.conf
deleted file mode 100644
index 05f754dfd6..0000000000
--- a/tools/tests/mce-test/config/setup.conf
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-#
-# Software injection based test cases: test cases are triggered via
-# mce-inject tool.
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-export MCE_SRAO_MEM=0
-export MCE_SRAO_LLC=1
-export CMCI_UCNA_LLC=2
diff --git a/tools/tests/mce-test/lib/xen-mceinj-tool.sh b/tools/tests/mce-test/lib/xen-mceinj-tool.sh
deleted file mode 100644
index c0a3b293c5..0000000000
--- a/tools/tests/mce-test/lib/xen-mceinj-tool.sh
+++ /dev/null
@@ -1,260 +0,0 @@
-#!/bin/bash
-#
-# Software injection based test cases: test cases are triggered via
-# mce-inject tool.
-# Copyright (c) 2010, Intel Corporation
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version
-# 2 as published by the Free Software Foundation.
-# 
-# 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/>.
-#
-# Author: Xudong Hao <xudong.hao@intel.com>
-#
-
-. $ROOT/config/setup.conf
-
-#Guest Image Preparation
-hvm_image_prepare()
-{
-    local image=$1
-    local tmpdir=`mktemp -d`
-    local tmpfile=`mktemp`
-    local offset=`kpartx -l $image | awk '{print $NF*512}'`
-    mount -oloop,offset=$offset $image $tmpdir && echo "mount image to $tmpdir"
-    local g_grub=$tmpdir/boot/grub/grub.conf
-    if [ $? -ne 0 ]; then
-        show "  Mount image failed!"
-        return 1
-    fi
-
-    if ! grep FLAG_CONSOLE $g_grub; then
-        sed -e '/kernel/s/$/ console=ttyS0,115200,8n1 console=tty0/g' \
-            $g_grub > $tmpfile
-        mv -f $tmpfile $g_grub
-        rm -f $tmpfile
-        echo "
-#### FLAG_CONSOLE #### " >> $g_grub
-    fi
-    umount $tmpdir
-    rm -fr $tmpdir
-
-    return 0
-}
-
-create_hvm_guest()
-{
-    local image=$1
-    local originconfig="/etc/xen/xmexample.hvm"
-    local TF=`mktemp`
-    local case_dir=$ROOT/results/$this_case
-    local config=$case_dir/guest_config
-    [ -d $case_dir ] || mkdir $case_dir
-    [ -f $logfile ] || touch $logfile
-    local File=`echo $image|sed "s/\//\\\\\\\\\\//g"`
-    local g_name="`basename $image`_`date +%H%M%S`"
-
-    hvm_image_prepare $image
-
-    while getopts ":u:m:" Option
-    do
-        case $Option in
-            u ) vcpus=$OPTARG;;
-            m ) memory=$OPTARG;;
-            e ) bridge_name=$OPTARG;;
-            * ) ;;
-        esac
-    done
-
-    cp $originconfig $config -f
-
-    if [ -z $image ]; then
-        show "Image file $image does not exist, Please input one valid file"
-        return 1
-    fi
-
-    sed -e "/^disk/s/file:.*,\(hda\)/file:${File},\1/" $config \
-          | sed -e "/^disk/s/phy:.*,\(hda\)/file:${File},\1/" >$TF
-    mv -f $TF $config
-
-    [ -z $memory ] || sed -i "/^memory/s/^.*$/memory = $memory/" $config
-    [ -z $vcpus ] || sed -i "1,/^#vcpus/s/^#vcpus.*$/vcpus=$vcpus/;1d" $config
-    sed -i "/^vif/s/vif/#vif/" $config
-    sed -i "/^name/s/^.*$/name = \"$g_name\"/" $config
-
-    string1=$(ls /dev/pts | sort)
-    xm cr $config
-    [ $? -eq 0 ] && domid=`xm list $g_name | tail -n1 | awk '{print $2}'`
-    if [ -z $domid ]; then
-        show "  Guest can not boot up"
-        return 1
-    fi
-    
-    sleep 10
-
-    string2=$(ls /dev/pts | sort)
-
-    get_guest_klog
-    sleep 40
-
-    return 0
-}
-
-get_guest_klog()
-{
-    local case_dir=$ROOT/results/$this_case
-    gklog=$case_dir/gklog
-    [ -d $case_dir ] || mkdir $case_dir
-    [ -f $gklog ] || touch $gklog
-    for fo in $string2; do
-        echo $string1 | grep $fo -wq
-        [ $? -eq 1 ] && num=$fo
-    done
-    cat /dev/pts/$num > $gklog &
-}
-
-mce_inject_trigger()
-{
-    local errtype=$1
-    local append=""
-    while getopts ":d:u:p:" Option
-    do
-        case $Option in
-            d ) domid=$OPTARG;;
-            u ) cpu=$OPTARG;;
-            p ) pageaddr=$OPTARG;;
-            * ) ;;
-        esac
-    done
-
-    [ -z $domid ] || append=$append" -d $domid"
-    [ -z $cpu ] || append=$append" -c $cpu"
-    [ -z $pageaddr ] || append=$append" -p $pageaddr"
-
-    [ -f $ROOT/tools/xen-mceinj ]
-    if [ $? -eq 0 ]; then
-        xm dmesg -c
-        $ROOT/tools/xen-mceinj -t $errtype $append
-        if [ $? -ne 0 ]; then
-            show "  Failed: Maybe the memory addr is out of range. \
-                      Please check whether used xen-mceinj tool correctlly"
-            return 1
-        fi
-    else
-        show "  Failed: please compile xen-mce inject tool firstly"
-        return 1
-    fi
-    return 0
-}
-
-xen_verify()
-{
-    local case_dir=$ROOT/results/$this_case
-    local xenlog=$case_dir/xenlog
-    [ -d $case_dir ] || mkdir $case_dir
-    [ -f $xenlog ] || touch $xenlog
-    xm dmesg > $xenlog
-    grep "Error is successfully recovered" $xenlog > /dev/null
-    if [ $? -eq 0 ]; then
-        show "  Passed: Xen handle this MCE error successfully"
-    else
-        show "  Failed: Xen does not handle MCE error correctly !!"
-        return 1
-    fi
-    return 0
-}
-
-guest_verify()
-{
-    grep "kernel page recovery" $gklog > /dev/null
-    if [ $? -eq 0 ]; then
-        show "  Passed: Guest recive MCE error and solved correctly"
-    else
-        show "  Failed: Guest fail to solve MCE error"
-        return 1
-    fi
-    return 0
-}
-
-mcelog_verify()
-{
-    local err_type=$1
-    local ret=0
-    local case_dir=$ROOT/results/$this_case
-    local mcelog=$case_dir/mcelog
-    [ -d $case_dir ] || mkdir $case_dir
-    [ -f $mcelog ] || touch $mcelog
-    mcelog > $mcelog
-    if [ -z $mcelog ]; then
-        show "  Failed: MCELOG does not catch anything"
-        return 1
-    else
-        if [ $err_type -eq 0 ]; then
-            grep "MEMORY CONTROLLER MS_CHANNELunspecified_ERR" $mcelog \
-                > /dev/null
-            ret=$?
-        elif [ $err_type -eq 1 ]; then
-            grep "Generic CACHE Level-2 Eviction Error" $mcelog > /dev/null
-            ret=$?
-        elif [ $err_type -eq 2 ]; then
-            grep "Data CACHE Level-2 Data-Read Error" $mcelog > /dev/null
-            ret=$?
-        fi
-
-        if [ $ret -eq 0 ]; then
-            show "  Passed: MCElog catch a correct error"
-        else 
-            show "  Failed: MCE log catch a incorrect error !!"
-            return 1
-        fi
-    fi
-
-    return 0
-}
-
-function des_guest()
-{
-    xm des $domid    
-}
-
-function clean_env()
-{
-    [ -d $ROOT/results ] || mkdir $ROOT/results
-    # clean logs and results of last test for this case
-    rm -fr $ROOT/results/$this_case/*
-}
-
-function show()
-{
-    local case_dir=$ROOT/results/$this_case
-    local logfile=$case_dir/testlog
-    [ -d $case_dir ] || mkdir $case_dir
-    [ -f $logfile ] || touch $logfile
-    echo -e $* | tee -a $logfile > /dev/null
-}
-
-function gen_result()
-{
-    local ret=$1
-    local case_dir=$ROOT/results/$this_case
-    local result=$case_dir/result
-    [ -d $case_dir ] || mkdir $case_dir
-    [ -f $result ] || touch $result
-    
-    if [ $ret -eq 0 ]; then
-        echo "PASSED" > $result
-    elif [ $ret -eq 1 ]; then
-        echo "FAILED" > $result
-        echo "   Please check testlog for details!!! " >> $result
-    else
-        echo "NORESULT" > $result
-        echo "   Please check testlog for details!!! " >> $result
-    fi
-}
diff --git a/tools/tests/mce-test/tools/Makefile b/tools/tests/mce-test/tools/Makefile
deleted file mode 100644
index 0e92ac2977..0000000000
--- a/tools/tests/mce-test/tools/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-XEN_ROOT=$(CURDIR)/../../../..
-include $(XEN_ROOT)/tools/Rules.mk
-
-CFLAGS += -Werror
-CFLAGS += $(CFLAGS_libxenctrl)
-CFLAGS += $(CFLAGS_libxenguest)
-CFLAGS += $(CFLAGS_libxenstore)
-CFLAGS += $(CFLAGS_xeninclude)
-
-.PHONY: all
-all: xen-mceinj
-
-install: xen-mceinj
-	$(INSTALL_PROG) xen-mceinj $(DESTDIR)$(sbindir)
-
-.PHONY: clean
-clean:
-	$(RM) *.o xen-mceinj
-
-.PHONY: distclean
-distclean: clean
-
-xen-mceinj: xen-mceinj.o Makefile
-	$(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore)
diff --git a/tools/tests/mce-test/tools/README b/tools/tests/mce-test/tools/README
deleted file mode 100644
index bd0d442bae..0000000000
--- a/tools/tests/mce-test/tools/README
+++ /dev/null
@@ -1,24 +0,0 @@
-Xen Machine Check Exception(MCE) error inject tool
-----------------------------------------------
-
-xen-mceinj is a software MCE injection tool, which is based on Xen 
-MCE injection mechanism. It allows to inject machine check errors on the
-software level into a running Xen/dom0/VM. This is intended for
-validation of the Xen machine check handler.
-
-With the help of the Makefile, it is possible to compile a binary file 
-named "xen-mceinj".
-
-Usage
------
-$make (make install) --Note: make sure compile xen/tools before do this step
-$./xen-mceinj [OPTION]...
-
-OPTION arguments can be:
-  -D, --dump           dump addr info without error injection
-  -c, --cpu=CPU_ID     target CPU, the default is CPU0
-  -d, --domain=DomID   target domain, the default is Xen itself
-  -p, --page           physical page address, the default is 0x180020
-  -t, --type=error     error type
-
-For detail help, please refer to "./xen-mceinj -h"
diff --git a/tools/tests/mce-test/tools/xen-mceinj.c b/tools/tests/mce-test/tools/xen-mceinj.c
deleted file mode 100644
index 1187d01e5f..0000000000
--- a/tools/tests/mce-test/tools/xen-mceinj.c
+++ /dev/null
@@ -1,545 +0,0 @@
-/*
- * xen-mceinj.c: utilities to inject fake MCE for x86.
- * Copyright (c) 2010, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; If not, see <http://www.gnu.org/licenses/>.
- *
- * Authors: Yunhong Jiang <yunhong.jiang@intel.com>
- *          Haicheng Li <haicheng.li@intel.com>
- *          Xudong Hao <xudong.hao@intel.com>
- */
-
-
-#define _GNU_SOURCE
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <getopt.h>
-#include <errno.h>
-#include <signal.h>
-#include <stdarg.h>
-
-#define XC_WANT_COMPAT_MAP_FOREIGN_API
-#include <xenctrl.h>
-#include <xenguest.h>
-#include <inttypes.h>
-#include <sys/time.h>
-#include <xen/arch-x86/xen-mca.h>
-#include <xenstore.h>
-
-#define MCi_type_CTL        0x0
-#define MCi_type_STATUS     0x1
-#define MCi_type_ADDR       0x2
-#define MCi_type_MISC       0x3
-#define MCi_type_CTL2       0x4
-
-#define INVALID_MSR         ~0UL
-
-/* Intel MSRs */
-#define MSR_IA32_MCG_CAP         0x00000179
-#define MSR_IA32_MCG_STATUS      0x0000017a
-#define MSR_IA32_MCG_CTL         0x0000017b
-#define MSR_IA32_MC0_CTL         0x00000400
-#define MSR_IA32_MC0_STATUS      0x00000401
-#define MSR_IA32_MC0_ADDR        0x00000402
-#define MSR_IA32_MC0_MISC        0x00000403
-#define MSR_IA32_MC0_CTL2        0x00000280
-
-#define MCG_STATUS_LMCE          0x8
-
-struct mce_info {
-    const char *description;
-    uint8_t mcg_stat;
-    unsigned int bank;
-    uint64_t mci_stat;
-    uint64_t mci_misc;
-    bool cmci;
-};
-
-static struct mce_info mce_table[] = {
-    /* LLC (Last Level Cache) EWB (Explicit Write Back) SRAO MCE */
-    {
-        .description = "MCE_SRAO_MEM",
-        .mcg_stat = 0x5,
-        .bank = 7,
-        .mci_stat = 0xBD2000008000017Aull,
-        .mci_misc = 0x86ull,
-    },
-    /* Memory Patrol Scrub SRAO MCE */
-    {
-        .description = "MCE_SRAO_LLC",
-        .mcg_stat = 0x5,
-        .bank = 8,
-        .mci_stat = 0xBD000000004000CFull,
-        .mci_misc = 0x86ull,
-    },
-    /* LLC EWB UCNA Error */
-    {
-        .description = "CMCI_UCNA_LLC",
-        .mcg_stat = 0x0,
-        .bank = 9,
-        .mci_stat = 0xBC20000080000136ull,
-        .mci_misc = 0x86ull,
-        .cmci = true,
-    },
-    /* AMD L1 instruction cache data or tag parity. */
-    {
-        .description = "AMD L1 icache parity",
-        .mcg_stat = 0x5,
-        .bank = 1,
-        .mci_stat = 0x9400000000000151ull,
-        .mci_misc = 0x86ull,
-    },
-    /* LLC (Last Level Cache) EWB (Explicit Write Back) SRAO MCE */
-    {
-        .description = "MCE_SRAO_MEM (Fatal)",
-        .mcg_stat = 0x5,
-        .bank = 7,
-        .mci_stat = 0xBF2000008000017Aull,
-        .mci_misc = 0x86ull,
-    },
-};
-#define MCE_TABLE_SIZE (sizeof(mce_table)/sizeof(mce_table[0]))
-
-#define LOGFILE stdout
-
-int dump;
-int lmce;
-struct xen_mc_msrinject msr_inj;
-
-static void Lprintf(const char *fmt, ...)
-{
-    char *buf;
-    va_list args;
-
-    va_start(args, fmt);
-    if (vasprintf(&buf, fmt, args) < 0)
-        abort();
-    fprintf(LOGFILE, "%s\n", buf);
-    va_end(args);
-    free(buf);
-}
-
-static void err(xc_interface *xc_handle, const char *fmt, ...)
-{
-    char *buf;
-    va_list args;
-
-    va_start(args, fmt);
-    if (vasprintf(&buf, fmt, args) < 0)
-        abort();
-    perror(buf);
-    va_end(args);
-    free(buf);
-
-    if ( xc_handle )
-        xc_interface_close(xc_handle);
-    exit(EXIT_FAILURE);
-}
-
-static void init_msr_inj(void)
-{
-    memset(&msr_inj, 0, sizeof(msr_inj));
-}
-
-static int flush_msr_inj(xc_interface *xc_handle)
-{
-    struct xen_mc mc;
-
-    mc.cmd = XEN_MC_msrinject;
-    mc.interface_version = XEN_MCA_INTERFACE_VERSION;
-    mc.u.mc_msrinject = msr_inj;
-
-    return xc_mca_op(xc_handle, &mc);
-}
-
-static unsigned int mca_cpuinfo(xc_interface *xc_handle)
-{
-    struct xen_mc mc;
-
-    memset(&mc, 0, sizeof(struct xen_mc));
-
-    mc.cmd = XEN_MC_physcpuinfo;
-    mc.interface_version = XEN_MCA_INTERFACE_VERSION;
-
-    if (!xc_mca_op(xc_handle, &mc))
-        return mc.u.mc_physcpuinfo.ncpus;
-    else
-        return 0;
-}
-
-static int inject_cmci(xc_interface *xc_handle, unsigned int cpu_nr)
-{
-    struct xen_mc mc;
-    unsigned int nr_cpus;
-
-    memset(&mc, 0, sizeof(struct xen_mc));
-
-    nr_cpus = mca_cpuinfo(xc_handle);
-    if (!nr_cpus)
-        err(xc_handle, "Failed to get mca_cpuinfo");
-    if (cpu_nr >= nr_cpus)
-        err(xc_handle, "-c %u is larger than %u", cpu_nr, nr_cpus - 1);
-
-    mc.cmd = XEN_MC_inject_v2;
-    mc.interface_version = XEN_MCA_INTERFACE_VERSION;
-
-    mc.u.mc_inject_v2.flags |= XEN_MC_INJECT_CPU_BROADCAST;
-    mc.u.mc_inject_v2.flags |= XEN_MC_INJECT_TYPE_CMCI;
-    mc.u.mc_inject_v2.cpumap.nr_bits = nr_cpus;
-
-    return xc_mca_op(xc_handle, &mc);
-}
-
-static int inject_mce(xc_interface *xc_handle, int cpu_nr)
-{
-    struct xen_mc mc;
-
-    memset(&mc, 0, sizeof(struct xen_mc));
-
-    mc.cmd = XEN_MC_mceinject;
-    mc.interface_version = XEN_MCA_INTERFACE_VERSION;
-    mc.u.mc_mceinject.mceinj_cpunr = cpu_nr;
-
-    return xc_mca_op(xc_handle, &mc);
-}
-
-static int inject_lmce(xc_interface *xc_handle, unsigned int cpu)
-{
-    uint8_t *cpumap = NULL;
-    size_t cpumap_size, line, shift;
-    unsigned int nr_cpus;
-    int ret;
-
-    nr_cpus = mca_cpuinfo(xc_handle);
-    if ( !nr_cpus )
-        err(xc_handle, "Failed to get mca_cpuinfo");
-    if ( cpu >= nr_cpus )
-        err(xc_handle, "-c %u is larger than %u", cpu, nr_cpus - 1);
-
-    cpumap_size = (nr_cpus + 7) / 8;
-    cpumap = malloc(cpumap_size);
-    if ( !cpumap )
-        err(xc_handle, "Failed to allocate cpumap\n");
-    memset(cpumap, 0, cpumap_size);
-    line = cpu / 8;
-    shift = cpu % 8;
-    memset(cpumap + line, 1 << shift, 1);
-
-    ret = xc_mca_op_inject_v2(xc_handle, XEN_MC_INJECT_TYPE_LMCE,
-                              cpumap, cpumap_size * 8);
-
-    free(cpumap);
-    return ret;
-}
-
-static uint64_t bank_addr(int bank, int type)
-{
-    uint64_t addr;
-
-    switch ( type )
-    {
-    case MCi_type_CTL:
-    case MCi_type_STATUS:
-    case MCi_type_ADDR:
-    case MCi_type_MISC:
-        addr = MSR_IA32_MC0_CTL + (bank * 4) + type;
-        break;
-    case MCi_type_CTL2:
-        addr = MSR_IA32_MC0_CTL2 + bank;
-        break;
-    default:
-        addr = INVALID_MSR;
-        break;
-    }
-
-    return addr;
-}
-
-static int add_msr_intpose(xc_interface *xc_handle,
-                           uint32_t cpu_nr,
-                           uint32_t flags,
-                           uint64_t msr,
-                           uint64_t val,
-                           domid_t domid)
-{
-    uint32_t count;
-
-    if ( (msr_inj.mcinj_count &&
-          (cpu_nr != msr_inj.mcinj_cpunr || flags != msr_inj.mcinj_flags ||
-           domid != msr_inj.mcinj_domid)) ||
-         msr_inj.mcinj_count == MC_MSRINJ_MAXMSRS )
-    {
-        flush_msr_inj(xc_handle);
-        init_msr_inj();
-    }
-    count= msr_inj.mcinj_count;
-
-    if ( !count )
-    {
-        msr_inj.mcinj_cpunr = cpu_nr;
-        msr_inj.mcinj_flags = flags;
-        msr_inj.mcinj_domid = domid;
-    }
-    msr_inj.mcinj_msr[count].reg = msr;
-    msr_inj.mcinj_msr[count].value = val;
-    msr_inj.mcinj_count++;
-
-    return 0;
-}
-
-static int add_msr_bank_intpose(xc_interface *xc_handle,
-                                uint32_t cpu_nr,
-                                uint32_t flags,
-                                uint32_t type,
-                                uint32_t bank,
-                                uint64_t val,
-                                domid_t domid)
-{
-    uint64_t msr;
-
-    msr = bank_addr(bank, type);
-    if ( msr == INVALID_MSR )
-        return -1;
-    return add_msr_intpose(xc_handle, cpu_nr, flags, msr, val, domid);
-}
-
-static int inject_mcg_status(xc_interface *xc_handle,
-                             uint32_t cpu_nr,
-                             uint64_t val,
-                             domid_t domid)
-{
-    return add_msr_intpose(xc_handle, cpu_nr, MC_MSRINJ_F_INTERPOSE,
-                           MSR_IA32_MCG_STATUS, val, domid);
-}
-
-static int inject_mci_status(xc_interface *xc_handle,
-                             uint32_t cpu_nr,
-                             uint64_t bank,
-                             uint64_t val,
-                             domid_t domid)
-{
-    return add_msr_bank_intpose(xc_handle, cpu_nr, MC_MSRINJ_F_INTERPOSE,
-                                MCi_type_STATUS, bank, val, domid);
-}
-
-static int inject_mci_misc(xc_interface *xc_handle,
-                           uint32_t cpu_nr,
-                           uint64_t bank,
-                           uint64_t val,
-                           domid_t domid)
-{
-    return add_msr_bank_intpose(xc_handle, cpu_nr, MC_MSRINJ_F_INTERPOSE,
-                                MCi_type_MISC, bank, val, domid);
-}
-
-static int inject_mci_addr(xc_interface *xc_handle,
-                           uint32_t cpu_nr,
-                           uint64_t bank,
-                           uint64_t val,
-                           domid_t domid)
-{
-    return add_msr_bank_intpose(xc_handle, cpu_nr,
-                                MC_MSRINJ_F_INTERPOSE |
-                                ((domid >= DOMID_FIRST_RESERVED &&
-                                  domid != DOMID_SELF) ?
-                                 0 : MC_MSRINJ_F_GPADDR),
-                                MCi_type_ADDR, bank, val, domid);
-}
-
-static int inject(xc_interface *xc_handle, struct mce_info *mce,
-                  uint32_t cpu_nr, uint32_t domain, uint64_t gaddr)
-{
-    int ret = 0;
-    uint8_t mcg_status = mce->mcg_stat;
-
-    if ( lmce )
-    {
-        if ( mce->cmci )
-            err(xc_handle, "No support to inject CMCI as LMCE");
-        mcg_status |= MCG_STATUS_LMCE;
-    }
-    ret = inject_mcg_status(xc_handle, cpu_nr, mcg_status, domain);
-    if ( ret )
-        err(xc_handle, "Failed to inject MCG_STATUS MSR");
-
-    ret = inject_mci_status(xc_handle, cpu_nr,
-                            mce->bank, mce->mci_stat, domain);
-    if ( ret )
-        err(xc_handle, "Failed to inject MCi_STATUS MSR");
-
-    ret = inject_mci_misc(xc_handle, cpu_nr,
-                          mce->bank, mce->mci_misc, domain);
-    if ( ret )
-        err(xc_handle, "Failed to inject MCi_MISC MSR");
-
-    ret = inject_mci_addr(xc_handle, cpu_nr, mce->bank, gaddr, domain);
-    if ( ret )
-        err(xc_handle, "Failed to inject MCi_ADDR MSR");
-
-    ret = flush_msr_inj(xc_handle);
-    if ( ret )
-        err(xc_handle, "Failed to inject MSR");
-    if ( mce->cmci )
-        ret = inject_cmci(xc_handle, cpu_nr);
-    else if ( lmce )
-        ret = inject_lmce(xc_handle, cpu_nr);
-    else
-        ret = inject_mce(xc_handle, cpu_nr);
-    if ( ret )
-        err(xc_handle, "Failed to inject MCE error");
-
-    return 0;
-}
-
-static long xs_get_dom_mem(int domid)
-{
-    char path[128];
-    char *memstr;
-    uint64_t mem;
-    unsigned int plen;
-    struct xs_handle *xs;
-
-    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_close(xs);
-
-    if (!memstr || !plen)
-        return -1;
-
-    mem = atoll(memstr)*1024;
-    free(memstr);
-
-    return mem;
-}
-
-static struct option opts[] = {
-    {"cpu", 0, 0, 'c'},
-    {"domain", 0, 0, 'd'},
-    {"dump", 0, 0, 'D'},
-    {"help", 0, 0, 'h'},
-    {"page", 0, 0, 'p'},
-    {"lmce", 0, 0, 'l'},
-    {"", 0, 0, '\0'}
-};
-
-static void help(void)
-{
-    unsigned int i;
-
-    printf("Usage: xen-mceinj [OPTION]...\n"
-           "\n"
-           "Mandatory arguments to long options are mandatory"
-           "for short options too.\n"
-           "  -D, --dump           dump addr info without error injection\n"
-           "  -c, --cpu=CPU        target CPU\n"
-           "  -d, --domain=DOMID   target domain, the default is Xen itself\n"
-           "  -h, --help           print this page\n"
-           "  -p, --page=ADDR      physical address to report\n"
-           "  -l, --lmce           inject as LMCE (Intel only)\n"
-           "  -t, --type=ERROR     error type\n");
-
-    for ( i = 0; i < MCE_TABLE_SIZE; i++ )
-        printf("                       %2d : %s\n",
-               i, mce_table[i].description);
-}
-
-int main(int argc, char *argv[])
-{
-    int type = 0;
-    int c, opt_index;
-    uint32_t domid;
-    xc_interface *xc_handle;
-    unsigned int cpu_nr;
-    uint64_t gaddr, max_gpa;
-
-    /* Default Value */
-    domid = DOMID_XEN;
-    gaddr = 0x180020;
-    cpu_nr = 0;
-
-    init_msr_inj();
-    xc_handle = xc_interface_open(0, 0, 0);
-    if ( !xc_handle ) {
-        Lprintf("Failed to get xc interface");
-        exit(EXIT_FAILURE);
-    }
-
-    while ( 1 ) {
-        c = getopt_long(argc, argv, "c:Dd:t:hp:l", opts, &opt_index);
-        if ( c == -1 )
-            break;
-        switch ( c ) {
-        case 'D':
-            dump=1;
-            break;
-        case 'c':
-            cpu_nr = strtoul(optarg, &optarg, 10);
-            if ( strlen(optarg) != 0 )
-                err(xc_handle, "Please input a digit parameter for CPU");
-            break;
-        case 'd':
-            domid = strtol(optarg, &optarg, 10);
-            if ( strlen(optarg) != 0 )
-                err(xc_handle, "Please input a digit parameter for domain");
-            break;
-        case 'p':
-            gaddr = strtol(optarg, &optarg, 0);
-            if ( strlen(optarg) != 0 )
-                err(xc_handle, "Please input correct page address");
-            break;
-        case 't':
-            type = strtol(optarg, NULL, 0);
-            break;
-        case 'l':
-            lmce = 1;
-            break;
-        case 'h':
-        default:
-            help();
-            return 0;
-        }
-    }
-
-    if ( domid != DOMID_XEN ) {
-        max_gpa = xs_get_dom_mem(domid);
-        Lprintf("get domain %d max gpa is: 0x%lx", domid, max_gpa);
-        if ( gaddr >= max_gpa )
-            err(xc_handle, "Fail: gaddr exceeds max_gpa 0x%lx", max_gpa);
-    }
-    Lprintf("get gaddr of error inject is: 0x%lx", gaddr);
-
-    if ( dump ) {
-        if ( domid == DOMID_XEN )
-            Lprintf("Xen: gaddr=0x%lx", gaddr);
-        else
-            Lprintf("Dom%d: gaddr=0x%lx", domid, gaddr);
-        goto out;
-    }
-
-    if ( type < 0 || type >= MCE_TABLE_SIZE ) {
-        err(xc_handle, "Unsupported error type");
-        goto out;
-    }
-
-    inject(xc_handle, &mce_table[type], cpu_nr, domid, gaddr);
-
- out:
-    xc_interface_close(xc_handle);
-    return 0;
-}
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:47:45 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:47:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158885.292333 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5ryD-0004xj-6I; Tue, 20 Jul 2021 15:47:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158885.292333; Tue, 20 Jul 2021 15:47:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5ryD-0004xb-3L; Tue, 20 Jul 2021 15:47:45 +0000
Received: by outflank-mailman (input) for mailman id 158885;
 Tue, 20 Jul 2021 15:47:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ryC-0004xV-CT
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:47:44 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ryC-0004PE-BY
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:47:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ryC-0001QM-B0
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:47: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=E3B9pZzseiv1YQqHyo37vq9VhM/ScnkyqMaa/rmNamM=; b=glRnM5YtDEIw57319PaBl/N/UJ
	R8UWMZk1pb9qO9RreWDq8CctjM2ASmssPREXkLD2s2CcHhAkVN1wzYuNNJMHlbodRSxCNdTq4neGZ
	xfK+TrQesudCiCe3R4ek7IRCoXi99KSbkCddFJenOguzb1nQxAELG0Qtd52QJnRbLMHw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tests/resource: Rework Makefile
Message-Id: <E1m5ryC-0001QM-B0@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:47:44 +0000

commit ff759953b32286f376fda7f3ff5a17eccb542b03
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 15 15:22:11 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 16:38:27 2021 +0100

    tests/resource: Rework Makefile
    
    In particular, fill in the install/uninstall rules so this test can be
    packaged to be automated sensibly.
    
    Make all object files depend on the Makefile, drop redundant -f's for $(RM),
    and use $(TARGET) when appropriate.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 tools/tests/resource/Makefile | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/tests/resource/Makefile b/tools/tests/resource/Makefile
index 4bef482966..1c3aee4ff7 100644
--- a/tools/tests/resource/Makefile
+++ b/tools/tests/resource/Makefile
@@ -12,17 +12,20 @@ run: $(TARGET)
 
 .PHONY: clean
 clean:
-	$(RM) -f -- *.o $(TARGET) $(DEPS_RM)
+	$(RM) -- *.o $(TARGET) $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
-	$(RM) -f -- *~
+	$(RM) -- *~
 
 .PHONY: install
 install: all
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_PROG) $(TARGET) $(DESTDIR)$(LIBEXEC_BIN)
 
 .PHONY: uninstall
 uninstall:
+	$(RM) -- $(DESTDIR)$(LIBEXEC_BIN)/$(TARGET)
 
 CFLAGS += -Werror
 CFLAGS += $(CFLAGS_xeninclude)
@@ -34,7 +37,9 @@ LDFLAGS += $(LDLIBS_libxenctrl)
 LDFLAGS += $(LDLIBS_libxenforeignmemory)
 LDFLAGS += $(APPEND_LDFLAGS)
 
-test-resource: test-resource.o
+%.o: Makefile
+
+$(TARGET): test-resource.o
 	$(CC) -o $@ $< $(LDFLAGS)
 
 -include $(DEPS_INCLUDE)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:47:55 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:47:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158887.292355 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5ryN-0005SL-LQ; Tue, 20 Jul 2021 15:47:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158887.292355; Tue, 20 Jul 2021 15:47:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5ryN-0005SE-IO; Tue, 20 Jul 2021 15:47:55 +0000
Received: by outflank-mailman (input) for mailman id 158887;
 Tue, 20 Jul 2021 15:47:54 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ryM-0005Ri-FG
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:47:54 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ryM-0004PS-EV
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:47:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ryM-0001Qy-Do
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:47: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=b7iTyFtQhpdJnYwUd7yunteWFV06s6tGMFhz+X9Xgrc=; b=XvkzsZk9tuFDscbHCoRwE4XTlK
	fapA+xGqPDw0agfGprZnnNfdQf2MXZE9KKNQcp0gKJCuZRmp3GzlbNknij5STTfFtirs/7G8WzzVQ
	UZDyArpEJLGHqdCZuqKqtV8QSJ5zLUBGm8cxE+xXHLeIdBF86nQPc9bVflekpdSUrsxs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tests/cpu-policy: Rework Makefile
Message-Id: <E1m5ryM-0001Qy-Do@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:47:54 +0000

commit 6a9f5477637a9f2d1d61c0a065eeb01bf84f6484
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 15 15:37:49 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 16:38:27 2021 +0100

    tests/cpu-policy: Rework Makefile
    
    In particular, fill in the install/uninstall rules so this test can be
    packaged to be automated sensibly.
    
    Rework TARGET-y to be TARGETS, drop redundant -f's for $(RM), drop the
    unconditional -O3 and use the default instead, and drop CFLAGS from the link
    line but honour APPEND_LDFLAGS.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 tools/tests/cpu-policy/Makefile | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/tools/tests/cpu-policy/Makefile b/tools/tests/cpu-policy/Makefile
index 70ff154da6..93af9d76fa 100644
--- a/tools/tests/cpu-policy/Makefile
+++ b/tools/tests/cpu-policy/Makefile
@@ -1,21 +1,19 @@
 XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-TARGET-y := test-cpu-policy
+TARGETS :=
 
 # For brevity, these tests make extensive use of designated initialisers in
 # anonymous unions, but GCCs older than 4.6 can't cope.  Ignore the test in
 # this case.
-ifneq ($(clang),y)
-TARGET-$(call cc-ver,$(CC),lt,0x040600) :=
-endif
-
-ifeq ($(TARGET-y),)
+ifneq ($(gcc)$(call cc-ver,$(CC),lt,0x040600),yy)
+TARGETS += test-cpu-policy
+else
 $(warning Test harness not built, use newer compiler than "$(CC)" (version $(shell $(CC) -dumpversion)))
 endif
 
 .PHONY: all
-all: $(TARGET-y)
+all: $(TARGETS)
 
 .PHONY: run
 run: $(TARGET-y)
@@ -23,23 +21,32 @@ run: $(TARGET-y)
 
 .PHONY: clean
 clean:
-	$(RM) -f -- *.o .*.d .*.d2 test-cpu-policy
+	$(RM) -- *.o $(TARGETS) $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
-	$(RM) -f -- *~
+	$(RM) -- *~
 
 .PHONY: install
 install: all
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(if $(TARGETS),$(INSTALL_PROG) $(TARGETS) $(DESTDIR)$(LIBEXEC_BIN))
 
 .PHONY: uninstall
+uninstall:
+	$(RM) -- $(addprefix $(DESTDIR)$(LIBEXEC_BIN)/,$(TARGETS))
 
-CFLAGS += -Werror $(CFLAGS_xeninclude) -D__XEN_TOOLS__ -O3
+CFLAGS += -Werror -D__XEN_TOOLS__
+CFLAGS += $(CFLAGS_xeninclude)
 CFLAGS += $(APPEND_CFLAGS)
 
+LDFLAGS += $(APPEND_LDFLAGS)
+
 vpath %.c ../../../xen/lib/x86
 
+%.o: Makefile
+
 test-cpu-policy: test-cpu-policy.o msr.o cpuid.o policy.o
-	$(CC) $(CFLAGS) $^ -o $@
+	$(CC) $^ -o $@ $(LDFLAGS)
 
 -include $(DEPS_INCLUDE)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:48:05 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:48:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158890.292361 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5ryX-0005cP-OE; Tue, 20 Jul 2021 15:48:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158890.292361; Tue, 20 Jul 2021 15:48:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5ryX-0005cF-K7; Tue, 20 Jul 2021 15:48:05 +0000
Received: by outflank-mailman (input) for mailman id 158890;
 Tue, 20 Jul 2021 15:48:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ryW-0005bT-IE
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:48:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ryW-0004QB-HT
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:48:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ryW-0001T9-Gp
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:48: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Vd5AvffAJfzE4kMB4c5raGxpgmRwVQ95Ri5AlBM4B7I=; b=Ht73k7RGtSC+YtoTQa1RkYmyrE
	uaeyFBAsOJkmvPwvmzySIbVcUdTq6rixW+mRty5XF1FRpovStaMUkEhBHxK7uu3diSYglCLY64tEm
	TrdTLEdmS9TmYAOoEywNx2FwN2c/ABEKo/LWwX94nO9Vbu0DDaVGqpSXy/abMBbnOzxU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tests/xenstore: Rework Makefile
Message-Id: <E1m5ryW-0001T9-Gp@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:48:04 +0000

commit 93c9edbef51b31056f93a37a778326c90a83158c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 15 16:02:29 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 9 16:38:27 2021 +0100

    tests/xenstore: Rework Makefile
    
    In particular, fill in the install/uninstall rules so this test can be
    packaged to be automated sensibly.
    
    This causes the code to be noticed by CI, which objects as follows:
    
      test-xenstore.c: In function 'main':
      test-xenstore.c:486:5: error: ignoring return value of 'asprintf', declared
      with attribute warn_unused_result [-Werror=unused-result]
           asprintf(&path, "%s/%u", TEST_PATH, getpid());
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Address the CI failure by checking the asprintf() return value and exiting.
    
    Rename xs-test to test-xenstore to be consistent with other tests.  Honour
    APPEND_FLAGS too.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 .gitignore                           |   1 -
 tools/tests/xenstore/.gitignore      |   1 +
 tools/tests/xenstore/Makefile        |  31 +-
 tools/tests/xenstore/test-xenstore.c | 541 +++++++++++++++++++++++++++++++++++
 tools/tests/xenstore/xs-test.c       | 537 ----------------------------------
 5 files changed, 564 insertions(+), 547 deletions(-)

diff --git a/.gitignore b/.gitignore
index d4b90303b2..8ebb51b6c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -275,7 +275,6 @@ tools/tests/x86_emulator/*sse*.[ch]
 tools/tests/x86_emulator/test_x86_emulator
 tools/tests/x86_emulator/x86_emulate
 tools/tests/x86_emulator/xop*.[ch]
-tools/tests/xenstore/xs-test
 tools/tests/vpci/list.h
 tools/tests/vpci/vpci.[hc]
 tools/tests/vpci/test_vpci
diff --git a/tools/tests/xenstore/.gitignore b/tools/tests/xenstore/.gitignore
new file mode 100644
index 0000000000..4b44f5dd60
--- /dev/null
+++ b/tools/tests/xenstore/.gitignore
@@ -0,0 +1 @@
+test-xenstore
diff --git a/tools/tests/xenstore/Makefile b/tools/tests/xenstore/Makefile
index a367d88803..b9969dd090 100644
--- a/tools/tests/xenstore/Makefile
+++ b/tools/tests/xenstore/Makefile
@@ -1,11 +1,7 @@
 XEN_ROOT=$(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += -Werror
-
-CFLAGS += $(CFLAGS_libxenstore)
-
-TARGETS-y := xs-test
+TARGETS-y := test-xenstore
 TARGETS := $(TARGETS-y)
 
 .PHONY: all
@@ -16,14 +12,31 @@ build: $(TARGETS)
 
 .PHONY: clean
 clean:
-	$(RM) *.o $(TARGETS) *~ $(DEPS_RM)
+	$(RM) -- *.o $(TARGETS) $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
+	$(RM) -- *~
+
+.PHONY: install
+install: all
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(if $(TARGETS),$(INSTALL_PROG) $(TARGETS) $(DESTDIR)$(LIBEXEC_BIN))
+
+.PHONY: uninstall
+uninstall:
+	$(RM) -- $(addprefix $(DESTDIR)$(LIBEXEC_BIN)/,$(TARGETS))
+
+CFLAGS += -Werror
+CFLAGS += $(CFLAGS_libxenstore)
+CFLAGS += $(APPEND_CFLAGS)
+
+LDFLAGS += $(LDLIBS_libxenstore)
+LDFLAGS += $(APPEND_LDFLAGS)
 
-xs-test: xs-test.o Makefile
-	$(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenstore)
+%.o: Makefile
 
-install uninstall:
+test-xenstore: test-xenstore.o
+	$(CC) -o $@ $< $(LDFLAGS)
 
 -include $(DEPS_INCLUDE)
diff --git a/tools/tests/xenstore/test-xenstore.c b/tools/tests/xenstore/test-xenstore.c
new file mode 100644
index 0000000000..d3574b3fa2
--- /dev/null
+++ b/tools/tests/xenstore/test-xenstore.c
@@ -0,0 +1,541 @@
+/*
+ * xs-test.c
+ *
+ * Do Xenstore tests.
+ *
+ * Copyright (C) 2016  Juergen Gross <jgross@suse.com>,
+ *                     SUSE Linux GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms and conditions of the GNU General Public
+ * License, version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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/>.
+ */
+
+#define _GNU_SOURCE
+#include <err.h>
+#include <getopt.h>
+#include <inttypes.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <time.h>
+#include <xenstore.h>
+
+#include <xen-tools/libs.h>
+
+#define TEST_PATH "xenstore-test"
+#define WRITE_BUFFERS_N    10
+#define WRITE_BUFFERS_SIZE 4000
+#define MAX_TA_LOOPS       100
+
+struct test {
+    char *name;
+    int (*func_init)(uintptr_t par);
+    int (*func)(uintptr_t par);
+    int (*func_deinit)(uintptr_t par);
+    uintptr_t par;
+    char *descr;
+};
+
+static struct xs_handle *xsh;
+static char *path;
+static char *paths[WRITE_BUFFERS_N];
+static char write_buffers[WRITE_BUFFERS_N][WRITE_BUFFERS_SIZE];
+static int ta_loops;
+
+static struct option options[] = {
+    { "list-tests", 0, NULL, 'l' },
+    { "test", 1, NULL, 't' },
+    { "random", 1, NULL, 'r' },
+    { "help", 0, NULL, 'h' },
+    { "iterations", 1, NULL, 'i' },
+    { NULL, 0, NULL, 0 }
+};
+
+static int call_test(struct test *tst, int iters, bool no_clock)
+{
+    char *stage = "?";
+    struct timespec tp1, tp2;
+    uint64_t nsec, nsec_min, nsec_max, nsec_sum;
+    int i, ret = 0;
+
+    nsec_min = -1;
+    nsec_max = 0;
+    nsec_sum = 0;
+
+    for ( i = 0; i < iters; i++ )
+    {
+        stage = "pre-init";
+        xs_rm(xsh, XBT_NULL, path);
+        if ( !xs_write(xsh, XBT_NULL, path, "", 0) )
+        {
+            ret = errno;
+            break;
+        }
+        stage = "init";
+        ret = tst->func_init(tst->par);
+        if ( ret )
+            break;
+        if ( clock_gettime(CLOCK_REALTIME, &tp1) )
+            no_clock = true;
+        stage = "run";
+        ret = tst->func(tst->par);
+        if ( ret )
+            break;
+        if ( clock_gettime(CLOCK_REALTIME, &tp2) )
+            no_clock = true;
+        if ( !no_clock )
+        {
+            nsec = tp2.tv_sec * 1000000000 + tp2.tv_nsec -
+                   tp1.tv_sec * 1000000000 - tp1.tv_nsec;
+            if ( nsec < nsec_min )
+                nsec_min = nsec;
+            if ( nsec > nsec_max )
+                nsec_max = nsec;
+            nsec_sum += nsec;
+        }
+        stage = "deinit";
+        ret = tst->func_deinit(tst->par);
+        if ( ret )
+            break;
+    }
+
+    if ( ret )
+        printf("%-10s: failed (ret = %d, stage %s)\n", tst->name, ret, stage);
+    else if ( !no_clock )
+    {
+        printf("%-10s:", tst->name);
+        if ( iters > 1 )
+            printf(" avg: %"PRIu64" ns (%"PRIu64" ns .. %"PRIu64" ns)",
+                   nsec_sum / iters, nsec_min, nsec_max);
+        else
+            printf(" %"PRIu64" ns", nsec_sum);
+        printf("\n");
+    }
+
+    return ret;
+}
+
+static void usage(int ret)
+{
+    FILE *out;
+
+    out = ret ? stderr : stdout;
+
+    fprintf(out, "usage: xs-test [<options>]\n");
+    fprintf(out, "  <options> are:\n");
+    fprintf(out, "  -i|--iterations <i>  perform each test <i> times (default 1)\n");
+    fprintf(out, "  -l|--list-tests      list available tests\n");
+    fprintf(out, "  -r|--random <time>   perform random tests for <time> seconds\n");
+    fprintf(out, "  -t|--test <test>     run <test> (default is all tests)\n");
+    fprintf(out, "  -h|--help            print this usage information\n");
+    exit(ret);
+}
+
+static int ret0(uintptr_t par)
+{
+    return 0;
+}
+
+static int verify_node(char *node, char *data, unsigned int size)
+{
+    char *buf;
+    unsigned int len;
+    int ret;
+
+    buf = xs_read(xsh, XBT_NULL, node, &len);
+    if ( !buf )
+        return errno;
+
+    ret = (len == size && !memcmp(buf, data, len)) ? 0 : ENOENT;
+    free(buf);
+
+    return ret;
+}
+
+static int test_read_init(uintptr_t par)
+{
+    if ( par > WRITE_BUFFERS_SIZE )
+        return EFBIG;
+    return xs_write(xsh, XBT_NULL, paths[0], write_buffers[0], par) ? 0 : errno;
+}
+
+static int test_read(uintptr_t par)
+{
+    char *buf;
+    unsigned int len;
+
+    buf = xs_read(xsh, XBT_NULL, paths[0], &len);
+    if ( !buf )
+        return errno;
+    free(buf);
+    return 0;
+}
+
+#define test_read_deinit ret0
+
+static int test_write_init(uintptr_t par)
+{
+    return (par > WRITE_BUFFERS_SIZE) ? EFBIG : 0;
+}
+
+static int test_write(uintptr_t par)
+{
+    return xs_write(xsh, XBT_NULL, paths[0], write_buffers[0], par) ? 0 : errno;
+}
+
+static int test_write_deinit(uintptr_t par)
+{
+    return verify_node(paths[0], write_buffers[0], par);
+}
+
+static int test_dir_init(uintptr_t par)
+{
+    unsigned int i;
+
+    for ( i = 0; i < WRITE_BUFFERS_N; i++ )
+        if ( !xs_write(xsh, XBT_NULL, paths[i], write_buffers[i], 1) )
+            return errno;
+
+    return 0;
+}
+
+static int test_dir(uintptr_t par)
+{
+    char **dir;
+    unsigned int num;
+
+    dir = xs_directory(xsh, XBT_NULL, path, &num);
+    if ( !dir )
+        return errno;
+
+    free(dir);
+    return 0;
+}
+
+static int test_dir_deinit(uintptr_t par)
+{
+    char **dir;
+    unsigned int i, j, num;
+    int rc = 0;
+
+    dir = xs_directory(xsh, XBT_NULL, path, &num);
+    if ( !dir )
+        return errno;
+
+    for ( j = 0; j < WRITE_BUFFERS_N; j++ )
+    {
+        for ( i = 0; i < num; i++ )
+            if ( dir[i][0] == 'a' + j && dir[i][1] == 0 )
+                break;
+        if ( i == num )
+            rc = ENOENT;
+    }
+    if ( num != WRITE_BUFFERS_N )
+            rc = ENOENT;
+    free(dir);
+    return rc;
+}
+
+static int test_rm_init(uintptr_t par)
+{
+    unsigned int i;
+
+    if ( par > WRITE_BUFFERS_N )
+        return EFBIG;
+
+    for ( i = 0; i < par; i++ )
+        if ( xs_write(xsh, XBT_NULL, paths[i], write_buffers[i], 1) )
+            return errno;
+
+    return 0;
+}
+
+static int test_rm(uintptr_t par)
+{
+    if ( !xs_rm(xsh, XBT_NULL, path) )
+        return errno;
+
+    return 0;
+}
+
+#define test_rm_deinit ret0
+
+#define test_ta1_init ret0
+
+static int test_ta1(uintptr_t par)
+{
+    xs_transaction_t t;
+    int l;
+
+    for ( l = 0; l < MAX_TA_LOOPS; l++ )
+    {
+        t = xs_transaction_start(xsh);
+        if ( t == XBT_NULL )
+            return errno;
+        if ( xs_transaction_end(xsh, t, par ? true : false) )
+            return 0;
+        if ( errno != EAGAIN )
+            return errno;
+    }
+
+    ta_loops++;
+    return 0;
+}
+
+#define test_ta1_deinit ret0
+
+static int test_ta2_init(uintptr_t par)
+{
+    return xs_write(xsh, XBT_NULL, paths[0], write_buffers[0], 1) ? 0 : errno;
+}
+
+static int test_ta2(uintptr_t par)
+{
+    xs_transaction_t t;
+    char *buf;
+    unsigned int len;
+    int ret;
+    int l;
+
+    for ( l = 0; l < MAX_TA_LOOPS; l++ )
+    {
+        t = xs_transaction_start(xsh);
+        if ( t == XBT_NULL )
+            return errno;
+        buf = xs_read(xsh, t, paths[0], &len);
+        if ( !buf )
+            goto out;
+        free(buf);
+        if ( !xs_write(xsh, t, paths[0], "b", 1) )
+            goto out;
+        buf = xs_read(xsh, t, paths[0], &len);
+        if ( !buf )
+            goto out;
+        errno = (len == 1 && buf[0] == 'b') ? 0 : ENOENT;
+        free(buf);
+        if ( errno )
+            goto out;
+        buf = xs_read(xsh, XBT_NULL, paths[0], &len);
+        if ( !buf )
+            goto out;
+        errno = (len == 1 && buf[0] == 'a') ? 0 : ENOENT;
+        free(buf);
+        if ( errno )
+            goto out;
+        if ( xs_transaction_end(xsh, t, par ? true : false) )
+            return 0;
+        if ( errno != EAGAIN )
+            return errno;
+    }
+
+    ta_loops++;
+    return 0;
+
+ out:
+    ret = errno;
+    xs_transaction_end(xsh, t, true);
+    return ret;
+}
+
+static int test_ta2_deinit(uintptr_t par)
+{
+    return verify_node(paths[0], par ? "a" : "b", 1);
+}
+
+static int test_ta3_init(uintptr_t par)
+{
+    return xs_write(xsh, XBT_NULL, paths[0], write_buffers[0], 1) ? 0 : errno;
+}
+
+static int test_ta3(uintptr_t par)
+{
+    xs_transaction_t t;
+    char *buf;
+    unsigned int len;
+    int ret;
+
+    t = xs_transaction_start(xsh);
+    if ( t == XBT_NULL )
+        return errno;
+    buf = xs_read(xsh, t, paths[0], &len);
+    if ( !buf )
+        goto out;
+    free(buf);
+    if ( !xs_write(xsh, XBT_NULL, paths[0], "b", 1) )
+        goto out;
+    buf = xs_read(xsh, t, paths[0], &len);
+    if ( !buf )
+        goto out;
+    errno = (len == 1 && buf[0] == 'a') ? 0 : ENOENT;
+    free(buf);
+    if ( errno )
+        goto out;
+    if ( !xs_write(xsh, t, paths[0], "c", 1) )
+        goto out;
+    buf = xs_read(xsh, t, paths[0], &len);
+    if ( !buf )
+        goto out;
+    errno = (len == 1 && buf[0] == 'c') ? 0 : ENOENT;
+    free(buf);
+    if ( errno )
+        goto out;
+    if ( xs_transaction_end(xsh, t, false) || errno != EAGAIN )
+        return ENOENT;
+    return 0;
+
+ out:
+    ret = errno;
+    xs_transaction_end(xsh, t, true);
+    return ret;
+}
+
+static int test_ta3_deinit(uintptr_t par)
+{
+    return verify_node(paths[0], "b", 1);
+}
+
+#define TEST(s, f, p, l) { s, f ## _init, f, f ## _deinit, (uintptr_t)(p), l }
+struct test tests[] = {
+TEST("read 1", test_read, 1, "Read node with 1 byte data"),
+TEST("read 3000", test_read, 3000, "Read node with 3000 bytes data"),
+TEST("write 1", test_write, 1, "Write node with 1 byte data"),
+TEST("write 3000", test_write, 3000, "Write node with 3000 bytes data"),
+TEST("dir", test_dir, 0, "List directory"),
+TEST("rm node", test_rm, 0, "Remove single node"),
+TEST("rm dir", test_rm, WRITE_BUFFERS_N, "Remove node with sub-nodes"),
+TEST("ta empty", test_ta1, 0, "Empty transaction"),
+TEST("ta empty x", test_ta1, 1, "Empty transaction abort"),
+TEST("ta rmw", test_ta2, 0, "Read-modify-write transaction"),
+TEST("ta rmw x", test_ta2, 1, "Read-modify-write transaction abort"),
+TEST("ta err", test_ta3, 0, "Transaction with conflict"),
+};
+
+static void cleanup(void)
+{
+    xs_transaction_t t;
+    char **dir;
+    unsigned int num;
+
+    xs_rm(xsh, XBT_NULL, path);
+
+    while ( true )
+    {
+        t = xs_transaction_start(xsh);
+        if ( t == XBT_NULL )
+            return;
+
+        dir = xs_directory(xsh, t, TEST_PATH, &num);
+        if ( dir && !num )
+            xs_rm(xsh, t, TEST_PATH);
+        free(dir);
+
+        if ( xs_transaction_end(xsh, t, false) || errno != EAGAIN )
+            return;
+    }
+}
+
+int main(int argc, char *argv[])
+{
+    int opt, t, iters = 1, ret = 0, randtime = 0;
+    char *test = NULL;
+    bool list = false;
+    time_t stop;
+
+    while ( (opt = getopt_long(argc, argv, "lr:t:hi:", options,
+                               NULL)) != -1 )
+    {
+        switch ( opt )
+        {
+        case 'i':
+            iters = atoi(optarg);
+            break;
+        case 'l':
+            list = true;
+            break;
+        case 'r':
+            randtime = atoi(optarg);
+            break;
+        case 't':
+            test = optarg;
+            break;
+        case 'h':
+            usage(0);
+            break;
+        }
+    }
+    if ( optind != argc )
+        usage(1);
+
+    if ( list )
+    {
+        for ( t = 0; t < ARRAY_SIZE(tests); t++ )
+            printf("%-10s: %s\n", tests[t].name, tests[t].descr);
+        return 0;
+    }
+
+    if ( asprintf(&path, "%s/%u", TEST_PATH, getpid()) < 0 )
+        err(2, "asprintf() malloc failure\n");
+
+    for ( t = 0; t < WRITE_BUFFERS_N; t++ )
+    {
+        memset(write_buffers[t], 'a' + t, WRITE_BUFFERS_SIZE);
+        if ( asprintf(&paths[t], "%s/%c", path, 'a' + t) < 0 )
+            err(2, "asprintf() malloc failure\n");
+    }
+
+    xsh = xs_open(0);
+    if ( !xsh )
+    {
+        fprintf(stderr, "could not connect to xenstore\n");
+        exit(2);
+    }
+
+    if ( randtime )
+    {
+        stop = time(NULL) + randtime;
+        srandom((unsigned int)stop);
+
+        while ( time(NULL) < stop )
+        {
+            t = random() % ARRAY_SIZE(tests);
+            ret = call_test(tests + t, iters, true);
+        }
+    }
+    else
+        for ( t = 0; t < ARRAY_SIZE(tests); t++ )
+        {
+            if ( !test || !strcmp(test, tests[t].name) )
+                ret = call_test(tests + t, iters, false);
+        }
+
+    if ( !ret )
+        cleanup();
+
+    xs_close(xsh);
+
+    if ( ta_loops )
+        printf("Exhaustive transaction retries (%d) occurrred %d times.\n",
+               MAX_TA_LOOPS, ta_loops);
+
+    return 0;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/tests/xenstore/xs-test.c b/tools/tests/xenstore/xs-test.c
deleted file mode 100644
index c4c99c0661..0000000000
--- a/tools/tests/xenstore/xs-test.c
+++ /dev/null
@@ -1,537 +0,0 @@
-/*
- * xs-test.c
- *
- * Do Xenstore tests.
- *
- * Copyright (C) 2016  Juergen Gross <jgross@suse.com>,
- *                     SUSE Linux GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms and conditions of the GNU General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope 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/>.
- */
-
-#define _GNU_SOURCE
-#include <getopt.h>
-#include <inttypes.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <time.h>
-#include <xenstore.h>
-
-#include <xen-tools/libs.h>
-
-#define TEST_PATH "xenstore-test"
-#define WRITE_BUFFERS_N    10
-#define WRITE_BUFFERS_SIZE 4000
-#define MAX_TA_LOOPS       100
-
-struct test {
-    char *name;
-    int (*func_init)(uintptr_t par);
-    int (*func)(uintptr_t par);
-    int (*func_deinit)(uintptr_t par);
-    uintptr_t par;
-    char *descr;
-};
-
-static struct xs_handle *xsh;
-static char *path;
-static char *paths[WRITE_BUFFERS_N];
-static char write_buffers[WRITE_BUFFERS_N][WRITE_BUFFERS_SIZE];
-static int ta_loops;
-
-static struct option options[] = {
-    { "list-tests", 0, NULL, 'l' },
-    { "test", 1, NULL, 't' },
-    { "random", 1, NULL, 'r' },
-    { "help", 0, NULL, 'h' },
-    { "iterations", 1, NULL, 'i' },
-    { NULL, 0, NULL, 0 }
-};
-
-static int call_test(struct test *tst, int iters, bool no_clock)
-{
-    char *stage = "?";
-    struct timespec tp1, tp2;
-    uint64_t nsec, nsec_min, nsec_max, nsec_sum;
-    int i, ret = 0;
-
-    nsec_min = -1;
-    nsec_max = 0;
-    nsec_sum = 0;
-
-    for ( i = 0; i < iters; i++ )
-    {
-        stage = "pre-init";
-        xs_rm(xsh, XBT_NULL, path);
-        if ( !xs_write(xsh, XBT_NULL, path, "", 0) )
-        {
-            ret = errno;
-            break;
-        }
-        stage = "init";
-        ret = tst->func_init(tst->par);
-        if ( ret )
-            break;
-        if ( clock_gettime(CLOCK_REALTIME, &tp1) )
-            no_clock = true;
-        stage = "run";
-        ret = tst->func(tst->par);
-        if ( ret )
-            break;
-        if ( clock_gettime(CLOCK_REALTIME, &tp2) )
-            no_clock = true;
-        if ( !no_clock )
-        {
-            nsec = tp2.tv_sec * 1000000000 + tp2.tv_nsec -
-                   tp1.tv_sec * 1000000000 - tp1.tv_nsec;
-            if ( nsec < nsec_min )
-                nsec_min = nsec;
-            if ( nsec > nsec_max )
-                nsec_max = nsec;
-            nsec_sum += nsec;
-        }
-        stage = "deinit";
-        ret = tst->func_deinit(tst->par);
-        if ( ret )
-            break;
-    }
-
-    if ( ret )
-        printf("%-10s: failed (ret = %d, stage %s)\n", tst->name, ret, stage);
-    else if ( !no_clock )
-    {
-        printf("%-10s:", tst->name);
-        if ( iters > 1 )
-            printf(" avg: %"PRIu64" ns (%"PRIu64" ns .. %"PRIu64" ns)",
-                   nsec_sum / iters, nsec_min, nsec_max);
-        else
-            printf(" %"PRIu64" ns", nsec_sum);
-        printf("\n");
-    }
-
-    return ret;
-}
-
-static void usage(int ret)
-{
-    FILE *out;
-
-    out = ret ? stderr : stdout;
-
-    fprintf(out, "usage: xs-test [<options>]\n");
-    fprintf(out, "  <options> are:\n");
-    fprintf(out, "  -i|--iterations <i>  perform each test <i> times (default 1)\n");
-    fprintf(out, "  -l|--list-tests      list available tests\n");
-    fprintf(out, "  -r|--random <time>   perform random tests for <time> seconds\n");
-    fprintf(out, "  -t|--test <test>     run <test> (default is all tests)\n");
-    fprintf(out, "  -h|--help            print this usage information\n");
-    exit(ret);
-}
-
-static int ret0(uintptr_t par)
-{
-    return 0;
-}
-
-static int verify_node(char *node, char *data, unsigned int size)
-{
-    char *buf;
-    unsigned int len;
-    int ret;
-
-    buf = xs_read(xsh, XBT_NULL, node, &len);
-    if ( !buf )
-        return errno;
-
-    ret = (len == size && !memcmp(buf, data, len)) ? 0 : ENOENT;
-    free(buf);
-
-    return ret;
-}
-
-static int test_read_init(uintptr_t par)
-{
-    if ( par > WRITE_BUFFERS_SIZE )
-        return EFBIG;
-    return xs_write(xsh, XBT_NULL, paths[0], write_buffers[0], par) ? 0 : errno;
-}
-
-static int test_read(uintptr_t par)
-{
-    char *buf;
-    unsigned int len;
-
-    buf = xs_read(xsh, XBT_NULL, paths[0], &len);
-    if ( !buf )
-        return errno;
-    free(buf);
-    return 0;
-}
-
-#define test_read_deinit ret0
-
-static int test_write_init(uintptr_t par)
-{
-    return (par > WRITE_BUFFERS_SIZE) ? EFBIG : 0;
-}
-
-static int test_write(uintptr_t par)
-{
-    return xs_write(xsh, XBT_NULL, paths[0], write_buffers[0], par) ? 0 : errno;
-}
-
-static int test_write_deinit(uintptr_t par)
-{
-    return verify_node(paths[0], write_buffers[0], par);
-}
-
-static int test_dir_init(uintptr_t par)
-{
-    unsigned int i;
-
-    for ( i = 0; i < WRITE_BUFFERS_N; i++ )
-        if ( !xs_write(xsh, XBT_NULL, paths[i], write_buffers[i], 1) )
-            return errno;
-
-    return 0;
-}
-
-static int test_dir(uintptr_t par)
-{
-    char **dir;
-    unsigned int num;
-
-    dir = xs_directory(xsh, XBT_NULL, path, &num);
-    if ( !dir )
-        return errno;
-
-    free(dir);
-    return 0;
-}
-
-static int test_dir_deinit(uintptr_t par)
-{
-    char **dir;
-    unsigned int i, j, num;
-    int rc = 0;
-
-    dir = xs_directory(xsh, XBT_NULL, path, &num);
-    if ( !dir )
-        return errno;
-
-    for ( j = 0; j < WRITE_BUFFERS_N; j++ )
-    {
-        for ( i = 0; i < num; i++ )
-            if ( dir[i][0] == 'a' + j && dir[i][1] == 0 )
-                break;
-        if ( i == num )
-            rc = ENOENT;
-    }
-    if ( num != WRITE_BUFFERS_N )
-            rc = ENOENT;
-    free(dir);
-    return rc;
-}
-
-static int test_rm_init(uintptr_t par)
-{
-    unsigned int i;
-
-    if ( par > WRITE_BUFFERS_N )
-        return EFBIG;
-
-    for ( i = 0; i < par; i++ )
-        if ( xs_write(xsh, XBT_NULL, paths[i], write_buffers[i], 1) )
-            return errno;
-
-    return 0;
-}
-
-static int test_rm(uintptr_t par)
-{
-    if ( !xs_rm(xsh, XBT_NULL, path) )
-        return errno;
-
-    return 0;
-}
-
-#define test_rm_deinit ret0
-
-#define test_ta1_init ret0
-
-static int test_ta1(uintptr_t par)
-{
-    xs_transaction_t t;
-    int l;
-
-    for ( l = 0; l < MAX_TA_LOOPS; l++ )
-    {
-        t = xs_transaction_start(xsh);
-        if ( t == XBT_NULL )
-            return errno;
-        if ( xs_transaction_end(xsh, t, par ? true : false) )
-            return 0;
-        if ( errno != EAGAIN )
-            return errno;
-    }
-
-    ta_loops++;
-    return 0;
-}
-
-#define test_ta1_deinit ret0
-
-static int test_ta2_init(uintptr_t par)
-{
-    return xs_write(xsh, XBT_NULL, paths[0], write_buffers[0], 1) ? 0 : errno;
-}
-
-static int test_ta2(uintptr_t par)
-{
-    xs_transaction_t t;
-    char *buf;
-    unsigned int len;
-    int ret;
-    int l;
-
-    for ( l = 0; l < MAX_TA_LOOPS; l++ )
-    {
-        t = xs_transaction_start(xsh);
-        if ( t == XBT_NULL )
-            return errno;
-        buf = xs_read(xsh, t, paths[0], &len);
-        if ( !buf )
-            goto out;
-        free(buf);
-        if ( !xs_write(xsh, t, paths[0], "b", 1) )
-            goto out;
-        buf = xs_read(xsh, t, paths[0], &len);
-        if ( !buf )
-            goto out;
-        errno = (len == 1 && buf[0] == 'b') ? 0 : ENOENT;
-        free(buf);
-        if ( errno )
-            goto out;
-        buf = xs_read(xsh, XBT_NULL, paths[0], &len);
-        if ( !buf )
-            goto out;
-        errno = (len == 1 && buf[0] == 'a') ? 0 : ENOENT;
-        free(buf);
-        if ( errno )
-            goto out;
-        if ( xs_transaction_end(xsh, t, par ? true : false) )
-            return 0;
-        if ( errno != EAGAIN )
-            return errno;
-    }
-
-    ta_loops++;
-    return 0;
-
- out:
-    ret = errno;
-    xs_transaction_end(xsh, t, true);
-    return ret;
-}
-
-static int test_ta2_deinit(uintptr_t par)
-{
-    return verify_node(paths[0], par ? "a" : "b", 1);
-}
-
-static int test_ta3_init(uintptr_t par)
-{
-    return xs_write(xsh, XBT_NULL, paths[0], write_buffers[0], 1) ? 0 : errno;
-}
-
-static int test_ta3(uintptr_t par)
-{
-    xs_transaction_t t;
-    char *buf;
-    unsigned int len;
-    int ret;
-
-    t = xs_transaction_start(xsh);
-    if ( t == XBT_NULL )
-        return errno;
-    buf = xs_read(xsh, t, paths[0], &len);
-    if ( !buf )
-        goto out;
-    free(buf);
-    if ( !xs_write(xsh, XBT_NULL, paths[0], "b", 1) )
-        goto out;
-    buf = xs_read(xsh, t, paths[0], &len);
-    if ( !buf )
-        goto out;
-    errno = (len == 1 && buf[0] == 'a') ? 0 : ENOENT;
-    free(buf);
-    if ( errno )
-        goto out;
-    if ( !xs_write(xsh, t, paths[0], "c", 1) )
-        goto out;
-    buf = xs_read(xsh, t, paths[0], &len);
-    if ( !buf )
-        goto out;
-    errno = (len == 1 && buf[0] == 'c') ? 0 : ENOENT;
-    free(buf);
-    if ( errno )
-        goto out;
-    if ( xs_transaction_end(xsh, t, false) || errno != EAGAIN )
-        return ENOENT;
-    return 0;
-
- out:
-    ret = errno;
-    xs_transaction_end(xsh, t, true);
-    return ret;
-}
-
-static int test_ta3_deinit(uintptr_t par)
-{
-    return verify_node(paths[0], "b", 1);
-}
-
-#define TEST(s, f, p, l) { s, f ## _init, f, f ## _deinit, (uintptr_t)(p), l }
-struct test tests[] = {
-TEST("read 1", test_read, 1, "Read node with 1 byte data"),
-TEST("read 3000", test_read, 3000, "Read node with 3000 bytes data"),
-TEST("write 1", test_write, 1, "Write node with 1 byte data"),
-TEST("write 3000", test_write, 3000, "Write node with 3000 bytes data"),
-TEST("dir", test_dir, 0, "List directory"),
-TEST("rm node", test_rm, 0, "Remove single node"),
-TEST("rm dir", test_rm, WRITE_BUFFERS_N, "Remove node with sub-nodes"),
-TEST("ta empty", test_ta1, 0, "Empty transaction"),
-TEST("ta empty x", test_ta1, 1, "Empty transaction abort"),
-TEST("ta rmw", test_ta2, 0, "Read-modify-write transaction"),
-TEST("ta rmw x", test_ta2, 1, "Read-modify-write transaction abort"),
-TEST("ta err", test_ta3, 0, "Transaction with conflict"),
-};
-
-static void cleanup(void)
-{
-    xs_transaction_t t;
-    char **dir;
-    unsigned int num;
-
-    xs_rm(xsh, XBT_NULL, path);
-
-    while ( true )
-    {
-        t = xs_transaction_start(xsh);
-        if ( t == XBT_NULL )
-            return;
-
-        dir = xs_directory(xsh, t, TEST_PATH, &num);
-        if ( dir && !num )
-            xs_rm(xsh, t, TEST_PATH);
-        free(dir);
-
-        if ( xs_transaction_end(xsh, t, false) || errno != EAGAIN )
-            return;
-    }
-}
-
-int main(int argc, char *argv[])
-{
-    int opt, t, iters = 1, ret = 0, randtime = 0;
-    char *test = NULL;
-    bool list = false;
-    time_t stop;
-
-    while ( (opt = getopt_long(argc, argv, "lr:t:hi:", options,
-                               NULL)) != -1 )
-    {
-        switch ( opt )
-        {
-        case 'i':
-            iters = atoi(optarg);
-            break;
-        case 'l':
-            list = true;
-            break;
-        case 'r':
-            randtime = atoi(optarg);
-            break;
-        case 't':
-            test = optarg;
-            break;
-        case 'h':
-            usage(0);
-            break;
-        }
-    }
-    if ( optind != argc )
-        usage(1);
-
-    if ( list )
-    {
-        for ( t = 0; t < ARRAY_SIZE(tests); t++ )
-            printf("%-10s: %s\n", tests[t].name, tests[t].descr);
-        return 0;
-    }
-
-    asprintf(&path, "%s/%u", TEST_PATH, getpid());
-    for ( t = 0; t < WRITE_BUFFERS_N; t++ )
-    {
-        memset(write_buffers[t], 'a' + t, WRITE_BUFFERS_SIZE);
-        asprintf(&paths[t], "%s/%c", path, 'a' + t);
-    }
-
-    xsh = xs_open(0);
-    if ( !xsh )
-    {
-        fprintf(stderr, "could not connect to xenstore\n");
-        exit(2);
-    }
-
-    if ( randtime )
-    {
-        stop = time(NULL) + randtime;
-        srandom((unsigned int)stop);
-
-        while ( time(NULL) < stop )
-        {
-            t = random() % ARRAY_SIZE(tests);
-            ret = call_test(tests + t, iters, true);
-        }
-    }
-    else
-        for ( t = 0; t < ARRAY_SIZE(tests); t++ )
-        {
-            if ( !test || !strcmp(test, tests[t].name) )
-                ret = call_test(tests + t, iters, false);
-        }
-
-    if ( !ret )
-        cleanup();
-
-    xs_close(xsh);
-
-    if ( ta_loops )
-        printf("Exhaustive transaction retries (%d) occurrred %d times.\n",
-               MAX_TA_LOOPS, ta_loops);
-
-    return 0;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:48:15 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:48:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158891.292363 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5ryh-0005oc-Qw; Tue, 20 Jul 2021 15:48:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158891.292363; Tue, 20 Jul 2021 15:48:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5ryh-0005oS-NO; Tue, 20 Jul 2021 15:48:15 +0000
Received: by outflank-mailman (input) for mailman id 158891;
 Tue, 20 Jul 2021 15:48:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ryg-0005mS-L4
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:48:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ryg-0004Rt-KI
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:48:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ryg-0001U5-Ji
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0Hx4V8S4rmHHtmiWyP9+gd/dJrUngy0ilXT6coa/lyE=; b=dJ/BHwC2mLTjCqUvOhtdz+v9Ed
	bAD/pUlot5LS17q5N+DFhuPGhmOE63suyugbhtYsg1gAX6exOMfkhyOrBZ+Wpu6lLZXfKeV4Er77n
	0D33+QW63moQJm+ajq9q5dDhfudwqFnOLtuCc6xFK7gUzrRWSCoehOdAMvtfRsUILIhU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] IOMMU: correct parsing of "quarantine=scratch-page"
Message-Id: <E1m5ryg-0001U5-Ji@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:48:14 +0000

commit ec6e56359553e82fefa877fd221479847ffc93dd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jul 13 10:16:18 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 13 10:16:18 2021 +0200

    IOMMU: correct parsing of "quarantine=scratch-page"
    
    During the multiple renames of the sub-option I apparently forgot to
    update the left side of the &&, and this pretty consistently.
    
    Fixes: 980d6acf1517 ("IOMMU: make DMA containment of quarantined devices optional")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
---
 xen/drivers/passthrough/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index ab2ae61b11..fd2578d30a 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -82,7 +82,7 @@ static int __init parse_iommu_param(const char *s)
 #ifdef CONFIG_HAS_PCI
         else if ( (val = parse_boolean("quarantine", s, ss)) >= 0 )
             iommu_quarantine = val;
-        else if ( ss == s + 15 && !strncmp(s, "quarantine=scratch-page", 23) )
+        else if ( ss == s + 23 && !strncmp(s, "quarantine=scratch-page", 23) )
             iommu_quarantine = IOMMU_quarantine_scratch_page;
 #endif
 #ifdef CONFIG_X86
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:48:26 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:48:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158894.292367 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5ryr-0005ug-St; Tue, 20 Jul 2021 15:48:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158894.292367; Tue, 20 Jul 2021 15:48:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5ryr-0005uY-PT; Tue, 20 Jul 2021 15:48:25 +0000
Received: by outflank-mailman (input) for mailman id 158894;
 Tue, 20 Jul 2021 15:48:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ryq-0005u4-Pi
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:48:24 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ryq-0004S7-N1
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:48:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5ryq-0001Uk-MS
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1XSc201TFKlHBiiv6BpaM1qLnp3L4lKG4Lc5zzKVGCc=; b=DQnNeaH1DIECtZEY34auRbOqGp
	L217mc/3LCGsilfKvRo4POyEhDoyG9xg4tcLySWeTn95mwV0k22TZNcsAqKNYeioMFdx4TveARr1V
	URqGh5JvaEO37PpoQG53e/UJ1qffbryXpyj2gSQYFiD5yTjXsUgvh+S/zYZJbBLr+Tqk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CHANGELOG: record changed PCI device quarantining default
Message-Id: <E1m5ryq-0001Uk-MS@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:48:24 +0000

commit 1d3250f8c4cb750bb0dcf9fdbe01f8de85780281
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jul 13 10:17:33 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jul 13 10:17:33 2021 +0200

    CHANGELOG: record changed PCI device quarantining default
    
    This amends commit 980d6acf1517 ("IOMMU: make DMA containment of
    quarantined devices optional").
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
---
 CHANGELOG.md | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6896d70757..22cfdb4298 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  - XENSTORED_ROOTDIR environment variable from configuartion files and
    initscripts, due to being unused.
 
+### Changed
+ - Quarantining of passed-through PCI devices no longer defaults to directing I/O to a scratch
+   page, matching original post-XSA-302 behavior (albeit the change was also backported, first
+   appearing in 4.12.2 and 4.11.4). Prior (4.13...4.15-like) behavior can be arranged for
+   either by enabling the IOMMU_QUARANTINE_SCRATCH_PAGE setting at build (configuration) time
+   or by passing "iommu=quarantine=scratch-page" on the hypervisor command line.
+
 ## [4.15.0 UNRELEASED](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.15.0) - TBD
 
 ### Added / support upgraded
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:48:36 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:48:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158896.292371 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rz1-000613-Ua; Tue, 20 Jul 2021 15:48:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158896.292371; Tue, 20 Jul 2021 15:48:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rz1-00060r-RI; Tue, 20 Jul 2021 15:48:35 +0000
Received: by outflank-mailman (input) for mailman id 158896;
 Tue, 20 Jul 2021 15:48:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rz0-0005zH-QZ
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:48:34 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rz0-0004SI-Pk
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:48:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rz0-0001VQ-PF
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2wtFge0+pXsxjrXjR1b3PDBB0+w38pRLX4RuFY5mHwM=; b=bMjtqTXXdSqt3DufG/wKZ2XuLB
	MCN7idMWCwoIJVzxA8LaqDlYek0KIe5yf5XYLwQHH+WsSj/HTN0U00HJ6WNd9DTyeH+wnwp2DdBZC
	tSVGmZIBoJyAD7QCpq9WYC9CpSOQW1Pi2UILIbE6eyBWR/yNPaNMSffLIFP8vPxbTisU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] stubdom: foreignmemory: Fix build after 0dbb4be739c5
Message-Id: <E1m5rz0-0001VQ-PF@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:48:34 +0000

commit 3a98c1a4cec1a302beaddf944ded240b61173f87
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Tue Jul 13 10:20:19 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Jul 13 12:58:29 2021 +0100

    stubdom: foreignmemory: Fix build after 0dbb4be739c5
    
    Commit 0dbb4be739c5 add the inclusion of xenctrl.h from private.h and
    wreck the build in an interesting way:
    
    In file included from xen/stubdom/include/xen/domctl.h:39:0,
                     from xen/tools/include/xenctrl.h:36,
                     from private.h:4,
                     from minios.c:29:
    xen/include/public/memory.h:407:5: error: expected specifier-qualifier-list before ‘XEN_GUEST_HANDLE_64’
         XEN_GUEST_HANDLE_64(const_uint8) buffer;
         ^~~~~~~~~~~~~~~~~~~
    
    This is happening because xenctrl.h defines __XEN_TOOLS__ and therefore
    the public headers will start to expose the non-stable ABI. However,
    xen.h has already been included by a mini-OS header before hand. So
    there is a mismatch in the way the headers are included.
    
    For now solve it in a very simple (and gross) way by including
    xenctrl.h before the mini-os headers.
    
    Fixes: 0dbb4be739c5 ("tools/libs/foreignmemory: Fix PAGE_SIZE redefinition error")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libs/foreignmemory/minios.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/libs/foreignmemory/minios.c b/tools/libs/foreignmemory/minios.c
index c5453736d5..f2f4dfb2be 100644
--- a/tools/libs/foreignmemory/minios.c
+++ b/tools/libs/foreignmemory/minios.c
@@ -17,6 +17,14 @@
  * Copyright 2007-2008 Samuel Thibault <samuel.thibault@eu.citrix.com>.
  */
 
+/*
+ * xenctrl.h currently defines __XEN_TOOLS__ which affects what is
+ * exposed by Xen headers. As the define needs to be set consistently,
+ * we want to include xenctrl.h before the mini-os headers (they include
+ * public headers).
+ */
+#include <xenctrl.h>
+
 #include <mini-os/types.h>
 #include <mini-os/os.h>
 #include <mini-os/mm.h>
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:48:47 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:48:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158898.292374 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rzC-00067I-W2; Tue, 20 Jul 2021 15:48:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158898.292374; Tue, 20 Jul 2021 15:48:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rzC-000679-Sm; Tue, 20 Jul 2021 15:48:46 +0000
Received: by outflank-mailman (input) for mailman id 158898;
 Tue, 20 Jul 2021 15:48:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rzA-00065K-UH
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:48:44 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rzA-0004SU-TY
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:48:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rzA-0001WL-Se
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:48: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VxTUoky91bastKV9uExw2sQHqjNd5yz8Qax2xnoexcs=; b=I1DSpsXPThpvGa0m1o64avblzB
	uwpo2SxWVqcR6T621coGEF9d8DR0cbRqMus0DGPm5f3Ib1Fe6lf3X1W3W5c81NCmNRtYc6HetC7Sl
	s/IIRNIMcxSn4Jd1jeih+xU9WWVQ5G+USi9bAlbgbvsX5lDXlTCNB17wMECaTMaHnmDY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libxl/x86: check return value of SHADOW_OP_SET_ALLOCATION domctl
Message-Id: <E1m5rzA-0001WL-Se@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:48:44 +0000

commit 0be5a00af590c97ea553aadb60f1e0b3af53d8f6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jul 19 12:28:09 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 19 12:28:09 2021 +0200

    libxl/x86: check return value of SHADOW_OP_SET_ALLOCATION domctl
    
    The hypervisor may not have enough memory to satisfy the request. While
    there, make the unit of the value clear by renaming the local variable.
    
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/light/libxl_x86.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/tools/libs/light/libxl_x86.c b/tools/libs/light/libxl_x86.c
index ac09897a63..18c3c77ccd 100644
--- a/tools/libs/light/libxl_x86.c
+++ b/tools/libs/light/libxl_x86.c
@@ -529,10 +529,20 @@ int libxl__arch_domain_create(libxl__gc *gc,
         xc_domain_set_time_offset(ctx->xch, domid, rtc_timeoffset);
 
     if (d_config->b_info.type != LIBXL_DOMAIN_TYPE_PV) {
-        unsigned long shadow = DIV_ROUNDUP(d_config->b_info.shadow_memkb,
-                                           1024);
-        xc_shadow_control(ctx->xch, domid, XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION,
-                          NULL, 0, &shadow, 0, NULL);
+        unsigned long shadow_mb = DIV_ROUNDUP(d_config->b_info.shadow_memkb,
+                                              1024);
+        int r = xc_shadow_control(ctx->xch, domid,
+                                  XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION,
+                                  NULL, 0, &shadow_mb, 0, NULL);
+
+        if (r) {
+            LOGED(ERROR, domid,
+                  "Failed to set %lu MiB %s allocation",
+                  shadow_mb,
+                  libxl_defbool_val(d_config->c_info.hap) ? "HAP" : "shadow");
+            ret = ERROR_FAIL;
+            goto out;
+        }
     }
 
     if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_PV &&
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:48:57 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:48:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158901.292379 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rzN-0006E5-1F; Tue, 20 Jul 2021 15:48:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158901.292379; Tue, 20 Jul 2021 15:48:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rzM-0006Dx-UZ; Tue, 20 Jul 2021 15:48:56 +0000
Received: by outflank-mailman (input) for mailman id 158901;
 Tue, 20 Jul 2021 15:48:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rzL-0006DN-0w
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:48:55 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rzL-0004Se-0E
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:48:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rzK-0001Ww-Vx
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:48: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1J4LZo1VJ+aAF625KhSXh8xcaLZzLDYgecvoqrSQ3Ng=; b=djO6B/EQtZIlM/UoCriMEtc9UQ
	A/16rzEDgJMCOyxrtTs0Pmsh3/Go/uZdGK3KgPTD0wqWUtmmAf5/pHgQ31Ok7nSMUKEYmqGCb3RJy
	MXYvbz5tB6Ku55C86bwd4vzZF2A8QV1b0hHti0VH5ReLjSF1PvgpkCKoem5S7Uxqsi9Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/AMD: adjust SYSCFG, TOM, etc exposure to deal with running nested
Message-Id: <E1m5rzK-0001Ww-Vx@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:48:54 +0000

commit 471383ddd1843700fdd7d74242ba0e5f314dc678
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jul 19 12:28:50 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jul 19 12:28:50 2021 +0200

    x86/AMD: adjust SYSCFG, TOM, etc exposure to deal with running nested
    
    In the original change I neglected to consider the case of us running as
    L1 under another Xen. In this case we're not Dom0, so the underlying Xen
    wouldn't permit us access to these MSRs. As an immediate workaround use
    rdmsr_safe(); I don't view this as the final solution though, as the
    original problem the earlier change tried to address also applies when
    running nested. Yet it is then unclear to me how to properly address the
    issue: We shouldn't generally expose the MSR values, but handing back
    zero (or effectively any other static value) doesn't look appropriate
    either.
    
    Fixes: bfcdaae9c210 ("x86/AMD: expose SYSCFG, TOM, TOM2, and IORRs to Dom0")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/x86/msr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index 650d060b12..b834456c7b 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -367,7 +367,8 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
             goto gp_fault;
         if ( !is_hardware_domain(d) )
             return X86EMUL_UNHANDLEABLE;
-        rdmsrl(msr, *val);
+        if ( rdmsr_safe(msr, *val) )
+            goto gp_fault;
         if ( msr == MSR_K8_SYSCFG )
             *val &= (SYSCFG_TOM2_FORCE_WB | SYSCFG_MTRR_TOM2_EN |
                      SYSCFG_MTRR_VAR_DRAM_EN | SYSCFG_MTRR_FIX_DRAM_EN);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 15:49:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 15:49:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158902.292383 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rzX-0006Hw-2q; Tue, 20 Jul 2021 15:49:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158902.292383; Tue, 20 Jul 2021 15:49:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5rzW-0006Ho-W3; Tue, 20 Jul 2021 15:49:06 +0000
Received: by outflank-mailman (input) for mailman id 158902;
 Tue, 20 Jul 2021 15:49:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rzV-0006HJ-42
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:49:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rzV-0004TJ-3I
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15:49:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5rzV-0001Xs-2c
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 15: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=U4zno9BAX6pq2oJmKYyQNk2aHKSpHVI5RsyPLfvPZbs=; b=l1+p5vk7NhU9pWRpJpNqZxkqQU
	JMs7vih/AptZHClwk78n6ts9v3D/p7WGsL2SWuyh7uInx68nwkIrePWlpQQNHeG3JyDpWPEyZOmki
	kC1eiwKCQnyqGiXSlNkPJKPGMy3rKWd71iXfDt2VPPHpugkdVV/LrAC5gbJ6KmLf3Q3Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvm: Propagate real error information up through hvm_load()
Message-Id: <E1m5rzV-0001Xs-2c@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 15:49:05 +0000

commit 96e5ad4c476e70688295b3cfb537847a3351d6fd
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jul 19 11:44:06 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Jul 19 14:34:38 2021 +0100

    x86/hvm: Propagate real error information up through hvm_load()
    
    hvm_load() is currently a mix of -errno and -1 style error handling, which
    aliases -EPERM.  This leads to the following confusing diagnostics:
    
    From userspace:
      xc: info: Restoring domain
      xc: error: Unable to restore HVM context (1 = Operation not permitted): Internal error
      xc: error: Restore failed (1 = Operation not permitted): Internal error
      xc_domain_restore: [1] Restore failed (1 = Operation not permitted)
    
    From Xen:
      (XEN) HVM10.0 restore: inconsistent xsave state (feat=0x2ff accum=0x21f xcr0=0x7 bv=0x3 err=-22)
      (XEN) HVM10 restore: failed to load entry 16/0
    
    The actual error was a bad backport, but the -EINVAL got converted to -EPERM
    on the way out of the hypercall.
    
    The overwhelming majority of *_load() handlers already use -errno consistenty.
    Fix up the rest to be consistent, and fix a few other errors noticed along the
    way.
    
     * Failures of hvm_load_entry() indicate a truncated record or other bad data
       size.  Use -ENODATA.
     * Don't use {g,}dprintk().  Omitting diagnostics in release builds is rude,
       and almost everything uses unconditional printk()'s.
     * Switch some errors for more appropriate ones.
    
    Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/mcheck/vmce.c |  6 +++---
 xen/arch/x86/emul-i8254.c      |  9 +++++----
 xen/arch/x86/hvm/irq.c         |  6 +++---
 xen/arch/x86/hvm/save.c        | 25 ++++++++++++++-----------
 xen/arch/x86/hvm/vioapic.c     |  5 ++++-
 xen/arch/x86/hvm/vpic.c        |  2 +-
 6 files changed, 30 insertions(+), 23 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/vmce.c b/xen/arch/x86/cpu/mcheck/vmce.c
index b1df9e9efd..eb6434a3ba 100644
--- a/xen/arch/x86/cpu/mcheck/vmce.c
+++ b/xen/arch/x86/cpu/mcheck/vmce.c
@@ -82,11 +82,11 @@ int vmce_restore_vcpu(struct vcpu *v, const struct hvm_vmce_vcpu *ctxt)
 
     if ( ctxt->caps & ~guest_mcg_cap & ~MCG_CAP_COUNT & ~MCG_CTL_P )
     {
-        dprintk(XENLOG_G_ERR, "%s restore: unsupported MCA capabilities"
-                " %#" PRIx64 " for %pv (supported: %#Lx)\n",
+        printk(XENLOG_G_ERR
+               "%s restore: unsupported MCA capabilities %#"PRIx64" for %pv (supported: %#Lx)\n",
                 is_hvm_vcpu(v) ? "HVM" : "PV", ctxt->caps,
                 v, guest_mcg_cap & ~MCG_CAP_COUNT);
-        return -EPERM;
+        return -EINVAL;
     }
 
     v->arch.vmce.mcg_cap = ctxt->caps;
diff --git a/xen/arch/x86/emul-i8254.c b/xen/arch/x86/emul-i8254.c
index 73be4188ad..050c784702 100644
--- a/xen/arch/x86/emul-i8254.c
+++ b/xen/arch/x86/emul-i8254.c
@@ -412,7 +412,7 @@ static int pit_save(struct vcpu *v, hvm_domain_context_t *h)
 static int pit_load(struct domain *d, hvm_domain_context_t *h)
 {
     PITState *pit = domain_vpit(d);
-    int i;
+    int i, rc = 0;
 
     if ( !has_vpit(d) )
         return -ENODEV;
@@ -421,8 +421,8 @@ static int pit_load(struct domain *d, hvm_domain_context_t *h)
 
     if ( hvm_load_entry(PIT, h, &pit->hw) )
     {
-        spin_unlock(&pit->lock);
-        return 1;
+        rc = -ENODATA;
+        goto out;
     }
     
     /*
@@ -434,9 +434,10 @@ static int pit_load(struct domain *d, hvm_domain_context_t *h)
     for ( i = 0; i < 3; i++ )
         pit_load_count(pit, i, pit->hw.channels[i].count);
 
+ out:
     spin_unlock(&pit->lock);
 
-    return 0;
+    return rc;
 }
 
 HVM_REGISTER_SAVE_RESTORE(PIT, pit_save, pit_load, 1, HVMSR_PER_DOM);
diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index 38ac5fb6c7..52aae4565f 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -773,9 +773,9 @@ static int irq_load_link(struct domain *d, hvm_domain_context_t *h)
     for ( link = 0; link < 4; link++ )
         if ( hvm_irq->pci_link.route[link] > 15 )
         {
-            gdprintk(XENLOG_ERR, 
-                     "HVM restore: PCI-ISA link %u out of range (%u)\n",
-                     link, hvm_irq->pci_link.route[link]);
+            printk(XENLOG_G_ERR
+                   "HVM restore: PCI-ISA link %u out of range (%u)\n",
+                   link, hvm_irq->pci_link.route[link]);
             return -EINVAL;
         }
 
diff --git a/xen/arch/x86/hvm/save.c b/xen/arch/x86/hvm/save.c
index 584620985b..86c82cbd74 100644
--- a/xen/arch/x86/hvm/save.c
+++ b/xen/arch/x86/hvm/save.c
@@ -51,14 +51,14 @@ int arch_hvm_load(struct domain *d, struct hvm_save_header *hdr)
     {
         printk(XENLOG_G_ERR "HVM%d restore: bad magic number %#"PRIx32"\n",
                d->domain_id, hdr->magic);
-        return -1;
+        return -EINVAL;
     }
 
     if ( hdr->version != HVM_FILE_VERSION )
     {
         printk(XENLOG_G_ERR "HVM%d restore: unsupported version %u\n",
                d->domain_id, hdr->version);
-        return -1;
+        return -EINVAL;
     }
 
     cpuid(1, &eax, &ebx, &ecx, &edx);
@@ -294,16 +294,18 @@ int hvm_load(struct domain *d, hvm_domain_context_t *h)
     struct hvm_save_descriptor *desc;
     hvm_load_handler handler;
     struct vcpu *v;
+    int rc;
 
     if ( d->is_dying )
         return -EINVAL;
 
     /* Read the save header, which must be first */
     if ( hvm_load_entry(HEADER, h, &hdr) != 0 )
-        return -1;
+        return -ENODATA;
 
-    if ( arch_hvm_load(d, &hdr) )
-        return -1;
+    rc = arch_hvm_load(d, &hdr);
+    if ( rc )
+        return rc;
 
     /* Down all the vcpus: we only re-enable the ones that had state saved. */
     for_each_vcpu(d, v)
@@ -318,7 +320,7 @@ int hvm_load(struct domain *d, hvm_domain_context_t *h)
             printk(XENLOG_G_ERR
                    "HVM%d restore: save did not end with a null entry\n",
                    d->domain_id);
-            return -1;
+            return -ENODATA;
         }
 
         /* Read the typecode of the next entry  and check for the end-marker */
@@ -332,17 +334,18 @@ int hvm_load(struct domain *d, hvm_domain_context_t *h)
         {
             printk(XENLOG_G_ERR "HVM%d restore: unknown entry typecode %u\n",
                    d->domain_id, desc->typecode);
-            return -1;
+            return -EINVAL;
         }
 
         /* Load the entry */
         printk(XENLOG_G_INFO "HVM%d restore: %s %"PRIu16"\n", d->domain_id,
                hvm_sr_handlers[desc->typecode].name, desc->instance);
-        if ( handler(d, h) != 0 )
+        rc = handler(d, h);
+        if ( rc )
         {
-            printk(XENLOG_G_ERR "HVM%d restore: failed to load entry %u/%u\n",
-                   d->domain_id, desc->typecode, desc->instance);
-            return -1;
+            printk(XENLOG_G_ERR "HVM%d restore: failed to load entry %u/%u rc %d\n",
+                   d->domain_id, desc->typecode, desc->instance, rc);
+            return rc;
         }
         process_pending_softirqs();
     }
diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index 87370dd417..553c0f76ef 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -620,7 +620,10 @@ static int ioapic_load(struct domain *d, hvm_domain_context_t *h)
          d->arch.hvm.nr_vioapics != 1 )
         return -EOPNOTSUPP;
 
-    return hvm_load_entry(IOAPIC, h, &s->domU);
+    if ( hvm_load_entry(IOAPIC, h, &s->domU) )
+        return -ENODATA;
+
+    return 0;
 }
 
 HVM_REGISTER_SAVE_RESTORE(IOAPIC, ioapic_save, ioapic_load, 1, HVMSR_PER_DOM);
diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
index f465b7f997..af988a868c 100644
--- a/xen/arch/x86/hvm/vpic.c
+++ b/xen/arch/x86/hvm/vpic.c
@@ -430,7 +430,7 @@ static int vpic_load(struct domain *d, hvm_domain_context_t *h)
 
     /* Which PIC is this? */
     if ( inst > 1 )
-        return -EINVAL;
+        return -ENOENT;
     s = &d->arch.hvm.vpic[inst];
 
     /* Load the state */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 20 20:22:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jul 2021 20:22:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.158974.292516 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5wFi-0005i4-OD; Tue, 20 Jul 2021 20:22:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 158974.292516; Tue, 20 Jul 2021 20:22:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m5wFi-0005hu-KH; Tue, 20 Jul 2021 20:22:06 +0000
Received: by outflank-mailman (input) for mailman id 158974;
 Tue, 20 Jul 2021 20:22:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5wFg-0005gd-Mv
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 20:22:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5wFg-0001KV-Js
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 20:22:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m5wFg-00086k-H5
 for xen-changelog@lists.xenproject.org; Tue, 20 Jul 2021 20: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cfbUpeu30LRKWsEBowtu+1p52tc+TkwCVKquR3r0Fc8=; b=dT9gncMlcXYAkEm6XBhDbj9oYz
	IwtABQVo1dKHDkU7XSR1mvY+l06QEWE0t+VvEGLicmSUIlI43eJvRJkm9UH7stXikPwnDlQ1dMjkH
	UdFh45z0ERHmAlZf2OM4j3hIrrWd5P4JsM3Re2jZhxnAazbBtKh9CsZO0YKNAfabYxcw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm64: Remove READ/WRITE_SYSREG32 helper macros
Message-Id: <E1m5wFg-00086k-H5@xenbits.xenproject.org>
Date: Tue, 20 Jul 2021 20:22:04 +0000

commit 57e761b60dc92e210caf3429b8956d908ba04ae9
Author:     Michal Orzel <michal.orzel@arm.com>
AuthorDate: Mon Jul 12 10:53:29 2021 +0200
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Tue Jul 20 13:00:23 2021 -0700

    xen/arm64: Remove READ/WRITE_SYSREG32 helper macros
    
    AArch64 system registers are 64bit whereas AArch32 ones
    are 32bit or 64bit. MSR/MRS are expecting 64bit values thus
    we should get rid of helpers READ/WRITE_SYSREG32
    in favour of using READ/WRITE_SYSREG.
    
    The last place in code making use of READ/WRITE_SYSREG32
    on arm64 is in TVM_REG macro defining functions vreg_emulate_<register>.
    Implement a macro WRITE_SYSREG_SZ which expands as follows:
    -on arm64: WRITE_SYSREG
    -on arm32: WRITE_SYSREG{32/64}
    
    As there are no other places in the code using these helpers
    on arm64 - remove them.
    
    Signed-off-by: Michal Orzel <michal.orzel@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/vcpreg.c               | 12 +++++++++++-
 xen/include/asm-arm/arm64/sysregs.h |  4 ----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/vcpreg.c b/xen/arch/arm/vcpreg.c
index f0cdcc8a54..e3ce56d875 100644
--- a/xen/arch/arm/vcpreg.c
+++ b/xen/arch/arm/vcpreg.c
@@ -47,6 +47,16 @@
  *
  */
 
+#ifdef CONFIG_ARM_64
+#define WRITE_SYSREG_SZ(sz, val, sysreg) WRITE_SYSREG((uint##sz##_t)val, sysreg)
+#else
+/*
+ * WRITE_SYSREG{32/64} on arm32 is defined as variadic macro which imposes
+ * on the below macro to be defined like that as well.
+ */
+#define WRITE_SYSREG_SZ(sz, val, sysreg...)  WRITE_SYSREG##sz(val, sysreg)
+#endif
+
 /* The name is passed from the upper macro to workaround macro expansion. */
 #define TVM_REG(sz, func, reg...)                                           \
 static bool func(struct cpu_user_regs *regs, uint##sz##_t *r, bool read)    \
@@ -55,7 +65,7 @@ static bool func(struct cpu_user_regs *regs, uint##sz##_t *r, bool read)    \
     bool cache_enabled = vcpu_has_cache_enabled(v);                         \
                                                                             \
     GUEST_BUG_ON(read);                                                     \
-    WRITE_SYSREG##sz(*r, reg);                                              \
+    WRITE_SYSREG_SZ(sz, *r, reg);                                           \
                                                                             \
     p2m_toggle_cache(v, cache_enabled);                                     \
                                                                             \
diff --git a/xen/include/asm-arm/arm64/sysregs.h b/xen/include/asm-arm/arm64/sysregs.h
index 077fd95fb7..795901e1ba 100644
--- a/xen/include/asm-arm/arm64/sysregs.h
+++ b/xen/include/asm-arm/arm64/sysregs.h
@@ -87,10 +87,6 @@
 
 /* Access to system registers */
 
-#define READ_SYSREG32(name) ((uint32_t)READ_SYSREG64(name))
-
-#define WRITE_SYSREG32(v, name) WRITE_SYSREG64((uint64_t)v, name)
-
 #define WRITE_SYSREG64(v, name) do {                    \
     uint64_t _r = v;                                    \
     asm volatile("msr "__stringify(name)", %0" : : "r" (_r));       \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jul 21 14:33:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Jul 2021 14:33:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.159390.293195 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m6DHT-0007gn-V7; Wed, 21 Jul 2021 14:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 159390.293195; Wed, 21 Jul 2021 14:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m6DHT-0007gf-SH; Wed, 21 Jul 2021 14:33:03 +0000
Received: by outflank-mailman (input) for mailman id 159390;
 Wed, 21 Jul 2021 14:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m6DHS-0007fL-7B
 for xen-changelog@lists.xenproject.org; Wed, 21 Jul 2021 14:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m6DHS-0003xw-6J
 for xen-changelog@lists.xenproject.org; Wed, 21 Jul 2021 14:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m6DHS-0000tW-59
 for xen-changelog@lists.xenproject.org; Wed, 21 Jul 2021 14:33: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RZAGkhQcDpT6oI6ABkW/hdJ6n7b6YBaDAuBsoG3XLY8=; b=CtZkVm5/ghFQfnDeBlqFBHS0On
	FMv6zuOgVApeKSQ8gTsJWm6PXiSb4nSIu/ypZ29M/p6aAoxmm7RFL7yVdnkk0Kyp+/BFf1iKRwZce
	HONoKXOt9DYsmUwRMQssXmIwsIOxFbbBgU292wuTQrnFNmReeWvyAOVd4bi903jmuOt8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm64: Remove READ/WRITE_SYSREG32 helper macros
Message-Id: <E1m6DHS-0000tW-59@xenbits.xenproject.org>
Date: Wed, 21 Jul 2021 14:33:02 +0000

commit 57e761b60dc92e210caf3429b8956d908ba04ae9
Author:     Michal Orzel <michal.orzel@arm.com>
AuthorDate: Mon Jul 12 10:53:29 2021 +0200
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Tue Jul 20 13:00:23 2021 -0700

    xen/arm64: Remove READ/WRITE_SYSREG32 helper macros
    
    AArch64 system registers are 64bit whereas AArch32 ones
    are 32bit or 64bit. MSR/MRS are expecting 64bit values thus
    we should get rid of helpers READ/WRITE_SYSREG32
    in favour of using READ/WRITE_SYSREG.
    
    The last place in code making use of READ/WRITE_SYSREG32
    on arm64 is in TVM_REG macro defining functions vreg_emulate_<register>.
    Implement a macro WRITE_SYSREG_SZ which expands as follows:
    -on arm64: WRITE_SYSREG
    -on arm32: WRITE_SYSREG{32/64}
    
    As there are no other places in the code using these helpers
    on arm64 - remove them.
    
    Signed-off-by: Michal Orzel <michal.orzel@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/vcpreg.c               | 12 +++++++++++-
 xen/include/asm-arm/arm64/sysregs.h |  4 ----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/vcpreg.c b/xen/arch/arm/vcpreg.c
index f0cdcc8a54..e3ce56d875 100644
--- a/xen/arch/arm/vcpreg.c
+++ b/xen/arch/arm/vcpreg.c
@@ -47,6 +47,16 @@
  *
  */
 
+#ifdef CONFIG_ARM_64
+#define WRITE_SYSREG_SZ(sz, val, sysreg) WRITE_SYSREG((uint##sz##_t)val, sysreg)
+#else
+/*
+ * WRITE_SYSREG{32/64} on arm32 is defined as variadic macro which imposes
+ * on the below macro to be defined like that as well.
+ */
+#define WRITE_SYSREG_SZ(sz, val, sysreg...)  WRITE_SYSREG##sz(val, sysreg)
+#endif
+
 /* The name is passed from the upper macro to workaround macro expansion. */
 #define TVM_REG(sz, func, reg...)                                           \
 static bool func(struct cpu_user_regs *regs, uint##sz##_t *r, bool read)    \
@@ -55,7 +65,7 @@ static bool func(struct cpu_user_regs *regs, uint##sz##_t *r, bool read)    \
     bool cache_enabled = vcpu_has_cache_enabled(v);                         \
                                                                             \
     GUEST_BUG_ON(read);                                                     \
-    WRITE_SYSREG##sz(*r, reg);                                              \
+    WRITE_SYSREG_SZ(sz, *r, reg);                                           \
                                                                             \
     p2m_toggle_cache(v, cache_enabled);                                     \
                                                                             \
diff --git a/xen/include/asm-arm/arm64/sysregs.h b/xen/include/asm-arm/arm64/sysregs.h
index 077fd95fb7..795901e1ba 100644
--- a/xen/include/asm-arm/arm64/sysregs.h
+++ b/xen/include/asm-arm/arm64/sysregs.h
@@ -87,10 +87,6 @@
 
 /* Access to system registers */
 
-#define READ_SYSREG32(name) ((uint32_t)READ_SYSREG64(name))
-
-#define WRITE_SYSREG32(v, name) WRITE_SYSREG64((uint64_t)v, name)
-
 #define WRITE_SYSREG64(v, name) do {                    \
     uint64_t _r = v;                                    \
     asm volatile("msr "__stringify(name)", %0" : : "r" (_r));       \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jul 26 12:00:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Jul 2021 12:00:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.160925.295478 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m7zHC-0000QV-Qs; Mon, 26 Jul 2021 12:00:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 160925.295478; Mon, 26 Jul 2021 12:00:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m7zHC-0000QL-Mh; Mon, 26 Jul 2021 12:00:06 +0000
Received: by outflank-mailman (input) for mailman id 160925;
 Mon, 26 Jul 2021 12:00:06 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m7zHC-0000MM-1X
 for xen-changelog@lists.xenproject.org; Mon, 26 Jul 2021 12:00:06 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m7zHB-00080w-Re
 for xen-changelog@lists.xenproject.org; Mon, 26 Jul 2021 12:00:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m7zHB-00089l-QU
 for xen-changelog@lists.xenproject.org; Mon, 26 Jul 2021 12: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YBV859lJ6HSPDUuTEv+klv4m8H/XsblQ5echTebwAU0=; b=kMXp5l4m0Vn/reW2f4aNR6QoC1
	uEMA6pIZ3F6y0mFtfcycnyRNcUCpC5wzekKkrDorf3EC4f83Bzn9x92QEm///J+54GvkpJpExwqur
	FAXTl51+jpiI9qiGRqN/iVXKmQ59mRrEtqcEmkCNb6kV/78CxoeCuAFC6iEQQ21ADak4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxc: use uint32_t for pirq in xc_domain_irq_permission
Message-Id: <E1m7zHB-00089l-QU@xenbits.xenproject.org>
Date: Mon, 26 Jul 2021 12:00:05 +0000

commit 73c932d0ea43ddf904db9429811788480c4cb816
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Tue Jul 13 02:31:41 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Jul 26 10:32:04 2021 +0100

    tools/libxc: use uint32_t for pirq in xc_domain_irq_permission
    
    Current unit8_t for pirq argument in this interface is too restrictive
    causing failures on modern hardware with lots of GSIs. That extends down to
    XEN_DOMCTL_irq_permission ABI structure where it needs to be fixed up
    as well.
    
    Internal Xen structures appear to be fine. Existing users of the interface
    in tree (libxl, ocaml and python bindings) are currently using signed int
    for pirq representation which should be wide enough. Converting them to
    uint32_t now is desirable to avoid accidental passing of a negative
    number (probably denoting an error code) by caller as pirq, but left for
    the future clean up.
    
    Domctl interface version is needed to be bumped with this change but that
    was already done by 918b8842a8 ("arm64: Change type of hsr, cpsr, spsr_el1
    to uint64_t") in this release cycle.
    
    Additionally, take a change and convert allow_access argument to bool.
    
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 tools/include/xenctrl.h             | 4 ++--
 tools/libs/ctrl/xc_domain.c         | 4 ++--
 tools/ocaml/libs/xc/xenctrl_stubs.c | 4 ++--
 xen/include/public/domctl.h         | 3 ++-
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index 2a7c836a02..14adaa0c10 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1385,8 +1385,8 @@ int xc_domain_ioport_permission(xc_interface *xch,
 
 int xc_domain_irq_permission(xc_interface *xch,
                              uint32_t domid,
-                             uint8_t pirq,
-                             uint8_t allow_access);
+                             uint32_t pirq,
+                             bool allow_access);
 
 int xc_domain_iomem_permission(xc_interface *xch,
                                uint32_t domid,
diff --git a/tools/libs/ctrl/xc_domain.c b/tools/libs/ctrl/xc_domain.c
index 3803871538..a20e081b51 100644
--- a/tools/libs/ctrl/xc_domain.c
+++ b/tools/libs/ctrl/xc_domain.c
@@ -1385,8 +1385,8 @@ int xc_vcpu_setcontext(xc_interface *xch,
 
 int xc_domain_irq_permission(xc_interface *xch,
                              uint32_t domid,
-                             uint8_t pirq,
-                             uint8_t allow_access)
+                             uint32_t pirq,
+                             bool allow_access)
 {
     DECLARE_DOMCTL;
 
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index a6756c4a8c..dd09cb90aa 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -1075,8 +1075,8 @@ CAMLprim value stub_xc_domain_irq_permission(value xch, value domid,
 					     value pirq, value allow)
 {
 	CAMLparam4(xch, domid, pirq, allow);
-	uint8_t c_pirq;
-	uint8_t c_allow;
+	uint32_t c_pirq;
+	bool c_allow;
 	int ret;
 
 	c_pirq = Int_val(pirq);
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index d576bfabd6..96696e3842 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -441,8 +441,9 @@ struct xen_domctl_setdebugging {
 
 /* XEN_DOMCTL_irq_permission */
 struct xen_domctl_irq_permission {
-    uint8_t pirq;
+    uint32_t pirq;
     uint8_t allow_access;    /* flag to specify enable/disable of IRQ access */
+    uint8_t pad[3];
 };
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jul 27 06:44:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jul 2021 06:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.161060.295727 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m8Gos-0003to-No; Tue, 27 Jul 2021 06:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 161060.295727; Tue, 27 Jul 2021 06:44:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m8Gos-0003te-Kg; Tue, 27 Jul 2021 06:44:02 +0000
Received: by outflank-mailman (input) for mailman id 161060;
 Tue, 27 Jul 2021 06:44:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8Gor-0003tY-IN
 for xen-changelog@lists.xenproject.org; Tue, 27 Jul 2021 06:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8Gor-00082F-Gw
 for xen-changelog@lists.xenproject.org; Tue, 27 Jul 2021 06:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8Gor-00072l-Fo
 for xen-changelog@lists.xenproject.org; Tue, 27 Jul 2021 06:44: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=s55ao1Q5Yc6qmF+p4GVwQ1knr+YGXNWdpW2n2OLC2UM=; b=wpBeYaEdf+I4HHtFbzl3QeqD1V
	NMrARofrsYZwkvc+LC/6cjXkXVEEd3i8XyEjSK/2uOBEMJ/qWFw6t7/lgodpT3gXbye2DQjkvw7E8
	0nVhHhH06qZ/7dBHf+vw0FSmvOXrwO22y36OxwFiTctIu6wnwoZObXtEf+GJvfHR228k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxc: use uint32_t for pirq in xc_domain_irq_permission
Message-Id: <E1m8Gor-00072l-Fo@xenbits.xenproject.org>
Date: Tue, 27 Jul 2021 06:44:01 +0000

commit 73c932d0ea43ddf904db9429811788480c4cb816
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Tue Jul 13 02:31:41 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Jul 26 10:32:04 2021 +0100

    tools/libxc: use uint32_t for pirq in xc_domain_irq_permission
    
    Current unit8_t for pirq argument in this interface is too restrictive
    causing failures on modern hardware with lots of GSIs. That extends down to
    XEN_DOMCTL_irq_permission ABI structure where it needs to be fixed up
    as well.
    
    Internal Xen structures appear to be fine. Existing users of the interface
    in tree (libxl, ocaml and python bindings) are currently using signed int
    for pirq representation which should be wide enough. Converting them to
    uint32_t now is desirable to avoid accidental passing of a negative
    number (probably denoting an error code) by caller as pirq, but left for
    the future clean up.
    
    Domctl interface version is needed to be bumped with this change but that
    was already done by 918b8842a8 ("arm64: Change type of hsr, cpsr, spsr_el1
    to uint64_t") in this release cycle.
    
    Additionally, take a change and convert allow_access argument to bool.
    
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 tools/include/xenctrl.h             | 4 ++--
 tools/libs/ctrl/xc_domain.c         | 4 ++--
 tools/ocaml/libs/xc/xenctrl_stubs.c | 4 ++--
 xen/include/public/domctl.h         | 3 ++-
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index 2a7c836a02..14adaa0c10 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1385,8 +1385,8 @@ int xc_domain_ioport_permission(xc_interface *xch,
 
 int xc_domain_irq_permission(xc_interface *xch,
                              uint32_t domid,
-                             uint8_t pirq,
-                             uint8_t allow_access);
+                             uint32_t pirq,
+                             bool allow_access);
 
 int xc_domain_iomem_permission(xc_interface *xch,
                                uint32_t domid,
diff --git a/tools/libs/ctrl/xc_domain.c b/tools/libs/ctrl/xc_domain.c
index 3803871538..a20e081b51 100644
--- a/tools/libs/ctrl/xc_domain.c
+++ b/tools/libs/ctrl/xc_domain.c
@@ -1385,8 +1385,8 @@ int xc_vcpu_setcontext(xc_interface *xch,
 
 int xc_domain_irq_permission(xc_interface *xch,
                              uint32_t domid,
-                             uint8_t pirq,
-                             uint8_t allow_access)
+                             uint32_t pirq,
+                             bool allow_access)
 {
     DECLARE_DOMCTL;
 
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index a6756c4a8c..dd09cb90aa 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -1075,8 +1075,8 @@ CAMLprim value stub_xc_domain_irq_permission(value xch, value domid,
 					     value pirq, value allow)
 {
 	CAMLparam4(xch, domid, pirq, allow);
-	uint8_t c_pirq;
-	uint8_t c_allow;
+	uint32_t c_pirq;
+	bool c_allow;
 	int ret;
 
 	c_pirq = Int_val(pirq);
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index d576bfabd6..96696e3842 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -441,8 +441,9 @@ struct xen_domctl_setdebugging {
 
 /* XEN_DOMCTL_irq_permission */
 struct xen_domctl_irq_permission {
-    uint8_t pirq;
+    uint32_t pirq;
     uint8_t allow_access;    /* flag to specify enable/disable of IRQ access */
+    uint8_t pad[3];
 };
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jul 27 14:00:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jul 2021 14:00:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.161230.296044 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m8Ncs-0005yi-6b; Tue, 27 Jul 2021 14:00:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 161230.296044; Tue, 27 Jul 2021 14:00:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m8Ncs-0005yT-2X; Tue, 27 Jul 2021 14:00:06 +0000
Received: by outflank-mailman (input) for mailman id 161230;
 Tue, 27 Jul 2021 14:00:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8Ncr-0005tR-J6
 for xen-changelog@lists.xenproject.org; Tue, 27 Jul 2021 14:00:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8Ncr-0006hz-IJ
 for xen-changelog@lists.xenproject.org; Tue, 27 Jul 2021 14:00:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8Ncr-0002lN-HP
 for xen-changelog@lists.xenproject.org; Tue, 27 Jul 2021 14: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wH5+BoGVXqufhFTtKHs5T6GRq4dRPtCJ5yuW//4h/PM=; b=1QJjOIekqHNuL+Zq2y0bPdEx3l
	cmQ2JQ0/wEX7TwOBwxRTT9vVAN11MfpJbRejE3y8N8SKf8KBB8E/H6xCdkD3LKnddVVFayyn0dfF2
	UNYgsIKzO+wxEChcLc9fu1CQakz+9h2dsSlIjCoYpd4qbLlDWaT9/15kHYSLGnwp8mVY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xl: Add stubdomain_cmdline option to xl.cfg
Message-Id: <E1m8Ncr-0002lN-HP@xenbits.xenproject.org>
Date: Tue, 27 Jul 2021 14:00:05 +0000

commit ce233b10319dfb77ab5e0102202190a5911ae8f3
Author:     Scott Davis <scottwd@gmail.com>
AuthorDate: Thu Jul 22 12:54:30 2021 -0400
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Tue Jul 27 14:22:01 2021 +0100

    tools/xl: Add stubdomain_cmdline option to xl.cfg
    
    This adds an option to the xl domain configuration file syntax for specifying
    a kernel command line for device-model stubdomains. It is intended for use with
    Linux-based stubdomains.
    
    Signed-off-by: Scott Davis <scott.davis@starlab.io>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 docs/man/xl.cfg.5.pod.in             |  4 ++++
 tools/golang/xenlight/helpers.gen.go |  3 +++
 tools/golang/xenlight/types.gen.go   |  1 +
 tools/include/libxl.h                | 12 ++++++++++++
 tools/libs/light/libxl_dm.c          |  1 +
 tools/libs/light/libxl_types.idl     |  1 +
 tools/xl/xl_parse.c                  |  2 ++
 7 files changed, 24 insertions(+)

diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
index 56370a37db..4b1e3028d2 100644
--- a/docs/man/xl.cfg.5.pod.in
+++ b/docs/man/xl.cfg.5.pod.in
@@ -2742,6 +2742,10 @@ In case of B<qemu-xen-traditional> it is expected to be MiniOS-based stubdomain
 image, in case of B<qemu-xen> it is expected to be Linux-based stubdomain
 kernel.
 
+=item B<stubdomain_cmdline="STRING">
+
+Set the device-model stubdomain kernel command line to B<STRING>.
+
 =item B<stubdomain_ramdisk="PATH">
 
 Override the path to the ramdisk image used as device-model stubdomain.
diff --git a/tools/golang/xenlight/helpers.gen.go b/tools/golang/xenlight/helpers.gen.go
index db82537b42..bfc1e7f312 100644
--- a/tools/golang/xenlight/helpers.gen.go
+++ b/tools/golang/xenlight/helpers.gen.go
@@ -1018,6 +1018,7 @@ return fmt.Errorf("converting field DeviceModelStubdomain: %v", err)
 }
 x.StubdomainMemkb = uint64(xc.stubdomain_memkb)
 x.StubdomainKernel = C.GoString(xc.stubdomain_kernel)
+x.StubdomainCmdline = C.GoString(xc.stubdomain_cmdline)
 x.StubdomainRamdisk = C.GoString(xc.stubdomain_ramdisk)
 x.DeviceModel = C.GoString(xc.device_model)
 x.DeviceModelSsidref = uint32(xc.device_model_ssidref)
@@ -1344,6 +1345,8 @@ return fmt.Errorf("converting field DeviceModelStubdomain: %v", err)
 xc.stubdomain_memkb = C.uint64_t(x.StubdomainMemkb)
 if x.StubdomainKernel != "" {
 xc.stubdomain_kernel = C.CString(x.StubdomainKernel)}
+if x.StubdomainCmdline != "" {
+xc.stubdomain_cmdline = C.CString(x.StubdomainCmdline)}
 if x.StubdomainRamdisk != "" {
 xc.stubdomain_ramdisk = C.CString(x.StubdomainRamdisk)}
 if x.DeviceModel != "" {
diff --git a/tools/golang/xenlight/types.gen.go b/tools/golang/xenlight/types.gen.go
index a214dd9df6..09a3bb67e2 100644
--- a/tools/golang/xenlight/types.gen.go
+++ b/tools/golang/xenlight/types.gen.go
@@ -483,6 +483,7 @@ DeviceModelVersion DeviceModelVersion
 DeviceModelStubdomain Defbool
 StubdomainMemkb uint64
 StubdomainKernel string
+StubdomainCmdline string
 StubdomainRamdisk string
 DeviceModel string
 DeviceModelSsidref uint32
diff --git a/tools/include/libxl.h b/tools/include/libxl.h
index ae7fe27c1f..b9ba16d698 100644
--- a/tools/include/libxl.h
+++ b/tools/include/libxl.h
@@ -1030,6 +1030,18 @@ typedef struct libxl__ctx libxl_ctx;
  */
 #define LIBXL_HAVE_BUILDINFO_KERNEL 1
 
+/*
+ * LIBXL_HAVE_BUILDINFO_DEVICE_MODEL_STUBDOMAIN
+ *
+ * If this is defined, then the libxl_domain_build_info structure will contain
+ * the following fields that specify options for device model stubdomains:
+ *  - stubdomain_memkb:   integer indicating stubdomain RAM size
+ *  - stubdomain_kernel:  string indicating stubdomain kernel image location
+ *  - stubdomain_cmdline: string of parameters to pass to the stubdomain kernel
+ *  - stubdomain_ramdisk: string indicating stubdomain ramdisk location
+ */
+#define LIBXL_HAVE_BUILDINFO_DEVICE_MODEL_STUBDOMAIN 1
+
 /*
  * LIBXL_HAVE_DEVICE_CHANNEL
  *
diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index dbd3c7f278..b1732c1944 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -2373,6 +2373,7 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
     }
 
     stubdom_state->pv_kernel.path = guest_config->b_info.stubdomain_kernel;
+    stubdom_state->pv_cmdline = guest_config->b_info.stubdomain_cmdline;
     stubdom_state->pv_ramdisk.path = guest_config->b_info.stubdomain_ramdisk;
 
     /* fixme: this function can leak the stubdom if it fails */
diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
index f45adddab0..3f9fff653a 100644
--- a/tools/libs/light/libxl_types.idl
+++ b/tools/libs/light/libxl_types.idl
@@ -523,6 +523,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("device_model_stubdomain", libxl_defbool),
     ("stubdomain_memkb",   MemKB),
     ("stubdomain_kernel",  string),
+    ("stubdomain_cmdline", string),
     ("stubdomain_ramdisk", string),
     # if you set device_model you must set device_model_version too
     ("device_model",     string),
diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index 9fb0791429..17dddb4cd5 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -2533,6 +2533,8 @@ skip_usbdev:
 
     xlu_cfg_replace_string (config, "stubdomain_kernel",
                             &b_info->stubdomain_kernel, 0);
+    xlu_cfg_replace_string (config, "stubdomain_cmdline",
+                            &b_info->stubdomain_cmdline, 0);
     xlu_cfg_replace_string (config, "stubdomain_ramdisk",
                             &b_info->stubdomain_ramdisk, 0);
     if (!xlu_cfg_get_long (config, "stubdomain_memory", &l, 0))
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jul 27 14:00:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jul 2021 14:00:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.161231.296047 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m8Nd3-00068L-7D; Tue, 27 Jul 2021 14:00:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 161231.296047; Tue, 27 Jul 2021 14:00:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m8Nd3-00068D-44; Tue, 27 Jul 2021 14:00:17 +0000
Received: by outflank-mailman (input) for mailman id 161231;
 Tue, 27 Jul 2021 14:00:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8Nd1-000685-Ma
 for xen-changelog@lists.xenproject.org; Tue, 27 Jul 2021 14:00:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8Nd1-0006i8-Le
 for xen-changelog@lists.xenproject.org; Tue, 27 Jul 2021 14:00:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8Nd1-0002mw-Kg
 for xen-changelog@lists.xenproject.org; Tue, 27 Jul 2021 14:00: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=M7X0GppcEpn/u3wxQxXJKCydNdKL5PFp/tTP/kw9EHk=; b=bK1MjvzARwYdwFFAKgxZMCjn58
	wyrssUHRGZco35tpLSE5t0lzvOP2pr3yBHuSD0V2k6DiajNPBiVuMGUhuvbrMLXCftewmLaZMbqlT
	dOm9Wb/GKMKqXD9qTfcOtRt7B8afAvrZSb83xZtCvbIzs5Z6UIl7N0o0AO7tkr17DKPg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/firmware/ovmf: Use OvmfXen platform file if exist and update OVMF
Message-Id: <E1m8Nd1-0002mw-Kg@xenbits.xenproject.org>
Date: Tue, 27 Jul 2021 14:00:15 +0000

commit 81f29142023841f42bce8ae0c7b73077d7e47219
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Mon Jul 19 14:48:45 2021 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Tue Jul 27 14:26:57 2021 +0100

    tools/firmware/ovmf: Use OvmfXen platform file if exist and update OVMF
    
    A platform introduced in EDK II named OvmfXen is now the one to use for
    Xen instead of OvmfX64. It comes with PVH support.
    
    Also, the Xen support in OvmfX64 is deprecated,
        "deprecation notice: *dynamic* multi-VMM (QEMU vs. Xen) support in OvmfPkg"
        https://edk2.groups.io/g/devel/message/75498
    and has been removed upstream.
    
    We need to also update to a newer version of OVMF as OvmfXen in the
    release "edk2-stable202105" doesn't work well with Xen, so we need the
    fix b37cfdd28071 ("OvmfPkg/XenPlatformPei: Relocate shared_info page
    mapping").
    
    Also, don't set anymore the number of thread for parallel build when
    building the newer platform, OvmfPkg/build.sh is now doing parallel
    build by default.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 Config.mk                    |  2 +-
 tools/firmware/ovmf-makefile | 10 ++++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index f9dce4549b..4d723eec1d 100644
--- a/Config.mk
+++ b/Config.mk
@@ -244,7 +244,7 @@ QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
-OVMF_UPSTREAM_REVISION ?= e1999b264f1f9d7230edf2448f757c73da567832
+OVMF_UPSTREAM_REVISION ?= b37cfdd2807181aed2fee1e17bd7ec1190db266a
 QEMU_UPSTREAM_REVISION ?= master
 MINIOS_UPSTREAM_REVISION ?= 051b87bb9c19609976fb038f386920e1ce5454c5
 
diff --git a/tools/firmware/ovmf-makefile b/tools/firmware/ovmf-makefile
index 55f9992145..1f619a5189 100644
--- a/tools/firmware/ovmf-makefile
+++ b/tools/firmware/ovmf-makefile
@@ -17,8 +17,14 @@ all: build
 .PHONY: build
 build:
 	if test -e .git ; then $(GIT) submodule update --init --recursive ; fi
-	OvmfPkg/build.sh -a X64 -b $(TARGET) -n 4
-	cp Build/OvmfX64/$(TARGET)_GCC*/FV/OVMF.fd ovmf.bin
+	set -ex; \
+	if test -e OvmfPkg/OvmfXen.dsc; then \
+	  OvmfPkg/build.sh -a X64 -b $(TARGET) -p OvmfPkg/OvmfXen.dsc; \
+	  cp Build/OvmfXen/$(TARGET)_GCC*/FV/OVMF.fd ovmf.bin; \
+	else \
+	  OvmfPkg/build.sh -a X64 -b $(TARGET) -n 4; \
+	  cp Build/OvmfX64/$(TARGET)_GCC*/FV/OVMF.fd ovmf.bin; \
+	fi
 
 .PHONY: clean
 clean:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jul 27 14:00:27 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jul 2021 14:00:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.161232.296051 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m8NdD-0006B8-92; Tue, 27 Jul 2021 14:00:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 161232.296051; Tue, 27 Jul 2021 14:00:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m8NdD-0006B0-5a; Tue, 27 Jul 2021 14:00:27 +0000
Received: by outflank-mailman (input) for mailman id 161232;
 Tue, 27 Jul 2021 14:00:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8NdB-0006Ai-Pp
 for xen-changelog@lists.xenproject.org; Tue, 27 Jul 2021 14:00:25 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8NdB-0006iM-P1
 for xen-changelog@lists.xenproject.org; Tue, 27 Jul 2021 14:00:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8NdB-0002nx-OK
 for xen-changelog@lists.xenproject.org; Tue, 27 Jul 2021 14: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lBjSLHAB34QFal8WaRJDsmuaIP8G5kGKhZOIFcRLZGE=; b=B3wjndpG5KJgJK9gMVRZCarBam
	Dq4aa2XV11mQw/k7Sun45f2l1b1g9umy5rETiOmmc457mBA7Nmav+EpEi/rnRXY+Kkyj1McDK47tx
	hd0vpRf/RcRSdkme2GzXw1Kwxs4HDa+X/ZDKH2f9KOZPlMx/XcT6ADe9mPTH0vceE/MM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxl: add missing blank in message
Message-Id: <E1m8NdB-0002nx-OK@xenbits.xenproject.org>
Date: Tue, 27 Jul 2021 14:00:25 +0000

commit 0cdb4a5802bad51aa89f6b1f10014dd21c37228b
Author:     Alan Robinson <Alan.Robinson@fujitsu.com>
AuthorDate: Tue Jul 27 09:47:03 2021 +0200
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Tue Jul 27 14:27:55 2021 +0100

    tools/libxl: add missing blank in message
    
    Add missing blank giving "an emulation" instead of "anemulation"
    while making the text a single source line.
    
    Signed-off-by: Alan Robinson <alan.robinson@fujitsu.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 tools/libs/light/libxl_dm.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index b1732c1944..9d93056b5c 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -1893,8 +1893,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                 if (format == NULL) {
                     LOGD(WARN, guest_domid,
                          "Unable to determine disk image format: %s\n"
-                         "Disk will be available via PV drivers but not as an"
-                         "emulated disk.",
+                         "Disk will be available via PV drivers but not as an emulated disk.",
                          disks[i].vdev);
                     continue;
                 }
@@ -1905,8 +1904,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
 
                 if (!target_path) {
                     LOGD(WARN, guest_domid, "No way to get local access disk to image: %s\n"
-                         "Disk will be available via PV drivers but not as an"
-                         "emulated disk.",
+                         "Disk will be available via PV drivers but not as an emulated disk.",
                          disks[i].vdev);
                     continue;
                 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jul 27 14:11:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jul 2021 14:11:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.161233.296054 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m8NnX-00073E-2D; Tue, 27 Jul 2021 14:11:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 161233.296054; Tue, 27 Jul 2021 14:11:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m8NnW-000736-Vd; Tue, 27 Jul 2021 14:11:06 +0000
Received: by outflank-mailman (input) for mailman id 161233;
 Tue, 27 Jul 2021 14:11:06 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8NnW-000730-2a
 for xen-changelog@lists.xenproject.org; Tue, 27 Jul 2021 14:11:06 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8NnV-0006rN-Re
 for xen-changelog@lists.xenproject.org; Tue, 27 Jul 2021 14:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8NnV-00046F-Ql
 for xen-changelog@lists.xenproject.org; Tue, 27 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qqnuFMQlvTQsYOp+S8g13RYsyOK1lU7SfULvKS6ahqw=; b=Kh5Xmv59Aon0PbPTmG7NyfjpLg
	O0H2sk/BK8fy4J/iJ8aZt1ze5fAnEk2zLH07HpEvsJOijypPR97cw+k3Jq/+WpuIlZMlyI6snE4OQ
	d5lkkqDltWEu0FUqyfQfmQg3/K4fu/ofcyxoI7q/iyjZulSTc2onCiYcAZxWif/acQHg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: work around build issue with GNU ld 2.37
Message-Id: <E1m8NnV-00046F-Ql@xenbits.xenproject.org>
Date: Tue, 27 Jul 2021 14:11:05 +0000

commit 58ad654ebce7ccb272a3f4f3482c03aaad850d31
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 22 11:20:38 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jul 27 15:03:29 2021 +0100

    x86: work around build issue with GNU ld 2.37
    
    I suspect it is commit 40726f16a8d7 ("ld script expression parsing")
    which broke the hypervisor build, by no longer accepting section names
    with a dash in them inside ADDR() (and perhaps other script directives
    expecting just a section name, not an expression): .note.gnu.build-id
    is such a section.
    
    Quoting all section names passed to ADDR() via DECL_SECTION() works
    around the regression.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/xen.lds.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 9c6c1c8005..955d5cf4a0 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -18,7 +18,7 @@ ENTRY(efi_start)
 #else /* !EFI */
 
 #define FORMAT "elf64-x86-64"
-#define DECL_SECTION(x) x : AT(ADDR(x) - __XEN_VIRT_START)
+#define DECL_SECTION(x) x : AT(ADDR(#x) - __XEN_VIRT_START)
 
 ENTRY(start_pa)
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jul 28 06:11:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Jul 2021 06:11:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.161353.296260 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m8cmV-0003KH-Vu; Wed, 28 Jul 2021 06:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 161353.296260; Wed, 28 Jul 2021 06:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m8cmV-0003K9-Sl; Wed, 28 Jul 2021 06:11:03 +0000
Received: by outflank-mailman (input) for mailman id 161353;
 Wed, 28 Jul 2021 06:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8cmU-0003K3-9A
 for xen-changelog@lists.xenproject.org; Wed, 28 Jul 2021 06:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8cmU-0003rD-6f
 for xen-changelog@lists.xenproject.org; Wed, 28 Jul 2021 06:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8cmU-00006M-5f
 for xen-changelog@lists.xenproject.org; Wed, 28 Jul 2021 06:11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=I8J6kr2aVK4FjYKmT/X4MWSTBmOqpUqkc762skGD6FI=; b=Fs/qFLtGW5X6wO/birL6J6DxU/
	ACUWAQ5dd4iMOvsBrCNslGztBRrUypX/L//UnSbmqYFtdRj2eSvaGROZ/V2H7JULhziNyNiPp8B6E
	hTvQ+UJnCp+AARDq3BBVh8GiNJK5Ncpx61coOdEglk73QVUwtbkwlAJXfFSvxlO/Lx/4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xl: Add stubdomain_cmdline option to xl.cfg
Message-Id: <E1m8cmU-00006M-5f@xenbits.xenproject.org>
Date: Wed, 28 Jul 2021 06:11:02 +0000

commit ce233b10319dfb77ab5e0102202190a5911ae8f3
Author:     Scott Davis <scottwd@gmail.com>
AuthorDate: Thu Jul 22 12:54:30 2021 -0400
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Tue Jul 27 14:22:01 2021 +0100

    tools/xl: Add stubdomain_cmdline option to xl.cfg
    
    This adds an option to the xl domain configuration file syntax for specifying
    a kernel command line for device-model stubdomains. It is intended for use with
    Linux-based stubdomains.
    
    Signed-off-by: Scott Davis <scott.davis@starlab.io>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 docs/man/xl.cfg.5.pod.in             |  4 ++++
 tools/golang/xenlight/helpers.gen.go |  3 +++
 tools/golang/xenlight/types.gen.go   |  1 +
 tools/include/libxl.h                | 12 ++++++++++++
 tools/libs/light/libxl_dm.c          |  1 +
 tools/libs/light/libxl_types.idl     |  1 +
 tools/xl/xl_parse.c                  |  2 ++
 7 files changed, 24 insertions(+)

diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
index 56370a37db..4b1e3028d2 100644
--- a/docs/man/xl.cfg.5.pod.in
+++ b/docs/man/xl.cfg.5.pod.in
@@ -2742,6 +2742,10 @@ In case of B<qemu-xen-traditional> it is expected to be MiniOS-based stubdomain
 image, in case of B<qemu-xen> it is expected to be Linux-based stubdomain
 kernel.
 
+=item B<stubdomain_cmdline="STRING">
+
+Set the device-model stubdomain kernel command line to B<STRING>.
+
 =item B<stubdomain_ramdisk="PATH">
 
 Override the path to the ramdisk image used as device-model stubdomain.
diff --git a/tools/golang/xenlight/helpers.gen.go b/tools/golang/xenlight/helpers.gen.go
index db82537b42..bfc1e7f312 100644
--- a/tools/golang/xenlight/helpers.gen.go
+++ b/tools/golang/xenlight/helpers.gen.go
@@ -1018,6 +1018,7 @@ return fmt.Errorf("converting field DeviceModelStubdomain: %v", err)
 }
 x.StubdomainMemkb = uint64(xc.stubdomain_memkb)
 x.StubdomainKernel = C.GoString(xc.stubdomain_kernel)
+x.StubdomainCmdline = C.GoString(xc.stubdomain_cmdline)
 x.StubdomainRamdisk = C.GoString(xc.stubdomain_ramdisk)
 x.DeviceModel = C.GoString(xc.device_model)
 x.DeviceModelSsidref = uint32(xc.device_model_ssidref)
@@ -1344,6 +1345,8 @@ return fmt.Errorf("converting field DeviceModelStubdomain: %v", err)
 xc.stubdomain_memkb = C.uint64_t(x.StubdomainMemkb)
 if x.StubdomainKernel != "" {
 xc.stubdomain_kernel = C.CString(x.StubdomainKernel)}
+if x.StubdomainCmdline != "" {
+xc.stubdomain_cmdline = C.CString(x.StubdomainCmdline)}
 if x.StubdomainRamdisk != "" {
 xc.stubdomain_ramdisk = C.CString(x.StubdomainRamdisk)}
 if x.DeviceModel != "" {
diff --git a/tools/golang/xenlight/types.gen.go b/tools/golang/xenlight/types.gen.go
index a214dd9df6..09a3bb67e2 100644
--- a/tools/golang/xenlight/types.gen.go
+++ b/tools/golang/xenlight/types.gen.go
@@ -483,6 +483,7 @@ DeviceModelVersion DeviceModelVersion
 DeviceModelStubdomain Defbool
 StubdomainMemkb uint64
 StubdomainKernel string
+StubdomainCmdline string
 StubdomainRamdisk string
 DeviceModel string
 DeviceModelSsidref uint32
diff --git a/tools/include/libxl.h b/tools/include/libxl.h
index ae7fe27c1f..b9ba16d698 100644
--- a/tools/include/libxl.h
+++ b/tools/include/libxl.h
@@ -1030,6 +1030,18 @@ typedef struct libxl__ctx libxl_ctx;
  */
 #define LIBXL_HAVE_BUILDINFO_KERNEL 1
 
+/*
+ * LIBXL_HAVE_BUILDINFO_DEVICE_MODEL_STUBDOMAIN
+ *
+ * If this is defined, then the libxl_domain_build_info structure will contain
+ * the following fields that specify options for device model stubdomains:
+ *  - stubdomain_memkb:   integer indicating stubdomain RAM size
+ *  - stubdomain_kernel:  string indicating stubdomain kernel image location
+ *  - stubdomain_cmdline: string of parameters to pass to the stubdomain kernel
+ *  - stubdomain_ramdisk: string indicating stubdomain ramdisk location
+ */
+#define LIBXL_HAVE_BUILDINFO_DEVICE_MODEL_STUBDOMAIN 1
+
 /*
  * LIBXL_HAVE_DEVICE_CHANNEL
  *
diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index dbd3c7f278..b1732c1944 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -2373,6 +2373,7 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
     }
 
     stubdom_state->pv_kernel.path = guest_config->b_info.stubdomain_kernel;
+    stubdom_state->pv_cmdline = guest_config->b_info.stubdomain_cmdline;
     stubdom_state->pv_ramdisk.path = guest_config->b_info.stubdomain_ramdisk;
 
     /* fixme: this function can leak the stubdom if it fails */
diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
index f45adddab0..3f9fff653a 100644
--- a/tools/libs/light/libxl_types.idl
+++ b/tools/libs/light/libxl_types.idl
@@ -523,6 +523,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("device_model_stubdomain", libxl_defbool),
     ("stubdomain_memkb",   MemKB),
     ("stubdomain_kernel",  string),
+    ("stubdomain_cmdline", string),
     ("stubdomain_ramdisk", string),
     # if you set device_model you must set device_model_version too
     ("device_model",     string),
diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index 9fb0791429..17dddb4cd5 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -2533,6 +2533,8 @@ skip_usbdev:
 
     xlu_cfg_replace_string (config, "stubdomain_kernel",
                             &b_info->stubdomain_kernel, 0);
+    xlu_cfg_replace_string (config, "stubdomain_cmdline",
+                            &b_info->stubdomain_cmdline, 0);
     xlu_cfg_replace_string (config, "stubdomain_ramdisk",
                             &b_info->stubdomain_ramdisk, 0);
     if (!xlu_cfg_get_long (config, "stubdomain_memory", &l, 0))
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jul 28 06:11:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Jul 2021 06:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.161354.296264 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m8cmg-0003MG-1N; Wed, 28 Jul 2021 06:11:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 161354.296264; Wed, 28 Jul 2021 06:11:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m8cmf-0003M8-US; Wed, 28 Jul 2021 06:11:13 +0000
Received: by outflank-mailman (input) for mailman id 161354;
 Wed, 28 Jul 2021 06:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8cme-0003Lu-Ar
 for xen-changelog@lists.xenproject.org; Wed, 28 Jul 2021 06:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8cme-0003rI-A3
 for xen-changelog@lists.xenproject.org; Wed, 28 Jul 2021 06:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8cme-00007O-91
 for xen-changelog@lists.xenproject.org; Wed, 28 Jul 2021 06: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mIMBRozpLE6lsLEBD6uu9edk+cPY9MXOWNR+0Pym/tk=; b=nOduUPJ1uyBKjo+Uh2vb9Tu+5o
	2rNJpawZ71Vh74h6+1R9OC6RjEZLAwsannQcbPsLorFhxLcppEiBGiTiAbj6WMSHFQWNhmpjts0Zg
	MVpmLr8Owte8k7SUPW7TG0aBrAMZYIvcTk45OmUEeCdI7E+f3rtIEklmJvA1ZizL3l8A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/firmware/ovmf: Use OvmfXen platform file if exist and update OVMF
Message-Id: <E1m8cme-00007O-91@xenbits.xenproject.org>
Date: Wed, 28 Jul 2021 06:11:12 +0000

commit 81f29142023841f42bce8ae0c7b73077d7e47219
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Mon Jul 19 14:48:45 2021 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Tue Jul 27 14:26:57 2021 +0100

    tools/firmware/ovmf: Use OvmfXen platform file if exist and update OVMF
    
    A platform introduced in EDK II named OvmfXen is now the one to use for
    Xen instead of OvmfX64. It comes with PVH support.
    
    Also, the Xen support in OvmfX64 is deprecated,
        "deprecation notice: *dynamic* multi-VMM (QEMU vs. Xen) support in OvmfPkg"
        https://edk2.groups.io/g/devel/message/75498
    and has been removed upstream.
    
    We need to also update to a newer version of OVMF as OvmfXen in the
    release "edk2-stable202105" doesn't work well with Xen, so we need the
    fix b37cfdd28071 ("OvmfPkg/XenPlatformPei: Relocate shared_info page
    mapping").
    
    Also, don't set anymore the number of thread for parallel build when
    building the newer platform, OvmfPkg/build.sh is now doing parallel
    build by default.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 Config.mk                    |  2 +-
 tools/firmware/ovmf-makefile | 10 ++++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index f9dce4549b..4d723eec1d 100644
--- a/Config.mk
+++ b/Config.mk
@@ -244,7 +244,7 @@ QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
-OVMF_UPSTREAM_REVISION ?= e1999b264f1f9d7230edf2448f757c73da567832
+OVMF_UPSTREAM_REVISION ?= b37cfdd2807181aed2fee1e17bd7ec1190db266a
 QEMU_UPSTREAM_REVISION ?= master
 MINIOS_UPSTREAM_REVISION ?= 051b87bb9c19609976fb038f386920e1ce5454c5
 
diff --git a/tools/firmware/ovmf-makefile b/tools/firmware/ovmf-makefile
index 55f9992145..1f619a5189 100644
--- a/tools/firmware/ovmf-makefile
+++ b/tools/firmware/ovmf-makefile
@@ -17,8 +17,14 @@ all: build
 .PHONY: build
 build:
 	if test -e .git ; then $(GIT) submodule update --init --recursive ; fi
-	OvmfPkg/build.sh -a X64 -b $(TARGET) -n 4
-	cp Build/OvmfX64/$(TARGET)_GCC*/FV/OVMF.fd ovmf.bin
+	set -ex; \
+	if test -e OvmfPkg/OvmfXen.dsc; then \
+	  OvmfPkg/build.sh -a X64 -b $(TARGET) -p OvmfPkg/OvmfXen.dsc; \
+	  cp Build/OvmfXen/$(TARGET)_GCC*/FV/OVMF.fd ovmf.bin; \
+	else \
+	  OvmfPkg/build.sh -a X64 -b $(TARGET) -n 4; \
+	  cp Build/OvmfX64/$(TARGET)_GCC*/FV/OVMF.fd ovmf.bin; \
+	fi
 
 .PHONY: clean
 clean:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jul 28 06:11:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Jul 2021 06:11:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.161355.296268 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m8cmq-0003P8-4A; Wed, 28 Jul 2021 06:11:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 161355.296268; Wed, 28 Jul 2021 06:11:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m8cmq-0003P0-1B; Wed, 28 Jul 2021 06:11:24 +0000
Received: by outflank-mailman (input) for mailman id 161355;
 Wed, 28 Jul 2021 06:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8cmo-0003Oq-EB
 for xen-changelog@lists.xenproject.org; Wed, 28 Jul 2021 06:11:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8cmo-0003rT-DH
 for xen-changelog@lists.xenproject.org; Wed, 28 Jul 2021 06:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8cmo-000083-CK
 for xen-changelog@lists.xenproject.org; Wed, 28 Jul 2021 06:11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1qTPi3KpNYBaES0PuMagCgxXVd30KNddNIbs7jruhQI=; b=ufSeSOOUF6VVWX4kY+BdGwOpmv
	D3Nh9TPN6svHytymJrzvBL0B89f9oR1eeEwDjInU158oRvCLAuUswZ33oYmW6tjru4649FR4+VmFK
	sBNjInT5IymyFnJHv1lj6nqaPx+kO5D7uLJ8CYuD73+GhKloFwV+bC5PX2ZrNJmutp10=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxl: add missing blank in message
Message-Id: <E1m8cmo-000083-CK@xenbits.xenproject.org>
Date: Wed, 28 Jul 2021 06:11:22 +0000

commit 0cdb4a5802bad51aa89f6b1f10014dd21c37228b
Author:     Alan Robinson <Alan.Robinson@fujitsu.com>
AuthorDate: Tue Jul 27 09:47:03 2021 +0200
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Tue Jul 27 14:27:55 2021 +0100

    tools/libxl: add missing blank in message
    
    Add missing blank giving "an emulation" instead of "anemulation"
    while making the text a single source line.
    
    Signed-off-by: Alan Robinson <alan.robinson@fujitsu.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 tools/libs/light/libxl_dm.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index b1732c1944..9d93056b5c 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -1893,8 +1893,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                 if (format == NULL) {
                     LOGD(WARN, guest_domid,
                          "Unable to determine disk image format: %s\n"
-                         "Disk will be available via PV drivers but not as an"
-                         "emulated disk.",
+                         "Disk will be available via PV drivers but not as an emulated disk.",
                          disks[i].vdev);
                     continue;
                 }
@@ -1905,8 +1904,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
 
                 if (!target_path) {
                     LOGD(WARN, guest_domid, "No way to get local access disk to image: %s\n"
-                         "Disk will be available via PV drivers but not as an"
-                         "emulated disk.",
+                         "Disk will be available via PV drivers but not as an emulated disk.",
                          disks[i].vdev);
                     continue;
                 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jul 28 16:33:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Jul 2021 16:33:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.161735.296820 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m8mUR-0007OF-H4; Wed, 28 Jul 2021 16:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 161735.296820; Wed, 28 Jul 2021 16:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m8mUR-0007O7-E6; Wed, 28 Jul 2021 16:33:03 +0000
Received: by outflank-mailman (input) for mailman id 161735;
 Wed, 28 Jul 2021 16:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8mUQ-0007O1-2R
 for xen-changelog@lists.xenproject.org; Wed, 28 Jul 2021 16:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8mUP-0005bG-V6
 for xen-changelog@lists.xenproject.org; Wed, 28 Jul 2021 16:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m8mUP-0006t9-Ts
 for xen-changelog@lists.xenproject.org; Wed, 28 Jul 2021 16: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dGRXN+F7s+OfHzJTVIJmDNqUtoMX0CpT+b71ysGGACI=; b=GAjjS0+skOA6VpqbGJzYuoF15Z
	w6c6KtmGdzaQ6mBZDLYV1iV+98Lj+W6hztdHeXC0u1HV40JD3NsaU+ygoWPCWuBhWT5hT5N+MCKb1
	3UgUEbUoosEGE5UD1UWNGfygh2uQ5jTn4UGVZ2+6rnZSuI1i4vl5C9qrXMH3rWTpYHsM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: work around build issue with GNU ld 2.37
Message-Id: <E1m8mUP-0006t9-Ts@xenbits.xenproject.org>
Date: Wed, 28 Jul 2021 16:33:01 +0000

commit 58ad654ebce7ccb272a3f4f3482c03aaad850d31
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jul 22 11:20:38 2021 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jul 27 15:03:29 2021 +0100

    x86: work around build issue with GNU ld 2.37
    
    I suspect it is commit 40726f16a8d7 ("ld script expression parsing")
    which broke the hypervisor build, by no longer accepting section names
    with a dash in them inside ADDR() (and perhaps other script directives
    expecting just a section name, not an expression): .note.gnu.build-id
    is such a section.
    
    Quoting all section names passed to ADDR() via DECL_SECTION() works
    around the regression.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/xen.lds.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 9c6c1c8005..955d5cf4a0 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -18,7 +18,7 @@ ENTRY(efi_start)
 #else /* !EFI */
 
 #define FORMAT "elf64-x86-64"
-#define DECL_SECTION(x) x : AT(ADDR(x) - __XEN_VIRT_START)
+#define DECL_SECTION(x) x : AT(ADDR(#x) - __XEN_VIRT_START)
 
 ENTRY(start_pa)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Jul 30 09:55:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Jul 2021 09:55:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.162444.297901 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m9PEQ-0003VA-Nh; Fri, 30 Jul 2021 09:55:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 162444.297901; Fri, 30 Jul 2021 09:55:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m9PEQ-0003V2-Kr; Fri, 30 Jul 2021 09:55:06 +0000
Received: by outflank-mailman (input) for mailman id 162444;
 Fri, 30 Jul 2021 09:55:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9PEP-0003Uw-8W
 for xen-changelog@lists.xenproject.org; Fri, 30 Jul 2021 09:55:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9PEP-0000WR-7i
 for xen-changelog@lists.xenproject.org; Fri, 30 Jul 2021 09:55:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9PEP-0003oo-6v
 for xen-changelog@lists.xenproject.org; Fri, 30 Jul 2021 09: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rgLwavBxrhw/NE9O9CgApMa/dckXlxmzYKjRx0OILgg=; b=Xc9fjyX4DHS1YwUFFwS2u0Ub+D
	KaDC8vuEwtPYxJbUzm7mbuiS7Lavbfyl2Qdd+ZjilPbUyF3oRc/kd7Lb6oz1+iX7S6P2IzV+TK3vi
	r8nu+Ru383SmJuzs2+LczdDflN+sYttEmxF/lz03VEwZ1VEHYKl6LZe0rohaHp7Oe6RI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/lib: Fix strcmp() and strncmp()
Message-Id: <E1m9PEP-0003oo-6v@xenbits.xenproject.org>
Date: Fri, 30 Jul 2021 09:55:05 +0000

commit 3747a2bb67daa5a8baeff6cda57dc98a5ef79c3e
Author:     Jane Malalane <jane.malalane@citrix.com>
AuthorDate: Tue Jul 27 19:47:15 2021 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Jul 30 10:52:46 2021 +0100

    xen/lib: Fix strcmp() and strncmp()
    
    The C standard requires that each character be compared as unsigned
    char. Xen's current behaviour compares as signed char, which changes
    the answer when chars with a value greater than 0x7f are used.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jane Malalane <jane.malalane@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
---
 xen/lib/strcmp.c  | 8 +++++---
 xen/lib/strncmp.c | 8 +++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/xen/lib/strcmp.c b/xen/lib/strcmp.c
index 465f1c4191..f85c1e8741 100644
--- a/xen/lib/strcmp.c
+++ b/xen/lib/strcmp.c
@@ -11,14 +11,16 @@
  */
 int (strcmp)(const char *cs, const char *ct)
 {
-	register signed char __res;
+	unsigned char *csu = (unsigned char *)cs;
+	unsigned char *ctu = (unsigned char *)ct;
+	int res;
 
 	while (1) {
-		if ((__res = *cs - *ct++) != 0 || !*cs++)
+		if ((res = *csu - *ctu++) != 0 || !*csu++)
 			break;
 	}
 
-	return __res;
+	return res;
 }
 
 /*
diff --git a/xen/lib/strncmp.c b/xen/lib/strncmp.c
index 9af7fa1c99..1480f58c2e 100644
--- a/xen/lib/strncmp.c
+++ b/xen/lib/strncmp.c
@@ -12,15 +12,17 @@
  */
 int (strncmp)(const char *cs, const char *ct, size_t count)
 {
-	register signed char __res = 0;
+	unsigned char *csu = (unsigned char *)cs;
+	unsigned char *ctu = (unsigned char *)ct;
+	int res = 0;
 
 	while (count) {
-		if ((__res = *cs - *ct++) != 0 || !*cs++)
+		if ((res = *csu - *ctu++) != 0 || !*csu++)
 			break;
 		count--;
 	}
 
-	return __res;
+	return res;
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 30 10:11:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Jul 2021 10:11:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.162461.297929 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m9PTv-0006UY-IW; Fri, 30 Jul 2021 10:11:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 162461.297929; Fri, 30 Jul 2021 10:11:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m9PTv-0006UQ-Ff; Fri, 30 Jul 2021 10:11:07 +0000
Received: by outflank-mailman (input) for mailman id 162461;
 Fri, 30 Jul 2021 10:11:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9PTt-0006UG-IA
 for xen-changelog@lists.xenproject.org; Fri, 30 Jul 2021 10:11:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9PTs-0000qp-Mc
 for xen-changelog@lists.xenproject.org; Fri, 30 Jul 2021 10:11:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9PTs-0005hv-Lb
 for xen-changelog@lists.xenproject.org; Fri, 30 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1BPS2UTZqwZ1d7yzMgXo6pLCT7fV8NqN1KAZl0AFiio=; b=JQ2xaQRCYJlq6bmnAHwfPC9vAn
	0Bncilm2Nrhkcm7trgPds7KKQGaf6NZNaHCSzCC5gKuhdlWeHHBriIG3/HlG9YboQr1WPN704IrIz
	/IYHL52VFo34LPn98N4OSpsuKMfKcB8B9DBwdToUPf5MHlVHzZjAn5APR11tmbjDMxkc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstored: Fix off-by-one in dump_state_nodes()
Message-Id: <E1m9PTs-0005hv-Lb@xenbits.xenproject.org>
Date: Fri, 30 Jul 2021 10:11:04 +0000

commit c85610a3224a89159284f082c8c3dfb842c070fb
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Jul 29 10:34:20 2021 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Jul 30 11:02:35 2021 +0100

    tools/xenstored: Fix off-by-one in dump_state_nodes()
    
    The maximum path length supported by Xenstored protocol is
    XENSTORE_ABS_PATH_MAX (i.e 3072). This doesn't take into account the
    NUL at the end of the path.
    
    However, the code to dump the nodes will allocate a buffer
    of XENSTORE_ABS_PATH. As a result it may not be possible to live-update
    if there is a node name of XENSTORE_ABS_PATH.
    
    Fix it by allocating a buffer of XENSTORE_ABS_PATH_MAX + 1 characters.
    
    Take the opportunity to pass the max length of the buffer as a
    parameter of dump_state_node_tree(). This will be clearer that the
    check in the function is linked to the allocation in dump_state_nodes().
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstore/xenstored_core.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 16c856730c..0d4c73d6e2 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -2574,7 +2574,8 @@ const char *dump_state_node_perms(FILE *fp, const struct xs_permissions *perms,
 	return NULL;
 }
 
-static const char *dump_state_node_tree(FILE *fp, char *path)
+static const char *dump_state_node_tree(FILE *fp, char *path,
+					unsigned int path_max_len)
 {
 	unsigned int pathlen, childlen, p = 0;
 	struct xs_state_record_header head;
@@ -2642,10 +2643,10 @@ static const char *dump_state_node_tree(FILE *fp, char *path)
 	}
 	while (p < hdr->childlen) {
 		childlen = strlen(child) + 1;
-		if (pathlen + childlen > XENSTORE_ABS_PATH_MAX)
+		if (pathlen + childlen > path_max_len)
 			return "Dump node path length error";
 		strcpy(path + pathlen, child);
-		ret = dump_state_node_tree(fp, path);
+		ret = dump_state_node_tree(fp, path, path_max_len);
 		if (ret)
 			return ret;
 		p += childlen;
@@ -2661,13 +2662,13 @@ const char *dump_state_nodes(FILE *fp, const void *ctx)
 {
 	char *path;
 
-	path = talloc_size(ctx, XENSTORE_ABS_PATH_MAX);
+	path = talloc_size(ctx, XENSTORE_ABS_PATH_MAX + 1);
 	if (!path)
 		return "Path buffer allocation error";
 
 	strcpy(path, "/");
 
-	return dump_state_node_tree(fp, path);
+	return dump_state_node_tree(fp, path, XENSTORE_ABS_PATH_MAX + 1);
 }
 
 void read_state_global(const void *ctx, const void *state)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 30 10:11:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Jul 2021 10:11:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.162462.297933 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m9PU4-0006Wo-K2; Fri, 30 Jul 2021 10:11:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 162462.297933; Fri, 30 Jul 2021 10:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m9PU4-0006Wg-H7; Fri, 30 Jul 2021 10:11:16 +0000
Received: by outflank-mailman (input) for mailman id 162462;
 Fri, 30 Jul 2021 10:11:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9PU2-0006WQ-Qt
 for xen-changelog@lists.xenproject.org; Fri, 30 Jul 2021 10:11:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9PU2-0000qy-Q3
 for xen-changelog@lists.xenproject.org; Fri, 30 Jul 2021 10:11:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9PU2-0005j5-P5
 for xen-changelog@lists.xenproject.org; Fri, 30 Jul 2021 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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BJq65gScCMUrent7EUk5BDKp8OPs/wFy8F0FG5PVrCg=; b=JP6HBT/sEtHWuMfuPv1bp6Q3t3
	wPDUfaVboe/+MwfwbAdzhFe/iP/zKI9DS2/HfcWo0SrOBj8viBgUUucqutvg+lJphw5TIMtPH9HkN
	dYAiW+hPe1zZ3xsfiM5JItulTbK5BeZ5bG7YBesyqJtzzIGB5Zv/qcO8kVU36jGHufuA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstored: Propagate correctly the error message from lu_start()
Message-Id: <E1m9PU2-0005j5-P5@xenbits.xenproject.org>
Date: Fri, 30 Jul 2021 10:11:14 +0000

commit 604551fb763c4c70123f642a9b2866890790e2b2
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Jul 29 12:06:02 2021 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Jul 30 11:02:46 2021 +0100

    tools/xenstored: Propagate correctly the error message from lu_start()
    
    lu_start() will only set errno when it returns NULL. For all the
    other cases, the value is unknown.
    
    This means that when lu_start() returns an error message, it may not
    be propagated to the client.
    
    The check that errno is a non-zero value is now dropped and instead
    the value is returned when no error message is provided. This
    relies on errno to always be set when ret == NULL.
    
    Fixes: af216a99fb ("tools/xenstore: add the basic framework for doing the live update")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstore/xenstored_control.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_control.c
index ff9863c17f..6b68b79faa 100644
--- a/tools/xenstore/xenstored_control.c
+++ b/tools/xenstore/xenstored_control.c
@@ -795,10 +795,8 @@ static int do_control_lu(void *ctx, struct connection *conn,
 				return EINVAL;
 		}
 		ret = lu_start(ctx, conn, force, to);
-		if (errno)
-			return errno;
 		if (!ret)
-			return 0;
+			return errno;
 	} else {
 		errno = 0;
 		ret = lu_arch(ctx, conn, vec, num);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jul 30 15:22:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Jul 2021 15:22:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.162602.298141 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m9UKs-0000Tq-J0; Fri, 30 Jul 2021 15:22:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 162602.298141; Fri, 30 Jul 2021 15:22:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m9UKs-0000Tg-Fo; Fri, 30 Jul 2021 15:22:06 +0000
Received: by outflank-mailman (input) for mailman id 162602;
 Fri, 30 Jul 2021 15:22:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9UKq-0000Ta-U0
 for xen-changelog@lists.xenproject.org; Fri, 30 Jul 2021 15:22:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9UKq-0005PS-RU
 for xen-changelog@lists.xenproject.org; Fri, 30 Jul 2021 15:22:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9UKq-0003AN-QU
 for xen-changelog@lists.xenproject.org; Fri, 30 Jul 2021 15: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=58Uo7EYhf8BkxEF6hOAoeiW7TSdXh3vt3+vywP2oBdM=; b=Ucf6kWuCODcZZT+idYthwaMFfS
	WFIN30RbIDJj1GrmW9rffrX2pf4h3bBNLLLV8haT/hLrZNw7EfWew3iNe16f32Z76ywZy1PcuVTJw
	H11UgoFV6kb9ll9xdjjFVtuQXlzFStRq+Zfv66g9Y8HwGAyYK83GTBEq5FSKeySVYKW4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstored: Don't assume errno will not be overwritten in lu_arch()
Message-Id: <E1m9UKq-0003AN-QU@xenbits.xenproject.org>
Date: Fri, 30 Jul 2021 15:22:04 +0000

commit e066ca5acc2ee3b5db5c005e1a548b05e753e07d
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Jul 30 16:14:14 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Jul 30 16:14:39 2021 +0100

    tools/xenstored: Don't assume errno will not be overwritten in lu_arch()
    
    At the moment, do_control_lu() will set errno to 0 before calling
    lu_arch() and then check errno. The expectation is nothing in lu_arch()
    will change the value unless there is an error.
    
    However, per errno(3), a function that succeeds is allowed to change
    errno. In fact, syslog() will overwrite errno if the logs are rotated
    at the time it is called.
    
    To prevent any further issue, errno is now always set before
    returning NULL.
    
    Additionally, errno is only checked when returning NULL so the client
    can see the error message if there is any.
    
    Reported-by: Michael Kurth <mku@amazon.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstore/xenstored_control.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_control.c
index 6b68b79faa..7b4300ef77 100644
--- a/tools/xenstore/xenstored_control.c
+++ b/tools/xenstore/xenstored_control.c
@@ -324,6 +324,7 @@ static const char *lu_binary_alloc(const void *ctx, struct connection *conn,
 	lu_status->kernel_size = size;
 	lu_status->kernel_off = 0;
 
+	errno = 0;
 	return NULL;
 }
 
@@ -339,6 +340,7 @@ static const char *lu_binary_save(const void *ctx, struct connection *conn,
 	memcpy(lu_status->kernel + lu_status->kernel_off, data, size);
 	lu_status->kernel_off += size;
 
+	errno = 0;
 	return NULL;
 }
 
@@ -413,6 +415,7 @@ static const char *lu_binary(const void *ctx, struct connection *conn,
 	if (!lu_status->filename)
 		return "Allocation failure.";
 
+	errno = 0;
 	return NULL;
 }
 
@@ -798,9 +801,8 @@ static int do_control_lu(void *ctx, struct connection *conn,
 		if (!ret)
 			return errno;
 	} else {
-		errno = 0;
 		ret = lu_arch(ctx, conn, vec, num);
-		if (errno)
+		if (!ret && errno)
 			return errno;
 	}
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sat Jul 31 17:11:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Jul 2021 17:11:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.162786.298400 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m9sVr-0007Rr-AW; Sat, 31 Jul 2021 17:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 162786.298400; Sat, 31 Jul 2021 17:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m9sVr-0007Rj-7d; Sat, 31 Jul 2021 17:11:03 +0000
Received: by outflank-mailman (input) for mailman id 162786;
 Sat, 31 Jul 2021 17:11:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9sVp-0007Rd-TH
 for xen-changelog@lists.xenproject.org; Sat, 31 Jul 2021 17:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9sVp-0003xH-RP
 for xen-changelog@lists.xenproject.org; Sat, 31 Jul 2021 17:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9sVp-00072C-QK
 for xen-changelog@lists.xenproject.org; Sat, 31 Jul 2021 17:11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TuqD55zKqECoSKGFj7MjS+Vqc5cLE/4+C6Gj4sbxNjk=; b=BqrSK0BSms8OLyQfPFJxwNPtRD
	vhnGRKjF8Y0s26rjWeHzMV5fck+VrjgGby31evGE1LxuLjrtMRQI9YiRle8/7iXvszrLYiloxcOrQ
	hutCDImJWdNtS0bdCGKBKFN72bYgRL3brzr3TMH2FLvTrG4CuQM1e261oah5pPTe0bTI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/lib: Fix strcmp() and strncmp()
Message-Id: <E1m9sVp-00072C-QK@xenbits.xenproject.org>
Date: Sat, 31 Jul 2021 17:11:01 +0000

commit 3747a2bb67daa5a8baeff6cda57dc98a5ef79c3e
Author:     Jane Malalane <jane.malalane@citrix.com>
AuthorDate: Tue Jul 27 19:47:15 2021 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Jul 30 10:52:46 2021 +0100

    xen/lib: Fix strcmp() and strncmp()
    
    The C standard requires that each character be compared as unsigned
    char. Xen's current behaviour compares as signed char, which changes
    the answer when chars with a value greater than 0x7f are used.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jane Malalane <jane.malalane@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
---
 xen/lib/strcmp.c  | 8 +++++---
 xen/lib/strncmp.c | 8 +++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/xen/lib/strcmp.c b/xen/lib/strcmp.c
index 465f1c4191..f85c1e8741 100644
--- a/xen/lib/strcmp.c
+++ b/xen/lib/strcmp.c
@@ -11,14 +11,16 @@
  */
 int (strcmp)(const char *cs, const char *ct)
 {
-	register signed char __res;
+	unsigned char *csu = (unsigned char *)cs;
+	unsigned char *ctu = (unsigned char *)ct;
+	int res;
 
 	while (1) {
-		if ((__res = *cs - *ct++) != 0 || !*cs++)
+		if ((res = *csu - *ctu++) != 0 || !*csu++)
 			break;
 	}
 
-	return __res;
+	return res;
 }
 
 /*
diff --git a/xen/lib/strncmp.c b/xen/lib/strncmp.c
index 9af7fa1c99..1480f58c2e 100644
--- a/xen/lib/strncmp.c
+++ b/xen/lib/strncmp.c
@@ -12,15 +12,17 @@
  */
 int (strncmp)(const char *cs, const char *ct, size_t count)
 {
-	register signed char __res = 0;
+	unsigned char *csu = (unsigned char *)cs;
+	unsigned char *ctu = (unsigned char *)ct;
+	int res = 0;
 
 	while (count) {
-		if ((__res = *cs - *ct++) != 0 || !*cs++)
+		if ((res = *csu - *ctu++) != 0 || !*csu++)
 			break;
 		count--;
 	}
 
-	return __res;
+	return res;
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Jul 31 17:11:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Jul 2021 17:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.162787.298404 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m9sW1-0007Tn-C1; Sat, 31 Jul 2021 17:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 162787.298404; Sat, 31 Jul 2021 17:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m9sW1-0007Tf-9B; Sat, 31 Jul 2021 17:11:13 +0000
Received: by outflank-mailman (input) for mailman id 162787;
 Sat, 31 Jul 2021 17:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9sVz-0007TX-VS
 for xen-changelog@lists.xenproject.org; Sat, 31 Jul 2021 17:11:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9sVz-0003xZ-UW
 for xen-changelog@lists.xenproject.org; Sat, 31 Jul 2021 17:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9sVz-00072n-Th
 for xen-changelog@lists.xenproject.org; Sat, 31 Jul 2021 17: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6AJvthozCm3DdiSVrmn8QQY2+ZYDvrY8QsSmovhl3OY=; b=YzKT6hjvc2zhZmaJ/VB6fPOeec
	WZLfjvzU0i+X2rxOchf4+o6kAu628v55luFvuABZ6QdiMq0iXfkBO44Ke2O6laaQM2c74Q4KZ2tVD
	73B0gtUFUYy5Z3uce4mxhnmh21kSrJ0bDUx4ZCXPjC9rV52gAptD36m2Kmx++tAm8jqo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: Fix off-by-one in dump_state_nodes()
Message-Id: <E1m9sVz-00072n-Th@xenbits.xenproject.org>
Date: Sat, 31 Jul 2021 17:11:11 +0000

commit c85610a3224a89159284f082c8c3dfb842c070fb
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Jul 29 10:34:20 2021 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Jul 30 11:02:35 2021 +0100

    tools/xenstored: Fix off-by-one in dump_state_nodes()
    
    The maximum path length supported by Xenstored protocol is
    XENSTORE_ABS_PATH_MAX (i.e 3072). This doesn't take into account the
    NUL at the end of the path.
    
    However, the code to dump the nodes will allocate a buffer
    of XENSTORE_ABS_PATH. As a result it may not be possible to live-update
    if there is a node name of XENSTORE_ABS_PATH.
    
    Fix it by allocating a buffer of XENSTORE_ABS_PATH_MAX + 1 characters.
    
    Take the opportunity to pass the max length of the buffer as a
    parameter of dump_state_node_tree(). This will be clearer that the
    check in the function is linked to the allocation in dump_state_nodes().
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstore/xenstored_core.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 16c856730c..0d4c73d6e2 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -2574,7 +2574,8 @@ const char *dump_state_node_perms(FILE *fp, const struct xs_permissions *perms,
 	return NULL;
 }
 
-static const char *dump_state_node_tree(FILE *fp, char *path)
+static const char *dump_state_node_tree(FILE *fp, char *path,
+					unsigned int path_max_len)
 {
 	unsigned int pathlen, childlen, p = 0;
 	struct xs_state_record_header head;
@@ -2642,10 +2643,10 @@ static const char *dump_state_node_tree(FILE *fp, char *path)
 	}
 	while (p < hdr->childlen) {
 		childlen = strlen(child) + 1;
-		if (pathlen + childlen > XENSTORE_ABS_PATH_MAX)
+		if (pathlen + childlen > path_max_len)
 			return "Dump node path length error";
 		strcpy(path + pathlen, child);
-		ret = dump_state_node_tree(fp, path);
+		ret = dump_state_node_tree(fp, path, path_max_len);
 		if (ret)
 			return ret;
 		p += childlen;
@@ -2661,13 +2662,13 @@ const char *dump_state_nodes(FILE *fp, const void *ctx)
 {
 	char *path;
 
-	path = talloc_size(ctx, XENSTORE_ABS_PATH_MAX);
+	path = talloc_size(ctx, XENSTORE_ABS_PATH_MAX + 1);
 	if (!path)
 		return "Path buffer allocation error";
 
 	strcpy(path, "/");
 
-	return dump_state_node_tree(fp, path);
+	return dump_state_node_tree(fp, path, XENSTORE_ABS_PATH_MAX + 1);
 }
 
 void read_state_global(const void *ctx, const void *state)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Jul 31 17:11:23 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Jul 2021 17:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.162788.298408 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m9sWB-0007WT-Dw; Sat, 31 Jul 2021 17:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 162788.298408; Sat, 31 Jul 2021 17:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m9sWB-0007WL-Ag; Sat, 31 Jul 2021 17:11:23 +0000
Received: by outflank-mailman (input) for mailman id 162788;
 Sat, 31 Jul 2021 17:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9sWA-0007W0-2M
 for xen-changelog@lists.xenproject.org; Sat, 31 Jul 2021 17:11:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9sWA-0003xq-1Q
 for xen-changelog@lists.xenproject.org; Sat, 31 Jul 2021 17:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9sWA-00073h-0Z
 for xen-changelog@lists.xenproject.org; Sat, 31 Jul 2021 17:11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xcMRKVnSPJ2QPym/cxO6IcrIkIDQUsjgoYwBP40SXNY=; b=XF/yRT2g/Tc5Rybd2HMOD97AVe
	wdM/2o8TBDu/nk5Gxygg6Gp5yBjEPY/dov4+tcE+FzpBUiVFKgFHS5a2qWuDgIj1UNOBOlQJSKScN
	Ze0qjCnX6njXKWbxsyAa8PYV61D8I9uQWVo7zz3mU8BomdkWa3apJiXdR0AI09dTpquc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: Propagate correctly the error message from lu_start()
Message-Id: <E1m9sWA-00073h-0Z@xenbits.xenproject.org>
Date: Sat, 31 Jul 2021 17:11:22 +0000

commit 604551fb763c4c70123f642a9b2866890790e2b2
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Jul 29 12:06:02 2021 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Jul 30 11:02:46 2021 +0100

    tools/xenstored: Propagate correctly the error message from lu_start()
    
    lu_start() will only set errno when it returns NULL. For all the
    other cases, the value is unknown.
    
    This means that when lu_start() returns an error message, it may not
    be propagated to the client.
    
    The check that errno is a non-zero value is now dropped and instead
    the value is returned when no error message is provided. This
    relies on errno to always be set when ret == NULL.
    
    Fixes: af216a99fb ("tools/xenstore: add the basic framework for doing the live update")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstore/xenstored_control.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_control.c
index ff9863c17f..6b68b79faa 100644
--- a/tools/xenstore/xenstored_control.c
+++ b/tools/xenstore/xenstored_control.c
@@ -795,10 +795,8 @@ static int do_control_lu(void *ctx, struct connection *conn,
 				return EINVAL;
 		}
 		ret = lu_start(ctx, conn, force, to);
-		if (errno)
-			return errno;
 		if (!ret)
-			return 0;
+			return errno;
 	} else {
 		errno = 0;
 		ret = lu_arch(ctx, conn, vec, num);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Jul 31 17:11:33 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Jul 2021 17:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.162791.298428 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m9sWL-0007qp-OB; Sat, 31 Jul 2021 17:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 162791.298428; Sat, 31 Jul 2021 17:11:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1m9sWL-0007qf-Kp; Sat, 31 Jul 2021 17:11:33 +0000
Received: by outflank-mailman (input) for mailman id 162791;
 Sat, 31 Jul 2021 17:11:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9sWK-0007qB-5J
 for xen-changelog@lists.xenproject.org; Sat, 31 Jul 2021 17:11:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9sWK-0003yw-4V
 for xen-changelog@lists.xenproject.org; Sat, 31 Jul 2021 17:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1m9sWK-00074T-3e
 for xen-changelog@lists.xenproject.org; Sat, 31 Jul 2021 17:11: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hrAeE5LhWBpgAge7X9qaOjcIXwxh0+hSCygiFm69/kY=; b=NSSf3Dsi5QfRW5DPVnOQ/kfK02
	IRW6wtJ55ZK8XCyyqzRg4oSbFcbKqPuwfUcrpw3ov++dnP3Tj5zRWCSe3GoFUYRWqzat85GhcC/bF
	Gl78Ka1+GmNonFW/sg7GEk7rv/f7B8M3vrWLnFiYWhcfvmPnKs9k8e6BBaniAmuU+YvM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: Don't assume errno will not be overwritten in lu_arch()
Message-Id: <E1m9sWK-00074T-3e@xenbits.xenproject.org>
Date: Sat, 31 Jul 2021 17:11:32 +0000

commit e066ca5acc2ee3b5db5c005e1a548b05e753e07d
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Jul 30 16:14:14 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Jul 30 16:14:39 2021 +0100

    tools/xenstored: Don't assume errno will not be overwritten in lu_arch()
    
    At the moment, do_control_lu() will set errno to 0 before calling
    lu_arch() and then check errno. The expectation is nothing in lu_arch()
    will change the value unless there is an error.
    
    However, per errno(3), a function that succeeds is allowed to change
    errno. In fact, syslog() will overwrite errno if the logs are rotated
    at the time it is called.
    
    To prevent any further issue, errno is now always set before
    returning NULL.
    
    Additionally, errno is only checked when returning NULL so the client
    can see the error message if there is any.
    
    Reported-by: Michael Kurth <mku@amazon.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstore/xenstored_control.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_control.c
index 6b68b79faa..7b4300ef77 100644
--- a/tools/xenstore/xenstored_control.c
+++ b/tools/xenstore/xenstored_control.c
@@ -324,6 +324,7 @@ static const char *lu_binary_alloc(const void *ctx, struct connection *conn,
 	lu_status->kernel_size = size;
 	lu_status->kernel_off = 0;
 
+	errno = 0;
 	return NULL;
 }
 
@@ -339,6 +340,7 @@ static const char *lu_binary_save(const void *ctx, struct connection *conn,
 	memcpy(lu_status->kernel + lu_status->kernel_off, data, size);
 	lu_status->kernel_off += size;
 
+	errno = 0;
 	return NULL;
 }
 
@@ -413,6 +415,7 @@ static const char *lu_binary(const void *ctx, struct connection *conn,
 	if (!lu_status->filename)
 		return "Allocation failure.";
 
+	errno = 0;
 	return NULL;
 }
 
@@ -798,9 +801,8 @@ static int do_control_lu(void *ctx, struct connection *conn,
 		if (!ret)
 			return errno;
 	} else {
-		errno = 0;
 		ret = lu_arch(ctx, conn, vec, num);
-		if (errno)
+		if (!ret && errno)
 			return errno;
 	}
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


