From xen-changelog-bounces@lists.xenproject.org Mon Mar 01 14:22:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 01 Mar 2021 14:22:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.91547.172959 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lGjR0-0004dk-Td; Mon, 01 Mar 2021 14:22:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 91547.172959; Mon, 01 Mar 2021 14: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 1lGjR0-0004dc-QA; Mon, 01 Mar 2021 14:22:06 +0000
Received: by outflank-mailman (input) for mailman id 91547;
 Mon, 01 Mar 2021 14: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 1lGjQy-0004dX-OJ
 for xen-changelog@lists.xenproject.org; Mon, 01 Mar 2021 14: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 1lGjQy-0001OM-KL
 for xen-changelog@lists.xenproject.org; Mon, 01 Mar 2021 14:22:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lGjQy-0000HM-JL
 for xen-changelog@lists.xenproject.org; Mon, 01 Mar 2021 14: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=jDB/tAxbcb2WnoWwhulu4d1/jw+RrRJLR4KzVDQVjsI=; b=PsB4Xz1xXpAVuVrVaBpBV43cT4
	I5vvN2o1SObGz6MbSAaEk6vpacBDqxhuDZyWeo9hglVnMO8q075rYU9Vpitz5dhK6SD46+AXAim4J
	DB6kFdIC92ViN6vcdXvA9P3i+oLhsEFO2OYvcbAEMjUitI0WFW/m+NVqzbdogBTK/iv4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Config.mk: pin to fixed versions for 4.15-rc
Message-Id: <E1lGjQy-0000HM-JL@xenbits.xenproject.org>
Date: Mon, 01 Mar 2021 14:22:04 +0000

commit 491ef860a752425518ff31d09ca79cfe444a0923
Author:     Ian Jackson <iwj@xenproject.org>
AuthorDate: Mon Mar 1 14:11:43 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Mon Mar 1 14:11:43 2021 +0000

    Config.mk: pin to fixed versions for 4.15-rc
    
    Signed-off-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 eb28e498be..a56a971028 100644
--- a/Config.mk
+++ b/Config.mk
@@ -245,7 +245,7 @@ SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= a3741780fe3535e19e02efa869a7cac481891129
-QEMU_UPSTREAM_REVISION ?= master
+QEMU_UPSTREAM_REVISION ?= 7ea428895af2840d85c524f0bd11a38aac308308
 MINIOS_UPSTREAM_REVISION ?= 051b87bb9c19609976fb038f386920e1ce5454c5
 
 SEABIOS_UPSTREAM_REVISION ?= rel-1.14.0
@@ -253,7 +253,7 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.14.0
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= 3d273dd05e51e5a1ffba3d98c7437ee84e8f8764
+QEMU_TRADITIONAL_REVISION ?= xen-4.15.0-rc1
 # Wed Jul 15 10:01:40 2020 +0100
 # qemu-trad: remove Xen path dependencies
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Mar 01 14:22:15 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 01 Mar 2021 14:22:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.91548.172963 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lGjR9-0004eV-Uq; Mon, 01 Mar 2021 14:22:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 91548.172963; Mon, 01 Mar 2021 14:22: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 1lGjR9-0004eN-Rd; Mon, 01 Mar 2021 14:22:15 +0000
Received: by outflank-mailman (input) for mailman id 91548;
 Mon, 01 Mar 2021 14:22: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 1lGjR8-0004eF-Ol
 for xen-changelog@lists.xenproject.org; Mon, 01 Mar 2021 14:22: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 1lGjR8-0001OT-Nu
 for xen-changelog@lists.xenproject.org; Mon, 01 Mar 2021 14:22:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lGjR8-0000IJ-MX
 for xen-changelog@lists.xenproject.org; Mon, 01 Mar 2021 14:22: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=d70TEPuftz+jFHbnQTVfxtQ+NSyL59S6erUs/Zl1tPs=; b=db4jH/ti5hU+q2eicVqjRi8yR4
	2iUdOw0yBs0gFbBIDWjpiBNBaOx2NieNyCufawEoV98af8pVXX6mqmUqGRhnh6GCzcBzlVcYZbawZ
	MKzEIcn72afZfbgeRdsAH7WPQi0YLZofLpQwDCuRbHRCJx99vfDbj1g//QviW+D47qas=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Version numbers: Set to 4.15-rc
Message-Id: <E1lGjR8-0000IJ-MX@xenbits.xenproject.org>
Date: Mon, 01 Mar 2021 14:22:14 +0000

commit 77d7b3540c12b9bebba67dca8eb2d939d9e8b5df
Author:     Ian Jackson <iwj@xenproject.org>
AuthorDate: Mon Mar 1 14:12:05 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Mon Mar 1 14:12:05 2021 +0000

    Version numbers: Set to 4.15-rc
    
    Signed-off-by: Ian Jackson <iwj@xenproject.org>
---
 README       | 10 +++++-----
 SUPPORT.md   |  2 +-
 xen/Makefile |  2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/README b/README
index 33cdf6b826..6e15242ae1 100644
--- a/README
+++ b/README
@@ -1,9 +1,9 @@
 #################################
- _  _    _ ____                        _        _     _
-| || |  / | ___|       _   _ _ __  ___| |_ __ _| |__ | | ___
-| || |_ | |___ \ _____| | | | '_ \/ __| __/ _` | '_ \| |/ _ \
-|__   _|| |___) |_____| |_| | | | \__ \ || (_| | |_) | |  __/
-   |_|(_)_|____/       \__,_|_| |_|___/\__\__,_|_.__/|_|\___|
+ _  _    _ ____
+| || |  / | ___|       _ __ ___
+| || |_ | |___ \ _____| '__/ __|
+|__   _|| |___) |_____| | | (__
+   |_|(_)_|____/      |_|  \___|
 
 #################################
 
diff --git a/SUPPORT.md b/SUPPORT.md
index 4cb5ec9802..7db4568f1a 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -9,7 +9,7 @@ for the definitions of the support status levels etc.
 
 # Release Support
 
-    Xen-Version: 4.15-unstable
+    Xen-Version: 4.15-rc
     Initial-Release: n/a
     Supported-Until: TBD
     Security-Support-Until: Unreleased - not yet security-supported
diff --git a/xen/Makefile b/xen/Makefile
index 544cc0995d..0b97e459e2 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 15
-export XEN_EXTRAVERSION ?= -unstable$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .0-rc$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Mar 01 23:22:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 01 Mar 2021 23:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.91991.173627 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lGrrb-0004C5-4B; Mon, 01 Mar 2021 23:22:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 91991.173627; Mon, 01 Mar 2021 23: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 1lGrrb-0004Bw-17; Mon, 01 Mar 2021 23:22:07 +0000
Received: by outflank-mailman (input) for mailman id 91991;
 Mon, 01 Mar 2021 23:22: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 1lGrra-0004Br-Eu
 for xen-changelog@lists.xenproject.org; Mon, 01 Mar 2021 23:22: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 1lGrrZ-0002ak-UY
 for xen-changelog@lists.xenproject.org; Mon, 01 Mar 2021 23:22:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lGrrZ-0003xi-T4
 for xen-changelog@lists.xenproject.org; Mon, 01 Mar 2021 23: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=od7HDZVIuWvkKzDj0m11n9igN8MfZwHHrNuqj1yjh3M=; b=kfSkJx6RVsYPXSNRcygdxtIrjv
	6m6cKaAlIpoyz5AjuGXuEl2D4I7dbYjQpDSdebAkySnoyKBoPa0+3wFyFas57WJyVmZ4vH/GZZO4U
	l+mjczEir0Jatbyu3ntGt2Nd1HpzNK67EuG0Ow/vzLMW9UFr6P+O43IEs7rowi6TNV+M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] cirrus-ci: Drop obsolete dependency
Message-Id: <E1lGrrZ-0003xi-T4@xenbits.xenproject.org>
Date: Mon, 01 Mar 2021 23:22:05 +0000

commit c90b6f4369a07f1538a5cdc54a40c4bd11da205f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Feb 25 20:30:49 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Mar 1 23:19:39 2021 +0000

    cirrus-ci: Drop obsolete dependency
    
    markdown as a dependency was dropped in 4.12
    
    Fixes: 5d94433a66 ("cirrus-ci: introduce some basic FreeBSD testing")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 5e3e46368e..0efff6fa98 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 markdown gettext-tools gmake
+  install_script: pkg install -y seabios gettext-tools gmake
                                  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 Mon Mar 01 23:22:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 01 Mar 2021 23:22:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.91992.173631 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lGrrl-0004Cr-5Y; Mon, 01 Mar 2021 23:22:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 91992.173631; Mon, 01 Mar 2021 23: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 1lGrrl-0004Cj-2m; Mon, 01 Mar 2021 23:22:17 +0000
Received: by outflank-mailman (input) for mailman id 91992;
 Mon, 01 Mar 2021 23:22: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 1lGrrk-0004Ca-3u
 for xen-changelog@lists.xenproject.org; Mon, 01 Mar 2021 23:22: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 1lGrrk-0002ar-1b
 for xen-changelog@lists.xenproject.org; Mon, 01 Mar 2021 23:22:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lGrrk-0003yO-0e
 for xen-changelog@lists.xenproject.org; Mon, 01 Mar 2021 23:22:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SLBqEVDNqWoYKqVTvVlTx0seoN7VaihZSttIA2l3fv0=; b=TPwwfclEr5cBvKfDNFa0UkffSV
	+DqmDtJyr5PDM76hivy4yvVoqzxSlyDshFIsIkaRZ0WP6Wb516csaFFIBqr4i/F+2d2iE2l7xbLAT
	qtFpi+6IWzueiO9x6snr41IvebWqvUU0XsPIMabzXzyJtlvVogfZzS6QEJCnZTDRWfR0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/hvmloader: Drop machelf include as well
Message-Id: <E1lGrrk-0003yO-0e@xenbits.xenproject.org>
Date: Mon, 01 Mar 2021 23:22:16 +0000

commit 570da5423dbee1a253fa09ceaa89c68e725e9d5b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Feb 25 19:13:17 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Mar 1 23:19:39 2021 +0000

    tools/hvmloader: Drop machelf include as well
    
    The logic behind switching to elfstructs applies to sun builds as well.
    
    Fixes: 81b2b328a2 ("hvmloader: use Xen private header for elf structs")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/firmware/hvmloader/32bitbios_support.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/tools/firmware/hvmloader/32bitbios_support.c b/tools/firmware/hvmloader/32bitbios_support.c
index e726946a7b..6f28fb6bde 100644
--- a/tools/firmware/hvmloader/32bitbios_support.c
+++ b/tools/firmware/hvmloader/32bitbios_support.c
@@ -22,9 +22,6 @@
 
 #include <inttypes.h>
 #include <xen/libelf/elfstructs.h>
-#ifdef __sun__
-#include <sys/machelf.h>
-#endif
 
 #include "util.h"
 #include "config.h"
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Mar 01 23:22:27 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 01 Mar 2021 23:22:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.91993.173635 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lGrrv-0004E4-7N; Mon, 01 Mar 2021 23:22:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 91993.173635; Mon, 01 Mar 2021 23:22: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 1lGrrv-0004Dw-4N; Mon, 01 Mar 2021 23:22:27 +0000
Received: by outflank-mailman (input) for mailman id 91993;
 Mon, 01 Mar 2021 23:22: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 1lGrru-0004Do-AB
 for xen-changelog@lists.xenproject.org; Mon, 01 Mar 2021 23:22: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 1lGrru-0002az-7t
 for xen-changelog@lists.xenproject.org; Mon, 01 Mar 2021 23:22:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lGrru-0003z1-3l
 for xen-changelog@lists.xenproject.org; Mon, 01 Mar 2021 23:22:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4GqjFoScs+AOsS6WirfNje1AFvQ/My/YJn8i4uVHxzs=; b=naVoqIVCodfsXB4oxnTiAyn/vT
	/E4iE0MabibvWuDcUVytYcx4cwZmD+DmWGNx44EqCUJJKOaXZ27vh62lYHR0ksBAqV/mtytrLnUNO
	Gk/OuSCGfxaQd2gqPk+ugrR26CFU+vrxviVqNPTM+UMWi6dhpXLebY29SdPQubFcb3Wk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/firmware: Build firmware as -ffreestanding
Message-Id: <E1lGrru-0003z1-3l@xenbits.xenproject.org>
Date: Mon, 01 Mar 2021 23:22:26 +0000

commit 0eae016b6e3dce69e3fb86aca5c4f221591a2f12
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Feb 25 19:15:08 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Mar 1 23:19:39 2021 +0000

    tools/firmware: Build firmware as -ffreestanding
    
    firmware should always have been -ffreestanding, as it doesn't execute in the
    host environment.  -ffreestanding implies -fno-builtin, so replace the option.
    
    inttypes.h isn't a freestanding header, but the 32bitbios_support.c only wants
    the stdint.h types so switch to the more appropriate include.
    
    This removes the build time dependency on a 32bit libc just to compile the
    hvmloader and friends.
    
    Update README and the TravisCI configuration.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 .travis.yml                                  | 1 -
 README                                       | 3 ---
 tools/firmware/Rules.mk                      | 2 +-
 tools/firmware/hvmloader/32bitbios_support.c | 2 +-
 4 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 15ca9e9047..2362475f7a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -58,7 +58,6 @@ addons:
             - acpica-tools
             - bin86
             - bcc
-            - libc6-dev-i386
             - libnl-3-dev
             - ocaml-nox
             - libfindlib-ocaml-dev
diff --git a/README b/README
index 6e15242ae1..8c99c30986 100644
--- a/README
+++ b/README
@@ -62,9 +62,6 @@ provided by your OS distributor:
     * GNU bison and GNU flex
     * GNU gettext
     * ACPI ASL compiler (iasl)
-    * Libc multiarch package (e.g. libc6-dev-i386 / glibc-devel.i686).
-      Required when building on a 64-bit platform to build
-      32-bit components which are enabled on a default build.
 
 In addition to the above there are a number of optional build
 prerequisites. Omitting these will cause the related features to be
diff --git a/tools/firmware/Rules.mk b/tools/firmware/Rules.mk
index 26bbddccd4..dc372a86d8 100644
--- a/tools/firmware/Rules.mk
+++ b/tools/firmware/Rules.mk
@@ -16,4 +16,4 @@ CFLAGS += -Werror
 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 
 # Extra CFLAGS suitable for an embedded type of environment.
-CFLAGS += -fno-builtin -msoft-float
+CFLAGS += -ffreestanding -msoft-float
diff --git a/tools/firmware/hvmloader/32bitbios_support.c b/tools/firmware/hvmloader/32bitbios_support.c
index 6f28fb6bde..cee3804888 100644
--- a/tools/firmware/hvmloader/32bitbios_support.c
+++ b/tools/firmware/hvmloader/32bitbios_support.c
@@ -20,7 +20,7 @@
  * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <inttypes.h>
+#include <stdint.h>
 #include <xen/libelf/elfstructs.h>
 
 #include "util.h"
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Mar 01 23:22:37 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 01 Mar 2021 23:22:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.91994.173639 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lGrs5-0004FY-95; Mon, 01 Mar 2021 23:22:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 91994.173639; Mon, 01 Mar 2021 23:22: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 1lGrs5-0004FQ-5w; Mon, 01 Mar 2021 23:22:37 +0000
Received: by outflank-mailman (input) for mailman id 91994;
 Mon, 01 Mar 2021 23:22: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 1lGrs4-0004FC-DM
 for xen-changelog@lists.xenproject.org; Mon, 01 Mar 2021 23:22: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 1lGrs4-0002bR-BA
 for xen-changelog@lists.xenproject.org; Mon, 01 Mar 2021 23:22:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lGrs4-0003zn-AF
 for xen-changelog@lists.xenproject.org; Mon, 01 Mar 2021 23:22:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HCuu7xN6sn1ePXhTvBvPBfuUtGmaKYhbpSAKkerZuo8=; b=dzRreWcbfhPsQIs1AhiEvzHGF7
	jK7DOcuREmg0OKFm8/TIf9LmOqSrIuCDizN0eoaU/XYH72rdzczW7jyHIuz1X9a0275Fza/z5KVU/
	UzEB0Zh+aQa8RbbzN3+hXGfW29bMnFWwoaRpxQGdjBexK3bf0idZvCAke8nxviKTNA1A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation: Annotate that a 32bit libc is no longer a dependency
Message-Id: <E1lGrs4-0003zn-AF@xenbits.xenproject.org>
Date: Mon, 01 Mar 2021 23:22:36 +0000

commit 6b4d4dd38470c2293caddf0a5f7034bb832bb574
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Feb 25 19:35:39 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Mar 1 23:19:39 2021 +0000

    automation: Annotate that a 32bit libc is no longer a dependency
    
    We can't drop the 32bit libc from the existing containers, because they are
    used on older Xen branches as well.
    
    However, we can avoid the dependency being propagated into newer conainers
    derived from our dockerfiles.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 automation/build/archlinux/current.dockerfile        | 1 +
 automation/build/centos/7.2.dockerfile               | 1 +
 automation/build/centos/7.dockerfile                 | 1 +
 automation/build/debian/jessie.dockerfile            | 1 +
 automation/build/debian/stretch.dockerfile           | 1 +
 automation/build/debian/unstable.dockerfile          | 1 +
 automation/build/fedora/29.dockerfile                | 1 +
 automation/build/suse/opensuse-leap.dockerfile       | 1 +
 automation/build/suse/opensuse-tumbleweed.dockerfile | 1 +
 automation/build/ubuntu/bionic.dockerfile            | 1 +
 automation/build/ubuntu/focal.dockerfile             | 1 +
 automation/build/ubuntu/trusty.dockerfile            | 1 +
 automation/build/ubuntu/xenial.dockerfile            | 1 +
 13 files changed, 13 insertions(+)

diff --git a/automation/build/archlinux/current.dockerfile b/automation/build/archlinux/current.dockerfile
index d8fbebaf79..d46fc9d9ca 100644
--- a/automation/build/archlinux/current.dockerfile
+++ b/automation/build/archlinux/current.dockerfile
@@ -20,6 +20,7 @@ RUN pacman -S --refresh --sysupgrade --noconfirm --noprogressbar --needed \
         iasl \
         inetutils \
         iproute \
+        # lib32-glibc for Xen < 4.15
         lib32-glibc \
         libaio \
         libcacard \
diff --git a/automation/build/centos/7.2.dockerfile b/automation/build/centos/7.2.dockerfile
index c2f46b694c..af672a0be1 100644
--- a/automation/build/centos/7.2.dockerfile
+++ b/automation/build/centos/7.2.dockerfile
@@ -34,6 +34,7 @@ RUN rpm --rebuilddb && \
         yajl-devel \
         pixman-devel \
         glibc-devel \
+        # glibc-devel.i686 for Xen < 4.15
         glibc-devel.i686 \
         make \
         binutils \
diff --git a/automation/build/centos/7.dockerfile b/automation/build/centos/7.dockerfile
index e37d9d743a..5f83c97d0c 100644
--- a/automation/build/centos/7.dockerfile
+++ b/automation/build/centos/7.dockerfile
@@ -32,6 +32,7 @@ RUN yum -y install \
         yajl-devel \
         pixman-devel \
         glibc-devel \
+        # glibc-devel.i686 for Xen < 4.15
         glibc-devel.i686 \
         make \
         binutils \
diff --git a/automation/build/debian/jessie.dockerfile b/automation/build/debian/jessie.dockerfile
index 1232b9e204..808d6272e4 100644
--- a/automation/build/debian/jessie.dockerfile
+++ b/automation/build/debian/jessie.dockerfile
@@ -31,6 +31,7 @@ RUN apt-get update && \
         bin86 \
         bcc \
         liblzma-dev \
+        # libc6-dev-i386 for Xen < 4.15
         libc6-dev-i386 \
         libnl-3-dev \
         ocaml-nox \
diff --git a/automation/build/debian/stretch.dockerfile b/automation/build/debian/stretch.dockerfile
index 32742f7f39..e3bace1f87 100644
--- a/automation/build/debian/stretch.dockerfile
+++ b/automation/build/debian/stretch.dockerfile
@@ -32,6 +32,7 @@ RUN apt-get update && \
         bin86 \
         bcc \
         liblzma-dev \
+        # libc6-dev-i386 for Xen < 4.15
         libc6-dev-i386 \
         libnl-3-dev \
         ocaml-nox \
diff --git a/automation/build/debian/unstable.dockerfile b/automation/build/debian/unstable.dockerfile
index aeb4f3448b..9a10ee08d6 100644
--- a/automation/build/debian/unstable.dockerfile
+++ b/automation/build/debian/unstable.dockerfile
@@ -32,6 +32,7 @@ RUN apt-get update && \
         bin86 \
         bcc \
         liblzma-dev \
+        # libc6-dev-i386 for Xen < 4.15
         libc6-dev-i386 \
         libnl-3-dev \
         ocaml-nox \
diff --git a/automation/build/fedora/29.dockerfile b/automation/build/fedora/29.dockerfile
index 6a4e5b0413..5482952523 100644
--- a/automation/build/fedora/29.dockerfile
+++ b/automation/build/fedora/29.dockerfile
@@ -25,6 +25,7 @@ RUN dnf -y install \
         yajl-devel \
         pixman-devel \
         glibc-devel \
+        # glibc-devel.i686 for Xen < 4.15
         glibc-devel.i686 \
         make \
         binutils \
diff --git a/automation/build/suse/opensuse-leap.dockerfile b/automation/build/suse/opensuse-leap.dockerfile
index c60c13c943..685dd5d7fd 100644
--- a/automation/build/suse/opensuse-leap.dockerfile
+++ b/automation/build/suse/opensuse-leap.dockerfile
@@ -26,6 +26,7 @@ RUN zypper install -y --no-recommends \
         git \
         glib2-devel \
         glibc-devel \
+        # glibc-devel-32bit for Xen < 4.15
         glibc-devel-32bit \
         gzip \
         hostname \
diff --git a/automation/build/suse/opensuse-tumbleweed.dockerfile b/automation/build/suse/opensuse-tumbleweed.dockerfile
index 084cce0921..061173e751 100644
--- a/automation/build/suse/opensuse-tumbleweed.dockerfile
+++ b/automation/build/suse/opensuse-tumbleweed.dockerfile
@@ -26,6 +26,7 @@ RUN zypper install -y --no-recommends \
         git \
         glib2-devel \
         glibc-devel \
+        # glibc-devel-32bit for Xen < 4.15
         glibc-devel-32bit \
         gzip \
         hostname \
diff --git a/automation/build/ubuntu/bionic.dockerfile b/automation/build/ubuntu/bionic.dockerfile
index 712b2e4722..408063698c 100644
--- a/automation/build/ubuntu/bionic.dockerfile
+++ b/automation/build/ubuntu/bionic.dockerfile
@@ -32,6 +32,7 @@ RUN apt-get update && \
         bin86 \
         bcc \
         liblzma-dev \
+        # libc6-dev-i386 for Xen < 4.15
         libc6-dev-i386 \
         libnl-3-dev \
         ocaml-nox \
diff --git a/automation/build/ubuntu/focal.dockerfile b/automation/build/ubuntu/focal.dockerfile
index c1c1f8d58f..90b4001a6a 100644
--- a/automation/build/ubuntu/focal.dockerfile
+++ b/automation/build/ubuntu/focal.dockerfile
@@ -31,6 +31,7 @@ RUN apt-get update && \
         bin86 \
         bcc \
         liblzma-dev \
+        # libc6-dev-i386 for Xen < 4.15
         libc6-dev-i386 \
         libnl-3-dev \
         ocaml-nox \
diff --git a/automation/build/ubuntu/trusty.dockerfile b/automation/build/ubuntu/trusty.dockerfile
index 397a28061d..fd377d948f 100644
--- a/automation/build/ubuntu/trusty.dockerfile
+++ b/automation/build/ubuntu/trusty.dockerfile
@@ -32,6 +32,7 @@ RUN apt-get update && \
         bin86 \
         bcc \
         liblzma-dev \
+        # libc6-dev-i386 for Xen < 4.15
         libc6-dev-i386 \
         libnl-3-dev \
         ocaml-nox \
diff --git a/automation/build/ubuntu/xenial.dockerfile b/automation/build/ubuntu/xenial.dockerfile
index ce0e84fa2f..57a71eb8c6 100644
--- a/automation/build/ubuntu/xenial.dockerfile
+++ b/automation/build/ubuntu/xenial.dockerfile
@@ -32,6 +32,7 @@ RUN apt-get update && \
         bin86 \
         bcc \
         liblzma-dev \
+        # libc6-dev-i386 for Xen < 4.15
         libc6-dev-i386 \
         libnl-3-dev \
         ocaml-nox \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 02 06:00:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Mar 2021 06:00:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92093.173826 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lGy4x-0007ZD-52; Tue, 02 Mar 2021 06:00:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 92093.173826; Tue, 02 Mar 2021 06:00:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lGy4w-0007Z3-WE; Tue, 02 Mar 2021 06:00:19 +0000
Received: by outflank-mailman (input) for mailman id 92093;
 Tue, 02 Mar 2021 06: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 1lGy4q-0007Yi-Vx
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 06: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 1lGy4q-0005wA-VF
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 06:00:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lGy4q-00077p-Sh
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 06: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=v2cEAcLM2fohLSFV4s94G2dOM8W9Gxfoqze0L0XIbOQ=; b=IGNVNyG9ZBd8RZTkBqD0ruP2rJ
	YLk5at65g3TmvE63aLVJkGwZibZOSrAeAY5pw4Gon+OHPQiePAl/wAuX8VqLWTRpFN5XnNJ1Jj1Qg
	3QlGWrVh3QdZhUwzBt3JmX5m/LYRlDRmQ7rtkYDnuxe6mHauIrdvmtejuJxQdQoDlo5o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Version numbers: Set to 4.15-rc
Message-Id: <E1lGy4q-00077p-Sh@xenbits.xenproject.org>
Date: Tue, 02 Mar 2021 06:00:12 +0000

commit 77d7b3540c12b9bebba67dca8eb2d939d9e8b5df
Author:     Ian Jackson <iwj@xenproject.org>
AuthorDate: Mon Mar 1 14:12:05 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Mon Mar 1 14:12:05 2021 +0000

    Version numbers: Set to 4.15-rc
    
    Signed-off-by: Ian Jackson <iwj@xenproject.org>
---
 README       | 10 +++++-----
 SUPPORT.md   |  2 +-
 xen/Makefile |  2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/README b/README
index 33cdf6b826..6e15242ae1 100644
--- a/README
+++ b/README
@@ -1,9 +1,9 @@
 #################################
- _  _    _ ____                        _        _     _
-| || |  / | ___|       _   _ _ __  ___| |_ __ _| |__ | | ___
-| || |_ | |___ \ _____| | | | '_ \/ __| __/ _` | '_ \| |/ _ \
-|__   _|| |___) |_____| |_| | | | \__ \ || (_| | |_) | |  __/
-   |_|(_)_|____/       \__,_|_| |_|___/\__\__,_|_.__/|_|\___|
+ _  _    _ ____
+| || |  / | ___|       _ __ ___
+| || |_ | |___ \ _____| '__/ __|
+|__   _|| |___) |_____| | | (__
+   |_|(_)_|____/      |_|  \___|
 
 #################################
 
diff --git a/SUPPORT.md b/SUPPORT.md
index 4cb5ec9802..7db4568f1a 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -9,7 +9,7 @@ for the definitions of the support status levels etc.
 
 # Release Support
 
-    Xen-Version: 4.15-unstable
+    Xen-Version: 4.15-rc
     Initial-Release: n/a
     Supported-Until: TBD
     Security-Support-Until: Unreleased - not yet security-supported
diff --git a/xen/Makefile b/xen/Makefile
index 544cc0995d..0b97e459e2 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 15
-export XEN_EXTRAVERSION ?= -unstable$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .0-rc$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Mar 02 06:00:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Mar 2021 06:00:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92092.173822 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lGy4x-0007Yx-1m; Tue, 02 Mar 2021 06:00:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 92092.173822; Tue, 02 Mar 2021 06:00:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lGy4w-0007Yp-Ul; Tue, 02 Mar 2021 06:00:18 +0000
Received: by outflank-mailman (input) for mailman id 92092;
 Tue, 02 Mar 2021 06: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 1lGy4g-00076U-T0
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 06: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 1lGy4g-0005w7-QJ
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 06:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lGy4f-00075v-V6
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 06:00: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=3p/vOVrbBo980DTbIDR604wA6jBd2ZC1pXP/eoi4J0Y=; b=09Vp5v8IfqcfFLlu7wjyDau5QB
	fE20sVdaTa/eDUcnaht8pB/h38+YoRqRgQeyZwyPc214eozT9WvKKKWMS1VVGcweAKnSKg5jGAtqQ
	mdbD8r45Z1c7p672gAcqJ67XSxvpBu2C/PT1iu4KMT8V9RTCVWtpClC9QW6wvA6EWiog=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Config.mk: pin to fixed versions for 4.15-rc
Message-Id: <E1lGy4f-00075v-V6@xenbits.xenproject.org>
Date: Tue, 02 Mar 2021 06:00:01 +0000

commit 491ef860a752425518ff31d09ca79cfe444a0923
Author:     Ian Jackson <iwj@xenproject.org>
AuthorDate: Mon Mar 1 14:11:43 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Mon Mar 1 14:11:43 2021 +0000

    Config.mk: pin to fixed versions for 4.15-rc
    
    Signed-off-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 eb28e498be..a56a971028 100644
--- a/Config.mk
+++ b/Config.mk
@@ -245,7 +245,7 @@ SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= a3741780fe3535e19e02efa869a7cac481891129
-QEMU_UPSTREAM_REVISION ?= master
+QEMU_UPSTREAM_REVISION ?= 7ea428895af2840d85c524f0bd11a38aac308308
 MINIOS_UPSTREAM_REVISION ?= 051b87bb9c19609976fb038f386920e1ce5454c5
 
 SEABIOS_UPSTREAM_REVISION ?= rel-1.14.0
@@ -253,7 +253,7 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.14.0
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= 3d273dd05e51e5a1ffba3d98c7437ee84e8f8764
+QEMU_TRADITIONAL_REVISION ?= xen-4.15.0-rc1
 # Wed Jul 15 10:01:40 2020 +0100
 # qemu-trad: remove Xen path dependencies
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Mar 02 09:44:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Mar 2021 09:44:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92220.173970 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lH1ZX-0005Wt-2Q; Tue, 02 Mar 2021 09:44:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 92220.173970; Tue, 02 Mar 2021 09:44: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 1lH1ZW-0005Wl-Uw; Tue, 02 Mar 2021 09:44:06 +0000
Received: by outflank-mailman (input) for mailman id 92220;
 Tue, 02 Mar 2021 09: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 1lH1ZU-0005Wc-Tb
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 09: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 1lH1ZU-0001ep-Rk
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 09:44:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lH1ZU-0007tQ-P6
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 09: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=QvBxI4bnT0fDMoW+GdEuJC0Ffso1cq1pySSLAJS76Wk=; b=w521BUU5PHODtIA6UKtlWcrsnh
	PJBFrhjsHU3m7NH+4CuwGxJup+YuddUzbnZ7u8kT9giHIIMZhBzZx9o3BuSpny91D3V78O9nzS0oq
	6E4vWFbKfMzBfSHukLlDaMyIKGy1aOrYNJKc+vm72qgg3zDGpVJ3lEz8Zvhr1CROsQBI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstored: Avoid dereferencing a NULL pointer if LiveUpdate is failing
Message-Id: <E1lH1ZU-0007tQ-P6@xenbits.xenproject.org>
Date: Tue, 02 Mar 2021 09:44:04 +0000

commit 29fae90baa14f518407fe7c437d38af768a3134c
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Feb 26 18:26:55 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Mar 2 09:42:21 2021 +0000

    tools/xenstored: Avoid dereferencing a NULL pointer if LiveUpdate is failing
    
    In case of failure in do_lu_start(), XenStored will first free lu_start
    and then try to dereference it.
    
    This will result to a NULL dereference as the destruction callback will
    set lu_start to NULL.
    
    The crash can be avoided by freeing lu_start *after* the reply has been
    set.
    
    Fixes: af216a99fb4a ("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>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/xenstore/xenstored_control.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_control.c
index 653890f2d9..766b243839 100644
--- a/tools/xenstore/xenstored_control.c
+++ b/tools/xenstore/xenstored_control.c
@@ -657,9 +657,8 @@ static bool do_lu_start(struct delayed_request *req)
 
 	/* We will reach this point only in case of failure. */
  out:
-	talloc_free(lu_status);
-
 	send_reply(lu_status->conn, XS_CONTROL, ret, strlen(ret) + 1);
+	talloc_free(lu_status);
 
 	return true;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 02 10:00:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Mar 2021 10:00:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92231.174009 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lH1p0-0007nr-VE; Tue, 02 Mar 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 92231.174009; Tue, 02 Mar 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 1lH1p0-0007nj-S4; Tue, 02 Mar 2021 10:00:06 +0000
Received: by outflank-mailman (input) for mailman id 92231;
 Tue, 02 Mar 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 1lH1oz-0007jj-I0
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 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 1lH1oz-00021K-GS
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 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 1lH1oz-0000bk-FS
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 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=yqEgU5V4AEANRE8kZVC2Ke053s8GZN/ra120WQ7B5RA=; b=H+5jDOre2pTYE9vSq4KwuWX9AG
	Ej2L7W1Dk+jNEn+9+O2W/aPkNPgzZhE5iZ8rkVIrhZUzgit91gWf13NOE9p7RDlGQDil5hOiToP65
	NXWxJ3ZpK9wVLRfNLV8JIRsmY0MXx/mgTo5XdkoiSEdrFON0Sjj8sL5X2lDo/yvsc9Qg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/iommu: x86: Don't try to free page tables is the IOMMU is not enabled
Message-Id: <E1lH1oz-0000bk-FS@xenbits.xenproject.org>
Date: Tue, 02 Mar 2021 10:00:05 +0000

commit f4cf483e2a1aec2b359347f0a34abd6bf2f208c2
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Feb 26 10:56:38 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Mar 2 09:51:14 2021 +0000

    xen/iommu: x86: Don't try to free page tables is the IOMMU is not enabled
    
    When using CONFIG_BIGMEM=y, the page_list cannot be accessed whilst it
    is is unitialized. However, iommu_free_pgtables() will be called even if
    the domain is not using an IOMMU.
    
    Consequently, Xen will try to go through the page list and deference a
    NULL pointer.
    
    Bail out early if the domain is not using an IOMMU.
    
    Fixes: 15bc9a1ef51c ("x86/iommu: add common page-table allocator")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/drivers/passthrough/x86/iommu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c
index cea1032b3d..58a330e822 100644
--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -267,6 +267,9 @@ int iommu_free_pgtables(struct domain *d)
     struct page_info *pg;
     unsigned int done = 0;
 
+    if ( !is_iommu_enabled(d) )
+        return 0;
+
     while ( (pg = page_list_remove_head(&hd->arch.pgtables.list)) )
     {
         free_domheap_page(pg);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 02 10:00:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Mar 2021 10:00:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92233.174013 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lH1pB-0007pL-0W; Tue, 02 Mar 2021 10:00:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 92233.174013; Tue, 02 Mar 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 1lH1pA-0007pD-TZ; Tue, 02 Mar 2021 10:00:16 +0000
Received: by outflank-mailman (input) for mailman id 92233;
 Tue, 02 Mar 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 1lH1p9-0007p3-KP
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 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 1lH1p9-00021T-Ji
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 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 1lH1p9-0000d5-Il
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 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=i9K8yymUVyXLxPFDUOEMPC6jSrHq9TAwIw+SFIIl2LM=; b=MLuHGxRl+2U0g/tVTaAslzOg67
	Btm+YrJyuJkvLEqe1cOVbMX8HfChnT+EFNGSjEp1p4x/EUX/JC5IZ7KyjUPDgCJU8lOVEs0tDly3y
	Gud/MQnj5tauIJ3cKMeRDG1EJ+ZKZ2w4XmoQsLsSA9yTcQzbdX3gCq1AkFEvwes6nNKA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/x86: iommu: Ignore IOMMU mapping requests when a domain is dying
Message-Id: <E1lH1p9-0000d5-Il@xenbits.xenproject.org>
Date: Tue, 02 Mar 2021 10:00:15 +0000

commit 1ef48c82e77692f63114cb6bdeee8a9261dbe493
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Feb 26 10:56:39 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Mar 2 09:52:30 2021 +0000

    xen/x86: iommu: Ignore IOMMU mapping requests when a domain is dying
    
    The new x86 IOMMU page-tables allocator will release the pages when
    relinquishing the domain resources. However, this is not sufficient
    when the domain is dying because nothing prevents page-table to be
    allocated.
    
    As the domain is dying, it is not necessary to continue to modify the
    IOMMU page-tables as they are going to be destroyed soon.
    
    At the moment, page-table allocates will only happen when iommu_map().
    So after this change there will be no more page-table allocation
    happening because we don't use superpage mappings yet when not sharing
    page tables.
    
    In order to observe d->is_dying correctly, we need to rely on per-arch
    locking, so the check to ignore IOMMU mapping is added on the per-driver
    map_page() callback.
    
    Fixes: 15bc9a1ef51c ("x86/iommu: add common page-table allocator")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/drivers/passthrough/amd/iommu_map.c | 12 ++++++++++++
 xen/drivers/passthrough/vtd/iommu.c     | 12 ++++++++++++
 xen/drivers/passthrough/x86/iommu.c     |  3 +++
 3 files changed, 27 insertions(+)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index d3a8b1aec7..560af54b76 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -285,6 +285,18 @@ int amd_iommu_map_page(struct domain *d, dfn_t dfn, mfn_t mfn,
 
     spin_lock(&hd->arch.mapping_lock);
 
+    /*
+     * IOMMU mapping request can be safely ignored when the domain is dying.
+     *
+     * hd->arch.mapping_lock guarantees that d->is_dying will be observed
+     * before any page tables are freed (see iommu_free_pgtables()).
+     */
+    if ( d->is_dying )
+    {
+        spin_unlock(&hd->arch.mapping_lock);
+        return 0;
+    }
+
     rc = amd_iommu_alloc_root(d);
     if ( rc )
     {
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index d136fe3688..b549a71530 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1762,6 +1762,18 @@ static int __must_check intel_iommu_map_page(struct domain *d, dfn_t dfn,
 
     spin_lock(&hd->arch.mapping_lock);
 
+    /*
+     * IOMMU mapping request can be safely ignored when the domain is dying.
+     *
+     * hd->arch.mapping_lock guarantees that d->is_dying will be observed
+     * before any page tables are freed (see iommu_free_pgtables())
+     */
+    if ( d->is_dying )
+    {
+        spin_unlock(&hd->arch.mapping_lock);
+        return 0;
+    }
+
     pg_maddr = addr_to_dma_page_maddr(d, dfn_to_daddr(dfn), 1);
     if ( !pg_maddr )
     {
diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c
index 58a330e822..ad19b7dd46 100644
--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -270,6 +270,9 @@ int iommu_free_pgtables(struct domain *d)
     if ( !is_iommu_enabled(d) )
         return 0;
 
+    /* After this barrier, no new IOMMU mappings can be inserted. */
+    spin_barrier(&hd->arch.mapping_lock);
+
     while ( (pg = page_list_remove_head(&hd->arch.pgtables.list)) )
     {
         free_domheap_page(pg);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 02 10:00:27 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Mar 2021 10:00:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92234.174016 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lH1pL-0007qs-1r; Tue, 02 Mar 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 92234.174016; Tue, 02 Mar 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 1lH1pK-0007qk-VB; Tue, 02 Mar 2021 10:00:26 +0000
Received: by outflank-mailman (input) for mailman id 92234;
 Tue, 02 Mar 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 1lH1pJ-0007qZ-Pw
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 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 1lH1pJ-00021a-P6
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 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 1lH1pJ-0000dl-M8
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 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=SBVzPzK6IQnlEh/1FDprAcwz0WNIMfEIq3x1cEqMcT0=; b=EKmd82x3VPaq5LqTsp9EU9GzM6
	oYcGybdtqyS9O+HwlHmk1XCW0aUewRpf+XpADhm9IMsG69LbCDVKLzW0u8opPp+dJvuSNQqKUZpvk
	wYb/rNQyhmV1Zlj5vtvTHnGiGdWuA97SDycmO1ma0h7Hn0lnWSx33cUCA7fShl5njzCo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/iommu: x86: Clear the root page-table before freeing the page-tables
Message-Id: <E1lH1pJ-0000dl-M8@xenbits.xenproject.org>
Date: Tue, 02 Mar 2021 10:00:25 +0000

commit 9bd9695a8bc72a86b98c0683736d2310838558fe
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Feb 26 10:56:40 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Mar 2 09:54:43 2021 +0000

    xen/iommu: x86: Clear the root page-table before freeing the page-tables
    
    The new per-domain IOMMU page-table allocator will now free the
    page-tables when domain's resources are relinquished. However, the
    per-domain IOMMU structure will still contain a dangling pointer to
    the root page-table.
    
    Xen may access the IOMMU page-tables afterwards at least in the case of
    PV domain:
    
    (XEN) Xen call trace:
    (XEN)    [<ffff82d04025b4b2>] R iommu.c#addr_to_dma_page_maddr+0x12e/0x1d8
    (XEN)    [<ffff82d04025b695>] F iommu.c#intel_iommu_unmap_page+0x5d/0xf8
    (XEN)    [<ffff82d0402695f3>] F iommu_unmap+0x9c/0x129
    (XEN)    [<ffff82d0402696a6>] F iommu_legacy_unmap+0x26/0x63
    (XEN)    [<ffff82d04033c5c7>] F mm.c#cleanup_page_mappings+0x139/0x144
    (XEN)    [<ffff82d04033c61d>] F put_page+0x4b/0xb3
    (XEN)    [<ffff82d04033c87f>] F put_page_from_l1e+0x136/0x13b
    (XEN)    [<ffff82d04033cada>] F devalidate_page+0x256/0x8dc
    (XEN)    [<ffff82d04033d396>] F mm.c#_put_page_type+0x236/0x47e
    (XEN)    [<ffff82d04033d64d>] F mm.c#put_pt_page+0x6f/0x80
    (XEN)    [<ffff82d04033d8d6>] F mm.c#put_page_from_l2e+0x8a/0xcf
    (XEN)    [<ffff82d04033cc27>] F devalidate_page+0x3a3/0x8dc
    (XEN)    [<ffff82d04033d396>] F mm.c#_put_page_type+0x236/0x47e
    (XEN)    [<ffff82d04033d64d>] F mm.c#put_pt_page+0x6f/0x80
    (XEN)    [<ffff82d04033d807>] F mm.c#put_page_from_l3e+0x8a/0xcf
    (XEN)    [<ffff82d04033cdf0>] F devalidate_page+0x56c/0x8dc
    (XEN)    [<ffff82d04033d396>] F mm.c#_put_page_type+0x236/0x47e
    (XEN)    [<ffff82d04033d64d>] F mm.c#put_pt_page+0x6f/0x80
    (XEN)    [<ffff82d04033d6c7>] F mm.c#put_page_from_l4e+0x69/0x6d
    (XEN)    [<ffff82d04033cf24>] F devalidate_page+0x6a0/0x8dc
    (XEN)    [<ffff82d04033d396>] F mm.c#_put_page_type+0x236/0x47e
    (XEN)    [<ffff82d04033d92e>] F put_page_type_preemptible+0x13/0x15
    (XEN)    [<ffff82d04032598a>] F domain.c#relinquish_memory+0x1ff/0x4e9
    (XEN)    [<ffff82d0403295f2>] F domain_relinquish_resources+0x2b6/0x36a
    (XEN)    [<ffff82d040205cdf>] F domain_kill+0xb8/0x141
    (XEN)    [<ffff82d040236cac>] F do_domctl+0xb6f/0x18e5
    (XEN)    [<ffff82d04031d098>] F pv_hypercall+0x2f0/0x55f
    (XEN)    [<ffff82d04039b432>] F lstar_enter+0x112/0x120
    
    This will result to a use after-free and possibly an host crash or
    memory corruption.
    
    It would not be possible to free the page-tables further down in
    domain_relinquish_resources() because cleanup_page_mappings() will only
    be called when the last reference on the page dropped. This may happen
    much later if another domain still hold a reference.
    
    After all the PCI devices have been de-assigned, nobody should use the
    IOMMU page-tables and it is therefore pointless to try to modify them.
    
    So we can simply clear any reference to the root page-table in the
    per-domain IOMMU structure. This requires to introduce a new callback of
    the method will depend on the IOMMU driver used.
    
    Take the opportunity to add an ASSERT() in arch_iommu_domain_destroy()
    to check if we freed all the IOMMU page tables.
    
    Fixes: 3eef6d07d722 ("x86/iommu: convert VT-d code to use new page table allocator")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c | 12 +++++++++++-
 xen/drivers/passthrough/vtd/iommu.c         | 12 +++++++++++-
 xen/drivers/passthrough/x86/iommu.c         | 13 +++++++++++++
 xen/include/xen/iommu.h                     |  1 +
 4 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 42b5a5a9be..085fe2f577 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -381,9 +381,18 @@ static int amd_iommu_assign_device(struct domain *d, u8 devfn,
     return reassign_device(pdev->domain, d, devfn, pdev);
 }
 
+static void amd_iommu_clear_root_pgtable(struct domain *d)
+{
+    struct domain_iommu *hd = dom_iommu(d);
+
+    spin_lock(&hd->arch.mapping_lock);
+    hd->arch.amd.root_table = NULL;
+    spin_unlock(&hd->arch.mapping_lock);
+}
+
 static void amd_iommu_domain_destroy(struct domain *d)
 {
-    dom_iommu(d)->arch.amd.root_table = NULL;
+    ASSERT(!dom_iommu(d)->arch.amd.root_table);
 }
 
 static int amd_iommu_add_device(u8 devfn, struct pci_dev *pdev)
@@ -565,6 +574,7 @@ static const struct iommu_ops __initconstrel _iommu_ops = {
     .remove_device = amd_iommu_remove_device,
     .assign_device  = amd_iommu_assign_device,
     .teardown = amd_iommu_domain_destroy,
+    .clear_root_pgtable = amd_iommu_clear_root_pgtable,
     .map_page = amd_iommu_map_page,
     .unmap_page = amd_iommu_unmap_page,
     .iotlb_flush = amd_iommu_flush_iotlb_pages,
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index b549a71530..475efb3be3 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1726,6 +1726,15 @@ out:
     return ret;
 }
 
+static void iommu_clear_root_pgtable(struct domain *d)
+{
+    struct domain_iommu *hd = dom_iommu(d);
+
+    spin_lock(&hd->arch.mapping_lock);
+    hd->arch.vtd.pgd_maddr = 0;
+    spin_unlock(&hd->arch.mapping_lock);
+}
+
 static void iommu_domain_teardown(struct domain *d)
 {
     struct domain_iommu *hd = dom_iommu(d);
@@ -1740,7 +1749,7 @@ static void iommu_domain_teardown(struct domain *d)
         xfree(mrmrr);
     }
 
-    hd->arch.vtd.pgd_maddr = 0;
+    ASSERT(!hd->arch.vtd.pgd_maddr);
 }
 
 static int __must_check intel_iommu_map_page(struct domain *d, dfn_t dfn,
@@ -2731,6 +2740,7 @@ static struct iommu_ops __initdata vtd_ops = {
     .remove_device = intel_iommu_remove_device,
     .assign_device  = intel_iommu_assign_device,
     .teardown = iommu_domain_teardown,
+    .clear_root_pgtable = iommu_clear_root_pgtable,
     .map_page = intel_iommu_map_page,
     .unmap_page = intel_iommu_unmap_page,
     .lookup_page = intel_iommu_lookup_page,
diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c
index ad19b7dd46..b90bb31bfe 100644
--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -149,6 +149,13 @@ int arch_iommu_domain_init(struct domain *d)
 
 void arch_iommu_domain_destroy(struct domain *d)
 {
+    /*
+     * There should be not page-tables left allocated by the time the
+     * domain is destroyed. Note that arch_iommu_domain_destroy() is
+     * called unconditionally, so pgtables may be uninitialized.
+     */
+    ASSERT(!dom_iommu(d)->platform_ops ||
+           page_list_empty(&dom_iommu(d)->arch.pgtables.list));
 }
 
 static bool __hwdom_init hwdom_iommu_map(const struct domain *d,
@@ -273,6 +280,12 @@ int iommu_free_pgtables(struct domain *d)
     /* After this barrier, no new IOMMU mappings can be inserted. */
     spin_barrier(&hd->arch.mapping_lock);
 
+    /*
+     * Pages will be moved to the free list below. So we want to
+     * clear the root page-table to avoid any potential use after-free.
+     */
+    hd->platform_ops->clear_root_pgtable(d);
+
     while ( (pg = page_list_remove_head(&hd->arch.pgtables.list)) )
     {
         free_domheap_page(pg);
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 863a68fe16..d59ed7cbad 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -272,6 +272,7 @@ struct iommu_ops {
 
     int (*adjust_irq_affinities)(void);
     void (*sync_cache)(const void *addr, unsigned int size);
+    void (*clear_root_pgtable)(struct domain *d);
 #endif /* CONFIG_X86 */
 
     int __must_check (*suspend)(void);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 02 11:33:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Mar 2021 11:33:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92287.174153 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lH3H0-00014N-He; Tue, 02 Mar 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 92287.174153; Tue, 02 Mar 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 1lH3H0-00014F-Eo; Tue, 02 Mar 2021 11:33:06 +0000
Received: by outflank-mailman (input) for mailman id 92287;
 Tue, 02 Mar 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 1lH3Gz-00014A-EB
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 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 1lH3Gz-0003YP-CO
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 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 1lH3Gz-0006pv-9N
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 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=pGAJ8fMBLgEsfsdxNj2MPffZMyCmTH8MwgAQ06r0DVI=; b=MlIi0nWgXCeBHEy/F86QA4diVE
	Vcv+6DBcV4qGcUE6FzGQaa0yil6boINhXiMjSq8QV9sDht5lUhULCtJtvPn+jQTGpqbGGQNQ/ztwE
	Kh0yfBV8/Vo7mluvSXGtKB17G6L1N3+PCcMmrOnrVRVMOre7Txj62WqkuNt/MzDoOArg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] sched: fix build when NR_CPUS == 1
Message-Id: <E1lH3Gz-0006pv-9N@xenbits.xenproject.org>
Date: Tue, 02 Mar 2021 11:33:05 +0000

commit 2de43f834ad2d758dd7b3441a6d1398491f18eae
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 2 12:29:16 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 2 12:29:16 2021 +0100

    sched: fix build when NR_CPUS == 1
    
    In this case the compiler is recognizing that no valid array indexes
    remain, and hence e.g. reports:
    
    core.c: In function 'cpu_schedule_up':
    core.c:2769:19: error: array subscript 1 is above array bounds
    of 'struct vcpu *[1]' [-Werror=array-bounds]
     2769 |     if ( idle_vcpu[cpu] == NULL )
          |          ~~~~~~~~~^~~~~
    
    Reported-by: Connor Davis <connojdavis@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/common/sched/core.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 2b974fd6f8..6d34764d38 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -2768,6 +2768,12 @@ static int cpu_schedule_up(unsigned int cpu)
     if ( cpu == 0 )
         return 0;
 
+    /*
+     * Guard in particular against the compiler suspecting out-of-bounds
+     * array accesses below when NR_CPUS=1.
+     */
+    BUG_ON(cpu >= NR_CPUS);
+
     if ( idle_vcpu[cpu] == NULL )
         vcpu_create(idle_vcpu[0]->domain, cpu);
     else
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 02 11:33:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Mar 2021 11:33:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92288.174157 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lH3HA-00015N-Kf; Tue, 02 Mar 2021 11:33:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 92288.174157; Tue, 02 Mar 2021 11: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 1lH3HA-00015F-Hc; Tue, 02 Mar 2021 11:33:16 +0000
Received: by outflank-mailman (input) for mailman id 92288;
 Tue, 02 Mar 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 1lH3H9-000159-HI
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 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 1lH3H9-0003YX-G1
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 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 1lH3H9-0006ql-Ex
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 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=jxKBorvSzsB+OjpCJPcJpIN9A5xbuiwsGH/X3XdQLSs=; b=FJgYkudr3roNNYNBtc4d/waEC0
	Gqv01NrCFvS/K54asWHK7mF//67Ngn1rClUywvlRz8TdE3RLWUgA0sCiOni6weAPOecXrUpNUhzHq
	rBhbcNgr7B0cgYagZ2o487AGe6vtQmVyIykMRJc7SbQejTkROBLNCSZeLcjgZr5J45sw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: replace bogus return path in shadow_get_page_from_l1e()
Message-Id: <E1lH3H9-0006ql-Ex@xenbits.xenproject.org>
Date: Tue, 02 Mar 2021 11:33:15 +0000

commit 4834936549f788378918da8e9bc97df7dd3ee16d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 2 12:30:30 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 2 12:30:30 2021 +0100

    x86/shadow: replace bogus return path in shadow_get_page_from_l1e()
    
    Prior to be640b1800bb ("x86: make get_page_from_l1e() return a proper
    error code") a positive return value did indicate an error. Said commit
    failed to adjust this return path, but luckily the only caller has
    always been inside a shadow_mode_refcounts() conditional.
    
    Subsequent changes caused 1 to end up at the default (error) label in
    the caller's switch() again, but the returning of 1 (== _PAGE_PRESENT)
    is still rather confusing here, and a latent risk.
    
    Convert to an ASSERT() instead, just in case any new caller would
    appear.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/arch/x86/mm/shadow/multi.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 797ebde586..dd59bec2c3 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -802,9 +802,7 @@ shadow_get_page_from_l1e(shadow_l1e_t sl1e, struct domain *d, p2m_type_t type)
     struct domain *owner;
 
     ASSERT(!sh_l1e_is_magic(sl1e));
-
-    if ( !shadow_mode_refcounts(d) )
-        return 1;
+    ASSERT(shadow_mode_refcounts(d));
 
     res = get_page_from_l1e(sl1e, d, d);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 02 20:44:15 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Mar 2021 20:44:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92604.174566 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHBsB-0001Px-WD; Tue, 02 Mar 2021 20:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 92604.174566; Tue, 02 Mar 2021 20: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 1lHBsB-0001Pp-TC; Tue, 02 Mar 2021 20:44:03 +0000
Received: by outflank-mailman (input) for mailman id 92604;
 Tue, 02 Mar 2021 20: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 1lHBsA-0001Pk-4I
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 20: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 1lHBsA-0004tN-1X
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 20:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lHBs9-0004dz-T8
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 20: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=+pIGHs/HGL1bUZjEp98kx8Tx3M+yL1qEmMeqnkP7Sm8=; b=V+AnjXaJprdh2ePn2xT75CAy+D
	afTAEUStbkstC5uXjWOFqhw/TQSj+rTK1gitF8pT6gw8eJ70i8oMEWxEzzQ2cCZpxKaB136zDsZJR
	YsaUGBQmdH54uQEUIGGgHI8hGGLBqg+aGEE83qCJFFMkGUZ3xa1aQ2X8aFu4uuX83w1o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] cirrus-ci: Drop obsolete dependency
Message-Id: <E1lHBs9-0004dz-T8@xenbits.xenproject.org>
Date: Tue, 02 Mar 2021 20:44:01 +0000

commit c90b6f4369a07f1538a5cdc54a40c4bd11da205f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Feb 25 20:30:49 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Mar 1 23:19:39 2021 +0000

    cirrus-ci: Drop obsolete dependency
    
    markdown as a dependency was dropped in 4.12
    
    Fixes: 5d94433a66 ("cirrus-ci: introduce some basic FreeBSD testing")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 5e3e46368e..0efff6fa98 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 markdown gettext-tools gmake
+  install_script: pkg install -y seabios gettext-tools gmake
                                  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 Mar 02 20:44:15 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Mar 2021 20:44:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92605.174570 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHBsM-0001QW-1c; Tue, 02 Mar 2021 20:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 92605.174570; Tue, 02 Mar 2021 20: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 1lHBsL-0001QO-Uh; Tue, 02 Mar 2021 20:44:13 +0000
Received: by outflank-mailman (input) for mailman id 92605;
 Tue, 02 Mar 2021 20: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 1lHBsK-0001QF-6C
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 20: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 1lHBsK-0004tQ-5M
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 20:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lHBsK-0004ei-3q
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 20:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NZB77Iji+ZDApqwhTHyi8WFIDtIa8h7XkRJiSbtaS9U=; b=l5PiMFOHnbRhNQZ/8aRxlihVHG
	A7l0K/GxqPIsylL3gVUPJNG8awe7iJqQVmw+VgJAhmGyn3HC3rqXyf+A2F9eebS3zoDT6nE0uohbd
	h9AfFbSzf1+0Zzm7IkFnhhIMiYAOO0dlBT3x1QIGU/Q9oYDjl7gOUpkTq4Hrqt9RJO3Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/hvmloader: Drop machelf include as well
Message-Id: <E1lHBsK-0004ei-3q@xenbits.xenproject.org>
Date: Tue, 02 Mar 2021 20:44:12 +0000

commit 570da5423dbee1a253fa09ceaa89c68e725e9d5b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Feb 25 19:13:17 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Mar 1 23:19:39 2021 +0000

    tools/hvmloader: Drop machelf include as well
    
    The logic behind switching to elfstructs applies to sun builds as well.
    
    Fixes: 81b2b328a2 ("hvmloader: use Xen private header for elf structs")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/firmware/hvmloader/32bitbios_support.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/tools/firmware/hvmloader/32bitbios_support.c b/tools/firmware/hvmloader/32bitbios_support.c
index e726946a7b..6f28fb6bde 100644
--- a/tools/firmware/hvmloader/32bitbios_support.c
+++ b/tools/firmware/hvmloader/32bitbios_support.c
@@ -22,9 +22,6 @@
 
 #include <inttypes.h>
 #include <xen/libelf/elfstructs.h>
-#ifdef __sun__
-#include <sys/machelf.h>
-#endif
 
 #include "util.h"
 #include "config.h"
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Mar 02 20:44:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Mar 2021 20:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92606.174574 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHBsW-0001Ru-38; Tue, 02 Mar 2021 20:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 92606.174574; Tue, 02 Mar 2021 20: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 1lHBsV-0001Rm-WE; Tue, 02 Mar 2021 20:44:24 +0000
Received: by outflank-mailman (input) for mailman id 92606;
 Tue, 02 Mar 2021 20: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 1lHBsU-0001Rc-QB
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 20: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 1lHBsU-0004tX-PE
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 20:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lHBsU-0004fj-8E
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 20: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=RAbsnmBW0wlMLF+eAr2+IVeXY6syjIc7d5ckHrV0C4Q=; b=oCO+0tdoMmCnSNfF7w6SmEHGbX
	vBMstWXterPTyOBh8tzfpuXTNGjxGEB/oOEtnbt/wIGpC20KSIFpBES2wkK9GUkxf4X19yMg8B9QF
	rK/gaSq9YHWIBSKZ428RD0YckLc50u0EkXgQy30vUJk+2ukUhM4SqrJxSUuAd1HAQc1E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/firmware: Build firmware as -ffreestanding
Message-Id: <E1lHBsU-0004fj-8E@xenbits.xenproject.org>
Date: Tue, 02 Mar 2021 20:44:22 +0000

commit 0eae016b6e3dce69e3fb86aca5c4f221591a2f12
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Feb 25 19:15:08 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Mar 1 23:19:39 2021 +0000

    tools/firmware: Build firmware as -ffreestanding
    
    firmware should always have been -ffreestanding, as it doesn't execute in the
    host environment.  -ffreestanding implies -fno-builtin, so replace the option.
    
    inttypes.h isn't a freestanding header, but the 32bitbios_support.c only wants
    the stdint.h types so switch to the more appropriate include.
    
    This removes the build time dependency on a 32bit libc just to compile the
    hvmloader and friends.
    
    Update README and the TravisCI configuration.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 .travis.yml                                  | 1 -
 README                                       | 3 ---
 tools/firmware/Rules.mk                      | 2 +-
 tools/firmware/hvmloader/32bitbios_support.c | 2 +-
 4 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 15ca9e9047..2362475f7a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -58,7 +58,6 @@ addons:
             - acpica-tools
             - bin86
             - bcc
-            - libc6-dev-i386
             - libnl-3-dev
             - ocaml-nox
             - libfindlib-ocaml-dev
diff --git a/README b/README
index 6e15242ae1..8c99c30986 100644
--- a/README
+++ b/README
@@ -62,9 +62,6 @@ provided by your OS distributor:
     * GNU bison and GNU flex
     * GNU gettext
     * ACPI ASL compiler (iasl)
-    * Libc multiarch package (e.g. libc6-dev-i386 / glibc-devel.i686).
-      Required when building on a 64-bit platform to build
-      32-bit components which are enabled on a default build.
 
 In addition to the above there are a number of optional build
 prerequisites. Omitting these will cause the related features to be
diff --git a/tools/firmware/Rules.mk b/tools/firmware/Rules.mk
index 26bbddccd4..dc372a86d8 100644
--- a/tools/firmware/Rules.mk
+++ b/tools/firmware/Rules.mk
@@ -16,4 +16,4 @@ CFLAGS += -Werror
 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 
 # Extra CFLAGS suitable for an embedded type of environment.
-CFLAGS += -fno-builtin -msoft-float
+CFLAGS += -ffreestanding -msoft-float
diff --git a/tools/firmware/hvmloader/32bitbios_support.c b/tools/firmware/hvmloader/32bitbios_support.c
index 6f28fb6bde..cee3804888 100644
--- a/tools/firmware/hvmloader/32bitbios_support.c
+++ b/tools/firmware/hvmloader/32bitbios_support.c
@@ -20,7 +20,7 @@
  * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <inttypes.h>
+#include <stdint.h>
 #include <xen/libelf/elfstructs.h>
 
 #include "util.h"
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Mar 02 20:44:35 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Mar 2021 20:44:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92607.174578 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHBsh-0001TU-4t; Tue, 02 Mar 2021 20:44:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 92607.174578; Tue, 02 Mar 2021 20:44: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 1lHBsh-0001TM-1d; Tue, 02 Mar 2021 20:44:35 +0000
Received: by outflank-mailman (input) for mailman id 92607;
 Tue, 02 Mar 2021 20: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 1lHBse-0001TF-VH
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 20: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 1lHBse-0004ti-UV
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 20:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lHBse-0004h1-Ru
 for xen-changelog@lists.xenproject.org; Tue, 02 Mar 2021 20: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=6SGxxz6sbyUv1lXGKD3HxqNFyFHfqGcYIEphN58aIVM=; b=nX1A4DvmRu5rEHQnFL9aRXEShW
	pP7G99iHGZWU1kC8hFWO4enX1HYLLm0DgPN60/Za8t3WElvpWUadfGkYChkNZQAAp4mOk0ppN7Whw
	NQQlcNmWzyWWwuTmbYdDujdZKQ0YHf4DVwp1f4BcvHe+5vbAaw6apbFP5mDRAKGhcSDk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: Annotate that a 32bit libc is no longer a dependency
Message-Id: <E1lHBse-0004h1-Ru@xenbits.xenproject.org>
Date: Tue, 02 Mar 2021 20:44:32 +0000

commit 6b4d4dd38470c2293caddf0a5f7034bb832bb574
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Feb 25 19:35:39 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Mar 1 23:19:39 2021 +0000

    automation: Annotate that a 32bit libc is no longer a dependency
    
    We can't drop the 32bit libc from the existing containers, because they are
    used on older Xen branches as well.
    
    However, we can avoid the dependency being propagated into newer conainers
    derived from our dockerfiles.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 automation/build/archlinux/current.dockerfile        | 1 +
 automation/build/centos/7.2.dockerfile               | 1 +
 automation/build/centos/7.dockerfile                 | 1 +
 automation/build/debian/jessie.dockerfile            | 1 +
 automation/build/debian/stretch.dockerfile           | 1 +
 automation/build/debian/unstable.dockerfile          | 1 +
 automation/build/fedora/29.dockerfile                | 1 +
 automation/build/suse/opensuse-leap.dockerfile       | 1 +
 automation/build/suse/opensuse-tumbleweed.dockerfile | 1 +
 automation/build/ubuntu/bionic.dockerfile            | 1 +
 automation/build/ubuntu/focal.dockerfile             | 1 +
 automation/build/ubuntu/trusty.dockerfile            | 1 +
 automation/build/ubuntu/xenial.dockerfile            | 1 +
 13 files changed, 13 insertions(+)

diff --git a/automation/build/archlinux/current.dockerfile b/automation/build/archlinux/current.dockerfile
index d8fbebaf79..d46fc9d9ca 100644
--- a/automation/build/archlinux/current.dockerfile
+++ b/automation/build/archlinux/current.dockerfile
@@ -20,6 +20,7 @@ RUN pacman -S --refresh --sysupgrade --noconfirm --noprogressbar --needed \
         iasl \
         inetutils \
         iproute \
+        # lib32-glibc for Xen < 4.15
         lib32-glibc \
         libaio \
         libcacard \
diff --git a/automation/build/centos/7.2.dockerfile b/automation/build/centos/7.2.dockerfile
index c2f46b694c..af672a0be1 100644
--- a/automation/build/centos/7.2.dockerfile
+++ b/automation/build/centos/7.2.dockerfile
@@ -34,6 +34,7 @@ RUN rpm --rebuilddb && \
         yajl-devel \
         pixman-devel \
         glibc-devel \
+        # glibc-devel.i686 for Xen < 4.15
         glibc-devel.i686 \
         make \
         binutils \
diff --git a/automation/build/centos/7.dockerfile b/automation/build/centos/7.dockerfile
index e37d9d743a..5f83c97d0c 100644
--- a/automation/build/centos/7.dockerfile
+++ b/automation/build/centos/7.dockerfile
@@ -32,6 +32,7 @@ RUN yum -y install \
         yajl-devel \
         pixman-devel \
         glibc-devel \
+        # glibc-devel.i686 for Xen < 4.15
         glibc-devel.i686 \
         make \
         binutils \
diff --git a/automation/build/debian/jessie.dockerfile b/automation/build/debian/jessie.dockerfile
index 1232b9e204..808d6272e4 100644
--- a/automation/build/debian/jessie.dockerfile
+++ b/automation/build/debian/jessie.dockerfile
@@ -31,6 +31,7 @@ RUN apt-get update && \
         bin86 \
         bcc \
         liblzma-dev \
+        # libc6-dev-i386 for Xen < 4.15
         libc6-dev-i386 \
         libnl-3-dev \
         ocaml-nox \
diff --git a/automation/build/debian/stretch.dockerfile b/automation/build/debian/stretch.dockerfile
index 32742f7f39..e3bace1f87 100644
--- a/automation/build/debian/stretch.dockerfile
+++ b/automation/build/debian/stretch.dockerfile
@@ -32,6 +32,7 @@ RUN apt-get update && \
         bin86 \
         bcc \
         liblzma-dev \
+        # libc6-dev-i386 for Xen < 4.15
         libc6-dev-i386 \
         libnl-3-dev \
         ocaml-nox \
diff --git a/automation/build/debian/unstable.dockerfile b/automation/build/debian/unstable.dockerfile
index aeb4f3448b..9a10ee08d6 100644
--- a/automation/build/debian/unstable.dockerfile
+++ b/automation/build/debian/unstable.dockerfile
@@ -32,6 +32,7 @@ RUN apt-get update && \
         bin86 \
         bcc \
         liblzma-dev \
+        # libc6-dev-i386 for Xen < 4.15
         libc6-dev-i386 \
         libnl-3-dev \
         ocaml-nox \
diff --git a/automation/build/fedora/29.dockerfile b/automation/build/fedora/29.dockerfile
index 6a4e5b0413..5482952523 100644
--- a/automation/build/fedora/29.dockerfile
+++ b/automation/build/fedora/29.dockerfile
@@ -25,6 +25,7 @@ RUN dnf -y install \
         yajl-devel \
         pixman-devel \
         glibc-devel \
+        # glibc-devel.i686 for Xen < 4.15
         glibc-devel.i686 \
         make \
         binutils \
diff --git a/automation/build/suse/opensuse-leap.dockerfile b/automation/build/suse/opensuse-leap.dockerfile
index c60c13c943..685dd5d7fd 100644
--- a/automation/build/suse/opensuse-leap.dockerfile
+++ b/automation/build/suse/opensuse-leap.dockerfile
@@ -26,6 +26,7 @@ RUN zypper install -y --no-recommends \
         git \
         glib2-devel \
         glibc-devel \
+        # glibc-devel-32bit for Xen < 4.15
         glibc-devel-32bit \
         gzip \
         hostname \
diff --git a/automation/build/suse/opensuse-tumbleweed.dockerfile b/automation/build/suse/opensuse-tumbleweed.dockerfile
index 084cce0921..061173e751 100644
--- a/automation/build/suse/opensuse-tumbleweed.dockerfile
+++ b/automation/build/suse/opensuse-tumbleweed.dockerfile
@@ -26,6 +26,7 @@ RUN zypper install -y --no-recommends \
         git \
         glib2-devel \
         glibc-devel \
+        # glibc-devel-32bit for Xen < 4.15
         glibc-devel-32bit \
         gzip \
         hostname \
diff --git a/automation/build/ubuntu/bionic.dockerfile b/automation/build/ubuntu/bionic.dockerfile
index 712b2e4722..408063698c 100644
--- a/automation/build/ubuntu/bionic.dockerfile
+++ b/automation/build/ubuntu/bionic.dockerfile
@@ -32,6 +32,7 @@ RUN apt-get update && \
         bin86 \
         bcc \
         liblzma-dev \
+        # libc6-dev-i386 for Xen < 4.15
         libc6-dev-i386 \
         libnl-3-dev \
         ocaml-nox \
diff --git a/automation/build/ubuntu/focal.dockerfile b/automation/build/ubuntu/focal.dockerfile
index c1c1f8d58f..90b4001a6a 100644
--- a/automation/build/ubuntu/focal.dockerfile
+++ b/automation/build/ubuntu/focal.dockerfile
@@ -31,6 +31,7 @@ RUN apt-get update && \
         bin86 \
         bcc \
         liblzma-dev \
+        # libc6-dev-i386 for Xen < 4.15
         libc6-dev-i386 \
         libnl-3-dev \
         ocaml-nox \
diff --git a/automation/build/ubuntu/trusty.dockerfile b/automation/build/ubuntu/trusty.dockerfile
index 397a28061d..fd377d948f 100644
--- a/automation/build/ubuntu/trusty.dockerfile
+++ b/automation/build/ubuntu/trusty.dockerfile
@@ -32,6 +32,7 @@ RUN apt-get update && \
         bin86 \
         bcc \
         liblzma-dev \
+        # libc6-dev-i386 for Xen < 4.15
         libc6-dev-i386 \
         libnl-3-dev \
         ocaml-nox \
diff --git a/automation/build/ubuntu/xenial.dockerfile b/automation/build/ubuntu/xenial.dockerfile
index ce0e84fa2f..57a71eb8c6 100644
--- a/automation/build/ubuntu/xenial.dockerfile
+++ b/automation/build/ubuntu/xenial.dockerfile
@@ -32,6 +32,7 @@ RUN apt-get update && \
         bin86 \
         bcc \
         liblzma-dev \
+        # libc6-dev-i386 for Xen < 4.15
         libc6-dev-i386 \
         libnl-3-dev \
         ocaml-nox \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Mar 03 08:55:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Mar 2021 08:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92764.174819 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHNHc-0002uX-Bg; Wed, 03 Mar 2021 08:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 92764.174819; Wed, 03 Mar 2021 08: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 1lHNHc-0002uP-8W; Wed, 03 Mar 2021 08:55:04 +0000
Received: by outflank-mailman (input) for mailman id 92764;
 Wed, 03 Mar 2021 08: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 1lHNHa-0002uI-KF
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 08: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 1lHNHa-00041a-Hc
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 08:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lHNHa-00082w-GX
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 08: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=n/iChfvyI3xpJw6PeOngU5MojaChWz2ck2CK8BgBhRM=; b=jTr3nRs4WG2V0Uu7+Vsqwvaukk
	TC3rcWMaI+i/0nG2GhnalF0QMSORw0X74l+w62OtFb9reJV6KACnSzeGFDR9rpHC+nF0u7Y+3JMDH
	IdiBm3M5MP8F0xZJFmPpK/diYN/l5tdVZAn2eUaPq7IZkzjOPF6R38opcVYeNPWGieyk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: Avoid dereferencing a NULL pointer if LiveUpdate is failing
Message-Id: <E1lHNHa-00082w-GX@xenbits.xenproject.org>
Date: Wed, 03 Mar 2021 08:55:02 +0000

commit 29fae90baa14f518407fe7c437d38af768a3134c
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Feb 26 18:26:55 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Mar 2 09:42:21 2021 +0000

    tools/xenstored: Avoid dereferencing a NULL pointer if LiveUpdate is failing
    
    In case of failure in do_lu_start(), XenStored will first free lu_start
    and then try to dereference it.
    
    This will result to a NULL dereference as the destruction callback will
    set lu_start to NULL.
    
    The crash can be avoided by freeing lu_start *after* the reply has been
    set.
    
    Fixes: af216a99fb4a ("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>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/xenstore/xenstored_control.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_control.c
index 653890f2d9..766b243839 100644
--- a/tools/xenstore/xenstored_control.c
+++ b/tools/xenstore/xenstored_control.c
@@ -657,9 +657,8 @@ static bool do_lu_start(struct delayed_request *req)
 
 	/* We will reach this point only in case of failure. */
  out:
-	talloc_free(lu_status);
-
 	send_reply(lu_status->conn, XS_CONTROL, ret, strlen(ret) + 1);
+	talloc_free(lu_status);
 
 	return true;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Mar 03 08:55:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Mar 2021 08:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92765.174823 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHNHm-0002vm-D7; Wed, 03 Mar 2021 08:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 92765.174823; Wed, 03 Mar 2021 08: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 1lHNHm-0002ve-A5; Wed, 03 Mar 2021 08:55:14 +0000
Received: by outflank-mailman (input) for mailman id 92765;
 Wed, 03 Mar 2021 08: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 1lHNHk-0002vW-N4
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 08: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 1lHNHk-00041d-Lu
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 08:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lHNHk-00083f-Je
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 08: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=Xy8W0W+ucsWBKsB2XZcnZ5PpTCNHww2qlLmAKO5skvk=; b=Jtyra7DrXxMVUXYXe/0KtWBJrT
	ksyIB2ThN8QP2y5AkZH5KZLRy6f/sYlrhufi0JSQbHX+jTAtAEYXM3F/eRmhTdJQf05kdEGFJZjXY
	+GF306QMeQP4sstprkSkslC0QQ+IZeuajLZeTYtwUw12M4UpsTrpehRmP9J4Wj3jpmZM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/iommu: x86: Don't try to free page tables is the IOMMU is not enabled
Message-Id: <E1lHNHk-00083f-Je@xenbits.xenproject.org>
Date: Wed, 03 Mar 2021 08:55:12 +0000

commit f4cf483e2a1aec2b359347f0a34abd6bf2f208c2
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Feb 26 10:56:38 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Mar 2 09:51:14 2021 +0000

    xen/iommu: x86: Don't try to free page tables is the IOMMU is not enabled
    
    When using CONFIG_BIGMEM=y, the page_list cannot be accessed whilst it
    is is unitialized. However, iommu_free_pgtables() will be called even if
    the domain is not using an IOMMU.
    
    Consequently, Xen will try to go through the page list and deference a
    NULL pointer.
    
    Bail out early if the domain is not using an IOMMU.
    
    Fixes: 15bc9a1ef51c ("x86/iommu: add common page-table allocator")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/drivers/passthrough/x86/iommu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c
index cea1032b3d..58a330e822 100644
--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -267,6 +267,9 @@ int iommu_free_pgtables(struct domain *d)
     struct page_info *pg;
     unsigned int done = 0;
 
+    if ( !is_iommu_enabled(d) )
+        return 0;
+
     while ( (pg = page_list_remove_head(&hd->arch.pgtables.list)) )
     {
         free_domheap_page(pg);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Mar 03 08:55:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Mar 2021 08:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92766.174826 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHNHw-0002xB-Ek; Wed, 03 Mar 2021 08:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 92766.174826; Wed, 03 Mar 2021 08: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 1lHNHw-0002x3-Be; Wed, 03 Mar 2021 08:55:24 +0000
Received: by outflank-mailman (input) for mailman id 92766;
 Wed, 03 Mar 2021 08: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 1lHNHu-0002ws-QQ
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 08: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 1lHNHu-00041q-Pg
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 08:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lHNHu-00085g-OA
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 08: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=3he6y7yrbaX0DzXr3taBNx9hMYXXh1WoKsTLBmwJwyM=; b=FZsdGDaS/Qve7yBpGNkeRi7yBW
	Y5EMU/ETivu7ILopY+hQw7S5jJNbE9xZmZmhT0/idDoerZMS5W4dE+hKap9btdQhAFImHa5yQ6TCF
	w08UVCin37fGFQkdumJLZSk+qjSu4WKbAyqPhiqh7jX1LOC/FmL8mRtgjdeqvxmM3IX4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/x86: iommu: Ignore IOMMU mapping requests when a domain is dying
Message-Id: <E1lHNHu-00085g-OA@xenbits.xenproject.org>
Date: Wed, 03 Mar 2021 08:55:22 +0000

commit 1ef48c82e77692f63114cb6bdeee8a9261dbe493
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Feb 26 10:56:39 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Mar 2 09:52:30 2021 +0000

    xen/x86: iommu: Ignore IOMMU mapping requests when a domain is dying
    
    The new x86 IOMMU page-tables allocator will release the pages when
    relinquishing the domain resources. However, this is not sufficient
    when the domain is dying because nothing prevents page-table to be
    allocated.
    
    As the domain is dying, it is not necessary to continue to modify the
    IOMMU page-tables as they are going to be destroyed soon.
    
    At the moment, page-table allocates will only happen when iommu_map().
    So after this change there will be no more page-table allocation
    happening because we don't use superpage mappings yet when not sharing
    page tables.
    
    In order to observe d->is_dying correctly, we need to rely on per-arch
    locking, so the check to ignore IOMMU mapping is added on the per-driver
    map_page() callback.
    
    Fixes: 15bc9a1ef51c ("x86/iommu: add common page-table allocator")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/drivers/passthrough/amd/iommu_map.c | 12 ++++++++++++
 xen/drivers/passthrough/vtd/iommu.c     | 12 ++++++++++++
 xen/drivers/passthrough/x86/iommu.c     |  3 +++
 3 files changed, 27 insertions(+)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index d3a8b1aec7..560af54b76 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -285,6 +285,18 @@ int amd_iommu_map_page(struct domain *d, dfn_t dfn, mfn_t mfn,
 
     spin_lock(&hd->arch.mapping_lock);
 
+    /*
+     * IOMMU mapping request can be safely ignored when the domain is dying.
+     *
+     * hd->arch.mapping_lock guarantees that d->is_dying will be observed
+     * before any page tables are freed (see iommu_free_pgtables()).
+     */
+    if ( d->is_dying )
+    {
+        spin_unlock(&hd->arch.mapping_lock);
+        return 0;
+    }
+
     rc = amd_iommu_alloc_root(d);
     if ( rc )
     {
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index d136fe3688..b549a71530 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1762,6 +1762,18 @@ static int __must_check intel_iommu_map_page(struct domain *d, dfn_t dfn,
 
     spin_lock(&hd->arch.mapping_lock);
 
+    /*
+     * IOMMU mapping request can be safely ignored when the domain is dying.
+     *
+     * hd->arch.mapping_lock guarantees that d->is_dying will be observed
+     * before any page tables are freed (see iommu_free_pgtables())
+     */
+    if ( d->is_dying )
+    {
+        spin_unlock(&hd->arch.mapping_lock);
+        return 0;
+    }
+
     pg_maddr = addr_to_dma_page_maddr(d, dfn_to_daddr(dfn), 1);
     if ( !pg_maddr )
     {
diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c
index 58a330e822..ad19b7dd46 100644
--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -270,6 +270,9 @@ int iommu_free_pgtables(struct domain *d)
     if ( !is_iommu_enabled(d) )
         return 0;
 
+    /* After this barrier, no new IOMMU mappings can be inserted. */
+    spin_barrier(&hd->arch.mapping_lock);
+
     while ( (pg = page_list_remove_head(&hd->arch.pgtables.list)) )
     {
         free_domheap_page(pg);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Mar 03 08:55:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Mar 2021 08:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92767.174830 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHNI6-0002yh-HP; Wed, 03 Mar 2021 08:55:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 92767.174830; Wed, 03 Mar 2021 08:55: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 1lHNI6-0002yY-EQ; Wed, 03 Mar 2021 08:55:34 +0000
Received: by outflank-mailman (input) for mailman id 92767;
 Wed, 03 Mar 2021 08:55: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 1lHNI4-0002yQ-Vn
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 08: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 1lHNI4-00041y-TT
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 08:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lHNI4-00088s-S1
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 08: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=f8Hv1ZZK7mH6GhtmigYhQqtbhLczvwuotF6kym9bwuY=; b=ljxRSRYJW+HLAG3SoOtcznXKSM
	XfOrxHRY8xYl7X0qcSjisTVcMbA1+d1c41Xhbg8NyeaVC50Buw3kImUpU4DA3/Ng/DMpY0EwBnxIL
	EcFjgdm+opVdg/UWZ4IUZDYNfW7gsAVlWFLVHP+nb6KkL05qE/OlpartClyUXxhfeu2Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/iommu: x86: Clear the root page-table before freeing the page-tables
Message-Id: <E1lHNI4-00088s-S1@xenbits.xenproject.org>
Date: Wed, 03 Mar 2021 08:55:32 +0000

commit 9bd9695a8bc72a86b98c0683736d2310838558fe
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Feb 26 10:56:40 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Mar 2 09:54:43 2021 +0000

    xen/iommu: x86: Clear the root page-table before freeing the page-tables
    
    The new per-domain IOMMU page-table allocator will now free the
    page-tables when domain's resources are relinquished. However, the
    per-domain IOMMU structure will still contain a dangling pointer to
    the root page-table.
    
    Xen may access the IOMMU page-tables afterwards at least in the case of
    PV domain:
    
    (XEN) Xen call trace:
    (XEN)    [<ffff82d04025b4b2>] R iommu.c#addr_to_dma_page_maddr+0x12e/0x1d8
    (XEN)    [<ffff82d04025b695>] F iommu.c#intel_iommu_unmap_page+0x5d/0xf8
    (XEN)    [<ffff82d0402695f3>] F iommu_unmap+0x9c/0x129
    (XEN)    [<ffff82d0402696a6>] F iommu_legacy_unmap+0x26/0x63
    (XEN)    [<ffff82d04033c5c7>] F mm.c#cleanup_page_mappings+0x139/0x144
    (XEN)    [<ffff82d04033c61d>] F put_page+0x4b/0xb3
    (XEN)    [<ffff82d04033c87f>] F put_page_from_l1e+0x136/0x13b
    (XEN)    [<ffff82d04033cada>] F devalidate_page+0x256/0x8dc
    (XEN)    [<ffff82d04033d396>] F mm.c#_put_page_type+0x236/0x47e
    (XEN)    [<ffff82d04033d64d>] F mm.c#put_pt_page+0x6f/0x80
    (XEN)    [<ffff82d04033d8d6>] F mm.c#put_page_from_l2e+0x8a/0xcf
    (XEN)    [<ffff82d04033cc27>] F devalidate_page+0x3a3/0x8dc
    (XEN)    [<ffff82d04033d396>] F mm.c#_put_page_type+0x236/0x47e
    (XEN)    [<ffff82d04033d64d>] F mm.c#put_pt_page+0x6f/0x80
    (XEN)    [<ffff82d04033d807>] F mm.c#put_page_from_l3e+0x8a/0xcf
    (XEN)    [<ffff82d04033cdf0>] F devalidate_page+0x56c/0x8dc
    (XEN)    [<ffff82d04033d396>] F mm.c#_put_page_type+0x236/0x47e
    (XEN)    [<ffff82d04033d64d>] F mm.c#put_pt_page+0x6f/0x80
    (XEN)    [<ffff82d04033d6c7>] F mm.c#put_page_from_l4e+0x69/0x6d
    (XEN)    [<ffff82d04033cf24>] F devalidate_page+0x6a0/0x8dc
    (XEN)    [<ffff82d04033d396>] F mm.c#_put_page_type+0x236/0x47e
    (XEN)    [<ffff82d04033d92e>] F put_page_type_preemptible+0x13/0x15
    (XEN)    [<ffff82d04032598a>] F domain.c#relinquish_memory+0x1ff/0x4e9
    (XEN)    [<ffff82d0403295f2>] F domain_relinquish_resources+0x2b6/0x36a
    (XEN)    [<ffff82d040205cdf>] F domain_kill+0xb8/0x141
    (XEN)    [<ffff82d040236cac>] F do_domctl+0xb6f/0x18e5
    (XEN)    [<ffff82d04031d098>] F pv_hypercall+0x2f0/0x55f
    (XEN)    [<ffff82d04039b432>] F lstar_enter+0x112/0x120
    
    This will result to a use after-free and possibly an host crash or
    memory corruption.
    
    It would not be possible to free the page-tables further down in
    domain_relinquish_resources() because cleanup_page_mappings() will only
    be called when the last reference on the page dropped. This may happen
    much later if another domain still hold a reference.
    
    After all the PCI devices have been de-assigned, nobody should use the
    IOMMU page-tables and it is therefore pointless to try to modify them.
    
    So we can simply clear any reference to the root page-table in the
    per-domain IOMMU structure. This requires to introduce a new callback of
    the method will depend on the IOMMU driver used.
    
    Take the opportunity to add an ASSERT() in arch_iommu_domain_destroy()
    to check if we freed all the IOMMU page tables.
    
    Fixes: 3eef6d07d722 ("x86/iommu: convert VT-d code to use new page table allocator")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c | 12 +++++++++++-
 xen/drivers/passthrough/vtd/iommu.c         | 12 +++++++++++-
 xen/drivers/passthrough/x86/iommu.c         | 13 +++++++++++++
 xen/include/xen/iommu.h                     |  1 +
 4 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 42b5a5a9be..085fe2f577 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -381,9 +381,18 @@ static int amd_iommu_assign_device(struct domain *d, u8 devfn,
     return reassign_device(pdev->domain, d, devfn, pdev);
 }
 
+static void amd_iommu_clear_root_pgtable(struct domain *d)
+{
+    struct domain_iommu *hd = dom_iommu(d);
+
+    spin_lock(&hd->arch.mapping_lock);
+    hd->arch.amd.root_table = NULL;
+    spin_unlock(&hd->arch.mapping_lock);
+}
+
 static void amd_iommu_domain_destroy(struct domain *d)
 {
-    dom_iommu(d)->arch.amd.root_table = NULL;
+    ASSERT(!dom_iommu(d)->arch.amd.root_table);
 }
 
 static int amd_iommu_add_device(u8 devfn, struct pci_dev *pdev)
@@ -565,6 +574,7 @@ static const struct iommu_ops __initconstrel _iommu_ops = {
     .remove_device = amd_iommu_remove_device,
     .assign_device  = amd_iommu_assign_device,
     .teardown = amd_iommu_domain_destroy,
+    .clear_root_pgtable = amd_iommu_clear_root_pgtable,
     .map_page = amd_iommu_map_page,
     .unmap_page = amd_iommu_unmap_page,
     .iotlb_flush = amd_iommu_flush_iotlb_pages,
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index b549a71530..475efb3be3 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1726,6 +1726,15 @@ out:
     return ret;
 }
 
+static void iommu_clear_root_pgtable(struct domain *d)
+{
+    struct domain_iommu *hd = dom_iommu(d);
+
+    spin_lock(&hd->arch.mapping_lock);
+    hd->arch.vtd.pgd_maddr = 0;
+    spin_unlock(&hd->arch.mapping_lock);
+}
+
 static void iommu_domain_teardown(struct domain *d)
 {
     struct domain_iommu *hd = dom_iommu(d);
@@ -1740,7 +1749,7 @@ static void iommu_domain_teardown(struct domain *d)
         xfree(mrmrr);
     }
 
-    hd->arch.vtd.pgd_maddr = 0;
+    ASSERT(!hd->arch.vtd.pgd_maddr);
 }
 
 static int __must_check intel_iommu_map_page(struct domain *d, dfn_t dfn,
@@ -2731,6 +2740,7 @@ static struct iommu_ops __initdata vtd_ops = {
     .remove_device = intel_iommu_remove_device,
     .assign_device  = intel_iommu_assign_device,
     .teardown = iommu_domain_teardown,
+    .clear_root_pgtable = iommu_clear_root_pgtable,
     .map_page = intel_iommu_map_page,
     .unmap_page = intel_iommu_unmap_page,
     .lookup_page = intel_iommu_lookup_page,
diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c
index ad19b7dd46..b90bb31bfe 100644
--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -149,6 +149,13 @@ int arch_iommu_domain_init(struct domain *d)
 
 void arch_iommu_domain_destroy(struct domain *d)
 {
+    /*
+     * There should be not page-tables left allocated by the time the
+     * domain is destroyed. Note that arch_iommu_domain_destroy() is
+     * called unconditionally, so pgtables may be uninitialized.
+     */
+    ASSERT(!dom_iommu(d)->platform_ops ||
+           page_list_empty(&dom_iommu(d)->arch.pgtables.list));
 }
 
 static bool __hwdom_init hwdom_iommu_map(const struct domain *d,
@@ -273,6 +280,12 @@ int iommu_free_pgtables(struct domain *d)
     /* After this barrier, no new IOMMU mappings can be inserted. */
     spin_barrier(&hd->arch.mapping_lock);
 
+    /*
+     * Pages will be moved to the free list below. So we want to
+     * clear the root page-table to avoid any potential use after-free.
+     */
+    hd->platform_ops->clear_root_pgtable(d);
+
     while ( (pg = page_list_remove_head(&hd->arch.pgtables.list)) )
     {
         free_domheap_page(pg);
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 863a68fe16..d59ed7cbad 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -272,6 +272,7 @@ struct iommu_ops {
 
     int (*adjust_irq_affinities)(void);
     void (*sync_cache)(const void *addr, unsigned int size);
+    void (*clear_root_pgtable)(struct domain *d);
 #endif /* CONFIG_X86 */
 
     int __must_check (*suspend)(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Mar 03 08:55:44 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Mar 2021 08:55:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92768.174836 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHNIG-0002zh-JW; Wed, 03 Mar 2021 08:55:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 92768.174836; Wed, 03 Mar 2021 08:55: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 1lHNIG-0002zZ-G7; Wed, 03 Mar 2021 08:55:44 +0000
Received: by outflank-mailman (input) for mailman id 92768;
 Wed, 03 Mar 2021 08:55: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 1lHNIF-0002zS-1b
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 08:55: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 1lHNIF-000421-0G
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 08:55:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lHNIE-0008Bl-Vf
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 08: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=XtQNWxvik9eWOmaNf00Gdnsf5Ctlq7AspFVC5stOGGM=; b=J0vXcvNy+yPCHqpeZQEoGBrPbp
	NDtRsAueC6o3HVryEerxze/LL/hPhnKIbacn3j3lj5zZOZgHvMeIZQP0IxJ8FEDF4IxEXlaqKqb5+
	ct/he6PRAxVmPJqmKVmP0w6jBI/gNB7EhW0gmla3IkBa2g6Ebwd12Y8wbcCHiXt6oqLg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] sched: fix build when NR_CPUS == 1
Message-Id: <E1lHNIE-0008Bl-Vf@xenbits.xenproject.org>
Date: Wed, 03 Mar 2021 08:55:42 +0000

commit 2de43f834ad2d758dd7b3441a6d1398491f18eae
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 2 12:29:16 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 2 12:29:16 2021 +0100

    sched: fix build when NR_CPUS == 1
    
    In this case the compiler is recognizing that no valid array indexes
    remain, and hence e.g. reports:
    
    core.c: In function 'cpu_schedule_up':
    core.c:2769:19: error: array subscript 1 is above array bounds
    of 'struct vcpu *[1]' [-Werror=array-bounds]
     2769 |     if ( idle_vcpu[cpu] == NULL )
          |          ~~~~~~~~~^~~~~
    
    Reported-by: Connor Davis <connojdavis@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/common/sched/core.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 2b974fd6f8..6d34764d38 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -2768,6 +2768,12 @@ static int cpu_schedule_up(unsigned int cpu)
     if ( cpu == 0 )
         return 0;
 
+    /*
+     * Guard in particular against the compiler suspecting out-of-bounds
+     * array accesses below when NR_CPUS=1.
+     */
+    BUG_ON(cpu >= NR_CPUS);
+
     if ( idle_vcpu[cpu] == NULL )
         vcpu_create(idle_vcpu[0]->domain, cpu);
     else
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Mar 03 08:55:54 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Mar 2021 08:55:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92769.174839 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHNIQ-00030w-KZ; Wed, 03 Mar 2021 08:55:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 92769.174839; Wed, 03 Mar 2021 08:55: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 1lHNIQ-00030o-Ha; Wed, 03 Mar 2021 08:55:54 +0000
Received: by outflank-mailman (input) for mailman id 92769;
 Wed, 03 Mar 2021 08:55: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 1lHNIP-00030h-41
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 08:55: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 1lHNIP-00042S-3N
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 08:55:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lHNIP-0008Fx-2a
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 08:55: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=8MRZicIZhyMpqGr1foTyiMVbSaioanuJCXdcwL0HO98=; b=FyhA3qerqkXIZ7rDBUQSfcg6tK
	FELJXQldFPtZ7k+MmDR9+bXiI6nArCz0b0RD2DDRwNDqelvn4FPIoFPUVKTpXFF6FB8rfICImhhgt
	RJxc4A6EYQjxsQcHGVbgx+BcgfTLxMW2hstSCafttJPmJGbDmoUeOgnO3iO5/pK6ite4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: replace bogus return path in shadow_get_page_from_l1e()
Message-Id: <E1lHNIP-0008Fx-2a@xenbits.xenproject.org>
Date: Wed, 03 Mar 2021 08:55:53 +0000

commit 4834936549f788378918da8e9bc97df7dd3ee16d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 2 12:30:30 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 2 12:30:30 2021 +0100

    x86/shadow: replace bogus return path in shadow_get_page_from_l1e()
    
    Prior to be640b1800bb ("x86: make get_page_from_l1e() return a proper
    error code") a positive return value did indicate an error. Said commit
    failed to adjust this return path, but luckily the only caller has
    always been inside a shadow_mode_refcounts() conditional.
    
    Subsequent changes caused 1 to end up at the default (error) label in
    the caller's switch() again, but the returning of 1 (== _PAGE_PRESENT)
    is still rather confusing here, and a latent risk.
    
    Convert to an ASSERT() instead, just in case any new caller would
    appear.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/arch/x86/mm/shadow/multi.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 797ebde586..dd59bec2c3 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -802,9 +802,7 @@ shadow_get_page_from_l1e(shadow_l1e_t sl1e, struct domain *d, p2m_type_t type)
     struct domain *owner;
 
     ASSERT(!sh_l1e_is_magic(sl1e));
-
-    if ( !shadow_mode_refcounts(d) )
-        return 1;
+    ASSERT(shadow_mode_refcounts(d));
 
     res = get_page_from_l1e(sl1e, d, d);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Mar 03 18:33:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Mar 2021 18:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92963.175392 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHWJ0-000720-Cw; Wed, 03 Mar 2021 18:33:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 92963.175392; Wed, 03 Mar 2021 18: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 1lHWJ0-00071s-9y; Wed, 03 Mar 2021 18:33:06 +0000
Received: by outflank-mailman (input) for mailman id 92963;
 Wed, 03 Mar 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 1lHWIz-00071n-1B
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 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 1lHWIy-0006U8-Sm
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 18:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lHWIy-0006Ay-RG
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 18: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=OGpCWm0txf7KPRKf7rusPjUQ+fNRthg2wvNbcbB7cqI=; b=w57MneUMinqy4Kv6IIeWzwUINu
	WXiIuzC1V5urcEj3XVtzJhAB6In725FeWA9YDOmHyM9NdGsBweqrUR1hwo+TrW8SQky4+N3NZYeBx
	hJn8W4lwW0MKXZhY5O9OBTG0UD+uHIgoz3NPE4MOYXOh7EHv7qg4nDCjfblTy988VErQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xenstore: add missing NULL check
Message-Id: <E1lHWIy-0006Ay-RG@xenbits.xenproject.org>
Date: Wed, 03 Mar 2021 18:33:04 +0000

commit 0bdaa8b035ec9fbdfd4e4f25f0577016c94b7a50
Author:     Norbert Manthey <nmanthey@amazon.de>
AuthorDate: Fri Feb 26 15:41:35 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Mar 3 18:11:11 2021 +0000

    xenstore: add missing NULL check
    
    In case of allocation error, we should not dereference the obtained
    NULL pointer. Hence, fail early.
    
    This bug was discovered and resolved using Coverity Static Analysis
    Security Testing (SAST) by Synopsys, Inc.
    
    Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
    Reviewed-by: Thomas Friebel <friebelt@amazon.de>
    Reviewed-by: Julien Grall <jgrall@amazon.co.uk>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/xenstore/xenstored_core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 0fea598352..3803aef081 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1818,6 +1818,10 @@ static int check_store_(const char *name, struct hashtable *reachable)
 
 		struct hashtable * children =
 			create_hashtable(16, hash_from_key_fn, keys_equal_fn);
+		if (!children) {
+			log("check_store create table: ENOMEM");
+			return ENOMEM;
+		}
 
 		if (!remember_string(reachable, name)) {
 			hashtable_destroy(children, 0);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Mar 03 18:33:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Mar 2021 18:33:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92965.175407 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHWJA-00075j-Pc; Wed, 03 Mar 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 92965.175407; Wed, 03 Mar 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 1lHWJA-00075c-Mk; Wed, 03 Mar 2021 18:33:16 +0000
Received: by outflank-mailman (input) for mailman id 92965;
 Wed, 03 Mar 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 1lHWJ9-00075D-2f
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 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 1lHWJ9-0006UQ-1a
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 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 1lHWJ8-0006C6-Ur
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 18: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=lYjCCgmvAXIIi21zcW5qghnsRP26pN94uktaTQXwzlU=; b=O0UEavLJzx2jY2eXv024NrO8n/
	pKeYiI/sNnoawtyiVq2zsY+LXJj3oJEoHBtMBG9IM1WQxMRv7f+dkjeT/yRpUwH1aHpfC4V38p4oj
	UggGU8QHDsGwnQse16+/9JvDTbdHNeo36YFgEQJftZ/0tsROdrWhXC/C631mlRDQwZHQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xenstore: fix print format string
Message-Id: <E1lHWJ8-0006C6-Ur@xenbits.xenproject.org>
Date: Wed, 03 Mar 2021 18:33:14 +0000

commit 5c4634f22696bc609c96f0754832268ed1247059
Author:     Norbert Manthey <nmanthey@amazon.de>
AuthorDate: Fri Feb 26 15:41:36 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Mar 3 18:12:05 2021 +0000

    xenstore: fix print format string
    
    Use the correct format specifier for unsigned values. Additionally, a
    cast was dropped, as the format specifier did not require it anymore.
    
    This was reported by analysis with cppcheck.
    
    Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
    Reviewed-by: Thomas Friebel <friebelt@amazon.de>
    Reviewed-by: Julien Grall <jgrall@amazon.co.uk>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/xenstore/xs_tdb_dump.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/xenstore/xs_tdb_dump.c b/tools/xenstore/xs_tdb_dump.c
index 207ed446d5..f74676cf1c 100644
--- a/tools/xenstore/xs_tdb_dump.c
+++ b/tools/xenstore/xs_tdb_dump.c
@@ -59,8 +59,8 @@ int main(int argc, char *argv[])
 			fprintf(stderr, "%.*s: BAD truncated\n",
 				(int)key.dsize, key.dptr);
 		else if (data.dsize != total_size(hdr))
-			fprintf(stderr, "%.*s: BAD length %i for %i/%i/%i (%i)\n",
-				(int)key.dsize, key.dptr, (int)data.dsize,
+			fprintf(stderr, "%.*s: BAD length %zu for %u/%u/%u (%u)\n",
+				(int)key.dsize, key.dptr, data.dsize,
 				hdr->num_perms, hdr->datalen,
 				hdr->childlen, total_size(hdr));
 		else {
@@ -69,7 +69,7 @@ int main(int argc, char *argv[])
 
 			printf("%.*s: ", (int)key.dsize, key.dptr);
 			for (i = 0; i < hdr->num_perms; i++)
-				printf("%s%c%i",
+				printf("%s%c%u",
 				       i == 0 ? "" : ",",
 				       perm_to_char(hdr->perms[i].perms),
 				       hdr->perms[i].id);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Mar 03 18:33:26 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Mar 2021 18:33:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92967.175412 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHWJK-00079B-Ro; Wed, 03 Mar 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 92967.175412; Wed, 03 Mar 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 1lHWJK-000792-OX; Wed, 03 Mar 2021 18:33:26 +0000
Received: by outflank-mailman (input) for mailman id 92967;
 Wed, 03 Mar 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 1lHWJJ-00078c-5Y
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 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 1lHWJJ-0006UY-4q
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 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 1lHWJJ-0006D4-3z
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 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=nQN9r7U0gLuKXSc75cRP6dt2sYeHkvfPbxrf6+nV+SA=; b=nYQm8uqRE+EDe/YRgXu7VaLkko
	xnls5Zll7CEtYxxHgBT8/IDH8M/ERcoT3D5/FAWTgHu8aPNUzdQ3VrWoQhZRNpyXzuOwTJuwxwnqn
	paqlHOHuRi3XSpUOHGPcmkxVHIb+3t2N1wd1CkPNGxf6kVUmuFnSOcqW9ttTuutXmslA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xenstore: check formats of trace
Message-Id: <E1lHWJJ-0006D4-3z@xenbits.xenproject.org>
Date: Wed, 03 Mar 2021 18:33:25 +0000

commit 4a27a6786573067e69566afd2534edb2814de014
Author:     Norbert Manthey <nmanthey@amazon.de>
AuthorDate: Fri Feb 26 15:41:37 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Mar 3 18:13:12 2021 +0000

    xenstore: check formats of trace
    
    When passing format strings to the trace function, allow gcc to analyze
    those and warn on issues.
    
    Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
    Reviewed-by: Thomas Friebel <friebelt@amazon.de>
    Reviewed-by: Julien Grall <jgrall@amazon.co.uk>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/xenstore/xenstored_core.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 589699e833..0c9a0961b5 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -217,7 +217,7 @@ int delay_request(struct connection *conn, struct buffered_data *in,
 /* Tracing infrastructure. */
 void trace_create(const void *data, const char *type);
 void trace_destroy(const void *data, const char *type);
-void trace(const char *fmt, ...);
+void trace(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
 void dtrace_io(const struct connection *conn, const struct buffered_data *data, int out);
 void reopen_log(void);
 void close_log(void);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Mar 03 18:33:36 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Mar 2021 18:33:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92970.175416 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHWJU-0007B7-TI; Wed, 03 Mar 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 92970.175416; Wed, 03 Mar 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 1lHWJU-0007Ay-Q9; Wed, 03 Mar 2021 18:33:36 +0000
Received: by outflank-mailman (input) for mailman id 92970;
 Wed, 03 Mar 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 1lHWJT-0007Ag-9N
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 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 1lHWJT-0006Uf-8d
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 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 1lHWJT-0006FB-79
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 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=oevNrhIQoRVxsnK19GuphYXVTA/LKNp0/enoBQXjbw8=; b=PU5T6Zh3hpDqLg2Ct8RF6OhNSI
	2qtZtFxnc8cv/t2Ta0wkRm3xXhd3Di4FZfOPVST3glFzrCQB1H6msnKptL2kXpkn6wPFbwiTPHy6S
	JjteXUWfq6Riylp/T19ylZfb3ftc++d3YE3lSYzYmDbPLa8bhh7HAY/0p9CLXCopQCv8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xenstore: handle do_mkdir and do_rm failure
Message-Id: <E1lHWJT-0006FB-79@xenbits.xenproject.org>
Date: Wed, 03 Mar 2021 18:33:35 +0000

commit e0ca7b883a27919b968dc2c9d2fe2d0096342071
Author:     Norbert Manthey <nmanthey@amazon.de>
AuthorDate: Fri Feb 26 15:41:41 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Mar 3 18:17:14 2021 +0000

    xenstore: handle do_mkdir and do_rm failure
    
    In the out of memory case, we might return a NULL pointer when
    canonicalizing node names. This NULL pointer is not checked when
    creating a directory, or when removing a node. This change handles
    the NULL pointer for these two cases.
    
    This bug was discovered and resolved using Coverity Static Analysis
    Security Testing (SAST) by Synopsys, Inc.
    
    Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
    Reviewed-by: Thomas Friebel <friebelt@amazon.de>
    Reviewed-by: Julien Grall <jgrall@amazon.co.uk>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/xenstore/xenstored_core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 3803aef081..8febd09f55 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1160,6 +1160,8 @@ static int do_mkdir(struct connection *conn, struct buffered_data *in)
 		/* No permissions? */
 		if (errno != ENOENT)
 			return errno;
+		if (!name)
+			return ENOMEM;
 		node = create_node(conn, in, name, NULL, 0);
 		if (!node)
 			return errno;
@@ -1274,6 +1276,8 @@ static int do_rm(struct connection *conn, struct buffered_data *in)
 	if (!node) {
 		/* Didn't exist already?  Fine, if parent exists. */
 		if (errno == ENOENT) {
+			if (!name)
+				return ENOMEM;
 			parentname = get_parent(in, name);
 			if (!parentname)
 				return errno;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Mar 03 18:33:45 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Mar 2021 18:33:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92971.175420 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHWJd-0007D1-UY; Wed, 03 Mar 2021 18:33:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 92971.175420; Wed, 03 Mar 2021 18:33: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 1lHWJd-0007Ct-Rf; Wed, 03 Mar 2021 18:33:45 +0000
Received: by outflank-mailman (input) for mailman id 92971;
 Wed, 03 Mar 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 1lHWJd-0007Ck-GH
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 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 1lHWJd-0006Um-CG
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 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 1lHWJd-0006O5-At
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 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=gA8fmxzW2O4J1dG94+XEin4eNP+MmiVyKyVXxw+MDE4=; b=JzDScCPvqFFNKvhs2eKtIVDYEC
	r8fS5pbqLGpiDqoDqwQcMU1y+PrZzWJtSsRJ55S/V4GYzA1M3OXUM5Cjrk1SjLA3yZXkThWrY2D7K
	ecTV2CsvdpyexBkvExn7W8zyrp9Vs1x3xElInfcskSrkLFlbQLnGjOsL8BP4b5IRTzTU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xenstore: add missing NULL check
Message-Id: <E1lHWJd-0006O5-At@xenbits.xenproject.org>
Date: Wed, 03 Mar 2021 18:33:45 +0000

commit ff3e7e76813a7958e583e6d7e9090ff9b6df1ecd
Author:     Michael Kurth <mku@amazon.com>
AuthorDate: Fri Feb 26 15:41:42 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Mar 3 18:18:45 2021 +0000

    xenstore: add missing NULL check
    
    In case of allocation error, we should not dereference the obtained
    NULL pointer.
    
    This bug was discovered and resolved using Coverity Static Analysis
    Security Testing (SAST) by Synopsys, Inc.
    
    Signed-off-by: Michael Kurth <mku@amazon.com>
    Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
    Reviewed-by: Thomas Friebel <friebelt@amazon.de>
    Reviewed-by: Julien Grall <jgrall@amazon.co.uk>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/xenstore/xenstored_core.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 8febd09f55..8033c1e0eb 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -504,6 +504,11 @@ int write_node_raw(struct connection *conn, TDB_DATA *key, struct node *node,
 	}
 
 	data.dptr = talloc_size(node, data.dsize);
+	if (!data.dptr) {
+		errno = ENOMEM;
+		return errno;
+	}
+
 	hdr = (void *)data.dptr;
 	hdr->generation = node->generation;
 	hdr->num_perms = node->perms.num;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Mar 03 18:33:56 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Mar 2021 18:33:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.92972.175424 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHWJo-0007EY-04; Wed, 03 Mar 2021 18:33:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 92972.175424; Wed, 03 Mar 2021 18:33: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 1lHWJn-0007EP-T5; Wed, 03 Mar 2021 18:33:55 +0000
Received: by outflank-mailman (input) for mailman id 92972;
 Wed, 03 Mar 2021 18: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 1lHWJn-0007EJ-G6
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 18: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 1lHWJn-0006Uw-FM
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 18:33:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lHWJn-0006Or-EM
 for xen-changelog@lists.xenproject.org; Wed, 03 Mar 2021 18: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=agiz6NwVg6308fD5G8qT9Rk/xv26PwpL+t5rk4sXdkE=; b=Mot9c9Vc+IqU+xIdl4Fw0OxQny
	5BOvZZkEYi90eiKdRv1y+oI3cLVMaD/Penp35GBfcpYbP9bGsQp6Ja4O9KNbCy5vlnZaQx5PCVdR5
	Xoc8WNycU3OE7/CBk0a5jiQqrwakiDOBIQ6WCfx7+y9xy7y3iGmOSr1mcuVvNxb3H8OU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstore: Harden xs_domain_is_introduced()
Message-Id: <E1lHWJn-0006Or-EM@xenbits.xenproject.org>
Date: Wed, 03 Mar 2021 18:33:55 +0000

commit 243036df0d55673de59c214e240b9b914d278b65
Author:     Norbert Manthey <nmanthey@amazon.de>
AuthorDate: Fri Feb 26 15:41:44 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Mar 3 18:22:06 2021 +0000

    tools/xenstore: Harden xs_domain_is_introduced()
    
    The function single_with_domid() may return NULL if something
    went wrong (e.g. XenStored returns an error or the connection is
    in bad state).
    
    They are unlikely but not impossible, so it would be better to
    return an error and allow the caller to handle it gracefully rather
    than crashing.
    
    In this case we should treat it as the domain has disappeared (i.e.
    return false) as the caller will not likely going to be able to
    communicate with XenStored again.
    
    This bug was discovered and resolved using Coverity Static Analysis
    Security Testing (SAST) by Synopsys, Inc.
    
    Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
    Reviewed-by: Julien Grall <jgrall@amazon.co.uk>
    Reviewed-by: Raphael Ning <raphning@amazon.co.uk>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libs/store/xs.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/libs/store/xs.c b/tools/libs/store/xs.c
index b6ecbd787e..c91377c27f 100644
--- a/tools/libs/store/xs.c
+++ b/tools/libs/store/xs.c
@@ -1180,7 +1180,12 @@ bool xs_path_is_subpath(const char *parent, const char *child)
 bool xs_is_domain_introduced(struct xs_handle *h, unsigned int domid)
 {
 	char *domain = single_with_domid(h, XS_IS_DOMAIN_INTRODUCED, domid);
-	int rc = strcmp("F", domain);
+	bool rc = false;
+
+	if (!domain)
+		return rc;
+
+	rc = strcmp("F", domain) != 0;
 
 	free(domain);
 	return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Mar 04 08:44:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Mar 2021 08:44:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93054.175619 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHjaV-0002gL-SA; Thu, 04 Mar 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 93054.175619; Thu, 04 Mar 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 1lHjaV-0002gD-P0; Thu, 04 Mar 2021 08:44:03 +0000
Received: by outflank-mailman (input) for mailman id 93054;
 Thu, 04 Mar 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 1lHjaU-0002g8-Nw
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 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 1lHjaU-00072m-MC
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 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 1lHjaU-0008KD-Kb
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 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=e29B1aa9NRbIiFaIHJQZZa1yiarfOCkOrVeNOtSdi0k=; b=v0efD1xwSsvOMIJJrDEC6s4tUa
	u8Dgpta5q9WZMQjw4DSwuITlRpepi4V63hIdJ6ava0jXtlvnElOfDW2hjKbWVBjjKh2wM6xOmH/Sg
	dxCxbegUghYWz7DrWuHMn+G1jF/M+g4X4r0I7xi9pFJy63LCqYMKnaiBvGkinQUqSgzE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xenstore: add missing NULL check
Message-Id: <E1lHjaU-0008KD-Kb@xenbits.xenproject.org>
Date: Thu, 04 Mar 2021 08:44:02 +0000

commit 0bdaa8b035ec9fbdfd4e4f25f0577016c94b7a50
Author:     Norbert Manthey <nmanthey@amazon.de>
AuthorDate: Fri Feb 26 15:41:35 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Mar 3 18:11:11 2021 +0000

    xenstore: add missing NULL check
    
    In case of allocation error, we should not dereference the obtained
    NULL pointer. Hence, fail early.
    
    This bug was discovered and resolved using Coverity Static Analysis
    Security Testing (SAST) by Synopsys, Inc.
    
    Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
    Reviewed-by: Thomas Friebel <friebelt@amazon.de>
    Reviewed-by: Julien Grall <jgrall@amazon.co.uk>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/xenstore/xenstored_core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 0fea598352..3803aef081 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1818,6 +1818,10 @@ static int check_store_(const char *name, struct hashtable *reachable)
 
 		struct hashtable * children =
 			create_hashtable(16, hash_from_key_fn, keys_equal_fn);
+		if (!children) {
+			log("check_store create table: ENOMEM");
+			return ENOMEM;
+		}
 
 		if (!remember_string(reachable, name)) {
 			hashtable_destroy(children, 0);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Mar 04 08:44:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Mar 2021 08:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93055.175623 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHjaf-0002h6-Tu; Thu, 04 Mar 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 93055.175623; Thu, 04 Mar 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 1lHjaf-0002gy-Qf; Thu, 04 Mar 2021 08:44:13 +0000
Received: by outflank-mailman (input) for mailman id 93055;
 Thu, 04 Mar 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 1lHjae-0002gt-RE
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 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 1lHjae-000738-PP
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 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 1lHjae-0008L2-ON
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 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=svbB4bCVdFwOOjNyOdH2DxKNl2oYDwbxP+IXFdSZcY8=; b=g3/hFpqrkTA+caYhEVcveN9GI+
	pKO0foTZDwxWCGOVxWexg57AknBKV2Q/tXSvowzxL3DjEjC3FHdqfIgIzO1Nk8f5EEzNRMY/sP97l
	+a1yBbqyYrcrvSuNPR0ORDu7Gj18tiOryCk/oVgek9FZqCuTuA0bbpWAQEUUFgUw7z3s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xenstore: fix print format string
Message-Id: <E1lHjae-0008L2-ON@xenbits.xenproject.org>
Date: Thu, 04 Mar 2021 08:44:12 +0000

commit 5c4634f22696bc609c96f0754832268ed1247059
Author:     Norbert Manthey <nmanthey@amazon.de>
AuthorDate: Fri Feb 26 15:41:36 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Mar 3 18:12:05 2021 +0000

    xenstore: fix print format string
    
    Use the correct format specifier for unsigned values. Additionally, a
    cast was dropped, as the format specifier did not require it anymore.
    
    This was reported by analysis with cppcheck.
    
    Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
    Reviewed-by: Thomas Friebel <friebelt@amazon.de>
    Reviewed-by: Julien Grall <jgrall@amazon.co.uk>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/xenstore/xs_tdb_dump.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/xenstore/xs_tdb_dump.c b/tools/xenstore/xs_tdb_dump.c
index 207ed446d5..f74676cf1c 100644
--- a/tools/xenstore/xs_tdb_dump.c
+++ b/tools/xenstore/xs_tdb_dump.c
@@ -59,8 +59,8 @@ int main(int argc, char *argv[])
 			fprintf(stderr, "%.*s: BAD truncated\n",
 				(int)key.dsize, key.dptr);
 		else if (data.dsize != total_size(hdr))
-			fprintf(stderr, "%.*s: BAD length %i for %i/%i/%i (%i)\n",
-				(int)key.dsize, key.dptr, (int)data.dsize,
+			fprintf(stderr, "%.*s: BAD length %zu for %u/%u/%u (%u)\n",
+				(int)key.dsize, key.dptr, data.dsize,
 				hdr->num_perms, hdr->datalen,
 				hdr->childlen, total_size(hdr));
 		else {
@@ -69,7 +69,7 @@ int main(int argc, char *argv[])
 
 			printf("%.*s: ", (int)key.dsize, key.dptr);
 			for (i = 0; i < hdr->num_perms; i++)
-				printf("%s%c%i",
+				printf("%s%c%u",
 				       i == 0 ? "" : ",",
 				       perm_to_char(hdr->perms[i].perms),
 				       hdr->perms[i].id);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Mar 04 08:44:23 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Mar 2021 08:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93056.175627 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHjap-0002ig-VG; Thu, 04 Mar 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 93056.175627; Thu, 04 Mar 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 1lHjap-0002iY-SH; Thu, 04 Mar 2021 08:44:23 +0000
Received: by outflank-mailman (input) for mailman id 93056;
 Thu, 04 Mar 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 1lHjao-0002iQ-TE
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 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 1lHjao-00073I-SO
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 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 1lHjao-0008Lp-RO
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 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=YE83K3HU0Aj7r8Y1UJUnzgxI2G25IabL7jkCd0CFkAU=; b=Zj2yBOt6H6A15CLJQKAdFByNJE
	UhIVEKZ8JejepihMxMUonamxfHeIMpKFuqQPReb6x1g6McBbKEkQRC18rMEkzRq6v4/J7d5WDqxvt
	aquV+dAk03cJMXZGrgeaAgEPic9RqOyw1fFTAQmKAuzdhrgNjyLvFOeFkZ73MuToRvXo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xenstore: check formats of trace
Message-Id: <E1lHjao-0008Lp-RO@xenbits.xenproject.org>
Date: Thu, 04 Mar 2021 08:44:22 +0000

commit 4a27a6786573067e69566afd2534edb2814de014
Author:     Norbert Manthey <nmanthey@amazon.de>
AuthorDate: Fri Feb 26 15:41:37 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Mar 3 18:13:12 2021 +0000

    xenstore: check formats of trace
    
    When passing format strings to the trace function, allow gcc to analyze
    those and warn on issues.
    
    Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
    Reviewed-by: Thomas Friebel <friebelt@amazon.de>
    Reviewed-by: Julien Grall <jgrall@amazon.co.uk>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/xenstore/xenstored_core.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 589699e833..0c9a0961b5 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -217,7 +217,7 @@ int delay_request(struct connection *conn, struct buffered_data *in,
 /* Tracing infrastructure. */
 void trace_create(const void *data, const char *type);
 void trace_destroy(const void *data, const char *type);
-void trace(const char *fmt, ...);
+void trace(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
 void dtrace_io(const struct connection *conn, const struct buffered_data *data, int out);
 void reopen_log(void);
 void close_log(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Mar 04 08:44:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Mar 2021 08:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93057.175631 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHjb0-0002kN-2G; Thu, 04 Mar 2021 08:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93057.175631; Thu, 04 Mar 2021 08: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 1lHjaz-0002kC-VL; Thu, 04 Mar 2021 08:44:33 +0000
Received: by outflank-mailman (input) for mailman id 93057;
 Thu, 04 Mar 2021 08: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 1lHjaz-0002k5-1o
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 08: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 1lHjaz-00073P-0v
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 08:44:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lHjay-0008N5-UY
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 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=nXetKPxM615DGGXbdYWeobbkM5jfI8arLNzvMLoTP40=; b=nqMR6fK6KkE6JXmKtnaA98LrL5
	zKGJTibG4WSyKnEeL1OTeOVPL5tFM9pJG0Nf1sYDNPaqXyuskc08B1pbtL9xDtUCtYEc0TcfRnEe5
	l7Va8n4xaKbCzcbkiIZz2w35gtNp2O/dHM+uMTl9uRfqpFb3sxVIb1RRSkuXf5Ylpbc0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xenstore: handle do_mkdir and do_rm failure
Message-Id: <E1lHjay-0008N5-UY@xenbits.xenproject.org>
Date: Thu, 04 Mar 2021 08:44:32 +0000

commit e0ca7b883a27919b968dc2c9d2fe2d0096342071
Author:     Norbert Manthey <nmanthey@amazon.de>
AuthorDate: Fri Feb 26 15:41:41 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Mar 3 18:17:14 2021 +0000

    xenstore: handle do_mkdir and do_rm failure
    
    In the out of memory case, we might return a NULL pointer when
    canonicalizing node names. This NULL pointer is not checked when
    creating a directory, or when removing a node. This change handles
    the NULL pointer for these two cases.
    
    This bug was discovered and resolved using Coverity Static Analysis
    Security Testing (SAST) by Synopsys, Inc.
    
    Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
    Reviewed-by: Thomas Friebel <friebelt@amazon.de>
    Reviewed-by: Julien Grall <jgrall@amazon.co.uk>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/xenstore/xenstored_core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 3803aef081..8febd09f55 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1160,6 +1160,8 @@ static int do_mkdir(struct connection *conn, struct buffered_data *in)
 		/* No permissions? */
 		if (errno != ENOENT)
 			return errno;
+		if (!name)
+			return ENOMEM;
 		node = create_node(conn, in, name, NULL, 0);
 		if (!node)
 			return errno;
@@ -1274,6 +1276,8 @@ static int do_rm(struct connection *conn, struct buffered_data *in)
 	if (!node) {
 		/* Didn't exist already?  Fine, if parent exists. */
 		if (errno == ENOENT) {
+			if (!name)
+				return ENOMEM;
 			parentname = get_parent(in, name);
 			if (!parentname)
 				return errno;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Mar 04 08:44:44 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Mar 2021 08:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93058.175635 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHjbA-0002ld-42; Thu, 04 Mar 2021 08:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93058.175635; Thu, 04 Mar 2021 08: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 1lHjbA-0002lV-0c; Thu, 04 Mar 2021 08:44:44 +0000
Received: by outflank-mailman (input) for mailman id 93058;
 Thu, 04 Mar 2021 08: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 1lHjb9-0002lO-79
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 08:44: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 1lHjb9-00073h-4q
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 08:44:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lHjb9-0008OA-39
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 08:44:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UIPqvNSHnV3sdE2DJdYSnr6zQxxabTCTwoHguh36yzo=; b=h7/ucjPThS1sMg7TJd672f6PwY
	f7HHozMKMsZ1W7HUxywMS2cTCcqBILJ1L3vOmiPD70bX89k6vvSv24ITPNPvePD/AGG1/KQmgSkl3
	PM4pTVT1D6QdtC1SEx/L8zof7bC08nUj8aHg9v5OYDld8GIbcikH2BmV4vsK8DYW1A48=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xenstore: add missing NULL check
Message-Id: <E1lHjb9-0008OA-39@xenbits.xenproject.org>
Date: Thu, 04 Mar 2021 08:44:43 +0000

commit ff3e7e76813a7958e583e6d7e9090ff9b6df1ecd
Author:     Michael Kurth <mku@amazon.com>
AuthorDate: Fri Feb 26 15:41:42 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Mar 3 18:18:45 2021 +0000

    xenstore: add missing NULL check
    
    In case of allocation error, we should not dereference the obtained
    NULL pointer.
    
    This bug was discovered and resolved using Coverity Static Analysis
    Security Testing (SAST) by Synopsys, Inc.
    
    Signed-off-by: Michael Kurth <mku@amazon.com>
    Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
    Reviewed-by: Thomas Friebel <friebelt@amazon.de>
    Reviewed-by: Julien Grall <jgrall@amazon.co.uk>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/xenstore/xenstored_core.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 8febd09f55..8033c1e0eb 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -504,6 +504,11 @@ int write_node_raw(struct connection *conn, TDB_DATA *key, struct node *node,
 	}
 
 	data.dptr = talloc_size(node, data.dsize);
+	if (!data.dptr) {
+		errno = ENOMEM;
+		return errno;
+	}
+
 	hdr = (void *)data.dptr;
 	hdr->generation = node->generation;
 	hdr->num_perms = node->perms.num;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Mar 04 08:44:54 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Mar 2021 08:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93059.175639 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHjbK-0002mw-5R; Thu, 04 Mar 2021 08:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93059.175639; Thu, 04 Mar 2021 08: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 1lHjbK-0002mn-28; Thu, 04 Mar 2021 08:44:54 +0000
Received: by outflank-mailman (input) for mailman id 93059;
 Thu, 04 Mar 2021 08: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 1lHjbJ-0002mg-A4
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 08: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 1lHjbJ-00073q-9P
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 08:44:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lHjbJ-0008Om-6y
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 08: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=oHZTfsYG/UPxZMOkXojnN/j7NOkl8mNu3dF7UatTnEk=; b=r0e7QabLvjCQO6xyJ1YB4GaXOA
	cZ8a3eBvpGXJxQhjUx8nkXeIbE/u2s7EHFRjty6OaC6hrmQr3wePaFdX3uvnUnoOUUrgqsprkqTLI
	XZsanGMwlIeg+sZfiriVAgLy9K32ujbdguh80nUCWeR+u6eEuoBwGecP3j6M8Dh0aarA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstore: Harden xs_domain_is_introduced()
Message-Id: <E1lHjbJ-0008Om-6y@xenbits.xenproject.org>
Date: Thu, 04 Mar 2021 08:44:53 +0000

commit 243036df0d55673de59c214e240b9b914d278b65
Author:     Norbert Manthey <nmanthey@amazon.de>
AuthorDate: Fri Feb 26 15:41:44 2021 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Mar 3 18:22:06 2021 +0000

    tools/xenstore: Harden xs_domain_is_introduced()
    
    The function single_with_domid() may return NULL if something
    went wrong (e.g. XenStored returns an error or the connection is
    in bad state).
    
    They are unlikely but not impossible, so it would be better to
    return an error and allow the caller to handle it gracefully rather
    than crashing.
    
    In this case we should treat it as the domain has disappeared (i.e.
    return false) as the caller will not likely going to be able to
    communicate with XenStored again.
    
    This bug was discovered and resolved using Coverity Static Analysis
    Security Testing (SAST) by Synopsys, Inc.
    
    Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
    Reviewed-by: Julien Grall <jgrall@amazon.co.uk>
    Reviewed-by: Raphael Ning <raphning@amazon.co.uk>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libs/store/xs.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/libs/store/xs.c b/tools/libs/store/xs.c
index b6ecbd787e..c91377c27f 100644
--- a/tools/libs/store/xs.c
+++ b/tools/libs/store/xs.c
@@ -1180,7 +1180,12 @@ bool xs_path_is_subpath(const char *parent, const char *child)
 bool xs_is_domain_introduced(struct xs_handle *h, unsigned int domid)
 {
 	char *domain = single_with_domid(h, XS_IS_DOMAIN_INTRODUCED, domid);
-	int rc = strcmp("F", domain);
+	bool rc = false;
+
+	if (!domain)
+		return rc;
+
+	rc = strcmp("F", domain) != 0;
 
 	free(domain);
 	return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Mar 04 15:44:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Mar 2021 15:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93337.176202 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHq90-0006dJ-LO; Thu, 04 Mar 2021 15:44:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93337.176202; Thu, 04 Mar 2021 15:44: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 1lHq90-0006dB-IY; Thu, 04 Mar 2021 15:44:06 +0000
Received: by outflank-mailman (input) for mailman id 93337;
 Thu, 04 Mar 2021 15:44: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 1lHq8z-0006d6-A3
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 15:44: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 1lHq8z-00064e-7M
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 15:44:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lHq8z-0001FQ-46
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 15:44:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1RbYM6ub7tS7Wb0fAjiIasT7a/8WMx4CZytJHAgp2VU=; b=WguGaClD704TDwLRAMczkLnBJ8
	RH5uFpy3fudWyETOIjPaHBvXs1VNwPo5equ+E49xaUT2zjx4ZeUwYNYFOroEfIKQqVjegKVKwTs/T
	M4QtunHKzMsIPTbE4S/cP0eO2xVDZPgVCuuKwJf7b+wH9MuuTcuj4ysX3JTpzOeZIb3c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstored: liveupdate: Properly check long transaction
Message-Id: <E1lHq8z-0001FQ-46@xenbits.xenproject.org>
Date: Thu, 04 Mar 2021 15:44:05 +0000

commit 5d16679ab0760dbe5e4df52c02f15c69ed5541e6
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Wed Mar 3 17:05:26 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Mar 4 15:36:24 2021 +0000

    tools/xenstored: liveupdate: Properly check long transaction
    
    As XenStored is single-threaded, conn->ta_start_time will always be
    smaller than now. As we substract the latter from the former, it means
    a transaction will never be considered long running.
    
    Invert the two operands of the substraction in both lu_reject_reason()
    and lu_check_allowed(). In addition to that, the former also needs to
    check that conn->ta_start_time is not 0 (i.e the transaction is not
    active).
    
    Take the opportunity to document the return condition of
    lu_check_allowed().
    
    Fixes: e04e53a5be20 ("tools/xenstore: allow live update only with no transaction active")
    Reported-by: Bjoern Doebel <doebel@amazon.de>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/xenstore/xenstored_control.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_control.c
index 766b243839..a1652219b2 100644
--- a/tools/xenstore/xenstored_control.c
+++ b/tools/xenstore/xenstored_control.c
@@ -459,11 +459,18 @@ static bool lu_check_lu_allowed(void)
 	list_for_each_entry(conn, &connections, list) {
 		if (conn->ta_start_time) {
 			ta_total++;
-			if (conn->ta_start_time - now >= lu_status->timeout)
+			if (now - conn->ta_start_time >= lu_status->timeout)
 				ta_long++;
 		}
 	}
 
+	/*
+	 * Allow LiveUpdate if one of the following conditions is met:
+	 *	- There is no active transactions
+	 *	- All transactions are long running (e.g. they have been
+	 *	active for more than lu_status->timeout sec) and the admin as
+	 *	requested to force the operation.
+	 */
 	return ta_total ? (lu_status->force && ta_long == ta_total) : true;
 }
 
@@ -474,11 +481,12 @@ static const char *lu_reject_reason(const void *ctx)
 	time_t now = time(NULL);
 
 	list_for_each_entry(conn, &connections, list) {
-		if (conn->ta_start_time - now >= lu_status->timeout) {
+		if (conn->ta_start_time &&
+		    (now - conn->ta_start_time >= lu_status->timeout)) {
 			ret = talloc_asprintf(ctx, "%s\nDomain %u: %ld s",
 					      ret ? : "Domains with long running transactions:",
 					      conn->id,
-					      conn->ta_start_time - now);
+					      now - conn->ta_start_time);
 		}
 	}
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Mar 04 15:55:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Mar 2021 15:55:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93338.176207 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHqJf-0007cJ-GA; Thu, 04 Mar 2021 15:55:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93338.176207; Thu, 04 Mar 2021 15: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 1lHqJf-0007cB-DB; Thu, 04 Mar 2021 15:55:07 +0000
Received: by outflank-mailman (input) for mailman id 93338;
 Thu, 04 Mar 2021 15:55: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 1lHqJe-0007c6-2q
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 15:55: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 1lHqJd-0006FQ-Vb
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 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 1lHqJd-0002BY-Sa
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 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=tHtLeSuFJaulneOjDuM0JprNrRc7bkTjXG8LEDoxBnY=; b=ONsdSB68vgpnlZUhzdvytLTSSG
	n55kKwZ1XNWGa73Q7lcMSgByg6KP+9CRUJ+Xo3eYIGWbu+x3YxBAQhs7tHSZXzDWH7s3FVgUOvHRg
	koYF98eVxpZRDoDwde2rrvzAtkepFTvjJKXqDbEdobOEdkf6R4VrfCRbWrFqf5qG/wKw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] crypto: adjust rijndaelEncrypt() prototype for gcc11
Message-Id: <E1lHqJd-0002BY-Sa@xenbits.xenproject.org>
Date: Thu, 04 Mar 2021 15:55:05 +0000

commit c6ad5a701b9a6df443a6c98d9e7201c958bbcafc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Mar 4 16:47:51 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 4 16:47:51 2021 +0100

    crypto: adjust rijndaelEncrypt() prototype for gcc11
    
    The upcoming release complains, not entirely unreasonably:
    
    In file included from rijndael.c:33:
    .../xen/include/crypto/rijndael.h:55:53: note: previously declared as 'const unsigned char[]'
       55 | void    rijndaelEncrypt(const unsigned int [], int, const unsigned char [],
          |                                                     ^~~~~~~~~~~~~~~~~~~~~~
    rijndael.c:865:8: error: argument 4 of type 'u8[16]' {aka 'unsigned char[16]'} with mismatched bound [-Werror=array-parameter=]
      865 |     u8 ct[16])
          |     ~~~^~~~~~
    In file included from rijndael.c:33:
    .../xen/include/crypto/rijndael.h:56:13: note: previously declared as 'unsigned char[]'
       56 |             unsigned char []);
          |             ^~~~~~~~~~~~~~~~
    
    Simply declare the correct array dimensions right away. This then allows
    compilers to apply checking at call sites, which seems desirable anyway.
    
    For the moment I'm leaving untouched the disagreement between u8/u32
    used in the function definition and unsigned {char,int} used in the
    declaration, as making this consistent would call for touching further
    functions.
    
    Reported-by: Charles Arnold <carnold@suse.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/include/crypto/rijndael.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/crypto/rijndael.h b/xen/include/crypto/rijndael.h
index 69965783c5..4386be5878 100644
--- a/xen/include/crypto/rijndael.h
+++ b/xen/include/crypto/rijndael.h
@@ -52,7 +52,7 @@ void	 rijndael_encrypt(rijndael_ctx *, const unsigned char *, unsigned char *);
 
 int	rijndaelKeySetupEnc(unsigned int [], const unsigned char [], int);
 int	rijndaelKeySetupDec(unsigned int [], const unsigned char [], int);
-void	rijndaelEncrypt(const unsigned int [], int, const unsigned char [],
-	    unsigned char []);
+void	rijndaelEncrypt(const unsigned int [], int, const unsigned char [16],
+	    unsigned char [16]);
 
 #endif /* __RIJNDAEL_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Mar 04 15:55:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Mar 2021 15:55:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93339.176210 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHqJp-0007d6-HZ; Thu, 04 Mar 2021 15:55:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93339.176210; Thu, 04 Mar 2021 15: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 1lHqJp-0007cy-Ec; Thu, 04 Mar 2021 15:55:17 +0000
Received: by outflank-mailman (input) for mailman id 93339;
 Thu, 04 Mar 2021 15:55: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 1lHqJo-0007cq-4l
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 15:55: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 1lHqJo-0006Fj-3y
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 15:55:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lHqJo-0002CP-1U
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 15:55:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vnNZoFx/esSBK5zEhHpyT1wUfKQa33l0qLXQ7pN4aAA=; b=4DPNYZJ7jtHJ4iV9MOvGUqDrvP
	xhtdJxquLcK0nlgmub0XXV+A3Rvo0oNVALL8k/m/F9uZPFo88GBE0jjkLsLNB5ayPyxG4NkG798TX
	jhhB6680QFTe5dtMQ76TfFt/rk/0CUXx8w3p8XtUUGK/G+MFJgdaoIy2s2wGpz/TYz+c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] firmware: provide a stand alone set of headers
Message-Id: <E1lHqJo-0002CP-1U@xenbits.xenproject.org>
Date: Thu, 04 Mar 2021 15:55:16 +0000

commit 73b13705af7c3bb8fdf11932eb68788d090a443f
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Thu Mar 4 16:49:00 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 4 16:49:00 2021 +0100

    firmware: provide a stand alone set of headers
    
    The current build of the firmware relies on having 32bit compatible
    headers installed in order to build some of the 32bit firmware.
    Usually this can be solved by using the -ffreestanding compiler option
    which drops the usage of the system headers in favor of a private set
    of freestanding headers provided by the compiler itself that are not
    tied to libc.
    
    However such option is broken at least in the gcc compiler provided in
    Alpine Linux, as the system include path (ie: /usr/include) takes
    precedence over the gcc private include path:
    
    #include <...> search starts here:
     /usr/include
     /usr/lib/gcc/x86_64-alpine-linux-musl/10.2.1/include
    
    And the headers in /usr/include are exclusively 64bit.
    
    Since -ffreestanding is currently broken on at least that distro, and
    for resilience against future compilers also having the option broken
    provide a set of stand alone 32bit headers required for the firmware
    build.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/firmware/Rules.mk                       | 13 +++++++++
 tools/firmware/include/stdarg.h               | 10 +++++++
 tools/firmware/include/stdbool.h              |  9 +++++++
 tools/firmware/include/stddef.h               | 10 +++++++
 tools/firmware/include/stdint.h               | 39 +++++++++++++++++++++++++++
 tools/firmware/rombios/32bit/rombios_compat.h |  4 +--
 6 files changed, 82 insertions(+), 3 deletions(-)

diff --git a/tools/firmware/Rules.mk b/tools/firmware/Rules.mk
index dc372a86d8..9f78a7dec9 100644
--- a/tools/firmware/Rules.mk
+++ b/tools/firmware/Rules.mk
@@ -17,3 +17,16 @@ $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 
 # Extra CFLAGS suitable for an embedded type of environment.
 CFLAGS += -ffreestanding -msoft-float
+
+# Use our own set of stand alone headers to build firmware.
+#
+# Ideally using -ffreestanding should be enough, but that relies on the
+# compiler having the right order for include paths (ie: compiler private
+# headers before system ones) or the libc headers having proper arch-agnostic
+# freestanding support. This is not the case in Alpine at least which searches
+# system headers before compiler ones and has arch-specific libc headers. This
+# has been reported upstream:
+# https://gitlab.alpinelinux.org/alpine/aports/-/issues/12477
+# In the meantime (and for resilience against broken systems) use our own set
+# of headers that provide what's needed for the firmware build.
+CFLAGS += -nostdinc -I$(XEN_ROOT)/tools/firmware/include
diff --git a/tools/firmware/include/stdarg.h b/tools/firmware/include/stdarg.h
new file mode 100644
index 0000000000..c5e3761cd2
--- /dev/null
+++ b/tools/firmware/include/stdarg.h
@@ -0,0 +1,10 @@
+#ifndef _STDARG_H_
+#define _STDARG_H_
+
+typedef __builtin_va_list va_list;
+#define va_copy(dest, src) __builtin_va_copy(dest, src)
+#define va_start(ap, last) __builtin_va_start(ap, last)
+#define va_end(ap) __builtin_va_end(ap)
+#define va_arg __builtin_va_arg
+
+#endif
diff --git a/tools/firmware/include/stdbool.h b/tools/firmware/include/stdbool.h
new file mode 100644
index 0000000000..0cf76b106c
--- /dev/null
+++ b/tools/firmware/include/stdbool.h
@@ -0,0 +1,9 @@
+#ifndef _STDBOOL_H_
+#define _STDBOOL_H_
+
+#define bool _Bool
+#define true 1
+#define false 0
+#define __bool_true_false_are_defined 1
+
+#endif
diff --git a/tools/firmware/include/stddef.h b/tools/firmware/include/stddef.h
new file mode 100644
index 0000000000..c7f974608a
--- /dev/null
+++ b/tools/firmware/include/stddef.h
@@ -0,0 +1,10 @@
+#ifndef _STDDEF_H_
+#define _STDDEF_H_
+
+typedef __SIZE_TYPE__ size_t;
+
+#define NULL ((void*)0)
+
+#define offsetof(t, m) __builtin_offsetof(t, m)
+
+#endif
diff --git a/tools/firmware/include/stdint.h b/tools/firmware/include/stdint.h
new file mode 100644
index 0000000000..16a0b6de19
--- /dev/null
+++ b/tools/firmware/include/stdint.h
@@ -0,0 +1,39 @@
+#ifndef _STDINT_H_
+#define _STDINT_H_
+
+#if defined(__LP64__) || defined(__P64__)
+#error "32bit only header"
+#endif
+
+typedef unsigned char uint8_t;
+typedef signed char int8_t;
+
+typedef unsigned short uint16_t;
+typedef signed short int16_t;
+
+typedef unsigned int uint32_t;
+typedef signed int int32_t;
+
+typedef unsigned long long uint64_t;
+typedef signed long long int64_t;
+
+#define INT8_MIN        (-0x7f-1)
+#define INT16_MIN       (-0x7fff-1)
+#define INT32_MIN       (-0x7fffffff-1)
+#define INT64_MIN       (-0x7fffffffffffffffll-1)
+
+#define INT8_MAX        0x7f
+#define INT16_MAX       0x7fff
+#define INT32_MAX       0x7fffffff
+#define INT64_MAX       0x7fffffffffffffffll
+
+#define UINT8_MAX       0xff
+#define UINT16_MAX      0xffff
+#define UINT32_MAX      0xffffffffu
+#define UINT64_MAX      0xffffffffffffffffull
+
+typedef uint32_t uintptr_t;
+
+#define UINTPTR_MAX     UINT32_MAX
+
+#endif
diff --git a/tools/firmware/rombios/32bit/rombios_compat.h b/tools/firmware/rombios/32bit/rombios_compat.h
index 3fe7d67721..8ba4c17ffd 100644
--- a/tools/firmware/rombios/32bit/rombios_compat.h
+++ b/tools/firmware/rombios/32bit/rombios_compat.h
@@ -8,9 +8,7 @@
 
 #define ADDR_FROM_SEG_OFF(seg, off)  (void *)((((uint32_t)(seg)) << 4) + (off))
 
-typedef unsigned char uint8_t;
-typedef unsigned short int uint16_t;
-typedef unsigned int uint32_t;
+#include <stdint.h>
 
 typedef uint8_t  Bit8u;
 typedef uint16_t Bit16u;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Mar 04 15:55:27 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Mar 2021 15:55:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93340.176215 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHqJz-0007fE-JA; Thu, 04 Mar 2021 15:55:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93340.176215; Thu, 04 Mar 2021 15: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 1lHqJz-0007f4-G3; Thu, 04 Mar 2021 15:55:27 +0000
Received: by outflank-mailman (input) for mailman id 93340;
 Thu, 04 Mar 2021 15:55: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 1lHqJy-0007et-9u
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 15:55: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 1lHqJy-0006Fp-94
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 15:55:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lHqJy-0002DK-6P
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 15:55:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=q66xKtQnoWvVjTDy0EPGXqfoGNi8QxQgTV1QQvxjiYQ=; b=QWJA0hUm+SdJ32tJ1FpM/1ohno
	DcTV+iTarBU2zfRNKNM6Qmz8F2pXAQRwzHYsmYO9jxvkWB10MbNuK/NE5KmuQddpLjdeULkt3l1xn
	RVXV8KHuhOsd84Ocg3FqDghZPczwZJZ9KgILjfvl3kx/JvwbPyMmHFFR8WK14ZXCXUlk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/dmop: Fix XEN_DMOP_nr_vcpus to actually return data
Message-Id: <E1lHqJy-0002DK-6P@xenbits.xenproject.org>
Date: Thu, 04 Mar 2021 15:55:26 +0000

commit 6b0ac9a4e239d00d5e07f0313903b88b08d39452
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Mar 4 10:36:21 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Mar 4 15:54:25 2021 +0000

    xen/dmop: Fix XEN_DMOP_nr_vcpus to actually return data
    
    The const_op boolean needs clobbering to cause data to be written back to the
    caller.
    
    Fixes: c4441ab1f1 ("dmop: Add XEN_DMOP_nr_vcpus")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/arch/arm/dm.c     | 1 +
 xen/arch/x86/hvm/dm.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/xen/arch/arm/dm.c b/xen/arch/arm/dm.c
index d689e336fd..1b3fd6bc7d 100644
--- a/xen/arch/arm/dm.c
+++ b/xen/arch/arm/dm.c
@@ -128,6 +128,7 @@ int dm_op(const struct dmop_args *op_args)
         struct xen_dm_op_nr_vcpus *data = &op.u.nr_vcpus;
 
         data->vcpus = d->max_vcpus;
+        const_op = false;
         rc = 0;
         break;
     }
diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c
index f4f0910463..b60b9f3364 100644
--- a/xen/arch/x86/hvm/dm.c
+++ b/xen/arch/x86/hvm/dm.c
@@ -612,6 +612,7 @@ int dm_op(const struct dmop_args *op_args)
         struct xen_dm_op_nr_vcpus *data = &op.u.nr_vcpus;
 
         data->vcpus = d->max_vcpus;
+        const_op = false;
         rc = 0;
         break;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Mar 04 15:55:37 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Mar 2021 15:55:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93341.176219 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lHqK9-0007gb-Kc; Thu, 04 Mar 2021 15:55:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93341.176219; Thu, 04 Mar 2021 15: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 1lHqK9-0007gT-HU; Thu, 04 Mar 2021 15:55:37 +0000
Received: by outflank-mailman (input) for mailman id 93341;
 Thu, 04 Mar 2021 15:55: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 1lHqK8-0007gJ-D0
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 15:55: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 1lHqK8-0006Fz-CC
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 15:55:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lHqK8-0002Dt-BE
 for xen-changelog@lists.xenproject.org; Thu, 04 Mar 2021 15:55:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/NF9de4bfScKwQ/g6rA6t+uG0WcuQd/W4bpwrUaNzZk=; b=dxW9BH4HALhla9g8ofRiyXowCS
	nffz8IX0IWu6nlUvXwlL4ZRtsnuI/A5PN+KmsM9HYisgegvLhf/3o+3VMoH9U55eefxTyiZUS9U5i
	CuJmH/d+cKFVCj+xQyaj9+rDLhPOoFRJ+6L2tp+CLD1kL0iNQaeOTu2qXQE+dysfIJ4g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxendevicemodel: Strip __XEN_TOOLS__ header guard
Message-Id: <E1lHqK8-0002Dt-BE@xenbits.xenproject.org>
Date: Thu, 04 Mar 2021 15:55:36 +0000

commit f40e1c52e4e0a3e084b025ed6b68f1e6ebaea027
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Mar 4 12:44:44 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Mar 4 15:54:25 2021 +0000

    tools/libxendevicemodel: Strip __XEN_TOOLS__ header guard
    
    This is inappropriate for the header file of a standalone library with stable
    API and ABI.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/include/xendevicemodel.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/tools/include/xendevicemodel.h b/tools/include/xendevicemodel.h
index 33698d67f3..797e0c6b29 100644
--- a/tools/include/xendevicemodel.h
+++ b/tools/include/xendevicemodel.h
@@ -17,8 +17,6 @@
 #ifndef XENDEVICEMODEL_H
 #define XENDEVICEMODEL_H
 
-#ifdef __XEN_TOOLS__
-
 #include <stdint.h>
 
 #include <xen/xen.h>
@@ -377,8 +375,6 @@ int xendevicemodel_nr_vcpus(
  */
 int xendevicemodel_restrict(xendevicemodel_handle *dmod, domid_t domid);
 
-#endif /* __XEN_TOOLS__ */
-
 #endif /* XENDEVICEMODEL_H */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 12:33:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 12:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93652.176627 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lI9dj-0000b4-AO; Fri, 05 Mar 2021 12:33:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93652.176627; Fri, 05 Mar 2021 12: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 1lI9dj-0000ax-7N; Fri, 05 Mar 2021 12:33:07 +0000
Received: by outflank-mailman (input) for mailman id 93652;
 Fri, 05 Mar 2021 12:33: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 1lI9dh-0000as-VU
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 12:33: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 1lI9dh-0005fw-Ez
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 12:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lI9dh-0006it-Ci
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 12: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=3GZEanfFYwI9/gkWsGAGdkObor2OnRHSy0qgc3qB5BE=; b=GTGA0ll/SVdgO2S+BnKjmGKv2H
	Nj754/NVerttBqCePfuDly1/OEJOY3M9DfzNoxixGrMOa04X4MSODBgkx4ixMsAtE2ydKqVgqY2Cq
	HOLR0ZG81DBhMn8gWaBj2h1hmtjYCv8jd8kxw/CQ3txH+N/CMZj1m8eEvO+cQCu1n9Ak=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: suppress "fast fault path" optimization without reserved bits
Message-Id: <E1lI9dh-0006it-Ci@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 12:33:05 +0000

commit 9318fdf757ec234f0ee6c5cd381326b2f581d065
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 13:29:28 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 13:29:28 2021 +0100

    x86/shadow: suppress "fast fault path" optimization without reserved bits
    
    When none of the physical address bits in PTEs are reserved, we can't
    create any 4k (leaf) PTEs which would trigger reserved bit faults. Hence
    the present SHOPT_FAST_FAULT_PATH machinery needs to be suppressed in
    this case, which is most easily achieved by never creating any magic
    entries.
    
    To compensate a little, eliminate sh_write_p2m_entry_post()'s impact on
    such hardware.
    
    While at it, also avoid using an MMIO magic entry when that would
    truncate the incoming GFN.
    
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/arch/x86/mm/shadow/multi.c |  3 ++-
 xen/arch/x86/mm/shadow/types.h | 28 ++++++++++++++++++++++------
 2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index dd59bec2c3..9b43cb116c 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -499,7 +499,8 @@ _sh_propagate(struct vcpu *v,
     {
         /* Guest l1e maps emulated MMIO space */
         *sp = sh_l1e_mmio(target_gfn, gflags);
-        d->arch.paging.shadow.has_fast_mmio_entries = true;
+        if ( sh_l1e_is_magic(*sp) )
+            d->arch.paging.shadow.has_fast_mmio_entries = true;
         goto done;
     }
 
diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index 416b284123..901645560a 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -281,7 +281,8 @@ static inline shadow_l4e_t shadow_l4e_from_mfn(mfn_t mfn, u32 flags)
  * pagetables.
  *
  * This is only feasible for PAE and 64bit Xen: 32-bit non-PAE PTEs don't
- * have reserved bits that we can use for this.
+ * have reserved bits that we can use for this.  And even there it can only
+ * be used if the processor doesn't use all 52 address bits.
  */
 
 #define SH_L1E_MAGIC 0xffffffff00000001ULL
@@ -291,14 +292,24 @@ static inline bool sh_l1e_is_magic(shadow_l1e_t sl1e)
 }
 
 /* Guest not present: a single magic value */
-static inline shadow_l1e_t sh_l1e_gnp(void)
+static inline shadow_l1e_t sh_l1e_gnp_raw(void)
 {
     return (shadow_l1e_t){ -1ULL };
 }
 
+static inline shadow_l1e_t sh_l1e_gnp(void)
+{
+    /*
+     * On systems with no reserved physical address bits we can't engage the
+     * fast fault path.
+     */
+    return paddr_bits < PADDR_BITS ? sh_l1e_gnp_raw()
+                                   : shadow_l1e_empty();
+}
+
 static inline bool sh_l1e_is_gnp(shadow_l1e_t sl1e)
 {
-    return sl1e.l1 == sh_l1e_gnp().l1;
+    return sl1e.l1 == sh_l1e_gnp_raw().l1;
 }
 
 /*
@@ -313,9 +324,14 @@ static inline bool sh_l1e_is_gnp(shadow_l1e_t sl1e)
 
 static inline shadow_l1e_t sh_l1e_mmio(gfn_t gfn, u32 gflags)
 {
-    return (shadow_l1e_t) { (SH_L1E_MMIO_MAGIC
-                             | MASK_INSR(gfn_x(gfn), SH_L1E_MMIO_GFN_MASK)
-                             | (gflags & (_PAGE_USER|_PAGE_RW))) };
+    unsigned long gfn_val = MASK_INSR(gfn_x(gfn), SH_L1E_MMIO_GFN_MASK);
+
+    if ( paddr_bits >= PADDR_BITS ||
+         gfn_x(gfn) != MASK_EXTR(gfn_val, SH_L1E_MMIO_GFN_MASK) )
+        return shadow_l1e_empty();
+
+    return (shadow_l1e_t) { (SH_L1E_MMIO_MAGIC | gfn_val |
+                             (gflags & (_PAGE_USER | _PAGE_RW))) };
 }
 
 static inline bool sh_l1e_is_mmio(shadow_l1e_t sl1e)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:00:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:00:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93733.176919 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIAzr-0002xv-Rf; Fri, 05 Mar 2021 14:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93733.176919; Fri, 05 Mar 2021 14: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 1lIAzr-0002xP-OW; Fri, 05 Mar 2021 14:00:03 +0000
Received: by outflank-mailman (input) for mailman id 93733;
 Fri, 05 Mar 2021 14: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 1lIAzq-0002ov-TQ
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14: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 1lIAzq-0007R2-SJ
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIAzq-0004N0-Pf
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14: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=GWyegyEmu5mGtsAVvo08rOTP1z017AXlr5GaR4WIwh0=; b=vXBBN61/1NOxw1GNkRhQ/h+Zms
	JbvlmzkYtEu+MRRpQCv7t2mJRnd5i/p8iGnh6TDGwePHN+7XW35mj6IicMFFX+plO2fyj6Bc0hDzH
	fp2y7gYLaUzMNXEPGAYlHzFbqMgnMIAh2qI4Xf4ww5EzBb1lRvNU32BJ0Ax2Lh/oaMm0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: liveupdate: Properly check long transaction
Message-Id: <E1lIAzq-0004N0-Pf@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:00:02 +0000

commit 5d16679ab0760dbe5e4df52c02f15c69ed5541e6
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Wed Mar 3 17:05:26 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Mar 4 15:36:24 2021 +0000

    tools/xenstored: liveupdate: Properly check long transaction
    
    As XenStored is single-threaded, conn->ta_start_time will always be
    smaller than now. As we substract the latter from the former, it means
    a transaction will never be considered long running.
    
    Invert the two operands of the substraction in both lu_reject_reason()
    and lu_check_allowed(). In addition to that, the former also needs to
    check that conn->ta_start_time is not 0 (i.e the transaction is not
    active).
    
    Take the opportunity to document the return condition of
    lu_check_allowed().
    
    Fixes: e04e53a5be20 ("tools/xenstore: allow live update only with no transaction active")
    Reported-by: Bjoern Doebel <doebel@amazon.de>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/xenstore/xenstored_control.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_control.c
index 766b243839..a1652219b2 100644
--- a/tools/xenstore/xenstored_control.c
+++ b/tools/xenstore/xenstored_control.c
@@ -459,11 +459,18 @@ static bool lu_check_lu_allowed(void)
 	list_for_each_entry(conn, &connections, list) {
 		if (conn->ta_start_time) {
 			ta_total++;
-			if (conn->ta_start_time - now >= lu_status->timeout)
+			if (now - conn->ta_start_time >= lu_status->timeout)
 				ta_long++;
 		}
 	}
 
+	/*
+	 * Allow LiveUpdate if one of the following conditions is met:
+	 *	- There is no active transactions
+	 *	- All transactions are long running (e.g. they have been
+	 *	active for more than lu_status->timeout sec) and the admin as
+	 *	requested to force the operation.
+	 */
 	return ta_total ? (lu_status->force && ta_long == ta_total) : true;
 }
 
@@ -474,11 +481,12 @@ static const char *lu_reject_reason(const void *ctx)
 	time_t now = time(NULL);
 
 	list_for_each_entry(conn, &connections, list) {
-		if (conn->ta_start_time - now >= lu_status->timeout) {
+		if (conn->ta_start_time &&
+		    (now - conn->ta_start_time >= lu_status->timeout)) {
 			ret = talloc_asprintf(ctx, "%s\nDomain %u: %ld s",
 					      ret ? : "Domains with long running transactions:",
 					      conn->id,
-					      conn->ta_start_time - now);
+					      now - conn->ta_start_time);
 		}
 	}
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:00:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:00:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93734.176923 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIB01-0003Ie-Sr; Fri, 05 Mar 2021 14:00:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93734.176923; Fri, 05 Mar 2021 14:00: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 1lIB01-0003IW-Q5; Fri, 05 Mar 2021 14:00:13 +0000
Received: by outflank-mailman (input) for mailman id 93734;
 Fri, 05 Mar 2021 14: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 1lIB01-0003IQ-08
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14: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 1lIB00-0007R5-Vl
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:00:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIB00-0004OS-Ue
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14: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=CebvoBJzYmEOeszAj+1/Re+iXo+tjjqGdoie10hvm78=; b=VTdzFm/KwMlyKgZpqTf0zRpAhA
	d31JNQ5/dIzcL01iYLmJe+9UEuSsjKWEu5y63vOcvvbNVuCBSFn8/ZGr6ZecrFvFxI8O0tDwC8uI7
	PCh7DOoZxGHAGnLOL10/x7DxMPBujVB4QwU+9OXtHtJ6SGHhCQPqP23AyeTXdSdI7kN0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] crypto: adjust rijndaelEncrypt() prototype for gcc11
Message-Id: <E1lIB00-0004OS-Ue@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:00:12 +0000

commit c6ad5a701b9a6df443a6c98d9e7201c958bbcafc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Mar 4 16:47:51 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 4 16:47:51 2021 +0100

    crypto: adjust rijndaelEncrypt() prototype for gcc11
    
    The upcoming release complains, not entirely unreasonably:
    
    In file included from rijndael.c:33:
    .../xen/include/crypto/rijndael.h:55:53: note: previously declared as 'const unsigned char[]'
       55 | void    rijndaelEncrypt(const unsigned int [], int, const unsigned char [],
          |                                                     ^~~~~~~~~~~~~~~~~~~~~~
    rijndael.c:865:8: error: argument 4 of type 'u8[16]' {aka 'unsigned char[16]'} with mismatched bound [-Werror=array-parameter=]
      865 |     u8 ct[16])
          |     ~~~^~~~~~
    In file included from rijndael.c:33:
    .../xen/include/crypto/rijndael.h:56:13: note: previously declared as 'unsigned char[]'
       56 |             unsigned char []);
          |             ^~~~~~~~~~~~~~~~
    
    Simply declare the correct array dimensions right away. This then allows
    compilers to apply checking at call sites, which seems desirable anyway.
    
    For the moment I'm leaving untouched the disagreement between u8/u32
    used in the function definition and unsigned {char,int} used in the
    declaration, as making this consistent would call for touching further
    functions.
    
    Reported-by: Charles Arnold <carnold@suse.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/include/crypto/rijndael.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/crypto/rijndael.h b/xen/include/crypto/rijndael.h
index 69965783c5..4386be5878 100644
--- a/xen/include/crypto/rijndael.h
+++ b/xen/include/crypto/rijndael.h
@@ -52,7 +52,7 @@ void	 rijndael_encrypt(rijndael_ctx *, const unsigned char *, unsigned char *);
 
 int	rijndaelKeySetupEnc(unsigned int [], const unsigned char [], int);
 int	rijndaelKeySetupDec(unsigned int [], const unsigned char [], int);
-void	rijndaelEncrypt(const unsigned int [], int, const unsigned char [],
-	    unsigned char []);
+void	rijndaelEncrypt(const unsigned int [], int, const unsigned char [16],
+	    unsigned char [16]);
 
 #endif /* __RIJNDAEL_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:00:23 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:00:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93735.176926 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIB0B-0003K6-UG; Fri, 05 Mar 2021 14:00:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93735.176926; Fri, 05 Mar 2021 14:00: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 1lIB0B-0003Jy-RU; Fri, 05 Mar 2021 14:00:23 +0000
Received: by outflank-mailman (input) for mailman id 93735;
 Fri, 05 Mar 2021 14: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 1lIB0B-0003Jq-3N
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14: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 1lIB0B-0007RG-2Z
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:00:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIB0B-0004PE-1r
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14: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=BHz82E6WLANSOWBTwMJz2u/POiDRzsDKqhOYnA+gJ/Q=; b=EFqJW2SVSRg0uWSQRZ54wSNT4j
	SmMmz9BZtKh2hrO4Q8FB8ipF4ANFMdFQoxDU2NpJ1m/OR49giFCrlwN71fTKcP4PodK75w+aDV6nJ
	FiYGIDD58wZTE1DI7qx0x/FsxPkfFjKeswKh+r1hAds/UZp7aR4Ebyj0HgEilixjn9BI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] firmware: provide a stand alone set of headers
Message-Id: <E1lIB0B-0004PE-1r@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:00:23 +0000

commit 73b13705af7c3bb8fdf11932eb68788d090a443f
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Thu Mar 4 16:49:00 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 4 16:49:00 2021 +0100

    firmware: provide a stand alone set of headers
    
    The current build of the firmware relies on having 32bit compatible
    headers installed in order to build some of the 32bit firmware.
    Usually this can be solved by using the -ffreestanding compiler option
    which drops the usage of the system headers in favor of a private set
    of freestanding headers provided by the compiler itself that are not
    tied to libc.
    
    However such option is broken at least in the gcc compiler provided in
    Alpine Linux, as the system include path (ie: /usr/include) takes
    precedence over the gcc private include path:
    
    #include <...> search starts here:
     /usr/include
     /usr/lib/gcc/x86_64-alpine-linux-musl/10.2.1/include
    
    And the headers in /usr/include are exclusively 64bit.
    
    Since -ffreestanding is currently broken on at least that distro, and
    for resilience against future compilers also having the option broken
    provide a set of stand alone 32bit headers required for the firmware
    build.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/firmware/Rules.mk                       | 13 +++++++++
 tools/firmware/include/stdarg.h               | 10 +++++++
 tools/firmware/include/stdbool.h              |  9 +++++++
 tools/firmware/include/stddef.h               | 10 +++++++
 tools/firmware/include/stdint.h               | 39 +++++++++++++++++++++++++++
 tools/firmware/rombios/32bit/rombios_compat.h |  4 +--
 6 files changed, 82 insertions(+), 3 deletions(-)

diff --git a/tools/firmware/Rules.mk b/tools/firmware/Rules.mk
index dc372a86d8..9f78a7dec9 100644
--- a/tools/firmware/Rules.mk
+++ b/tools/firmware/Rules.mk
@@ -17,3 +17,16 @@ $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 
 # Extra CFLAGS suitable for an embedded type of environment.
 CFLAGS += -ffreestanding -msoft-float
+
+# Use our own set of stand alone headers to build firmware.
+#
+# Ideally using -ffreestanding should be enough, but that relies on the
+# compiler having the right order for include paths (ie: compiler private
+# headers before system ones) or the libc headers having proper arch-agnostic
+# freestanding support. This is not the case in Alpine at least which searches
+# system headers before compiler ones and has arch-specific libc headers. This
+# has been reported upstream:
+# https://gitlab.alpinelinux.org/alpine/aports/-/issues/12477
+# In the meantime (and for resilience against broken systems) use our own set
+# of headers that provide what's needed for the firmware build.
+CFLAGS += -nostdinc -I$(XEN_ROOT)/tools/firmware/include
diff --git a/tools/firmware/include/stdarg.h b/tools/firmware/include/stdarg.h
new file mode 100644
index 0000000000..c5e3761cd2
--- /dev/null
+++ b/tools/firmware/include/stdarg.h
@@ -0,0 +1,10 @@
+#ifndef _STDARG_H_
+#define _STDARG_H_
+
+typedef __builtin_va_list va_list;
+#define va_copy(dest, src) __builtin_va_copy(dest, src)
+#define va_start(ap, last) __builtin_va_start(ap, last)
+#define va_end(ap) __builtin_va_end(ap)
+#define va_arg __builtin_va_arg
+
+#endif
diff --git a/tools/firmware/include/stdbool.h b/tools/firmware/include/stdbool.h
new file mode 100644
index 0000000000..0cf76b106c
--- /dev/null
+++ b/tools/firmware/include/stdbool.h
@@ -0,0 +1,9 @@
+#ifndef _STDBOOL_H_
+#define _STDBOOL_H_
+
+#define bool _Bool
+#define true 1
+#define false 0
+#define __bool_true_false_are_defined 1
+
+#endif
diff --git a/tools/firmware/include/stddef.h b/tools/firmware/include/stddef.h
new file mode 100644
index 0000000000..c7f974608a
--- /dev/null
+++ b/tools/firmware/include/stddef.h
@@ -0,0 +1,10 @@
+#ifndef _STDDEF_H_
+#define _STDDEF_H_
+
+typedef __SIZE_TYPE__ size_t;
+
+#define NULL ((void*)0)
+
+#define offsetof(t, m) __builtin_offsetof(t, m)
+
+#endif
diff --git a/tools/firmware/include/stdint.h b/tools/firmware/include/stdint.h
new file mode 100644
index 0000000000..16a0b6de19
--- /dev/null
+++ b/tools/firmware/include/stdint.h
@@ -0,0 +1,39 @@
+#ifndef _STDINT_H_
+#define _STDINT_H_
+
+#if defined(__LP64__) || defined(__P64__)
+#error "32bit only header"
+#endif
+
+typedef unsigned char uint8_t;
+typedef signed char int8_t;
+
+typedef unsigned short uint16_t;
+typedef signed short int16_t;
+
+typedef unsigned int uint32_t;
+typedef signed int int32_t;
+
+typedef unsigned long long uint64_t;
+typedef signed long long int64_t;
+
+#define INT8_MIN        (-0x7f-1)
+#define INT16_MIN       (-0x7fff-1)
+#define INT32_MIN       (-0x7fffffff-1)
+#define INT64_MIN       (-0x7fffffffffffffffll-1)
+
+#define INT8_MAX        0x7f
+#define INT16_MAX       0x7fff
+#define INT32_MAX       0x7fffffff
+#define INT64_MAX       0x7fffffffffffffffll
+
+#define UINT8_MAX       0xff
+#define UINT16_MAX      0xffff
+#define UINT32_MAX      0xffffffffu
+#define UINT64_MAX      0xffffffffffffffffull
+
+typedef uint32_t uintptr_t;
+
+#define UINTPTR_MAX     UINT32_MAX
+
+#endif
diff --git a/tools/firmware/rombios/32bit/rombios_compat.h b/tools/firmware/rombios/32bit/rombios_compat.h
index 3fe7d67721..8ba4c17ffd 100644
--- a/tools/firmware/rombios/32bit/rombios_compat.h
+++ b/tools/firmware/rombios/32bit/rombios_compat.h
@@ -8,9 +8,7 @@
 
 #define ADDR_FROM_SEG_OFF(seg, off)  (void *)((((uint32_t)(seg)) << 4) + (off))
 
-typedef unsigned char uint8_t;
-typedef unsigned short int uint16_t;
-typedef unsigned int uint32_t;
+#include <stdint.h>
 
 typedef uint8_t  Bit8u;
 typedef uint16_t Bit16u;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:00:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:00:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93736.176931 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIB0L-0003LW-W8; Fri, 05 Mar 2021 14:00:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93736.176931; Fri, 05 Mar 2021 14: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 1lIB0L-0003LO-T3; Fri, 05 Mar 2021 14:00:33 +0000
Received: by outflank-mailman (input) for mailman id 93736;
 Fri, 05 Mar 2021 14:00: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 1lIB0L-0003LI-88
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:00: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 1lIB0L-0007Rg-7I
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:00:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIB0L-0004Q2-4r
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:00: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=fhqVSuS8hBn/1e692A4RSKXomlGs01nakRfWiNNk1SE=; b=PN4JKhc+1+EuIldixwuDIF0hQs
	YyjhgiDvN7EP5bOCSYUPmvhkw3DMa/Xg/TxY+atDjFakjjDDuk1L/tdpKa6/+nL6q3Vap/WOcSFpX
	MCM46JhP5i7STDJa6L9FOn15AzlYDcGzgYx0dE3dV5a4DkoN697KzZSGlHioZ19aGyWk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/dmop: Fix XEN_DMOP_nr_vcpus to actually return data
Message-Id: <E1lIB0L-0004Q2-4r@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:00:33 +0000

commit 6b0ac9a4e239d00d5e07f0313903b88b08d39452
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Mar 4 10:36:21 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Mar 4 15:54:25 2021 +0000

    xen/dmop: Fix XEN_DMOP_nr_vcpus to actually return data
    
    The const_op boolean needs clobbering to cause data to be written back to the
    caller.
    
    Fixes: c4441ab1f1 ("dmop: Add XEN_DMOP_nr_vcpus")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/arch/arm/dm.c     | 1 +
 xen/arch/x86/hvm/dm.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/xen/arch/arm/dm.c b/xen/arch/arm/dm.c
index d689e336fd..1b3fd6bc7d 100644
--- a/xen/arch/arm/dm.c
+++ b/xen/arch/arm/dm.c
@@ -128,6 +128,7 @@ int dm_op(const struct dmop_args *op_args)
         struct xen_dm_op_nr_vcpus *data = &op.u.nr_vcpus;
 
         data->vcpus = d->max_vcpus;
+        const_op = false;
         rc = 0;
         break;
     }
diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c
index f4f0910463..b60b9f3364 100644
--- a/xen/arch/x86/hvm/dm.c
+++ b/xen/arch/x86/hvm/dm.c
@@ -612,6 +612,7 @@ int dm_op(const struct dmop_args *op_args)
         struct xen_dm_op_nr_vcpus *data = &op.u.nr_vcpus;
 
         data->vcpus = d->max_vcpus;
+        const_op = false;
         rc = 0;
         break;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:00:44 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:00:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93737.176936 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIB0W-0003N8-2R; Fri, 05 Mar 2021 14:00:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93737.176936; Fri, 05 Mar 2021 14:00: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 1lIB0V-0003Mz-Uv; Fri, 05 Mar 2021 14:00:43 +0000
Received: by outflank-mailman (input) for mailman id 93737;
 Fri, 05 Mar 2021 14:00: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 1lIB0V-0003Mr-BT
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:00: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 1lIB0V-0007Rq-AQ
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:00:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIB0V-0004Qn-9S
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:00:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OuVptFzX6ZERvtGQixHLdSJa9Wn3ltniHVdF5mNg+0c=; b=uV/fRCtrZ7nmz429u3ghBKeijl
	fA2RssBoPTV9HZSfzxEAUVrJNQgs15Lq911k1H56DBm98MhW1+vqmZtlq38urfpvgzjw1o2eKHhkG
	+5SD8NWFe///JBVW2JOD4e/pUip/hYRdUT5317SYAJvc/4kObHnVQVOfdoexT3GT8NR0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxendevicemodel: Strip __XEN_TOOLS__ header guard
Message-Id: <E1lIB0V-0004Qn-9S@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:00:43 +0000

commit f40e1c52e4e0a3e084b025ed6b68f1e6ebaea027
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Mar 4 12:44:44 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Mar 4 15:54:25 2021 +0000

    tools/libxendevicemodel: Strip __XEN_TOOLS__ header guard
    
    This is inappropriate for the header file of a standalone library with stable
    API and ABI.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/include/xendevicemodel.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/tools/include/xendevicemodel.h b/tools/include/xendevicemodel.h
index 33698d67f3..797e0c6b29 100644
--- a/tools/include/xendevicemodel.h
+++ b/tools/include/xendevicemodel.h
@@ -17,8 +17,6 @@
 #ifndef XENDEVICEMODEL_H
 #define XENDEVICEMODEL_H
 
-#ifdef __XEN_TOOLS__
-
 #include <stdint.h>
 
 #include <xen/xen.h>
@@ -377,8 +375,6 @@ int xendevicemodel_nr_vcpus(
  */
 int xendevicemodel_restrict(xendevicemodel_handle *dmod, domid_t domid);
 
-#endif /* __XEN_TOOLS__ */
-
 #endif /* XENDEVICEMODEL_H */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:44:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:44:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93774.177038 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBgU-00087w-Df; Fri, 05 Mar 2021 14:44:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93774.177038; Fri, 05 Mar 2021 14:44: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 1lIBgU-00087o-Am; Fri, 05 Mar 2021 14:44:06 +0000
Received: by outflank-mailman (input) for mailman id 93774;
 Fri, 05 Mar 2021 14:44: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 1lIBgT-00087j-Dd
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:44: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 1lIBgT-0008CM-BG
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:44:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBgT-000894-8e
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:44:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0G1hbCZ0vvlqq7dxBFtijBbqd24vXyw7cQVXrCKgjpo=; b=w3zlv7icb8Tw/rdiujjbH+XCDU
	W6L1RnqWNcS9l4fj4XNEE6LzkWXlGC6ps4Y1Vdyp4cMA/inMlWOzfxMVuoqpHVHWvCzXbr2uFnfnl
	aUTWcBF4c2ZjOqTJ1LJxqu4I9i4loijuxdRqGxMmmOtEYAQKu5u0bUz3OD++wBp2EWI8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/vioapic: check IRR before attempting to inject interrupt after EOI
Message-Id: <E1lIBgT-000894-8e@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:44:05 +0000

commit 761995ee29ac7c43d88a5e853f0a75a653b23b11
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Mar 5 15:26:05 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:26:05 2021 +0100

    x86/vioapic: check IRR before attempting to inject interrupt after EOI
    
    In vioapic_update_EOI the irq_lock will be dropped in order to forward
    the EOI to the dpci handler, so there's a window between clearing IRR
    and checking if the line is asserted where IRR can change behind our
    back.
    
    Fix this by checking whether IRR is set before attempting to inject a
    new interrupt.
    
    Fixes: 06e3f8f2766 ('vt-d: Do dpci eoi outside of irq_lock.')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: ba584fb1a26c058ebd0e6a2779287b3e4400415c
    master date: 2021-01-22 12:13:05 +0100
---
 xen/arch/x86/hvm/vioapic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index abb27a5704..99e137df33 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -544,7 +544,7 @@ void vioapic_update_EOI(struct domain *d, u8 vector)
             }
 
             if ( (ent->fields.trig_mode == VIOAPIC_LEVEL_TRIG) &&
-                 !ent->fields.mask &&
+                 !ent->fields.mask && !ent->fields.remote_irr &&
                  hvm_irq->gsi_assert_count[vioapic->base_gsi + pin] )
             {
                 ent->fields.remote_irr = 1;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:44:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:44:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93775.177042 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBge-000893-GT; Fri, 05 Mar 2021 14:44:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93775.177042; Fri, 05 Mar 2021 14:44: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 1lIBge-00088v-Da; Fri, 05 Mar 2021 14:44:16 +0000
Received: by outflank-mailman (input) for mailman id 93775;
 Fri, 05 Mar 2021 14:44: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 1lIBgd-00088p-Lt
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:44: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 1lIBgd-0008CP-Jd
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:44:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBgd-0008AW-DY
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:44:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qGPYA5JLSuyaxe1rpTcJZ57WAKuwGyUxPADXPkgrlhI=; b=SmJRmnZbQwyhRY3UeBbsg6p4AD
	UdTkZ31AL6v3I2afznF6r7QkGGD+CSwBU4t21xgROO5vNwGdhkPaIJ0Ka1PH1SY1upBTiXnDfI2AA
	Jdk3uwzZpRLAyuzQzZB9e/LqtOSUgjfVILVpE5cqDFBC+RqyVAz665duxiCqguWPibQg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] xen/include: compat/xlat.h may change with .config changes
Message-Id: <E1lIBgd-0008AW-DY@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:44:15 +0000

commit a473bdd81bc109b104a451c71f9402150796a1ff
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:26:51 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:26:51 2021 +0100

    xen/include: compat/xlat.h may change with .config changes
    
    $(xlat-y) getting derived from $(headers-y) means its contents may
    change with changes to .config. The individual files $(xlat-y) refers
    to, otoh, may not change, and hence not trigger rebuilding of xlat.h.
    (Note that the issue was already present before the commit referred to
    below, but it was far more limited in affecting only changes to
    CONFIG_XSM_FLASK.)
    
    Fixes: 2c8fabb2232d ("x86: only generate compat headers actually needed")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c7b0f25e8f86373ed54e1c446f8e67ce25ac6819
    master date: 2021-01-26 14:42:23 +0100
---
 xen/include/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/Makefile b/xen/include/Makefile
index 089314dc72..687aa130d8 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -89,7 +89,7 @@ compat/.xlat/%.lst: xlat.lst Makefile
 xlat-y := $(shell sed -ne 's,@arch@,$(compat-arch-y),g' -re 's,^[?!][[:blank:]]+[^[:blank:]]+[[:blank:]]+,,p' xlat.lst | uniq)
 xlat-y := $(filter $(patsubst compat/%,%,$(headers-y)),$(xlat-y))
 
-compat/xlat.h: $(addprefix compat/.xlat/,$(xlat-y)) Makefile
+compat/xlat.h: $(addprefix compat/.xlat/,$(xlat-y)) config/auto.conf Makefile
 	cat $(filter %.h,$^) >$@.new
 	mv -f $@.new $@
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:44:26 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:44:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93776.177046 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBgo-0008AS-I5; Fri, 05 Mar 2021 14:44:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93776.177046; Fri, 05 Mar 2021 14:44: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 1lIBgo-0008AJ-FA; Fri, 05 Mar 2021 14:44:26 +0000
Received: by outflank-mailman (input) for mailman id 93776;
 Fri, 05 Mar 2021 14:44: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 1lIBgn-0008AE-QF
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:44: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 1lIBgn-0008Ce-OV
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:44:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBgn-0008B8-Lx
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:44:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=V5CltYoPLupdPZuF3kjRhQ2vDMf56UwT2uYSoB7R+e4=; b=t16H7k/kjswtLnFXRPUngPMnbo
	8DcOKmJJae2Omjw/uKzR4Kw16uSkgU/ja+AjuocxpZkZF2nMrAJyHUqPXzNHlMPJBKeJ7S9NIaoq0
	SOeLTG33lSEFkcRSMSZVyVbhYmw5FqbmqfaA6S+66i4qe/brfjLndnV/EO9LqQEl2Be0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/timer: Fix boot on Intel systems using ITSSPRC static PIT clock gating
Message-Id: <E1lIBgn-0008B8-Lx@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:44:25 +0000

commit f6f787de989655747795e216a7ca5d16e8cd7609
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 5 15:27:22 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:27:22 2021 +0100

    x86/timer: Fix boot on Intel systems using ITSSPRC static PIT clock gating
    
    Recent Intel client devices have disabled the legacy PIT for powersaving
    reasons, breaking compatibility with a traditional IBM PC.  Xen depends on a
    legacy timer interrupt to check that the IO-APIC/PIC routing is configured
    correctly, and fails to boot with:
    
      (XEN) *******************************
      (XEN) Panic on CPU 0:
      (XEN) IO-APIC + timer doesn't work!  Boot with apic_verbosity=debug and send report.  Then try booting with the `noapic` option
      (XEN) *******************************
    
    While this setting can be undone by Xen, the details of how to differ by
    chipset, and would be very short sighted for battery based devices.  See bit 2
    "8254 Static Clock Gating Enable" in:
    
      https://edc.intel.com/content/www/us/en/design/products-and-solutions/processors-and-chipsets/comet-lake-u/intel-400-series-chipset-on-package-platform-controller-hub-register-database/itss-power-reduction-control-itssprc-offset-3300/
    
    All impacted systems have an HPET, but there is no indication of the absence
    of PIT functionality, nor a suitable way to probe for its absence.  As a short
    term fix, reconfigure the HPET into legacy replacement mode.  A better
    longterm fix would be to avoid the reliance on the timer interrupt entirely.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: e1de4c196a2eb4fd5063c30a2e115adf144bdeef
    master date: 2021-01-27 19:15:19 +0000
---
 xen/arch/x86/hpet.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 66 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index f4951d7a20..59ad71592c 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -768,7 +768,7 @@ static u32 *hpet_boot_cfg;
 u64 __init hpet_setup(void)
 {
     static u64 __initdata hpet_rate;
-    u32 hpet_id, hpet_period;
+    unsigned int hpet_id, hpet_period, hpet_cfg;
     unsigned int last, rem;
 
     if ( hpet_rate )
@@ -803,6 +803,71 @@ u64 __init hpet_setup(void)
     if ( (rem * 2) > hpet_period )
         hpet_rate++;
 
+    /*
+     * Intel chipsets from Skylake/ApolloLake onwards can statically clock
+     * gate the 8259 PIT.  This option is enabled by default in slightly later
+     * systems, as turning the PIT off is a prerequisite to entering the C11
+     * power saving state.
+     *
+     * Xen currently depends on the legacy timer interrupt being active while
+     * IRQ routing is configured.
+     *
+     * Reconfigure the HPET into legacy mode to re-establish the timer
+     * interrupt.
+     */
+    if ( hpet_id & HPET_ID_LEGSUP &&
+         !((hpet_cfg = hpet_read32(HPET_CFG)) & HPET_CFG_LEGACY) )
+    {
+        unsigned int c0_cfg, ticks, count;
+
+        /* Stop the main counter. */
+        hpet_write32(hpet_cfg & ~HPET_CFG_ENABLE, HPET_CFG);
+
+        /* Reconfigure channel 0 to be 32bit periodic. */
+        c0_cfg = hpet_read32(HPET_Tn_CFG(0));
+        c0_cfg |= (HPET_TN_ENABLE | HPET_TN_PERIODIC | HPET_TN_SETVAL |
+                   HPET_TN_32BIT);
+        hpet_write32(c0_cfg, HPET_Tn_CFG(0));
+
+        /*
+         * The exact period doesn't have to match a legacy PIT.  All we need
+         * is an interrupt queued up via the IO-APIC to check routing.
+         *
+         * Use HZ as the frequency.
+         */
+        ticks = ((SECONDS(1) / HZ) * div_sc(hpet_rate, SECONDS(1), 32)) >> 32;
+
+        count = hpet_read32(HPET_COUNTER);
+
+        /*
+         * HPET_TN_SETVAL above is atrociously documented in the spec.
+         *
+         * Periodic HPET channels have a main comparator register, and
+         * separate "accumulator" register.  Despite being named accumulator
+         * in the spec, this is not an accurate description of its behaviour
+         * or purpose.
+         *
+         * Each time an interrupt is generated, the "accumulator" register is
+         * re-added to the comparator set up the new period.
+         *
+         * Normally, writes to the CMP register update both registers.
+         * However, under these semantics, it is impossible to set up a
+         * periodic timer correctly without the main HPET counter being at 0.
+         *
+         * Instead, HPET_TN_SETVAL is a self-clearing control bit which we can
+         * use for periodic timers to mean that the second write to CMP
+         * updates the accumulator only, and not the absolute comparator
+         * value.
+         *
+         * This lets us set a period when the main counter isn't at 0.
+         */
+        hpet_write32(count + ticks, HPET_Tn_CMP(0));
+        hpet_write32(ticks,         HPET_Tn_CMP(0));
+
+        /* Restart the main counter, and legacy mode. */
+        hpet_write32(hpet_cfg | HPET_CFG_ENABLE | HPET_CFG_LEGACY, HPET_CFG);
+    }
+
     return hpet_rate;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:44:37 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:44:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93777.177049 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBgz-0008Bt-Jl; Fri, 05 Mar 2021 14:44:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93777.177049; Fri, 05 Mar 2021 14:44: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 1lIBgz-0008Bl-Gf; Fri, 05 Mar 2021 14:44:37 +0000
Received: by outflank-mailman (input) for mailman id 93777;
 Fri, 05 Mar 2021 14:44: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 1lIBgx-0008BW-Vx
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:44: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 1lIBgx-0008DC-Tf
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:44:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBgx-0008Bw-Qm
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:44:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+cbK/T2SAqXMRSnCrOUJ/XcLbkLgDXBc42BAmagBgJ4=; b=mORyEyX7KZvTw5hlBXp41fwhc6
	dyPB8bYlEogYxyJ53u7xD8QtWrNl4faWZku0J3F7DatdVfLiltQCAMgkmgPYwVeUDT7DY4UlCPa9q
	74Ih8dOQLXgR/UbYv1MhWCTMQJ90s7L/7NXWTZXokzD93rmJmN9kqkstideb+0YdMc4g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] memory: bail from page scrubbing when CPU is no longer online
Message-Id: <E1lIBgx-0008Bw-Qm@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:44:35 +0000

commit 17810630a023631c7baa7b45ba2cde006304d694
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:28:30 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:28:30 2021 +0100

    memory: bail from page scrubbing when CPU is no longer online
    
    Scrubbing can significantly delay the offlining (parking) of a CPU (e.g.
    because of booting into in smt=0 mode), to a degree that the "CPU <n>
    still not dead..." messages logged on x86 in 1s intervals can be seen
    multiple times. There are no softirqs involved in this process, so
    extend the existing preemption check in the scrubbing logic to also exit
    when the CPU is no longer observed online.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 3c9fd69416f8ffc611705fb24dfb383203ddc84f
    master date: 2021-01-29 11:34:37 +0100
---
 xen/common/page_alloc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index d9578abb7c..8859fa4fd1 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1328,9 +1328,11 @@ bool scrub_free_pages(void)
                      * Scrub a few (8) pages before becoming eligible for
                      * preemption. But also count non-scrubbing loop iterations
                      * so that we don't get stuck here with an almost clean
-                     * heap.
+                     * heap. Consider the CPU no longer being seen as online as
+                     * a request to preempt immediately, to not unduly delay
+                     * its offlining.
                      */
-                    if ( cnt > 800 && softirq_pending(cpu) )
+                    if ( !cpu_online(cpu) || (cnt > 800 && softirq_pending(cpu)) )
                     {
                         preempt = true;
                         break;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:44:47 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:44:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93778.177054 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBh9-0008DF-L6; Fri, 05 Mar 2021 14:44:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93778.177054; Fri, 05 Mar 2021 14:44: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 1lIBh9-0008D7-IB; Fri, 05 Mar 2021 14:44:47 +0000
Received: by outflank-mailman (input) for mailman id 93778;
 Fri, 05 Mar 2021 14:44: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 1lIBh8-0008Cv-1Q
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:44: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 1lIBh8-0008DL-0a
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:44:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBh7-0008DE-Vz
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:44:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JAZRAmzeFU/xn9BW5mbi1RQJT8aR0dUrYLElyt6oDkI=; b=wL2ooPsz6FIRSYB6s4LepIk2F/
	u9zunp4VlXzL4c3nhvI7G/wSo6YERC4K3D0czX4WfAV6U778afnveyksqY6ITW1SBJJxcklSYAZSB
	XATZOpmCEgpqeMr3T/4xgkxxWT6YN7QAsYa6oIhr+0IH1hg9oQS5W/cP1Zsg4t2tCoqg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/HVM: re-order error path of hvm_domain_initialise()
Message-Id: <E1lIBh7-0008DE-Vz@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:44:45 +0000

commit 3d09a43f75a7ad0d24b460d9ba6130da637ffeed
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:28:57 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:28:57 2021 +0100

    x86/HVM: re-order error path of hvm_domain_initialise()
    
    hvm_destroy_all_ioreq_servers(), called from
    hvm_domain_relinquish_resources(), invokes relocate_portio_handler(),
    which uses d->arch.hvm.io_handler. Defer freeing of this array
    accordingly on the error path of hvm_domain_initialise().
    
    Similarly rtc_deinit() requires d->arch.hvm.pl_time to still be around,
    or else an armed timer structure would get freed, and that timer never
    get killed.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: fbb3bf002b42803ef289ea2a649ebd5f25d22236
    master date: 2021-01-29 11:36:54 +0100
---
 xen/arch/x86/hvm/hvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 3001e7442b..ab45b0a588 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -714,15 +714,15 @@ int hvm_domain_initialise(struct domain *d)
  fail1:
     if ( is_hardware_domain(d) )
         xfree(d->arch.hvm.io_bitmap);
-    XFREE(d->arch.hvm.io_handler);
     XFREE(d->arch.hvm.params);
-    XFREE(d->arch.hvm.pl_time);
     XFREE(d->arch.hvm.irq);
  fail0:
     hvm_destroy_cacheattr_region_list(d);
     destroy_perdomain_mapping(d, PERDOMAIN_VIRT_START, 0);
  fail:
     hvm_domain_relinquish_resources(d);
+    XFREE(d->arch.hvm.io_handler);
+    XFREE(d->arch.hvm.pl_time);
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:44:57 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:44:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93779.177057 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBhJ-0008EZ-Mb; Fri, 05 Mar 2021 14:44:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93779.177057; Fri, 05 Mar 2021 14:44: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 1lIBhJ-0008ET-Jn; Fri, 05 Mar 2021 14:44:57 +0000
Received: by outflank-mailman (input) for mailman id 93779;
 Fri, 05 Mar 2021 14:44: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 1lIBhI-0008EG-4l
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:44: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 1lIBhI-0008DU-41
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:44:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBhI-0008Dr-2e
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:44:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Bs5PhoBXqaiO489yezpob0n5u6qBvhzQT543BJiNYcA=; b=uwIrIk0+P6+nFfuK9+WiuFNufM
	r41KkPuPb+Q0PSkTEqoMjFPOnUQXZn19cy6zbbcj2lfg4Md/dbab54sL/kddhOrJ6+Q7vQlFaloel
	22e9siVLZqqMaC8VKBYgeLtsppkiDTPPtlbXKtcxjIzK5FFXC1TMZQUPBNLyPTTJI/qM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/debug: fix page-overflow bug in dbg_rw_guest_mem
Message-Id: <E1lIBhI-0008Dr-2e@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:44:56 +0000

commit ec003beb5c94fc9918ac1cc87fcccf3892c237e2
Author:     Tamas K Lengyel <tamas@tklengyel.com>
AuthorDate: Fri Mar 5 15:29:31 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:29:31 2021 +0100

    x86/debug: fix page-overflow bug in dbg_rw_guest_mem
    
    When using gdbsx dbg_rw_guest_mem is used to read/write guest memory. When the
    buffer being accessed is on a page-boundary, the next page needs to be grabbed
    to access the correct memory for the buffer's overflown parts. While
    dbg_rw_guest_mem has logic to handle that, it broke with 229492e210a. Instead
    of grabbing the next page the code right now is looping back to the
    start of the first page. This results in errors like the following while trying
    to use gdb with Linux' lx-dmesg:
    
    [    0.114457] PM: hibernation: Registered nosave memory: [mem
    0xfdfff000-0xffffffff]
    [    0.114460] [mem 0x90000000-0xfbffffff] available for PCI demem 0
    [    0.114462] f]f]
    Python Exception <class 'ValueError'> embedded null character:
    Error occurred in Python: embedded null character
    
    Fixing this bug by taking the variable assignment outside the loop.
    
    Fixes: 229492e210a ("x86/debugger: use copy_to/from_guest() in dbg_rw_guest_mem()")
    Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 9dc687f155a57216b83b17f9cde55dd43e06b0cd
    master date: 2021-01-30 03:21:33 +0000
---
 xen/arch/x86/debug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/debug.c b/xen/arch/x86/debug.c
index 5d8acdad71..491033f356 100644
--- a/xen/arch/x86/debug.c
+++ b/xen/arch/x86/debug.c
@@ -112,10 +112,11 @@ static unsigned int dbg_rw_guest_mem(struct domain *dp, void * __user gaddr,
                                      void * __user buf, unsigned int len,
                                      bool toaddr, uint64_t pgd3)
 {
+    unsigned long addr = (unsigned long)gaddr;
+
     while ( len > 0 )
     {
         char *va;
-        unsigned long addr = (unsigned long)gaddr;
         mfn_t mfn;
         gfn_t gfn = INVALID_GFN;
         unsigned long pagecnt;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:45:07 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:45:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93780.177062 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBhT-0008Fu-O6; Fri, 05 Mar 2021 14:45:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93780.177062; Fri, 05 Mar 2021 14:45: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 1lIBhT-0008Fm-LG; Fri, 05 Mar 2021 14:45:07 +0000
Received: by outflank-mailman (input) for mailman id 93780;
 Fri, 05 Mar 2021 14:45: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 1lIBhS-0008Fc-7l
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:45: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 1lIBhS-0008E1-74
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:45:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBhS-0008FG-6C
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:45:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LRUx+ij8omaDiQk27HSU12crUSbI7BBU9bXVCgLIAV0=; b=ZNWAUA+pPAOG3vTc89uQgdOGp1
	1iGM9IOzsN0uy2Dsqj9vlR5hdHy2Elbgr5u9F7f8C7GLu8S+nDwcHKC4URUxtU7qoOca9nEKtoOd5
	Ep0N6OXgdvX1U5fnj70RFSjNDIu5Ms4mAS75nNB2j2MqmXJFIKiysVvc6gTzJ6Gs9HRk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/string: correct memmove()'s forwarding to memcpy()
Message-Id: <E1lIBhS-0008FG-6C@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:45:06 +0000

commit 72fc75d707ed1ab4b12189aacfcc237f8578590d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:29:52 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:29:52 2021 +0100

    x86/string: correct memmove()'s forwarding to memcpy()
    
    With memcpy() expanding to the compiler builtin, we may not hand it
    overlapping source and destination. We strictly mean to forward to our
    own implementation (a few lines up in the same source file).
    
    Fixes: 78825e1c60fa ("x86/string: Clean up x86/string.h")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 7b93d92a35dc7c0a6e5f1f79b3c887aa3e66ddc0
    master date: 2021-02-04 13:59:56 +0100
---
 xen/arch/x86/string.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/string.c b/xen/arch/x86/string.c
index e2f84638c4..bda24b14ac 100644
--- a/xen/arch/x86/string.c
+++ b/xen/arch/x86/string.c
@@ -43,7 +43,8 @@ void *(memmove)(void *dest, const void *src, size_t n)
         return dest;
 
     if ( dest < src )
-        return memcpy(dest, src, n);
+        /* Depends on Xen's implementation operating forwards. */
+        return (memcpy)(dest, src, n);
 
     asm volatile (
         "   std         ; "
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:45:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:45:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93781.177066 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBhd-0008HD-Py; Fri, 05 Mar 2021 14:45:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93781.177066; Fri, 05 Mar 2021 14:45: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 1lIBhd-0008H5-Mg; Fri, 05 Mar 2021 14:45:17 +0000
Received: by outflank-mailman (input) for mailman id 93781;
 Fri, 05 Mar 2021 14:45: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 1lIBhc-0008Gw-Ar
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:45: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 1lIBhc-0008E9-A5
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:45:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBhc-0008Fu-9F
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:45: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=gT1HJI6nGs3y5KS5xgIHlahHm0qm0usVDOFUh4wTzD0=; b=3sbSMoiBUcHphgPyeLBBQR0nWc
	UypM/w87C8u1zBIUIDOh2plS7oXAuSUHjplupkCLR0c57KC6Nacva/XynxmOgO1xuv1yfOJNEhk+B
	mDym+MlOa0yRdW4pV72tepXcPPXyUDCKdnGGtcQpNutPZGYxVGi9UaE3/5c7va+k+omA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/efi: enable MS ABI attribute on clang
Message-Id: <E1lIBhc-0008Fu-9F@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:45:16 +0000

commit c354bd746877591ad16ed80077ee367c9c98fa48
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Mar 5 15:30:23 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:30:23 2021 +0100

    x86/efi: enable MS ABI attribute on clang
    
    Or else the EFI service calls will use the wrong calling convention.
    
    The __ms_abi__ attribute is available on all supported versions of
    clang. Add a specific Clang check because the GCC version reported by
    Clang is below the required 4.4 to use the __ms_abi__ attribute.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    master commit: 92f5ffa58d188c9f9a9f1bcdccb6d6348d9df612
    master date: 2021-02-04 14:02:32 +0100
---
 xen/include/asm-x86/x86_64/efibind.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/asm-x86/x86_64/efibind.h b/xen/include/asm-x86/x86_64/efibind.h
index b013db175d..ddcfae07ec 100644
--- a/xen/include/asm-x86/x86_64/efibind.h
+++ b/xen/include/asm-x86/x86_64/efibind.h
@@ -172,7 +172,7 @@ typedef uint64_t   UINTN;
 #ifndef EFIAPI                  // Forces EFI calling conventions reguardless of compiler options
     #ifdef _MSC_EXTENSIONS
         #define EFIAPI __cdecl  // Force C calling convention for Microsoft C compiler
-    #elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+    #elif __clang__ || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
         #define EFIAPI __attribute__((__ms_abi__))  // Force Microsoft ABI
     #else
         #define EFIAPI          // Substitute expresion to force C calling convention
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:45:27 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:45:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93782.177070 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBhn-0008Ih-T9; Fri, 05 Mar 2021 14:45:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93782.177070; Fri, 05 Mar 2021 14:45: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 1lIBhn-0008IY-Pr; Fri, 05 Mar 2021 14:45:27 +0000
Received: by outflank-mailman (input) for mailman id 93782;
 Fri, 05 Mar 2021 14:45: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 1lIBhm-0008IQ-EH
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:45: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 1lIBhm-0008EH-DZ
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:45:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBhm-0008Ge-CW
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:45: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=HoWsISdsVPVnBDjYP00Kbo6rwyK9Adh9JjL4nx+isdI=; b=Cs9PqQhmRAJOzZlTdat/XHhjtH
	6BnQSDqm7E6U77IcrGniFAuVY1sbhQRrtBloMWmSEaQGUO0QbHmbEtiOVnnF1uE2Xbbe86Vo+uG9V
	m5VRUeujtiY/qMoOtpBh9nQ/MNhPzP1IhSiW4zlAhydI2Tf5jApiXQ1X6xKw6/V1y93o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/EFI: work around GNU ld 2.36 issue
Message-Id: <E1lIBhm-0008Ge-CW@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:45:26 +0000

commit 73a269624b5b6625344af97269f480c4ff426508
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:31:12 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:31:12 2021 +0100

    x86/EFI: work around GNU ld 2.36 issue
    
    Our linker capability check fails with the recent binutils release's ld:
    
    .../check.o:(.debug_aranges+0x6): relocation truncated to fit: R_X86_64_32 against `.debug_info'
    .../check.o:(.debug_info+0x6): relocation truncated to fit: R_X86_64_32 against `.debug_abbrev'
    .../check.o:(.debug_info+0xc): relocation truncated to fit: R_X86_64_32 against `.debug_str'+76
    .../check.o:(.debug_info+0x11): relocation truncated to fit: R_X86_64_32 against `.debug_str'+d
    .../check.o:(.debug_info+0x15): relocation truncated to fit: R_X86_64_32 against `.debug_str'+2b
    .../check.o:(.debug_info+0x29): relocation truncated to fit: R_X86_64_32 against `.debug_line'
    .../check.o:(.debug_info+0x30): relocation truncated to fit: R_X86_64_32 against `.debug_str'+19
    .../check.o:(.debug_info+0x37): relocation truncated to fit: R_X86_64_32 against `.debug_str'+71
    .../check.o:(.debug_info+0x3e): relocation truncated to fit: R_X86_64_32 against `.debug_str'
    .../check.o:(.debug_info+0x45): relocation truncated to fit: R_X86_64_32 against `.debug_str'+5e
    .../check.o:(.debug_info+0x4c): additional relocation overflows omitted from the output
    
    Tell the linker to strip debug info as a workaround. Debug info has been
    getting stripped already anyway when linking the actual xen.efi.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: f4318db940c39cc656128fcf72df3e79d2e55bc1
    master date: 2021-02-05 14:09:42 +0100
---
 xen/arch/x86/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 26ff2a9a3e..7216bd7b68 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -176,7 +176,7 @@ EFI_LDFLAGS += --major-subsystem-version=2 --minor-subsystem-version=0
 # Check if the compiler supports the MS ABI.
 export XEN_BUILD_EFI := $(shell $(CC) $(XEN_CFLAGS) -c efi/check.c -o efi/check.o 2>/dev/null && echo y)
 # Check if the linker supports PE.
-XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) -mi386pep --subsystem=10 -o efi/check.efi efi/check.o 2>/dev/null && echo y))
+XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) -mi386pep --subsystem=10 -S -o efi/check.efi efi/check.o 2>/dev/null && echo y))
 CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
 
 $(TARGET).efi: VIRT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A VIRT_START$$,,p')
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:45:37 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:45:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93783.177074 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBhx-0008Jv-UM; Fri, 05 Mar 2021 14:45:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93783.177074; Fri, 05 Mar 2021 14:45: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 1lIBhx-0008Jm-RO; Fri, 05 Mar 2021 14:45:37 +0000
Received: by outflank-mailman (input) for mailman id 93783;
 Fri, 05 Mar 2021 14:45: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 1lIBhw-0008Jf-HM
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:45: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 1lIBhw-0008Ef-Gj
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:45:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBhw-0008HE-Fp
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:45:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Gj3V4dgTN9245hNbYMH/adIjYlctOk440FVQxE/Am4A=; b=aq9rEM8L9ENO6W9Ttcw3DSoWvk
	d2PmuON88BVjYOiV5S6bVqA93udtd7JL3gZ1gczeQmnFqdma3JdMCk3nvt7kLirYjUEW7e+wTFpGa
	EgSNrnkycVc0FzP/vZ/0OcuSDOJqVvPpGsA54SLEZnJOVGYfpcAtTx/QL5DjW17E/VGM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/ucode/amd: Fix OoB read in cpu_request_microcode()
Message-Id: <E1lIBhw-0008HE-Fp@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:45:36 +0000

commit daa4149647e1ba5ea22de346e1894ae793a17500
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 5 15:31:50 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:31:50 2021 +0100

    x86/ucode/amd: Fix OoB read in cpu_request_microcode()
    
    verify_patch_size() is a maximum size check, and doesn't have a minimum bound.
    
    If the microcode container encodes a blob with a length less than 64 bytes,
    the subsequent calls to microcode_fits()/compare_header() may read off the end
    of the buffer.
    
    Fixes: 4de936a38a ("x86/ucode/amd: Rework parsing logic in cpu_request_microcode()")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1cbc4d89c45cba3929f1c0cb4bca0b000c4f174b
    master date: 2021-02-10 13:23:51 +0000
---
 xen/arch/x86/cpu/microcode/amd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index cd532321e8..5b45530d93 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -346,6 +346,7 @@ static struct microcode_patch *cpu_request_microcode(const void *buf, size_t siz
             if ( size < sizeof(*mc) ||
                  (mc = buf)->type != UCODE_UCODE_TYPE ||
                  size - sizeof(*mc) < mc->len ||
+                 mc->len < sizeof(struct microcode_patch) ||
                  (!skip_ucode && !verify_patch_size(mc->len)) )
             {
                 printk(XENLOG_ERR "microcode: Bad microcode data\n");
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:45:48 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:45:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93784.177078 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBi7-0008LZ-Vm; Fri, 05 Mar 2021 14:45:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93784.177078; Fri, 05 Mar 2021 14:45: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 1lIBi7-0008LR-Sy; Fri, 05 Mar 2021 14:45:47 +0000
Received: by outflank-mailman (input) for mailman id 93784;
 Fri, 05 Mar 2021 14:45: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 1lIBi6-0008LE-Lo
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:45: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 1lIBi6-0008En-Kx
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:45:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBi6-0008IZ-JV
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:45:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zYY65TvxBxEW5KevHJSI4j1FsEu8oD0Fu/zcnRHtfkk=; b=r9y5meUQNjOu7TWGstwd3tBNSk
	AgSbaiJFcrp00Z+Il1A0wHgZgvOHlJcEStzpKxAQjFhS4RpcqDRXLvMFlzWdEWtaDn7UdB0LpSx09
	l2rqKdf3XwSnSp3YkGbBLcKbFRzv02GGFdHlqrqPS2jafMXw6OWmOJ1Cut5ST5jj4nVs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86emul: fix SYSENTER/SYSCALL switching into 64-bit mode
Message-Id: <E1lIBi6-0008IZ-JV@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:45:46 +0000

commit 865eba02a1ec10972edbeb403b492e45e391f509
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:32:24 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:32:24 2021 +0100

    x86emul: fix SYSENTER/SYSCALL switching into 64-bit mode
    
    When invoked by compat mode, mode_64bit() will be false at the start of
    emulation. The logic after complete_insn, however, needs to consider the
    mode switched into, in particular to avoid truncating RIP.
    
    Inspired by / paralleling and extending Linux commit 943dea8af21b ("KVM:
    x86: Update emulator context mode if SYSENTER xfers to 64-bit mode").
    
    While there, tighten a related assertion in x86_emulate_wrapper() - we
    want to be sure to not switch into an impossible mode when the code gets
    built for 32-bit only (as is possible for the test harness).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citirix.com>
    master commit: f3e1eb2f0234c955243a915d69ebd84f26eec130
    master date: 2021-02-11 17:53:10 +0100
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 9b29548e2d..8ef66d824d 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -6124,6 +6124,10 @@ x86_emulate(
              (rc = ops->write_segment(x86_seg_ss, &sreg, ctxt)) )
             goto done;
 
+        if ( ctxt->lma )
+            /* In particular mode_64bit() needs to return true from here on. */
+            ctxt->addr_size = ctxt->sp_size = 64;
+
         /*
          * SYSCALL (unlike most instructions) evaluates its singlestep action
          * based on the resulting EFLAGS.TF, not the starting EFLAGS.TF.
@@ -6924,6 +6928,10 @@ x86_emulate(
                                       ctxt)) != X86EMUL_OKAY )
             goto done;
 
+        if ( ctxt->lma )
+            /* In particular mode_64bit() needs to return true from here on. */
+            ctxt->addr_size = ctxt->sp_size = 64;
+
         singlestep = _regs.eflags & X86_EFLAGS_TF;
         break;
 
@@ -12096,8 +12104,12 @@ int x86_emulate_wrapper(
     unsigned long orig_ip = ctxt->regs->r(ip);
     int rc;
 
+#ifdef __x86_64__
     if ( mode_64bit() )
         ASSERT(ctxt->lma);
+#else
+    ASSERT(!ctxt->lma && !mode_64bit());
+#endif
 
     rc = x86_emulate(ctxt, ops);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:45:58 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:45:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93785.177082 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBiI-0008Mt-1M; Fri, 05 Mar 2021 14:45:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93785.177082; Fri, 05 Mar 2021 14:45: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 1lIBiH-0008Ml-Ua; Fri, 05 Mar 2021 14:45:57 +0000
Received: by outflank-mailman (input) for mailman id 93785;
 Fri, 05 Mar 2021 14:45: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 1lIBiG-0008Md-Qr
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:45: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 1lIBiG-0008Ev-QE
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:45:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBiG-0008JV-NL
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:45:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hBp9HxX+nKGwOwMdLEwW+6VZpIFD+5kvmhBdki20wI0=; b=P8AIG1ULCm1UR6LYYyZL9og12u
	+NeZAAqG4AkRTOKte9EhEwEDMh/N+BtnASlGt0O9Kv4sfqcpChJCl40k7EtpYLwlwXgguwBoD0eqz
	RcBpQ1r0ClRA1axpThLr2mPr18UjO9rq4vopNjPMaGa9hr4zRZtfveIPfQ6sEP0o1s/w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] xen/iommu: Check if the IOMMU was initialized before tearing down
Message-Id: <E1lIBiG-0008JV-NL@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:45:56 +0000

commit 605e1d92efa0a00e81396fd7510046ed38bd9197
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Mar 5 15:33:27 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:33:27 2021 +0100

    xen/iommu: Check if the IOMMU was initialized before tearing down
    
    is_iommu_enabled() will return true even if the IOMMU has not been
    initialized (e.g. the ops are not set).
    
    In the case of an early failure in arch_domain_init(), the function
    iommu_destroy_domain() will be called even if the IOMMU is not
    initialized.
    
    This will result to dereference the ops which will be NULL and an host
    crash.
    
    Fix the issue by checking that ops has been set before accessing it.
    
    Fixes: 71e617a6b8f6 ("use is_iommu_enabled() where appropriate...")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: d670ef3401b91d04c58d72cd8ce5579b4fa900d8
    master date: 2021-02-17 11:30:05 +0000
---
 xen/drivers/passthrough/iommu.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 1d644844ab..75eef853f4 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -225,6 +225,13 @@ static void iommu_teardown(struct domain *d)
 {
     struct domain_iommu *hd = dom_iommu(d);
 
+    /*
+     * During early domain creation failure, we may reach here with the
+     * ops not yet initialized.
+     */
+    if ( !hd->platform_ops )
+        return;
+
     hd->platform_ops->teardown(d);
     tasklet_schedule(&iommu_pt_cleanup_tasklet);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:46:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:46:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93786.177086 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBiS-0008O7-2v; Fri, 05 Mar 2021 14:46:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93786.177086; Fri, 05 Mar 2021 14:46: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 1lIBiR-0008Nz-W5; Fri, 05 Mar 2021 14:46:07 +0000
Received: by outflank-mailman (input) for mailman id 93786;
 Fri, 05 Mar 2021 14:46: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 1lIBiQ-0008Nq-UL
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:46: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 1lIBiQ-0008FM-Ti
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:46:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBiQ-0008Kp-Su
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:46:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GxRI0n+bEI4Flb/y6G9JpwFU9xVr64Eo/OdTra07wto=; b=J0U4V1irpN9duIMwubDCxnVXuD
	NFCkGNme10blf8d2KZiGGV1dQ8AVMUGdMSmpdIUEetQewaemQAuzpxh2sEe2SCc41YBY3Be6tFEOn
	xMrlIs0c4OnWllQhqQew8FL9zwuKoPXi19IN4bcXssDI5LmgMtRx044BY8ma1ITPOKQE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] gnttab: never permit mapping transitive grants
Message-Id: <E1lIBiQ-0008Kp-Su@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:46:06 +0000

commit 4a505ed5c4b7b333e22fb485ddfa5a19029045ad
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:34:07 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:34:07 2021 +0100

    gnttab: never permit mapping transitive grants
    
    Transitive grants allow an intermediate domain I to grant a target
    domain T access to a page which origin domain O did grant I access to.
    As an implementation restriction, T is not allowed to map such a grant.
    This restriction is currently tried to be enforced by marking active
    entries resulting from transitive grants as is-sub-page; sub-page grants
    for obvious reasons don't allow mapping. However, marking (and checking)
    only active entries is insufficient, as a map attempt may also occur on
    a grant not otherwise in use. When not presently in use (pin count zero)
    the grant type itself needs checking. Otherwise T may be able to map an
    unrelated page owned by I. This is because the "transitive" sub-
    structure of the v2 union would end up being interpreted as "full_page"
    sub-structure instead. The low 32 bits of the GFN used would match the
    grant reference specified in I's transitive grant entry, while the upper
    32 bits could be random (depending on how exactly I sets up its grant
    table entries).
    
    Note that if one mapping already exists and the granting domain _then_
    changes the grant to GTF_transitive (which the domain is not supposed to
    do), the changed type will only be honored after the pin count has gone
    back to zero. This is no different from e.g. GTF_readonly or
    GTF_sub_page becoming set when a grant is already in use.
    
    While adjusting the implementation, also adjust commentary in the public
    header to better reflect reality.
    
    Fixes: 3672ce675c93 ("Transitive grant support")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: b339e3a976b1680f57051adabcb98281198f7eac
    master date: 2021-02-18 13:16:12 +0100
---
 xen/common/grant_table.c         | 9 +++++----
 xen/include/public/grant_table.h | 6 ++++--
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 9f0cae52c0..4a6ae52ae3 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -836,9 +836,10 @@ static int _set_status_v2(const grant_entry_header_t *shah,
         mask |= GTF_sub_page;
 
     /* If not already pinned, check the grant domid and type. */
-    if ( !act->pin && ((((scombo.flags & mask) != GTF_permit_access) &&
-                        ((scombo.flags & mask) != GTF_transitive)) ||
-                       (scombo.domid != ldomid)) )
+    if ( !act->pin &&
+         ((((scombo.flags & mask) != GTF_permit_access) &&
+           (mapflag || ((scombo.flags & mask) != GTF_transitive))) ||
+          (scombo.domid != ldomid)) )
         PIN_FAIL(done, GNTST_general_error,
                  "Bad flags (%x) or dom (%d); expected d%d, flags %x\n",
                  scombo.flags, scombo.domid, ldomid, mask);
@@ -864,7 +865,7 @@ static int _set_status_v2(const grant_entry_header_t *shah,
     if ( !act->pin )
     {
         if ( (((scombo.flags & mask) != GTF_permit_access) &&
-              ((scombo.flags & mask) != GTF_transitive)) ||
+              (mapflag || ((scombo.flags & mask) != GTF_transitive))) ||
              (scombo.domid != ldomid) ||
              (!readonly && (scombo.flags & GTF_readonly)) )
         {
diff --git a/xen/include/public/grant_table.h b/xen/include/public/grant_table.h
index 3b7bf93d74..84b1d26b36 100644
--- a/xen/include/public/grant_table.h
+++ b/xen/include/public/grant_table.h
@@ -166,11 +166,13 @@ typedef struct grant_entry_v1 grant_entry_v1_t;
 #define GTF_type_mask       (3U<<0)
 
 /*
- * Subflags for GTF_permit_access.
+ * Subflags for GTF_permit_access and GTF_transitive.
  *  GTF_readonly: Restrict @domid to read-only mappings and accesses. [GST]
  *  GTF_reading: Grant entry is currently mapped for reading by @domid. [XEN]
  *  GTF_writing: Grant entry is currently mapped for writing by @domid. [XEN]
- *  GTF_PAT, GTF_PWT, GTF_PCD: (x86) cache attribute flags for the grant [GST]
+ * Further subflags for GTF_permit_access only.
+ *  GTF_PAT, GTF_PWT, GTF_PCD: (x86) cache attribute flags to be used for
+ *                             mappings of the grant [GST]
  *  GTF_sub_page: Grant access to only a subrange of the page.  @domid
  *                will only be allowed to copy from the grant, and not
  *                map it. [GST]
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:46:19 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:46:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93787.177090 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBid-0008Qt-4F; Fri, 05 Mar 2021 14:46:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93787.177090; Fri, 05 Mar 2021 14:46:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBid-0008Ql-1I; Fri, 05 Mar 2021 14:46:19 +0000
Received: by outflank-mailman (input) for mailman id 93787;
 Fri, 05 Mar 2021 14:46: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 1lIBib-0008QZ-3g
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:46: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 1lIBib-0008FS-1Q
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:46:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBib-0008LZ-01
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:46: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=ZiW1fE9wH2subRe2zBELazNrbgFHBcv9gIkGtmUVwPY=; b=f02mQ+T8ZEgKW3qAj1OmQAweHr
	exGwMYeCMWybI6dDCultofILgYPYs3+nKiKtrjomHizYz5nUbHC3gk+HHgze79idy8u6cSnpCWHMW
	GbYjCaDTacJKet1SEQA1pA9BfjqhRSaRicg9uTEO6naSA6+qFI1/qgSrHHbq9UhdkEOA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] gnttab: bypass IOMMU (un)mapping when a domain is (un)mapping its own grant
Message-Id: <E1lIBib-0008LZ-01@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:46:17 +0000

commit 9b6054a63ebae032cd14dc610ed6d7c21e7e7a2f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:34:53 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:34:53 2021 +0100

    gnttab: bypass IOMMU (un)mapping when a domain is (un)mapping its own grant
    
    Mappings for a domain's own pages should already be present in the
    IOMMU. While installing the same mapping again is merely redundant (and
    inefficient), removing the mapping when the grant mapping gets removed
    is outright wrong in this case: The mapping was there before the map, so
    should remain in place after unmapping.
    
    This affects
    - Arm Dom0 in the direct mapped case,
    - x86 PV Dom0 in the "iommu=dom0-strict" / "dom0-iommu=strict" case,
    - all x86 PV DomU-s, including driver domains.
    
    See the code comment for why it's the original domain and not the page
    owner that gets compared against.
    
    Reported-by: Rahul Singh <Rahul.Singh@arm.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    master commit: e8185c5f01c68f7d29d23a4a91bc1be1ff2cc1ca
    master date: 2021-02-18 13:16:59 +0100
---
 xen/common/grant_table.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 4a6ae52ae3..5239d1395c 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1207,7 +1207,14 @@ map_grant_ref(
         goto undo_out;
     }
 
-    need_iommu = gnttab_need_iommu_mapping(ld);
+    /*
+     * This is deliberately not checking the page's owner: get_paged_frame()
+     * explicitly rejects foreign pages, and all success paths above yield
+     * either owner == rd or owner == dom_io (the dom_cow case is irrelevant
+     * as mem-sharing and IOMMU use are incompatible). The dom_io case would
+     * need checking separately if we compared against owner here.
+     */
+    need_iommu = ld != rd && gnttab_need_iommu_mapping(ld);
     if ( need_iommu )
     {
         unsigned int kind;
@@ -1471,7 +1478,8 @@ unmap_common(
     if ( put_handle )
         put_maptrack_handle(lgt, op->handle);
 
-    if ( rc == GNTST_okay && gnttab_need_iommu_mapping(ld) )
+    /* See the respective comment in map_grant_ref(). */
+    if ( rc == GNTST_okay && ld != rd && gnttab_need_iommu_mapping(ld) )
     {
         unsigned int kind;
         int err = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:46:28 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:46:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93789.177106 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBim-0008TY-EL; Fri, 05 Mar 2021 14:46:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93789.177106; Fri, 05 Mar 2021 14:46: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 1lIBim-0008TO-Ab; Fri, 05 Mar 2021 14:46:28 +0000
Received: by outflank-mailman (input) for mailman id 93789;
 Fri, 05 Mar 2021 14:46: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 1lIBil-0008Su-55
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:46: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 1lIBil-0008Fl-4N
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:46:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBil-0008Nv-3d
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:46: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=iHQRRfbCZ/hgDRSoZwl0tOe7KxjhP+0M4oq+N4qvzH4=; b=dOBZ3vDK0gb0eYRPZQIPM/Qen+
	xg9DtFwsgaoCaaix+QMy/Z/1grkqyW9qCQ8wBEO832SsQwLFlLN7gtFMP8/J8+WuPOz7uzZd47ubt
	Pa3vbgXzNRs6BTKk+n/+SRpZXbBWsDUziNv60BxYwD0vESgywYPlEADsT2mQM1x8c73k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/EFI: suppress GNU ld 2.36'es creation of base relocs
Message-Id: <E1lIBil-0008Nv-3d@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:46:27 +0000

commit 97c0a5c05bb6ff87fd19b6366bb4a3ca006a32da
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:35:19 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:35:19 2021 +0100

    x86/EFI: suppress GNU ld 2.36'es creation of base relocs
    
    All of the sudden ld creates base relocations itself, for PE
    executables - as a result we now have two of them for every entity to
    be relocated. While we will likely want to use this down the road, it
    doesn't work quite right yet in corner cases, so rather than suppressing
    our own way of creating the relocations we need to tell ld to avoid
    doing so.
    
    Probe whether --disable-reloc-section (which was introduced by the same
    commit making relocation generation the default) is recognized by ld's PE
    emulation, and use the option if so. (To limit redundancy, move the first
    part of setting EFI_LDFLAGS earlier, and use it already while probing.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 76cbb9c3f4dd9ab6aa44eeacab84fb88b2e8bfc1
    master date: 2021-02-25 15:11:58 +0100
---
 xen/arch/x86/Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 7216bd7b68..d45b213ab6 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -176,8 +176,13 @@ EFI_LDFLAGS += --major-subsystem-version=2 --minor-subsystem-version=0
 # Check if the compiler supports the MS ABI.
 export XEN_BUILD_EFI := $(shell $(CC) $(XEN_CFLAGS) -c efi/check.c -o efi/check.o 2>/dev/null && echo y)
 # Check if the linker supports PE.
-XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) -mi386pep --subsystem=10 -S -o efi/check.efi efi/check.o 2>/dev/null && echo y))
+XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) $(call EFI_LDFLAGS,0x100000000) -o efi/check.efi efi/check.o 2>/dev/null && echo y))
 CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
+# Check if the linker produces fixups in PE by default (we need to disable it doing so for now).
+XEN_NO_PE_FIXUPS := $(if $(XEN_BUILD_EFI), \
+                         $(shell $(LD) $(call EFI_LDFLAGS,0x100000000) --disable-reloc-section -o efi/check.efi efi/check.o 2>/dev/null && \
+                                 echo --disable-reloc-section))
+EFI_LDFLAGS += $(XEN_NO_PE_FIXUPS)
 
 $(TARGET).efi: VIRT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A VIRT_START$$,,p')
 $(TARGET).efi: ALT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A ALT_START$$,,p')
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:46:38 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:46:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93790.177110 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBiw-00005V-H0; Fri, 05 Mar 2021 14:46:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93790.177110; Fri, 05 Mar 2021 14:46: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 1lIBiw-00005J-Db; Fri, 05 Mar 2021 14:46:38 +0000
Received: by outflank-mailman (input) for mailman id 93790;
 Fri, 05 Mar 2021 14:46: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 1lIBiv-000055-8J
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:46: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 1lIBiv-0008GK-7c
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:46:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBiv-0008QM-6m
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:46: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=VdgcZzq66D/O4UudL58a889ppsVdbR2liZprNuFABSY=; b=zD9JctrmOuKhMPmXk99vreTz7Z
	oB/PGf9x4g1SHpegjg2JkHePeYSe85aL2T72YMpIryiBg0NhImxEuM0aPIoTC/C4Z65Y60/9iacch
	IYZu01uxqXqrOdWWWfknO7iWi0YWtFIVDohxt0Kwbpj25zA+DsE5TMG20cLsIppex+FQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] xen/sched: Add missing memory barrier in vcpu_block()
Message-Id: <E1lIBiv-0008QM-6m@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:46:37 +0000

commit 3eee5228247cb5286e9e219fba0b15349b0ae2a1
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Mar 5 15:35:54 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:35:54 2021 +0100

    xen/sched: Add missing memory barrier in vcpu_block()
    
    The comment in vcpu_block() states that the events should be checked
    /after/ blocking to avoids wakeup waiting race. However, from a generic
    perspective, set_bit() doesn't prevent re-ordering. So the following
    could happen:
    
    CPU0  (blocking vCPU A)         |   CPU1 ( unblock vCPU A)
                                    |
    A <- read local events          |
                                    |   set local events
                                    |   test_and_clear_bit(_VPF_blocked)
                                    |       -> Bail out as the bit if not set
                                    |
    set_bit(_VFP_blocked)           |
                                    |
    check A                         |
    
    The variable A will be 0 and therefore the vCPU will be blocked when it
    should continue running.
    
    vcpu_block() is now gaining an smp_mb__after_atomic() to prevent the CPU
    to read any information about local events before the flag _VPF_blocked
    is set.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ash Wilding <ash.j.wilding@gmail.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Dario Faggioli <dfaggioli@suse.com>
    master commit: 109e8177fd4a225e7025c4c17d2c9537b550b4ed
    master date: 2021-02-26 09:47:23 +0000
---
 xen/common/sched/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index ab94d2ec3a..1bd63c9de6 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -1360,6 +1360,8 @@ void vcpu_block(void)
 
     set_bit(_VPF_blocked, &v->pause_flags);
 
+    smp_mb__after_atomic();
+
     arch_vcpu_block(v);
 
     /* Check for events /after/ blocking: avoids wakeup waiting race. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:46:48 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:46:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93791.177114 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBj6-00008K-IR; Fri, 05 Mar 2021 14:46:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93791.177114; Fri, 05 Mar 2021 14:46: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 1lIBj6-00008A-FB; Fri, 05 Mar 2021 14:46:48 +0000
Received: by outflank-mailman (input) for mailman id 93791;
 Fri, 05 Mar 2021 14:46: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 1lIBj5-000082-BM
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:46: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 1lIBj5-0008GX-Ad
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:46:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBj5-0008RC-9s
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:46: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=3ia6umY990PoyRzg8E6mkc/elbVKZwJLy88Tw28YdD4=; b=LbXFh69vXw0h64EFD5dl8F20C5
	II2XBsEJl5c6QxIsNxfkSO0zhWNiqOC5caTDMJwr8IPS0sdv0gNtAZqA8fnjDEGgVYRXGh5cfPWEq
	/f29k0ryPtUkVVkrXEh/xdRcy1a87T9wlwGm+SxBo3gFX8NObRjBxYFVMnCKghJhx8Pc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/dmop: Properly fail for PV guests
Message-Id: <E1lIBj5-0008RC-9s@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:46:47 +0000

commit a1dab05393ec5654e2a88be296cc973595ffb1d0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 5 15:36:27 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:36:27 2021 +0100

    x86/dmop: Properly fail for PV guests
    
    The current code has an early exit for PV guests, but it returns 0 having done
    nothing.
    
    Fixes: 524a98c2ac5 ("public / x86: introduce __HYPERCALL_dm_op...")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 615367b5275a5b0123f1f1ee86c985fab234a5a4
    master date: 2021-02-26 12:28:52 +0000
---
 xen/arch/x86/hvm/dm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c
index e3f845165d..7586952633 100644
--- a/xen/arch/x86/hvm/dm.c
+++ b/xen/arch/x86/hvm/dm.c
@@ -370,6 +370,7 @@ static int dm_op(const struct dmop_args *op_args)
     if ( rc )
         return rc;
 
+    rc = -EINVAL;
     if ( !is_hvm_domain(d) )
         goto out;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:55:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:55:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93803.177130 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBrA-0001EZ-Ev; Fri, 05 Mar 2021 14:55:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93803.177130; Fri, 05 Mar 2021 14:55: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 1lIBrA-0001ER-By; Fri, 05 Mar 2021 14:55:08 +0000
Received: by outflank-mailman (input) for mailman id 93803;
 Fri, 05 Mar 2021 14:55: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 1lIBr8-0001EM-RC
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:55: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 1lIBr8-0008Ps-PY
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:55:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBr8-0000hf-Lz
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:55:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tjI4NeVX1VGEG2OqSd34Iyqj4f4uamEUR+I6Woyq7Mw=; b=3eTyz2H3pRQ0kaTHdxi6kU/DGg
	apBLVlZW7kf5zWXmhMABZFMhgmHNIUYU+9JPwkRbk8g4kOHVqFk2i1Y0KwIVxxQURrWbHgycG+EOf
	TvlCrqLojZlFe4SWXknC7Z4o8uGwrX3A3GOIXtNwb/ju6AGQkW4BU1yq+MeoeRLSN9nU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/vioapic: check IRR before attempting to inject interrupt after EOI
Message-Id: <E1lIBr8-0000hf-Lz@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:55:06 +0000

commit 8b4f699b65db279a04c09dd30425f3830d6ba654
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Mar 5 15:40:32 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:40:32 2021 +0100

    x86/vioapic: check IRR before attempting to inject interrupt after EOI
    
    In vioapic_update_EOI the irq_lock will be dropped in order to forward
    the EOI to the dpci handler, so there's a window between clearing IRR
    and checking if the line is asserted where IRR can change behind our
    back.
    
    Fix this by checking whether IRR is set before attempting to inject a
    new interrupt.
    
    Fixes: 06e3f8f2766 ('vt-d: Do dpci eoi outside of irq_lock.')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: ba584fb1a26c058ebd0e6a2779287b3e4400415c
    master date: 2021-01-22 12:13:05 +0100
---
 xen/arch/x86/hvm/vioapic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index da03b4d4b3..35717edf73 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -544,7 +544,7 @@ void vioapic_update_EOI(struct domain *d, u8 vector)
             }
 
             if ( (ent->fields.trig_mode == VIOAPIC_LEVEL_TRIG) &&
-                 !ent->fields.mask &&
+                 !ent->fields.mask && !ent->fields.remote_irr &&
                  hvm_irq->gsi_assert_count[vioapic->base_gsi + pin] )
             {
                 ent->fields.remote_irr = 1;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:55:18 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:55:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93804.177134 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBrK-0001FW-GT; Fri, 05 Mar 2021 14:55:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93804.177134; Fri, 05 Mar 2021 14:55: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 1lIBrK-0001FO-DQ; Fri, 05 Mar 2021 14:55:18 +0000
Received: by outflank-mailman (input) for mailman id 93804;
 Fri, 05 Mar 2021 14:55: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 1lIBrJ-0001FD-1j
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:55: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 1lIBrI-0008Pv-WB
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:55:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBrI-0000ia-Rv
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:55:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+1mgpfQrQOjn8uedZdcjs4LptsiA3NIr1u/rw8U9BA8=; b=DFzN+WK/T0ZZai2OgWn7Hhnl1J
	zSLHvlyZQo06d/OktBur9b2u4Iz1eM2nuqG5JGsjW/oJwa/H3Kxid7vzL/CFiU7/+2sj8817bRN3f
	iWUnbAX+FF3kEnb72wmKEeAkDXyQ6RIVS/d3zqrO2Iz5cH3skzWCbDDH/G5rJDssCFuY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] xen/include: compat/xlat.h may change with .config changes
Message-Id: <E1lIBrI-0000ia-Rv@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:55:16 +0000

commit 6d5d73b77f022b6ddf855eeefdbd4368322d04b6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:41:11 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:41:11 2021 +0100

    xen/include: compat/xlat.h may change with .config changes
    
    $(xlat-y) getting derived from $(headers-y) means its contents may
    change with changes to .config. The individual files $(xlat-y) refers
    to, otoh, may not change, and hence not trigger rebuilding of xlat.h.
    (Note that the issue was already present before the commit referred to
    below, but it was far more limited in affecting only changes to
    CONFIG_XSM_FLASK.)
    
    Fixes: 2c8fabb2232d ("x86: only generate compat headers actually needed")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c7b0f25e8f86373ed54e1c446f8e67ce25ac6819
    master date: 2021-01-26 14:42:23 +0100
---
 xen/include/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/Makefile b/xen/include/Makefile
index c3e0283d34..47908905b9 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -90,7 +90,7 @@ compat/.xlat/%.lst: xlat.lst Makefile
 xlat-y := $(shell sed -ne 's,@arch@,$(compat-arch-y),g' -re 's,^[?!][[:blank:]]+[^[:blank:]]+[[:blank:]]+,,p' xlat.lst | uniq)
 xlat-y := $(filter $(patsubst compat/%,%,$(headers-y)),$(xlat-y))
 
-compat/xlat.h: $(addprefix compat/.xlat/,$(xlat-y)) Makefile
+compat/xlat.h: $(addprefix compat/.xlat/,$(xlat-y)) config/auto.conf Makefile
 	cat $(filter %.h,$^) >$@.new
 	mv -f $@.new $@
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:55:28 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:55:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93805.177138 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBrU-0001Gh-Hw; Fri, 05 Mar 2021 14:55:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93805.177138; Fri, 05 Mar 2021 14:55: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 1lIBrU-0001GZ-Ew; Fri, 05 Mar 2021 14:55:28 +0000
Received: by outflank-mailman (input) for mailman id 93805;
 Fri, 05 Mar 2021 14:55: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 1lIBrT-0001GS-6C
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:55: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 1lIBrT-0008Q6-4s
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:55:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBrT-0000jZ-2M
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:55:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gtEN0InLsqM5tWSU/zd24RhNI95OMqyXEQL7As1VocM=; b=gjVpjURgy9UpLypkBX/fYwWIMJ
	6ts/6MDbqmaOlsb9RM4bTA6gNpsN5c4GJze1zyftHGNYp+uaOFccbMTWcFbbOr+uKSLcrRxNoCBbu
	ANynU2otZ9dHKjn/AidBdJyAB1R8En4TDA9vReX0Cpo8LTVCaGvvqFT4pID6TFNtvOWU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/timer: Fix boot on Intel systems using ITSSPRC static PIT clock gating
Message-Id: <E1lIBrT-0000jZ-2M@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:55:27 +0000

commit c11bd12218365e31ee4d00f315a075b21a015914
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 5 15:41:35 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:41:35 2021 +0100

    x86/timer: Fix boot on Intel systems using ITSSPRC static PIT clock gating
    
    Recent Intel client devices have disabled the legacy PIT for powersaving
    reasons, breaking compatibility with a traditional IBM PC.  Xen depends on a
    legacy timer interrupt to check that the IO-APIC/PIC routing is configured
    correctly, and fails to boot with:
    
      (XEN) *******************************
      (XEN) Panic on CPU 0:
      (XEN) IO-APIC + timer doesn't work!  Boot with apic_verbosity=debug and send report.  Then try booting with the `noapic` option
      (XEN) *******************************
    
    While this setting can be undone by Xen, the details of how to differ by
    chipset, and would be very short sighted for battery based devices.  See bit 2
    "8254 Static Clock Gating Enable" in:
    
      https://edc.intel.com/content/www/us/en/design/products-and-solutions/processors-and-chipsets/comet-lake-u/intel-400-series-chipset-on-package-platform-controller-hub-register-database/itss-power-reduction-control-itssprc-offset-3300/
    
    All impacted systems have an HPET, but there is no indication of the absence
    of PIT functionality, nor a suitable way to probe for its absence.  As a short
    term fix, reconfigure the HPET into legacy replacement mode.  A better
    longterm fix would be to avoid the reliance on the timer interrupt entirely.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: e1de4c196a2eb4fd5063c30a2e115adf144bdeef
    master date: 2021-01-27 19:15:19 +0000
---
 xen/arch/x86/hpet.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 66 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index e99d7116b6..86b4e88f9b 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -767,7 +767,7 @@ static u32 *hpet_boot_cfg;
 u64 __init hpet_setup(void)
 {
     static u64 __initdata hpet_rate;
-    u32 hpet_id, hpet_period;
+    unsigned int hpet_id, hpet_period, hpet_cfg;
     unsigned int last;
 
     if ( hpet_rate )
@@ -800,6 +800,71 @@ u64 __init hpet_setup(void)
     hpet_rate = 1000000000000000ULL; /* 10^15 */
     (void)do_div(hpet_rate, hpet_period);
 
+    /*
+     * Intel chipsets from Skylake/ApolloLake onwards can statically clock
+     * gate the 8259 PIT.  This option is enabled by default in slightly later
+     * systems, as turning the PIT off is a prerequisite to entering the C11
+     * power saving state.
+     *
+     * Xen currently depends on the legacy timer interrupt being active while
+     * IRQ routing is configured.
+     *
+     * Reconfigure the HPET into legacy mode to re-establish the timer
+     * interrupt.
+     */
+    if ( hpet_id & HPET_ID_LEGSUP &&
+         !((hpet_cfg = hpet_read32(HPET_CFG)) & HPET_CFG_LEGACY) )
+    {
+        unsigned int c0_cfg, ticks, count;
+
+        /* Stop the main counter. */
+        hpet_write32(hpet_cfg & ~HPET_CFG_ENABLE, HPET_CFG);
+
+        /* Reconfigure channel 0 to be 32bit periodic. */
+        c0_cfg = hpet_read32(HPET_Tn_CFG(0));
+        c0_cfg |= (HPET_TN_ENABLE | HPET_TN_PERIODIC | HPET_TN_SETVAL |
+                   HPET_TN_32BIT);
+        hpet_write32(c0_cfg, HPET_Tn_CFG(0));
+
+        /*
+         * The exact period doesn't have to match a legacy PIT.  All we need
+         * is an interrupt queued up via the IO-APIC to check routing.
+         *
+         * Use HZ as the frequency.
+         */
+        ticks = ((SECONDS(1) / HZ) * div_sc(hpet_rate, SECONDS(1), 32)) >> 32;
+
+        count = hpet_read32(HPET_COUNTER);
+
+        /*
+         * HPET_TN_SETVAL above is atrociously documented in the spec.
+         *
+         * Periodic HPET channels have a main comparator register, and
+         * separate "accumulator" register.  Despite being named accumulator
+         * in the spec, this is not an accurate description of its behaviour
+         * or purpose.
+         *
+         * Each time an interrupt is generated, the "accumulator" register is
+         * re-added to the comparator set up the new period.
+         *
+         * Normally, writes to the CMP register update both registers.
+         * However, under these semantics, it is impossible to set up a
+         * periodic timer correctly without the main HPET counter being at 0.
+         *
+         * Instead, HPET_TN_SETVAL is a self-clearing control bit which we can
+         * use for periodic timers to mean that the second write to CMP
+         * updates the accumulator only, and not the absolute comparator
+         * value.
+         *
+         * This lets us set a period when the main counter isn't at 0.
+         */
+        hpet_write32(count + ticks, HPET_Tn_CMP(0));
+        hpet_write32(ticks,         HPET_Tn_CMP(0));
+
+        /* Restart the main counter, and legacy mode. */
+        hpet_write32(hpet_cfg | HPET_CFG_ENABLE | HPET_CFG_LEGACY, HPET_CFG);
+    }
+
     return hpet_rate;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:55:38 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:55:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93806.177141 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBre-0001I7-Js; Fri, 05 Mar 2021 14:55:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93806.177141; Fri, 05 Mar 2021 14:55: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 1lIBre-0001Hz-GV; Fri, 05 Mar 2021 14:55:38 +0000
Received: by outflank-mailman (input) for mailman id 93806;
 Fri, 05 Mar 2021 14:55: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 1lIBrd-0001Hr-B6
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:55: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 1lIBrd-0008QU-AK
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:55:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBrd-0000kO-7L
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:55:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2My/wo4O/XVgZpeHLxpqw7L4KJDp0/gD+HOn5eJUWO8=; b=IEqFmKmL7RT1yrtWEBQBETlohL
	nAYOuTVb9a0nA6iz3/nR+2+ozpRFs7ozzRetuicNu1CeqF9PTOu4zgDFjvZ2ilm9ZcOFMf/yeAnn0
	09y0zlqtreAs7R2Ugeb3MpnF9wPDoTtXuQ2DWwiZHySspvqkyThL85FvzRhG0Bel6N5s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] memory: bail from page scrubbing when CPU is no longer online
Message-Id: <E1lIBrd-0000kO-7L@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:55:37 +0000

commit ab3770e98f8ca1feae8607f52b3ec118664c8a74
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:42:31 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:42:31 2021 +0100

    memory: bail from page scrubbing when CPU is no longer online
    
    Scrubbing can significantly delay the offlining (parking) of a CPU (e.g.
    because of booting into in smt=0 mode), to a degree that the "CPU <n>
    still not dead..." messages logged on x86 in 1s intervals can be seen
    multiple times. There are no softirqs involved in this process, so
    extend the existing preemption check in the scrubbing logic to also exit
    when the CPU is no longer observed online.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 3c9fd69416f8ffc611705fb24dfb383203ddc84f
    master date: 2021-01-29 11:34:37 +0100
---
 xen/common/page_alloc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index ebc7f45c0f..1563188f4f 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1327,9 +1327,11 @@ bool scrub_free_pages(void)
                      * Scrub a few (8) pages before becoming eligible for
                      * preemption. But also count non-scrubbing loop iterations
                      * so that we don't get stuck here with an almost clean
-                     * heap.
+                     * heap. Consider the CPU no longer being seen as online as
+                     * a request to preempt immediately, to not unduly delay
+                     * its offlining.
                      */
-                    if ( cnt > 800 && softirq_pending(cpu) )
+                    if ( !cpu_online(cpu) || (cnt > 800 && softirq_pending(cpu)) )
                     {
                         preempt = true;
                         break;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:55:48 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:55:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93807.177147 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBro-0001Jw-MR; Fri, 05 Mar 2021 14:55:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93807.177147; Fri, 05 Mar 2021 14: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 1lIBro-0001Ji-IA; Fri, 05 Mar 2021 14:55:48 +0000
Received: by outflank-mailman (input) for mailman id 93807;
 Fri, 05 Mar 2021 14:55: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 1lIBrn-0001JY-GY
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:55: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 1lIBrn-0008Qc-FM
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:55:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBrn-0000l3-Cr
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:55:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=i2NInAzeJeDFwN4FBmN7t2FnT/sKoiwOv6TfwDunC9c=; b=gZw0C6hBtELP49hdLOmjH99O1k
	fLikPJVt6YxzsG2LD9S/cgqYPVGb9V+eoKJr66Y7OYavexibvWc5j2FajvI80GQllK5aw25Wi6YtD
	liZiXJF5w1GYav/Iy4KSqF9JBsGz9NIOkJwtHPzsIJWMdyF/fCNff+9WEt7bl3JWLNUA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/HVM: re-order error path of hvm_domain_initialise()
Message-Id: <E1lIBrn-0000l3-Cr@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:55:47 +0000

commit be2f8932e27872b79d11778b4fce22ddb81bae70
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:42:59 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:42:59 2021 +0100

    x86/HVM: re-order error path of hvm_domain_initialise()
    
    hvm_destroy_all_ioreq_servers(), called from
    hvm_domain_relinquish_resources(), invokes relocate_portio_handler(),
    which uses d->arch.hvm.io_handler. Defer freeing of this array
    accordingly on the error path of hvm_domain_initialise().
    
    Similarly rtc_deinit() requires d->arch.hvm.pl_time to still be around,
    or else an armed timer structure would get freed, and that timer never
    get killed.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: fbb3bf002b42803ef289ea2a649ebd5f25d22236
    master date: 2021-01-29 11:36:54 +0100
---
 xen/arch/x86/hvm/hvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index d946d16335..2be0460f08 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -702,15 +702,15 @@ int hvm_domain_initialise(struct domain *d)
  fail1:
     if ( is_hardware_domain(d) )
         xfree(d->arch.hvm.io_bitmap);
-    XFREE(d->arch.hvm.io_handler);
     XFREE(d->arch.hvm.params);
-    XFREE(d->arch.hvm.pl_time);
     XFREE(d->arch.hvm.irq);
  fail0:
     hvm_destroy_cacheattr_region_list(d);
     destroy_perdomain_mapping(d, PERDOMAIN_VIRT_START, 0);
  fail:
     hvm_domain_relinquish_resources(d);
+    XFREE(d->arch.hvm.io_handler);
+    XFREE(d->arch.hvm.pl_time);
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:55:59 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:55:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93809.177162 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBrz-0001NU-5x; Fri, 05 Mar 2021 14:55:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93809.177162; Fri, 05 Mar 2021 14:55: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 1lIBrz-0001NK-2Y; Fri, 05 Mar 2021 14:55:59 +0000
Received: by outflank-mailman (input) for mailman id 93809;
 Fri, 05 Mar 2021 14:55: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 1lIBrx-0001Mn-KF
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:55: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 1lIBrx-0008Qt-JS
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:55:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBrx-0000lx-IE
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:55:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WHDlWukxoYZLEzIpOS/cgC+JlSY/nCBuumuDO0yUAVM=; b=CM7YCyATI3ZIJ+W5Eqn5WkfbOe
	9/JliAYKvjzUB3coR9WQvdSPx9Zj4zG5zaQpLPw6lF+dnnhGrLVbmcIymzV6lQ+OWxC5CVSQGxGx/
	U4WAzJifRy+HVvgznUBnExUFzWFm92ZJ/NdzgwpqcF6ZOhi4ypgKmg/rH4DINuIb0jLQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/debug: fix page-overflow bug in dbg_rw_guest_mem
Message-Id: <E1lIBrx-0000lx-IE@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:55:57 +0000

commit e9cb9588232f5b5de07db77455045c9d449b615c
Author:     Tamas K Lengyel <tamas@tklengyel.com>
AuthorDate: Fri Mar 5 15:43:31 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:43:31 2021 +0100

    x86/debug: fix page-overflow bug in dbg_rw_guest_mem
    
    When using gdbsx dbg_rw_guest_mem is used to read/write guest memory. When the
    buffer being accessed is on a page-boundary, the next page needs to be grabbed
    to access the correct memory for the buffer's overflown parts. While
    dbg_rw_guest_mem has logic to handle that, it broke with 229492e210a. Instead
    of grabbing the next page the code right now is looping back to the
    start of the first page. This results in errors like the following while trying
    to use gdb with Linux' lx-dmesg:
    
    [    0.114457] PM: hibernation: Registered nosave memory: [mem
    0xfdfff000-0xffffffff]
    [    0.114460] [mem 0x90000000-0xfbffffff] available for PCI demem 0
    [    0.114462] f]f]
    Python Exception <class 'ValueError'> embedded null character:
    Error occurred in Python: embedded null character
    
    Fixing this bug by taking the variable assignment outside the loop.
    
    Fixes: 229492e210a ("x86/debugger: use copy_to/from_guest() in dbg_rw_guest_mem()")
    Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 9dc687f155a57216b83b17f9cde55dd43e06b0cd
    master date: 2021-01-30 03:21:33 +0000
---
 xen/arch/x86/debug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/debug.c b/xen/arch/x86/debug.c
index a500df01ac..61bf048bf9 100644
--- a/xen/arch/x86/debug.c
+++ b/xen/arch/x86/debug.c
@@ -158,10 +158,11 @@ static unsigned int dbg_rw_guest_mem(struct domain *dp, void * __user gaddr,
                                      void * __user buf, unsigned int len,
                                      bool toaddr, uint64_t pgd3)
 {
+    unsigned long addr = (unsigned long)gaddr;
+
     while ( len > 0 )
     {
         char *va;
-        unsigned long addr = (unsigned long)gaddr;
         mfn_t mfn;
         gfn_t gfn = INVALID_GFN;
         unsigned long pagecnt;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:56:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:56:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93810.177165 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBs8-0001QT-7A; Fri, 05 Mar 2021 14:56:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93810.177165; Fri, 05 Mar 2021 14:56: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 1lIBs8-0001QO-48; Fri, 05 Mar 2021 14:56:08 +0000
Received: by outflank-mailman (input) for mailman id 93810;
 Fri, 05 Mar 2021 14:56: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 1lIBs7-0001QH-PZ
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:56: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 1lIBs7-0008RI-Ok
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:56:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBs7-0000n8-M5
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:56:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6mxg5Flo5MbUqDNAp//Y4e8mAxRV98jPagcpgKs4yOM=; b=QutRrlTqZFR1Y/CLSWDhMzRtgW
	mB7h1IOzndqeY8jMWU4/VqRtaXDDpTYJFOFBlFSE+vb+nzZQuptPq0DUG2P7VqTKcVrIWbwTT1DLa
	AOI9jHmLHOPkZpGrohHj7sXxdQWKwYM/j7jWwDm0bKZZLUYQOLAhivzG+z8ZNENUiTdM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/string: correct memmove()'s forwarding to memcpy()
Message-Id: <E1lIBs7-0000n8-M5@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:56:07 +0000

commit 2c813771c5876e0d7a0f423a0d22f6b7d5ae47a3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:43:52 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:43:52 2021 +0100

    x86/string: correct memmove()'s forwarding to memcpy()
    
    With memcpy() expanding to the compiler builtin, we may not hand it
    overlapping source and destination. We strictly mean to forward to our
    own implementation (a few lines up in the same source file).
    
    Fixes: 78825e1c60fa ("x86/string: Clean up x86/string.h")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 7b93d92a35dc7c0a6e5f1f79b3c887aa3e66ddc0
    master date: 2021-02-04 13:59:56 +0100
---
 xen/arch/x86/string.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/string.c b/xen/arch/x86/string.c
index e2f84638c4..bda24b14ac 100644
--- a/xen/arch/x86/string.c
+++ b/xen/arch/x86/string.c
@@ -43,7 +43,8 @@ void *(memmove)(void *dest, const void *src, size_t n)
         return dest;
 
     if ( dest < src )
-        return memcpy(dest, src, n);
+        /* Depends on Xen's implementation operating forwards. */
+        return (memcpy)(dest, src, n);
 
     asm volatile (
         "   std         ; "
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:56:18 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:56:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93814.177181 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBsI-0001XP-HM; Fri, 05 Mar 2021 14:56:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93814.177181; Fri, 05 Mar 2021 14:56: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 1lIBsI-0001XF-EU; Fri, 05 Mar 2021 14:56:18 +0000
Received: by outflank-mailman (input) for mailman id 93814;
 Fri, 05 Mar 2021 14:56: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 1lIBsH-0001X1-TT
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:56: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 1lIBsH-0008RS-Se
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:56:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBsH-0000ne-RJ
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:56:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8h7WdVx+gLd6VzZDm13gVMEH6miNdWiK2nd4vtEz/Xw=; b=ulTj3ICav5TL2lPnK8eRNdUw/W
	v23TyPF1wsFnLjVMumxIKtELr841rEmnQcpm8qjrTP+9kh1VKj4mILze6Ov84ksPETEf4w2BYFiJf
	GaPbrSulkX8ewLJUPGrxF5gYXMb6+dLS41SZJ9sATt7Tu37yKc5xTk8UYGwugyRywOUk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/efi: enable MS ABI attribute on clang
Message-Id: <E1lIBsH-0000ne-RJ@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:56:17 +0000

commit 9724e60e033cbf586e50a425d7e47eaa613480f7
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Mar 5 15:44:18 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:44:18 2021 +0100

    x86/efi: enable MS ABI attribute on clang
    
    Or else the EFI service calls will use the wrong calling convention.
    
    The __ms_abi__ attribute is available on all supported versions of
    clang. Add a specific Clang check because the GCC version reported by
    Clang is below the required 4.4 to use the __ms_abi__ attribute.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    master commit: 92f5ffa58d188c9f9a9f1bcdccb6d6348d9df612
    master date: 2021-02-04 14:02:32 +0100
---
 xen/include/asm-x86/x86_64/efibind.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/asm-x86/x86_64/efibind.h b/xen/include/asm-x86/x86_64/efibind.h
index b013db175d..ddcfae07ec 100644
--- a/xen/include/asm-x86/x86_64/efibind.h
+++ b/xen/include/asm-x86/x86_64/efibind.h
@@ -172,7 +172,7 @@ typedef uint64_t   UINTN;
 #ifndef EFIAPI                  // Forces EFI calling conventions reguardless of compiler options
     #ifdef _MSC_EXTENSIONS
         #define EFIAPI __cdecl  // Force C calling convention for Microsoft C compiler
-    #elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+    #elif __clang__ || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
         #define EFIAPI __attribute__((__ms_abi__))  // Force Microsoft ABI
     #else
         #define EFIAPI          // Substitute expresion to force C calling convention
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:56:28 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:56:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93817.177186 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBsS-0001as-J9; Fri, 05 Mar 2021 14:56:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93817.177186; Fri, 05 Mar 2021 14:56: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 1lIBsS-0001af-Fz; Fri, 05 Mar 2021 14:56:28 +0000
Received: by outflank-mailman (input) for mailman id 93817;
 Fri, 05 Mar 2021 14:56: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 1lIBsS-0001aU-0O
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:56:28 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBsR-0008Rs-W0
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:56:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBsR-0000oV-V9
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:56:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GlT7AY5mmHfWMTuJQv/usewnnQMytWTeWacob7qF2d4=; b=WbIH030L2aJEf4FsbzR8yZ9NJ4
	l4bizVUtcrw9Q3tQsvrmHF96RFrqs6qkL5hkoQy2lk0Q56qRXm+lnT36YqNgpA2jy13SeZeFxI8ne
	tRF4HgDKs9rqmR99ptSQvLO2+A7bsnfjM/xc6g9Z9Pu2hvtxhQq80LixdDVyBtO5Tq9Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/EFI: work around GNU ld 2.36 issue
Message-Id: <E1lIBsR-0000oV-V9@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:56:27 +0000

commit 61ddd50cceebc53c708c6ef88388e54e249afeb9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:44:47 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:44:47 2021 +0100

    x86/EFI: work around GNU ld 2.36 issue
    
    Our linker capability check fails with the recent binutils release's ld:
    
    .../check.o:(.debug_aranges+0x6): relocation truncated to fit: R_X86_64_32 against `.debug_info'
    .../check.o:(.debug_info+0x6): relocation truncated to fit: R_X86_64_32 against `.debug_abbrev'
    .../check.o:(.debug_info+0xc): relocation truncated to fit: R_X86_64_32 against `.debug_str'+76
    .../check.o:(.debug_info+0x11): relocation truncated to fit: R_X86_64_32 against `.debug_str'+d
    .../check.o:(.debug_info+0x15): relocation truncated to fit: R_X86_64_32 against `.debug_str'+2b
    .../check.o:(.debug_info+0x29): relocation truncated to fit: R_X86_64_32 against `.debug_line'
    .../check.o:(.debug_info+0x30): relocation truncated to fit: R_X86_64_32 against `.debug_str'+19
    .../check.o:(.debug_info+0x37): relocation truncated to fit: R_X86_64_32 against `.debug_str'+71
    .../check.o:(.debug_info+0x3e): relocation truncated to fit: R_X86_64_32 against `.debug_str'
    .../check.o:(.debug_info+0x45): relocation truncated to fit: R_X86_64_32 against `.debug_str'+5e
    .../check.o:(.debug_info+0x4c): additional relocation overflows omitted from the output
    
    Tell the linker to strip debug info as a workaround. Debug info has been
    getting stripped already anyway when linking the actual xen.efi.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: f4318db940c39cc656128fcf72df3e79d2e55bc1
    master date: 2021-02-05 14:09:42 +0100
---
 xen/arch/x86/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 00d7dbe51b..4212eb1d93 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -173,7 +173,7 @@ EFI_LDFLAGS += --major-subsystem-version=2 --minor-subsystem-version=0
 # Check if the compiler supports the MS ABI.
 export XEN_BUILD_EFI := $(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c efi/check.c -o efi/check.o 2>/dev/null && echo y)
 # Check if the linker supports PE.
-XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) -mi386pep --subsystem=10 -o efi/check.efi efi/check.o 2>/dev/null && echo y))
+XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) -mi386pep --subsystem=10 -S -o efi/check.efi efi/check.o 2>/dev/null && echo y))
 CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
 
 $(TARGET).efi: VIRT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A VIRT_START$$,,p')
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:56:39 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:56:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93820.177190 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBsd-0001dL-KR; Fri, 05 Mar 2021 14:56:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93820.177190; Fri, 05 Mar 2021 14:56:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBsd-0001dD-HR; Fri, 05 Mar 2021 14:56:39 +0000
Received: by outflank-mailman (input) for mailman id 93820;
 Fri, 05 Mar 2021 14:56: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 1lIBsc-0001d1-3i
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:56: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 1lIBsc-0008Rz-2x
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:56:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBsc-0000qi-22
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:56:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=a9Q6JXicUIwv9UFsGDoweQW6x0rQ/iqxupkCO+RqMaE=; b=qkN1ytBUKTyBB0FK4ycSpXfeUA
	/DNtpyVvocfGM4rtRhsO3eZdop9mAON68jR8v8aop4/WBOa1RJe+aLsNeZMYWi6FnA6kv7l6ecRrx
	y96Zr0JJiDKA2yLSw+jGCFvBUkUGLthAwObv5VqdANIh7u5PDDkJI3m38bJN8QvrHf2Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/ucode/amd: Fix OoB read in cpu_request_microcode()
Message-Id: <E1lIBsc-0000qi-22@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:56:38 +0000

commit 2b0c46ebb26b872c5507b16e417a8b73c0ea0fca
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 5 15:45:06 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:45:06 2021 +0100

    x86/ucode/amd: Fix OoB read in cpu_request_microcode()
    
    verify_patch_size() is a maximum size check, and doesn't have a minimum bound.
    
    If the microcode container encodes a blob with a length less than 64 bytes,
    the subsequent calls to microcode_fits()/compare_header() may read off the end
    of the buffer.
    
    Fixes: 4de936a38a ("x86/ucode/amd: Rework parsing logic in cpu_request_microcode()")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1cbc4d89c45cba3929f1c0cb4bca0b000c4f174b
    master date: 2021-02-10 13:23:51 +0000
---
 xen/arch/x86/microcode_amd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/microcode_amd.c b/xen/arch/x86/microcode_amd.c
index a5becbfaf4..d678357bb4 100644
--- a/xen/arch/x86/microcode_amd.c
+++ b/xen/arch/x86/microcode_amd.c
@@ -292,7 +292,8 @@ static int get_ucode_from_buffer_amd(
         return -EINVAL;
     }
 
-    if ( (*offset + mpbuf->len) > bufsize )
+    if ( (*offset + mpbuf->len) > bufsize ||
+         mpbuf->len < sizeof(struct microcode_header_amd) )
     {
         printk(KERN_ERR "microcode: Bad data in microcode data file\n");
         return -EINVAL;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:56:49 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:56:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93821.177194 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBsn-0001fH-MM; Fri, 05 Mar 2021 14:56:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93821.177194; Fri, 05 Mar 2021 14:56:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBsn-0001fB-Iw; Fri, 05 Mar 2021 14:56:49 +0000
Received: by outflank-mailman (input) for mailman id 93821;
 Fri, 05 Mar 2021 14:56: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 1lIBsm-0001ex-88
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:56: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 1lIBsm-0008Sw-6z
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:56:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBsm-0000rI-6H
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:56:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7PoZzBkeyUPQizvIH9FurBG2MeXdw1PGR3yi987n3M4=; b=LwuhgWuGJAoQa0QY8FeSrWtvNI
	xJn/KIeLsIQwWxbCX5XDesbcmJ/c6Ia9smw/D5rAwwCacpD8NYhXE7oDZGOtYvcPEX/zXsxkq0U4x
	sGlSbGzyzYoCjHSbVvbCTm6YqYdPJOzTfd3daWJOrV9briB+CVI9/6Q8hpc7wJBgnteA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86emul: fix SYSENTER/SYSCALL switching into 64-bit mode
Message-Id: <E1lIBsm-0000rI-6H@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:56:48 +0000

commit ac4955c74b2dd8cc81d455c424f680041180c063
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:45:54 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:45:54 2021 +0100

    x86emul: fix SYSENTER/SYSCALL switching into 64-bit mode
    
    When invoked by compat mode, mode_64bit() will be false at the start of
    emulation. The logic after complete_insn, however, needs to consider the
    mode switched into, in particular to avoid truncating RIP.
    
    Inspired by / paralleling and extending Linux commit 943dea8af21b ("KVM:
    x86: Update emulator context mode if SYSENTER xfers to 64-bit mode").
    
    While there, tighten a related assertion in x86_emulate_wrapper() - we
    want to be sure to not switch into an impossible mode when the code gets
    built for 32-bit only (as is possible for the test harness).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citirix.com>
    master commit: f3e1eb2f0234c955243a915d69ebd84f26eec130
    master date: 2021-02-11 17:53:10 +0100
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index a6f67c6a56..a4e0341b25 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -5926,6 +5926,10 @@ x86_emulate(
              (rc = ops->write_segment(x86_seg_ss, &sreg, ctxt)) )
             goto done;
 
+        if ( ctxt->lma )
+            /* In particular mode_64bit() needs to return true from here on. */
+            ctxt->addr_size = ctxt->sp_size = 64;
+
         /*
          * SYSCALL (unlike most instructions) evaluates its singlestep action
          * based on the resulting EFLAGS.TF, not the starting EFLAGS.TF.
@@ -6595,6 +6599,10 @@ x86_emulate(
             goto done;
         _regs.r(sp) = ctxt->lma ? msr_val : (uint32_t)msr_val;
 
+        if ( ctxt->lma )
+            /* In particular mode_64bit() needs to return true from here on. */
+            ctxt->addr_size = ctxt->sp_size = 64;
+
         singlestep = _regs.eflags & X86_EFLAGS_TF;
         break;
 
@@ -11195,8 +11203,12 @@ int x86_emulate_wrapper(
     unsigned long orig_ip = ctxt->regs->r(ip);
     int rc;
 
+#ifdef __x86_64__
     if ( mode_64bit() )
         ASSERT(ctxt->lma);
+#else
+    ASSERT(!ctxt->lma && !mode_64bit());
+#endif
 
     rc = x86_emulate(ctxt, ops);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:56:59 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:56:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93822.177197 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBsx-0001gw-Ng; Fri, 05 Mar 2021 14:56:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93822.177197; Fri, 05 Mar 2021 14:56: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 1lIBsx-0001go-Kn; Fri, 05 Mar 2021 14:56:59 +0000
Received: by outflank-mailman (input) for mailman id 93822;
 Fri, 05 Mar 2021 14:56: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 1lIBsw-0001ge-Am
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:56: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 1lIBsw-0008Tq-A5
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:56:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBsw-0000rs-9I
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:56:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sDL0iT/mIvNUECE92fNT9vVZDREY5Roq6WyH+Af5/k4=; b=tiXjeXZBMq1Ah4DI+r/VSkwiPI
	pFIrxX2a/69ixvLXWKr5WV5rEIQqkytdms2OwLvv9eqhpZX3X7s8JzLWDFKaSQ7irRNYhwkahwgx1
	y/stiJ3/7eca+t1S9qiOFsXj5pwE6YxofucfwSrJ9D/fiNKw5HauXxWR4qHOOfTeR/Vg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] xen/iommu: Check if the IOMMU was initialized before tearing down
Message-Id: <E1lIBsw-0000rs-9I@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:56:58 +0000

commit c41fdabe8426079a0966b4e6bb9119c90bca62cb
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Mar 5 15:46:27 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:46:27 2021 +0100

    xen/iommu: Check if the IOMMU was initialized before tearing down
    
    is_iommu_enabled() will return true even if the IOMMU has not been
    initialized (e.g. the ops are not set).
    
    In the case of an early failure in arch_domain_init(), the function
    iommu_destroy_domain() will be called even if the IOMMU is not
    initialized.
    
    This will result to dereference the ops which will be NULL and an host
    crash.
    
    Fix the issue by checking that ops has been set before accessing it.
    
    Fixes: 71e617a6b8f6 ("use is_iommu_enabled() where appropriate...")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: d670ef3401b91d04c58d72cd8ce5579b4fa900d8
    master date: 2021-02-17 11:30:05 +0000
---
 xen/drivers/passthrough/iommu.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index bab7a3d099..93d4377978 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -228,6 +228,13 @@ static void iommu_teardown(struct domain *d)
 {
     struct domain_iommu *hd = dom_iommu(d);
 
+    /*
+     * During early domain creation failure, we may reach here with the
+     * ops not yet initialized.
+     */
+    if ( !hd->platform_ops )
+        return;
+
     hd->platform_ops->teardown(d);
     tasklet_schedule(&iommu_pt_cleanup_tasklet);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:57:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:57:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93823.177203 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBt7-0001iV-Qu; Fri, 05 Mar 2021 14:57:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93823.177203; Fri, 05 Mar 2021 14:57:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBt7-0001iM-MV; Fri, 05 Mar 2021 14:57:09 +0000
Received: by outflank-mailman (input) for mailman id 93823;
 Fri, 05 Mar 2021 14:57: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 1lIBt6-0001i7-ER
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:57: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 1lIBt6-0008UD-Dh
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:57:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBt6-0000sh-Cm
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:57:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=s6AC7332N9z1YhTCE+KnCnMxCu0yf8nIN2BTNOwxb2k=; b=fLEMXaUwLTnSC/6FgONPJ8DoNU
	h2XLYlVnIgY4XDXY4f55ztITyh/ZLSToeFUekoHwqgcESOruXBR/hdv9Iu6oMWCT44LQC4UYodVJA
	gX7HJBdHVj1mHT0UzfCsteYbX+62eOU4/KOP9XWsfqs9RCrBdRhQrVBuU9hTLjRPl0dM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] gnttab: never permit mapping transitive grants
Message-Id: <E1lIBt6-0000sh-Cm@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:57:08 +0000

commit 638b5787137eea3d88602c8ba5800b1f5beae9a8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:46:55 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:46:55 2021 +0100

    gnttab: never permit mapping transitive grants
    
    Transitive grants allow an intermediate domain I to grant a target
    domain T access to a page which origin domain O did grant I access to.
    As an implementation restriction, T is not allowed to map such a grant.
    This restriction is currently tried to be enforced by marking active
    entries resulting from transitive grants as is-sub-page; sub-page grants
    for obvious reasons don't allow mapping. However, marking (and checking)
    only active entries is insufficient, as a map attempt may also occur on
    a grant not otherwise in use. When not presently in use (pin count zero)
    the grant type itself needs checking. Otherwise T may be able to map an
    unrelated page owned by I. This is because the "transitive" sub-
    structure of the v2 union would end up being interpreted as "full_page"
    sub-structure instead. The low 32 bits of the GFN used would match the
    grant reference specified in I's transitive grant entry, while the upper
    32 bits could be random (depending on how exactly I sets up its grant
    table entries).
    
    Note that if one mapping already exists and the granting domain _then_
    changes the grant to GTF_transitive (which the domain is not supposed to
    do), the changed type will only be honored after the pin count has gone
    back to zero. This is no different from e.g. GTF_readonly or
    GTF_sub_page becoming set when a grant is already in use.
    
    While adjusting the implementation, also adjust commentary in the public
    header to better reflect reality.
    
    Fixes: 3672ce675c93 ("Transitive grant support")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: b339e3a976b1680f57051adabcb98281198f7eac
    master date: 2021-02-18 13:16:12 +0100
---
 xen/common/grant_table.c         | 9 +++++----
 xen/include/public/grant_table.h | 6 ++++--
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 41fd89f5d9..0e0ec1b5aa 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -795,9 +795,10 @@ static int _set_status_v2(const grant_entry_header_t *shah,
         mask |= GTF_sub_page;
 
     /* If not already pinned, check the grant domid and type. */
-    if ( !act->pin && ((((scombo.flags & mask) != GTF_permit_access) &&
-                        ((scombo.flags & mask) != GTF_transitive)) ||
-                       (scombo.domid != ldomid)) )
+    if ( !act->pin &&
+         ((((scombo.flags & mask) != GTF_permit_access) &&
+           (mapflag || ((scombo.flags & mask) != GTF_transitive))) ||
+          (scombo.domid != ldomid)) )
         PIN_FAIL(done, GNTST_general_error,
                  "Bad flags (%x) or dom (%d); expected d%d, flags %x\n",
                  scombo.flags, scombo.domid, ldomid, mask);
@@ -823,7 +824,7 @@ static int _set_status_v2(const grant_entry_header_t *shah,
     if ( !act->pin )
     {
         if ( (((scombo.flags & mask) != GTF_permit_access) &&
-              ((scombo.flags & mask) != GTF_transitive)) ||
+              (mapflag || ((scombo.flags & mask) != GTF_transitive))) ||
              (scombo.domid != ldomid) ||
              (!readonly && (scombo.flags & GTF_readonly)) )
         {
diff --git a/xen/include/public/grant_table.h b/xen/include/public/grant_table.h
index 3b7bf93d74..84b1d26b36 100644
--- a/xen/include/public/grant_table.h
+++ b/xen/include/public/grant_table.h
@@ -166,11 +166,13 @@ typedef struct grant_entry_v1 grant_entry_v1_t;
 #define GTF_type_mask       (3U<<0)
 
 /*
- * Subflags for GTF_permit_access.
+ * Subflags for GTF_permit_access and GTF_transitive.
  *  GTF_readonly: Restrict @domid to read-only mappings and accesses. [GST]
  *  GTF_reading: Grant entry is currently mapped for reading by @domid. [XEN]
  *  GTF_writing: Grant entry is currently mapped for writing by @domid. [XEN]
- *  GTF_PAT, GTF_PWT, GTF_PCD: (x86) cache attribute flags for the grant [GST]
+ * Further subflags for GTF_permit_access only.
+ *  GTF_PAT, GTF_PWT, GTF_PCD: (x86) cache attribute flags to be used for
+ *                             mappings of the grant [GST]
  *  GTF_sub_page: Grant access to only a subrange of the page.  @domid
  *                will only be allowed to copy from the grant, and not
  *                map it. [GST]
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:57:19 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:57:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93824.177206 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBtH-0001kJ-Ss; Fri, 05 Mar 2021 14:57:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93824.177206; Fri, 05 Mar 2021 14:57:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBtH-0001kA-Pi; Fri, 05 Mar 2021 14:57:19 +0000
Received: by outflank-mailman (input) for mailman id 93824;
 Fri, 05 Mar 2021 14:57:18 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBtG-0001k1-II
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:57:18 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBtG-0008UM-H8
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:57:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBtG-0000tL-GG
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:57:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=viomUDiDgN35Q9RbG7viuVb7WCEWJ6j3wLnZ+VpVIXo=; b=LpmtXhlpruHJPwU1WOmNXheqDn
	ZZW0qd6arhRe+3pdrNvDQeLc90tCj9WTh+bfOz6hHXWhhXutVRbuFaidJauvYcHjfAlqYm+VvxJ81
	rP/PITCuM1FgBPpE1/S/lA7qWXWhXIIfygZX7j5Vs2nr/NN7QV6Jf3yGn1mOVTG5LlOc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] gnttab: bypass IOMMU (un)mapping when a domain is (un)mapping its own grant
Message-Id: <E1lIBtG-0000tL-GG@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:57:18 +0000

commit 98e6482bd1d805706519290b8488076c2a8feac1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:47:35 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:47:35 2021 +0100

    gnttab: bypass IOMMU (un)mapping when a domain is (un)mapping its own grant
    
    Mappings for a domain's own pages should already be present in the
    IOMMU. While installing the same mapping again is merely redundant (and
    inefficient), removing the mapping when the grant mapping gets removed
    is outright wrong in this case: The mapping was there before the map, so
    should remain in place after unmapping.
    
    This affects
    - Arm Dom0 in the direct mapped case,
    - x86 PV Dom0 in the "iommu=dom0-strict" / "dom0-iommu=strict" case,
    - all x86 PV DomU-s, including driver domains.
    
    See the code comment for why it's the original domain and not the page
    owner that gets compared against.
    
    Reported-by: Rahul Singh <Rahul.Singh@arm.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    master commit: e8185c5f01c68f7d29d23a4a91bc1be1ff2cc1ca
    master date: 2021-02-18 13:16:59 +0100
---
 xen/common/grant_table.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 0e0ec1b5aa..b15e978d06 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1168,7 +1168,14 @@ map_grant_ref(
         goto undo_out;
     }
 
-    need_iommu = gnttab_need_iommu_mapping(ld);
+    /*
+     * This is deliberately not checking the page's owner: get_paged_frame()
+     * explicitly rejects foreign pages, and all success paths above yield
+     * either owner == rd or owner == dom_io (the dom_cow case is irrelevant
+     * as mem-sharing and IOMMU use are incompatible). The dom_io case would
+     * need checking separately if we compared against owner here.
+     */
+    need_iommu = ld != rd && gnttab_need_iommu_mapping(ld);
     if ( need_iommu )
     {
         unsigned int kind;
@@ -1432,7 +1439,8 @@ unmap_common(
     if ( put_handle )
         put_maptrack_handle(lgt, op->handle);
 
-    if ( rc == GNTST_okay && gnttab_need_iommu_mapping(ld) )
+    /* See the respective comment in map_grant_ref(). */
+    if ( rc == GNTST_okay && ld != rd && gnttab_need_iommu_mapping(ld) )
     {
         unsigned int kind;
         int err = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:57:29 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:57:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93825.177211 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBtR-0001lq-Ud; Fri, 05 Mar 2021 14:57:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93825.177211; Fri, 05 Mar 2021 14:57:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBtR-0001lf-RG; Fri, 05 Mar 2021 14:57:29 +0000
Received: by outflank-mailman (input) for mailman id 93825;
 Fri, 05 Mar 2021 14:57: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 1lIBtQ-0001lU-Ky
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:57:28 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBtQ-0008Um-KJ
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:57:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBtQ-0000tu-JK
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:57:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MW4CtbpTH85PnHcPwwPJv+yxDjzVv1rOaU9bNldl/DA=; b=kYHnQacHZ+IpbnEDIx9UBgOZUj
	onDHoGis5Kpg4zEcCPJykdAZET/vhF0hRMVcsxtCN+YhPm3Zg4Ds4nuSEfpq6CdDtH/pX36Kdq/D1
	rDnTVYdC/LqjYopXzyrmgrholqYHoqVzQg6vQThkDVD1Pj06Bq2WPeWWE/A9FMYzgLlE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/EFI: suppress GNU ld 2.36'es creation of base relocs
Message-Id: <E1lIBtQ-0000tu-JK@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:57:28 +0000

commit a4c4fc0de3bd5c6847a2b8077a02ea6e9d26bab0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:48:06 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:48:06 2021 +0100

    x86/EFI: suppress GNU ld 2.36'es creation of base relocs
    
    All of the sudden ld creates base relocations itself, for PE
    executables - as a result we now have two of them for every entity to
    be relocated. While we will likely want to use this down the road, it
    doesn't work quite right yet in corner cases, so rather than suppressing
    our own way of creating the relocations we need to tell ld to avoid
    doing so.
    
    Probe whether --disable-reloc-section (which was introduced by the same
    commit making relocation generation the default) is recognized by ld's PE
    emulation, and use the option if so. (To limit redundancy, move the first
    part of setting EFI_LDFLAGS earlier, and use it already while probing.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 76cbb9c3f4dd9ab6aa44eeacab84fb88b2e8bfc1
    master date: 2021-02-25 15:11:58 +0100
---
 xen/arch/x86/Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 4212eb1d93..c57ae581dd 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -173,8 +173,13 @@ EFI_LDFLAGS += --major-subsystem-version=2 --minor-subsystem-version=0
 # Check if the compiler supports the MS ABI.
 export XEN_BUILD_EFI := $(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c efi/check.c -o efi/check.o 2>/dev/null && echo y)
 # Check if the linker supports PE.
-XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) -mi386pep --subsystem=10 -S -o efi/check.efi efi/check.o 2>/dev/null && echo y))
+XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) $(call EFI_LDFLAGS,0x100000000) -o efi/check.efi efi/check.o 2>/dev/null && echo y))
 CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
+# Check if the linker produces fixups in PE by default (we need to disable it doing so for now).
+XEN_NO_PE_FIXUPS := $(if $(XEN_BUILD_EFI), \
+                         $(shell $(LD) $(call EFI_LDFLAGS,0x100000000) --disable-reloc-section -o efi/check.efi efi/check.o 2>/dev/null && \
+                                 echo --disable-reloc-section))
+EFI_LDFLAGS += $(XEN_NO_PE_FIXUPS)
 
 $(TARGET).efi: VIRT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A VIRT_START$$,,p')
 $(TARGET).efi: ALT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A ALT_START$$,,p')
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:57:40 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:57:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93826.177213 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBtb-0001nU-Vj; Fri, 05 Mar 2021 14:57:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93826.177213; Fri, 05 Mar 2021 14:57:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBtb-0001nN-Sr; Fri, 05 Mar 2021 14:57:39 +0000
Received: by outflank-mailman (input) for mailman id 93826;
 Fri, 05 Mar 2021 14:57: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 1lIBta-0001n9-Og
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:57: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 1lIBta-0008V2-Nu
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:57:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBta-0000uY-N0
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:57:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ftMcjnNRCfR7Mw8E9OKITNtO4NPruP1ubrSKE6poRVs=; b=qAjBW/60a4rJ4freSzAVBqnLwp
	5hGoPd7uiSL6BbbuSYMsxscjFul/Wnw/Deb/lV+rsH9wivLaXw1oqz6X8ytKRCKjU8FK/lcI/d73F
	NMONvhAbO4nf+h980eHeocLD0EM57hRcs75mnZkz0D34wgwzbrGXdLs2i8yHZgNUntNs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] xen/sched: Add missing memory barrier in vcpu_block()
Message-Id: <E1lIBta-0000uY-N0@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:57:38 +0000

commit 8384641f6b1abe6c9f916a219100b352e5f30d27
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Mar 5 15:48:45 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:48:45 2021 +0100

    xen/sched: Add missing memory barrier in vcpu_block()
    
    The comment in vcpu_block() states that the events should be checked
    /after/ blocking to avoids wakeup waiting race. However, from a generic
    perspective, set_bit() doesn't prevent re-ordering. So the following
    could happen:
    
    CPU0  (blocking vCPU A)         |   CPU1 ( unblock vCPU A)
                                    |
    A <- read local events          |
                                    |   set local events
                                    |   test_and_clear_bit(_VPF_blocked)
                                    |       -> Bail out as the bit if not set
                                    |
    set_bit(_VFP_blocked)           |
                                    |
    check A                         |
    
    The variable A will be 0 and therefore the vCPU will be blocked when it
    should continue running.
    
    vcpu_block() is now gaining an smp_mb__after_atomic() to prevent the CPU
    to read any information about local events before the flag _VPF_blocked
    is set.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ash Wilding <ash.j.wilding@gmail.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Dario Faggioli <dfaggioli@suse.com>
    
    atomics: introduce smp_mb__[after|before]_atomic() barriers
    
    When using atomic variables for synchronization barriers are needed
    to ensure proper data serialization. Introduce smp_mb__before_atomic()
    and smp_mb__after_atomic() as in the Linux kernel for that purpose.
    
    Use the same definitions as in the Linux kernel.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: 109e8177fd4a225e7025c4c17d2c9537b550b4ed
    master date: 2021-02-26 09:47:23 +0000
    master commit: c301211a511111caca29f3bd797eb13965026c78
    master date: 2020-03-26 12:42:19 +0100
---
 xen/common/schedule.c        | 2 ++
 xen/include/asm-arm/system.h | 3 +++
 xen/include/asm-x86/system.h | 3 +++
 3 files changed, 8 insertions(+)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 6b1ae7bf8c..a698a13698 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1366,6 +1366,8 @@ void vcpu_block(void)
 
     set_bit(_VPF_blocked, &v->pause_flags);
 
+    smp_mb__after_atomic();
+
     arch_vcpu_block(v);
 
     /* Check for events /after/ blocking: avoids wakeup waiting race. */
diff --git a/xen/include/asm-arm/system.h b/xen/include/asm-arm/system.h
index e5d062667d..65d5c8e423 100644
--- a/xen/include/asm-arm/system.h
+++ b/xen/include/asm-arm/system.h
@@ -30,6 +30,9 @@
 
 #define smp_wmb()       dmb(ishst)
 
+#define smp_mb__before_atomic()    smp_mb()
+#define smp_mb__after_atomic()     smp_mb()
+
 /*
  * This is used to ensure the compiler did actually allocate the register we
  * asked it for some inline assembly sequences.  Apparently we can't trust
diff --git a/xen/include/asm-x86/system.h b/xen/include/asm-x86/system.h
index 069f422f0d..7e5891f3df 100644
--- a/xen/include/asm-x86/system.h
+++ b/xen/include/asm-x86/system.h
@@ -233,6 +233,9 @@ static always_inline unsigned long __xadd(
 #define set_mb(var, value) do { xchg(&var, value); } while (0)
 #define set_wmb(var, value) do { var = value; smp_wmb(); } while (0)
 
+#define smp_mb__before_atomic()    do { } while (0)
+#define smp_mb__after_atomic()     do { } while (0)
+
 /**
  * array_index_mask_nospec() - generate a mask that is ~0UL when the
  *      bounds check succeeds and 0 otherwise
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 05 14:57:50 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Mar 2021 14:57:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.93827.177219 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBtm-0001pC-1v; Fri, 05 Mar 2021 14:57:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 93827.177219; Fri, 05 Mar 2021 14:57:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIBtl-0001p1-Uq; Fri, 05 Mar 2021 14:57:49 +0000
Received: by outflank-mailman (input) for mailman id 93827;
 Fri, 05 Mar 2021 14:57: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 1lIBtk-0001or-Sn
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:57: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 1lIBtk-0008VE-Qy
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:57:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIBtk-0000vA-QH
 for xen-changelog@lists.xenproject.org; Fri, 05 Mar 2021 14:57: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=muNeWDJSjPiN6UU98qB13Iz9rnYKOrTsJELVNaBPM30=; b=jXSJ1XqYGl0nCSut6lXq27baal
	CA8fOCd0Vl4DAjyGa64Jdt8vt0x+Z0GpFmAnIeJ5BFn45ueU09/D/yymsb5yTrpAk8l5VkW5ZvRRf
	ykQntUFgz6PvmxKQhURxdFf8U3SU6MSzw+N6kOfrfUzQubpfH5s7IBVb3M3GLrl4QyV8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/dmop: Properly fail for PV guests
Message-Id: <E1lIBtk-0000vA-QH@xenbits.xenproject.org>
Date: Fri, 05 Mar 2021 14:57:48 +0000

commit 24b181e4e4c6c6fe28217c845d6d753da1606aeb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 5 15:49:32 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:49:32 2021 +0100

    x86/dmop: Properly fail for PV guests
    
    The current code has an early exit for PV guests, but it returns 0 having done
    nothing.
    
    Fixes: 524a98c2ac5 ("public / x86: introduce __HYPERCALL_dm_op...")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 615367b5275a5b0123f1f1ee86c985fab234a5a4
    master date: 2021-02-26 12:28:52 +0000
---
 xen/arch/x86/hvm/dm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c
index d6d0e8be89..c387a1e49e 100644
--- a/xen/arch/x86/hvm/dm.c
+++ b/xen/arch/x86/hvm/dm.c
@@ -368,6 +368,7 @@ static int dm_op(const struct dmop_args *op_args)
     if ( rc )
         return rc;
 
+    rc = -EINVAL;
     if ( !is_hvm_domain(d) )
         goto out;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 07:11:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 07:11:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94159.177614 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIR5c-0000Kg-4E; Sat, 06 Mar 2021 07:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94159.177614; Sat, 06 Mar 2021 07:11: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 1lIR5c-0000KY-0e; Sat, 06 Mar 2021 07:11:04 +0000
Received: by outflank-mailman (input) for mailman id 94159;
 Sat, 06 Mar 2021 07: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 1lIR5a-0000KQ-Ch
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07: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 1lIR5a-0002oP-Bv
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIR5a-0004CU-9D
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07: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=csD9ZyZ7wnt5cKHEWAuOIHnl+Ryvi4UuuJJdGzO/P+I=; b=GRyb4ezRsqDXA0weKVINkQFt7x
	JSM2JIlKVt1kMnlnkFXENPqZqs/+rmy2F1J+NEHd+biXZddQjmIf5k1/705nKcU7XWPs9Uy1bGAFV
	6sANVjagIp9ndRB+dE4e3sW6vBSTnw6nS2VFCxTuvf/Fjfc0QgaeywQQC/YxJ5juDsi8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/vioapic: check IRR before attempting to inject interrupt after EOI
Message-Id: <E1lIR5a-0004CU-9D@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 07:11:02 +0000

commit 761995ee29ac7c43d88a5e853f0a75a653b23b11
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Mar 5 15:26:05 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:26:05 2021 +0100

    x86/vioapic: check IRR before attempting to inject interrupt after EOI
    
    In vioapic_update_EOI the irq_lock will be dropped in order to forward
    the EOI to the dpci handler, so there's a window between clearing IRR
    and checking if the line is asserted where IRR can change behind our
    back.
    
    Fix this by checking whether IRR is set before attempting to inject a
    new interrupt.
    
    Fixes: 06e3f8f2766 ('vt-d: Do dpci eoi outside of irq_lock.')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: ba584fb1a26c058ebd0e6a2779287b3e4400415c
    master date: 2021-01-22 12:13:05 +0100
---
 xen/arch/x86/hvm/vioapic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index abb27a5704..99e137df33 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -544,7 +544,7 @@ void vioapic_update_EOI(struct domain *d, u8 vector)
             }
 
             if ( (ent->fields.trig_mode == VIOAPIC_LEVEL_TRIG) &&
-                 !ent->fields.mask &&
+                 !ent->fields.mask && !ent->fields.remote_irr &&
                  hvm_irq->gsi_assert_count[vioapic->base_gsi + pin] )
             {
                 ent->fields.remote_irr = 1;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 07:11:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 07:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94160.177617 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIR5m-0000NK-5I; Sat, 06 Mar 2021 07:11:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94160.177617; Sat, 06 Mar 2021 07: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 1lIR5m-0000NC-2F; Sat, 06 Mar 2021 07:11:14 +0000
Received: by outflank-mailman (input) for mailman id 94160;
 Sat, 06 Mar 2021 07: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 1lIR5k-0000LW-HU
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07: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 1lIR5k-0002oY-FD
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIR5k-0004DM-E9
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07: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=dXXNguHH4nMmBgGZX8jcxIXdTa43QWR9/p/SowOgtIE=; b=tvjagik/GAYJDc4HqKJWxHni6/
	v73o5iq/FYDFk7r38tw4S64HjYWLJFfFfSM+LgsOWy5I39/JRCNCAhGrs708qIrAGlSu3EAdXdtfL
	7wp4mM5pMTWSNGYvhb5e3rxNUwfUdr6JR/z9l/fQhwOELIYGCHL9tq3OYPZf+zcSo8B4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] xen/include: compat/xlat.h may change with .config changes
Message-Id: <E1lIR5k-0004DM-E9@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 07:11:12 +0000

commit a473bdd81bc109b104a451c71f9402150796a1ff
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:26:51 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:26:51 2021 +0100

    xen/include: compat/xlat.h may change with .config changes
    
    $(xlat-y) getting derived from $(headers-y) means its contents may
    change with changes to .config. The individual files $(xlat-y) refers
    to, otoh, may not change, and hence not trigger rebuilding of xlat.h.
    (Note that the issue was already present before the commit referred to
    below, but it was far more limited in affecting only changes to
    CONFIG_XSM_FLASK.)
    
    Fixes: 2c8fabb2232d ("x86: only generate compat headers actually needed")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c7b0f25e8f86373ed54e1c446f8e67ce25ac6819
    master date: 2021-01-26 14:42:23 +0100
---
 xen/include/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/Makefile b/xen/include/Makefile
index 089314dc72..687aa130d8 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -89,7 +89,7 @@ compat/.xlat/%.lst: xlat.lst Makefile
 xlat-y := $(shell sed -ne 's,@arch@,$(compat-arch-y),g' -re 's,^[?!][[:blank:]]+[^[:blank:]]+[[:blank:]]+,,p' xlat.lst | uniq)
 xlat-y := $(filter $(patsubst compat/%,%,$(headers-y)),$(xlat-y))
 
-compat/xlat.h: $(addprefix compat/.xlat/,$(xlat-y)) Makefile
+compat/xlat.h: $(addprefix compat/.xlat/,$(xlat-y)) config/auto.conf Makefile
 	cat $(filter %.h,$^) >$@.new
 	mv -f $@.new $@
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 07:11:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 07:11:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94162.177621 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIR5w-0000Ov-7I; Sat, 06 Mar 2021 07:11:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94162.177621; Sat, 06 Mar 2021 07: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 1lIR5w-0000Om-3p; Sat, 06 Mar 2021 07:11:24 +0000
Received: by outflank-mailman (input) for mailman id 94162;
 Sat, 06 Mar 2021 07: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 1lIR5u-0000OX-JI
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07: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 1lIR5u-0002oj-I8
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIR5u-0004EC-HM
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07: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=ZOU7bTQ8lcNWDcxytctXHKRPJD0yTc+waPGepND8ADA=; b=3UUrn1tHOSUsedd9p3xNhjix9D
	+bZezQyEVUQuek/JhD4AQ73FpFTf7Zm/mfji/ValG415IupaXfFdHauNMwJeK0SQAMGBCgk+6/B0U
	riJKcKJ3dKseBwKewdQxiC66kLLFrFmIkBUnOf85HPhjuL2eX+3gVcoFKWtHmTXtsJD0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/timer: Fix boot on Intel systems using ITSSPRC static PIT clock gating
Message-Id: <E1lIR5u-0004EC-HM@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 07:11:22 +0000

commit f6f787de989655747795e216a7ca5d16e8cd7609
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 5 15:27:22 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:27:22 2021 +0100

    x86/timer: Fix boot on Intel systems using ITSSPRC static PIT clock gating
    
    Recent Intel client devices have disabled the legacy PIT for powersaving
    reasons, breaking compatibility with a traditional IBM PC.  Xen depends on a
    legacy timer interrupt to check that the IO-APIC/PIC routing is configured
    correctly, and fails to boot with:
    
      (XEN) *******************************
      (XEN) Panic on CPU 0:
      (XEN) IO-APIC + timer doesn't work!  Boot with apic_verbosity=debug and send report.  Then try booting with the `noapic` option
      (XEN) *******************************
    
    While this setting can be undone by Xen, the details of how to differ by
    chipset, and would be very short sighted for battery based devices.  See bit 2
    "8254 Static Clock Gating Enable" in:
    
      https://edc.intel.com/content/www/us/en/design/products-and-solutions/processors-and-chipsets/comet-lake-u/intel-400-series-chipset-on-package-platform-controller-hub-register-database/itss-power-reduction-control-itssprc-offset-3300/
    
    All impacted systems have an HPET, but there is no indication of the absence
    of PIT functionality, nor a suitable way to probe for its absence.  As a short
    term fix, reconfigure the HPET into legacy replacement mode.  A better
    longterm fix would be to avoid the reliance on the timer interrupt entirely.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: e1de4c196a2eb4fd5063c30a2e115adf144bdeef
    master date: 2021-01-27 19:15:19 +0000
---
 xen/arch/x86/hpet.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 66 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index f4951d7a20..59ad71592c 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -768,7 +768,7 @@ static u32 *hpet_boot_cfg;
 u64 __init hpet_setup(void)
 {
     static u64 __initdata hpet_rate;
-    u32 hpet_id, hpet_period;
+    unsigned int hpet_id, hpet_period, hpet_cfg;
     unsigned int last, rem;
 
     if ( hpet_rate )
@@ -803,6 +803,71 @@ u64 __init hpet_setup(void)
     if ( (rem * 2) > hpet_period )
         hpet_rate++;
 
+    /*
+     * Intel chipsets from Skylake/ApolloLake onwards can statically clock
+     * gate the 8259 PIT.  This option is enabled by default in slightly later
+     * systems, as turning the PIT off is a prerequisite to entering the C11
+     * power saving state.
+     *
+     * Xen currently depends on the legacy timer interrupt being active while
+     * IRQ routing is configured.
+     *
+     * Reconfigure the HPET into legacy mode to re-establish the timer
+     * interrupt.
+     */
+    if ( hpet_id & HPET_ID_LEGSUP &&
+         !((hpet_cfg = hpet_read32(HPET_CFG)) & HPET_CFG_LEGACY) )
+    {
+        unsigned int c0_cfg, ticks, count;
+
+        /* Stop the main counter. */
+        hpet_write32(hpet_cfg & ~HPET_CFG_ENABLE, HPET_CFG);
+
+        /* Reconfigure channel 0 to be 32bit periodic. */
+        c0_cfg = hpet_read32(HPET_Tn_CFG(0));
+        c0_cfg |= (HPET_TN_ENABLE | HPET_TN_PERIODIC | HPET_TN_SETVAL |
+                   HPET_TN_32BIT);
+        hpet_write32(c0_cfg, HPET_Tn_CFG(0));
+
+        /*
+         * The exact period doesn't have to match a legacy PIT.  All we need
+         * is an interrupt queued up via the IO-APIC to check routing.
+         *
+         * Use HZ as the frequency.
+         */
+        ticks = ((SECONDS(1) / HZ) * div_sc(hpet_rate, SECONDS(1), 32)) >> 32;
+
+        count = hpet_read32(HPET_COUNTER);
+
+        /*
+         * HPET_TN_SETVAL above is atrociously documented in the spec.
+         *
+         * Periodic HPET channels have a main comparator register, and
+         * separate "accumulator" register.  Despite being named accumulator
+         * in the spec, this is not an accurate description of its behaviour
+         * or purpose.
+         *
+         * Each time an interrupt is generated, the "accumulator" register is
+         * re-added to the comparator set up the new period.
+         *
+         * Normally, writes to the CMP register update both registers.
+         * However, under these semantics, it is impossible to set up a
+         * periodic timer correctly without the main HPET counter being at 0.
+         *
+         * Instead, HPET_TN_SETVAL is a self-clearing control bit which we can
+         * use for periodic timers to mean that the second write to CMP
+         * updates the accumulator only, and not the absolute comparator
+         * value.
+         *
+         * This lets us set a period when the main counter isn't at 0.
+         */
+        hpet_write32(count + ticks, HPET_Tn_CMP(0));
+        hpet_write32(ticks,         HPET_Tn_CMP(0));
+
+        /* Restart the main counter, and legacy mode. */
+        hpet_write32(hpet_cfg | HPET_CFG_ENABLE | HPET_CFG_LEGACY, HPET_CFG);
+    }
+
     return hpet_rate;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 07:11:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 07:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94163.177625 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIR66-0000Qd-Aq; Sat, 06 Mar 2021 07:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94163.177625; Sat, 06 Mar 2021 07:11: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 1lIR66-0000QW-7W; Sat, 06 Mar 2021 07:11:34 +0000
Received: by outflank-mailman (input) for mailman id 94163;
 Sat, 06 Mar 2021 07: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 1lIR64-0000QN-Mv
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07: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 1lIR64-0002oq-MD
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIR64-0004Ey-KA
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07: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=JhS1XjyPjxI7WbI8lNJF3LkTW9DdsJW9lzL2fV7f+/Q=; b=dSQ854ay5SyBWy3mFRQWuqfD9b
	cnrfr2d9wcjU9S4P2GSQzsajMSN7rxgro29708M8A8j3SSILCpcXAICPny6f3cOp4jfZZ7XhwyogY
	GV6fehwhkmuINp3K2jAn8mo99gV8kjXb1M60v4SvxUEMHzJjbsOHd64pRGR6EelDyMCY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] memory: bail from page scrubbing when CPU is no longer online
Message-Id: <E1lIR64-0004Ey-KA@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 07:11:32 +0000

commit 17810630a023631c7baa7b45ba2cde006304d694
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:28:30 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:28:30 2021 +0100

    memory: bail from page scrubbing when CPU is no longer online
    
    Scrubbing can significantly delay the offlining (parking) of a CPU (e.g.
    because of booting into in smt=0 mode), to a degree that the "CPU <n>
    still not dead..." messages logged on x86 in 1s intervals can be seen
    multiple times. There are no softirqs involved in this process, so
    extend the existing preemption check in the scrubbing logic to also exit
    when the CPU is no longer observed online.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 3c9fd69416f8ffc611705fb24dfb383203ddc84f
    master date: 2021-01-29 11:34:37 +0100
---
 xen/common/page_alloc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index d9578abb7c..8859fa4fd1 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1328,9 +1328,11 @@ bool scrub_free_pages(void)
                      * Scrub a few (8) pages before becoming eligible for
                      * preemption. But also count non-scrubbing loop iterations
                      * so that we don't get stuck here with an almost clean
-                     * heap.
+                     * heap. Consider the CPU no longer being seen as online as
+                     * a request to preempt immediately, to not unduly delay
+                     * its offlining.
                      */
-                    if ( cnt > 800 && softirq_pending(cpu) )
+                    if ( !cpu_online(cpu) || (cnt > 800 && softirq_pending(cpu)) )
                     {
                         preempt = true;
                         break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 07:11:44 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 07:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94164.177629 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIR6G-0000S3-CT; Sat, 06 Mar 2021 07:11:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94164.177629; Sat, 06 Mar 2021 07:11: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 1lIR6G-0000Rv-9U; Sat, 06 Mar 2021 07:11:44 +0000
Received: by outflank-mailman (input) for mailman id 94164;
 Sat, 06 Mar 2021 07: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 1lIR6E-0000Rm-QD
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07: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 1lIR6E-0002pI-PQ
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIR6E-0004HB-OQ
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07: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=TyUHMaVsiFwOoAd0+fbxNxK2fRD/8rwC12fbC9gcDuk=; b=48QtvKbMoew+ipfx+X8VQZLRSL
	5BcDHyA00kePzZoSM9TV+H9vdBcs5/2dcdnZJIdQPtj6yoXSaA5LHw/7oebNba01McIh9Wj8kH/1y
	XMjExBhHzmjlfHxU08QBNMN+gyPTZ5S7draZncvpRRWKsDI2OW/IKXp0/37nuKc2fC+g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/HVM: re-order error path of hvm_domain_initialise()
Message-Id: <E1lIR6E-0004HB-OQ@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 07:11:42 +0000

commit 3d09a43f75a7ad0d24b460d9ba6130da637ffeed
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:28:57 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:28:57 2021 +0100

    x86/HVM: re-order error path of hvm_domain_initialise()
    
    hvm_destroy_all_ioreq_servers(), called from
    hvm_domain_relinquish_resources(), invokes relocate_portio_handler(),
    which uses d->arch.hvm.io_handler. Defer freeing of this array
    accordingly on the error path of hvm_domain_initialise().
    
    Similarly rtc_deinit() requires d->arch.hvm.pl_time to still be around,
    or else an armed timer structure would get freed, and that timer never
    get killed.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: fbb3bf002b42803ef289ea2a649ebd5f25d22236
    master date: 2021-01-29 11:36:54 +0100
---
 xen/arch/x86/hvm/hvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 3001e7442b..ab45b0a588 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -714,15 +714,15 @@ int hvm_domain_initialise(struct domain *d)
  fail1:
     if ( is_hardware_domain(d) )
         xfree(d->arch.hvm.io_bitmap);
-    XFREE(d->arch.hvm.io_handler);
     XFREE(d->arch.hvm.params);
-    XFREE(d->arch.hvm.pl_time);
     XFREE(d->arch.hvm.irq);
  fail0:
     hvm_destroy_cacheattr_region_list(d);
     destroy_perdomain_mapping(d, PERDOMAIN_VIRT_START, 0);
  fail:
     hvm_domain_relinquish_resources(d);
+    XFREE(d->arch.hvm.io_handler);
+    XFREE(d->arch.hvm.pl_time);
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 07:11:54 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 07:11:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94165.177633 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIR6Q-0000Tb-Dh; Sat, 06 Mar 2021 07:11:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94165.177633; Sat, 06 Mar 2021 07:11: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 1lIR6Q-0000TT-Aw; Sat, 06 Mar 2021 07:11:54 +0000
Received: by outflank-mailman (input) for mailman id 94165;
 Sat, 06 Mar 2021 07: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 1lIR6O-0000TJ-T7
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07: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 1lIR6O-0002qx-SP
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIR6O-0004Ht-RM
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07: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=hfw4C8n4ILDdD2wIIGMh3XQ8J/VtCmDB13LCa+ZIDbo=; b=ObcS1Jz/vSV7PS8gkjBIMfIEIq
	sZ+PgMQ3c6TqQCFIj2AqQ5Vr5gB78ZpdsLVnP3OuQ7/kdxLJAyz7HvvH+YnsfNg5QelNf4FbZjwfW
	oskz3I15RXMhTRwTNiRGC/ca/JiVS4Gpo6UiGjUIReIFV97dl1vQkmpz+/o1hec6nOAg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/debug: fix page-overflow bug in dbg_rw_guest_mem
Message-Id: <E1lIR6O-0004Ht-RM@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 07:11:52 +0000

commit ec003beb5c94fc9918ac1cc87fcccf3892c237e2
Author:     Tamas K Lengyel <tamas@tklengyel.com>
AuthorDate: Fri Mar 5 15:29:31 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:29:31 2021 +0100

    x86/debug: fix page-overflow bug in dbg_rw_guest_mem
    
    When using gdbsx dbg_rw_guest_mem is used to read/write guest memory. When the
    buffer being accessed is on a page-boundary, the next page needs to be grabbed
    to access the correct memory for the buffer's overflown parts. While
    dbg_rw_guest_mem has logic to handle that, it broke with 229492e210a. Instead
    of grabbing the next page the code right now is looping back to the
    start of the first page. This results in errors like the following while trying
    to use gdb with Linux' lx-dmesg:
    
    [    0.114457] PM: hibernation: Registered nosave memory: [mem
    0xfdfff000-0xffffffff]
    [    0.114460] [mem 0x90000000-0xfbffffff] available for PCI demem 0
    [    0.114462] f]f]
    Python Exception <class 'ValueError'> embedded null character:
    Error occurred in Python: embedded null character
    
    Fixing this bug by taking the variable assignment outside the loop.
    
    Fixes: 229492e210a ("x86/debugger: use copy_to/from_guest() in dbg_rw_guest_mem()")
    Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 9dc687f155a57216b83b17f9cde55dd43e06b0cd
    master date: 2021-01-30 03:21:33 +0000
---
 xen/arch/x86/debug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/debug.c b/xen/arch/x86/debug.c
index 5d8acdad71..491033f356 100644
--- a/xen/arch/x86/debug.c
+++ b/xen/arch/x86/debug.c
@@ -112,10 +112,11 @@ static unsigned int dbg_rw_guest_mem(struct domain *dp, void * __user gaddr,
                                      void * __user buf, unsigned int len,
                                      bool toaddr, uint64_t pgd3)
 {
+    unsigned long addr = (unsigned long)gaddr;
+
     while ( len > 0 )
     {
         char *va;
-        unsigned long addr = (unsigned long)gaddr;
         mfn_t mfn;
         gfn_t gfn = INVALID_GFN;
         unsigned long pagecnt;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 07:12:04 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 07:12:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94166.177638 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIR6a-0000V1-Ft; Sat, 06 Mar 2021 07:12:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94166.177638; Sat, 06 Mar 2021 07:12: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 1lIR6a-0000Ur-CK; Sat, 06 Mar 2021 07:12:04 +0000
Received: by outflank-mailman (input) for mailman id 94166;
 Sat, 06 Mar 2021 07:12: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 1lIR6Z-0000Ug-2J
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:12: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 1lIR6Z-0002rL-0c
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:12:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIR6Y-0004Ig-UQ
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07: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=/Savp5PwWgM1S7tqn7/h+lU5gt0kJ68SWDTWZoXzv9k=; b=WdbOCwjQxdn44VKzU1ceEwmXUk
	Y3TPPZy2NSI9GmuZRZfnGH4uObIBV57uCss9czBBf/BcwdzbDgXSh/BpoWsG6gxvizaC5ifv9ZDKV
	5uJHqErvHhEz0l96E39lHETo6nQnWPsRYvz058Msh/doT+zO93haDz5BB0FnT5gFykjc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/string: correct memmove()'s forwarding to memcpy()
Message-Id: <E1lIR6Y-0004Ig-UQ@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 07:12:02 +0000

commit 72fc75d707ed1ab4b12189aacfcc237f8578590d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:29:52 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:29:52 2021 +0100

    x86/string: correct memmove()'s forwarding to memcpy()
    
    With memcpy() expanding to the compiler builtin, we may not hand it
    overlapping source and destination. We strictly mean to forward to our
    own implementation (a few lines up in the same source file).
    
    Fixes: 78825e1c60fa ("x86/string: Clean up x86/string.h")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 7b93d92a35dc7c0a6e5f1f79b3c887aa3e66ddc0
    master date: 2021-02-04 13:59:56 +0100
---
 xen/arch/x86/string.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/string.c b/xen/arch/x86/string.c
index e2f84638c4..bda24b14ac 100644
--- a/xen/arch/x86/string.c
+++ b/xen/arch/x86/string.c
@@ -43,7 +43,8 @@ void *(memmove)(void *dest, const void *src, size_t n)
         return dest;
 
     if ( dest < src )
-        return memcpy(dest, src, n);
+        /* Depends on Xen's implementation operating forwards. */
+        return (memcpy)(dest, src, n);
 
     asm volatile (
         "   std         ; "
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 07:12:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 07:12:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94167.177640 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIR6k-0000WH-Gr; Sat, 06 Mar 2021 07:12:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94167.177640; Sat, 06 Mar 2021 07:12: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 1lIR6k-0000WA-E2; Sat, 06 Mar 2021 07:12:14 +0000
Received: by outflank-mailman (input) for mailman id 94167;
 Sat, 06 Mar 2021 07:12: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 1lIR6j-0000W1-4P
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:12: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 1lIR6j-0002rX-3l
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIR6j-0004JM-2j
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:12: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=XDyL4SMI2sk73RSB6PlaQ7dL1yT6PKFWqCMs51SxFXk=; b=nkYZCx4DqpcxLiVurKMJq+Y2Xq
	9wHFJdO6ceZH4RWlc5KYJQ+UGzrUv22iWoDLOVgIrdVGVJXor8dc/AmS5wNWIsexfIUrt2PyqQDrL
	Rq6ryxohFGtJ3j9y5oBhgvihb5DBXUvVREo8PJ7j8d5U/Hw0UtGn+KNdvotH533KZryc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/efi: enable MS ABI attribute on clang
Message-Id: <E1lIR6j-0004JM-2j@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 07:12:13 +0000

commit c354bd746877591ad16ed80077ee367c9c98fa48
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Mar 5 15:30:23 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:30:23 2021 +0100

    x86/efi: enable MS ABI attribute on clang
    
    Or else the EFI service calls will use the wrong calling convention.
    
    The __ms_abi__ attribute is available on all supported versions of
    clang. Add a specific Clang check because the GCC version reported by
    Clang is below the required 4.4 to use the __ms_abi__ attribute.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    master commit: 92f5ffa58d188c9f9a9f1bcdccb6d6348d9df612
    master date: 2021-02-04 14:02:32 +0100
---
 xen/include/asm-x86/x86_64/efibind.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/asm-x86/x86_64/efibind.h b/xen/include/asm-x86/x86_64/efibind.h
index b013db175d..ddcfae07ec 100644
--- a/xen/include/asm-x86/x86_64/efibind.h
+++ b/xen/include/asm-x86/x86_64/efibind.h
@@ -172,7 +172,7 @@ typedef uint64_t   UINTN;
 #ifndef EFIAPI                  // Forces EFI calling conventions reguardless of compiler options
     #ifdef _MSC_EXTENSIONS
         #define EFIAPI __cdecl  // Force C calling convention for Microsoft C compiler
-    #elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+    #elif __clang__ || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
         #define EFIAPI __attribute__((__ms_abi__))  // Force Microsoft ABI
     #else
         #define EFIAPI          // Substitute expresion to force C calling convention
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 07:12:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 07:12:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94168.177647 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIR6u-0000Xk-JU; Sat, 06 Mar 2021 07:12:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94168.177647; Sat, 06 Mar 2021 07:12: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 1lIR6u-0000XZ-Fh; Sat, 06 Mar 2021 07:12:24 +0000
Received: by outflank-mailman (input) for mailman id 94168;
 Sat, 06 Mar 2021 07:12: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 1lIR6t-0000XM-7B
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:12: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 1lIR6t-0002re-6X
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:12:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIR6t-0004Jz-5n
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:12: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=g4wJc/UdVb675eIgTMvVldEHBi9ORufIHDhCvFVmNdE=; b=ITRGavHPzSH2PJL3AOYdPp/Hsa
	bFT02ejGeNGJtoB58pz3hwc0eZsvh2lCUVPccD2lV6jNoE0dElxCZ9/ifwMew42cyCbTHFX6z/XM+
	wmUsGEa9OC2mUz9MYohUAjPy1RNpDxD8NAuHogmgdG4Cr00moUjUzN3awxCWHZSGP/Hk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/EFI: work around GNU ld 2.36 issue
Message-Id: <E1lIR6t-0004Jz-5n@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 07:12:23 +0000

commit 73a269624b5b6625344af97269f480c4ff426508
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:31:12 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:31:12 2021 +0100

    x86/EFI: work around GNU ld 2.36 issue
    
    Our linker capability check fails with the recent binutils release's ld:
    
    .../check.o:(.debug_aranges+0x6): relocation truncated to fit: R_X86_64_32 against `.debug_info'
    .../check.o:(.debug_info+0x6): relocation truncated to fit: R_X86_64_32 against `.debug_abbrev'
    .../check.o:(.debug_info+0xc): relocation truncated to fit: R_X86_64_32 against `.debug_str'+76
    .../check.o:(.debug_info+0x11): relocation truncated to fit: R_X86_64_32 against `.debug_str'+d
    .../check.o:(.debug_info+0x15): relocation truncated to fit: R_X86_64_32 against `.debug_str'+2b
    .../check.o:(.debug_info+0x29): relocation truncated to fit: R_X86_64_32 against `.debug_line'
    .../check.o:(.debug_info+0x30): relocation truncated to fit: R_X86_64_32 against `.debug_str'+19
    .../check.o:(.debug_info+0x37): relocation truncated to fit: R_X86_64_32 against `.debug_str'+71
    .../check.o:(.debug_info+0x3e): relocation truncated to fit: R_X86_64_32 against `.debug_str'
    .../check.o:(.debug_info+0x45): relocation truncated to fit: R_X86_64_32 against `.debug_str'+5e
    .../check.o:(.debug_info+0x4c): additional relocation overflows omitted from the output
    
    Tell the linker to strip debug info as a workaround. Debug info has been
    getting stripped already anyway when linking the actual xen.efi.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: f4318db940c39cc656128fcf72df3e79d2e55bc1
    master date: 2021-02-05 14:09:42 +0100
---
 xen/arch/x86/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 26ff2a9a3e..7216bd7b68 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -176,7 +176,7 @@ EFI_LDFLAGS += --major-subsystem-version=2 --minor-subsystem-version=0
 # Check if the compiler supports the MS ABI.
 export XEN_BUILD_EFI := $(shell $(CC) $(XEN_CFLAGS) -c efi/check.c -o efi/check.o 2>/dev/null && echo y)
 # Check if the linker supports PE.
-XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) -mi386pep --subsystem=10 -o efi/check.efi efi/check.o 2>/dev/null && echo y))
+XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) -mi386pep --subsystem=10 -S -o efi/check.efi efi/check.o 2>/dev/null && echo y))
 CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
 
 $(TARGET).efi: VIRT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A VIRT_START$$,,p')
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 07:12:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 07:12:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94169.177651 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIR74-0000Z1-L1; Sat, 06 Mar 2021 07:12:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94169.177651; Sat, 06 Mar 2021 07: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 1lIR74-0000Yt-HT; Sat, 06 Mar 2021 07:12:34 +0000
Received: by outflank-mailman (input) for mailman id 94169;
 Sat, 06 Mar 2021 07:12: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 1lIR73-0000Yi-AF
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:12: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 1lIR73-0002ru-9Z
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:12:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIR73-0004Kf-8Z
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:12: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=wMZbkwEqn1/7atj7nVm41F9pnnn5ohDWJQUHu+IOSwg=; b=AlrBEQmcytryJeuKPZwnaH8ysI
	krI6BmZowmmHvoYX4AvOOuWO1k2VFVBCFBdaYsYpCCFfVh3foEELx0u3A36BydGGxXyvbu78hFdmw
	rduEJQjF0Kj5QlVEH5eU8kYUK7H0ItNiIHupkk92oSJ8kUk5DdcGpL/M3wRCsoQ6FBMs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/ucode/amd: Fix OoB read in cpu_request_microcode()
Message-Id: <E1lIR73-0004Kf-8Z@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 07:12:33 +0000

commit daa4149647e1ba5ea22de346e1894ae793a17500
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 5 15:31:50 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:31:50 2021 +0100

    x86/ucode/amd: Fix OoB read in cpu_request_microcode()
    
    verify_patch_size() is a maximum size check, and doesn't have a minimum bound.
    
    If the microcode container encodes a blob with a length less than 64 bytes,
    the subsequent calls to microcode_fits()/compare_header() may read off the end
    of the buffer.
    
    Fixes: 4de936a38a ("x86/ucode/amd: Rework parsing logic in cpu_request_microcode()")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1cbc4d89c45cba3929f1c0cb4bca0b000c4f174b
    master date: 2021-02-10 13:23:51 +0000
---
 xen/arch/x86/cpu/microcode/amd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index cd532321e8..5b45530d93 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -346,6 +346,7 @@ static struct microcode_patch *cpu_request_microcode(const void *buf, size_t siz
             if ( size < sizeof(*mc) ||
                  (mc = buf)->type != UCODE_UCODE_TYPE ||
                  size - sizeof(*mc) < mc->len ||
+                 mc->len < sizeof(struct microcode_patch) ||
                  (!skip_ucode && !verify_patch_size(mc->len)) )
             {
                 printk(XENLOG_ERR "microcode: Bad microcode data\n");
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 07:12:44 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 07:12:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94171.177653 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIR7E-0000ad-MK; Sat, 06 Mar 2021 07:12:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94171.177653; Sat, 06 Mar 2021 07: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 1lIR7E-0000aV-Iv; Sat, 06 Mar 2021 07:12:44 +0000
Received: by outflank-mailman (input) for mailman id 94171;
 Sat, 06 Mar 2021 07:12: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 1lIR7D-0000aM-Dr
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:12: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 1lIR7D-0002sO-D2
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:12:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIR7D-0004LY-C7
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:12:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8amGcv+KdKi+gqotr7HDOyMfOnEyK1sVSgWOsB1rbmc=; b=TXASyZV0BLdZotmLGZzWb5YV8P
	mzoaeBMmldYYq56F+fUPLoY8Bpm9weVDVYz00QgHu3qs5v1GZCl9Q6icQO7V+KvNVcy4dYJtYL3M5
	110XEnpT37VFuUhvhiwknIUKSmXEJbYkG+E8huAs8zBkfIxHDamv4yEIRtqAvkImlA5c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86emul: fix SYSENTER/SYSCALL switching into 64-bit mode
Message-Id: <E1lIR7D-0004LY-C7@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 07:12:43 +0000

commit 865eba02a1ec10972edbeb403b492e45e391f509
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:32:24 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:32:24 2021 +0100

    x86emul: fix SYSENTER/SYSCALL switching into 64-bit mode
    
    When invoked by compat mode, mode_64bit() will be false at the start of
    emulation. The logic after complete_insn, however, needs to consider the
    mode switched into, in particular to avoid truncating RIP.
    
    Inspired by / paralleling and extending Linux commit 943dea8af21b ("KVM:
    x86: Update emulator context mode if SYSENTER xfers to 64-bit mode").
    
    While there, tighten a related assertion in x86_emulate_wrapper() - we
    want to be sure to not switch into an impossible mode when the code gets
    built for 32-bit only (as is possible for the test harness).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citirix.com>
    master commit: f3e1eb2f0234c955243a915d69ebd84f26eec130
    master date: 2021-02-11 17:53:10 +0100
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 9b29548e2d..8ef66d824d 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -6124,6 +6124,10 @@ x86_emulate(
              (rc = ops->write_segment(x86_seg_ss, &sreg, ctxt)) )
             goto done;
 
+        if ( ctxt->lma )
+            /* In particular mode_64bit() needs to return true from here on. */
+            ctxt->addr_size = ctxt->sp_size = 64;
+
         /*
          * SYSCALL (unlike most instructions) evaluates its singlestep action
          * based on the resulting EFLAGS.TF, not the starting EFLAGS.TF.
@@ -6924,6 +6928,10 @@ x86_emulate(
                                       ctxt)) != X86EMUL_OKAY )
             goto done;
 
+        if ( ctxt->lma )
+            /* In particular mode_64bit() needs to return true from here on. */
+            ctxt->addr_size = ctxt->sp_size = 64;
+
         singlestep = _regs.eflags & X86_EFLAGS_TF;
         break;
 
@@ -12096,8 +12104,12 @@ int x86_emulate_wrapper(
     unsigned long orig_ip = ctxt->regs->r(ip);
     int rc;
 
+#ifdef __x86_64__
     if ( mode_64bit() )
         ASSERT(ctxt->lma);
+#else
+    ASSERT(!ctxt->lma && !mode_64bit());
+#endif
 
     rc = x86_emulate(ctxt, ops);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 07:12:55 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 07:12:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94172.177657 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIR7P-0000cO-PF; Sat, 06 Mar 2021 07:12:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94172.177657; Sat, 06 Mar 2021 07:12: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 1lIR7P-0000cG-M8; Sat, 06 Mar 2021 07:12:55 +0000
Received: by outflank-mailman (input) for mailman id 94172;
 Sat, 06 Mar 2021 07:12: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 1lIR7N-0000c4-HB
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:12: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 1lIR7N-0002sZ-GS
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:12:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIR7N-0004MS-Ey
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:12: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=q3Z8joEZ/XhTT++qZwsXeiazus95kZzcsBVEE0kYEeo=; b=c1Nkhy2HCfD/xpUBMAFWdpeEHS
	UZPEjWyQa9adhpPBUmrfX4cd1oRSJFq5rbhK5Oz/QNI7zXypnFc5iR5GC1LTdwyfCzqe9IpM+XSNp
	4q4lkcS3IJmsqroeAyaiwAvXiRPT0jlEzAtvoOpHdTdKExIOFV5isbYt+Uxr9OeoMmgU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] xen/iommu: Check if the IOMMU was initialized before tearing down
Message-Id: <E1lIR7N-0004MS-Ey@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 07:12:53 +0000

commit 605e1d92efa0a00e81396fd7510046ed38bd9197
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Mar 5 15:33:27 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:33:27 2021 +0100

    xen/iommu: Check if the IOMMU was initialized before tearing down
    
    is_iommu_enabled() will return true even if the IOMMU has not been
    initialized (e.g. the ops are not set).
    
    In the case of an early failure in arch_domain_init(), the function
    iommu_destroy_domain() will be called even if the IOMMU is not
    initialized.
    
    This will result to dereference the ops which will be NULL and an host
    crash.
    
    Fix the issue by checking that ops has been set before accessing it.
    
    Fixes: 71e617a6b8f6 ("use is_iommu_enabled() where appropriate...")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: d670ef3401b91d04c58d72cd8ce5579b4fa900d8
    master date: 2021-02-17 11:30:05 +0000
---
 xen/drivers/passthrough/iommu.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 1d644844ab..75eef853f4 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -225,6 +225,13 @@ static void iommu_teardown(struct domain *d)
 {
     struct domain_iommu *hd = dom_iommu(d);
 
+    /*
+     * During early domain creation failure, we may reach here with the
+     * ops not yet initialized.
+     */
+    if ( !hd->platform_ops )
+        return;
+
     hd->platform_ops->teardown(d);
     tasklet_schedule(&iommu_pt_cleanup_tasklet);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 07:13:04 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 07:13:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94173.177661 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIR7Y-0000dO-Qr; Sat, 06 Mar 2021 07:13:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94173.177661; Sat, 06 Mar 2021 07: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 1lIR7Y-0000dH-Nc; Sat, 06 Mar 2021 07:13:04 +0000
Received: by outflank-mailman (input) for mailman id 94173;
 Sat, 06 Mar 2021 07: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 1lIR7X-0000dA-KR
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07: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 1lIR7X-0002sw-Jm
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:13:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIR7X-0004Na-In
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:13: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=vZyEx/1SZR3v2uWOfsfwc/vKeW3pjvTt14/yEcU9a5g=; b=PlNh4gNV+gJgJQyQ76y04cUnWV
	kkTGyeb7Q22VGVTPWTem/KpmPzoY2G6kcweKv1X/hEc4wjHh0SP/B9nsuxe1gzFlDTFtjmhb2mkpy
	9uCiSMtsuRvC1uQLbJTXzmCf2yBXtqysIQBGxdWqgp3EgxLskhEOQ8xdX+j87VtG7/as=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] gnttab: never permit mapping transitive grants
Message-Id: <E1lIR7X-0004Na-In@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 07:13:03 +0000

commit 4a505ed5c4b7b333e22fb485ddfa5a19029045ad
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:34:07 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:34:07 2021 +0100

    gnttab: never permit mapping transitive grants
    
    Transitive grants allow an intermediate domain I to grant a target
    domain T access to a page which origin domain O did grant I access to.
    As an implementation restriction, T is not allowed to map such a grant.
    This restriction is currently tried to be enforced by marking active
    entries resulting from transitive grants as is-sub-page; sub-page grants
    for obvious reasons don't allow mapping. However, marking (and checking)
    only active entries is insufficient, as a map attempt may also occur on
    a grant not otherwise in use. When not presently in use (pin count zero)
    the grant type itself needs checking. Otherwise T may be able to map an
    unrelated page owned by I. This is because the "transitive" sub-
    structure of the v2 union would end up being interpreted as "full_page"
    sub-structure instead. The low 32 bits of the GFN used would match the
    grant reference specified in I's transitive grant entry, while the upper
    32 bits could be random (depending on how exactly I sets up its grant
    table entries).
    
    Note that if one mapping already exists and the granting domain _then_
    changes the grant to GTF_transitive (which the domain is not supposed to
    do), the changed type will only be honored after the pin count has gone
    back to zero. This is no different from e.g. GTF_readonly or
    GTF_sub_page becoming set when a grant is already in use.
    
    While adjusting the implementation, also adjust commentary in the public
    header to better reflect reality.
    
    Fixes: 3672ce675c93 ("Transitive grant support")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: b339e3a976b1680f57051adabcb98281198f7eac
    master date: 2021-02-18 13:16:12 +0100
---
 xen/common/grant_table.c         | 9 +++++----
 xen/include/public/grant_table.h | 6 ++++--
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 9f0cae52c0..4a6ae52ae3 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -836,9 +836,10 @@ static int _set_status_v2(const grant_entry_header_t *shah,
         mask |= GTF_sub_page;
 
     /* If not already pinned, check the grant domid and type. */
-    if ( !act->pin && ((((scombo.flags & mask) != GTF_permit_access) &&
-                        ((scombo.flags & mask) != GTF_transitive)) ||
-                       (scombo.domid != ldomid)) )
+    if ( !act->pin &&
+         ((((scombo.flags & mask) != GTF_permit_access) &&
+           (mapflag || ((scombo.flags & mask) != GTF_transitive))) ||
+          (scombo.domid != ldomid)) )
         PIN_FAIL(done, GNTST_general_error,
                  "Bad flags (%x) or dom (%d); expected d%d, flags %x\n",
                  scombo.flags, scombo.domid, ldomid, mask);
@@ -864,7 +865,7 @@ static int _set_status_v2(const grant_entry_header_t *shah,
     if ( !act->pin )
     {
         if ( (((scombo.flags & mask) != GTF_permit_access) &&
-              ((scombo.flags & mask) != GTF_transitive)) ||
+              (mapflag || ((scombo.flags & mask) != GTF_transitive))) ||
              (scombo.domid != ldomid) ||
              (!readonly && (scombo.flags & GTF_readonly)) )
         {
diff --git a/xen/include/public/grant_table.h b/xen/include/public/grant_table.h
index 3b7bf93d74..84b1d26b36 100644
--- a/xen/include/public/grant_table.h
+++ b/xen/include/public/grant_table.h
@@ -166,11 +166,13 @@ typedef struct grant_entry_v1 grant_entry_v1_t;
 #define GTF_type_mask       (3U<<0)
 
 /*
- * Subflags for GTF_permit_access.
+ * Subflags for GTF_permit_access and GTF_transitive.
  *  GTF_readonly: Restrict @domid to read-only mappings and accesses. [GST]
  *  GTF_reading: Grant entry is currently mapped for reading by @domid. [XEN]
  *  GTF_writing: Grant entry is currently mapped for writing by @domid. [XEN]
- *  GTF_PAT, GTF_PWT, GTF_PCD: (x86) cache attribute flags for the grant [GST]
+ * Further subflags for GTF_permit_access only.
+ *  GTF_PAT, GTF_PWT, GTF_PCD: (x86) cache attribute flags to be used for
+ *                             mappings of the grant [GST]
  *  GTF_sub_page: Grant access to only a subrange of the page.  @domid
  *                will only be allowed to copy from the grant, and not
  *                map it. [GST]
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 07:13:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 07:13:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94174.177665 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIR7i-0000es-SQ; Sat, 06 Mar 2021 07:13:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94174.177665; Sat, 06 Mar 2021 07:13: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 1lIR7i-0000ek-PO; Sat, 06 Mar 2021 07:13:14 +0000
Received: by outflank-mailman (input) for mailman id 94174;
 Sat, 06 Mar 2021 07:13: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 1lIR7h-0000ec-Nb
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:13: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 1lIR7h-0002t8-Mx
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:13:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIR7h-0004OG-M5
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:13: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=/Aa3YzHTJjI2zR2HASW4OprP1q2JnmbBjKcwjSCbZR4=; b=zdSFcLJozP4ga9HjzM2j+u3o+y
	Uxl77qUOkBLrdEoA+jK0iobeAAL3SXKYL83uKm0sAD2kphi+qtSWJzfbaArKvGc4yDPJXRkT0woyb
	yKLEeJrZh0zrEEhDkgQfEkiKgdh1xkdVOs2Hrcnmr6qTGAIWXSl4M5plZS6CijzlOZjw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] gnttab: bypass IOMMU (un)mapping when a domain is (un)mapping its own grant
Message-Id: <E1lIR7h-0004OG-M5@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 07:13:13 +0000

commit 9b6054a63ebae032cd14dc610ed6d7c21e7e7a2f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:34:53 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:34:53 2021 +0100

    gnttab: bypass IOMMU (un)mapping when a domain is (un)mapping its own grant
    
    Mappings for a domain's own pages should already be present in the
    IOMMU. While installing the same mapping again is merely redundant (and
    inefficient), removing the mapping when the grant mapping gets removed
    is outright wrong in this case: The mapping was there before the map, so
    should remain in place after unmapping.
    
    This affects
    - Arm Dom0 in the direct mapped case,
    - x86 PV Dom0 in the "iommu=dom0-strict" / "dom0-iommu=strict" case,
    - all x86 PV DomU-s, including driver domains.
    
    See the code comment for why it's the original domain and not the page
    owner that gets compared against.
    
    Reported-by: Rahul Singh <Rahul.Singh@arm.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    master commit: e8185c5f01c68f7d29d23a4a91bc1be1ff2cc1ca
    master date: 2021-02-18 13:16:59 +0100
---
 xen/common/grant_table.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 4a6ae52ae3..5239d1395c 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1207,7 +1207,14 @@ map_grant_ref(
         goto undo_out;
     }
 
-    need_iommu = gnttab_need_iommu_mapping(ld);
+    /*
+     * This is deliberately not checking the page's owner: get_paged_frame()
+     * explicitly rejects foreign pages, and all success paths above yield
+     * either owner == rd or owner == dom_io (the dom_cow case is irrelevant
+     * as mem-sharing and IOMMU use are incompatible). The dom_io case would
+     * need checking separately if we compared against owner here.
+     */
+    need_iommu = ld != rd && gnttab_need_iommu_mapping(ld);
     if ( need_iommu )
     {
         unsigned int kind;
@@ -1471,7 +1478,8 @@ unmap_common(
     if ( put_handle )
         put_maptrack_handle(lgt, op->handle);
 
-    if ( rc == GNTST_okay && gnttab_need_iommu_mapping(ld) )
+    /* See the respective comment in map_grant_ref(). */
+    if ( rc == GNTST_okay && ld != rd && gnttab_need_iommu_mapping(ld) )
     {
         unsigned int kind;
         int err = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 07:13:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 07:13:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94175.177669 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIR7s-0000gK-Tt; Sat, 06 Mar 2021 07:13:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94175.177669; Sat, 06 Mar 2021 07:13: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 1lIR7s-0000gC-R2; Sat, 06 Mar 2021 07:13:24 +0000
Received: by outflank-mailman (input) for mailman id 94175;
 Sat, 06 Mar 2021 07:13: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 1lIR7r-0000g6-QV
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:13: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 1lIR7r-0002tG-Pn
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:13:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIR7r-0004Ou-Oy
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:13: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=fqsxXpUB14W5WfpulO/iEkZZuHc9gcYgQfwpRoi5WAM=; b=LwSTJcogmOGg7iSCyUxWTSFE2u
	SheKw2iC6kMcgXmTLf9GkJpa9bAbd6Y2hN7Fv1BmUytDs2zfh6NQCMhhgENx5W/ESKE+RICPfiV9i
	OLT4Xa8hnq+ba99ABReWkkVv07aAnbCVBM5zZkE+HNRAsYv1itPsuNiY9JwF/91NPtUQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/EFI: suppress GNU ld 2.36'es creation of base relocs
Message-Id: <E1lIR7r-0004Ou-Oy@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 07:13:23 +0000

commit 97c0a5c05bb6ff87fd19b6366bb4a3ca006a32da
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:35:19 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:35:19 2021 +0100

    x86/EFI: suppress GNU ld 2.36'es creation of base relocs
    
    All of the sudden ld creates base relocations itself, for PE
    executables - as a result we now have two of them for every entity to
    be relocated. While we will likely want to use this down the road, it
    doesn't work quite right yet in corner cases, so rather than suppressing
    our own way of creating the relocations we need to tell ld to avoid
    doing so.
    
    Probe whether --disable-reloc-section (which was introduced by the same
    commit making relocation generation the default) is recognized by ld's PE
    emulation, and use the option if so. (To limit redundancy, move the first
    part of setting EFI_LDFLAGS earlier, and use it already while probing.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 76cbb9c3f4dd9ab6aa44eeacab84fb88b2e8bfc1
    master date: 2021-02-25 15:11:58 +0100
---
 xen/arch/x86/Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 7216bd7b68..d45b213ab6 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -176,8 +176,13 @@ EFI_LDFLAGS += --major-subsystem-version=2 --minor-subsystem-version=0
 # Check if the compiler supports the MS ABI.
 export XEN_BUILD_EFI := $(shell $(CC) $(XEN_CFLAGS) -c efi/check.c -o efi/check.o 2>/dev/null && echo y)
 # Check if the linker supports PE.
-XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) -mi386pep --subsystem=10 -S -o efi/check.efi efi/check.o 2>/dev/null && echo y))
+XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) $(call EFI_LDFLAGS,0x100000000) -o efi/check.efi efi/check.o 2>/dev/null && echo y))
 CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
+# Check if the linker produces fixups in PE by default (we need to disable it doing so for now).
+XEN_NO_PE_FIXUPS := $(if $(XEN_BUILD_EFI), \
+                         $(shell $(LD) $(call EFI_LDFLAGS,0x100000000) --disable-reloc-section -o efi/check.efi efi/check.o 2>/dev/null && \
+                                 echo --disable-reloc-section))
+EFI_LDFLAGS += $(XEN_NO_PE_FIXUPS)
 
 $(TARGET).efi: VIRT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A VIRT_START$$,,p')
 $(TARGET).efi: ALT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A ALT_START$$,,p')
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 07:13:35 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 07:13:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94176.177673 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIR82-0000hX-Vk; Sat, 06 Mar 2021 07:13:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94176.177673; Sat, 06 Mar 2021 07:13: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 1lIR82-0000hO-Se; Sat, 06 Mar 2021 07:13:34 +0000
Received: by outflank-mailman (input) for mailman id 94176;
 Sat, 06 Mar 2021 07:13: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 1lIR81-0000hG-Tf
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:13: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 1lIR81-0002tQ-Sy
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:13:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIR81-0004PX-S1
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:13: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=M4G0XlSANgttFaksxnPv6zoUad/LEeNiX09BHQ++mYQ=; b=liKY6HBfUf5WpVvNM/ykEqdZES
	5K0mYQ616c8dShIgY9aRDBHBtpCovwnNprIG8qTFrID8/cloAb4H/RAHzn3+sxbCnukLYI20+qu2W
	pYe3QaI+ajyWfHVvgQqmSnCRgUMcG7BLhC+xZLdUS5AVYWXKBRMNZxYRFjlFI8Lq2dWs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] xen/sched: Add missing memory barrier in vcpu_block()
Message-Id: <E1lIR81-0004PX-S1@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 07:13:33 +0000

commit 3eee5228247cb5286e9e219fba0b15349b0ae2a1
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Mar 5 15:35:54 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:35:54 2021 +0100

    xen/sched: Add missing memory barrier in vcpu_block()
    
    The comment in vcpu_block() states that the events should be checked
    /after/ blocking to avoids wakeup waiting race. However, from a generic
    perspective, set_bit() doesn't prevent re-ordering. So the following
    could happen:
    
    CPU0  (blocking vCPU A)         |   CPU1 ( unblock vCPU A)
                                    |
    A <- read local events          |
                                    |   set local events
                                    |   test_and_clear_bit(_VPF_blocked)
                                    |       -> Bail out as the bit if not set
                                    |
    set_bit(_VFP_blocked)           |
                                    |
    check A                         |
    
    The variable A will be 0 and therefore the vCPU will be blocked when it
    should continue running.
    
    vcpu_block() is now gaining an smp_mb__after_atomic() to prevent the CPU
    to read any information about local events before the flag _VPF_blocked
    is set.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ash Wilding <ash.j.wilding@gmail.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Dario Faggioli <dfaggioli@suse.com>
    master commit: 109e8177fd4a225e7025c4c17d2c9537b550b4ed
    master date: 2021-02-26 09:47:23 +0000
---
 xen/common/sched/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index ab94d2ec3a..1bd63c9de6 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -1360,6 +1360,8 @@ void vcpu_block(void)
 
     set_bit(_VPF_blocked, &v->pause_flags);
 
+    smp_mb__after_atomic();
+
     arch_vcpu_block(v);
 
     /* Check for events /after/ blocking: avoids wakeup waiting race. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 07:13:45 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 07:13:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94177.177677 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIR8D-0000iy-1H; Sat, 06 Mar 2021 07:13:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94177.177677; Sat, 06 Mar 2021 07:13: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 1lIR8C-0000ip-UF; Sat, 06 Mar 2021 07:13:44 +0000
Received: by outflank-mailman (input) for mailman id 94177;
 Sat, 06 Mar 2021 07:13: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 1lIR8C-0000ie-1A
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:13: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 1lIR8B-0002to-Vn
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:13:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIR8B-0004QJ-V3
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 07:13: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=PulGDarJBGbLYl+KB/qmDkvHuD/dmxcVjozWanSXjQo=; b=btxkpLQPXD6A00/oXkB6KLI26I
	sDEB+CFoWMEFBy+wusstwkqo//c1Ex3ucx8/b/ALLlt9QFzCi9tARLHBGM8brtOGKQX+vnxXHrRQE
	bTXLYvw6bsVkW4S1vjor6er8wlblIcYQSz7MpQeAc4RyN0cFROxqlwjooivyQ1te/38E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/dmop: Properly fail for PV guests
Message-Id: <E1lIR8B-0004QJ-V3@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 07:13:43 +0000

commit a1dab05393ec5654e2a88be296cc973595ffb1d0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 5 15:36:27 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:36:27 2021 +0100

    x86/dmop: Properly fail for PV guests
    
    The current code has an early exit for PV guests, but it returns 0 having done
    nothing.
    
    Fixes: 524a98c2ac5 ("public / x86: introduce __HYPERCALL_dm_op...")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 615367b5275a5b0123f1f1ee86c985fab234a5a4
    master date: 2021-02-26 12:28:52 +0000
---
 xen/arch/x86/hvm/dm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c
index e3f845165d..7586952633 100644
--- a/xen/arch/x86/hvm/dm.c
+++ b/xen/arch/x86/hvm/dm.c
@@ -370,6 +370,7 @@ static int dm_op(const struct dmop_args *op_args)
     if ( rc )
         return rc;
 
+    rc = -EINVAL;
     if ( !is_hvm_domain(d) )
         goto out;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 10:33:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 10:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94224.177720 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIUF5-0003dL-8K; Sat, 06 Mar 2021 10:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94224.177720; Sat, 06 Mar 2021 10: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 1lIUF5-0003dD-5Q; Sat, 06 Mar 2021 10:33:03 +0000
Received: by outflank-mailman (input) for mailman id 94224;
 Sat, 06 Mar 2021 10:33: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 1lIUF4-0003d8-Um
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10: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 1lIUF4-0006do-Ss
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIUF4-0001ky-RH
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10: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=8gaSRMmN3hthjv/7qxETmLA0HW3onEE7xiRIWJb0Uzg=; b=VDs/tCshEalu5px+F8qJCRTXUG
	vJg4tFo5yrCTjqzLOj0+oceBDiZkdHDIrwFLA7u7Ls+Td3qqJXrfa9V0uZWXvtUoE7HX67fWoHMj9
	FVNci3w09vBxWC2HbvKjEUHo8JVEX4Xb9rs1Sbqn+EOqeNZmrlTcglpyqkLcAIdw7wSI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/vioapic: check IRR before attempting to inject interrupt after EOI
Message-Id: <E1lIUF4-0001ky-RH@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 10:33:02 +0000

commit 8b4f699b65db279a04c09dd30425f3830d6ba654
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Mar 5 15:40:32 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:40:32 2021 +0100

    x86/vioapic: check IRR before attempting to inject interrupt after EOI
    
    In vioapic_update_EOI the irq_lock will be dropped in order to forward
    the EOI to the dpci handler, so there's a window between clearing IRR
    and checking if the line is asserted where IRR can change behind our
    back.
    
    Fix this by checking whether IRR is set before attempting to inject a
    new interrupt.
    
    Fixes: 06e3f8f2766 ('vt-d: Do dpci eoi outside of irq_lock.')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: ba584fb1a26c058ebd0e6a2779287b3e4400415c
    master date: 2021-01-22 12:13:05 +0100
---
 xen/arch/x86/hvm/vioapic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index da03b4d4b3..35717edf73 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -544,7 +544,7 @@ void vioapic_update_EOI(struct domain *d, u8 vector)
             }
 
             if ( (ent->fields.trig_mode == VIOAPIC_LEVEL_TRIG) &&
-                 !ent->fields.mask &&
+                 !ent->fields.mask && !ent->fields.remote_irr &&
                  hvm_irq->gsi_assert_count[vioapic->base_gsi + pin] )
             {
                 ent->fields.remote_irr = 1;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 10:33:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 10:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94225.177724 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIUFG-0003eN-Bv; Sat, 06 Mar 2021 10:33:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94225.177724; Sat, 06 Mar 2021 10:33: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 1lIUFG-0003eG-8V; Sat, 06 Mar 2021 10:33:14 +0000
Received: by outflank-mailman (input) for mailman id 94225;
 Sat, 06 Mar 2021 10:33: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 1lIUFF-0003eB-1C
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:33: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 1lIUFF-0006dw-0U
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:33:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIUFE-0001li-V4
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MenBEt3lL7qG8zvRFkoGoCE76LXRSbc8uixGOJiqDpY=; b=O+ZkH9fXkyhtG7mtBuUXokx7xS
	ozI1VKhVDx7wmMJWMJ+1fjresvNc5JLjE+FfT0hUA4Fs1K2PKF2aEDT+hkvSRd7r/xZ3kQB6/9F5i
	jxWkbo7OFIFpRDIa4pXlbhFDHqYzEm5mSHER0zL6ZCy4I6KzGQ87O3Y2/qL6CCyYjFp4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/include: compat/xlat.h may change with .config changes
Message-Id: <E1lIUFE-0001li-V4@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 10:33:12 +0000

commit 6d5d73b77f022b6ddf855eeefdbd4368322d04b6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:41:11 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:41:11 2021 +0100

    xen/include: compat/xlat.h may change with .config changes
    
    $(xlat-y) getting derived from $(headers-y) means its contents may
    change with changes to .config. The individual files $(xlat-y) refers
    to, otoh, may not change, and hence not trigger rebuilding of xlat.h.
    (Note that the issue was already present before the commit referred to
    below, but it was far more limited in affecting only changes to
    CONFIG_XSM_FLASK.)
    
    Fixes: 2c8fabb2232d ("x86: only generate compat headers actually needed")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c7b0f25e8f86373ed54e1c446f8e67ce25ac6819
    master date: 2021-01-26 14:42:23 +0100
---
 xen/include/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/Makefile b/xen/include/Makefile
index c3e0283d34..47908905b9 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -90,7 +90,7 @@ compat/.xlat/%.lst: xlat.lst Makefile
 xlat-y := $(shell sed -ne 's,@arch@,$(compat-arch-y),g' -re 's,^[?!][[:blank:]]+[^[:blank:]]+[[:blank:]]+,,p' xlat.lst | uniq)
 xlat-y := $(filter $(patsubst compat/%,%,$(headers-y)),$(xlat-y))
 
-compat/xlat.h: $(addprefix compat/.xlat/,$(xlat-y)) Makefile
+compat/xlat.h: $(addprefix compat/.xlat/,$(xlat-y)) config/auto.conf Makefile
 	cat $(filter %.h,$^) >$@.new
 	mv -f $@.new $@
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 10:33:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 10:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94226.177728 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIUFQ-0003fR-DJ; Sat, 06 Mar 2021 10:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94226.177728; Sat, 06 Mar 2021 10:33: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 1lIUFQ-0003fJ-AL; Sat, 06 Mar 2021 10:33:24 +0000
Received: by outflank-mailman (input) for mailman id 94226;
 Sat, 06 Mar 2021 10:33: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 1lIUFP-0003fA-5w
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:33: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 1lIUFP-0006dz-3V
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:33:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIUFP-0001mQ-2a
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:33: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=xzHJeeRkGMY6JpxbezamPtn431slaKp9QFBlRLgGnxY=; b=anBbPZvFKAmsTiAwtO9NLJgq6P
	cETYbBc18vhiKS+941Y6tE+wdzj8mRWpkvb+6K446kLtyBDIGXkRU/9g/PbE1JMyPv0WjP1/bbBNE
	HvnzXc+8biJe0Fv7DUPTukVT1tFsORcorR6OeRvKEFE9uCY4tEhAtFi45kUXFGzaxx24=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/timer: Fix boot on Intel systems using ITSSPRC static PIT clock gating
Message-Id: <E1lIUFP-0001mQ-2a@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 10:33:23 +0000

commit c11bd12218365e31ee4d00f315a075b21a015914
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 5 15:41:35 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:41:35 2021 +0100

    x86/timer: Fix boot on Intel systems using ITSSPRC static PIT clock gating
    
    Recent Intel client devices have disabled the legacy PIT for powersaving
    reasons, breaking compatibility with a traditional IBM PC.  Xen depends on a
    legacy timer interrupt to check that the IO-APIC/PIC routing is configured
    correctly, and fails to boot with:
    
      (XEN) *******************************
      (XEN) Panic on CPU 0:
      (XEN) IO-APIC + timer doesn't work!  Boot with apic_verbosity=debug and send report.  Then try booting with the `noapic` option
      (XEN) *******************************
    
    While this setting can be undone by Xen, the details of how to differ by
    chipset, and would be very short sighted for battery based devices.  See bit 2
    "8254 Static Clock Gating Enable" in:
    
      https://edc.intel.com/content/www/us/en/design/products-and-solutions/processors-and-chipsets/comet-lake-u/intel-400-series-chipset-on-package-platform-controller-hub-register-database/itss-power-reduction-control-itssprc-offset-3300/
    
    All impacted systems have an HPET, but there is no indication of the absence
    of PIT functionality, nor a suitable way to probe for its absence.  As a short
    term fix, reconfigure the HPET into legacy replacement mode.  A better
    longterm fix would be to avoid the reliance on the timer interrupt entirely.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: e1de4c196a2eb4fd5063c30a2e115adf144bdeef
    master date: 2021-01-27 19:15:19 +0000
---
 xen/arch/x86/hpet.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 66 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index e99d7116b6..86b4e88f9b 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -767,7 +767,7 @@ static u32 *hpet_boot_cfg;
 u64 __init hpet_setup(void)
 {
     static u64 __initdata hpet_rate;
-    u32 hpet_id, hpet_period;
+    unsigned int hpet_id, hpet_period, hpet_cfg;
     unsigned int last;
 
     if ( hpet_rate )
@@ -800,6 +800,71 @@ u64 __init hpet_setup(void)
     hpet_rate = 1000000000000000ULL; /* 10^15 */
     (void)do_div(hpet_rate, hpet_period);
 
+    /*
+     * Intel chipsets from Skylake/ApolloLake onwards can statically clock
+     * gate the 8259 PIT.  This option is enabled by default in slightly later
+     * systems, as turning the PIT off is a prerequisite to entering the C11
+     * power saving state.
+     *
+     * Xen currently depends on the legacy timer interrupt being active while
+     * IRQ routing is configured.
+     *
+     * Reconfigure the HPET into legacy mode to re-establish the timer
+     * interrupt.
+     */
+    if ( hpet_id & HPET_ID_LEGSUP &&
+         !((hpet_cfg = hpet_read32(HPET_CFG)) & HPET_CFG_LEGACY) )
+    {
+        unsigned int c0_cfg, ticks, count;
+
+        /* Stop the main counter. */
+        hpet_write32(hpet_cfg & ~HPET_CFG_ENABLE, HPET_CFG);
+
+        /* Reconfigure channel 0 to be 32bit periodic. */
+        c0_cfg = hpet_read32(HPET_Tn_CFG(0));
+        c0_cfg |= (HPET_TN_ENABLE | HPET_TN_PERIODIC | HPET_TN_SETVAL |
+                   HPET_TN_32BIT);
+        hpet_write32(c0_cfg, HPET_Tn_CFG(0));
+
+        /*
+         * The exact period doesn't have to match a legacy PIT.  All we need
+         * is an interrupt queued up via the IO-APIC to check routing.
+         *
+         * Use HZ as the frequency.
+         */
+        ticks = ((SECONDS(1) / HZ) * div_sc(hpet_rate, SECONDS(1), 32)) >> 32;
+
+        count = hpet_read32(HPET_COUNTER);
+
+        /*
+         * HPET_TN_SETVAL above is atrociously documented in the spec.
+         *
+         * Periodic HPET channels have a main comparator register, and
+         * separate "accumulator" register.  Despite being named accumulator
+         * in the spec, this is not an accurate description of its behaviour
+         * or purpose.
+         *
+         * Each time an interrupt is generated, the "accumulator" register is
+         * re-added to the comparator set up the new period.
+         *
+         * Normally, writes to the CMP register update both registers.
+         * However, under these semantics, it is impossible to set up a
+         * periodic timer correctly without the main HPET counter being at 0.
+         *
+         * Instead, HPET_TN_SETVAL is a self-clearing control bit which we can
+         * use for periodic timers to mean that the second write to CMP
+         * updates the accumulator only, and not the absolute comparator
+         * value.
+         *
+         * This lets us set a period when the main counter isn't at 0.
+         */
+        hpet_write32(count + ticks, HPET_Tn_CMP(0));
+        hpet_write32(ticks,         HPET_Tn_CMP(0));
+
+        /* Restart the main counter, and legacy mode. */
+        hpet_write32(hpet_cfg | HPET_CFG_ENABLE | HPET_CFG_LEGACY, HPET_CFG);
+    }
+
     return hpet_rate;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 10:33:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 10:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94227.177732 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIUFa-0003gc-F5; Sat, 06 Mar 2021 10:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94227.177732; Sat, 06 Mar 2021 10:33: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 1lIUFa-0003gU-Bt; Sat, 06 Mar 2021 10:33:34 +0000
Received: by outflank-mailman (input) for mailman id 94227;
 Sat, 06 Mar 2021 10:33: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 1lIUFZ-0003gL-7r
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:33: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 1lIUFZ-0006eA-6g
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:33:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIUFZ-0001nF-5b
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:33: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=BXRbHKkkVvY79w48rjqAX3nf1LW5CZEqAOZOxmq/DIM=; b=qsEKq7jqs9HJR17hcp2JU87gwX
	oNr08AqHKm1q1yMjW101cE2DN0QfptbAIoauKibXtj2DYrIiwXmmb3KakD3Dj+0k+Xazpi78sW5Nm
	ab+fRoC62Q4JKZnmWVGRHpwcuSD8kAGVUaUMmght/ZIwGhbXhE+SLrFEbNLnMKlaEpAA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] memory: bail from page scrubbing when CPU is no longer online
Message-Id: <E1lIUFZ-0001nF-5b@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 10:33:33 +0000

commit ab3770e98f8ca1feae8607f52b3ec118664c8a74
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:42:31 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:42:31 2021 +0100

    memory: bail from page scrubbing when CPU is no longer online
    
    Scrubbing can significantly delay the offlining (parking) of a CPU (e.g.
    because of booting into in smt=0 mode), to a degree that the "CPU <n>
    still not dead..." messages logged on x86 in 1s intervals can be seen
    multiple times. There are no softirqs involved in this process, so
    extend the existing preemption check in the scrubbing logic to also exit
    when the CPU is no longer observed online.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 3c9fd69416f8ffc611705fb24dfb383203ddc84f
    master date: 2021-01-29 11:34:37 +0100
---
 xen/common/page_alloc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index ebc7f45c0f..1563188f4f 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1327,9 +1327,11 @@ bool scrub_free_pages(void)
                      * Scrub a few (8) pages before becoming eligible for
                      * preemption. But also count non-scrubbing loop iterations
                      * so that we don't get stuck here with an almost clean
-                     * heap.
+                     * heap. Consider the CPU no longer being seen as online as
+                     * a request to preempt immediately, to not unduly delay
+                     * its offlining.
                      */
-                    if ( cnt > 800 && softirq_pending(cpu) )
+                    if ( !cpu_online(cpu) || (cnt > 800 && softirq_pending(cpu)) )
                     {
                         preempt = true;
                         break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 10:33:44 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 10:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94228.177736 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIUFk-0003hv-GZ; Sat, 06 Mar 2021 10:33:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94228.177736; Sat, 06 Mar 2021 10:33: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 1lIUFk-0003hn-Dh; Sat, 06 Mar 2021 10:33:44 +0000
Received: by outflank-mailman (input) for mailman id 94228;
 Sat, 06 Mar 2021 10:33: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 1lIUFj-0003hf-DZ
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:33: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 1lIUFj-0006eb-AO
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:33:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIUFj-0001oB-92
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:33:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=v8s9sTaU+I6pYnlUNp/4Qpms5lgMzsLqE29jpWWljO8=; b=Mmg2DHWzrySWbG7/Fy/zRySHpH
	rU92lBD7hqJhZn0GY92qUQDgXZ14fMyn60Qqa7std5F5nerfOnCOhReb2l3ADttRo8dZ0pZxLnnnX
	CJUTmvq8Pgil0sR+/KaiwWd5sO6oKWlF1y/Q8Geqp3zrsZVHaDQkHKwNjfi4tn53p+6I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/HVM: re-order error path of hvm_domain_initialise()
Message-Id: <E1lIUFj-0001oB-92@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 10:33:43 +0000

commit be2f8932e27872b79d11778b4fce22ddb81bae70
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:42:59 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:42:59 2021 +0100

    x86/HVM: re-order error path of hvm_domain_initialise()
    
    hvm_destroy_all_ioreq_servers(), called from
    hvm_domain_relinquish_resources(), invokes relocate_portio_handler(),
    which uses d->arch.hvm.io_handler. Defer freeing of this array
    accordingly on the error path of hvm_domain_initialise().
    
    Similarly rtc_deinit() requires d->arch.hvm.pl_time to still be around,
    or else an armed timer structure would get freed, and that timer never
    get killed.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: fbb3bf002b42803ef289ea2a649ebd5f25d22236
    master date: 2021-01-29 11:36:54 +0100
---
 xen/arch/x86/hvm/hvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index d946d16335..2be0460f08 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -702,15 +702,15 @@ int hvm_domain_initialise(struct domain *d)
  fail1:
     if ( is_hardware_domain(d) )
         xfree(d->arch.hvm.io_bitmap);
-    XFREE(d->arch.hvm.io_handler);
     XFREE(d->arch.hvm.params);
-    XFREE(d->arch.hvm.pl_time);
     XFREE(d->arch.hvm.irq);
  fail0:
     hvm_destroy_cacheattr_region_list(d);
     destroy_perdomain_mapping(d, PERDOMAIN_VIRT_START, 0);
  fail:
     hvm_domain_relinquish_resources(d);
+    XFREE(d->arch.hvm.io_handler);
+    XFREE(d->arch.hvm.pl_time);
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 10:33:54 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 10:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94229.177739 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIUFu-0003jS-Iq; Sat, 06 Mar 2021 10:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94229.177739; Sat, 06 Mar 2021 10:33: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 1lIUFu-0003j1-Fq; Sat, 06 Mar 2021 10:33:54 +0000
Received: by outflank-mailman (input) for mailman id 94229;
 Sat, 06 Mar 2021 10:33: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 1lIUFt-0003it-Ds
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:33: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 1lIUFt-0006el-DE
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:33:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIUFt-0001on-CT
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:33:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+RwCMVSAKlty2K7zSQhVYeC8ADSC4xs9OTp+D10ZrOI=; b=BSM/qBte6zBFi2nQQ0tLB+wEC2
	NOCHKrdHWuTYeGEQKYBKkuYfKRn4evkx4JuPyqKR2DdgAv8j71OWm5Bh94sBq9LcvyvWX1pEcHc1L
	7OmDa2zmAcX4z9PTYP/vbY7lIwVoxK0qHxEIUFmYPfVVY9DqTR/oiIuL4rkU9igUQfeY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/debug: fix page-overflow bug in dbg_rw_guest_mem
Message-Id: <E1lIUFt-0001on-CT@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 10:33:53 +0000

commit e9cb9588232f5b5de07db77455045c9d449b615c
Author:     Tamas K Lengyel <tamas@tklengyel.com>
AuthorDate: Fri Mar 5 15:43:31 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:43:31 2021 +0100

    x86/debug: fix page-overflow bug in dbg_rw_guest_mem
    
    When using gdbsx dbg_rw_guest_mem is used to read/write guest memory. When the
    buffer being accessed is on a page-boundary, the next page needs to be grabbed
    to access the correct memory for the buffer's overflown parts. While
    dbg_rw_guest_mem has logic to handle that, it broke with 229492e210a. Instead
    of grabbing the next page the code right now is looping back to the
    start of the first page. This results in errors like the following while trying
    to use gdb with Linux' lx-dmesg:
    
    [    0.114457] PM: hibernation: Registered nosave memory: [mem
    0xfdfff000-0xffffffff]
    [    0.114460] [mem 0x90000000-0xfbffffff] available for PCI demem 0
    [    0.114462] f]f]
    Python Exception <class 'ValueError'> embedded null character:
    Error occurred in Python: embedded null character
    
    Fixing this bug by taking the variable assignment outside the loop.
    
    Fixes: 229492e210a ("x86/debugger: use copy_to/from_guest() in dbg_rw_guest_mem()")
    Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 9dc687f155a57216b83b17f9cde55dd43e06b0cd
    master date: 2021-01-30 03:21:33 +0000
---
 xen/arch/x86/debug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/debug.c b/xen/arch/x86/debug.c
index a500df01ac..61bf048bf9 100644
--- a/xen/arch/x86/debug.c
+++ b/xen/arch/x86/debug.c
@@ -158,10 +158,11 @@ static unsigned int dbg_rw_guest_mem(struct domain *dp, void * __user gaddr,
                                      void * __user buf, unsigned int len,
                                      bool toaddr, uint64_t pgd3)
 {
+    unsigned long addr = (unsigned long)gaddr;
+
     while ( len > 0 )
     {
         char *va;
-        unsigned long addr = (unsigned long)gaddr;
         mfn_t mfn;
         gfn_t gfn = INVALID_GFN;
         unsigned long pagecnt;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 10:34:04 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 10:34:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94230.177744 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIUG4-0003ki-KO; Sat, 06 Mar 2021 10:34:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94230.177744; Sat, 06 Mar 2021 10:34: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 1lIUG4-0003ka-HR; Sat, 06 Mar 2021 10:34:04 +0000
Received: by outflank-mailman (input) for mailman id 94230;
 Sat, 06 Mar 2021 10:34: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 1lIUG3-0003kT-H2
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:34: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 1lIUG3-0006f6-GL
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:34:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIUG3-0001pl-FQ
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:34: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=1AC9bbb4Cdoz6Ft/2f4gVGRNXGQ5LvFOy9AgQCX6QPE=; b=6LHraqmmrqS9lqcppsG3YXJ/Va
	AFLMd+Y0Iw2SJ56Jzb8ujCbcDxVOAnsw3WR8ufklHMWq80rxP9XXohd6PDYThw6kcy2UwHkHlw5Ok
	9lhsjP+DsKQHifyZCKULQK85dTHNrz89zDElEx500NnnJVLq/54YWsip/fRm84EHdSW8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/string: correct memmove()'s forwarding to memcpy()
Message-Id: <E1lIUG3-0001pl-FQ@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 10:34:03 +0000

commit 2c813771c5876e0d7a0f423a0d22f6b7d5ae47a3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:43:52 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:43:52 2021 +0100

    x86/string: correct memmove()'s forwarding to memcpy()
    
    With memcpy() expanding to the compiler builtin, we may not hand it
    overlapping source and destination. We strictly mean to forward to our
    own implementation (a few lines up in the same source file).
    
    Fixes: 78825e1c60fa ("x86/string: Clean up x86/string.h")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 7b93d92a35dc7c0a6e5f1f79b3c887aa3e66ddc0
    master date: 2021-02-04 13:59:56 +0100
---
 xen/arch/x86/string.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/string.c b/xen/arch/x86/string.c
index e2f84638c4..bda24b14ac 100644
--- a/xen/arch/x86/string.c
+++ b/xen/arch/x86/string.c
@@ -43,7 +43,8 @@ void *(memmove)(void *dest, const void *src, size_t n)
         return dest;
 
     if ( dest < src )
-        return memcpy(dest, src, n);
+        /* Depends on Xen's implementation operating forwards. */
+        return (memcpy)(dest, src, n);
 
     asm volatile (
         "   std         ; "
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 10:34:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 10:34:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94232.177749 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIUGE-0003m2-MW; Sat, 06 Mar 2021 10:34:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94232.177749; Sat, 06 Mar 2021 10:34: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 1lIUGE-0003ls-J7; Sat, 06 Mar 2021 10:34:14 +0000
Received: by outflank-mailman (input) for mailman id 94232;
 Sat, 06 Mar 2021 10:34: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 1lIUGD-0003ll-M0
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:34: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 1lIUGD-0006fD-LF
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:34:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIUGD-0001qr-IT
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:34: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=cYTqG+8JDoKlu1/ITy/sNbFb1WVtY7cu8oB6Sd0IACw=; b=1wGRUJ2elCoQdXB4tHucuYui9W
	qZ+0MZ1NlBsmbC/wQR1skNeOvk30AMJxhmIsL0NhEzXbnLk3alTdxX52JByFizkPuxFCBZEVWv2sm
	HV4KPNWiEfKq8VIEqItIN1z/OaI0bBZyB6u0Tkz5NdDSlUyFsEF0/DUaVTYC5oXtkp1U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/efi: enable MS ABI attribute on clang
Message-Id: <E1lIUGD-0001qr-IT@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 10:34:13 +0000

commit 9724e60e033cbf586e50a425d7e47eaa613480f7
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Mar 5 15:44:18 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:44:18 2021 +0100

    x86/efi: enable MS ABI attribute on clang
    
    Or else the EFI service calls will use the wrong calling convention.
    
    The __ms_abi__ attribute is available on all supported versions of
    clang. Add a specific Clang check because the GCC version reported by
    Clang is below the required 4.4 to use the __ms_abi__ attribute.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    master commit: 92f5ffa58d188c9f9a9f1bcdccb6d6348d9df612
    master date: 2021-02-04 14:02:32 +0100
---
 xen/include/asm-x86/x86_64/efibind.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/asm-x86/x86_64/efibind.h b/xen/include/asm-x86/x86_64/efibind.h
index b013db175d..ddcfae07ec 100644
--- a/xen/include/asm-x86/x86_64/efibind.h
+++ b/xen/include/asm-x86/x86_64/efibind.h
@@ -172,7 +172,7 @@ typedef uint64_t   UINTN;
 #ifndef EFIAPI                  // Forces EFI calling conventions reguardless of compiler options
     #ifdef _MSC_EXTENSIONS
         #define EFIAPI __cdecl  // Force C calling convention for Microsoft C compiler
-    #elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+    #elif __clang__ || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
         #define EFIAPI __attribute__((__ms_abi__))  // Force Microsoft ABI
     #else
         #define EFIAPI          // Substitute expresion to force C calling convention
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 10:34:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 10:34:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94233.177752 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIUGO-0003nS-PP; Sat, 06 Mar 2021 10:34:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94233.177752; Sat, 06 Mar 2021 10:34: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 1lIUGO-0003nK-MK; Sat, 06 Mar 2021 10:34:24 +0000
Received: by outflank-mailman (input) for mailman id 94233;
 Sat, 06 Mar 2021 10:34: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 1lIUGN-0003nD-Op
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:34: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 1lIUGN-0006fO-O8
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:34:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIUGN-0001rt-NL
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:34: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=+f3WcRzusp55InvBvZfkniz89c8uaRSd6dSHVxRO+I4=; b=DdsPgP7B/tAwkDsiWmyv3DqbY0
	ywvPzmMh7eqsFGyukaZJmS0rGz4W8iUv7Nv1GlklL9qfYGlPY1Iwa97zrXYAd9CLZJSAz9Bx1MAL6
	t3SN7ZFNcPgeec70WzX3pzoGHQpXXT6ZsCArGsL38q+Y3a5vvDFkJTESUBDR6kPizppw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/EFI: work around GNU ld 2.36 issue
Message-Id: <E1lIUGN-0001rt-NL@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 10:34:23 +0000

commit 61ddd50cceebc53c708c6ef88388e54e249afeb9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:44:47 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:44:47 2021 +0100

    x86/EFI: work around GNU ld 2.36 issue
    
    Our linker capability check fails with the recent binutils release's ld:
    
    .../check.o:(.debug_aranges+0x6): relocation truncated to fit: R_X86_64_32 against `.debug_info'
    .../check.o:(.debug_info+0x6): relocation truncated to fit: R_X86_64_32 against `.debug_abbrev'
    .../check.o:(.debug_info+0xc): relocation truncated to fit: R_X86_64_32 against `.debug_str'+76
    .../check.o:(.debug_info+0x11): relocation truncated to fit: R_X86_64_32 against `.debug_str'+d
    .../check.o:(.debug_info+0x15): relocation truncated to fit: R_X86_64_32 against `.debug_str'+2b
    .../check.o:(.debug_info+0x29): relocation truncated to fit: R_X86_64_32 against `.debug_line'
    .../check.o:(.debug_info+0x30): relocation truncated to fit: R_X86_64_32 against `.debug_str'+19
    .../check.o:(.debug_info+0x37): relocation truncated to fit: R_X86_64_32 against `.debug_str'+71
    .../check.o:(.debug_info+0x3e): relocation truncated to fit: R_X86_64_32 against `.debug_str'
    .../check.o:(.debug_info+0x45): relocation truncated to fit: R_X86_64_32 against `.debug_str'+5e
    .../check.o:(.debug_info+0x4c): additional relocation overflows omitted from the output
    
    Tell the linker to strip debug info as a workaround. Debug info has been
    getting stripped already anyway when linking the actual xen.efi.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: f4318db940c39cc656128fcf72df3e79d2e55bc1
    master date: 2021-02-05 14:09:42 +0100
---
 xen/arch/x86/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 00d7dbe51b..4212eb1d93 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -173,7 +173,7 @@ EFI_LDFLAGS += --major-subsystem-version=2 --minor-subsystem-version=0
 # Check if the compiler supports the MS ABI.
 export XEN_BUILD_EFI := $(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c efi/check.c -o efi/check.o 2>/dev/null && echo y)
 # Check if the linker supports PE.
-XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) -mi386pep --subsystem=10 -o efi/check.efi efi/check.o 2>/dev/null && echo y))
+XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) -mi386pep --subsystem=10 -S -o efi/check.efi efi/check.o 2>/dev/null && echo y))
 CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
 
 $(TARGET).efi: VIRT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A VIRT_START$$,,p')
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 10:34:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 10:34:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94234.177755 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIUGY-0003ot-R0; Sat, 06 Mar 2021 10:34:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94234.177755; Sat, 06 Mar 2021 10:34: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 1lIUGY-0003om-Nz; Sat, 06 Mar 2021 10:34:34 +0000
Received: by outflank-mailman (input) for mailman id 94234;
 Sat, 06 Mar 2021 10:34: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 1lIUGX-0003oa-Rm
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:34: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 1lIUGX-0006fZ-R6
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIUGX-0001t8-QF
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:34: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=YDycjOeA/hCsGBtpQ0OlXHu6ENdrSXC5wJRDg3F1xUk=; b=xWp31I1vZ6WYqVzZ+I1o64UEgZ
	L0/4PH6j933aGo10BkmyVqp0rM+06u9/TtmurM3bEgCoGGKmFOk5GTc9nggjnZvT98VJkDplpJW8I
	er6Nc6Z+d9O7AowSlRxfFgiVRglZSpU3q11hP6NpwpYTgz86TV3eINF7+LNlONZRtZPc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/ucode/amd: Fix OoB read in cpu_request_microcode()
Message-Id: <E1lIUGX-0001t8-QF@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 10:34:33 +0000

commit 2b0c46ebb26b872c5507b16e417a8b73c0ea0fca
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 5 15:45:06 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:45:06 2021 +0100

    x86/ucode/amd: Fix OoB read in cpu_request_microcode()
    
    verify_patch_size() is a maximum size check, and doesn't have a minimum bound.
    
    If the microcode container encodes a blob with a length less than 64 bytes,
    the subsequent calls to microcode_fits()/compare_header() may read off the end
    of the buffer.
    
    Fixes: 4de936a38a ("x86/ucode/amd: Rework parsing logic in cpu_request_microcode()")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1cbc4d89c45cba3929f1c0cb4bca0b000c4f174b
    master date: 2021-02-10 13:23:51 +0000
---
 xen/arch/x86/microcode_amd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/microcode_amd.c b/xen/arch/x86/microcode_amd.c
index a5becbfaf4..d678357bb4 100644
--- a/xen/arch/x86/microcode_amd.c
+++ b/xen/arch/x86/microcode_amd.c
@@ -292,7 +292,8 @@ static int get_ucode_from_buffer_amd(
         return -EINVAL;
     }
 
-    if ( (*offset + mpbuf->len) > bufsize )
+    if ( (*offset + mpbuf->len) > bufsize ||
+         mpbuf->len < sizeof(struct microcode_header_amd) )
     {
         printk(KERN_ERR "microcode: Bad data in microcode data file\n");
         return -EINVAL;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 10:34:44 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 10:34:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94235.177760 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIUGi-0003qJ-Sb; Sat, 06 Mar 2021 10:34:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94235.177760; Sat, 06 Mar 2021 10:34: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 1lIUGi-0003qB-Pe; Sat, 06 Mar 2021 10:34:44 +0000
Received: by outflank-mailman (input) for mailman id 94235;
 Sat, 06 Mar 2021 10:34: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 1lIUGh-0003q4-Vk
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:34: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 1lIUGh-0006g7-V3
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:34:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIUGh-0001uJ-UG
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:34:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SXl7tWNXRTJg56IGJtCruAaNPKPNTJs/UhHDVSwBtoU=; b=jfXi63D+Mxoz/gGaAxK5fnhndk
	20kBsKyWrZpVYvzMxF4hQ0N34GjrrtpwIdvrYQWdJG5QhTpdgoRpONBsYEWBgCAaTj9i4IpIWjJXJ
	UtWG+ByJQSTxRhUj7cZAveeEE8ktewNPev/BXKeRTzhiVrd3pnQi6A46VO30FDdy8df4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86emul: fix SYSENTER/SYSCALL switching into 64-bit mode
Message-Id: <E1lIUGh-0001uJ-UG@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 10:34:43 +0000

commit ac4955c74b2dd8cc81d455c424f680041180c063
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:45:54 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:45:54 2021 +0100

    x86emul: fix SYSENTER/SYSCALL switching into 64-bit mode
    
    When invoked by compat mode, mode_64bit() will be false at the start of
    emulation. The logic after complete_insn, however, needs to consider the
    mode switched into, in particular to avoid truncating RIP.
    
    Inspired by / paralleling and extending Linux commit 943dea8af21b ("KVM:
    x86: Update emulator context mode if SYSENTER xfers to 64-bit mode").
    
    While there, tighten a related assertion in x86_emulate_wrapper() - we
    want to be sure to not switch into an impossible mode when the code gets
    built for 32-bit only (as is possible for the test harness).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citirix.com>
    master commit: f3e1eb2f0234c955243a915d69ebd84f26eec130
    master date: 2021-02-11 17:53:10 +0100
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index a6f67c6a56..a4e0341b25 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -5926,6 +5926,10 @@ x86_emulate(
              (rc = ops->write_segment(x86_seg_ss, &sreg, ctxt)) )
             goto done;
 
+        if ( ctxt->lma )
+            /* In particular mode_64bit() needs to return true from here on. */
+            ctxt->addr_size = ctxt->sp_size = 64;
+
         /*
          * SYSCALL (unlike most instructions) evaluates its singlestep action
          * based on the resulting EFLAGS.TF, not the starting EFLAGS.TF.
@@ -6595,6 +6599,10 @@ x86_emulate(
             goto done;
         _regs.r(sp) = ctxt->lma ? msr_val : (uint32_t)msr_val;
 
+        if ( ctxt->lma )
+            /* In particular mode_64bit() needs to return true from here on. */
+            ctxt->addr_size = ctxt->sp_size = 64;
+
         singlestep = _regs.eflags & X86_EFLAGS_TF;
         break;
 
@@ -11195,8 +11203,12 @@ int x86_emulate_wrapper(
     unsigned long orig_ip = ctxt->regs->r(ip);
     int rc;
 
+#ifdef __x86_64__
     if ( mode_64bit() )
         ASSERT(ctxt->lma);
+#else
+    ASSERT(!ctxt->lma && !mode_64bit());
+#endif
 
     rc = x86_emulate(ctxt, ops);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 10:34:54 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 10:34:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94236.177764 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIUGs-0003s4-UM; Sat, 06 Mar 2021 10:34:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94236.177764; Sat, 06 Mar 2021 10:34: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 1lIUGs-0003rw-RO; Sat, 06 Mar 2021 10:34:54 +0000
Received: by outflank-mailman (input) for mailman id 94236;
 Sat, 06 Mar 2021 10:34: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 1lIUGs-0003rY-2M
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:34: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 1lIUGs-0006gB-1k
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:34:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIUGs-0001vJ-0r
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:34: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=3qOlml9noAbvi+37JP8sZtmtyvU3e4feM1+cjtnAzyw=; b=D/UnRISGnTsiIqaETW4G9RyhDO
	zHlN0k2nTMMxKKxad6g/uisrYSjwyOsGpZLYtOPyVWZxpNJdxIkQdVnoQ7tUOxg2yS7O6idz8U3Bz
	ZJL3IavrVGuHP2r2YkHHxc1fP2wP1y2Z2ZKlbdn9bi4YoiSmZDriuvzweUSN8w+hRb7Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/iommu: Check if the IOMMU was initialized before tearing down
Message-Id: <E1lIUGs-0001vJ-0r@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 10:34:54 +0000

commit c41fdabe8426079a0966b4e6bb9119c90bca62cb
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Mar 5 15:46:27 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:46:27 2021 +0100

    xen/iommu: Check if the IOMMU was initialized before tearing down
    
    is_iommu_enabled() will return true even if the IOMMU has not been
    initialized (e.g. the ops are not set).
    
    In the case of an early failure in arch_domain_init(), the function
    iommu_destroy_domain() will be called even if the IOMMU is not
    initialized.
    
    This will result to dereference the ops which will be NULL and an host
    crash.
    
    Fix the issue by checking that ops has been set before accessing it.
    
    Fixes: 71e617a6b8f6 ("use is_iommu_enabled() where appropriate...")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: d670ef3401b91d04c58d72cd8ce5579b4fa900d8
    master date: 2021-02-17 11:30:05 +0000
---
 xen/drivers/passthrough/iommu.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index bab7a3d099..93d4377978 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -228,6 +228,13 @@ static void iommu_teardown(struct domain *d)
 {
     struct domain_iommu *hd = dom_iommu(d);
 
+    /*
+     * During early domain creation failure, we may reach here with the
+     * ops not yet initialized.
+     */
+    if ( !hd->platform_ops )
+        return;
+
     hd->platform_ops->teardown(d);
     tasklet_schedule(&iommu_pt_cleanup_tasklet);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 10:35:05 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 10:35:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94237.177768 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIUH3-0003tD-04; Sat, 06 Mar 2021 10:35:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94237.177768; Sat, 06 Mar 2021 10:35: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 1lIUH2-0003t5-T7; Sat, 06 Mar 2021 10:35:04 +0000
Received: by outflank-mailman (input) for mailman id 94237;
 Sat, 06 Mar 2021 10:35: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 1lIUH2-0003sx-5t
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:35: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 1lIUH2-0006gW-5H
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:35:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIUH2-0001wm-47
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:35:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TG8aJpDg3jKcBuXrxb9ueoxfAtt3WJ5KOms5QkJay48=; b=n/faYdp8v7y9a9z3mAuJ9obwXD
	TB641Zu1vIAqfvwOZNRuTvHlpuYmsfj+/ONl3HCck/skZVdce72T28JMMhDTnEgGiqfpxggiMGZ5u
	vRaYNk7bZRgkSgFgVRrcs9R/nOZki+s0yo8ufzxt2i31LI5DTqPDjARHqxAzDTfFhqHk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] gnttab: never permit mapping transitive grants
Message-Id: <E1lIUH2-0001wm-47@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 10:35:04 +0000

commit 638b5787137eea3d88602c8ba5800b1f5beae9a8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:46:55 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:46:55 2021 +0100

    gnttab: never permit mapping transitive grants
    
    Transitive grants allow an intermediate domain I to grant a target
    domain T access to a page which origin domain O did grant I access to.
    As an implementation restriction, T is not allowed to map such a grant.
    This restriction is currently tried to be enforced by marking active
    entries resulting from transitive grants as is-sub-page; sub-page grants
    for obvious reasons don't allow mapping. However, marking (and checking)
    only active entries is insufficient, as a map attempt may also occur on
    a grant not otherwise in use. When not presently in use (pin count zero)
    the grant type itself needs checking. Otherwise T may be able to map an
    unrelated page owned by I. This is because the "transitive" sub-
    structure of the v2 union would end up being interpreted as "full_page"
    sub-structure instead. The low 32 bits of the GFN used would match the
    grant reference specified in I's transitive grant entry, while the upper
    32 bits could be random (depending on how exactly I sets up its grant
    table entries).
    
    Note that if one mapping already exists and the granting domain _then_
    changes the grant to GTF_transitive (which the domain is not supposed to
    do), the changed type will only be honored after the pin count has gone
    back to zero. This is no different from e.g. GTF_readonly or
    GTF_sub_page becoming set when a grant is already in use.
    
    While adjusting the implementation, also adjust commentary in the public
    header to better reflect reality.
    
    Fixes: 3672ce675c93 ("Transitive grant support")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: b339e3a976b1680f57051adabcb98281198f7eac
    master date: 2021-02-18 13:16:12 +0100
---
 xen/common/grant_table.c         | 9 +++++----
 xen/include/public/grant_table.h | 6 ++++--
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 41fd89f5d9..0e0ec1b5aa 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -795,9 +795,10 @@ static int _set_status_v2(const grant_entry_header_t *shah,
         mask |= GTF_sub_page;
 
     /* If not already pinned, check the grant domid and type. */
-    if ( !act->pin && ((((scombo.flags & mask) != GTF_permit_access) &&
-                        ((scombo.flags & mask) != GTF_transitive)) ||
-                       (scombo.domid != ldomid)) )
+    if ( !act->pin &&
+         ((((scombo.flags & mask) != GTF_permit_access) &&
+           (mapflag || ((scombo.flags & mask) != GTF_transitive))) ||
+          (scombo.domid != ldomid)) )
         PIN_FAIL(done, GNTST_general_error,
                  "Bad flags (%x) or dom (%d); expected d%d, flags %x\n",
                  scombo.flags, scombo.domid, ldomid, mask);
@@ -823,7 +824,7 @@ static int _set_status_v2(const grant_entry_header_t *shah,
     if ( !act->pin )
     {
         if ( (((scombo.flags & mask) != GTF_permit_access) &&
-              ((scombo.flags & mask) != GTF_transitive)) ||
+              (mapflag || ((scombo.flags & mask) != GTF_transitive))) ||
              (scombo.domid != ldomid) ||
              (!readonly && (scombo.flags & GTF_readonly)) )
         {
diff --git a/xen/include/public/grant_table.h b/xen/include/public/grant_table.h
index 3b7bf93d74..84b1d26b36 100644
--- a/xen/include/public/grant_table.h
+++ b/xen/include/public/grant_table.h
@@ -166,11 +166,13 @@ typedef struct grant_entry_v1 grant_entry_v1_t;
 #define GTF_type_mask       (3U<<0)
 
 /*
- * Subflags for GTF_permit_access.
+ * Subflags for GTF_permit_access and GTF_transitive.
  *  GTF_readonly: Restrict @domid to read-only mappings and accesses. [GST]
  *  GTF_reading: Grant entry is currently mapped for reading by @domid. [XEN]
  *  GTF_writing: Grant entry is currently mapped for writing by @domid. [XEN]
- *  GTF_PAT, GTF_PWT, GTF_PCD: (x86) cache attribute flags for the grant [GST]
+ * Further subflags for GTF_permit_access only.
+ *  GTF_PAT, GTF_PWT, GTF_PCD: (x86) cache attribute flags to be used for
+ *                             mappings of the grant [GST]
  *  GTF_sub_page: Grant access to only a subrange of the page.  @domid
  *                will only be allowed to copy from the grant, and not
  *                map it. [GST]
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 10:35:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 10:35:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94238.177772 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIUHE-0003ui-1M; Sat, 06 Mar 2021 10:35:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94238.177772; Sat, 06 Mar 2021 10:35: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 1lIUHD-0003ua-Um; Sat, 06 Mar 2021 10:35:15 +0000
Received: by outflank-mailman (input) for mailman id 94238;
 Sat, 06 Mar 2021 10:35: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 1lIUHC-0003uU-9C
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:35: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 1lIUHC-0006ge-8T
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:35:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIUHC-0001xs-7h
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:35:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=M6Gyz7Wmk7QBtPvnxppuAt+/HMHHcYCNfeVlXZZwys4=; b=QohJFXkMD2Uv5ovEmCn4GwXCVS
	3IQg0qSR3a2LfzyPzdUPdDBb49rWma1Kw2LFpUlnFYGWC+L3jrYPz94W8Jgip2ucjiywkz9C7CHhw
	bRaC6Iv8IFjiQQqw640g/UqoI2PlSb4uwkLJuG+Hc4mpi9B4JhjiMsxtDsO9srRg+nOk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] gnttab: bypass IOMMU (un)mapping when a domain is (un)mapping its own grant
Message-Id: <E1lIUHC-0001xs-7h@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 10:35:14 +0000

commit 98e6482bd1d805706519290b8488076c2a8feac1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:47:35 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:47:35 2021 +0100

    gnttab: bypass IOMMU (un)mapping when a domain is (un)mapping its own grant
    
    Mappings for a domain's own pages should already be present in the
    IOMMU. While installing the same mapping again is merely redundant (and
    inefficient), removing the mapping when the grant mapping gets removed
    is outright wrong in this case: The mapping was there before the map, so
    should remain in place after unmapping.
    
    This affects
    - Arm Dom0 in the direct mapped case,
    - x86 PV Dom0 in the "iommu=dom0-strict" / "dom0-iommu=strict" case,
    - all x86 PV DomU-s, including driver domains.
    
    See the code comment for why it's the original domain and not the page
    owner that gets compared against.
    
    Reported-by: Rahul Singh <Rahul.Singh@arm.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    master commit: e8185c5f01c68f7d29d23a4a91bc1be1ff2cc1ca
    master date: 2021-02-18 13:16:59 +0100
---
 xen/common/grant_table.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 0e0ec1b5aa..b15e978d06 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1168,7 +1168,14 @@ map_grant_ref(
         goto undo_out;
     }
 
-    need_iommu = gnttab_need_iommu_mapping(ld);
+    /*
+     * This is deliberately not checking the page's owner: get_paged_frame()
+     * explicitly rejects foreign pages, and all success paths above yield
+     * either owner == rd or owner == dom_io (the dom_cow case is irrelevant
+     * as mem-sharing and IOMMU use are incompatible). The dom_io case would
+     * need checking separately if we compared against owner here.
+     */
+    need_iommu = ld != rd && gnttab_need_iommu_mapping(ld);
     if ( need_iommu )
     {
         unsigned int kind;
@@ -1432,7 +1439,8 @@ unmap_common(
     if ( put_handle )
         put_maptrack_handle(lgt, op->handle);
 
-    if ( rc == GNTST_okay && gnttab_need_iommu_mapping(ld) )
+    /* See the respective comment in map_grant_ref(). */
+    if ( rc == GNTST_okay && ld != rd && gnttab_need_iommu_mapping(ld) )
     {
         unsigned int kind;
         int err = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 10:35:26 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 10:35:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94239.177776 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIUHO-0003wC-3K; Sat, 06 Mar 2021 10:35:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94239.177776; Sat, 06 Mar 2021 10:35: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 1lIUHO-0003w4-07; Sat, 06 Mar 2021 10:35:26 +0000
Received: by outflank-mailman (input) for mailman id 94239;
 Sat, 06 Mar 2021 10:35: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 1lIUHM-0003vt-Cl
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:35: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 1lIUHM-0006gm-C5
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:35:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIUHM-0001yw-AT
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:35:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=E9v31yTYzzgt97chtkuRQm7J81VAGCkMqtB4kzbfksE=; b=pKhpfTlaYjTnOHxs8XkeklIXe/
	4CgzLt7i4sPlSunTIyRB+oEgI9FJWiU5W9l3rSMlUWKcgvzCeq8WgOeEGmGB+dKjD260FX1vdMZzg
	QhYXo8GCNHwpZP96kx7e7ngrIAi6PB6+FrDM2W5ziGK2nj05LW3b3U2yB8pIkpBEcIw4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/EFI: suppress GNU ld 2.36'es creation of base relocs
Message-Id: <E1lIUHM-0001yw-AT@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 10:35:24 +0000

commit a4c4fc0de3bd5c6847a2b8077a02ea6e9d26bab0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 15:48:06 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:48:06 2021 +0100

    x86/EFI: suppress GNU ld 2.36'es creation of base relocs
    
    All of the sudden ld creates base relocations itself, for PE
    executables - as a result we now have two of them for every entity to
    be relocated. While we will likely want to use this down the road, it
    doesn't work quite right yet in corner cases, so rather than suppressing
    our own way of creating the relocations we need to tell ld to avoid
    doing so.
    
    Probe whether --disable-reloc-section (which was introduced by the same
    commit making relocation generation the default) is recognized by ld's PE
    emulation, and use the option if so. (To limit redundancy, move the first
    part of setting EFI_LDFLAGS earlier, and use it already while probing.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 76cbb9c3f4dd9ab6aa44eeacab84fb88b2e8bfc1
    master date: 2021-02-25 15:11:58 +0100
---
 xen/arch/x86/Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 4212eb1d93..c57ae581dd 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -173,8 +173,13 @@ EFI_LDFLAGS += --major-subsystem-version=2 --minor-subsystem-version=0
 # Check if the compiler supports the MS ABI.
 export XEN_BUILD_EFI := $(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c efi/check.c -o efi/check.o 2>/dev/null && echo y)
 # Check if the linker supports PE.
-XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) -mi386pep --subsystem=10 -S -o efi/check.efi efi/check.o 2>/dev/null && echo y))
+XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) $(call EFI_LDFLAGS,0x100000000) -o efi/check.efi efi/check.o 2>/dev/null && echo y))
 CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
+# Check if the linker produces fixups in PE by default (we need to disable it doing so for now).
+XEN_NO_PE_FIXUPS := $(if $(XEN_BUILD_EFI), \
+                         $(shell $(LD) $(call EFI_LDFLAGS,0x100000000) --disable-reloc-section -o efi/check.efi efi/check.o 2>/dev/null && \
+                                 echo --disable-reloc-section))
+EFI_LDFLAGS += $(XEN_NO_PE_FIXUPS)
 
 $(TARGET).efi: VIRT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A VIRT_START$$,,p')
 $(TARGET).efi: ALT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A ALT_START$$,,p')
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 10:35:36 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 10:35:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94240.177780 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIUHY-0003xc-6D; Sat, 06 Mar 2021 10:35:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94240.177780; Sat, 06 Mar 2021 10:35: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 1lIUHY-0003xU-33; Sat, 06 Mar 2021 10:35:36 +0000
Received: by outflank-mailman (input) for mailman id 94240;
 Sat, 06 Mar 2021 10:35: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 1lIUHW-0003xN-Hi
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:35: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 1lIUHW-0006gs-Gr
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:35:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIUHW-000202-EP
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:35: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=zngO0MKkyBa0ZsW4OyAXU4E9+mQLbH5RNfcA/HMP5BI=; b=2Js2CDFIhU8k8Ptl8+YXsezrJo
	nKinI06LWnnbzNkLb66SsAk5GFhp5nILppu4UdXs6McKHVFCmWRXOUIsPGBqx5Fbpzg8Pjzrdv+Ns
	LODl/pnHkTicMmfQIiDO6dlYdCVKrF2VGKr2fvQ3ztNYhqCsDDuFeGkMy/Q2A98wmuD4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/sched: Add missing memory barrier in vcpu_block()
Message-Id: <E1lIUHW-000202-EP@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 10:35:34 +0000

commit 8384641f6b1abe6c9f916a219100b352e5f30d27
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Mar 5 15:48:45 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:48:45 2021 +0100

    xen/sched: Add missing memory barrier in vcpu_block()
    
    The comment in vcpu_block() states that the events should be checked
    /after/ blocking to avoids wakeup waiting race. However, from a generic
    perspective, set_bit() doesn't prevent re-ordering. So the following
    could happen:
    
    CPU0  (blocking vCPU A)         |   CPU1 ( unblock vCPU A)
                                    |
    A <- read local events          |
                                    |   set local events
                                    |   test_and_clear_bit(_VPF_blocked)
                                    |       -> Bail out as the bit if not set
                                    |
    set_bit(_VFP_blocked)           |
                                    |
    check A                         |
    
    The variable A will be 0 and therefore the vCPU will be blocked when it
    should continue running.
    
    vcpu_block() is now gaining an smp_mb__after_atomic() to prevent the CPU
    to read any information about local events before the flag _VPF_blocked
    is set.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ash Wilding <ash.j.wilding@gmail.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Dario Faggioli <dfaggioli@suse.com>
    
    atomics: introduce smp_mb__[after|before]_atomic() barriers
    
    When using atomic variables for synchronization barriers are needed
    to ensure proper data serialization. Introduce smp_mb__before_atomic()
    and smp_mb__after_atomic() as in the Linux kernel for that purpose.
    
    Use the same definitions as in the Linux kernel.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: 109e8177fd4a225e7025c4c17d2c9537b550b4ed
    master date: 2021-02-26 09:47:23 +0000
    master commit: c301211a511111caca29f3bd797eb13965026c78
    master date: 2020-03-26 12:42:19 +0100
---
 xen/common/schedule.c        | 2 ++
 xen/include/asm-arm/system.h | 3 +++
 xen/include/asm-x86/system.h | 3 +++
 3 files changed, 8 insertions(+)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 6b1ae7bf8c..a698a13698 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1366,6 +1366,8 @@ void vcpu_block(void)
 
     set_bit(_VPF_blocked, &v->pause_flags);
 
+    smp_mb__after_atomic();
+
     arch_vcpu_block(v);
 
     /* Check for events /after/ blocking: avoids wakeup waiting race. */
diff --git a/xen/include/asm-arm/system.h b/xen/include/asm-arm/system.h
index e5d062667d..65d5c8e423 100644
--- a/xen/include/asm-arm/system.h
+++ b/xen/include/asm-arm/system.h
@@ -30,6 +30,9 @@
 
 #define smp_wmb()       dmb(ishst)
 
+#define smp_mb__before_atomic()    smp_mb()
+#define smp_mb__after_atomic()     smp_mb()
+
 /*
  * This is used to ensure the compiler did actually allocate the register we
  * asked it for some inline assembly sequences.  Apparently we can't trust
diff --git a/xen/include/asm-x86/system.h b/xen/include/asm-x86/system.h
index 069f422f0d..7e5891f3df 100644
--- a/xen/include/asm-x86/system.h
+++ b/xen/include/asm-x86/system.h
@@ -233,6 +233,9 @@ static always_inline unsigned long __xadd(
 #define set_mb(var, value) do { xchg(&var, value); } while (0)
 #define set_wmb(var, value) do { var = value; smp_wmb(); } while (0)
 
+#define smp_mb__before_atomic()    do { } while (0)
+#define smp_mb__after_atomic()     do { } while (0)
+
 /**
  * array_index_mask_nospec() - generate a mask that is ~0UL when the
  *      bounds check succeeds and 0 otherwise
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 10:35:46 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 10:35:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94241.177783 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIUHi-0003yo-7e; Sat, 06 Mar 2021 10:35:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94241.177783; Sat, 06 Mar 2021 10:35: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 1lIUHi-0003yg-4l; Sat, 06 Mar 2021 10:35:46 +0000
Received: by outflank-mailman (input) for mailman id 94241;
 Sat, 06 Mar 2021 10:35: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 1lIUHg-0003yY-Kn
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:35: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 1lIUHg-0006hG-KC
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:35:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIUHg-00021A-JN
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 10:35: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=ffuDxnXrYWlZcIMiLYe+53G8n7DMhA3LQiCFZuekNBc=; b=Hx4tVTBinDQkzmyyr9aOThm8F7
	6Z5vQn1GV1bKB6fD+qQWHBmduvP5r5p0i6L/Bq90ngQuWIAACwzXmnIbtxkp4l4Yopb0iVWd71p1E
	jbUiaXHwd1d1IiWXSfMSzzRaPIrJjl9gDeEV9VK0JlqjFsb6hL7nV3qYxBt93X+t7Ryk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/dmop: Properly fail for PV guests
Message-Id: <E1lIUHg-00021A-JN@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 10:35:44 +0000

commit 24b181e4e4c6c6fe28217c845d6d753da1606aeb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 5 15:49:32 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 15:49:32 2021 +0100

    x86/dmop: Properly fail for PV guests
    
    The current code has an early exit for PV guests, but it returns 0 having done
    nothing.
    
    Fixes: 524a98c2ac5 ("public / x86: introduce __HYPERCALL_dm_op...")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 615367b5275a5b0123f1f1ee86c985fab234a5a4
    master date: 2021-02-26 12:28:52 +0000
---
 xen/arch/x86/hvm/dm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c
index d6d0e8be89..c387a1e49e 100644
--- a/xen/arch/x86/hvm/dm.c
+++ b/xen/arch/x86/hvm/dm.c
@@ -368,6 +368,7 @@ static int dm_op(const struct dmop_args *op_args)
     if ( rc )
         return rc;
 
+    rc = -EINVAL;
     if ( !is_hvm_domain(d) )
         goto out;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 19:44:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 19:44:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94371.177917 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIcqL-00059m-3w; Sat, 06 Mar 2021 19:44:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94371.177917; Sat, 06 Mar 2021 19: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 1lIcqL-00059e-0z; Sat, 06 Mar 2021 19:44:05 +0000
Received: by outflank-mailman (input) for mailman id 94371;
 Sat, 06 Mar 2021 19: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 1lIcqK-00059Z-E7
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 19: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 1lIcqK-0007oQ-Bj
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 19:44:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIcqK-0006cS-8u
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 19: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=qlDSyasIOVBawTKVyKxTaN3Sc9zXEEcOLCPNU9nqbiI=; b=ecasXhtrcNfwTscM59YrY7S3Xr
	EM3Y01HAFlwH400guF/61XtC39ki0RXG2Hak2m343NccUZnf50BuFmwxxDWLNvo8jdY35jpolCM4v
	VpuehMZXJD4Bn2yusn6c1obQ5HSwxsvBP9HaWlXmw/2WC+Bl5NC7SdwDuvTjKz3pQxvE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstored: liveupdate: Increase the maximum number of parameters
Message-Id: <E1lIcqK-0006cS-8u@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 19:44:04 +0000

commit 51972482f77b68ef494c8b9591b125460e7984b9
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Mar 5 12:10:29 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Sat Mar 6 19:07:49 2021 +0000

    tools/xenstored: liveupdate: Increase the maximum number of parameters
    
    The longest possible command line for LiveUpdate is:
    
      liveupdate -s -t <timeout> -F
    
    This is 5 parameters. However, the maximum is currently specified to 4.
    This means the some of the parameters will get ignored.
    
    Update the field max_pars to 5 so and admin can specify the timeout and
    force at the same time.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 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 a1652219b2..8e470f2b20 100644
--- a/tools/xenstore/xenstored_control.c
+++ b/tools/xenstore/xenstored_control.c
@@ -768,7 +768,7 @@ static struct cmd_s cmds[] = {
 	 */
 	{ "live-update", do_control_lu,
 		"[-c <cmdline>] [-F] [-t <timeout>] <file>\n"
-		"    Default timeout is 60 seconds.", 4 },
+		"    Default timeout is 60 seconds.", 5 },
 #endif
 #ifdef __MINIOS__
 	{ "memreport", do_control_memreport, "" },
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sat Mar 06 23:33:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Mar 2021 23:33:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94399.177987 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIgPv-0001AY-U2; Sat, 06 Mar 2021 23:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94399.177987; Sat, 06 Mar 2021 23: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 1lIgPv-0001AQ-R5; Sat, 06 Mar 2021 23:33:03 +0000
Received: by outflank-mailman (input) for mailman id 94399;
 Sat, 06 Mar 2021 23: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 1lIgPu-0001A5-IY
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 23: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 1lIgPu-0003AV-Dl
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 23:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIgPu-00054O-CQ
 for xen-changelog@lists.xenproject.org; Sat, 06 Mar 2021 23: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=W9Iv4ik+x1o407+mTweAtAfrHyP57U+/wkBKoCLlXoA=; b=23vSV3goPkBU95swTKH3bv+Zv3
	GFecfJU1aR/6godaGaFph+RjspCQfNe+r1mmP1SqYozfZn7m+NRH4bM7+tkmpk11M3LM1ssoWLQUZ
	MdUp9mcB9X4CZOA8Iiby/bEf2P22vdgggrDZ+cgfhpCmhdOn58izVDJ2uZfSB6+bYGjE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: suppress "fast fault path" optimization without reserved bits
Message-Id: <E1lIgPu-00054O-CQ@xenbits.xenproject.org>
Date: Sat, 06 Mar 2021 23:33:02 +0000

commit 9318fdf757ec234f0ee6c5cd381326b2f581d065
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 5 13:29:28 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 5 13:29:28 2021 +0100

    x86/shadow: suppress "fast fault path" optimization without reserved bits
    
    When none of the physical address bits in PTEs are reserved, we can't
    create any 4k (leaf) PTEs which would trigger reserved bit faults. Hence
    the present SHOPT_FAST_FAULT_PATH machinery needs to be suppressed in
    this case, which is most easily achieved by never creating any magic
    entries.
    
    To compensate a little, eliminate sh_write_p2m_entry_post()'s impact on
    such hardware.
    
    While at it, also avoid using an MMIO magic entry when that would
    truncate the incoming GFN.
    
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/arch/x86/mm/shadow/multi.c |  3 ++-
 xen/arch/x86/mm/shadow/types.h | 28 ++++++++++++++++++++++------
 2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index dd59bec2c3..9b43cb116c 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -499,7 +499,8 @@ _sh_propagate(struct vcpu *v,
     {
         /* Guest l1e maps emulated MMIO space */
         *sp = sh_l1e_mmio(target_gfn, gflags);
-        d->arch.paging.shadow.has_fast_mmio_entries = true;
+        if ( sh_l1e_is_magic(*sp) )
+            d->arch.paging.shadow.has_fast_mmio_entries = true;
         goto done;
     }
 
diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index 416b284123..901645560a 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -281,7 +281,8 @@ static inline shadow_l4e_t shadow_l4e_from_mfn(mfn_t mfn, u32 flags)
  * pagetables.
  *
  * This is only feasible for PAE and 64bit Xen: 32-bit non-PAE PTEs don't
- * have reserved bits that we can use for this.
+ * have reserved bits that we can use for this.  And even there it can only
+ * be used if the processor doesn't use all 52 address bits.
  */
 
 #define SH_L1E_MAGIC 0xffffffff00000001ULL
@@ -291,14 +292,24 @@ static inline bool sh_l1e_is_magic(shadow_l1e_t sl1e)
 }
 
 /* Guest not present: a single magic value */
-static inline shadow_l1e_t sh_l1e_gnp(void)
+static inline shadow_l1e_t sh_l1e_gnp_raw(void)
 {
     return (shadow_l1e_t){ -1ULL };
 }
 
+static inline shadow_l1e_t sh_l1e_gnp(void)
+{
+    /*
+     * On systems with no reserved physical address bits we can't engage the
+     * fast fault path.
+     */
+    return paddr_bits < PADDR_BITS ? sh_l1e_gnp_raw()
+                                   : shadow_l1e_empty();
+}
+
 static inline bool sh_l1e_is_gnp(shadow_l1e_t sl1e)
 {
-    return sl1e.l1 == sh_l1e_gnp().l1;
+    return sl1e.l1 == sh_l1e_gnp_raw().l1;
 }
 
 /*
@@ -313,9 +324,14 @@ static inline bool sh_l1e_is_gnp(shadow_l1e_t sl1e)
 
 static inline shadow_l1e_t sh_l1e_mmio(gfn_t gfn, u32 gflags)
 {
-    return (shadow_l1e_t) { (SH_L1E_MMIO_MAGIC
-                             | MASK_INSR(gfn_x(gfn), SH_L1E_MMIO_GFN_MASK)
-                             | (gflags & (_PAGE_USER|_PAGE_RW))) };
+    unsigned long gfn_val = MASK_INSR(gfn_x(gfn), SH_L1E_MMIO_GFN_MASK);
+
+    if ( paddr_bits >= PADDR_BITS ||
+         gfn_x(gfn) != MASK_EXTR(gfn_val, SH_L1E_MMIO_GFN_MASK) )
+        return shadow_l1e_empty();
+
+    return (shadow_l1e_t) { (SH_L1E_MMIO_MAGIC | gfn_val |
+                             (gflags & (_PAGE_USER | _PAGE_RW))) };
 }
 
 static inline bool sh_l1e_is_mmio(shadow_l1e_t sl1e)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun Mar 07 11:22:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 07 Mar 2021 11:22:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94498.178078 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lIrU3-0002CJ-My; Sun, 07 Mar 2021 11:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94498.178078; Sun, 07 Mar 2021 11:22: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 1lIrU3-0002CB-Jt; Sun, 07 Mar 2021 11:22:03 +0000
Received: by outflank-mailman (input) for mailman id 94498;
 Sun, 07 Mar 2021 11: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 1lIrU2-0002C6-A3
 for xen-changelog@lists.xenproject.org; Sun, 07 Mar 2021 11: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 1lIrU2-0001Yp-4U
 for xen-changelog@lists.xenproject.org; Sun, 07 Mar 2021 11:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lIrU2-0007Hv-0x
 for xen-changelog@lists.xenproject.org; Sun, 07 Mar 2021 11: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=e7HlnM4SIex3MsUnHq1kG2b9DsY2LToahrWK62YeMfs=; b=SJDK/OmtuD9IxRP2e5unDTV/2b
	5u7dbrkEP8OW0kKI7IpKYm1mguvQFG2/t3iclWrdtLqzYD+kuu3h6poA1k7fQFpNoEQr2g5cirWkd
	aHUh5ILqyKspGmZfWLGsnVrSxHHK66LYcnjRrjyTlZYP6Rh4K1JHJQneydJYAHMOPAF4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: liveupdate: Increase the maximum number of parameters
Message-Id: <E1lIrU2-0007Hv-0x@xenbits.xenproject.org>
Date: Sun, 07 Mar 2021 11:22:02 +0000

commit 51972482f77b68ef494c8b9591b125460e7984b9
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Mar 5 12:10:29 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Sat Mar 6 19:07:49 2021 +0000

    tools/xenstored: liveupdate: Increase the maximum number of parameters
    
    The longest possible command line for LiveUpdate is:
    
      liveupdate -s -t <timeout> -F
    
    This is 5 parameters. However, the maximum is currently specified to 4.
    This means the some of the parameters will get ignored.
    
    Update the field max_pars to 5 so and admin can specify the timeout and
    force at the same time.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 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 a1652219b2..8e470f2b20 100644
--- a/tools/xenstore/xenstored_control.c
+++ b/tools/xenstore/xenstored_control.c
@@ -768,7 +768,7 @@ static struct cmd_s cmds[] = {
 	 */
 	{ "live-update", do_control_lu,
 		"[-c <cmdline>] [-F] [-t <timeout>] <file>\n"
-		"    Default timeout is 60 seconds.", 4 },
+		"    Default timeout is 60 seconds.", 5 },
 #endif
 #ifdef __MINIOS__
 	{ "memreport", do_control_memreport, "" },
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Mar 08 09:44:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Mar 2021 09:44:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.94735.178346 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lJCQo-0004Rv-20; Mon, 08 Mar 2021 09:44:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 94735.178346; Mon, 08 Mar 2021 09:44: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 1lJCQn-0004Rm-VC; Mon, 08 Mar 2021 09:44:05 +0000
Received: by outflank-mailman (input) for mailman id 94735;
 Mon, 08 Mar 2021 09:44: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 1lJCQm-0004Rg-UX
 for xen-changelog@lists.xenproject.org; Mon, 08 Mar 2021 09: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 1lJCQm-0000vI-Oh
 for xen-changelog@lists.xenproject.org; Mon, 08 Mar 2021 09:44:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lJCQm-0002DN-Ms
 for xen-changelog@lists.xenproject.org; Mon, 08 Mar 2021 09: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=aboWq5yqFe8L1bry171IL8hGKslqkCRnV279pxxP7cw=; b=jskKtqi40MGZ2aI6Oewkjzy31T
	7rzXVOg/S79pJLlOJ4IznGe6jnK0ItaVuSTzH/xx4hNl1HNUykKNmi6RZE2kntgetPRztzwMaL6Fu
	PDQ+t1tzYYnMsIcaSR3p2qlTfK2NjSEUvH/Bhj9g+HRl6y5tqr6qwfJAzIG3lTvQkboU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: suppress "fast fault path" optimization when running virtualized
Message-Id: <E1lJCQm-0002DN-Ms@xenbits.xenproject.org>
Date: Mon, 08 Mar 2021 09:44:04 +0000

commit 60c0444fae2148452f9ed0b7c49af1fa41f8f522
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Mar 8 10:41:50 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Mar 8 10:41:50 2021 +0100

    x86/shadow: suppress "fast fault path" optimization when running virtualized
    
    We can't make correctness of our own behavior dependent upon a
    hypervisor underneath us correctly telling us the true physical address
    with hardware uses. Without knowing this, we can't be certain reserved
    bit faults can actually be observed. Therefore, besides evaluating the
    number of address bits when deciding whether to use the optimization,
    also check whether we're running virtualized ourselves. (Note that since
    we may get migrated when running virtualized, the number of address bits
    may also change.)
    
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/arch/x86/mm/shadow/types.h | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index 901645560a..27de593d87 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -282,10 +282,16 @@ static inline shadow_l4e_t shadow_l4e_from_mfn(mfn_t mfn, u32 flags)
  *
  * This is only feasible for PAE and 64bit Xen: 32-bit non-PAE PTEs don't
  * have reserved bits that we can use for this.  And even there it can only
- * be used if the processor doesn't use all 52 address bits.
+ * be used if we can be certain the processor doesn't use all 52 address bits.
  */
 
 #define SH_L1E_MAGIC 0xffffffff00000001ULL
+
+static inline bool sh_have_pte_rsvd_bits(void)
+{
+    return paddr_bits < PADDR_BITS && !cpu_has_hypervisor;
+}
+
 static inline bool sh_l1e_is_magic(shadow_l1e_t sl1e)
 {
     return (sl1e.l1 & SH_L1E_MAGIC) == SH_L1E_MAGIC;
@@ -303,7 +309,7 @@ static inline shadow_l1e_t sh_l1e_gnp(void)
      * On systems with no reserved physical address bits we can't engage the
      * fast fault path.
      */
-    return paddr_bits < PADDR_BITS ? sh_l1e_gnp_raw()
+    return sh_have_pte_rsvd_bits() ? sh_l1e_gnp_raw()
                                    : shadow_l1e_empty();
 }
 
@@ -326,7 +332,7 @@ static inline shadow_l1e_t sh_l1e_mmio(gfn_t gfn, u32 gflags)
 {
     unsigned long gfn_val = MASK_INSR(gfn_x(gfn), SH_L1E_MMIO_GFN_MASK);
 
-    if ( paddr_bits >= PADDR_BITS ||
+    if ( !sh_have_pte_rsvd_bits() ||
          gfn_x(gfn) != MASK_EXTR(gfn_val, SH_L1E_MMIO_GFN_MASK) )
         return shadow_l1e_empty();
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 09 01:55:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 09 Mar 2021 01:55:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.95192.179607 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lJRaS-0002rM-0h; Tue, 09 Mar 2021 01:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 95192.179607; Tue, 09 Mar 2021 01: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 1lJRaR-0002rD-TF; Tue, 09 Mar 2021 01:55:03 +0000
Received: by outflank-mailman (input) for mailman id 95192;
 Tue, 09 Mar 2021 01: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 1lJRaQ-0002r8-Rb
 for xen-changelog@lists.xenproject.org; Tue, 09 Mar 2021 01: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 1lJRaQ-0003Nx-Nr
 for xen-changelog@lists.xenproject.org; Tue, 09 Mar 2021 01:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lJRaQ-00065z-It
 for xen-changelog@lists.xenproject.org; Tue, 09 Mar 2021 01: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=dh7fYh+/7YgLVY7wJfnzNsoligSPj6khhMkB2+XfZYQ=; b=XZoCIoAzb8FbRBBxfky/2HBPY8
	0oF5Hh797zH/UxpZWH/k/U4gpD4AlmTNB8G1Q3u9Y1LvDzqN9EIZmYQj2Fi3vNSFyXiARSxtcXUSO
	BZDrR7MBQHQX+6QQYM8inNUyoBHxE866pdgT55Mo5X59B1AcclBBwv3ixgLqsDUNU+tE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: suppress "fast fault path" optimization when running virtualized
Message-Id: <E1lJRaQ-00065z-It@xenbits.xenproject.org>
Date: Tue, 09 Mar 2021 01:55:02 +0000

commit 60c0444fae2148452f9ed0b7c49af1fa41f8f522
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Mar 8 10:41:50 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Mar 8 10:41:50 2021 +0100

    x86/shadow: suppress "fast fault path" optimization when running virtualized
    
    We can't make correctness of our own behavior dependent upon a
    hypervisor underneath us correctly telling us the true physical address
    with hardware uses. Without knowing this, we can't be certain reserved
    bit faults can actually be observed. Therefore, besides evaluating the
    number of address bits when deciding whether to use the optimization,
    also check whether we're running virtualized ourselves. (Note that since
    we may get migrated when running virtualized, the number of address bits
    may also change.)
    
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/arch/x86/mm/shadow/types.h | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index 901645560a..27de593d87 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -282,10 +282,16 @@ static inline shadow_l4e_t shadow_l4e_from_mfn(mfn_t mfn, u32 flags)
  *
  * This is only feasible for PAE and 64bit Xen: 32-bit non-PAE PTEs don't
  * have reserved bits that we can use for this.  And even there it can only
- * be used if the processor doesn't use all 52 address bits.
+ * be used if we can be certain the processor doesn't use all 52 address bits.
  */
 
 #define SH_L1E_MAGIC 0xffffffff00000001ULL
+
+static inline bool sh_have_pte_rsvd_bits(void)
+{
+    return paddr_bits < PADDR_BITS && !cpu_has_hypervisor;
+}
+
 static inline bool sh_l1e_is_magic(shadow_l1e_t sl1e)
 {
     return (sl1e.l1 & SH_L1E_MAGIC) == SH_L1E_MAGIC;
@@ -303,7 +309,7 @@ static inline shadow_l1e_t sh_l1e_gnp(void)
      * On systems with no reserved physical address bits we can't engage the
      * fast fault path.
      */
-    return paddr_bits < PADDR_BITS ? sh_l1e_gnp_raw()
+    return sh_have_pte_rsvd_bits() ? sh_l1e_gnp_raw()
                                    : shadow_l1e_empty();
 }
 
@@ -326,7 +332,7 @@ static inline shadow_l1e_t sh_l1e_mmio(gfn_t gfn, u32 gflags)
 {
     unsigned long gfn_val = MASK_INSR(gfn_x(gfn), SH_L1E_MMIO_GFN_MASK);
 
-    if ( paddr_bits >= PADDR_BITS ||
+    if ( !sh_have_pte_rsvd_bits() ||
          gfn_x(gfn) != MASK_EXTR(gfn_val, SH_L1E_MMIO_GFN_MASK) )
         return shadow_l1e_empty();
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Mar 09 02:33:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 09 Mar 2021 02:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.95204.179635 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lJSBH-0006rH-Af; Tue, 09 Mar 2021 02:33:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 95204.179635; Tue, 09 Mar 2021 02: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 1lJSBH-0006r9-7h; Tue, 09 Mar 2021 02:33:07 +0000
Received: by outflank-mailman (input) for mailman id 95204;
 Tue, 09 Mar 2021 02:33: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 1lJSBF-0006r4-Tt
 for xen-changelog@lists.xenproject.org; Tue, 09 Mar 2021 02: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 1lJSBF-0004Qd-Qq
 for xen-changelog@lists.xenproject.org; Tue, 09 Mar 2021 02:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lJSBF-0008UA-O3
 for xen-changelog@lists.xenproject.org; Tue, 09 Mar 2021 02: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=l6eSMh6/ascxRWcVwaPjbwcFldjjKKUTcPGvyi12hhA=; b=CWHowdFWkRpLVcgYD6rMh9SbuM
	IlDB6C2Gt6ZRBXtI6Ur873wzTkD5quZyYNKryeWzKfNYxaAkXzqBQUYu1qxD0untjysabIZKcM94+
	aFrfQeSlX/Whfc3IGZu8QnH4xvanUZ4Qub3yOsfqpFWk1zEUoador6QH5wzyfF9pkteY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation/alpine: add g++ to the list of build depends
Message-Id: <E1lJSBF-0008UA-O3@xenbits.xenproject.org>
Date: Tue, 09 Mar 2021 02:33:05 +0000

commit 5ee8e367f26082fb02b40319a019c795571f3f8e
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Mar 1 10:57:14 2021 +0100
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Mon Mar 8 18:20:59 2021 -0800

    automation/alpine: add g++ to the list of build depends
    
    clang++ relies on the C++ headers installed by g++, or else a clang
    build will hit the following error:
    
    <built-in>:3:10: fatal error: 'cstring' file not found
    #include "cstring"
             ^~~~~~~~~
    1 error generated.
    make[10]: *** [Makefile:120: headers++.chk] Error 1
    
    Link: https://gitlab.alpinelinux.org/alpine/aports/-/issues/12492
    Reported-by: Stefano Stabellini <sstabellini@kernel.org>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 automation/build/alpine/3.12.dockerfile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/automation/build/alpine/3.12.dockerfile b/automation/build/alpine/3.12.dockerfile
index 2c02417ee6..94557e239b 100644
--- a/automation/build/alpine/3.12.dockerfile
+++ b/automation/build/alpine/3.12.dockerfile
@@ -21,6 +21,7 @@ RUN \
   apk add curl-dev && \
   apk add dev86 && \
   apk add gcc  && \
+  apk add g++ && \
   apk add clang  && \
   apk add gettext && \
   apk add git && \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 09 02:33:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 09 Mar 2021 02:33:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.95205.179639 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lJSBR-0006s0-CD; Tue, 09 Mar 2021 02:33:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 95205.179639; Tue, 09 Mar 2021 02: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 1lJSBR-0006rs-9H; Tue, 09 Mar 2021 02:33:17 +0000
Received: by outflank-mailman (input) for mailman id 95205;
 Tue, 09 Mar 2021 02:33: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 1lJSBP-0006rk-V8
 for xen-changelog@lists.xenproject.org; Tue, 09 Mar 2021 02: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 1lJSBP-0004Qm-UF
 for xen-changelog@lists.xenproject.org; Tue, 09 Mar 2021 02:33:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lJSBP-0008Um-T6
 for xen-changelog@lists.xenproject.org; Tue, 09 Mar 2021 02: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=8Zv+EJSUHzgf7xS/GZYJ3JY1wNJrdAT2FpQ+iczlVG8=; b=iYjIMmPf3IbyQvYhJMV9XPMN+5
	NdcCWMyoV8cj7om9Dz00dhEDdiYKMZ2QKOGJI7CEUhEXVPhsrOMo1VCJjrhb4luZ9/dkr/qOZJNnI
	AD3R7LacAd49kwNQeLV4jTg47FnDKefYKjtxbITxnkCv0G/Fd0TJUW9irXb6rMifvPfE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation: Fix the Alpine clang builds to use clang
Message-Id: <E1lJSBP-0008Um-T6@xenbits.xenproject.org>
Date: Tue, 09 Mar 2021 02:33:15 +0000

commit 682edc95da4f0ffe8149b4651e5808c76d3a8987
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 26 11:02:33 2021 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Mon Mar 8 18:21:55 2021 -0800

    automation: Fix the Alpine clang builds to use clang
    
    Looks like a copy&paste error.
    
    Fixes: f6e1d8515d7 ("automation: add alpine linux x86 build jobs")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 automation/gitlab-ci/build.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index d00b8a5123..23ab81d892 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -443,13 +443,13 @@ alpine-3.12-gcc-debug:
   allow_failure: true
 
 alpine-3.12-clang:
-  extends: .gcc-x86-64-build
+  extends: .clang-x86-64-build
   variables:
     CONTAINER: alpine:3.12
   allow_failure: true
 
 alpine-3.12-clang-debug:
-  extends: .gcc-x86-64-build-debug
+  extends: .clang-x86-64-build-debug
   variables:
     CONTAINER: alpine:3.12
   allow_failure: true
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 09 17:11:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 09 Mar 2021 17:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.95634.180589 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lJfsw-0002PP-Bh; Tue, 09 Mar 2021 17:11:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 95634.180589; Tue, 09 Mar 2021 17: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 1lJfsw-0002PG-8m; Tue, 09 Mar 2021 17:11:06 +0000
Received: by outflank-mailman (input) for mailman id 95634;
 Tue, 09 Mar 2021 17: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 1lJfsu-0002PB-Vd
 for xen-changelog@lists.xenproject.org; Tue, 09 Mar 2021 17: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 1lJfsu-0003pq-Rd
 for xen-changelog@lists.xenproject.org; Tue, 09 Mar 2021 17:11:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lJfsu-0003Ax-Pv
 for xen-changelog@lists.xenproject.org; Tue, 09 Mar 2021 17: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=X2avJGlpzBTIPEACGNakGkzXJjbL/pIHGgJNJx3VrtA=; b=CAf5fVdQvpoGryHWmqIrFKXYnz
	AXzEx06hXk8dK6iO2EbucaJnOD+oqoGeoanAAIP4j3VZdrUKfpCkxWvStFRIhI+3RCViPB8Tg8G/L
	v+ftlgFVwW582ydbX5gG7APkpVyB0UHHdw5xh1T9ZvnUxNnmZubF/TLnvt6TbyVXqLuU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libxl/ACPI: add missing build dependency
Message-Id: <E1lJfsu-0003Ax-Pv@xenbits.xenproject.org>
Date: Tue, 09 Mar 2021 17:11:04 +0000

commit 1b47cc852fd130ed9ce274a0f1600a4a62949a2c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 9 18:04:07 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 9 18:04:07 2021 +0100

    libxl/ACPI: add missing build dependency
    
    Just like all other object files - wherever *.o is mentioned, *.opic
    also needs mentioning to yield consistent behavior. Otherwise make may
    decide to (re)build the object before recursion into $(ACPI_PATH)/ (to
    update $(DSDT_FILES-y) and ssdt_*.h) was actually finished.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libs/light/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index 216e2f55b0..7d8c51d492 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -32,7 +32,7 @@ ACPI_PATH  = $(XEN_ROOT)/tools/libacpi
 DSDT_FILES-$(CONFIG_X86) = dsdt_pvh.c
 ACPI_OBJS  = $(patsubst %.c,%.o,$(DSDT_FILES-y)) build.o static_tables.o
 ACPI_PIC_OBJS = $(patsubst %.o,%.opic,$(ACPI_OBJS))
-$(DSDT_FILES-y) build.o: acpi
+$(DSDT_FILES-y) build.o build.opic: acpi
 vpath build.c $(ACPI_PATH)/
 vpath static_tables.c $(ACPI_PATH)/
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Mar 10 08:22:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Mar 2021 08:22:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.95908.181090 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lJu6V-0006JR-4s; Wed, 10 Mar 2021 08:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 95908.181090; Wed, 10 Mar 2021 08:22: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 1lJu6V-0006JJ-1t; Wed, 10 Mar 2021 08:22:03 +0000
Received: by outflank-mailman (input) for mailman id 95908;
 Wed, 10 Mar 2021 08: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 1lJu6U-0006JE-26
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 08: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 1lJu6T-0005SJ-UT
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 08:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lJu6T-0008Qp-Ra
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 08: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=tq/Mo7bt6ogSE0z/ltIc7Kd+xZV7/iyqdZzutM70waY=; b=qJx2mAbboXE87JkkDQ8eOsUD54
	6STf3/D//gjRoKcYr10jKE902Fk+qRqs+xelv8Ql543TrBQ/Gi0WyhOEEnjcagxNFY/exWxRDwKr+
	B2fyl1qNjeNk3kXkps7Q2rKu5av+wSLjVqwO8vgpv9K7c7SCLRyzYs0GQwm3juT0xEaM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation/alpine: add g++ to the list of build depends
Message-Id: <E1lJu6T-0008Qp-Ra@xenbits.xenproject.org>
Date: Wed, 10 Mar 2021 08:22:01 +0000

commit 5ee8e367f26082fb02b40319a019c795571f3f8e
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Mar 1 10:57:14 2021 +0100
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Mon Mar 8 18:20:59 2021 -0800

    automation/alpine: add g++ to the list of build depends
    
    clang++ relies on the C++ headers installed by g++, or else a clang
    build will hit the following error:
    
    <built-in>:3:10: fatal error: 'cstring' file not found
    #include "cstring"
             ^~~~~~~~~
    1 error generated.
    make[10]: *** [Makefile:120: headers++.chk] Error 1
    
    Link: https://gitlab.alpinelinux.org/alpine/aports/-/issues/12492
    Reported-by: Stefano Stabellini <sstabellini@kernel.org>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 automation/build/alpine/3.12.dockerfile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/automation/build/alpine/3.12.dockerfile b/automation/build/alpine/3.12.dockerfile
index 2c02417ee6..94557e239b 100644
--- a/automation/build/alpine/3.12.dockerfile
+++ b/automation/build/alpine/3.12.dockerfile
@@ -21,6 +21,7 @@ RUN \
   apk add curl-dev && \
   apk add dev86 && \
   apk add gcc  && \
+  apk add g++ && \
   apk add clang  && \
   apk add gettext && \
   apk add git && \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Mar 10 08:22:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Mar 2021 08:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.95909.181095 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lJu6f-0006KW-6v; Wed, 10 Mar 2021 08:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 95909.181095; Wed, 10 Mar 2021 08:22: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 1lJu6f-0006KO-3S; Wed, 10 Mar 2021 08:22:13 +0000
Received: by outflank-mailman (input) for mailman id 95909;
 Wed, 10 Mar 2021 08: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 1lJu6e-0006KI-2B
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 08: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 1lJu6e-0005SP-1P
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 08:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lJu6e-0008Rb-0T
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 08: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=XJ+ARpeTidjHbeqC9fQPSdgCQInOlMTurmzvLVc9l+E=; b=ZexyPJ+twzZnfHwncic2tMKwp7
	9x9DZZ63YoV5i3Osu/Sj96D04Giy1nSveyBfqG4Fx5IEVMlmavO9Q2qATMb2ZUZjjth1gVgc/hJvp
	Fjg4c8G2u7HiVkC17IXEwNKsPdL6lEhx81Bm6moTEuwUmV5L7+BgSWFsW9Y0IYSF/cL8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: Fix the Alpine clang builds to use clang
Message-Id: <E1lJu6e-0008Rb-0T@xenbits.xenproject.org>
Date: Wed, 10 Mar 2021 08:22:12 +0000

commit 682edc95da4f0ffe8149b4651e5808c76d3a8987
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 26 11:02:33 2021 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Mon Mar 8 18:21:55 2021 -0800

    automation: Fix the Alpine clang builds to use clang
    
    Looks like a copy&paste error.
    
    Fixes: f6e1d8515d7 ("automation: add alpine linux x86 build jobs")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 automation/gitlab-ci/build.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index d00b8a5123..23ab81d892 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -443,13 +443,13 @@ alpine-3.12-gcc-debug:
   allow_failure: true
 
 alpine-3.12-clang:
-  extends: .gcc-x86-64-build
+  extends: .clang-x86-64-build
   variables:
     CONTAINER: alpine:3.12
   allow_failure: true
 
 alpine-3.12-clang-debug:
-  extends: .gcc-x86-64-build-debug
+  extends: .clang-x86-64-build-debug
   variables:
     CONTAINER: alpine:3.12
   allow_failure: true
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Mar 10 13:22:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Mar 2021 13:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.96047.181502 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lJyms-0002z5-HW; Wed, 10 Mar 2021 13:22:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 96047.181502; Wed, 10 Mar 2021 13: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 1lJyms-0002yx-ET; Wed, 10 Mar 2021 13:22:06 +0000
Received: by outflank-mailman (input) for mailman id 96047;
 Wed, 10 Mar 2021 13: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 1lJymr-0002ys-DS
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 13: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 1lJymr-0002QF-7P
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 13:22:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lJymr-0003fH-5t
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 13: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=IneXiiX8kHX7Cpp7WKRuIO+Xrg1+imYA5M8GOjEbwUU=; b=ph6MWzC+Ypehqr6TH4b8iVCASg
	RCZDPrd0jN+dsE1ZRjwxxVThJ9rv1b1LAgy1KcCQmCDGsPtZlyoWL2s6wn1FK4pNGxaTAoGqULKCV
	IkU7Dhpc4/LUKyYbO1o3MSrBriS8clCdIaATeSAbLdLn0wZjDWWqsKvbM/YMkBafr9+I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation: enable rombios build on Alpine
Message-Id: <E1lJymr-0003fH-5t@xenbits.xenproject.org>
Date: Wed, 10 Mar 2021 13:22:05 +0000

commit 4e01c48886d9fbfee3bf7e481c4529a176331c78
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Feb 26 09:59:08 2021 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Wed Mar 10 13:15:13 2021 +0000

    automation: enable rombios build on Alpine
    
    It's now safe to enable the build of rombios on Alpine systems, as
    hvmloader already builds fine there.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Wei Liu <wl@xen.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 automation/scripts/build | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/automation/scripts/build b/automation/scripts/build
index d8990c3bf4..87e44bb940 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -31,9 +31,8 @@ fi
 if ! test -z "$(ldd /bin/ls|grep musl|head -1)"; then
     # disable --disable-werror for QEMUU when building with MUSL
     cfgargs+=("--with-extra-qemuu-configure-args=\"--disable-werror\"")
-    # hvmloader doesn't build on MUSL systems
-    cfgargs+=("--disable-seabios")
-    cfgargs+=("--disable-rombios")
+    # SeaBIOS doesn't build on MUSL systems
+    cfgargs+=("--with-system-seabios=/bin/false")
 fi
 
 # Qemu requires Python 3.5 or later
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Mar 10 16:44:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Mar 2021 16:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.96230.181889 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lK1wO-0008OS-0y; Wed, 10 Mar 2021 16:44:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 96230.181889; Wed, 10 Mar 2021 16:44: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 1lK1wN-0008OK-UB; Wed, 10 Mar 2021 16:44:07 +0000
Received: by outflank-mailman (input) for mailman id 96230;
 Wed, 10 Mar 2021 16:44: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 1lK1wM-0008OF-Gq
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 16:44: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 1lK1wM-0006Nu-D9
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 16:44:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lK1wM-0002Fd-AP
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 16:44: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=uHc9dXPEEacRfis2ovuizLGS/RF/9q4zSELRDKmfqBE=; b=zWfkTdz8e8CCdWjjIDsApkBwC7
	ecx9hm/5Tpn7g2NXlcONOpP1tlyAU00QF7mm2xgLi7HRlrxlz8k1LFo5GcPZPiW4yuou8b+aQMTGk
	jRP4ePEwYQZdTHT8PTpo1vRvcxcvIij7L6s/vker15Vc7Cnpcb1BdXor6byqReauOZDI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] MAINTAINERS: Make myself the owner of the changelog
Message-Id: <E1lK1wM-0002Fd-AP@xenbits.xenproject.org>
Date: Wed, 10 Mar 2021 16:44:06 +0000

commit 3ee5cebcd8fd35304444115630382b0f17aabab2
Author:     Ian Jackson <iwj@xenproject.org>
AuthorDate: Tue Mar 9 14:47:58 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Wed Mar 10 16:13:36 2021 +0000

    MAINTAINERS: Make myself the owner of the changelog
    
    Signed-off-by: Ian Jackson <iwj@xenproject.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 3a5c481543..6a7fa8717e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -256,7 +256,7 @@ S:	Supported
 F:	xen/drivers/passthrough/arm/smmu-v3.c
 
 Change Log
-M:	Paul Durrant <paul@xen.org>
+M:	Ian Jackson <iwj@xenproject.org>
 R:	Community Manager <community.manager@xenproject.org>
 S:	Maintained
 F:	CHANGELOG.md
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Mar 10 16:44:18 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Mar 2021 16:44:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.96231.181893 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lK1wY-0008PX-2P; Wed, 10 Mar 2021 16:44:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 96231.181893; Wed, 10 Mar 2021 16:44: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 1lK1wX-0008PQ-Vk; Wed, 10 Mar 2021 16:44:17 +0000
Received: by outflank-mailman (input) for mailman id 96231;
 Wed, 10 Mar 2021 16:44: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 1lK1wW-0008PH-Ie
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 16:44: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 1lK1wW-0006Nx-Hp
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 16:44:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lK1wW-0002Gg-FY
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 16:44:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2qRge9UFB8ElkZ8r3UAgudh3uUmQpYKmBinXqZtpv8g=; b=xl4mKTGh4TqQmYQjdUaF0N6pRI
	pcYrOW6XgQltsylmAvm3+1YTnJZHVlEkVtAu1nOr2khnXbhD86HZHPyp6tVIpd5aO+m+c4jxwVJuN
	iFlpNIz7CagJ188VNPFcw0i4bKPIZlaTUhuq1CmtsmySqXxKl2EMj8nR9nvy5QXTGljg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CHANGELOG.md: Add sections for 4.14 (belated) and 4.15 (prospective)
Message-Id: <E1lK1wW-0002Gg-FY@xenbits.xenproject.org>
Date: Wed, 10 Mar 2021 16:44:16 +0000

commit b8eaedbb51e8e51808728d7de392d3e9117fdece
Author:     Ian Jackson <iwj@xenproject.org>
AuthorDate: Wed Mar 10 15:53:31 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Wed Mar 10 16:13:45 2021 +0000

    CHANGELOG.md: Add sections for 4.14 (belated) and 4.15 (prospective)
    
    And update the release technician checklist to mention to edit it.
    
    Signed-off-by: Ian Jackson <iwj@xenproject.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 CHANGELOG.md                                  | 4 +++-
 docs/process/release-technician-checklist.txt | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5c3d3c791d..6805f9b7d4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,7 +4,9 @@ Notable changes to Xen will be documented in this file.
 
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 
-## [Unreleased](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog)
+## [4.15.0 UNRELEASED](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.15.0) - TBD
+
+## [4.14.0](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.14.0) - 2020-07-23
 
 ### Added
  - This file and MAINTAINERS entry.
diff --git a/docs/process/release-technician-checklist.txt b/docs/process/release-technician-checklist.txt
index 7ed2636a12..880630c1ed 100644
--- a/docs/process/release-technician-checklist.txt
+++ b/docs/process/release-technician-checklist.txt
@@ -56,6 +56,8 @@ t=RELEASE-$r
 * change SUPPORT.md heading version number; -unstable or -rc tag
 *     (empty in stable branches after .0 release).
 * SUPPORT.md: insert correct version number in release-notes link
+* CHANGELOG.md: set section heading to delete UNRELEASED and add date;
+#               in unstable branches set to X.Y.0 and RELEASE-X.YY.0
 * change xen-unstable xen/Makefile XEN_EXTRAVERSION
 # if main version number has changed (eg 4.7 -> 4.8) rerun ./autogen.sh
 * rerun ./autogen.sh to update version number in configure
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Mar 10 16:44:28 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Mar 2021 16:44:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.96232.181896 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lK1wi-0008Qt-4B; Wed, 10 Mar 2021 16:44:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 96232.181896; Wed, 10 Mar 2021 16:44: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 1lK1wi-0008Ql-1G; Wed, 10 Mar 2021 16:44:28 +0000
Received: by outflank-mailman (input) for mailman id 96232;
 Wed, 10 Mar 2021 16:44: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 1lK1wg-0008Qa-Lm
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 16:44: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 1lK1wg-0006OO-L3
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 16:44:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lK1wg-0002HU-K8
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 16:44:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dGlikNFEMXWiy5rC6msk7atiOkK3Y9BHNdAtQ6C218M=; b=nK6k1Utjbl++kBqIC+LINudPdS
	QPOKa14zwehFCn9mYjOPdzBgkCtr9xDpE6jDNPt5c+T4rh+RjIK6yYZobJeFRQNxpOVn0HaTfH3jA
	C5Xx6GtNAe5e3AejgHZsf5C3r/dEPETt7IsErqtr5oR+EmZQMCUG6PIk2j7soCQ22T/0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CHANGELOG.md: Glean some information from SUPPORT.md
Message-Id: <E1lK1wg-0002HU-K8@xenbits.xenproject.org>
Date: Wed, 10 Mar 2021 16:44:26 +0000

commit e4bdcc8aef6707027168ea29caed844a7da67b4d
Author:     Ian Jackson <iwj@xenproject.org>
AuthorDate: Tue Mar 9 14:39:21 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Wed Mar 10 16:13:48 2021 +0000

    CHANGELOG.md: Glean some information from SUPPORT.md
    
    Signed-off-by: Ian Jackson <iwj@xenproject.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 CHANGELOG.md | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6805f9b7d4..c407f6bb2f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 
 ## [4.15.0 UNRELEASED](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.15.0) - TBD
 
+## Added / support upgraded
+ - ARM IOREQ servers (device emulation etc.) (Tech Preview)
+ - Renesas IPMMU-VMSA (Supported, not security supported; was Tech Preview)
+ - ARM SMMUv3 (Tech Preview)
+
+## Removed / support downgraded
+
+ - qemu-xen-traditional as host process device model, now "No security
+   support, not recommended".  (Use as stub domain device model is still
+   supported - see SUPPORT.md.)
+
 ## [4.14.0](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.14.0) - 2020-07-23
 
 ### Added
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Mar 10 20:33:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Mar 2021 20:33:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.96302.182050 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lK5Vv-0005Kn-LU; Wed, 10 Mar 2021 20:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 96302.182050; Wed, 10 Mar 2021 20: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 1lK5Vv-0005Kf-IK; Wed, 10 Mar 2021 20:33:03 +0000
Received: by outflank-mailman (input) for mailman id 96302;
 Wed, 10 Mar 2021 20: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 1lK5Vu-0005Ka-Hj
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 20: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 1lK5Vu-0001oy-Fm
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 20:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lK5Vu-00058K-C4
 for xen-changelog@lists.xenproject.org; Wed, 10 Mar 2021 20: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=Zv/j9LKNRyORhOZ8TcdR9qnNz0R7n0mgPOVsqQsv3YI=; b=JP0Em5vIPZl3NaXdqJrjUs37lG
	rB/pQfi0RDdWfTOeeTZq+ASUVAHn/0WtWWIwCR5w4QM5m9i+/7r8DVwQqPxZUxq7qtXGpmaPPLkRi
	sGbCauaxy9cMWkVkL4lYGZAiGj01h9VLcH1fOwWaLfrT1kUQQVMiZ+Ctzd8R9ljlEsK8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libxl/ACPI: add missing build dependency
Message-Id: <E1lK5Vu-00058K-C4@xenbits.xenproject.org>
Date: Wed, 10 Mar 2021 20:33:02 +0000

commit 1b47cc852fd130ed9ce274a0f1600a4a62949a2c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 9 18:04:07 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 9 18:04:07 2021 +0100

    libxl/ACPI: add missing build dependency
    
    Just like all other object files - wherever *.o is mentioned, *.opic
    also needs mentioning to yield consistent behavior. Otherwise make may
    decide to (re)build the object before recursion into $(ACPI_PATH)/ (to
    update $(DSDT_FILES-y) and ssdt_*.h) was actually finished.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libs/light/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index 216e2f55b0..7d8c51d492 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -32,7 +32,7 @@ ACPI_PATH  = $(XEN_ROOT)/tools/libacpi
 DSDT_FILES-$(CONFIG_X86) = dsdt_pvh.c
 ACPI_OBJS  = $(patsubst %.c,%.o,$(DSDT_FILES-y)) build.o static_tables.o
 ACPI_PIC_OBJS = $(patsubst %.o,%.opic,$(ACPI_OBJS))
-$(DSDT_FILES-y) build.o: acpi
+$(DSDT_FILES-y) build.o build.opic: acpi
 vpath build.c $(ACPI_PATH)/
 vpath static_tables.c $(ACPI_PATH)/
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Mar 11 09:55:15 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Mar 2021 09:55:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.96417.182372 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKI27-0008Et-QE; Thu, 11 Mar 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 96417.182372; Thu, 11 Mar 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 1lKI27-0008Ej-N4; Thu, 11 Mar 2021 09:55:07 +0000
Received: by outflank-mailman (input) for mailman id 96417;
 Thu, 11 Mar 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 1lKI25-0008Ee-OT
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 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 1lKI25-0002AL-KU
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 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 1lKI25-0008ED-Eq
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 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=QPRx1beL/tVZhMcEin6vlNofrbKiZZImHHPSQBjuEgk=; b=izKi4OOo0MzwZyjSclKjV56djf
	cUlHd1nrtAtSuEnKEBTamjl+liNfiVFJ4E3eqhc2tz829Tfm2cM9T6BmzO6sI+MK7dB/rEFK5cXP5
	8QfyuJtdTZAhCP0OxpMe9JGIJPprkOvGberyPJUEMxIheohnebUetVDN2ELYXoy9Obiw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstore: Consolidate PRINTF_ATTRIBUTE() in utils.h
Message-Id: <E1lKI25-0008ED-Eq@xenbits.xenproject.org>
Date: Thu, 11 Mar 2021 09:55:05 +0000

commit 209b309e33ebbf8674a9d84fd73cce7f1e70e7eb
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Mar 5 12:40:02 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Mar 11 09:44:51 2021 +0000

    tools/xenstore: Consolidate PRINTF_ATTRIBUTE() in utils.h
    
    At the moment PRINTF_ATTRIBUTE() is defined in two places:
        - tdb.h: Defined as a NOP
        - talloc.h: Defined as a NOP for GCC older than 3.0 otherwise will
        add the attribute to check the printf format
    
    Xen requires to build with minimum GCC 4.1 and we want to check the
    printf format for all the printf-like functions.
    
    Only implement PRINTF_ATTRIBUTE() once in utils.h and drop the
    conditional check for GCC < 3.0.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/xenstore/talloc.h | 15 ++-------------
 tools/xenstore/tdb.h    |  6 ++----
 tools/xenstore/utils.h  |  2 ++
 3 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/tools/xenstore/talloc.h b/tools/xenstore/talloc.h
index 71a36e7be0..a0f4bff257 100644
--- a/tools/xenstore/talloc.h
+++ b/tools/xenstore/talloc.h
@@ -26,6 +26,8 @@
 
 #include <sys/types.h>
 
+#include "utils.h"
+
 /* this is only needed for compatibility with the old talloc */
 typedef void TALLOC_CTX;
 
@@ -84,19 +86,6 @@ typedef void TALLOC_CTX;
 #define talloc_destroy(ctx) talloc_free(ctx)
 #endif
 
-#ifndef PRINTF_ATTRIBUTE
-#if (__GNUC__ >= 3)
-/** Use gcc attribute to check printf fns.  a1 is the 1-based index of
- * the parameter containing the format, and a2 the index of the first
- * argument. Note that some gcc 2.x versions don't handle this
- * properly **/
-#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
-#else
-#define PRINTF_ATTRIBUTE(a1, a2)
-#endif
-#endif
-
-
 /* The following definitions come from talloc.c  */
 void *_talloc(const void *context, size_t size);
 void talloc_set_destructor(const void *ptr, int (*destructor)(void *));
diff --git a/tools/xenstore/tdb.h b/tools/xenstore/tdb.h
index 557cf727b8..ce3c7339f8 100644
--- a/tools/xenstore/tdb.h
+++ b/tools/xenstore/tdb.h
@@ -1,6 +1,8 @@
 #ifndef __TDB_H__
 #define __TDB_H__
 
+#include "utils.h"
+
 /* 
    Unix SMB/CIFS implementation.
 
@@ -84,10 +86,6 @@ struct tdb_traverse_lock {
 	uint32_t hash;
 };
 
-#ifndef PRINTF_ATTRIBUTE
-#define PRINTF_ATTRIBUTE(a,b)
-#endif
-
 /* this is the context structure that is returned from a db open */
 typedef struct tdb_context {
 	char *name; /* the name of the database */
diff --git a/tools/xenstore/utils.h b/tools/xenstore/utils.h
index df1cb9a3ba..3dfb96b556 100644
--- a/tools/xenstore/utils.h
+++ b/tools/xenstore/utils.h
@@ -27,6 +27,8 @@ static inline bool strends(const char *a, const char *b)
  */
 const char *dump_state_align(FILE *fp);
 
+#define PRINTF_ATTRIBUTE(a1, a2) __attribute__((format (printf, a1, a2)))
+
 void barf(const char *fmt, ...) __attribute__((noreturn));
 void barf_perror(const char *fmt, ...) __attribute__((noreturn));
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Mar 11 09:55:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Mar 2021 09:55:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.96418.182376 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKI2H-0008Fi-Rc; Thu, 11 Mar 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 96418.182376; Thu, 11 Mar 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 1lKI2H-0008Fa-OY; Thu, 11 Mar 2021 09:55:17 +0000
Received: by outflank-mailman (input) for mailman id 96418;
 Thu, 11 Mar 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 1lKI2F-0008FO-P3
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 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 1lKI2F-0002AV-OA
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 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 1lKI2F-0008Es-Mj
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 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=7KsTgA4dr246hubT/3GmzCBd7YQn0n20oRawM/M6PrA=; b=Rr4WAjcebNhFoDdU871fG6dJ7u
	vXjLEF91s9ubn2H3ialInFfiOsURNQ3eXAZ6PLDmiOHS2xmQx7a4v/nfxtOuPY1rFU+at2B+1Z/Ie
	EyjtX52iMf+ui2hRZtvYaoG7Az1Oco3ADrLMoxCNHuSbRVEWT1CXGhfOD2pFuo/xs7XI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstore: Check the format printf for xprintf() and barf{,_perror}()
Message-Id: <E1lKI2F-0008Es-Mj@xenbits.xenproject.org>
Date: Thu, 11 Mar 2021 09:55:15 +0000

commit 1fff444679a1ffa67d0bf55744b80555ab58f9f8
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Mar 5 12:40:03 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Mar 11 09:47:02 2021 +0000

    tools/xenstore: Check the format printf for xprintf() and barf{,_perror}()
    
    Allow GCC to analyze the format printf for xprintf() and
    barf{,_perror}().
    
    Take the opportunity to define __noreturn to make the prototype for
    barf{,_perror})() easier to read.
    
    Also document why 'extern' is used for xprintf().
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/xenstore/utils.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/xenstore/utils.h b/tools/xenstore/utils.h
index 3dfb96b556..87713a8e5d 100644
--- a/tools/xenstore/utils.h
+++ b/tools/xenstore/utils.h
@@ -29,10 +29,13 @@ const char *dump_state_align(FILE *fp);
 
 #define PRINTF_ATTRIBUTE(a1, a2) __attribute__((format (printf, a1, a2)))
 
-void barf(const char *fmt, ...) __attribute__((noreturn));
-void barf_perror(const char *fmt, ...) __attribute__((noreturn));
+#define __noreturn __attribute__((noreturn))
 
-extern void (*xprintf)(const char *fmt, ...);
+void barf(const char *fmt, ...) __noreturn PRINTF_ATTRIBUTE(1, 2);
+void barf_perror(const char *fmt, ...) __noreturn PRINTF_ATTRIBUTE(1, 2);
+
+/* Function pointer as xprintf() can be configured at runtime. */
+extern void (*xprintf)(const char *fmt, ...) PRINTF_ATTRIBUTE(1, 2);
 
 #define eprintf(_fmt, _args...) xprintf("[ERR] %s" _fmt, __FUNCTION__, ##_args)
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Mar 11 09:55:28 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Mar 2021 09:55:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.96420.182386 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKI2S-0008Hq-9E; Thu, 11 Mar 2021 09:55:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 96420.182386; Thu, 11 Mar 2021 09:55: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 1lKI2S-0008HZ-22; Thu, 11 Mar 2021 09:55:28 +0000
Received: by outflank-mailman (input) for mailman id 96420;
 Thu, 11 Mar 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 1lKI2P-0008Gz-SJ
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 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 1lKI2P-0002Ak-RW
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 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 1lKI2P-0008FU-Qe
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 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=iGv4LqhZkYZ69ITgUMPBPii8FJos7DvMRjn2jPkXW88=; b=h4AfJaC3zLEjAZ7ZY0TBUIGNtZ
	5bMHbi+k+JUWyXCqAaRFhISE06uEPOrzx/rWWQvsHb3RnPB4geAAr0wEML8mWKF1nauZRI6bBJY10
	CtfZ51jOJQynRW7UtM+UH1+QnKk/5CDp+yYY0wpzNW2BcCjnBSZC2xwHXrgCKGtuxjfY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/public: replace typeof() with __typeof__()
Message-Id: <E1lKI2P-0008FU-Qe@xenbits.xenproject.org>
Date: Thu, 11 Mar 2021 09:55:25 +0000

commit 935e0836710ce8cab584155b2844cea8497a5159
Author:     Elliott Mitchell <ehem+xen@m5p.com>
AuthorDate: Mon Mar 8 05:36:18 2021 -0800
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Mar 11 09:51:07 2021 +0000

    xen/public: replace typeof() with __typeof__()
    
    typeof() is available in Xen's build environment, which uses Xen's
    compiler.  As these headers are public, they need strict standards
    conformance.  Only __typeof__() is officially standardized.
    
    A compiler in standards conformance mode should report:
    
    warning: implicit declaration of function 'typeof' is invalid in C99
    [-Wimplicit-function-declaration]
    
    (this has been observed with FreeBSD's kernel build environment)
    
    Based-on-patch-by: Julien Grall <julien@xen.org>, Sun Oct 4 20:33:04 2015 +0100
    Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/include/public/arch-arm.h | 2 +-
 xen/include/public/hvm/save.h | 4 ++--
 xen/include/public/io/ring.h  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index c365b1b39e..713fd65317 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -191,7 +191,7 @@
 #define XEN_GUEST_HANDLE_PARAM(name)    __guest_handle_ ## name
 #define set_xen_guest_handle_raw(hnd, val)                  \
     do {                                                    \
-        typeof(&(hnd)) _sxghr_tmp = &(hnd);                 \
+        __typeof__(&(hnd)) _sxghr_tmp = &(hnd);             \
         _sxghr_tmp->q = 0;                                  \
         _sxghr_tmp->p = val;                                \
     } while ( 0 )
diff --git a/xen/include/public/hvm/save.h b/xen/include/public/hvm/save.h
index f72e3a9bc4..bea5e9f50f 100644
--- a/xen/include/public/hvm/save.h
+++ b/xen/include/public/hvm/save.h
@@ -82,12 +82,12 @@ struct hvm_save_descriptor {
     struct __HVM_SAVE_TYPE_##_x { _type t; char c[_code]; char cpt[1];}
 #endif
 
-#define HVM_SAVE_TYPE(_x) typeof (((struct __HVM_SAVE_TYPE_##_x *)(0))->t)
+#define HVM_SAVE_TYPE(_x) __typeof__ (((struct __HVM_SAVE_TYPE_##_x *)(0))->t)
 #define HVM_SAVE_LENGTH(_x) (sizeof (HVM_SAVE_TYPE(_x)))
 #define HVM_SAVE_CODE(_x) (sizeof (((struct __HVM_SAVE_TYPE_##_x *)(0))->c))
 
 #ifdef __XEN__
-# define HVM_SAVE_TYPE_COMPAT(_x) typeof (((struct __HVM_SAVE_TYPE_COMPAT_##_x *)(0))->t)
+# define HVM_SAVE_TYPE_COMPAT(_x) __typeof__ (((struct __HVM_SAVE_TYPE_COMPAT_##_x *)(0))->t)
 # define HVM_SAVE_LENGTH_COMPAT(_x) (sizeof (HVM_SAVE_TYPE_COMPAT(_x)))
 
 # define HVM_SAVE_HAS_COMPAT(_x) (sizeof (((struct __HVM_SAVE_TYPE_##_x *)(0))->cpt)-1)
diff --git a/xen/include/public/io/ring.h b/xen/include/public/io/ring.h
index d68615ae2f..6a94a9fe4b 100644
--- a/xen/include/public/io/ring.h
+++ b/xen/include/public/io/ring.h
@@ -242,7 +242,7 @@ typedef struct __name##_back_ring __name##_back_ring_t
  */
 #define RING_COPY_REQUEST(_r, _idx, _req) do {				\
 	/* Use volatile to force the copy into _req. */			\
-	*(_req) = *(volatile typeof(_req))RING_GET_REQUEST(_r, _idx);	\
+	*(_req) = *(volatile __typeof__(_req))RING_GET_REQUEST(_r, _idx);	\
 } while (0)
 
 #define RING_GET_RESPONSE(_r, _idx)                                     \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Mar 11 13:11:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Mar 2021 13:11:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.96530.182674 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKL5j-00047P-65; Thu, 11 Mar 2021 13:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 96530.182674; Thu, 11 Mar 2021 13: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 1lKL5j-00047G-3C; Thu, 11 Mar 2021 13:11:03 +0000
Received: by outflank-mailman (input) for mailman id 96530;
 Thu, 11 Mar 2021 13: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 1lKL5i-000477-Ab
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 13: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 1lKL5i-0005Vj-6h
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 13:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKL5i-00069P-41
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 13: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=KFXjbvBmLM3yoE/mocemD7kh3i2nZ62KvRwBB1adIuU=; b=LbkwHMZoYVkCJQuCLJAULLqvI4
	NcMmlUH3pwAytFkZywhINt0kDbdNan8oesV1lsnZWRtq7pyf0xnZ1V4oPrxjEIjko9OHzNVaxBB/b
	H2nnPW1NofYqe+kBDw6fiDl0wAdUzwkECnWP/8oBi10se8dqn2Ne2WjYxsOfxMzrRmXE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: enable rombios build on Alpine
Message-Id: <E1lKL5i-00069P-41@xenbits.xenproject.org>
Date: Thu, 11 Mar 2021 13:11:02 +0000

commit 4e01c48886d9fbfee3bf7e481c4529a176331c78
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Feb 26 09:59:08 2021 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Wed Mar 10 13:15:13 2021 +0000

    automation: enable rombios build on Alpine
    
    It's now safe to enable the build of rombios on Alpine systems, as
    hvmloader already builds fine there.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Wei Liu <wl@xen.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 automation/scripts/build | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/automation/scripts/build b/automation/scripts/build
index d8990c3bf4..87e44bb940 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -31,9 +31,8 @@ fi
 if ! test -z "$(ldd /bin/ls|grep musl|head -1)"; then
     # disable --disable-werror for QEMUU when building with MUSL
     cfgargs+=("--with-extra-qemuu-configure-args=\"--disable-werror\"")
-    # hvmloader doesn't build on MUSL systems
-    cfgargs+=("--disable-seabios")
-    cfgargs+=("--disable-rombios")
+    # SeaBIOS doesn't build on MUSL systems
+    cfgargs+=("--with-system-seabios=/bin/false")
 fi
 
 # Qemu requires Python 3.5 or later
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Mar 11 13:11:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Mar 2021 13:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.96532.182680 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKL5t-00048w-7z; Thu, 11 Mar 2021 13:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 96532.182680; Thu, 11 Mar 2021 13: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 1lKL5t-00048j-4l; Thu, 11 Mar 2021 13:11:13 +0000
Received: by outflank-mailman (input) for mailman id 96532;
 Thu, 11 Mar 2021 13: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 1lKL5s-00048c-Ax
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 13: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 1lKL5s-0005Vo-AE
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 13:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKL5s-0006A5-9F
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 13: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=3/332urq3JhHcyW8D8sErSE+i7ZUZax2GVn5/Xw9X2E=; b=pMpaVvolfcGFEuJESPd/RhS2Xo
	1VVvnFYxEvQg8xCjZeSsGhe/z/iJZI856z4hPZcJ/z008TU3fEkPBM7f7PqF2PHMGN2sJY0+FOOX4
	edIkLRgR+Tfr4pQvCsTGu+s/v2Sw8Y/uU2B2TtsFY7C8gjAT5FNBLfFnUxzx5Ckut40g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] MAINTAINERS: Make myself the owner of the changelog
Message-Id: <E1lKL5s-0006A5-9F@xenbits.xenproject.org>
Date: Thu, 11 Mar 2021 13:11:12 +0000

commit 3ee5cebcd8fd35304444115630382b0f17aabab2
Author:     Ian Jackson <iwj@xenproject.org>
AuthorDate: Tue Mar 9 14:47:58 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Wed Mar 10 16:13:36 2021 +0000

    MAINTAINERS: Make myself the owner of the changelog
    
    Signed-off-by: Ian Jackson <iwj@xenproject.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 3a5c481543..6a7fa8717e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -256,7 +256,7 @@ S:	Supported
 F:	xen/drivers/passthrough/arm/smmu-v3.c
 
 Change Log
-M:	Paul Durrant <paul@xen.org>
+M:	Ian Jackson <iwj@xenproject.org>
 R:	Community Manager <community.manager@xenproject.org>
 S:	Maintained
 F:	CHANGELOG.md
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Mar 11 13:11:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Mar 2021 13:11:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.96534.182683 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKL64-0004Ar-9U; Thu, 11 Mar 2021 13:11:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 96534.182683; Thu, 11 Mar 2021 13: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 1lKL64-0004Ah-6C; Thu, 11 Mar 2021 13:11:24 +0000
Received: by outflank-mailman (input) for mailman id 96534;
 Thu, 11 Mar 2021 13: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 1lKL62-0004AC-Hq
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 13: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 1lKL62-0005Vx-FS
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 13:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKL62-0006B4-CS
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 13: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=0ukgeph51oAVZdmrTCn7fnrH+UXljY26Ri/B4iLxqZE=; b=A+pdD7vRBPEDOYonWlft0wxQiu
	q8TP5E1Vbn0Q1/zAs+YrbXuzdao9A2EaOvwhCNIHzjwyEFfPjeBkQANpro91RzozG9MiN/xlbAKX5
	GdMj4jH5s+idV7jGTN8c1ZZUb+Qor0zmqzYu/ehR6Q36xHDBpUic+SUY+iRCQ1YfLXP0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CHANGELOG.md: Add sections for 4.14 (belated) and 4.15 (prospective)
Message-Id: <E1lKL62-0006B4-CS@xenbits.xenproject.org>
Date: Thu, 11 Mar 2021 13:11:22 +0000

commit b8eaedbb51e8e51808728d7de392d3e9117fdece
Author:     Ian Jackson <iwj@xenproject.org>
AuthorDate: Wed Mar 10 15:53:31 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Wed Mar 10 16:13:45 2021 +0000

    CHANGELOG.md: Add sections for 4.14 (belated) and 4.15 (prospective)
    
    And update the release technician checklist to mention to edit it.
    
    Signed-off-by: Ian Jackson <iwj@xenproject.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 CHANGELOG.md                                  | 4 +++-
 docs/process/release-technician-checklist.txt | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5c3d3c791d..6805f9b7d4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,7 +4,9 @@ Notable changes to Xen will be documented in this file.
 
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 
-## [Unreleased](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog)
+## [4.15.0 UNRELEASED](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.15.0) - TBD
+
+## [4.14.0](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.14.0) - 2020-07-23
 
 ### Added
  - This file and MAINTAINERS entry.
diff --git a/docs/process/release-technician-checklist.txt b/docs/process/release-technician-checklist.txt
index 7ed2636a12..880630c1ed 100644
--- a/docs/process/release-technician-checklist.txt
+++ b/docs/process/release-technician-checklist.txt
@@ -56,6 +56,8 @@ t=RELEASE-$r
 * change SUPPORT.md heading version number; -unstable or -rc tag
 *     (empty in stable branches after .0 release).
 * SUPPORT.md: insert correct version number in release-notes link
+* CHANGELOG.md: set section heading to delete UNRELEASED and add date;
+#               in unstable branches set to X.Y.0 and RELEASE-X.YY.0
 * change xen-unstable xen/Makefile XEN_EXTRAVERSION
 # if main version number has changed (eg 4.7 -> 4.8) rerun ./autogen.sh
 * rerun ./autogen.sh to update version number in configure
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Mar 11 13:11:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Mar 2021 13:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.96535.182687 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKL6E-0004Dl-Al; Thu, 11 Mar 2021 13:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 96535.182687; Thu, 11 Mar 2021 13:11: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 1lKL6E-0004Dd-7g; Thu, 11 Mar 2021 13:11:34 +0000
Received: by outflank-mailman (input) for mailman id 96535;
 Thu, 11 Mar 2021 13: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 1lKL6C-0004Cc-Kt
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 13: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 1lKL6C-0005W4-KA
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 13:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKL6C-0006Bn-Hf
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 13: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=B6mW8K944aPTvVGM+IU8z0w37gj5kaXpuzDyVh0m9xc=; b=5FHV30zMUU7yEpQSkyAjVsiEGi
	qFUVW4suMbDADq+dKClY9OX88QfKlBSGjSt8B9dY/1vDyG6Pt3MiwG7xyqblz7c3RzOo1skQG65Ee
	Z8DlkzlN/OrOCa/p+kJ/OY64+VpxB/pmXov6fE3/p2AVsfI53DQRx/m8RMml/p+UKt9k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CHANGELOG.md: Glean some information from SUPPORT.md
Message-Id: <E1lKL6C-0006Bn-Hf@xenbits.xenproject.org>
Date: Thu, 11 Mar 2021 13:11:32 +0000

commit e4bdcc8aef6707027168ea29caed844a7da67b4d
Author:     Ian Jackson <iwj@xenproject.org>
AuthorDate: Tue Mar 9 14:39:21 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Wed Mar 10 16:13:48 2021 +0000

    CHANGELOG.md: Glean some information from SUPPORT.md
    
    Signed-off-by: Ian Jackson <iwj@xenproject.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 CHANGELOG.md | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6805f9b7d4..c407f6bb2f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 
 ## [4.15.0 UNRELEASED](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.15.0) - TBD
 
+## Added / support upgraded
+ - ARM IOREQ servers (device emulation etc.) (Tech Preview)
+ - Renesas IPMMU-VMSA (Supported, not security supported; was Tech Preview)
+ - ARM SMMUv3 (Tech Preview)
+
+## Removed / support downgraded
+
+ - qemu-xen-traditional as host process device model, now "No security
+   support, not recommended".  (Use as stub domain device model is still
+   supported - see SUPPORT.md.)
+
 ## [4.14.0](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.14.0) - 2020-07-23
 
 ### Added
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Mar 11 15:44:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Mar 2021 15:44:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.96671.183147 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKNTq-0006Ee-Fk; Thu, 11 Mar 2021 15:44:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 96671.183147; Thu, 11 Mar 2021 15:44: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 1lKNTq-0006EW-Ci; Thu, 11 Mar 2021 15:44:06 +0000
Received: by outflank-mailman (input) for mailman id 96671;
 Thu, 11 Mar 2021 15:44: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 1lKNTp-0006ER-Ey
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 15:44: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 1lKNTp-0008AH-BJ
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 15:44:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKNTp-0008KY-AG
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 15:44:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=e+rw6SzQpNlGqfumakUPuV3kB4GV72ubJB8v9m60Fis=; b=v0kH16LFFXHh67NNV39vA5Htwa
	qGaPwduUTEK4DhkhiLPlCgfe/ttLIJ8lDwV1p4WCLTKnunwulRUvVAGyyvF7kJCGJRZmikkF1GDRn
	Ue7B/Cysk2+sN44zSlLi4TJxVBs1qOJM2MbBvDongOferq52vBv5BloN+ADV4w9PQLN8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation: allow doing hypervisor only builds
Message-Id: <E1lKNTp-0008KY-AG@xenbits.xenproject.org>
Date: Thu, 11 Mar 2021 15:44:05 +0000

commit 893103e286ac1c500d2ad113f55c41edb35e047c
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Mar 3 15:33:16 2021 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Mar 11 15:39:37 2021 +0000

    automation: allow doing hypervisor only builds
    
    For things like randconfig there's no need to do a full Xen build, a
    hypervisor build only will be much faster and will achieve the same
    level of testing, as randconfig only changes the hypervisor build
    options.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    Acked-by: Doug Goldstein <cardoe@cardoe.com>
---
 automation/scripts/build | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/automation/scripts/build b/automation/scripts/build
index 87e44bb940..1b752edfe6 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -11,6 +11,7 @@ cc-ver()
 # random config or default config
 if [[ "${RANDCONFIG}" == "y" ]]; then
     make -j$(nproc) -C xen KCONFIG_ALLCONFIG=tools/kconfig/allrandom.config randconfig
+    hypervisor_only="y"
 else
     make -j$(nproc) -C xen defconfig
 fi
@@ -45,16 +46,27 @@ if [[ "${CC}" == "gcc" && `cc-ver` -lt 0x040600 ]]; then
     cfgargs+=("--with-system-seabios=/bin/false")
 fi
 
-./configure "${cfgargs[@]}"
-
-make -j$(nproc) dist
+if [[ "${hypervisor_only}" == "y" ]]; then
+    make -j$(nproc) xen
+else
+    ./configure "${cfgargs[@]}"
+    make -j$(nproc) dist
+fi
 
 # Extract artifacts to avoid getting rewritten by customised builds
 cp xen/.config xen-config
 mkdir binaries
 if [[ "${XEN_TARGET_ARCH}" != "x86_32" ]]; then
     cp xen/xen binaries/xen
-    cp -r dist binaries/
+    if [[ "${hypervisor_only}" != "y" ]]; then
+        cp -r dist binaries/
+    fi
+fi
+
+if [[ "${hypervisor_only}" == "y" ]]; then
+    # If we are build testing a specific Kconfig exit now, there's no point in
+    # testing all the possible configs.
+    exit 0
 fi
 
 # Build all the configs we care about
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Mar 11 19:11:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Mar 2021 19:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.96722.183322 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKQiA-0003cY-VX; Thu, 11 Mar 2021 19:11:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 96722.183322; Thu, 11 Mar 2021 19: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 1lKQiA-0003cQ-SZ; Thu, 11 Mar 2021 19:11:06 +0000
Received: by outflank-mailman (input) for mailman id 96722;
 Thu, 11 Mar 2021 19: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 1lKQi9-0003cL-7L
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 19: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 1lKQi9-0003iI-2u
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 19:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKQi9-0001kh-1T
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 19: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=4H88O0mC28x1TnNBs0zk2QAQIRKXtS7CdCQHSZdd4+0=; b=MctGxIKkjtxrK+/VteL/de00iL
	lHu+Oc3/Q8iq57MM4cfcBw7AIrlR2sTkalt3SMxIHgon4gHf4uz+udtQST7vRY79NsSO4C2mbJTCv
	nI+XRsSvaup6eks6YFRidf5zQ2/sLiJjdTM52LHe62N9+FudZ/KeyjKoTx9aEW0PzQIM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxentoolcore: Fill in LIBHEADERS
Message-Id: <E1lKQi9-0001kh-1T@xenbits.xenproject.org>
Date: Thu, 11 Mar 2021 19:11:05 +0000

commit 67390ec1f73f48253d53a59581bf6574234708a1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Mar 1 17:30:00 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Mar 11 17:27:48 2021 +0000

    tools/libxentoolcore: Fill in LIBHEADERS
    
    c/s 4664034cd replaced a glob over include/*.h with an expectation that
    LIBHEADER was suitably set for libraries which didn't have a single,
    consistently named, header file.
    
    This wasn't true for xentoolcore, which lost xentoolcore_internal.h as a
    consequence, and failed an API/ABI check vs 4.14
    
    Fixes: 4664034cd ("tools/libs: move official headers to common directory")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libs/toolcore/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/libs/toolcore/Makefile b/tools/libs/toolcore/Makefile
index 1cf30733c9..3550786491 100644
--- a/tools/libs/toolcore/Makefile
+++ b/tools/libs/toolcore/Makefile
@@ -5,6 +5,8 @@ MAJOR	= 1
 MINOR	= 0
 AUTOINCS := $(XEN_INCLUDE)/_xentoolcore_list.h
 
+LIBHEADER := xentoolcore.h xentoolcore_internal.h
+
 SRCS-y	+= handlereg.c
 
 include $(XEN_ROOT)/tools/libs/libs.mk
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Mar 11 19:11:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Mar 2021 19:11:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.96723.183326 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKQiL-0003dP-0l; Thu, 11 Mar 2021 19:11:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 96723.183326; Thu, 11 Mar 2021 19: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 1lKQiK-0003dH-U2; Thu, 11 Mar 2021 19:11:16 +0000
Received: by outflank-mailman (input) for mailman id 96723;
 Thu, 11 Mar 2021 19: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 1lKQiJ-0003d9-8R
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 19: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 1lKQiJ-0003iL-68
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 19:11:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKQiJ-0001lH-59
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 19: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=DRpnmj9RXPT3hBOz8CI4+UraJFxPVlFmp9SYYUkXApU=; b=gjKEbFf8G12PEO0E77BQSZR09D
	HQdcLi2baBWozhVcIDd7CscVfvsTBQTZ3H2YRHLqHR03kJCtpZA4Mp1mII9qwC+TZ0fpWKqvu3zN6
	o33+5dgDY70NPut0wY3I4pWOVXxTq0UEunZ8mprBPomaUy0YPbHfUhEyyXwklNc+sbGw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/dmop: Strip __XEN_TOOLS__ header guard from public ABI
Message-Id: <E1lKQiJ-0001lH-59@xenbits.xenproject.org>
Date: Thu, 11 Mar 2021 19:11:15 +0000

commit 368096b9c4a273be58dd897e996e3e010bcfc21b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Mar 4 22:30:00 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Mar 11 17:27:48 2021 +0000

    xen/dmop: Strip __XEN_TOOLS__ header guard from public ABI
    
    __XEN_TOOLS__ is really there to separate the unstable from stable hypercalls.
    Exactly as with c/s f40e1c52e4, stable interfaces shouldn't contain this
    guard.
    
    That change actually broke the build with:
    
      include/xendevicemodel.h:52:5: error: unknown type name 'ioservid_t'
           ioservid_t *id);
           ^
    
    as libxendevicemodel.h now uses a type it can't see a typedef for.  However,
    nothing noticed because the header.chk logic is also broken (fixed
    subsequently).
    
    Strip the guard from the public header, and remove compensation from
    devicemodel's private.h.  Fix the dmop design doc to discuss both reasons
    behind the the ABI design.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 docs/designs/dmop.pandoc         | 12 +++++++++---
 tools/libs/devicemodel/private.h |  2 --
 xen/include/public/hvm/dm_op.h   |  5 -----
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/docs/designs/dmop.pandoc b/docs/designs/dmop.pandoc
index 8e9f95af47..49e52b1bcc 100644
--- a/docs/designs/dmop.pandoc
+++ b/docs/designs/dmop.pandoc
@@ -4,9 +4,15 @@ DMOP
 Introduction
 ------------
 
-The aim of DMOP is to prevent a compromised device model from compromising
-domains other than the one it is providing emulation for (which is therefore
-likely already compromised).
+The DMOP hypercall has a new ABI design to solve problems in the Xen
+ecosystem.  First, the ABI is fully stable, to reduce the coupling between
+device models and the version of Xen.  Specifically, device model software
+using DMOP (be it user, stub domain or kernel software) need not be recompiled
+to match the version of the running hypervisor.
+
+Secondly, for device models in userspace, the ABI is designed specifically to
+allow a kernel to audit the memory ranges used, without having to know the
+internal structure of sub-ops.
 
 The problem occurs when you a device model issues an hypercall that
 includes references to user memory other than the operation structure
diff --git a/tools/libs/devicemodel/private.h b/tools/libs/devicemodel/private.h
index c4a225f8af..c24f3396bb 100644
--- a/tools/libs/devicemodel/private.h
+++ b/tools/libs/devicemodel/private.h
@@ -1,8 +1,6 @@
 #ifndef XENDEVICEMODEL_PRIVATE_H
 #define XENDEVICEMODEL_PRIVATE_H
 
-#define __XEN_TOOLS__ 1
-
 #include <xentoollog.h>
 #include <xendevicemodel.h>
 #include <xencall.h>
diff --git a/xen/include/public/hvm/dm_op.h b/xen/include/public/hvm/dm_op.h
index ef7fbc0d3d..fa3f083fed 100644
--- a/xen/include/public/hvm/dm_op.h
+++ b/xen/include/public/hvm/dm_op.h
@@ -25,9 +25,6 @@
 #define __XEN_PUBLIC_HVM_DM_OP_H__
 
 #include "../xen.h"
-
-#if defined(__XEN__) || defined(__XEN_TOOLS__)
-
 #include "../event_channel.h"
 
 #ifndef uint64_aligned_t
@@ -491,8 +488,6 @@ struct xen_dm_op {
     } u;
 };
 
-#endif /* __XEN__ || __XEN_TOOLS__ */
-
 struct xen_dm_op_buf {
     XEN_GUEST_HANDLE(void) h;
     xen_ulong_t size;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Mar 11 19:11:27 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Mar 2021 19:11:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.96724.183330 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKQiV-0003eg-2h; Thu, 11 Mar 2021 19:11:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 96724.183330; Thu, 11 Mar 2021 19: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 1lKQiU-0003eY-VZ; Thu, 11 Mar 2021 19:11:26 +0000
Received: by outflank-mailman (input) for mailman id 96724;
 Thu, 11 Mar 2021 19: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 1lKQiT-0003eN-Bb
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 19: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 1lKQiT-0003iX-9L
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 19:11:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKQiT-0001m6-8J
 for xen-changelog@lists.xenproject.org; Thu, 11 Mar 2021 19: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=cLXDS3BYmxwz4dJjWF6Z5+RlWGSbTw4pJZ0CDnhOR38=; b=f6B8NqRSOj97ortT5SF1lbSzLh
	RSt88fvx/bMs2KBkaw0KHax6aB/asJCx34gjBmDq+2neKzGSo/SxcYFHxJQA5jcM5Cz0LbiO3mZq5
	YFP1RMhHMJJk2mcleUx8qr1Zs8Blqztefd4jrckJrzKUKAdFSXypaGtzRv5PrK0ci+T0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libs: Fix headers.chk logic
Message-Id: <E1lKQiT-0001m6-8J@xenbits.xenproject.org>
Date: Thu, 11 Mar 2021 19:11:25 +0000

commit 9e23f10eb0db5ffa06f1a43f74fac790992a85c7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Mar 4 22:30:00 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Mar 11 17:27:48 2021 +0000

    tools/libs: Fix headers.chk logic
    
    c/s 4664034cd dropped the $(LIBHEADERSGLOB) dependency for the headers.chk
    rule, without replacing it.
    
    As headers.chk uses $^, a typical build looks like:
    
      andrewcoop@andrewcoop:/local/xen.git$ make -C tools/libs/devicemodel/
      make: Entering directory '/local/xen.git/tools/libs/devicemodel'
      for i in ; do \
          gcc -x c -ansi -Wall -Werror -I/local/xen.git/tools/libs/devicemodel/../../../tools/include \
                -S -o /dev/null $i || exit 1; \
          echo $i; \
      done >headers.chk.new
      mv headers.chk.new headers.chk
    
    i.e. with an empty for loop.
    
    Reinsert a $(LIBHEADERS) dependency, so more than just the $(AUTOINCS) get
    checked.
    
    Fixes: 4664034cd ("tools/libs: move official headers to common directory")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libs/libs.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index a68cec244c..2d973ccb95 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -76,7 +76,7 @@ else
 .PHONY: headers.chk
 endif
 
-headers.chk: $(AUTOINCS)
+headers.chk: $(LIBHEADERS) $(AUTOINCS)
 
 headers.lst: FORCE
 	@{ set -e; $(foreach h,$(LIBHEADERS),echo $(h);) } > $@.tmp
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Mar 12 08:11:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Mar 2021 08:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.96893.183781 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKct0-0001ja-9d; Fri, 12 Mar 2021 08:11:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 96893.183781; Fri, 12 Mar 2021 08: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 1lKct0-0001jS-6O; Fri, 12 Mar 2021 08:11:06 +0000
Received: by outflank-mailman (input) for mailman id 96893;
 Fri, 12 Mar 2021 08: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 1lKcsz-0001jN-3M
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 08: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 1lKcsz-0003Ff-22
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 08:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKcsy-0001tF-Vg
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 08: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=ZD3LeP/waGx24SLMpCCEJMeDZJO432G2M8eyRX6OqMI=; b=3sY4w/oLdHNOceCOBHs36Q7qqW
	Lp0LPvo+IfEjM64XZTwyNzM7EatUCU+bDU58iQ1Hk6Kh9QT44vn8QXsk+7r2L9xDqJfDl9oXQwW3A
	vVlhiJWctEbhRbBBkjXUCpjCAVNKt4S3uL152kFKMHMUeVGCKQjskc2clEeyA3UrDSfI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/msr: introduce an option for compatible MSR behavior selection
Message-Id: <E1lKcsy-0001tF-Vg@xenbits.xenproject.org>
Date: Fri, 12 Mar 2021 08:11:04 +0000

commit 0570d7f276dd20a3adee80ca44a5fe7daf7566cd
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Mar 12 08:59:56 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 12 08:59:56 2021 +0100

    x86/msr: introduce an option for compatible MSR behavior selection
    
    Introduce an option to allow selecting a behavior similar to the pre
    Xen 4.15 one for accesses to MSRs not explicitly handled. Since commit
    84e848fd7a162f669 and 322ec7c89f6640e accesses to MSRs not explicitly
    handled by Xen result in the injection of a #GP to the guest. This
    is a behavior change since previously a #GP was only injected if
    accessing the MSR on the real hardware would also trigger a #GP, or if
    the attempted to be set bits wouldn't match the hardware values (for
    PV). The reasons for not leaking hardware MSR values and injecting a
    #GP are fully valid, so the solution proposed here should be
    considered a temporary workaround until all the required MSRs are
    properly handled.
    
    This seems to be problematic for some guests, so introduce an option
    to fallback to this kind of legacy behavior without leaking the
    underlying MSR values to the guest.
    
    When the option is set, for both PV and HVM don't inject a #GP to the
    guest on MSR read if reading the underlying MSR doesn't result in a
    #GP, do the same for writes and simply discard the value to be written
    on that case.
    
    Note that for guests restored or migrated from previous Xen versions
    the option is enabled by default, in order to keep a compatible
    MSR behavior. Such compatibility is done at the libxl layer, to avoid
    higher-level toolstacks from having to know the details about this flag.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 docs/man/xl.cfg.5.pod.in            | 14 ++++++++++++++
 docs/misc/xen-command-line.pandoc   | 14 +++++++++++++-
 tools/include/libxl.h               |  7 +++++++
 tools/libs/light/libxl_arch.h       |  5 +++++
 tools/libs/light/libxl_arm.c        |  6 ++++++
 tools/libs/light/libxl_create.c     |  7 +++++++
 tools/libs/light/libxl_internal.c   |  3 +++
 tools/libs/light/libxl_types.idl    |  2 ++
 tools/libs/light/libxl_x86.c        | 20 ++++++++++++++++++++
 tools/ocaml/libs/xc/xenctrl.ml      |  4 ++++
 tools/ocaml/libs/xc/xenctrl.mli     |  4 ++++
 tools/ocaml/libs/xc/xenctrl_stubs.c |  9 +++++++++
 tools/xl/xl_parse.c                 |  7 +++++++
 xen/arch/x86/dom0_build.c           |  3 +++
 xen/arch/x86/domain.c               |  9 +++++++++
 xen/arch/x86/hvm/svm/svm.c          | 10 ++++++++++
 xen/arch/x86/hvm/vmx/vmx.c          | 10 ++++++++++
 xen/arch/x86/pv/emul-priv-op.c      | 10 ++++++++++
 xen/arch/x86/setup.c                |  3 +++
 xen/include/asm-x86/domain.h        |  3 +++
 xen/include/asm-x86/setup.h         |  1 +
 xen/include/public/arch-x86/xen.h   |  8 ++++++++
 22 files changed, 158 insertions(+), 1 deletion(-)

diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
index 040374dcd6..56370a37db 100644
--- a/docs/man/xl.cfg.5.pod.in
+++ b/docs/man/xl.cfg.5.pod.in
@@ -2861,6 +2861,20 @@ No MCA capabilities in above list are enabled.
 
 =back
 
+=item B<msr_relaxed=BOOLEAN>
+
+The "msr_relaxed" boolean is an interim option, and defaults to false.
+
+In Xen 4.15, the default behaviour for unhandled MSRs has been changed,
+to avoid leaking host data into guests, and to avoid breaking guest
+logic which uses #GP probing to identify the availability of MSRs.
+
+However, this new stricter behaviour has the possibility to break
+guests, and a more 4.14-like behaviour can be selected by setting this
+option.
+
+If using this option is necessary to fix an issue, please report a bug.
+
 =back
 
 =head1 SEE ALSO
diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 4737c92bfe..a0601ff838 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -740,7 +740,7 @@ Specify the bit width of the DMA heap.
 
 ### dom0
     = List of [ pv | pvh, shadow=<bool>, verbose=<bool>,
-                cpuid-faulting=<bool> ]
+                cpuid-faulting=<bool>, msr-relaxed=<bool> ]
 
     Applicability: x86
 
@@ -789,6 +789,18 @@ Controls for how dom0 is constructed on x86 systems.
     restore the pre-4.13 behaviour.  If specifying `no-cpuid-faulting` fixes
     an issue in dom0, please report a bug.
 
+*   The `msr-relaxed` boolean is an interim option, and defaults to false.
+
+    In Xen 4.15, the default behaviour for unhandled MSRs has been changed,
+    to avoid leaking host data into guests, and to avoid breaking guest
+    logic which uses \#GP probing to identify the availability of MSRs.
+
+    However, this new stricter behaviour has the possibility to break
+    guests, and a more 4.14-like behaviour can be selected by specifying
+    `dom0=msr-relaxed`.
+
+    If using this option is necessary to fix an issue, please report a bug.
+
 ### dom0-iommu
     = List of [ passthrough=<bool>, strict=<bool>, map-inclusive=<bool>,
                 map-reserved=<bool>, none ]
diff --git a/tools/include/libxl.h b/tools/include/libxl.h
index a7b673e89d..ae7fe27c1f 100644
--- a/tools/include/libxl.h
+++ b/tools/include/libxl.h
@@ -495,6 +495,13 @@
  */
 #define LIBXL_HAVE_VMTRACE_BUF_KB 1
 
+/*
+ * LIBXL_HAVE_X86_MSR_RELAXED indicates the toolstack has support for switching
+ * the MSR access handling in the hypervisor to relaxed mode. This is done by
+ * setting the libxl_domain_build_info arch_x86.msr_relaxed field.
+ */
+#define LIBXL_HAVE_X86_MSR_RELAXED 1
+
 /*
  * libxl ABI compatibility
  *
diff --git a/tools/libs/light/libxl_arch.h b/tools/libs/light/libxl_arch.h
index c305d704b1..8527fc5c6c 100644
--- a/tools/libs/light/libxl_arch.h
+++ b/tools/libs/light/libxl_arch.h
@@ -85,6 +85,11 @@ int libxl__arch_extra_memory(libxl__gc *gc,
                              const libxl_domain_build_info *info,
                              uint64_t *out);
 
+_hidden
+void libxl__arch_update_domain_config(libxl__gc *gc,
+                                      libxl_domain_config *dst,
+                                      const libxl_domain_config *src);
+
 #if defined(__i386__) || defined(__x86_64__)
 
 #define LAPIC_BASE_ADDRESS  0xfee00000
diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
index 5e2a209a8b..e2901f13b7 100644
--- a/tools/libs/light/libxl_arm.c
+++ b/tools/libs/light/libxl_arm.c
@@ -1222,6 +1222,12 @@ int libxl__arch_passthrough_mode_setdefault(libxl__gc *gc,
     return rc;
 }
 
+void libxl__arch_update_domain_config(libxl__gc *gc,
+                                      libxl_domain_config *dst,
+                                      const libxl_domain_config *src)
+{
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c
index 46f68da697..1131b2a733 100644
--- a/tools/libs/light/libxl_create.c
+++ b/tools/libs/light/libxl_create.c
@@ -2287,6 +2287,13 @@ int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config,
         unset_disk_colo_restore(d_config);
     }
 
+    /*
+     * When restoring (either from a save file or for a migration domain) set
+     * the MSR relaxed mode for compatibility with older Xen versions if the
+     * option is not set as part of the original configuration.
+     */
+    libxl_defbool_setdefault(&d_config->b_info.arch_x86.msr_relaxed, true);
+
     return do_domain_create(ctx, d_config, domid, restore_fd, send_back_fd,
                             params, ao_how, aop_console_how);
 }
diff --git a/tools/libs/light/libxl_internal.c b/tools/libs/light/libxl_internal.c
index d93a75533f..86556b6113 100644
--- a/tools/libs/light/libxl_internal.c
+++ b/tools/libs/light/libxl_internal.c
@@ -16,6 +16,7 @@
 #include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
+#include "libxl_arch.h"
 
 void libxl__alloc_failed(libxl_ctx *ctx, const char *func,
                          size_t nmemb, size_t size) {
@@ -594,6 +595,8 @@ void libxl__update_domain_configuration(libxl__gc *gc,
 
     /* video ram */
     dst->b_info.video_memkb = src->b_info.video_memkb;
+
+    libxl__arch_update_domain_config(gc, dst, src);
 }
 
 static void ev_slowlock_init_internal(libxl__ev_slowlock *lock,
diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
index 5b85a7419f..f45adddab0 100644
--- a/tools/libs/light/libxl_types.idl
+++ b/tools/libs/light/libxl_types.idl
@@ -644,6 +644,8 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("arch_arm", Struct(None, [("gic_version", libxl_gic_version),
                                ("vuart", libxl_vuart_type),
                               ])),
+    ("arch_x86", Struct(None, [("msr_relaxed", libxl_defbool),
+                              ])),
     # Alternate p2m is not bound to any architecture or guest type, as it is
     # supported by x86 HVM and ARM support is planned.
     ("altp2m", libxl_altp2m_mode),
diff --git a/tools/libs/light/libxl_x86.c b/tools/libs/light/libxl_x86.c
index 58187ed760..ac09897a63 100644
--- a/tools/libs/light/libxl_x86.c
+++ b/tools/libs/light/libxl_x86.c
@@ -19,6 +19,10 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
         abort();
     }
 
+    config->arch.misc_flags = 0;
+    if (libxl_defbool_val(d_config->b_info.arch_x86.msr_relaxed))
+        config->arch.misc_flags |= XEN_X86_MSR_RELAXED;
+
     return 0;
 }
 
@@ -809,6 +813,7 @@ void libxl__arch_domain_build_info_setdefault(libxl__gc *gc,
                                               libxl_domain_build_info *b_info)
 {
     libxl_defbool_setdefault(&b_info->acpi, true);
+    libxl_defbool_setdefault(&b_info->arch_x86.msr_relaxed, false);
 }
 
 int libxl__arch_passthrough_mode_setdefault(libxl__gc *gc,
@@ -851,6 +856,21 @@ int libxl__arch_passthrough_mode_setdefault(libxl__gc *gc,
     return rc;
 }
 
+void libxl__arch_update_domain_config(libxl__gc *gc,
+                                      libxl_domain_config *dst,
+                                      const libxl_domain_config *src)
+{
+    /*
+     * Force MSR relaxed to be set (either to true or false) so it's part of
+     * the domain configuration when saving or performing a live-migration.
+     *
+     * Doing so allows the recovery side to figure out whether the flag should
+     * be set to true in order to keep backwards compatibility with already
+     * started domains.
+     */
+    libxl_defbool_setdefault(&dst->b_info.arch_x86.msr_relaxed,
+                    libxl_defbool_val(src->b_info.arch_x86.msr_relaxed));
+}
 
 /*
  * Local variables:
diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml
index a02e26b27f..a5588c643f 100644
--- a/tools/ocaml/libs/xc/xenctrl.ml
+++ b/tools/ocaml/libs/xc/xenctrl.ml
@@ -48,9 +48,13 @@ type x86_arch_emulation_flags =
 	| X86_EMU_USE_PIRQ
 	| X86_EMU_VPCI
 
+type x86_arch_misc_flags =
+	| X86_MSR_RELAXED
+
 type xen_x86_arch_domainconfig =
 {
 	emulation_flags: x86_arch_emulation_flags list;
+	misc_flags: x86_arch_misc_flags list;
 }
 
 type arch_domainconfig =
diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli
index d2a312e273..6e94940a8a 100644
--- a/tools/ocaml/libs/xc/xenctrl.mli
+++ b/tools/ocaml/libs/xc/xenctrl.mli
@@ -42,8 +42,12 @@ type x86_arch_emulation_flags =
   | X86_EMU_USE_PIRQ
   | X86_EMU_VPCI
 
+type x86_arch_misc_flags =
+  | X86_MSR_RELAXED
+
 type xen_x86_arch_domainconfig = {
   emulation_flags: x86_arch_emulation_flags list;
+  misc_flags: x86_arch_misc_flags list;
 }
 
 type arch_domainconfig =
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 9a8dbe5579..d05d7bb30e 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -233,6 +233,15 @@ CAMLprim value stub_xc_domain_create(value xch, value wanted_domid, value config
 
 #undef VAL_EMUL_FLAGS
 
+#define VAL_MISC_FLAGS          Field(arch_domconfig, 1)
+
+		cfg.arch.misc_flags = ocaml_list_to_c_bitmap
+			/* ! x86_arch_misc_flags X86_ none */
+			/* ! XEN_X86_ XEN_X86_MSR_RELAXED all */
+			(VAL_MISC_FLAGS);
+
+#undef VAL_MISC_FLAGS
+
 #else
 		caml_failwith("Unhandled: x86");
 #endif
diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index 1893cfc086..9fb0791429 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -2741,6 +2741,13 @@ skip_usbdev:
     xlu_cfg_get_defbool(config, "xend_suspend_evtchn_compat",
                         &c_info->xend_suspend_evtchn_compat, 0);
 
+    if (!xlu_cfg_get_defbool(config, "msr_relaxed",
+                             &b_info->arch_x86.msr_relaxed, 0))
+            fprintf(stderr,
+                    "WARNING: msr_relaxed will be removed in future versions.\n"
+                    "If it fixes an issue you are having please report to "
+                    "xen-devel@lists.xenproject.org.\n");
+
     xlu_cfg_destroy(config);
 }
 
diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 0ce29e91a3..74b443e509 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -256,6 +256,7 @@ bool __initdata opt_dom0_shadow;
 #endif
 bool __initdata opt_dom0_pvh = !IS_ENABLED(CONFIG_PV);
 bool __initdata opt_dom0_verbose = IS_ENABLED(CONFIG_VERBOSE_DEBUG);
+bool __initdata opt_dom0_msr_relaxed;
 
 static int __init parse_dom0_param(const char *s)
 {
@@ -282,6 +283,8 @@ static int __init parse_dom0_param(const char *s)
         else if ( IS_ENABLED(CONFIG_PV) &&
                   (val = parse_boolean("cpuid-faulting", s, ss)) >= 0 )
             opt_dom0_cpuid_faulting = val;
+        else if ( (val = parse_boolean("msr-relaxed", s, ss)) >= 0 )
+            opt_dom0_msr_relaxed = val;
         else
             rc = -EINVAL;
 
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 5e3c94d3fa..b212729880 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -683,6 +683,13 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
         }
     }
 
+    if ( config->arch.misc_flags & ~XEN_X86_MSR_RELAXED )
+    {
+        dprintk(XENLOG_INFO, "Invalid arch misc flags %#x\n",
+                config->arch.misc_flags);
+        return -EINVAL;
+    }
+
     return 0;
 }
 
@@ -852,6 +859,8 @@ int arch_domain_create(struct domain *d,
 
     domain_cpu_policy_changed(d);
 
+    d->arch.msr_relaxed = config->arch.misc_flags & XEN_X86_MSR_RELAXED;
+
     return 0;
 
  fail:
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index b819897a4a..4585efe1f8 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1795,6 +1795,7 @@ static int svm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
     const struct domain *d = v->domain;
     struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
     const struct nestedsvm *nsvm = &vcpu_nestedsvm(v);
+    uint64_t tmp;
 
     switch ( msr )
     {
@@ -1965,6 +1966,12 @@ static int svm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
         break;
 
     default:
+        if ( d->arch.msr_relaxed && !rdmsr_safe(msr, tmp) )
+        {
+            *msr_content = 0;
+            break;
+        }
+
         gdprintk(XENLOG_WARNING, "RDMSR 0x%08x unimplemented\n", msr);
         goto gpf;
     }
@@ -2151,6 +2158,9 @@ static int svm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         break;
 
     default:
+        if ( d->arch.msr_relaxed && !rdmsr_safe(msr, msr_content) )
+            break;
+
         gdprintk(XENLOG_WARNING,
                  "WRMSR 0x%08x val 0x%016"PRIx64" unimplemented\n",
                  msr, msr_content);
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index bfea1b0f8a..b52824677e 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -3123,6 +3123,7 @@ static int is_last_branch_msr(u32 ecx)
 static int vmx_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
 {
     struct vcpu *curr = current;
+    uint64_t tmp;
 
     HVM_DBG_LOG(DBG_LEVEL_MSR, "ecx=%#x", msr);
 
@@ -3204,6 +3205,12 @@ static int vmx_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
             break;
         }
 
+        if ( curr->domain->arch.msr_relaxed && !rdmsr_safe(msr, tmp) )
+        {
+            *msr_content = 0;
+            break;
+        }
+
         gdprintk(XENLOG_WARNING, "RDMSR 0x%08x unimplemented\n", msr);
         goto gp_fault;
     }
@@ -3505,6 +3512,9 @@ static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content)
              is_last_branch_msr(msr) )
             break;
 
+        if ( v->domain->arch.msr_relaxed && !rdmsr_safe(msr, msr_content) )
+            break;
+
         gdprintk(XENLOG_WARNING,
                  "WRMSR 0x%08x val 0x%016"PRIx64" unimplemented\n",
                  msr, msr_content);
diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index e5a22b9347..74e71403ff 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -875,6 +875,7 @@ static int read_msr(unsigned int reg, uint64_t *val,
     const struct domain *currd = curr->domain;
     const struct cpuid_policy *cp = currd->arch.cpuid;
     bool vpmu_msr = false;
+    uint64_t tmp;
     int ret;
 
     if ( (ret = guest_rdmsr(curr, reg, val)) != X86EMUL_UNHANDLEABLE )
@@ -986,6 +987,12 @@ static int read_msr(unsigned int reg, uint64_t *val,
         }
         /* fall through */
     default:
+        if ( currd->arch.msr_relaxed && !rdmsr_safe(reg, tmp) )
+        {
+            *val = 0;
+            return X86EMUL_OKAY;
+        }
+
         gdprintk(XENLOG_WARNING, "RDMSR 0x%08x unimplemented\n", reg);
         break;
 
@@ -1148,6 +1155,9 @@ static int write_msr(unsigned int reg, uint64_t val,
         }
         /* fall through */
     default:
+        if ( currd->arch.msr_relaxed && !rdmsr_safe(reg, val) )
+            return X86EMUL_OKAY;
+
         gdprintk(XENLOG_WARNING,
                  "WRMSR 0x%08x val 0x%016"PRIx64" unimplemented\n",
                  reg, val);
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 23bbb6e8c1..68454df8ed 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -749,6 +749,9 @@ static struct domain *__init create_dom0(const module_t *image,
         .max_grant_frames = -1,
         .max_maptrack_frames = -1,
         .max_vcpus = dom0_max_vcpus(),
+        .arch = {
+            .misc_flags = opt_dom0_msr_relaxed ? XEN_X86_MSR_RELAXED : 0,
+        },
     };
     struct domain *d;
     char *cmdline;
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 3900d7b48b..7213d184b0 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -437,6 +437,9 @@ struct arch_domain
     /* Mem_access emulation control */
     bool_t mem_access_emulate_each_rep;
 
+    /* Don't unconditionally inject #GP for unhandled MSRs. */
+    bool msr_relaxed;
+
     /* Emulated devices enabled bitmap. */
     uint32_t emulation_flags;
 } __cacheline_aligned;
diff --git a/xen/include/asm-x86/setup.h b/xen/include/asm-x86/setup.h
index 642a5e8460..24be46115d 100644
--- a/xen/include/asm-x86/setup.h
+++ b/xen/include/asm-x86/setup.h
@@ -65,6 +65,7 @@ extern bool opt_dom0_shadow;
 extern bool opt_dom0_pvh;
 extern bool opt_dom0_verbose;
 extern bool opt_dom0_cpuid_faulting;
+extern bool opt_dom0_msr_relaxed;
 
 #define max_init_domid (0)
 
diff --git a/xen/include/public/arch-x86/xen.h b/xen/include/public/arch-x86/xen.h
index 629cb2ba40..6bf1e8cccb 100644
--- a/xen/include/public/arch-x86/xen.h
+++ b/xen/include/public/arch-x86/xen.h
@@ -304,6 +304,14 @@ struct xen_arch_domainconfig {
                                      XEN_X86_EMU_PIT | XEN_X86_EMU_USE_PIRQ |\
                                      XEN_X86_EMU_VPCI)
     uint32_t emulation_flags;
+
+/*
+ * Select whether to use a relaxed behavior for accesses to MSRs not explicitly
+ * handled by Xen instead of injecting a #GP to the guest. Note this option
+ * doesn't allow the guest to read or write to the underlying MSR.
+ */
+#define XEN_X86_MSR_RELAXED (1u << 0)
+    uint32_t misc_flags;
 };
 
 /* Location of online VCPU bitmap. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Mar 12 16:11:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Mar 2021 16:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.97225.184589 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKkNV-0005Bb-V9; Fri, 12 Mar 2021 16:11:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 97225.184589; Fri, 12 Mar 2021 16: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 1lKkNV-0005BQ-Rp; Fri, 12 Mar 2021 16:11:05 +0000
Received: by outflank-mailman (input) for mailman id 97225;
 Fri, 12 Mar 2021 16: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 1lKkNV-0005BL-2E
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 16: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 1lKkNV-0003Z7-1O
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 16:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKkNV-0008VF-0M
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 16: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=fDfHczgfwncfCZ2grCo9tsyHpQjgeFMm7PXy4RQXvqo=; b=kx/6XgbEL0qMIO0eoKD3ZIfPsx
	8Chv3ppplj5X03ci2+wbcUs2AY4g2apjpZchsZ7DjgpBWpKirL3i9k551kE4ta8WpZNsTuBVLyA67
	JxaaJPhROQ9gJiCecaNMdhP/Gb1gqEcThBIUgNbkkcQBjFnSwJkbTxMXXyT31sd6YNk4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] vtd: make sure QI/IR are disabled before initialisation
Message-Id: <E1lKkNV-0008VF-0M@xenbits.xenproject.org>
Date: Fri, 12 Mar 2021 16:11:05 +0000

commit 04181c6fb543db01f635227c7681ced4073109ba
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Fri Mar 12 17:01:52 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 12 17:01:52 2021 +0100

    vtd: make sure QI/IR are disabled before initialisation
    
    BIOS might pass control to Xen leaving QI and/or IR in enabled and/or
    partially configured state. In case of x2APIC code path where EIM is
    enabled early in boot - those are correctly disabled by Xen before any
    attempt to configure. But for xAPIC that step is missing which was
    proven to cause QI initialization failures on some ICX based platforms
    where QI is left pre-enabled and partially configured by BIOS. That
    problem becomes hard to avoid since those platforms are shipped with
    x2APIC opt out being advertised by default at the same time by firmware.
    
    Unify the behaviour between x2APIC and xAPIC code paths keeping that in
    line with what Linux does.
    
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/arch/x86/apic.c                 |  2 +-
 xen/drivers/passthrough/vtd/iommu.c | 12 +++++++++++-
 xen/include/asm-x86/apic.h          |  1 +
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 7497ddb5da..8ab8214559 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -47,7 +47,7 @@ static bool __read_mostly tdt_enabled;
 static bool __initdata tdt_enable = true;
 boolean_param("tdt", tdt_enable);
 
-static bool __read_mostly iommu_x2apic_enabled;
+bool __read_mostly iommu_x2apic_enabled;
 
 static struct {
     int active;
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 475efb3be3..9b58d566c8 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2101,7 +2101,7 @@ static int __must_check init_vtd_hw(void)
     u32 sts;
 
     /*
-     * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults.  
+     * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults, etc.
      */
     for_each_drhd_unit ( drhd )
     {
@@ -2111,6 +2111,16 @@ static int __must_check init_vtd_hw(void)
 
         clear_fault_bits(iommu);
 
+        /*
+         * Disable interrupt remapping and queued invalidation if
+         * already enabled by BIOS in case we've not initialized it yet.
+         */
+        if ( !iommu_x2apic_enabled )
+        {
+            disable_intremap(iommu);
+            disable_qinval(iommu);
+        }
+
         spin_lock_irqsave(&iommu->register_lock, flags);
         sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
         sts &= ~DMA_FECTL_IM;
diff --git a/xen/include/asm-x86/apic.h b/xen/include/asm-x86/apic.h
index 8ddb896ee9..2fe54bbf1c 100644
--- a/xen/include/asm-x86/apic.h
+++ b/xen/include/asm-x86/apic.h
@@ -24,6 +24,7 @@ enum apic_mode {
     APIC_MODE_X2APIC    /* x2APIC mode - common for large MP machines */
 };
 
+extern bool iommu_x2apic_enabled;
 extern u8 apic_verbosity;
 extern bool directed_eoi_enabled;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Mar 12 16:11:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Mar 2021 16:11:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.97226.184593 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKkNg-0005CK-0B; Fri, 12 Mar 2021 16:11:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 97226.184593; Fri, 12 Mar 2021 16: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 1lKkNf-0005CC-TI; Fri, 12 Mar 2021 16:11:15 +0000
Received: by outflank-mailman (input) for mailman id 97226;
 Fri, 12 Mar 2021 16: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 1lKkNf-0005C7-5P
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 16: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 1lKkNf-0003ZA-4g
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 16:11:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKkNf-0008Vn-3m
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 16: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=qII8BCeP5bGBJj+16KJASmg9Y8juT/yVIfzKz+tvwSM=; b=K34qL1y4VpQUW7/D7BgNmhFS5g
	G1uyTzKQZUWl3fSnkiPJRFXysWrKQOWpLT8MqhOE+QckjTD6TMXiasC4v4US/6ZLcHpN770eNVW1R
	HO18PNUwUMS4PLjtgALeXMDtCtVEvwtJxzntagDjVB8lNarMaITLQrPCv9wpllqhFKq0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: fix for_each_cpu when NR_CPUS=1
Message-Id: <E1lKkNf-0008Vn-3m@xenbits.xenproject.org>
Date: Fri, 12 Mar 2021 16:11:15 +0000

commit aa50f45332f17e8d6308b996d890d3e83748a1a5
Author:     Dario Faggioli <dfaggioli@suse.com>
AuthorDate: Fri Mar 12 17:02:47 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 12 17:02:47 2021 +0100

    xen: fix for_each_cpu when NR_CPUS=1
    
    When running an hypervisor build with NR_CPUS=1 for_each_cpu does not
    take into account whether the bit of the CPU is set or not in the
    provided mask.
    
    This means that whatever we have in the bodies of these loops is always
    done once, even if the mask was empty and it should never be done. This
    is clearly a bug and was in fact causing an assert to trigger in credit2
    code.
    
    Removing the special casing of NR_CPUS == 1 makes things work again.
    
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/include/xen/cpumask.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/xen/include/xen/cpumask.h b/xen/include/xen/cpumask.h
index 256b60b106..e69589fc08 100644
--- a/xen/include/xen/cpumask.h
+++ b/xen/include/xen/cpumask.h
@@ -368,15 +368,10 @@ static inline void free_cpumask_var(cpumask_var_t mask)
 #define FREE_CPUMASK_VAR(m) free_cpumask_var(m)
 #endif
 
-#if NR_CPUS > 1
 #define for_each_cpu(cpu, mask)			\
 	for ((cpu) = cpumask_first(mask);	\
 	     (cpu) < nr_cpu_ids;		\
 	     (cpu) = cpumask_next(cpu, mask))
-#else /* NR_CPUS == 1 */
-#define for_each_cpu(cpu, mask)			\
-	for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)(mask))
-#endif /* NR_CPUS */
 
 /*
  * The following particular system cpumasks and operations manage
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Mar 12 16:44:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Mar 2021 16:44:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.97242.184648 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKktS-0000Ck-EC; Fri, 12 Mar 2021 16:44:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 97242.184648; Fri, 12 Mar 2021 16:44: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 1lKktS-0000Cc-BC; Fri, 12 Mar 2021 16:44:06 +0000
Received: by outflank-mailman (input) for mailman id 97242;
 Fri, 12 Mar 2021 16:44: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 1lKktR-0000CX-5m
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 16:44: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 1lKktQ-00045X-U5
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 16:44:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKktQ-00028V-Rf
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 16: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=4AI66CwD12acCh/2VedE9yiY4fTnVSwkAJI713TI+JE=; b=kAh/r1nmMyjuJ7JgTKkWF44EBE
	2Ayk5EY86NEGe68kFiJFSF7pAlQCUm+sxV3GOgOpUC5rkJmy99DZjoGiSoUerEQtuMt/CJeakM9cX
	0v39D0vIiXztCNDKjSOeZtulOhr06STpYErSWX1qlmHNppVwzhMg+j40R1Kh842FFTqE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] gnttab: work around "may be used uninitialized" warning
Message-Id: <E1lKktQ-00028V-Rf@xenbits.xenproject.org>
Date: Fri, 12 Mar 2021 16:44:04 +0000

commit 9dc46386d89d83c73c41c2b19be83a73957c4393
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 12 17:35:54 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 12 17:35:54 2021 +0100

    gnttab: work around "may be used uninitialized" warning
    
    Sadly I was wrong to suggest dropping vaddrs' initializer during review
    of v2 of the patch introducing this code. gcc 4.3 can't cope.
    
    Fixes: 52531c734ea1 ("xen/gnttab: Rework resource acquisition")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/common/grant_table.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index f937c1d350..ab30e2e8cf 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -4026,7 +4026,7 @@ int gnttab_acquire_resource(
     struct grant_table *gt = d->grant_table;
     unsigned int i, final_frame;
     mfn_t tmp;
-    void **vaddrs;
+    void **vaddrs = NULL;
     int rc = -EINVAL;
 
     if ( !nr_frames )
@@ -4055,6 +4055,17 @@ int gnttab_acquire_resource(
         break;
     }
 
+    /*
+     * Some older toolchains can't spot that vaddrs won't remain uninitialized
+     * on non-error paths, and hence it needs setting to NULL at the top of the
+     * function.  Leave some runtime safety.
+     */
+    if ( !vaddrs )
+    {
+        ASSERT_UNREACHABLE();
+        rc = -ENODATA;
+    }
+
     /* Any errors?  Bad id, or from growing the table? */
     if ( rc )
         goto out;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Mar 12 17:11:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Mar 2021 17:11:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.97266.184727 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKlJb-0003gO-3o; Fri, 12 Mar 2021 17:11:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 97266.184727; Fri, 12 Mar 2021 17: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 1lKlJb-0003gG-0k; Fri, 12 Mar 2021 17:11:07 +0000
Received: by outflank-mailman (input) for mailman id 97266;
 Fri, 12 Mar 2021 17: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 1lKlJZ-0003gB-8f
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 17: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 1lKlJZ-0004bB-4H
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 17:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKlJZ-0007wL-3J
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 17: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=0Q5P7Mdc2yu0ZkFiJ0MGEzXPe3axXfWJUbmgWGSDf/g=; b=u2D10fJFEMQrAMIQNITIlwdNMb
	kLNVmFMcJYxgZfQ/ue0IUJ7qnIyu2nz1+UMoh29n9qnYJSh9Zy/hMM2N6w5yqATm7Y4SE9L761dWB
	JjGuA32rDbyOi24yhkp03l3J6nTVSjWSONNp8429a625sCKhLKz55er+X4lDHEU7Rg04=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/PV: conditionally avoid raising #GP for early guest MSR reads
Message-Id: <E1lKlJZ-0007wL-3J@xenbits.xenproject.org>
Date: Fri, 12 Mar 2021 17:11:05 +0000

commit 6eef0a99262cc903495879448cc4ffefe305ef2a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 12 12:02:42 2021 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 12 17:00:08 2021 +0000

    x86/PV: conditionally avoid raising #GP for early guest MSR reads
    
    Prior to 4.15 Linux, when running in PV mode, did not install a #GP
    handler early enough to cover for example the rdmsrl_safe() of
    MSR_K8_TSEG_ADDR in bsp_init_amd() (not to speak of the unguarded read
    of MSR_K7_HWCR later in the same function). The respective change
    (42b3a4cb5609 "x86/xen: Support early interrupts in xen pv guests") was
    backported to 4.14, but no further - presumably since it wasn't really
    easy because of other dependencies.
    
    Therefore, to prevent our change in the handling of guest MSR accesses
    to render PV Linux 4.13 and older unusable on at least AMD systems, make
    the raising of #GP on this paths conditional upon the guest having
    installed a handler, provided of course the MSR can be read in the first
    place (we would have raised #GP in that case even before). Producing
    zero for reads isn't necessarily correct and may trip code trying to
    detect presence of MSRs early, but since such detection logic won't work
    without a #GP handler anyway, this ought to be a fair workaround.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/arch/x86/pv/emul-priv-op.c    | 20 ++++++++++++++++----
 xen/include/public/arch-x86/xen.h |  6 ++++++
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index 74e71403ff..8889509d2a 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -874,7 +874,7 @@ static int read_msr(unsigned int reg, uint64_t *val,
     struct vcpu *curr = current;
     const struct domain *currd = curr->domain;
     const struct cpuid_policy *cp = currd->arch.cpuid;
-    bool vpmu_msr = false;
+    bool vpmu_msr = false, warn = false;
     uint64_t tmp;
     int ret;
 
@@ -883,7 +883,7 @@ static int read_msr(unsigned int reg, uint64_t *val,
         if ( ret == X86EMUL_EXCEPTION )
             x86_emul_hw_exception(TRAP_gp_fault, 0, ctxt);
 
-        return ret;
+        goto done;
     }
 
     switch ( reg )
@@ -993,7 +993,7 @@ static int read_msr(unsigned int reg, uint64_t *val,
             return X86EMUL_OKAY;
         }
 
-        gdprintk(XENLOG_WARNING, "RDMSR 0x%08x unimplemented\n", reg);
+        warn = true;
         break;
 
     normal:
@@ -1002,7 +1002,19 @@ static int read_msr(unsigned int reg, uint64_t *val,
         return X86EMUL_OKAY;
     }
 
-    return X86EMUL_UNHANDLEABLE;
+ done:
+    if ( ret != X86EMUL_OKAY && !curr->arch.pv.trap_ctxt[X86_EXC_GP].address &&
+         (reg >> 16) != 0x4000 && !rdmsr_safe(reg, tmp) )
+    {
+        gprintk(XENLOG_WARNING, "faking RDMSR 0x%08x\n", reg);
+        *val = 0;
+        x86_emul_reset_event(ctxt);
+        ret = X86EMUL_OKAY;
+    }
+    else if ( warn )
+        gdprintk(XENLOG_WARNING, "RDMSR 0x%08x unimplemented\n", reg);
+
+    return ret;
 }
 
 static int write_msr(unsigned int reg, uint64_t val,
diff --git a/xen/include/public/arch-x86/xen.h b/xen/include/public/arch-x86/xen.h
index 6bf1e8cccb..7acd94c8eb 100644
--- a/xen/include/public/arch-x86/xen.h
+++ b/xen/include/public/arch-x86/xen.h
@@ -143,6 +143,12 @@ typedef unsigned long xen_ulong_t;
  *  Level == 1: Kernel may enter
  *  Level == 2: Kernel may enter
  *  Level == 3: Everyone may enter
+ *
+ * Note: For compatibility with kernels not setting up exception handlers
+ *       early enough, Xen will avoid trying to inject #GP (and hence crash
+ *       the domain) when an RDMSR would require this, but no handler was
+ *       set yet. The precise conditions are implementation specific, and
+ *       new code may not rely on such behavior anyway.
  */
 #define TI_GET_DPL(_ti)      ((_ti)->flags & 3)
 #define TI_GET_IF(_ti)       ((_ti)->flags & 4)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Mar 12 17:11:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Mar 2021 17:11:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.97267.184731 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKlJl-0003hP-5G; Fri, 12 Mar 2021 17:11:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 97267.184731; Fri, 12 Mar 2021 17: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 1lKlJl-0003hH-2O; Fri, 12 Mar 2021 17:11:17 +0000
Received: by outflank-mailman (input) for mailman id 97267;
 Fri, 12 Mar 2021 17: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 1lKlJj-0003h9-8K
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 17: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 1lKlJj-0004bH-7S
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 17:11:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKlJj-0007wr-6a
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 17: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=gi0OJWIuFjfibpG97alSgWDtBEWnuPipv/LaFVTiypQ=; b=MlHZnOKb3HGRoADRGcMPSWNeST
	QtOzZoy5WueK6ZzCkHE6ERZBH5Zelfi2ECuQdOwsDq7L9KJ6rYDoJcPiogS0NIWrgliAZw8wuuL/8
	js6fuhUlq73Etqrf3oIjSbUY5jXWa5ap4CzJWLnxkRQ4SjNSdgB9HAzUYz3sPKKPEkA4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/AMD: expose HWCR.TscFreqSel to guests
Message-Id: <E1lKlJj-0007wr-6a@xenbits.xenproject.org>
Date: Fri, 12 Mar 2021 17:11:15 +0000

commit 14b95b3b8546db201e7efd0636ae0e215fae98f3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 12 12:03:06 2021 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 12 17:00:30 2021 +0000

    x86/AMD: expose HWCR.TscFreqSel to guests
    
    Linux has been warning ("firmware bug") about this bit being clear for a
    long time. While writable in older hardware it has been readonly on more
    than just most recent hardware. For simplicitly report it always set (if
    anything we may want to log the issue ourselves if it turns out to be
    clear on older hardware) on CPU families 10h and up (in family 0fh the
    bit is part of a larger field of different purpose).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/arch/x86/msr.c              | 7 +++++++
 xen/include/asm-x86/msr-index.h | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index 8ed0b4e982..0ebcb04259 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -315,6 +315,13 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
         *val = msrs->tsc_aux;
         break;
 
+    case MSR_K8_HWCR:
+        if ( !(cp->x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
+            goto gp_fault;
+        *val = get_cpu_family(cp->basic.raw_fms, NULL, NULL) >= 0x10
+               ? K8_HWCR_TSC_FREQ_SEL : 0;
+        break;
+
     case MSR_AMD64_DE_CFG:
         if ( !(cp->x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
             goto gp_fault;
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 1f5a5d0e38..f2e34dd22b 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -287,6 +287,8 @@
 
 #define MSR_K7_HWCR			0xc0010015
 #define MSR_K8_HWCR			0xc0010015
+#define K8_HWCR_TSC_FREQ_SEL		(1ULL << 24)
+
 #define MSR_K7_FID_VID_CTL		0xc0010041
 #define MSR_K7_FID_VID_STATUS		0xc0010042
 #define MSR_K8_PSTATE_LIMIT		0xc0010061
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Mar 12 20:22:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Mar 2021 20:22:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.97319.184858 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKoIM-0005lb-Ho; Fri, 12 Mar 2021 20:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 97319.184858; Fri, 12 Mar 2021 20: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 1lKoIM-0005lT-Em; Fri, 12 Mar 2021 20:22:02 +0000
Received: by outflank-mailman (input) for mailman id 97319;
 Fri, 12 Mar 2021 20: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 1lKoIM-0005lO-3q
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20: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 1lKoIM-0007rI-34
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKoIM-0004rd-0R
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20: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=g6LeL+ErDVvl72OLXcpfkjt4c8qjkZEvyrYNvLihdAI=; b=oOmCufsl0SmO2/2N0YrpqDOHqe
	o3gLgbP2ot+fR3FlwMuQgjmy0k59auhQnuYuGiG3WqhmcpQUaraTXvF6y99AVHHRyQQ80WkBxjtIj
	bIzGZ1mtSZfiqtHA4ZhzGC6beuRGP6x12bZbTYT81m5ZpPI6DfyUCMBD2ksBocZGGJ5Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstore: Consolidate PRINTF_ATTRIBUTE() in utils.h
Message-Id: <E1lKoIM-0004rd-0R@xenbits.xenproject.org>
Date: Fri, 12 Mar 2021 20:22:02 +0000

commit 209b309e33ebbf8674a9d84fd73cce7f1e70e7eb
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Mar 5 12:40:02 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Mar 11 09:44:51 2021 +0000

    tools/xenstore: Consolidate PRINTF_ATTRIBUTE() in utils.h
    
    At the moment PRINTF_ATTRIBUTE() is defined in two places:
        - tdb.h: Defined as a NOP
        - talloc.h: Defined as a NOP for GCC older than 3.0 otherwise will
        add the attribute to check the printf format
    
    Xen requires to build with minimum GCC 4.1 and we want to check the
    printf format for all the printf-like functions.
    
    Only implement PRINTF_ATTRIBUTE() once in utils.h and drop the
    conditional check for GCC < 3.0.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/xenstore/talloc.h | 15 ++-------------
 tools/xenstore/tdb.h    |  6 ++----
 tools/xenstore/utils.h  |  2 ++
 3 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/tools/xenstore/talloc.h b/tools/xenstore/talloc.h
index 71a36e7be0..a0f4bff257 100644
--- a/tools/xenstore/talloc.h
+++ b/tools/xenstore/talloc.h
@@ -26,6 +26,8 @@
 
 #include <sys/types.h>
 
+#include "utils.h"
+
 /* this is only needed for compatibility with the old talloc */
 typedef void TALLOC_CTX;
 
@@ -84,19 +86,6 @@ typedef void TALLOC_CTX;
 #define talloc_destroy(ctx) talloc_free(ctx)
 #endif
 
-#ifndef PRINTF_ATTRIBUTE
-#if (__GNUC__ >= 3)
-/** Use gcc attribute to check printf fns.  a1 is the 1-based index of
- * the parameter containing the format, and a2 the index of the first
- * argument. Note that some gcc 2.x versions don't handle this
- * properly **/
-#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
-#else
-#define PRINTF_ATTRIBUTE(a1, a2)
-#endif
-#endif
-
-
 /* The following definitions come from talloc.c  */
 void *_talloc(const void *context, size_t size);
 void talloc_set_destructor(const void *ptr, int (*destructor)(void *));
diff --git a/tools/xenstore/tdb.h b/tools/xenstore/tdb.h
index 557cf727b8..ce3c7339f8 100644
--- a/tools/xenstore/tdb.h
+++ b/tools/xenstore/tdb.h
@@ -1,6 +1,8 @@
 #ifndef __TDB_H__
 #define __TDB_H__
 
+#include "utils.h"
+
 /* 
    Unix SMB/CIFS implementation.
 
@@ -84,10 +86,6 @@ struct tdb_traverse_lock {
 	uint32_t hash;
 };
 
-#ifndef PRINTF_ATTRIBUTE
-#define PRINTF_ATTRIBUTE(a,b)
-#endif
-
 /* this is the context structure that is returned from a db open */
 typedef struct tdb_context {
 	char *name; /* the name of the database */
diff --git a/tools/xenstore/utils.h b/tools/xenstore/utils.h
index df1cb9a3ba..3dfb96b556 100644
--- a/tools/xenstore/utils.h
+++ b/tools/xenstore/utils.h
@@ -27,6 +27,8 @@ static inline bool strends(const char *a, const char *b)
  */
 const char *dump_state_align(FILE *fp);
 
+#define PRINTF_ATTRIBUTE(a1, a2) __attribute__((format (printf, a1, a2)))
+
 void barf(const char *fmt, ...) __attribute__((noreturn));
 void barf_perror(const char *fmt, ...) __attribute__((noreturn));
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Mar 12 20:22:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Mar 2021 20:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.97320.184862 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKoIX-0005mT-K6; Fri, 12 Mar 2021 20:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 97320.184862; Fri, 12 Mar 2021 20:22: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 1lKoIX-0005mL-GY; Fri, 12 Mar 2021 20:22:13 +0000
Received: by outflank-mailman (input) for mailman id 97320;
 Fri, 12 Mar 2021 20: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 1lKoIW-0005mD-AX
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20: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 1lKoIW-0007rO-7b
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKoIW-0004sb-5I
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uuMjg07XPadiNRUPNd4lfqoT556uJqEu6DPS4d3TVpQ=; b=Tplsx3J55HmoqjrUJvrwpyci0a
	OrGHoed0miUkIfLfujQYjJRv37TPKxv5RiL1IZIKIEL1yVy6PsvYrSm5L/JclYBCcqgD0QFRo9dzO
	YWzMAZjTQH1lPwFs6xvnzwCRHKNqf52AfGkjcwPaVIezlwTbfXlhj017dYqTbi0XZLLE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstore: Check the format printf for xprintf() and barf{,_perror}()
Message-Id: <E1lKoIW-0004sb-5I@xenbits.xenproject.org>
Date: Fri, 12 Mar 2021 20:22:12 +0000

commit 1fff444679a1ffa67d0bf55744b80555ab58f9f8
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Mar 5 12:40:03 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Mar 11 09:47:02 2021 +0000

    tools/xenstore: Check the format printf for xprintf() and barf{,_perror}()
    
    Allow GCC to analyze the format printf for xprintf() and
    barf{,_perror}().
    
    Take the opportunity to define __noreturn to make the prototype for
    barf{,_perror})() easier to read.
    
    Also document why 'extern' is used for xprintf().
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/xenstore/utils.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/xenstore/utils.h b/tools/xenstore/utils.h
index 3dfb96b556..87713a8e5d 100644
--- a/tools/xenstore/utils.h
+++ b/tools/xenstore/utils.h
@@ -29,10 +29,13 @@ const char *dump_state_align(FILE *fp);
 
 #define PRINTF_ATTRIBUTE(a1, a2) __attribute__((format (printf, a1, a2)))
 
-void barf(const char *fmt, ...) __attribute__((noreturn));
-void barf_perror(const char *fmt, ...) __attribute__((noreturn));
+#define __noreturn __attribute__((noreturn))
 
-extern void (*xprintf)(const char *fmt, ...);
+void barf(const char *fmt, ...) __noreturn PRINTF_ATTRIBUTE(1, 2);
+void barf_perror(const char *fmt, ...) __noreturn PRINTF_ATTRIBUTE(1, 2);
+
+/* Function pointer as xprintf() can be configured at runtime. */
+extern void (*xprintf)(const char *fmt, ...) PRINTF_ATTRIBUTE(1, 2);
 
 #define eprintf(_fmt, _args...) xprintf("[ERR] %s" _fmt, __FUNCTION__, ##_args)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Mar 12 20:22:23 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Mar 2021 20:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.97321.184866 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKoIh-0005ny-NV; Fri, 12 Mar 2021 20:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 97321.184866; Fri, 12 Mar 2021 20:22: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 1lKoIh-0005no-KA; Fri, 12 Mar 2021 20:22:23 +0000
Received: by outflank-mailman (input) for mailman id 97321;
 Fri, 12 Mar 2021 20: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 1lKoIg-0005nc-Du
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20: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 1lKoIg-0007rW-BZ
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKoIg-0004tK-A2
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20: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=StLjdYSJY1GArPZMHcbfL7SLpi85okbawB7AcHoEpz0=; b=GuFrf0CEd7QW0xV7lBP12GO8vs
	4sO2SdpmQnQ8pTHNkUapSlHV3R3+rDo7ivZf/1zxL2flFXq0te/79627qc9bM75GiabSX7NfEei48
	GYi+dSki8fJgMEhjMS7ZMJyHCTrBO9TbO7/Lwoa53Y31JD+SWmMmlopOR/Cxl/DuwNac=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/public: replace typeof() with __typeof__()
Message-Id: <E1lKoIg-0004tK-A2@xenbits.xenproject.org>
Date: Fri, 12 Mar 2021 20:22:22 +0000

commit 935e0836710ce8cab584155b2844cea8497a5159
Author:     Elliott Mitchell <ehem+xen@m5p.com>
AuthorDate: Mon Mar 8 05:36:18 2021 -0800
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Mar 11 09:51:07 2021 +0000

    xen/public: replace typeof() with __typeof__()
    
    typeof() is available in Xen's build environment, which uses Xen's
    compiler.  As these headers are public, they need strict standards
    conformance.  Only __typeof__() is officially standardized.
    
    A compiler in standards conformance mode should report:
    
    warning: implicit declaration of function 'typeof' is invalid in C99
    [-Wimplicit-function-declaration]
    
    (this has been observed with FreeBSD's kernel build environment)
    
    Based-on-patch-by: Julien Grall <julien@xen.org>, Sun Oct 4 20:33:04 2015 +0100
    Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/include/public/arch-arm.h | 2 +-
 xen/include/public/hvm/save.h | 4 ++--
 xen/include/public/io/ring.h  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index c365b1b39e..713fd65317 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -191,7 +191,7 @@
 #define XEN_GUEST_HANDLE_PARAM(name)    __guest_handle_ ## name
 #define set_xen_guest_handle_raw(hnd, val)                  \
     do {                                                    \
-        typeof(&(hnd)) _sxghr_tmp = &(hnd);                 \
+        __typeof__(&(hnd)) _sxghr_tmp = &(hnd);             \
         _sxghr_tmp->q = 0;                                  \
         _sxghr_tmp->p = val;                                \
     } while ( 0 )
diff --git a/xen/include/public/hvm/save.h b/xen/include/public/hvm/save.h
index f72e3a9bc4..bea5e9f50f 100644
--- a/xen/include/public/hvm/save.h
+++ b/xen/include/public/hvm/save.h
@@ -82,12 +82,12 @@ struct hvm_save_descriptor {
     struct __HVM_SAVE_TYPE_##_x { _type t; char c[_code]; char cpt[1];}
 #endif
 
-#define HVM_SAVE_TYPE(_x) typeof (((struct __HVM_SAVE_TYPE_##_x *)(0))->t)
+#define HVM_SAVE_TYPE(_x) __typeof__ (((struct __HVM_SAVE_TYPE_##_x *)(0))->t)
 #define HVM_SAVE_LENGTH(_x) (sizeof (HVM_SAVE_TYPE(_x)))
 #define HVM_SAVE_CODE(_x) (sizeof (((struct __HVM_SAVE_TYPE_##_x *)(0))->c))
 
 #ifdef __XEN__
-# define HVM_SAVE_TYPE_COMPAT(_x) typeof (((struct __HVM_SAVE_TYPE_COMPAT_##_x *)(0))->t)
+# define HVM_SAVE_TYPE_COMPAT(_x) __typeof__ (((struct __HVM_SAVE_TYPE_COMPAT_##_x *)(0))->t)
 # define HVM_SAVE_LENGTH_COMPAT(_x) (sizeof (HVM_SAVE_TYPE_COMPAT(_x)))
 
 # define HVM_SAVE_HAS_COMPAT(_x) (sizeof (((struct __HVM_SAVE_TYPE_##_x *)(0))->cpt)-1)
diff --git a/xen/include/public/io/ring.h b/xen/include/public/io/ring.h
index d68615ae2f..6a94a9fe4b 100644
--- a/xen/include/public/io/ring.h
+++ b/xen/include/public/io/ring.h
@@ -242,7 +242,7 @@ typedef struct __name##_back_ring __name##_back_ring_t
  */
 #define RING_COPY_REQUEST(_r, _idx, _req) do {				\
 	/* Use volatile to force the copy into _req. */			\
-	*(_req) = *(volatile typeof(_req))RING_GET_REQUEST(_r, _idx);	\
+	*(_req) = *(volatile __typeof__(_req))RING_GET_REQUEST(_r, _idx);	\
 } while (0)
 
 #define RING_GET_RESPONSE(_r, _idx)                                     \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Mar 12 20:22:33 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Mar 2021 20:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.97323.184870 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKoIr-0005pM-Oh; Fri, 12 Mar 2021 20:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 97323.184870; Fri, 12 Mar 2021 20:22: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 1lKoIr-0005pE-Lh; Fri, 12 Mar 2021 20:22:33 +0000
Received: by outflank-mailman (input) for mailman id 97323;
 Fri, 12 Mar 2021 20: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 1lKoIq-0005p6-FJ
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20: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 1lKoIq-0007rg-EV
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKoIq-0004u0-Da
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20: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=LhCXoN1UdPRMOHHOl70Zsyffz6SDeGfUbbUXDDp+gRg=; b=Qbpt9SxLn2pzmBb1gp9XxkOCWJ
	0jKg3fK7YYgcVNx8qoBRsMwGAlVO6zOKam+tU/G+AnuwD7DbSMn1Tl4yZnjKUzRDw7aPwyWtPWwCR
	UqsN0nVvbBelZ+WnKkDXlQARkQd69c04lawMOOwbzq/xK+qOyoCeURx6yL7hn3uy2Kyc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: allow doing hypervisor only builds
Message-Id: <E1lKoIq-0004u0-Da@xenbits.xenproject.org>
Date: Fri, 12 Mar 2021 20:22:32 +0000

commit 893103e286ac1c500d2ad113f55c41edb35e047c
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Mar 3 15:33:16 2021 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Mar 11 15:39:37 2021 +0000

    automation: allow doing hypervisor only builds
    
    For things like randconfig there's no need to do a full Xen build, a
    hypervisor build only will be much faster and will achieve the same
    level of testing, as randconfig only changes the hypervisor build
    options.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    Acked-by: Doug Goldstein <cardoe@cardoe.com>
---
 automation/scripts/build | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/automation/scripts/build b/automation/scripts/build
index 87e44bb940..1b752edfe6 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -11,6 +11,7 @@ cc-ver()
 # random config or default config
 if [[ "${RANDCONFIG}" == "y" ]]; then
     make -j$(nproc) -C xen KCONFIG_ALLCONFIG=tools/kconfig/allrandom.config randconfig
+    hypervisor_only="y"
 else
     make -j$(nproc) -C xen defconfig
 fi
@@ -45,16 +46,27 @@ if [[ "${CC}" == "gcc" && `cc-ver` -lt 0x040600 ]]; then
     cfgargs+=("--with-system-seabios=/bin/false")
 fi
 
-./configure "${cfgargs[@]}"
-
-make -j$(nproc) dist
+if [[ "${hypervisor_only}" == "y" ]]; then
+    make -j$(nproc) xen
+else
+    ./configure "${cfgargs[@]}"
+    make -j$(nproc) dist
+fi
 
 # Extract artifacts to avoid getting rewritten by customised builds
 cp xen/.config xen-config
 mkdir binaries
 if [[ "${XEN_TARGET_ARCH}" != "x86_32" ]]; then
     cp xen/xen binaries/xen
-    cp -r dist binaries/
+    if [[ "${hypervisor_only}" != "y" ]]; then
+        cp -r dist binaries/
+    fi
+fi
+
+if [[ "${hypervisor_only}" == "y" ]]; then
+    # If we are build testing a specific Kconfig exit now, there's no point in
+    # testing all the possible configs.
+    exit 0
 fi
 
 # Build all the configs we care about
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Mar 12 20:22:43 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Mar 2021 20:22:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.97324.184874 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKoJ1-0005qa-QH; Fri, 12 Mar 2021 20:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 97324.184874; Fri, 12 Mar 2021 20:22: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 1lKoJ1-0005qT-NC; Fri, 12 Mar 2021 20:22:43 +0000
Received: by outflank-mailman (input) for mailman id 97324;
 Fri, 12 Mar 2021 20:22: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 1lKoJ0-0005qL-IB
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20:22: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 1lKoJ0-0007rt-HV
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKoJ0-0004wX-Gc
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20:22: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=DPTxaaBsfb4YmwV1XgI4AGC8pcDOcWerh9epYaRPHUQ=; b=VxVS+MHKaAhfWRf+lCuu5g6Y4T
	yCaLZSgnieXC/kv4M4xkroZedyoWroYlQQVn5DBq5Oxhm2RnTAAoYuG2Y8JdpbAV88T9RXXg+nf3U
	T9lWS7jK/Fsih1IRbZC69LAGbbBUZD5n5WnOgD49jqm1pOQHLn7/pii8Il7PFzxHFjwU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxentoolcore: Fill in LIBHEADERS
Message-Id: <E1lKoJ0-0004wX-Gc@xenbits.xenproject.org>
Date: Fri, 12 Mar 2021 20:22:42 +0000

commit 67390ec1f73f48253d53a59581bf6574234708a1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Mar 1 17:30:00 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Mar 11 17:27:48 2021 +0000

    tools/libxentoolcore: Fill in LIBHEADERS
    
    c/s 4664034cd replaced a glob over include/*.h with an expectation that
    LIBHEADER was suitably set for libraries which didn't have a single,
    consistently named, header file.
    
    This wasn't true for xentoolcore, which lost xentoolcore_internal.h as a
    consequence, and failed an API/ABI check vs 4.14
    
    Fixes: 4664034cd ("tools/libs: move official headers to common directory")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libs/toolcore/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/libs/toolcore/Makefile b/tools/libs/toolcore/Makefile
index 1cf30733c9..3550786491 100644
--- a/tools/libs/toolcore/Makefile
+++ b/tools/libs/toolcore/Makefile
@@ -5,6 +5,8 @@ MAJOR	= 1
 MINOR	= 0
 AUTOINCS := $(XEN_INCLUDE)/_xentoolcore_list.h
 
+LIBHEADER := xentoolcore.h xentoolcore_internal.h
+
 SRCS-y	+= handlereg.c
 
 include $(XEN_ROOT)/tools/libs/libs.mk
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Mar 12 20:22:53 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Mar 2021 20:22:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.97325.184878 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKoJB-0005s3-Rs; Fri, 12 Mar 2021 20:22:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 97325.184878; Fri, 12 Mar 2021 20:22: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 1lKoJB-0005rv-Oy; Fri, 12 Mar 2021 20:22:53 +0000
Received: by outflank-mailman (input) for mailman id 97325;
 Fri, 12 Mar 2021 20:22: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 1lKoJA-0005ro-LS
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20:22: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 1lKoJA-0007s5-Kk
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKoJA-0004xJ-Jr
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20:22: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=Vbyf19pBKFH6vHb0aIJYH0tRXBH098H1rS1Wlg+jTeM=; b=I7ji7eYUYJryLdyeRp+3ORht2H
	dWbBwLUsZGsBkg1mtLExBFAGbCzU7+f00WL+t7HNIushvrt+6qSxDKxFHdglOKOT1ai4apXagriX7
	89AnJTFtzXGtl8kvxq+SMpQky2GzmkOC5Jk+tQL+Et+jjbSsJ0IPKKhK9hu7fzJaJXMU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/dmop: Strip __XEN_TOOLS__ header guard from public ABI
Message-Id: <E1lKoJA-0004xJ-Jr@xenbits.xenproject.org>
Date: Fri, 12 Mar 2021 20:22:52 +0000

commit 368096b9c4a273be58dd897e996e3e010bcfc21b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Mar 4 22:30:00 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Mar 11 17:27:48 2021 +0000

    xen/dmop: Strip __XEN_TOOLS__ header guard from public ABI
    
    __XEN_TOOLS__ is really there to separate the unstable from stable hypercalls.
    Exactly as with c/s f40e1c52e4, stable interfaces shouldn't contain this
    guard.
    
    That change actually broke the build with:
    
      include/xendevicemodel.h:52:5: error: unknown type name 'ioservid_t'
           ioservid_t *id);
           ^
    
    as libxendevicemodel.h now uses a type it can't see a typedef for.  However,
    nothing noticed because the header.chk logic is also broken (fixed
    subsequently).
    
    Strip the guard from the public header, and remove compensation from
    devicemodel's private.h.  Fix the dmop design doc to discuss both reasons
    behind the the ABI design.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 docs/designs/dmop.pandoc         | 12 +++++++++---
 tools/libs/devicemodel/private.h |  2 --
 xen/include/public/hvm/dm_op.h   |  5 -----
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/docs/designs/dmop.pandoc b/docs/designs/dmop.pandoc
index 8e9f95af47..49e52b1bcc 100644
--- a/docs/designs/dmop.pandoc
+++ b/docs/designs/dmop.pandoc
@@ -4,9 +4,15 @@ DMOP
 Introduction
 ------------
 
-The aim of DMOP is to prevent a compromised device model from compromising
-domains other than the one it is providing emulation for (which is therefore
-likely already compromised).
+The DMOP hypercall has a new ABI design to solve problems in the Xen
+ecosystem.  First, the ABI is fully stable, to reduce the coupling between
+device models and the version of Xen.  Specifically, device model software
+using DMOP (be it user, stub domain or kernel software) need not be recompiled
+to match the version of the running hypervisor.
+
+Secondly, for device models in userspace, the ABI is designed specifically to
+allow a kernel to audit the memory ranges used, without having to know the
+internal structure of sub-ops.
 
 The problem occurs when you a device model issues an hypercall that
 includes references to user memory other than the operation structure
diff --git a/tools/libs/devicemodel/private.h b/tools/libs/devicemodel/private.h
index c4a225f8af..c24f3396bb 100644
--- a/tools/libs/devicemodel/private.h
+++ b/tools/libs/devicemodel/private.h
@@ -1,8 +1,6 @@
 #ifndef XENDEVICEMODEL_PRIVATE_H
 #define XENDEVICEMODEL_PRIVATE_H
 
-#define __XEN_TOOLS__ 1
-
 #include <xentoollog.h>
 #include <xendevicemodel.h>
 #include <xencall.h>
diff --git a/xen/include/public/hvm/dm_op.h b/xen/include/public/hvm/dm_op.h
index ef7fbc0d3d..fa3f083fed 100644
--- a/xen/include/public/hvm/dm_op.h
+++ b/xen/include/public/hvm/dm_op.h
@@ -25,9 +25,6 @@
 #define __XEN_PUBLIC_HVM_DM_OP_H__
 
 #include "../xen.h"
-
-#if defined(__XEN__) || defined(__XEN_TOOLS__)
-
 #include "../event_channel.h"
 
 #ifndef uint64_aligned_t
@@ -491,8 +488,6 @@ struct xen_dm_op {
     } u;
 };
 
-#endif /* __XEN__ || __XEN_TOOLS__ */
-
 struct xen_dm_op_buf {
     XEN_GUEST_HANDLE(void) h;
     xen_ulong_t size;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Mar 12 20:23:03 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Mar 2021 20:23:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.97326.184882 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKoJL-0005tC-TY; Fri, 12 Mar 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 97326.184882; Fri, 12 Mar 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 1lKoJL-0005t4-QZ; Fri, 12 Mar 2021 20:23:03 +0000
Received: by outflank-mailman (input) for mailman id 97326;
 Fri, 12 Mar 2021 20:23: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 1lKoJK-0005sx-P4
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20:23: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 1lKoJK-0007so-OE
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20:23:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKoJK-0004yJ-N3
 for xen-changelog@lists.xenproject.org; Fri, 12 Mar 2021 20:23: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=aQGp62aX/GNmSyDGa59AX+UKeq028mTVheF92uSzIO4=; b=t0d/o2sPoZ4N6IahOOrqK8EzaK
	jYZQDg5b5M/pd1phe9PKXB5wbGkFuAOJzW/MWcrIvEYFFOcycwU/KQs0lNXWSVMhtdvxn/QEDO+Wd
	8n1y7OSbToByvKlT692ZN2Oi6oKp4pct75EM4MHV4wmvhLoDhXdiEXDKXP/lGWXq+XTU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libs: Fix headers.chk logic
Message-Id: <E1lKoJK-0004yJ-N3@xenbits.xenproject.org>
Date: Fri, 12 Mar 2021 20:23:02 +0000

commit 9e23f10eb0db5ffa06f1a43f74fac790992a85c7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Mar 4 22:30:00 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Mar 11 17:27:48 2021 +0000

    tools/libs: Fix headers.chk logic
    
    c/s 4664034cd dropped the $(LIBHEADERSGLOB) dependency for the headers.chk
    rule, without replacing it.
    
    As headers.chk uses $^, a typical build looks like:
    
      andrewcoop@andrewcoop:/local/xen.git$ make -C tools/libs/devicemodel/
      make: Entering directory '/local/xen.git/tools/libs/devicemodel'
      for i in ; do \
          gcc -x c -ansi -Wall -Werror -I/local/xen.git/tools/libs/devicemodel/../../../tools/include \
                -S -o /dev/null $i || exit 1; \
          echo $i; \
      done >headers.chk.new
      mv headers.chk.new headers.chk
    
    i.e. with an empty for loop.
    
    Reinsert a $(LIBHEADERS) dependency, so more than just the $(AUTOINCS) get
    checked.
    
    Fixes: 4664034cd ("tools/libs: move official headers to common directory")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libs/libs.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index a68cec244c..2d973ccb95 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -76,7 +76,7 @@ else
 .PHONY: headers.chk
 endif
 
-headers.chk: $(AUTOINCS)
+headers.chk: $(LIBHEADERS) $(AUTOINCS)
 
 headers.lst: FORCE
 	@{ set -e; $(foreach h,$(LIBHEADERS),echo $(h);) } > $@.tmp
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Mar 13 07:33:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Mar 2021 07:33:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.97459.185163 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKylk-000681-G4; Sat, 13 Mar 2021 07:33:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 97459.185163; Sat, 13 Mar 2021 07:33: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 1lKylk-00067u-Cz; Sat, 13 Mar 2021 07:33:04 +0000
Received: by outflank-mailman (input) for mailman id 97459;
 Sat, 13 Mar 2021 07: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 1lKyli-00067o-Ln
 for xen-changelog@lists.xenproject.org; Sat, 13 Mar 2021 07: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 1lKyli-0005HE-Ho
 for xen-changelog@lists.xenproject.org; Sat, 13 Mar 2021 07:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKyli-0003FD-GL
 for xen-changelog@lists.xenproject.org; Sat, 13 Mar 2021 07: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=KH6OsrudwS/tpBPzlor2xa9FNxLecT0eZwQ5ENGe4/w=; b=zoTIPGxEDIlu47ZViLx74h1nE5
	D9tMi+Byr50ie6Vg9lg0JEd0Zj/oxDpOeons0M+kTLXczF4IuIzTyKpUnKbGrStQFij88lKsT4OTK
	yUuzchLRFplLzcKv0Q0dRPf75KLut4Mdgl78IEm6dKf8fQy2ik8Q8S5L8Dna+kLMsoL4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/msr: introduce an option for compatible MSR behavior selection
Message-Id: <E1lKyli-0003FD-GL@xenbits.xenproject.org>
Date: Sat, 13 Mar 2021 07:33:02 +0000

commit 0570d7f276dd20a3adee80ca44a5fe7daf7566cd
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Mar 12 08:59:56 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 12 08:59:56 2021 +0100

    x86/msr: introduce an option for compatible MSR behavior selection
    
    Introduce an option to allow selecting a behavior similar to the pre
    Xen 4.15 one for accesses to MSRs not explicitly handled. Since commit
    84e848fd7a162f669 and 322ec7c89f6640e accesses to MSRs not explicitly
    handled by Xen result in the injection of a #GP to the guest. This
    is a behavior change since previously a #GP was only injected if
    accessing the MSR on the real hardware would also trigger a #GP, or if
    the attempted to be set bits wouldn't match the hardware values (for
    PV). The reasons for not leaking hardware MSR values and injecting a
    #GP are fully valid, so the solution proposed here should be
    considered a temporary workaround until all the required MSRs are
    properly handled.
    
    This seems to be problematic for some guests, so introduce an option
    to fallback to this kind of legacy behavior without leaking the
    underlying MSR values to the guest.
    
    When the option is set, for both PV and HVM don't inject a #GP to the
    guest on MSR read if reading the underlying MSR doesn't result in a
    #GP, do the same for writes and simply discard the value to be written
    on that case.
    
    Note that for guests restored or migrated from previous Xen versions
    the option is enabled by default, in order to keep a compatible
    MSR behavior. Such compatibility is done at the libxl layer, to avoid
    higher-level toolstacks from having to know the details about this flag.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 docs/man/xl.cfg.5.pod.in            | 14 ++++++++++++++
 docs/misc/xen-command-line.pandoc   | 14 +++++++++++++-
 tools/include/libxl.h               |  7 +++++++
 tools/libs/light/libxl_arch.h       |  5 +++++
 tools/libs/light/libxl_arm.c        |  6 ++++++
 tools/libs/light/libxl_create.c     |  7 +++++++
 tools/libs/light/libxl_internal.c   |  3 +++
 tools/libs/light/libxl_types.idl    |  2 ++
 tools/libs/light/libxl_x86.c        | 20 ++++++++++++++++++++
 tools/ocaml/libs/xc/xenctrl.ml      |  4 ++++
 tools/ocaml/libs/xc/xenctrl.mli     |  4 ++++
 tools/ocaml/libs/xc/xenctrl_stubs.c |  9 +++++++++
 tools/xl/xl_parse.c                 |  7 +++++++
 xen/arch/x86/dom0_build.c           |  3 +++
 xen/arch/x86/domain.c               |  9 +++++++++
 xen/arch/x86/hvm/svm/svm.c          | 10 ++++++++++
 xen/arch/x86/hvm/vmx/vmx.c          | 10 ++++++++++
 xen/arch/x86/pv/emul-priv-op.c      | 10 ++++++++++
 xen/arch/x86/setup.c                |  3 +++
 xen/include/asm-x86/domain.h        |  3 +++
 xen/include/asm-x86/setup.h         |  1 +
 xen/include/public/arch-x86/xen.h   |  8 ++++++++
 22 files changed, 158 insertions(+), 1 deletion(-)

diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
index 040374dcd6..56370a37db 100644
--- a/docs/man/xl.cfg.5.pod.in
+++ b/docs/man/xl.cfg.5.pod.in
@@ -2861,6 +2861,20 @@ No MCA capabilities in above list are enabled.
 
 =back
 
+=item B<msr_relaxed=BOOLEAN>
+
+The "msr_relaxed" boolean is an interim option, and defaults to false.
+
+In Xen 4.15, the default behaviour for unhandled MSRs has been changed,
+to avoid leaking host data into guests, and to avoid breaking guest
+logic which uses #GP probing to identify the availability of MSRs.
+
+However, this new stricter behaviour has the possibility to break
+guests, and a more 4.14-like behaviour can be selected by setting this
+option.
+
+If using this option is necessary to fix an issue, please report a bug.
+
 =back
 
 =head1 SEE ALSO
diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 4737c92bfe..a0601ff838 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -740,7 +740,7 @@ Specify the bit width of the DMA heap.
 
 ### dom0
     = List of [ pv | pvh, shadow=<bool>, verbose=<bool>,
-                cpuid-faulting=<bool> ]
+                cpuid-faulting=<bool>, msr-relaxed=<bool> ]
 
     Applicability: x86
 
@@ -789,6 +789,18 @@ Controls for how dom0 is constructed on x86 systems.
     restore the pre-4.13 behaviour.  If specifying `no-cpuid-faulting` fixes
     an issue in dom0, please report a bug.
 
+*   The `msr-relaxed` boolean is an interim option, and defaults to false.
+
+    In Xen 4.15, the default behaviour for unhandled MSRs has been changed,
+    to avoid leaking host data into guests, and to avoid breaking guest
+    logic which uses \#GP probing to identify the availability of MSRs.
+
+    However, this new stricter behaviour has the possibility to break
+    guests, and a more 4.14-like behaviour can be selected by specifying
+    `dom0=msr-relaxed`.
+
+    If using this option is necessary to fix an issue, please report a bug.
+
 ### dom0-iommu
     = List of [ passthrough=<bool>, strict=<bool>, map-inclusive=<bool>,
                 map-reserved=<bool>, none ]
diff --git a/tools/include/libxl.h b/tools/include/libxl.h
index a7b673e89d..ae7fe27c1f 100644
--- a/tools/include/libxl.h
+++ b/tools/include/libxl.h
@@ -495,6 +495,13 @@
  */
 #define LIBXL_HAVE_VMTRACE_BUF_KB 1
 
+/*
+ * LIBXL_HAVE_X86_MSR_RELAXED indicates the toolstack has support for switching
+ * the MSR access handling in the hypervisor to relaxed mode. This is done by
+ * setting the libxl_domain_build_info arch_x86.msr_relaxed field.
+ */
+#define LIBXL_HAVE_X86_MSR_RELAXED 1
+
 /*
  * libxl ABI compatibility
  *
diff --git a/tools/libs/light/libxl_arch.h b/tools/libs/light/libxl_arch.h
index c305d704b1..8527fc5c6c 100644
--- a/tools/libs/light/libxl_arch.h
+++ b/tools/libs/light/libxl_arch.h
@@ -85,6 +85,11 @@ int libxl__arch_extra_memory(libxl__gc *gc,
                              const libxl_domain_build_info *info,
                              uint64_t *out);
 
+_hidden
+void libxl__arch_update_domain_config(libxl__gc *gc,
+                                      libxl_domain_config *dst,
+                                      const libxl_domain_config *src);
+
 #if defined(__i386__) || defined(__x86_64__)
 
 #define LAPIC_BASE_ADDRESS  0xfee00000
diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
index 5e2a209a8b..e2901f13b7 100644
--- a/tools/libs/light/libxl_arm.c
+++ b/tools/libs/light/libxl_arm.c
@@ -1222,6 +1222,12 @@ int libxl__arch_passthrough_mode_setdefault(libxl__gc *gc,
     return rc;
 }
 
+void libxl__arch_update_domain_config(libxl__gc *gc,
+                                      libxl_domain_config *dst,
+                                      const libxl_domain_config *src)
+{
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c
index 46f68da697..1131b2a733 100644
--- a/tools/libs/light/libxl_create.c
+++ b/tools/libs/light/libxl_create.c
@@ -2287,6 +2287,13 @@ int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config,
         unset_disk_colo_restore(d_config);
     }
 
+    /*
+     * When restoring (either from a save file or for a migration domain) set
+     * the MSR relaxed mode for compatibility with older Xen versions if the
+     * option is not set as part of the original configuration.
+     */
+    libxl_defbool_setdefault(&d_config->b_info.arch_x86.msr_relaxed, true);
+
     return do_domain_create(ctx, d_config, domid, restore_fd, send_back_fd,
                             params, ao_how, aop_console_how);
 }
diff --git a/tools/libs/light/libxl_internal.c b/tools/libs/light/libxl_internal.c
index d93a75533f..86556b6113 100644
--- a/tools/libs/light/libxl_internal.c
+++ b/tools/libs/light/libxl_internal.c
@@ -16,6 +16,7 @@
 #include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
+#include "libxl_arch.h"
 
 void libxl__alloc_failed(libxl_ctx *ctx, const char *func,
                          size_t nmemb, size_t size) {
@@ -594,6 +595,8 @@ void libxl__update_domain_configuration(libxl__gc *gc,
 
     /* video ram */
     dst->b_info.video_memkb = src->b_info.video_memkb;
+
+    libxl__arch_update_domain_config(gc, dst, src);
 }
 
 static void ev_slowlock_init_internal(libxl__ev_slowlock *lock,
diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
index 5b85a7419f..f45adddab0 100644
--- a/tools/libs/light/libxl_types.idl
+++ b/tools/libs/light/libxl_types.idl
@@ -644,6 +644,8 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("arch_arm", Struct(None, [("gic_version", libxl_gic_version),
                                ("vuart", libxl_vuart_type),
                               ])),
+    ("arch_x86", Struct(None, [("msr_relaxed", libxl_defbool),
+                              ])),
     # Alternate p2m is not bound to any architecture or guest type, as it is
     # supported by x86 HVM and ARM support is planned.
     ("altp2m", libxl_altp2m_mode),
diff --git a/tools/libs/light/libxl_x86.c b/tools/libs/light/libxl_x86.c
index 58187ed760..ac09897a63 100644
--- a/tools/libs/light/libxl_x86.c
+++ b/tools/libs/light/libxl_x86.c
@@ -19,6 +19,10 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
         abort();
     }
 
+    config->arch.misc_flags = 0;
+    if (libxl_defbool_val(d_config->b_info.arch_x86.msr_relaxed))
+        config->arch.misc_flags |= XEN_X86_MSR_RELAXED;
+
     return 0;
 }
 
@@ -809,6 +813,7 @@ void libxl__arch_domain_build_info_setdefault(libxl__gc *gc,
                                               libxl_domain_build_info *b_info)
 {
     libxl_defbool_setdefault(&b_info->acpi, true);
+    libxl_defbool_setdefault(&b_info->arch_x86.msr_relaxed, false);
 }
 
 int libxl__arch_passthrough_mode_setdefault(libxl__gc *gc,
@@ -851,6 +856,21 @@ int libxl__arch_passthrough_mode_setdefault(libxl__gc *gc,
     return rc;
 }
 
+void libxl__arch_update_domain_config(libxl__gc *gc,
+                                      libxl_domain_config *dst,
+                                      const libxl_domain_config *src)
+{
+    /*
+     * Force MSR relaxed to be set (either to true or false) so it's part of
+     * the domain configuration when saving or performing a live-migration.
+     *
+     * Doing so allows the recovery side to figure out whether the flag should
+     * be set to true in order to keep backwards compatibility with already
+     * started domains.
+     */
+    libxl_defbool_setdefault(&dst->b_info.arch_x86.msr_relaxed,
+                    libxl_defbool_val(src->b_info.arch_x86.msr_relaxed));
+}
 
 /*
  * Local variables:
diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml
index a02e26b27f..a5588c643f 100644
--- a/tools/ocaml/libs/xc/xenctrl.ml
+++ b/tools/ocaml/libs/xc/xenctrl.ml
@@ -48,9 +48,13 @@ type x86_arch_emulation_flags =
 	| X86_EMU_USE_PIRQ
 	| X86_EMU_VPCI
 
+type x86_arch_misc_flags =
+	| X86_MSR_RELAXED
+
 type xen_x86_arch_domainconfig =
 {
 	emulation_flags: x86_arch_emulation_flags list;
+	misc_flags: x86_arch_misc_flags list;
 }
 
 type arch_domainconfig =
diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli
index d2a312e273..6e94940a8a 100644
--- a/tools/ocaml/libs/xc/xenctrl.mli
+++ b/tools/ocaml/libs/xc/xenctrl.mli
@@ -42,8 +42,12 @@ type x86_arch_emulation_flags =
   | X86_EMU_USE_PIRQ
   | X86_EMU_VPCI
 
+type x86_arch_misc_flags =
+  | X86_MSR_RELAXED
+
 type xen_x86_arch_domainconfig = {
   emulation_flags: x86_arch_emulation_flags list;
+  misc_flags: x86_arch_misc_flags list;
 }
 
 type arch_domainconfig =
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 9a8dbe5579..d05d7bb30e 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -233,6 +233,15 @@ CAMLprim value stub_xc_domain_create(value xch, value wanted_domid, value config
 
 #undef VAL_EMUL_FLAGS
 
+#define VAL_MISC_FLAGS          Field(arch_domconfig, 1)
+
+		cfg.arch.misc_flags = ocaml_list_to_c_bitmap
+			/* ! x86_arch_misc_flags X86_ none */
+			/* ! XEN_X86_ XEN_X86_MSR_RELAXED all */
+			(VAL_MISC_FLAGS);
+
+#undef VAL_MISC_FLAGS
+
 #else
 		caml_failwith("Unhandled: x86");
 #endif
diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index 1893cfc086..9fb0791429 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -2741,6 +2741,13 @@ skip_usbdev:
     xlu_cfg_get_defbool(config, "xend_suspend_evtchn_compat",
                         &c_info->xend_suspend_evtchn_compat, 0);
 
+    if (!xlu_cfg_get_defbool(config, "msr_relaxed",
+                             &b_info->arch_x86.msr_relaxed, 0))
+            fprintf(stderr,
+                    "WARNING: msr_relaxed will be removed in future versions.\n"
+                    "If it fixes an issue you are having please report to "
+                    "xen-devel@lists.xenproject.org.\n");
+
     xlu_cfg_destroy(config);
 }
 
diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 0ce29e91a3..74b443e509 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -256,6 +256,7 @@ bool __initdata opt_dom0_shadow;
 #endif
 bool __initdata opt_dom0_pvh = !IS_ENABLED(CONFIG_PV);
 bool __initdata opt_dom0_verbose = IS_ENABLED(CONFIG_VERBOSE_DEBUG);
+bool __initdata opt_dom0_msr_relaxed;
 
 static int __init parse_dom0_param(const char *s)
 {
@@ -282,6 +283,8 @@ static int __init parse_dom0_param(const char *s)
         else if ( IS_ENABLED(CONFIG_PV) &&
                   (val = parse_boolean("cpuid-faulting", s, ss)) >= 0 )
             opt_dom0_cpuid_faulting = val;
+        else if ( (val = parse_boolean("msr-relaxed", s, ss)) >= 0 )
+            opt_dom0_msr_relaxed = val;
         else
             rc = -EINVAL;
 
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 5e3c94d3fa..b212729880 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -683,6 +683,13 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
         }
     }
 
+    if ( config->arch.misc_flags & ~XEN_X86_MSR_RELAXED )
+    {
+        dprintk(XENLOG_INFO, "Invalid arch misc flags %#x\n",
+                config->arch.misc_flags);
+        return -EINVAL;
+    }
+
     return 0;
 }
 
@@ -852,6 +859,8 @@ int arch_domain_create(struct domain *d,
 
     domain_cpu_policy_changed(d);
 
+    d->arch.msr_relaxed = config->arch.misc_flags & XEN_X86_MSR_RELAXED;
+
     return 0;
 
  fail:
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index b819897a4a..4585efe1f8 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1795,6 +1795,7 @@ static int svm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
     const struct domain *d = v->domain;
     struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
     const struct nestedsvm *nsvm = &vcpu_nestedsvm(v);
+    uint64_t tmp;
 
     switch ( msr )
     {
@@ -1965,6 +1966,12 @@ static int svm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
         break;
 
     default:
+        if ( d->arch.msr_relaxed && !rdmsr_safe(msr, tmp) )
+        {
+            *msr_content = 0;
+            break;
+        }
+
         gdprintk(XENLOG_WARNING, "RDMSR 0x%08x unimplemented\n", msr);
         goto gpf;
     }
@@ -2151,6 +2158,9 @@ static int svm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         break;
 
     default:
+        if ( d->arch.msr_relaxed && !rdmsr_safe(msr, msr_content) )
+            break;
+
         gdprintk(XENLOG_WARNING,
                  "WRMSR 0x%08x val 0x%016"PRIx64" unimplemented\n",
                  msr, msr_content);
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index bfea1b0f8a..b52824677e 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -3123,6 +3123,7 @@ static int is_last_branch_msr(u32 ecx)
 static int vmx_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
 {
     struct vcpu *curr = current;
+    uint64_t tmp;
 
     HVM_DBG_LOG(DBG_LEVEL_MSR, "ecx=%#x", msr);
 
@@ -3204,6 +3205,12 @@ static int vmx_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
             break;
         }
 
+        if ( curr->domain->arch.msr_relaxed && !rdmsr_safe(msr, tmp) )
+        {
+            *msr_content = 0;
+            break;
+        }
+
         gdprintk(XENLOG_WARNING, "RDMSR 0x%08x unimplemented\n", msr);
         goto gp_fault;
     }
@@ -3505,6 +3512,9 @@ static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content)
              is_last_branch_msr(msr) )
             break;
 
+        if ( v->domain->arch.msr_relaxed && !rdmsr_safe(msr, msr_content) )
+            break;
+
         gdprintk(XENLOG_WARNING,
                  "WRMSR 0x%08x val 0x%016"PRIx64" unimplemented\n",
                  msr, msr_content);
diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index e5a22b9347..74e71403ff 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -875,6 +875,7 @@ static int read_msr(unsigned int reg, uint64_t *val,
     const struct domain *currd = curr->domain;
     const struct cpuid_policy *cp = currd->arch.cpuid;
     bool vpmu_msr = false;
+    uint64_t tmp;
     int ret;
 
     if ( (ret = guest_rdmsr(curr, reg, val)) != X86EMUL_UNHANDLEABLE )
@@ -986,6 +987,12 @@ static int read_msr(unsigned int reg, uint64_t *val,
         }
         /* fall through */
     default:
+        if ( currd->arch.msr_relaxed && !rdmsr_safe(reg, tmp) )
+        {
+            *val = 0;
+            return X86EMUL_OKAY;
+        }
+
         gdprintk(XENLOG_WARNING, "RDMSR 0x%08x unimplemented\n", reg);
         break;
 
@@ -1148,6 +1155,9 @@ static int write_msr(unsigned int reg, uint64_t val,
         }
         /* fall through */
     default:
+        if ( currd->arch.msr_relaxed && !rdmsr_safe(reg, val) )
+            return X86EMUL_OKAY;
+
         gdprintk(XENLOG_WARNING,
                  "WRMSR 0x%08x val 0x%016"PRIx64" unimplemented\n",
                  reg, val);
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 23bbb6e8c1..68454df8ed 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -749,6 +749,9 @@ static struct domain *__init create_dom0(const module_t *image,
         .max_grant_frames = -1,
         .max_maptrack_frames = -1,
         .max_vcpus = dom0_max_vcpus(),
+        .arch = {
+            .misc_flags = opt_dom0_msr_relaxed ? XEN_X86_MSR_RELAXED : 0,
+        },
     };
     struct domain *d;
     char *cmdline;
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 3900d7b48b..7213d184b0 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -437,6 +437,9 @@ struct arch_domain
     /* Mem_access emulation control */
     bool_t mem_access_emulate_each_rep;
 
+    /* Don't unconditionally inject #GP for unhandled MSRs. */
+    bool msr_relaxed;
+
     /* Emulated devices enabled bitmap. */
     uint32_t emulation_flags;
 } __cacheline_aligned;
diff --git a/xen/include/asm-x86/setup.h b/xen/include/asm-x86/setup.h
index 642a5e8460..24be46115d 100644
--- a/xen/include/asm-x86/setup.h
+++ b/xen/include/asm-x86/setup.h
@@ -65,6 +65,7 @@ extern bool opt_dom0_shadow;
 extern bool opt_dom0_pvh;
 extern bool opt_dom0_verbose;
 extern bool opt_dom0_cpuid_faulting;
+extern bool opt_dom0_msr_relaxed;
 
 #define max_init_domid (0)
 
diff --git a/xen/include/public/arch-x86/xen.h b/xen/include/public/arch-x86/xen.h
index 629cb2ba40..6bf1e8cccb 100644
--- a/xen/include/public/arch-x86/xen.h
+++ b/xen/include/public/arch-x86/xen.h
@@ -304,6 +304,14 @@ struct xen_arch_domainconfig {
                                      XEN_X86_EMU_PIT | XEN_X86_EMU_USE_PIRQ |\
                                      XEN_X86_EMU_VPCI)
     uint32_t emulation_flags;
+
+/*
+ * Select whether to use a relaxed behavior for accesses to MSRs not explicitly
+ * handled by Xen instead of injecting a #GP to the guest. Note this option
+ * doesn't allow the guest to read or write to the underlying MSR.
+ */
+#define XEN_X86_MSR_RELAXED (1u << 0)
+    uint32_t misc_flags;
 };
 
 /* Location of online VCPU bitmap. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Mar 13 07:33:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Mar 2021 07:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.97460.185168 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKylt-00068y-J9; Sat, 13 Mar 2021 07:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 97460.185168; Sat, 13 Mar 2021 07:33: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 1lKylt-00068q-GF; Sat, 13 Mar 2021 07:33:13 +0000
Received: by outflank-mailman (input) for mailman id 97460;
 Sat, 13 Mar 2021 07:33: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 1lKyls-00068k-MS
 for xen-changelog@lists.xenproject.org; Sat, 13 Mar 2021 07:33: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 1lKyls-0005Hg-Lc
 for xen-changelog@lists.xenproject.org; Sat, 13 Mar 2021 07:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKyls-0003Fl-KE
 for xen-changelog@lists.xenproject.org; Sat, 13 Mar 2021 07:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cE0XesgPx4/anSKWaPSz7zE0oLmKE8+t8E4GY4MtQjw=; b=Sx4wrE7FpHRg8XGgfKX7DpT+2v
	KSnCIxzVyuz2+d8CRK/0VHG9SIUbOp//ot2LxYntdi7LxmoA3x/+yfyWb0Aa1WIeAae5xoZBccO8h
	/HCOf3NxPRJ7HWkQr7pTNvDIyipmFMdlXYBXSSfLGrw4YS2vVWM0o8VHdszfj6pYHfTk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] vtd: make sure QI/IR are disabled before initialisation
Message-Id: <E1lKyls-0003Fl-KE@xenbits.xenproject.org>
Date: Sat, 13 Mar 2021 07:33:12 +0000

commit 04181c6fb543db01f635227c7681ced4073109ba
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Fri Mar 12 17:01:52 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 12 17:01:52 2021 +0100

    vtd: make sure QI/IR are disabled before initialisation
    
    BIOS might pass control to Xen leaving QI and/or IR in enabled and/or
    partially configured state. In case of x2APIC code path where EIM is
    enabled early in boot - those are correctly disabled by Xen before any
    attempt to configure. But for xAPIC that step is missing which was
    proven to cause QI initialization failures on some ICX based platforms
    where QI is left pre-enabled and partially configured by BIOS. That
    problem becomes hard to avoid since those platforms are shipped with
    x2APIC opt out being advertised by default at the same time by firmware.
    
    Unify the behaviour between x2APIC and xAPIC code paths keeping that in
    line with what Linux does.
    
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/arch/x86/apic.c                 |  2 +-
 xen/drivers/passthrough/vtd/iommu.c | 12 +++++++++++-
 xen/include/asm-x86/apic.h          |  1 +
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 7497ddb5da..8ab8214559 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -47,7 +47,7 @@ static bool __read_mostly tdt_enabled;
 static bool __initdata tdt_enable = true;
 boolean_param("tdt", tdt_enable);
 
-static bool __read_mostly iommu_x2apic_enabled;
+bool __read_mostly iommu_x2apic_enabled;
 
 static struct {
     int active;
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 475efb3be3..9b58d566c8 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2101,7 +2101,7 @@ static int __must_check init_vtd_hw(void)
     u32 sts;
 
     /*
-     * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults.  
+     * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults, etc.
      */
     for_each_drhd_unit ( drhd )
     {
@@ -2111,6 +2111,16 @@ static int __must_check init_vtd_hw(void)
 
         clear_fault_bits(iommu);
 
+        /*
+         * Disable interrupt remapping and queued invalidation if
+         * already enabled by BIOS in case we've not initialized it yet.
+         */
+        if ( !iommu_x2apic_enabled )
+        {
+            disable_intremap(iommu);
+            disable_qinval(iommu);
+        }
+
         spin_lock_irqsave(&iommu->register_lock, flags);
         sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
         sts &= ~DMA_FECTL_IM;
diff --git a/xen/include/asm-x86/apic.h b/xen/include/asm-x86/apic.h
index 8ddb896ee9..2fe54bbf1c 100644
--- a/xen/include/asm-x86/apic.h
+++ b/xen/include/asm-x86/apic.h
@@ -24,6 +24,7 @@ enum apic_mode {
     APIC_MODE_X2APIC    /* x2APIC mode - common for large MP machines */
 };
 
+extern bool iommu_x2apic_enabled;
 extern u8 apic_verbosity;
 extern bool directed_eoi_enabled;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Mar 13 07:33:23 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Mar 2021 07:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.97461.185172 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKym3-0006AJ-Kv; Sat, 13 Mar 2021 07:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 97461.185172; Sat, 13 Mar 2021 07:33: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 1lKym3-0006AC-Hl; Sat, 13 Mar 2021 07:33:23 +0000
Received: by outflank-mailman (input) for mailman id 97461;
 Sat, 13 Mar 2021 07:33: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 1lKym2-0006A3-Py
 for xen-changelog@lists.xenproject.org; Sat, 13 Mar 2021 07:33: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 1lKym2-0005Hr-On
 for xen-changelog@lists.xenproject.org; Sat, 13 Mar 2021 07:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKym2-0003Go-Ns
 for xen-changelog@lists.xenproject.org; Sat, 13 Mar 2021 07:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OZ/4yYMxl1OlB9ULUu9jM/35vpqrWaVHxcV2NtuForc=; b=TgPXKQeYO48FJ4MpC7Zu73g7js
	nrjQ/AEOo/zev2dKU59FFtwSwf6cAS5YF/MdZ8wQAaHrd2MOnkmev6bCJW8lPUxpF1x+Asel8pzGI
	1TrtZGSrj2lNfanh3JgbO98Aw/qYCnmRGbc9YJqFb+YgD2DNpd28OkehGYpC9mehJz7Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: fix for_each_cpu when NR_CPUS=1
Message-Id: <E1lKym2-0003Go-Ns@xenbits.xenproject.org>
Date: Sat, 13 Mar 2021 07:33:22 +0000

commit aa50f45332f17e8d6308b996d890d3e83748a1a5
Author:     Dario Faggioli <dfaggioli@suse.com>
AuthorDate: Fri Mar 12 17:02:47 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 12 17:02:47 2021 +0100

    xen: fix for_each_cpu when NR_CPUS=1
    
    When running an hypervisor build with NR_CPUS=1 for_each_cpu does not
    take into account whether the bit of the CPU is set or not in the
    provided mask.
    
    This means that whatever we have in the bodies of these loops is always
    done once, even if the mask was empty and it should never be done. This
    is clearly a bug and was in fact causing an assert to trigger in credit2
    code.
    
    Removing the special casing of NR_CPUS == 1 makes things work again.
    
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/include/xen/cpumask.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/xen/include/xen/cpumask.h b/xen/include/xen/cpumask.h
index 256b60b106..e69589fc08 100644
--- a/xen/include/xen/cpumask.h
+++ b/xen/include/xen/cpumask.h
@@ -368,15 +368,10 @@ static inline void free_cpumask_var(cpumask_var_t mask)
 #define FREE_CPUMASK_VAR(m) free_cpumask_var(m)
 #endif
 
-#if NR_CPUS > 1
 #define for_each_cpu(cpu, mask)			\
 	for ((cpu) = cpumask_first(mask);	\
 	     (cpu) < nr_cpu_ids;		\
 	     (cpu) = cpumask_next(cpu, mask))
-#else /* NR_CPUS == 1 */
-#define for_each_cpu(cpu, mask)			\
-	for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)(mask))
-#endif /* NR_CPUS */
 
 /*
  * The following particular system cpumasks and operations manage
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Mar 13 07:33:33 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Mar 2021 07:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.97462.185176 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lKymD-0006Bi-Ms; Sat, 13 Mar 2021 07:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 97462.185176; Sat, 13 Mar 2021 07:33: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 1lKymD-0006Ba-JS; Sat, 13 Mar 2021 07:33:33 +0000
Received: by outflank-mailman (input) for mailman id 97462;
 Sat, 13 Mar 2021 07:33: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 1lKymC-0006BS-Th
 for xen-changelog@lists.xenproject.org; Sat, 13 Mar 2021 07:33: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 1lKymC-0005I1-Sp
 for xen-changelog@lists.xenproject.org; Sat, 13 Mar 2021 07:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lKymC-0003HT-RJ
 for xen-changelog@lists.xenproject.org; Sat, 13 Mar 2021 07:33:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bU1FhE7JcIZevUMkwGYyebpKV1BWrUbGdNUcjeek57c=; b=hLIAqgJ/myXfwpWibXjfUgx7xa
	5BBLyHBFu15WLSQ3LTs5wGuc6WnMtXSSSLF7NGGwvGTpu+PqxYuFxPpQOGGJd2F+jyvCWmpBCxxC4
	j5ywIJzSTefv3nm2N1+uglJxr3T9kU0LJF8TlPZL+EUDXATRtyxOtNoDBy2w7Z5VP9lg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] gnttab: work around "may be used uninitialized" warning
Message-Id: <E1lKymC-0003HT-RJ@xenbits.xenproject.org>
Date: Sat, 13 Mar 2021 07:33:32 +0000

commit 9dc46386d89d83c73c41c2b19be83a73957c4393
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 12 17:35:54 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 12 17:35:54 2021 +0100

    gnttab: work around "may be used uninitialized" warning
    
    Sadly I was wrong to suggest dropping vaddrs' initializer during review
    of v2 of the patch introducing this code. gcc 4.3 can't cope.
    
    Fixes: 52531c734ea1 ("xen/gnttab: Rework resource acquisition")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/common/grant_table.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index f937c1d350..ab30e2e8cf 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -4026,7 +4026,7 @@ int gnttab_acquire_resource(
     struct grant_table *gt = d->grant_table;
     unsigned int i, final_frame;
     mfn_t tmp;
-    void **vaddrs;
+    void **vaddrs = NULL;
     int rc = -EINVAL;
 
     if ( !nr_frames )
@@ -4055,6 +4055,17 @@ int gnttab_acquire_resource(
         break;
     }
 
+    /*
+     * Some older toolchains can't spot that vaddrs won't remain uninitialized
+     * on non-error paths, and hence it needs setting to NULL at the top of the
+     * function.  Leave some runtime safety.
+     */
+    if ( !vaddrs )
+    {
+        ASSERT_UNREACHABLE();
+        rc = -ENODATA;
+    }
+
     /* Any errors?  Bad id, or from growing the table? */
     if ( rc )
         goto out;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Mar 13 18:44:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Mar 2021 18:44:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.97611.185384 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lL9F5-0003WV-Lx; Sat, 13 Mar 2021 18:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 97611.185384; Sat, 13 Mar 2021 18: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 1lL9F5-0003WN-Iq; Sat, 13 Mar 2021 18:44:03 +0000
Received: by outflank-mailman (input) for mailman id 97611;
 Sat, 13 Mar 2021 18: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 1lL9F4-0003WH-Ib
 for xen-changelog@lists.xenproject.org; Sat, 13 Mar 2021 18: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 1lL9F4-0000cV-Hg
 for xen-changelog@lists.xenproject.org; Sat, 13 Mar 2021 18:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lL9F4-0006Tg-Ga
 for xen-changelog@lists.xenproject.org; Sat, 13 Mar 2021 18: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=aNBk8qE7WPyl1Rn3R/7D2uGNc/xGAIx03g1+RL6BDA4=; b=l9/uLasMReNGNQ/eIJ/8RcVe/6
	WNmqhtQm/DSXowrOpet4XSVOff09THJYl3BRW2tJo05GxEemKFgcayb2pEsM9UY2UMXdxD7OV5bTK
	rYOcMG+uXLzG8TREj4OvjHUTeDdRGGvUwMWe5lol772DFvUH4AjC+2tECjrYZdJ/WJFM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/PV: conditionally avoid raising #GP for early guest MSR reads
Message-Id: <E1lL9F4-0006Tg-Ga@xenbits.xenproject.org>
Date: Sat, 13 Mar 2021 18:44:02 +0000

commit 6eef0a99262cc903495879448cc4ffefe305ef2a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 12 12:02:42 2021 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 12 17:00:08 2021 +0000

    x86/PV: conditionally avoid raising #GP for early guest MSR reads
    
    Prior to 4.15 Linux, when running in PV mode, did not install a #GP
    handler early enough to cover for example the rdmsrl_safe() of
    MSR_K8_TSEG_ADDR in bsp_init_amd() (not to speak of the unguarded read
    of MSR_K7_HWCR later in the same function). The respective change
    (42b3a4cb5609 "x86/xen: Support early interrupts in xen pv guests") was
    backported to 4.14, but no further - presumably since it wasn't really
    easy because of other dependencies.
    
    Therefore, to prevent our change in the handling of guest MSR accesses
    to render PV Linux 4.13 and older unusable on at least AMD systems, make
    the raising of #GP on this paths conditional upon the guest having
    installed a handler, provided of course the MSR can be read in the first
    place (we would have raised #GP in that case even before). Producing
    zero for reads isn't necessarily correct and may trip code trying to
    detect presence of MSRs early, but since such detection logic won't work
    without a #GP handler anyway, this ought to be a fair workaround.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/arch/x86/pv/emul-priv-op.c    | 20 ++++++++++++++++----
 xen/include/public/arch-x86/xen.h |  6 ++++++
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index 74e71403ff..8889509d2a 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -874,7 +874,7 @@ static int read_msr(unsigned int reg, uint64_t *val,
     struct vcpu *curr = current;
     const struct domain *currd = curr->domain;
     const struct cpuid_policy *cp = currd->arch.cpuid;
-    bool vpmu_msr = false;
+    bool vpmu_msr = false, warn = false;
     uint64_t tmp;
     int ret;
 
@@ -883,7 +883,7 @@ static int read_msr(unsigned int reg, uint64_t *val,
         if ( ret == X86EMUL_EXCEPTION )
             x86_emul_hw_exception(TRAP_gp_fault, 0, ctxt);
 
-        return ret;
+        goto done;
     }
 
     switch ( reg )
@@ -993,7 +993,7 @@ static int read_msr(unsigned int reg, uint64_t *val,
             return X86EMUL_OKAY;
         }
 
-        gdprintk(XENLOG_WARNING, "RDMSR 0x%08x unimplemented\n", reg);
+        warn = true;
         break;
 
     normal:
@@ -1002,7 +1002,19 @@ static int read_msr(unsigned int reg, uint64_t *val,
         return X86EMUL_OKAY;
     }
 
-    return X86EMUL_UNHANDLEABLE;
+ done:
+    if ( ret != X86EMUL_OKAY && !curr->arch.pv.trap_ctxt[X86_EXC_GP].address &&
+         (reg >> 16) != 0x4000 && !rdmsr_safe(reg, tmp) )
+    {
+        gprintk(XENLOG_WARNING, "faking RDMSR 0x%08x\n", reg);
+        *val = 0;
+        x86_emul_reset_event(ctxt);
+        ret = X86EMUL_OKAY;
+    }
+    else if ( warn )
+        gdprintk(XENLOG_WARNING, "RDMSR 0x%08x unimplemented\n", reg);
+
+    return ret;
 }
 
 static int write_msr(unsigned int reg, uint64_t val,
diff --git a/xen/include/public/arch-x86/xen.h b/xen/include/public/arch-x86/xen.h
index 6bf1e8cccb..7acd94c8eb 100644
--- a/xen/include/public/arch-x86/xen.h
+++ b/xen/include/public/arch-x86/xen.h
@@ -143,6 +143,12 @@ typedef unsigned long xen_ulong_t;
  *  Level == 1: Kernel may enter
  *  Level == 2: Kernel may enter
  *  Level == 3: Everyone may enter
+ *
+ * Note: For compatibility with kernels not setting up exception handlers
+ *       early enough, Xen will avoid trying to inject #GP (and hence crash
+ *       the domain) when an RDMSR would require this, but no handler was
+ *       set yet. The precise conditions are implementation specific, and
+ *       new code may not rely on such behavior anyway.
  */
 #define TI_GET_DPL(_ti)      ((_ti)->flags & 3)
 #define TI_GET_IF(_ti)       ((_ti)->flags & 4)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Mar 13 18:44:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Mar 2021 18:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.97612.185388 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lL9FG-0003XT-Nf; Sat, 13 Mar 2021 18:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 97612.185388; Sat, 13 Mar 2021 18: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 1lL9FG-0003XL-KO; Sat, 13 Mar 2021 18:44:14 +0000
Received: by outflank-mailman (input) for mailman id 97612;
 Sat, 13 Mar 2021 18: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 1lL9FE-0003XD-Mv
 for xen-changelog@lists.xenproject.org; Sat, 13 Mar 2021 18: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 1lL9FE-0000cr-Kt
 for xen-changelog@lists.xenproject.org; Sat, 13 Mar 2021 18:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lL9FE-0006US-Jw
 for xen-changelog@lists.xenproject.org; Sat, 13 Mar 2021 18: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=LzjpH6sv4ZVBUcWNpKOlkG9pAYjuFynjJFOUmu32m1A=; b=c4yOqc29LG2h867nE6VFuPnVty
	eVOpx1uSwQPEOoA+//3S4hymNBNF2XVZLxS0PzsFSiLVxeCravgOF06X1uj3tTxvzkDCOu4UDu7YO
	42dTevsjoVQ9jgJNXFjXEDglarIXsa7X+4nPwfUs3QndDMHF5BjXvqx0LsmlK4KNERQE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/AMD: expose HWCR.TscFreqSel to guests
Message-Id: <E1lL9FE-0006US-Jw@xenbits.xenproject.org>
Date: Sat, 13 Mar 2021 18:44:12 +0000

commit 14b95b3b8546db201e7efd0636ae0e215fae98f3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 12 12:03:06 2021 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 12 17:00:30 2021 +0000

    x86/AMD: expose HWCR.TscFreqSel to guests
    
    Linux has been warning ("firmware bug") about this bit being clear for a
    long time. While writable in older hardware it has been readonly on more
    than just most recent hardware. For simplicitly report it always set (if
    anything we may want to log the issue ourselves if it turns out to be
    clear on older hardware) on CPU families 10h and up (in family 0fh the
    bit is part of a larger field of different purpose).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/arch/x86/msr.c              | 7 +++++++
 xen/include/asm-x86/msr-index.h | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index 8ed0b4e982..0ebcb04259 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -315,6 +315,13 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
         *val = msrs->tsc_aux;
         break;
 
+    case MSR_K8_HWCR:
+        if ( !(cp->x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
+            goto gp_fault;
+        *val = get_cpu_family(cp->basic.raw_fms, NULL, NULL) >= 0x10
+               ? K8_HWCR_TSC_FREQ_SEL : 0;
+        break;
+
     case MSR_AMD64_DE_CFG:
         if ( !(cp->x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
             goto gp_fault;
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 1f5a5d0e38..f2e34dd22b 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -287,6 +287,8 @@
 
 #define MSR_K7_HWCR			0xc0010015
 #define MSR_K8_HWCR			0xc0010015
+#define K8_HWCR_TSC_FREQ_SEL		(1ULL << 24)
+
 #define MSR_K7_FID_VID_CTL		0xc0010041
 #define MSR_K7_FID_VID_STATUS		0xc0010042
 #define MSR_K8_PSTATE_LIMIT		0xc0010061
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Mar 15 07:44:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Mar 2021 07:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.97856.185655 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lLhtW-00045y-C7; Mon, 15 Mar 2021 07:44:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 97856.185655; Mon, 15 Mar 2021 07:44: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 1lLhtW-00045q-9D; Mon, 15 Mar 2021 07:44:06 +0000
Received: by outflank-mailman (input) for mailman id 97856;
 Mon, 15 Mar 2021 07:44: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 1lLhtV-00045l-A9
 for xen-changelog@lists.xenproject.org; Mon, 15 Mar 2021 07:44: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 1lLhtV-0002WY-67
 for xen-changelog@lists.xenproject.org; Mon, 15 Mar 2021 07:44:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lLhtV-0005Bd-53
 for xen-changelog@lists.xenproject.org; Mon, 15 Mar 2021 07:44:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HMLD4yRTuGThsB/oYQn2GGWB4KDtO231qVp3ZibJ220=; b=QLOGj7g6xPdcnOxKpRbX8JXInk
	/a/B6CuKkhLQjlfkxh8lV1qvgLwkSUYZzuLWgJwXFO5fxvJCE0cpCiSBx5YXDGNiwlGRaPaDYDxLA
	3U6XwUsZctFKzCDrT9XpTu6V7sJiB66SYQCWPRhKqNesa5iwPESCHqtKy7hN9yoex39Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/x86: don't rebuild cpuid-autogen.h every time
Message-Id: <E1lLhtV-0005Bd-53@xenbits.xenproject.org>
Date: Mon, 15 Mar 2021 07:44:05 +0000

commit b4011741e6b39a8fd0ed5aded96c16c45ead5888
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Mar 15 08:33:53 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Mar 15 08:33:53 2021 +0100

    tools/x86: don't rebuild cpuid-autogen.h every time
    
    The first thing the "xen-dir" rule does is delete the entire xen/
    subtree. Obviously this includes deleting xen/lib/x86/*autogen.h. As a
    result there's no original version for $(move-if-changed ...) to compare
    against, and hence the file and all its consumers would get rebuilt
    every time. Instead only find and delete all the symlinks.
    
    Fixes: eddf9559c977 ("libx86: generate cpuid-autogen.h in the libx86 include dir")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/include/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/include/Makefile b/tools/include/Makefile
index 4d4ec5f974..42605d46b9 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -19,8 +19,8 @@ xen-foreign:
 	$(MAKE) -C xen-foreign
 
 xen-dir:
-	@rm -rf xen acpi
 	mkdir -p xen/libelf acpi
+	find xen/ acpi/ -type l -exec rm '{}' +
 	ln -s $(XEN_ROOT)/xen/include/public/COPYING xen/
 	ln -s $(XEN_ROOT)/xen/include/public/*.h xen/
 	ln -s $(XEN_ROOT)/xen/include/public/*/ xen/
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 16 01:33:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 16 Mar 2021 01:33:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.98153.186084 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lLyZz-0004L5-Eu; Tue, 16 Mar 2021 01:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 98153.186084; Tue, 16 Mar 2021 01: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 1lLyZz-0004Kw-Ac; Tue, 16 Mar 2021 01:33:03 +0000
Received: by outflank-mailman (input) for mailman id 98153;
 Tue, 16 Mar 2021 01:33: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 1lLyZx-0004Kr-Qf
 for xen-changelog@lists.xenproject.org; Tue, 16 Mar 2021 01:33: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 1lLyZx-0007EL-OB
 for xen-changelog@lists.xenproject.org; Tue, 16 Mar 2021 01:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lLyZx-0007cg-Mc
 for xen-changelog@lists.xenproject.org; Tue, 16 Mar 2021 01: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=W/18MbfWIm6KG9fmgtizVqO1le2DylCWrg9/27qukd0=; b=pcETaIT12Ljz/Q3yKqTwN00DGr
	Rswg7/VmDPclJ/c8fUnW2nKgbm0F94pd5K+LAnCGK1D2frKJ+cDZhuwWtNGaljuFJMCKSaH7B7nVp
	PP0thz9o3DAB8sKTIQl/LiLkezeo0oy/mRZkRpUJABHvf7lxtudZSZpcUoVaEDygnwco=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/x86: don't rebuild cpuid-autogen.h every time
Message-Id: <E1lLyZx-0007cg-Mc@xenbits.xenproject.org>
Date: Tue, 16 Mar 2021 01:33:01 +0000

commit b4011741e6b39a8fd0ed5aded96c16c45ead5888
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Mar 15 08:33:53 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Mar 15 08:33:53 2021 +0100

    tools/x86: don't rebuild cpuid-autogen.h every time
    
    The first thing the "xen-dir" rule does is delete the entire xen/
    subtree. Obviously this includes deleting xen/lib/x86/*autogen.h. As a
    result there's no original version for $(move-if-changed ...) to compare
    against, and hence the file and all its consumers would get rebuilt
    every time. Instead only find and delete all the symlinks.
    
    Fixes: eddf9559c977 ("libx86: generate cpuid-autogen.h in the libx86 include dir")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/include/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/include/Makefile b/tools/include/Makefile
index 4d4ec5f974..42605d46b9 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -19,8 +19,8 @@ xen-foreign:
 	$(MAKE) -C xen-foreign
 
 xen-dir:
-	@rm -rf xen acpi
 	mkdir -p xen/libelf acpi
+	find xen/ acpi/ -type l -exec rm '{}' +
 	ln -s $(XEN_ROOT)/xen/include/public/COPYING xen/
 	ln -s $(XEN_ROOT)/xen/include/public/*.h xen/
 	ln -s $(XEN_ROOT)/xen/include/public/*/ xen/
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Mar 16 14:33:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 16 Mar 2021 14:33:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.98312.186394 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lMAkr-0008Rc-Dt; Tue, 16 Mar 2021 14:33:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 98312.186394; Tue, 16 Mar 2021 14: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 1lMAkr-0008RU-Aq; Tue, 16 Mar 2021 14:33:05 +0000
Received: by outflank-mailman (input) for mailman id 98312;
 Tue, 16 Mar 2021 14: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 1lMAkq-0008RN-JO
 for xen-changelog@lists.xenproject.org; Tue, 16 Mar 2021 14: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 1lMAkq-0004kD-Hm
 for xen-changelog@lists.xenproject.org; Tue, 16 Mar 2021 14:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lMAkq-0001CF-F9
 for xen-changelog@lists.xenproject.org; Tue, 16 Mar 2021 14:33:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zOSPNtKLODyM9K1Vft7+he6sakNR1zez8NdMcDj4BoU=; b=3lXVcyOGw+yCldTOVqSWkoSt5o
	MHdZ9IrT+dnCkehpbgL/SWtlPGvVzXZ+J2MWq6ARXi4jhmZ2mrZk5+OFFsuq9u6qTwwtMYhKaEzOj
	x29WhUv/Gnz5Dh3TpGIIPlyGrWDS5IwtsWEzexa7xB4g1Is/ZiLfVq1vm+TGJnveYDzQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Bump the minimum version of GCC supported to 4.9 for arm32 and 5.1 on arm64
Message-Id: <E1lMAkq-0001CF-F9@xenbits.xenproject.org>
Date: Tue, 16 Mar 2021 14:33:04 +0000

commit 21657ad4f01a634beac570c64c0691e51b9cf366
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Sat Mar 6 21:41:48 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Mar 16 14:30:50 2021 +0000

    xen: Bump the minimum version of GCC supported to 4.9 for arm32 and 5.1 on arm64
    
    Compilers older than 4.8 have known codegen issues which can lead to
    silent miscompilation:
    
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145
    
    Furthermore, pre-4.9 GCC have known bugs (including things like
    internal compiler errors on Arm) which would require workaround (I
    haven't checked if we have any in Xen).
    
    The minimum version of GCC to build the hypervisor on arm is now
    raised to 4.9.
    
    In addition to that, on arm64, GCC version >= 4.9 and < 5.1 have been
    shown to emit memory references beyond the stack pointer, resulting in
    memory corruption if an interrupt is taken after the stack pointer has
    been adjusted but before the reference has been executed.
    
    Therefore, the minimum for arm64 is raised to 5.1.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 README                     |  7 +++++--
 xen/include/xen/compiler.h | 10 ++++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/README b/README
index 8c99c30986..aa8b4fe126 100644
--- a/README
+++ b/README
@@ -42,8 +42,11 @@ provided by your OS distributor:
         - GNU Binutils 2.16.91.0.5 or later
         or
         - Clang/LLVM 3.5 or later
-      - For ARM:
-        - GCC 4.8 or later
+      - For ARM 32-bit:
+        - GCC 4.9 or later
+        - GNU Binutils 2.24 or later
+      - For ARM 64-bit:
+        - GCC 5.1 or later
         - GNU Binutils 2.24 or later
     * Development install of zlib (e.g., zlib-dev)
     * Development install of Python 2.6 or later (e.g., python-dev)
diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h
index 0ec0b4698e..17cf00e1ec 100644
--- a/xen/include/xen/compiler.h
+++ b/xen/include/xen/compiler.h
@@ -3,6 +3,16 @@
 
 #if !defined(__GNUC__) || (__GNUC__ < 4)
 #error Sorry, your compiler is too old/not recognized.
+#elif CONFIG_CC_IS_GCC
+# if defined(CONFIG_ARM_32) && CONFIG_GCC_VERSION < 40900
+#  error Sorry, your version of GCC is too old - please use 4.9 or newer.
+# elif defined(CONFIG_ARM_64) && CONFIG_GCC_VERSION < 50100
+/*
+ * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63293
+ * https://lore.kernel.org/r/20210107111841.GN1551@shell.armlinux.org.uk
+ */
+#  error Sorry, your version of GCC is too old - please use 5.1 or newer.
+# endif
 #endif
 
 #define barrier()     __asm__ __volatile__("": : :"memory")
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Mar 17 06:55:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Mar 2021 06:55:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.98556.187022 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lMQ59-0001s2-CN; Wed, 17 Mar 2021 06:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 98556.187022; Wed, 17 Mar 2021 06: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 1lMQ59-0001rt-94; Wed, 17 Mar 2021 06:55:03 +0000
Received: by outflank-mailman (input) for mailman id 98556;
 Wed, 17 Mar 2021 06: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 1lMQ58-0001ro-FD
 for xen-changelog@lists.xenproject.org; Wed, 17 Mar 2021 06: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 1lMQ58-0008CG-BG
 for xen-changelog@lists.xenproject.org; Wed, 17 Mar 2021 06:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lMQ58-0003yU-8a
 for xen-changelog@lists.xenproject.org; Wed, 17 Mar 2021 06: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=UmwtkLyOinx7kJVceiyvXulQqmAm7ZUsYpQVw1P52Gw=; b=ocfv3oq5Sx7Sw7FAJORzFf9mUa
	NPmvXU0h/+cTmT22WCU0ZJVSERhqLalHVMw5XZ1GksuQbMYTbdEnh4PL5X/uhWXLltxlfUPKJULYh
	DgQQka/ou950wG1cb4fpGwKmKj1m5NpNYE2xOk4ecIdJoo+TvLejEGbaFLnDn2X8SF34=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Bump the minimum version of GCC supported to 4.9 for arm32 and 5.1 on arm64
Message-Id: <E1lMQ58-0003yU-8a@xenbits.xenproject.org>
Date: Wed, 17 Mar 2021 06:55:02 +0000

commit 21657ad4f01a634beac570c64c0691e51b9cf366
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Sat Mar 6 21:41:48 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Mar 16 14:30:50 2021 +0000

    xen: Bump the minimum version of GCC supported to 4.9 for arm32 and 5.1 on arm64
    
    Compilers older than 4.8 have known codegen issues which can lead to
    silent miscompilation:
    
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145
    
    Furthermore, pre-4.9 GCC have known bugs (including things like
    internal compiler errors on Arm) which would require workaround (I
    haven't checked if we have any in Xen).
    
    The minimum version of GCC to build the hypervisor on arm is now
    raised to 4.9.
    
    In addition to that, on arm64, GCC version >= 4.9 and < 5.1 have been
    shown to emit memory references beyond the stack pointer, resulting in
    memory corruption if an interrupt is taken after the stack pointer has
    been adjusted but before the reference has been executed.
    
    Therefore, the minimum for arm64 is raised to 5.1.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 README                     |  7 +++++--
 xen/include/xen/compiler.h | 10 ++++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/README b/README
index 8c99c30986..aa8b4fe126 100644
--- a/README
+++ b/README
@@ -42,8 +42,11 @@ provided by your OS distributor:
         - GNU Binutils 2.16.91.0.5 or later
         or
         - Clang/LLVM 3.5 or later
-      - For ARM:
-        - GCC 4.8 or later
+      - For ARM 32-bit:
+        - GCC 4.9 or later
+        - GNU Binutils 2.24 or later
+      - For ARM 64-bit:
+        - GCC 5.1 or later
         - GNU Binutils 2.24 or later
     * Development install of zlib (e.g., zlib-dev)
     * Development install of Python 2.6 or later (e.g., python-dev)
diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h
index 0ec0b4698e..17cf00e1ec 100644
--- a/xen/include/xen/compiler.h
+++ b/xen/include/xen/compiler.h
@@ -3,6 +3,16 @@
 
 #if !defined(__GNUC__) || (__GNUC__ < 4)
 #error Sorry, your compiler is too old/not recognized.
+#elif CONFIG_CC_IS_GCC
+# if defined(CONFIG_ARM_32) && CONFIG_GCC_VERSION < 40900
+#  error Sorry, your version of GCC is too old - please use 4.9 or newer.
+# elif defined(CONFIG_ARM_64) && CONFIG_GCC_VERSION < 50100
+/*
+ * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63293
+ * https://lore.kernel.org/r/20210107111841.GN1551@shell.armlinux.org.uk
+ */
+#  error Sorry, your version of GCC is too old - please use 5.1 or newer.
+# endif
 #endif
 
 #define barrier()     __asm__ __volatile__("": : :"memory")
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Mar 18 14:00:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Mar 2021 14:00:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99009.188043 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lMtC1-0005mP-Uz; Thu, 18 Mar 2021 14:00:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99009.188043; Thu, 18 Mar 2021 14:00: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 1lMtC1-0005lw-Re; Thu, 18 Mar 2021 14:00:05 +0000
Received: by outflank-mailman (input) for mailman id 99009;
 Thu, 18 Mar 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 1lMtC1-0005hD-Ar
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 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 1lMtC1-0001Pk-7c
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 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 1lMtC1-0000cg-5R
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 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=QBnz+JPO+AsNGSVRygbnkP63VU5YrcjkdY4YUnNWyJg=; b=mjGdG31Jl9QD7e7+dX1NlrjCOs
	h3NUY55P/WKZcStBo/dbmEH6fn6ctZjzULb8FEQrsBRj04TcRVf4z/ONCFQ2UHxbCHS1UgtmAgTDz
	/TMV2Ym+Vbz8VfD+ptLYfXYRpR+8DYUWrc/YnaJAUFLd2bnzpoOAjaOvEJR0gGXu8j/k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libxl: Fix domain soft reset state handling
Message-Id: <E1lMtC1-0000cg-5R@xenbits.xenproject.org>
Date: Thu, 18 Mar 2021 14:00:05 +0000

commit dae3c3e8b257cd27d6b35a467a34bf79a6650340
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed Feb 24 18:39:20 2021 +0000
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 14:56:33 2021 +0100

    libxl: Fix domain soft reset state handling
    
    In do_domain_soft_reset(), a `libxl__domain_suspend_state' is used
    without been properly initialised and disposed of. This lead do a
    abort() in libxl due to the `dsps.qmp' state been used before been
    initialised:
        libxl__ev_qmp_send: Assertion `ev->state == qmp_state_disconnected || ev->state == qmp_state_connected' failed.
    
    Once initialised, `dsps' also needs to be disposed of as the `qmp'
    state might still be in the `Connected' state in the callback for
    libxl__domain_suspend_device_model(). So this patch adds
    libxl__domain_suspend_dispose() which can be called from the two
    places where we need to dispose of `dsps'.
    
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Tested-by: Olaf Hering <olaf@aepfle.de>
---
 tools/libs/light/libxl_create.c      | 11 ++++++++---
 tools/libs/light/libxl_dom_suspend.c | 15 +++++++++++----
 tools/libs/light/libxl_internal.h    |  2 ++
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c
index 1131b2a733..0c64268f66 100644
--- a/tools/libs/light/libxl_create.c
+++ b/tools/libs/light/libxl_create.c
@@ -2179,9 +2179,7 @@ static int do_domain_soft_reset(libxl_ctx *ctx,
     state->console_tty = libxl__strdup(gc, console_tty);
 
     dss->ao = ao;
-    dss->domid = dss->dsps.domid = domid;
-    dss->dsps.dm_savefile = GCSPRINTF(LIBXL_DEVICE_MODEL_SAVE_FILE".%d",
-                                      domid);
+    dss->domid = domid;
 
     rc = libxl__save_emulator_xenstore_data(dss, &srs->toolstack_buf,
                                             &srs->toolstack_len);
@@ -2191,6 +2189,11 @@ static int do_domain_soft_reset(libxl_ctx *ctx,
     }
 
     dss->dsps.ao = ao;
+    dss->dsps.domid = domid;
+    dss->dsps.live = false;
+    rc = libxl__domain_suspend_init(egc, &dss->dsps, d_config->b_info.type);
+    if (rc)
+        goto out;
     dss->dsps.callback_device_model_done = soft_reset_dm_suspended;
     libxl__domain_suspend_device_model(egc, &dss->dsps); /* must be last */
 
@@ -2209,6 +2212,8 @@ static void soft_reset_dm_suspended(libxl__egc *egc,
         CONTAINER_OF(dsps, *srs, dss.dsps);
     libxl__app_domain_create_state *cdcs = &srs->cdcs;
 
+    libxl__domain_suspend_dispose(gc, dsps);
+
     /*
      * Ask all backends to disconnect by removing the domain from
      * xenstore. On the creation path the domain will be introduced to
diff --git a/tools/libs/light/libxl_dom_suspend.c b/tools/libs/light/libxl_dom_suspend.c
index f7823bbc8f..4fa22bb739 100644
--- a/tools/libs/light/libxl_dom_suspend.c
+++ b/tools/libs/light/libxl_dom_suspend.c
@@ -67,6 +67,16 @@ out:
     return rc;
 }
 
+void libxl__domain_suspend_dispose(libxl__gc *gc,
+                                   libxl__domain_suspend_state  *dsps)
+{
+    libxl__xswait_stop(gc, &dsps->pvcontrol);
+    libxl__ev_evtchn_cancel(gc, &dsps->guest_evtchn);
+    libxl__ev_xswatch_deregister(gc, &dsps->guest_watch);
+    libxl__ev_time_deregister(gc, &dsps->guest_timeout);
+    libxl__ev_qmp_dispose(gc, &dsps->qmp);
+}
+
 /*----- callbacks, called by xc_domain_save -----*/
 
 void libxl__domain_suspend_device_model(libxl__egc *egc,
@@ -388,10 +398,7 @@ static void domain_suspend_common_done(libxl__egc *egc,
 {
     EGC_GC;
     assert(!libxl__xswait_inuse(&dsps->pvcontrol));
-    libxl__ev_evtchn_cancel(gc, &dsps->guest_evtchn);
-    libxl__ev_xswatch_deregister(gc, &dsps->guest_watch);
-    libxl__ev_time_deregister(gc, &dsps->guest_timeout);
-    libxl__ev_qmp_dispose(gc, &dsps->qmp);
+    libxl__domain_suspend_dispose(gc, dsps);
     dsps->callback_common_done(egc, dsps, rc);
 }
 
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index 028bc013d9..c6a4a187f5 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -3617,6 +3617,8 @@ struct libxl__domain_suspend_state {
 int libxl__domain_suspend_init(libxl__egc *egc,
                                libxl__domain_suspend_state *dsps,
                                libxl_domain_type type);
+void libxl__domain_suspend_dispose(libxl__gc *gc,
+                                   libxl__domain_suspend_state  *dsps);
 
 /* calls dsps->callback_device_model_done when done
  * may synchronously calls this callback */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Mar 18 14:11:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Mar 2021 14:11:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99020.188047 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lMtMg-0006nw-Oj; Thu, 18 Mar 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 99020.188047; Thu, 18 Mar 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 1lMtMg-0006no-LY; Thu, 18 Mar 2021 14:11:06 +0000
Received: by outflank-mailman (input) for mailman id 99020;
 Thu, 18 Mar 2021 14: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 1lMtMf-0006nj-Ej
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14: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 1lMtMf-0001aP-AE
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 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 1lMtMf-0001Uc-8j
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 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=UexNlCI/gVbQqiQNNek3Vm1eCw/zWCQI23X/EwaZXo8=; b=OAWzo3vcJ1YjpsfsRFItrBaFWr
	54g/xYnUjShuGtk9nlnVaqF8aA9GCg1OSFTx6JElp72DDFng47EBaKI3iE3lbuhqxminx+1US2WjH
	ZFDpBBU8rgQ7XiMAmiabS3N9OMoEeqpmKNA55dl5Pac6AszvAxq8Va+MgPHfZJEZWWN0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] crypto: adjust rijndaelEncrypt() prototype for gcc11
Message-Id: <E1lMtMf-0001Uc-8j@xenbits.xenproject.org>
Date: Thu, 18 Mar 2021 14:11:05 +0000

commit 576844d1b677000ab0eb557247075a05f9aafec8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Mar 18 15:01:04 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:01:04 2021 +0100

    crypto: adjust rijndaelEncrypt() prototype for gcc11
    
    The upcoming release complains, not entirely unreasonably:
    
    In file included from rijndael.c:33:
    .../xen/include/crypto/rijndael.h:55:53: note: previously declared as 'const unsigned char[]'
       55 | void    rijndaelEncrypt(const unsigned int [], int, const unsigned char [],
          |                                                     ^~~~~~~~~~~~~~~~~~~~~~
    rijndael.c:865:8: error: argument 4 of type 'u8[16]' {aka 'unsigned char[16]'} with mismatched bound [-Werror=array-parameter=]
      865 |     u8 ct[16])
          |     ~~~^~~~~~
    In file included from rijndael.c:33:
    .../xen/include/crypto/rijndael.h:56:13: note: previously declared as 'unsigned char[]'
       56 |             unsigned char []);
          |             ^~~~~~~~~~~~~~~~
    
    Simply declare the correct array dimensions right away. This then allows
    compilers to apply checking at call sites, which seems desirable anyway.
    
    For the moment I'm leaving untouched the disagreement between u8/u32
    used in the function definition and unsigned {char,int} used in the
    declaration, as making this consistent would call for touching further
    functions.
    
    Reported-by: Charles Arnold <carnold@suse.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    master commit: c6ad5a701b9a6df443a6c98d9e7201c958bbcafc
    master date: 2021-03-04 16:47:51 +0100
---
 xen/include/crypto/rijndael.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/crypto/rijndael.h b/xen/include/crypto/rijndael.h
index 69965783c5..4386be5878 100644
--- a/xen/include/crypto/rijndael.h
+++ b/xen/include/crypto/rijndael.h
@@ -52,7 +52,7 @@ void	 rijndael_encrypt(rijndael_ctx *, const unsigned char *, unsigned char *);
 
 int	rijndaelKeySetupEnc(unsigned int [], const unsigned char [], int);
 int	rijndaelKeySetupDec(unsigned int [], const unsigned char [], int);
-void	rijndaelEncrypt(const unsigned int [], int, const unsigned char [],
-	    unsigned char []);
+void	rijndaelEncrypt(const unsigned int [], int, const unsigned char [16],
+	    unsigned char [16]);
 
 #endif /* __RIJNDAEL_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Mar 18 14:11:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Mar 2021 14:11:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99021.188051 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lMtMq-0006om-QH; Thu, 18 Mar 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 99021.188051; Thu, 18 Mar 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 1lMtMq-0006oe-NA; Thu, 18 Mar 2021 14:11:16 +0000
Received: by outflank-mailman (input) for mailman id 99021;
 Thu, 18 Mar 2021 14: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 1lMtMp-0006oX-FU
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14: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 1lMtMp-0001aV-Dr
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:11:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lMtMp-0001V9-Cw
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:11:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gUW7DUlyWIxychI3wXi1s9rT2Ev7vxMu9XSzu/alNw4=; b=f2YJZkqpou02XLSiw7FvKjZD9K
	tqfLpwG8WY6XHjMUxGGTtT7JXFW4873zTNEeDDIFmpUNAYLu1Ky6pY6U/dmgox1O7YBC8rToRxJSV
	D0zJHFxbaCppQEhKIljNRCmupSRVUThQzwZxTXjQP2Widu4HiL83vmsLo+iftOWnGxcA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/shadow: suppress "fast fault path" optimization without reserved bits
Message-Id: <E1lMtMp-0001V9-Cw@xenbits.xenproject.org>
Date: Thu, 18 Mar 2021 14:11:15 +0000

commit e7654716903461792d271ca3feab244827b970bd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Mar 18 15:01:50 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:01:50 2021 +0100

    x86/shadow: suppress "fast fault path" optimization without reserved bits
    
    When none of the physical address bits in PTEs are reserved, we can't
    create any 4k (leaf) PTEs which would trigger reserved bit faults. Hence
    the present SHOPT_FAST_FAULT_PATH machinery needs to be suppressed in
    this case, which is most easily achieved by never creating any magic
    entries.
    
    To compensate a little, eliminate sh_write_p2m_entry_post()'s impact on
    such hardware.
    
    While at it, also avoid using an MMIO magic entry when that would
    truncate the incoming GFN.
    
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    
    x86/shadow: suppress "fast fault path" optimization when running virtualized
    
    We can't make correctness of our own behavior dependent upon a
    hypervisor underneath us correctly telling us the true physical address
    with hardware uses. Without knowing this, we can't be certain reserved
    bit faults can actually be observed. Therefore, besides evaluating the
    number of address bits when deciding whether to use the optimization,
    also check whether we're running virtualized ourselves. (Note that since
    we may get migrated when running virtualized, the number of address bits
    may also change.)
    
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 9318fdf757ec234f0ee6c5cd381326b2f581d065
    master date: 2021-03-05 13:29:28 +0100
    master commit: 60c0444fae2148452f9ed0b7c49af1fa41f8f522
    master date: 2021-03-08 10:41:50 +0100
---
 xen/arch/x86/mm/shadow/multi.c |  3 ++-
 xen/arch/x86/mm/shadow/types.h | 34 ++++++++++++++++++++++++++++------
 2 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 7d16d1c1a9..99e410d999 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -530,7 +530,8 @@ _sh_propagate(struct vcpu *v,
     {
         /* Guest l1e maps emulated MMIO space */
         *sp = sh_l1e_mmio(target_gfn, gflags);
-        d->arch.paging.shadow.has_fast_mmio_entries = true;
+        if ( sh_l1e_is_magic(*sp) )
+            d->arch.paging.shadow.has_fast_mmio_entries = true;
         goto done;
     }
 
diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index d5096748ac..71d8c322ad 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -290,24 +290,41 @@ void sh_destroy_monitor_table(struct vcpu *v, mfn_t mmfn);
  * pagetables.
  *
  * This is only feasible for PAE and 64bit Xen: 32-bit non-PAE PTEs don't
- * have reserved bits that we can use for this.
+ * have reserved bits that we can use for this.  And even there it can only
+ * be used if we can be certain the processor doesn't use all 52 address bits.
  */
 
 #define SH_L1E_MAGIC 0xffffffff00000001ULL
+
+static inline bool sh_have_pte_rsvd_bits(void)
+{
+    return paddr_bits < PADDR_BITS && !cpu_has_hypervisor;
+}
+
 static inline bool sh_l1e_is_magic(shadow_l1e_t sl1e)
 {
     return (sl1e.l1 & SH_L1E_MAGIC) == SH_L1E_MAGIC;
 }
 
 /* Guest not present: a single magic value */
-static inline shadow_l1e_t sh_l1e_gnp(void)
+static inline shadow_l1e_t sh_l1e_gnp_raw(void)
 {
     return (shadow_l1e_t){ -1ULL };
 }
 
+static inline shadow_l1e_t sh_l1e_gnp(void)
+{
+    /*
+     * On systems with no reserved physical address bits we can't engage the
+     * fast fault path.
+     */
+    return sh_have_pte_rsvd_bits() ? sh_l1e_gnp_raw()
+                                   : shadow_l1e_empty();
+}
+
 static inline bool sh_l1e_is_gnp(shadow_l1e_t sl1e)
 {
-    return sl1e.l1 == sh_l1e_gnp().l1;
+    return sl1e.l1 == sh_l1e_gnp_raw().l1;
 }
 
 /*
@@ -322,9 +339,14 @@ static inline bool sh_l1e_is_gnp(shadow_l1e_t sl1e)
 
 static inline shadow_l1e_t sh_l1e_mmio(gfn_t gfn, u32 gflags)
 {
-    return (shadow_l1e_t) { (SH_L1E_MMIO_MAGIC
-                             | MASK_INSR(gfn_x(gfn), SH_L1E_MMIO_GFN_MASK)
-                             | (gflags & (_PAGE_USER|_PAGE_RW))) };
+    unsigned long gfn_val = MASK_INSR(gfn_x(gfn), SH_L1E_MMIO_GFN_MASK);
+
+    if ( !sh_have_pte_rsvd_bits() ||
+         gfn_x(gfn) != MASK_EXTR(gfn_val, SH_L1E_MMIO_GFN_MASK) )
+        return shadow_l1e_empty();
+
+    return (shadow_l1e_t) { (SH_L1E_MMIO_MAGIC | gfn_val |
+                             (gflags & (_PAGE_USER | _PAGE_RW))) };
 }
 
 static inline bool sh_l1e_is_mmio(shadow_l1e_t sl1e)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Mar 18 14:11:26 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Mar 2021 14:11:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99022.188055 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lMtN0-0006qG-Rs; Thu, 18 Mar 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 99022.188055; Thu, 18 Mar 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 1lMtN0-0006q7-Om; Thu, 18 Mar 2021 14:11:26 +0000
Received: by outflank-mailman (input) for mailman id 99022;
 Thu, 18 Mar 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 1lMtMz-0006px-JA
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 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 1lMtMz-0001ad-IK
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 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 1lMtMz-0001Vt-H2
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14: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=cIezhyW+tMgO5iKz2RGBq8iCQkmSDk/z4Aak8xUMAvI=; b=S/SN9jKDLfL7clq7AIhzId6Bxx
	rVBo8uobzI2Tj02lNe1QROeFhx5gfGU5zNS26OmFWiPfadtr6ETSDXlhW7W4JAl7JJbCS6WP3ORzM
	mleJ4Bg5ki9JEMj+YKk4xqM4wt6s1LBvXTKvWBVHTqWkibLUtzwjh7CykZQXbXvDEm+U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] vtd: make sure QI/IR are disabled before initialisation
Message-Id: <E1lMtMz-0001Vt-H2@xenbits.xenproject.org>
Date: Thu, 18 Mar 2021 14:11:25 +0000

commit 57ced58d26b2131e61b0b1b7c22de1e8ff712861
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Thu Mar 18 15:02:15 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:02:15 2021 +0100

    vtd: make sure QI/IR are disabled before initialisation
    
    BIOS might pass control to Xen leaving QI and/or IR in enabled and/or
    partially configured state. In case of x2APIC code path where EIM is
    enabled early in boot - those are correctly disabled by Xen before any
    attempt to configure. But for xAPIC that step is missing which was
    proven to cause QI initialization failures on some ICX based platforms
    where QI is left pre-enabled and partially configured by BIOS. That
    problem becomes hard to avoid since those platforms are shipped with
    x2APIC opt out being advertised by default at the same time by firmware.
    
    Unify the behaviour between x2APIC and xAPIC code paths keeping that in
    line with what Linux does.
    
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 04181c6fb543db01f635227c7681ced4073109ba
    master date: 2021-03-12 17:01:52 +0100
---
 xen/arch/x86/apic.c                 |  2 +-
 xen/drivers/passthrough/vtd/iommu.c | 12 +++++++++++-
 xen/include/asm-x86/apic.h          |  1 +
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 60627fd6e6..4a2740ccea 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -46,7 +46,7 @@ static bool __read_mostly tdt_enabled;
 static bool __initdata tdt_enable = true;
 boolean_param("tdt", tdt_enable);
 
-static bool __read_mostly iommu_x2apic_enabled;
+bool __read_mostly iommu_x2apic_enabled;
 
 static struct {
     int active;
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 2a99cd208f..58128be8b5 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2121,7 +2121,7 @@ static int __must_check init_vtd_hw(void)
     u32 sts;
 
     /*
-     * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults.  
+     * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults, etc.
      */
     for_each_drhd_unit ( drhd )
     {
@@ -2131,6 +2131,16 @@ static int __must_check init_vtd_hw(void)
 
         clear_fault_bits(iommu);
 
+        /*
+         * Disable interrupt remapping and queued invalidation if
+         * already enabled by BIOS in case we've not initialized it yet.
+         */
+        if ( !iommu_x2apic_enabled )
+        {
+            disable_intremap(iommu);
+            disable_qinval(iommu);
+        }
+
         spin_lock_irqsave(&iommu->register_lock, flags);
         sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
         sts &= ~DMA_FECTL_IM;
diff --git a/xen/include/asm-x86/apic.h b/xen/include/asm-x86/apic.h
index 8ddb896ee9..2fe54bbf1c 100644
--- a/xen/include/asm-x86/apic.h
+++ b/xen/include/asm-x86/apic.h
@@ -24,6 +24,7 @@ enum apic_mode {
     APIC_MODE_X2APIC    /* x2APIC mode - common for large MP machines */
 };
 
+extern bool iommu_x2apic_enabled;
 extern u8 apic_verbosity;
 extern bool directed_eoi_enabled;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Mar 18 14:11:36 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Mar 2021 14:11:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99023.188059 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lMtNA-0006tN-TY; Thu, 18 Mar 2021 14:11:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99023.188059; Thu, 18 Mar 2021 14:11: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 1lMtNA-0006tF-QL; Thu, 18 Mar 2021 14:11:36 +0000
Received: by outflank-mailman (input) for mailman id 99023;
 Thu, 18 Mar 2021 14: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 1lMtN9-0006t5-Mc
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:11: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 1lMtN9-0001b0-Lr
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:11:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lMtN9-0001WN-KZ
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:11:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CoIexXlZeDG/z9MgIHBhAKSXiriglbNsG5/zgyk2RPI=; b=cHDhgpqgoWTyFH5GKCYzCg8c1O
	kI4HHIfmqmtZjS66+sKpKRuagz716fpR+hb51Gd21pxf6bRnMbdC4nuVG+/dvJ9i2/cpY3SpnLMnb
	muXj693jPF6Agj33Dokf/caKNn/pgvTbnER4G9cVKCVLGdUskwO6sZpmZoB6yR9X0zg0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] xen: fix for_each_cpu when NR_CPUS=1
Message-Id: <E1lMtN9-0001WN-KZ@xenbits.xenproject.org>
Date: Thu, 18 Mar 2021 14:11:35 +0000

commit 1d6fa27b6b003e3589e6cae2b6d2fc3f842e0a6d
Author:     Dario Faggioli <dfaggioli@suse.com>
AuthorDate: Thu Mar 18 15:02:43 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:02:43 2021 +0100

    xen: fix for_each_cpu when NR_CPUS=1
    
    When running an hypervisor build with NR_CPUS=1 for_each_cpu does not
    take into account whether the bit of the CPU is set or not in the
    provided mask.
    
    This means that whatever we have in the bodies of these loops is always
    done once, even if the mask was empty and it should never be done. This
    is clearly a bug and was in fact causing an assert to trigger in credit2
    code.
    
    Removing the special casing of NR_CPUS == 1 makes things work again.
    
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: aa50f45332f17e8d6308b996d890d3e83748a1a5
    master date: 2021-03-12 17:02:47 +0100
---
 xen/include/xen/cpumask.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/xen/include/xen/cpumask.h b/xen/include/xen/cpumask.h
index 256b60b106..e69589fc08 100644
--- a/xen/include/xen/cpumask.h
+++ b/xen/include/xen/cpumask.h
@@ -368,15 +368,10 @@ static inline void free_cpumask_var(cpumask_var_t mask)
 #define FREE_CPUMASK_VAR(m) free_cpumask_var(m)
 #endif
 
-#if NR_CPUS > 1
 #define for_each_cpu(cpu, mask)			\
 	for ((cpu) = cpumask_first(mask);	\
 	     (cpu) < nr_cpu_ids;		\
 	     (cpu) = cpumask_next(cpu, mask))
-#else /* NR_CPUS == 1 */
-#define for_each_cpu(cpu, mask)			\
-	for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)(mask))
-#endif /* NR_CPUS */
 
 /*
  * The following particular system cpumasks and operations manage
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Mar 18 14:11:46 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Mar 2021 14:11:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99024.188062 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lMtNK-0006ue-Uc; Thu, 18 Mar 2021 14:11:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99024.188062; Thu, 18 Mar 2021 14:11: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 1lMtNK-0006uX-Rq; Thu, 18 Mar 2021 14:11:46 +0000
Received: by outflank-mailman (input) for mailman id 99024;
 Thu, 18 Mar 2021 14:11: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 1lMtNJ-0006uN-Rt
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:11: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 1lMtNJ-0001b7-PI
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:11:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lMtNJ-0001X6-ON
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:11:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=drZtwtPgejOpZSN19KQmkLWfFxcGsv7DLJwGD+/FdhY=; b=KmDwZNfNGhtrVFMtLWJtNEVehD
	ycKTOQwbIlhk1+roKUFeNQPMjj0PGDtmgJTpjELnrkEpwyOamdBGxubhZaZCYA3S9eouEasX0VPbb
	mkf+xw/Ceq4qwzAkLQ6wURNBj/7EkyAtIT9IxBMfH0+hSjzkzb3tbKI2tbIwAqlK/khA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] libxl: Fix domain soft reset state handling
Message-Id: <E1lMtNJ-0001X6-ON@xenbits.xenproject.org>
Date: Thu, 18 Mar 2021 14:11:45 +0000

commit b0d7739f10dc93d9565220b4e79ebc6675548c02
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Mar 18 15:03:28 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:03:28 2021 +0100

    libxl: Fix domain soft reset state handling
    
    In do_domain_soft_reset(), a `libxl__domain_suspend_state' is used
    without been properly initialised and disposed of. This lead do a
    abort() in libxl due to the `dsps.qmp' state been used before been
    initialised:
        libxl__ev_qmp_send: Assertion `ev->state == qmp_state_disconnected || ev->state == qmp_state_connected' failed.
    
    Once initialised, `dsps' also needs to be disposed of as the `qmp'
    state might still be in the `Connected' state in the callback for
    libxl__domain_suspend_device_model(). So this patch adds
    libxl__domain_suspend_dispose() which can be called from the two
    places where we need to dispose of `dsps'.
    
    This is XSA-368.
    
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Tested-by: Olaf Hering <olaf@aepfle.de>
    master commit: dae3c3e8b257cd27d6b35a467a34bf79a6650340
    master date: 2021-03-18 14:56:33 +0100
---
 tools/libxl/libxl_create.c      | 11 ++++++++---
 tools/libxl/libxl_dom_suspend.c | 15 +++++++++++----
 tools/libxl/libxl_internal.h    |  2 ++
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 2814818e34..83b0eb00bf 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -2174,9 +2174,7 @@ static int do_domain_soft_reset(libxl_ctx *ctx,
     state->console_tty = libxl__strdup(gc, console_tty);
 
     dss->ao = ao;
-    dss->domid = dss->dsps.domid = domid;
-    dss->dsps.dm_savefile = GCSPRINTF(LIBXL_DEVICE_MODEL_SAVE_FILE".%d",
-                                      domid);
+    dss->domid = domid;
 
     rc = libxl__save_emulator_xenstore_data(dss, &srs->toolstack_buf,
                                             &srs->toolstack_len);
@@ -2186,6 +2184,11 @@ static int do_domain_soft_reset(libxl_ctx *ctx,
     }
 
     dss->dsps.ao = ao;
+    dss->dsps.domid = domid;
+    dss->dsps.live = false;
+    rc = libxl__domain_suspend_init(egc, &dss->dsps, d_config->b_info.type);
+    if (rc)
+        goto out;
     dss->dsps.callback_device_model_done = soft_reset_dm_suspended;
     libxl__domain_suspend_device_model(egc, &dss->dsps); /* must be last */
 
@@ -2204,6 +2207,8 @@ static void soft_reset_dm_suspended(libxl__egc *egc,
         CONTAINER_OF(dsps, *srs, dss.dsps);
     libxl__app_domain_create_state *cdcs = &srs->cdcs;
 
+    libxl__domain_suspend_dispose(gc, dsps);
+
     /*
      * Ask all backends to disconnect by removing the domain from
      * xenstore. On the creation path the domain will be introduced to
diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libxl/libxl_dom_suspend.c
index 25d1571895..2a280f69a1 100644
--- a/tools/libxl/libxl_dom_suspend.c
+++ b/tools/libxl/libxl_dom_suspend.c
@@ -67,6 +67,16 @@ out:
     return rc;
 }
 
+void libxl__domain_suspend_dispose(libxl__gc *gc,
+                                   libxl__domain_suspend_state  *dsps)
+{
+    libxl__xswait_stop(gc, &dsps->pvcontrol);
+    libxl__ev_evtchn_cancel(gc, &dsps->guest_evtchn);
+    libxl__ev_xswatch_deregister(gc, &dsps->guest_watch);
+    libxl__ev_time_deregister(gc, &dsps->guest_timeout);
+    libxl__ev_qmp_dispose(gc, &dsps->qmp);
+}
+
 /*----- callbacks, called by xc_domain_save -----*/
 
 void libxl__domain_suspend_device_model(libxl__egc *egc,
@@ -388,10 +398,7 @@ static void domain_suspend_common_done(libxl__egc *egc,
 {
     EGC_GC;
     assert(!libxl__xswait_inuse(&dsps->pvcontrol));
-    libxl__ev_evtchn_cancel(gc, &dsps->guest_evtchn);
-    libxl__ev_xswatch_deregister(gc, &dsps->guest_watch);
-    libxl__ev_time_deregister(gc, &dsps->guest_timeout);
-    libxl__ev_qmp_dispose(gc, &dsps->qmp);
+    libxl__domain_suspend_dispose(gc, dsps);
     dsps->callback_common_done(egc, dsps, rc);
 }
 
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 94a23179d3..3bc3bbcf84 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -3615,6 +3615,8 @@ struct libxl__domain_suspend_state {
 int libxl__domain_suspend_init(libxl__egc *egc,
                                libxl__domain_suspend_state *dsps,
                                libxl_domain_type type);
+void libxl__domain_suspend_dispose(libxl__gc *gc,
+                                   libxl__domain_suspend_state  *dsps);
 
 /* calls dsps->callback_device_model_done when done
  * may synchronously calls this callback */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Mar 18 14:11:58 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Mar 2021 14:11:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99025.188067 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lMtNW-0006wB-1z; Thu, 18 Mar 2021 14:11:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99025.188067; Thu, 18 Mar 2021 14:11: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 1lMtNV-0006w2-VC; Thu, 18 Mar 2021 14:11:57 +0000
Received: by outflank-mailman (input) for mailman id 99025;
 Thu, 18 Mar 2021 14: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 1lMtNU-0006vw-Ma
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14: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 1lMtNU-0001bH-Lm
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:11:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lMtNU-0001YP-Jx
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14: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=myl0pxzJFOP7RyKoE+X13GeZDAR+RBtNiPJ2aqYISzw=; b=4vN3mPHWWMv4Hd7BDrdbQQi6o0
	y4kCeIbOsaM6vMVF1t3ooLoratKJjxVysdZyf5Zn7Yuna8TLKKWZ2Nuc6QLZRDJrjd/gbcowx5HaY
	3etNS9pvzedaNflGDRy47CXoOhlxbyvuhW0BpcrOFGhUBtBcCtIsbLmcILU2/nyiKlZo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] crypto: adjust rijndaelEncrypt() prototype for gcc11
Message-Id: <E1lMtNU-0001YP-Jx@xenbits.xenproject.org>
Date: Thu, 18 Mar 2021 14:11:56 +0000

commit b127def25683a0d42c9c640bfda901fd2b3d5e0a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Mar 18 15:05:33 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:05:33 2021 +0100

    crypto: adjust rijndaelEncrypt() prototype for gcc11
    
    The upcoming release complains, not entirely unreasonably:
    
    In file included from rijndael.c:33:
    .../xen/include/crypto/rijndael.h:55:53: note: previously declared as 'const unsigned char[]'
       55 | void    rijndaelEncrypt(const unsigned int [], int, const unsigned char [],
          |                                                     ^~~~~~~~~~~~~~~~~~~~~~
    rijndael.c:865:8: error: argument 4 of type 'u8[16]' {aka 'unsigned char[16]'} with mismatched bound [-Werror=array-parameter=]
      865 |     u8 ct[16])
          |     ~~~^~~~~~
    In file included from rijndael.c:33:
    .../xen/include/crypto/rijndael.h:56:13: note: previously declared as 'unsigned char[]'
       56 |             unsigned char []);
          |             ^~~~~~~~~~~~~~~~
    
    Simply declare the correct array dimensions right away. This then allows
    compilers to apply checking at call sites, which seems desirable anyway.
    
    For the moment I'm leaving untouched the disagreement between u8/u32
    used in the function definition and unsigned {char,int} used in the
    declaration, as making this consistent would call for touching further
    functions.
    
    Reported-by: Charles Arnold <carnold@suse.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    master commit: c6ad5a701b9a6df443a6c98d9e7201c958bbcafc
    master date: 2021-03-04 16:47:51 +0100
---
 xen/include/crypto/rijndael.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/crypto/rijndael.h b/xen/include/crypto/rijndael.h
index 69965783c5..4386be5878 100644
--- a/xen/include/crypto/rijndael.h
+++ b/xen/include/crypto/rijndael.h
@@ -52,7 +52,7 @@ void	 rijndael_encrypt(rijndael_ctx *, const unsigned char *, unsigned char *);
 
 int	rijndaelKeySetupEnc(unsigned int [], const unsigned char [], int);
 int	rijndaelKeySetupDec(unsigned int [], const unsigned char [], int);
-void	rijndaelEncrypt(const unsigned int [], int, const unsigned char [],
-	    unsigned char []);
+void	rijndaelEncrypt(const unsigned int [], int, const unsigned char [16],
+	    unsigned char [16]);
 
 #endif /* __RIJNDAEL_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Mar 18 14:12:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Mar 2021 14:12:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99026.188071 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lMtNg-0006xQ-3j; Thu, 18 Mar 2021 14:12:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99026.188071; Thu, 18 Mar 2021 14:12: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 1lMtNg-0006xI-0i; Thu, 18 Mar 2021 14:12:08 +0000
Received: by outflank-mailman (input) for mailman id 99026;
 Thu, 18 Mar 2021 14: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 1lMtNe-0006x7-Qb
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14: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 1lMtNe-0001bf-Pj
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:12:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lMtNe-0001ZE-Oh
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14: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=Yg0wID5WAwMk3eI+MZNd4qPO4NbGyUaDVAZyX8Ts+/8=; b=HqEvHSPquxxlWmQB1N7CKJZBE+
	1YnRpdo8/O/N+LTn9KGVTJukMgecc2wosM4+jor7FqdtDErwK7LoAaTOOAbS2XVAxLDcZJjzdFwPI
	9ItU0l3tYvJuQtEOU2jRbifYGMjvcktZHtt+eqHL6Juzg+bee1Y0NdGRqShdTENGN8wA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/shadow: suppress "fast fault path" optimization without reserved bits
Message-Id: <E1lMtNe-0001ZE-Oh@xenbits.xenproject.org>
Date: Thu, 18 Mar 2021 14:12:06 +0000

commit d4ac369247dae56642c60cbd5aea3c3504069977
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Mar 18 15:06:12 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:06:12 2021 +0100

    x86/shadow: suppress "fast fault path" optimization without reserved bits
    
    When none of the physical address bits in PTEs are reserved, we can't
    create any 4k (leaf) PTEs which would trigger reserved bit faults. Hence
    the present SHOPT_FAST_FAULT_PATH machinery needs to be suppressed in
    this case, which is most easily achieved by never creating any magic
    entries.
    
    To compensate a little, eliminate sh_write_p2m_entry_post()'s impact on
    such hardware.
    
    While at it, also avoid using an MMIO magic entry when that would
    truncate the incoming GFN.
    
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    
    x86/shadow: suppress "fast fault path" optimization when running virtualized
    
    We can't make correctness of our own behavior dependent upon a
    hypervisor underneath us correctly telling us the true physical address
    with hardware uses. Without knowing this, we can't be certain reserved
    bit faults can actually be observed. Therefore, besides evaluating the
    number of address bits when deciding whether to use the optimization,
    also check whether we're running virtualized ourselves. (Note that since
    we may get migrated when running virtualized, the number of address bits
    may also change.)
    
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 9318fdf757ec234f0ee6c5cd381326b2f581d065
    master date: 2021-03-05 13:29:28 +0100
    master commit: 60c0444fae2148452f9ed0b7c49af1fa41f8f522
    master date: 2021-03-08 10:41:50 +0100
---
 xen/arch/x86/mm/shadow/multi.c |  3 ++-
 xen/arch/x86/mm/shadow/types.h | 34 ++++++++++++++++++++++++++++------
 2 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 26798b317c..61e9cc951e 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -520,7 +520,8 @@ _sh_propagate(struct vcpu *v,
     {
         /* Guest l1e maps emulated MMIO space */
         *sp = sh_l1e_mmio(target_gfn, gflags);
-        d->arch.paging.shadow.has_fast_mmio_entries = true;
+        if ( sh_l1e_is_magic(*sp) )
+            d->arch.paging.shadow.has_fast_mmio_entries = true;
         goto done;
     }
 
diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index d5096748ac..71d8c322ad 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -290,24 +290,41 @@ void sh_destroy_monitor_table(struct vcpu *v, mfn_t mmfn);
  * pagetables.
  *
  * This is only feasible for PAE and 64bit Xen: 32-bit non-PAE PTEs don't
- * have reserved bits that we can use for this.
+ * have reserved bits that we can use for this.  And even there it can only
+ * be used if we can be certain the processor doesn't use all 52 address bits.
  */
 
 #define SH_L1E_MAGIC 0xffffffff00000001ULL
+
+static inline bool sh_have_pte_rsvd_bits(void)
+{
+    return paddr_bits < PADDR_BITS && !cpu_has_hypervisor;
+}
+
 static inline bool sh_l1e_is_magic(shadow_l1e_t sl1e)
 {
     return (sl1e.l1 & SH_L1E_MAGIC) == SH_L1E_MAGIC;
 }
 
 /* Guest not present: a single magic value */
-static inline shadow_l1e_t sh_l1e_gnp(void)
+static inline shadow_l1e_t sh_l1e_gnp_raw(void)
 {
     return (shadow_l1e_t){ -1ULL };
 }
 
+static inline shadow_l1e_t sh_l1e_gnp(void)
+{
+    /*
+     * On systems with no reserved physical address bits we can't engage the
+     * fast fault path.
+     */
+    return sh_have_pte_rsvd_bits() ? sh_l1e_gnp_raw()
+                                   : shadow_l1e_empty();
+}
+
 static inline bool sh_l1e_is_gnp(shadow_l1e_t sl1e)
 {
-    return sl1e.l1 == sh_l1e_gnp().l1;
+    return sl1e.l1 == sh_l1e_gnp_raw().l1;
 }
 
 /*
@@ -322,9 +339,14 @@ static inline bool sh_l1e_is_gnp(shadow_l1e_t sl1e)
 
 static inline shadow_l1e_t sh_l1e_mmio(gfn_t gfn, u32 gflags)
 {
-    return (shadow_l1e_t) { (SH_L1E_MMIO_MAGIC
-                             | MASK_INSR(gfn_x(gfn), SH_L1E_MMIO_GFN_MASK)
-                             | (gflags & (_PAGE_USER|_PAGE_RW))) };
+    unsigned long gfn_val = MASK_INSR(gfn_x(gfn), SH_L1E_MMIO_GFN_MASK);
+
+    if ( !sh_have_pte_rsvd_bits() ||
+         gfn_x(gfn) != MASK_EXTR(gfn_val, SH_L1E_MMIO_GFN_MASK) )
+        return shadow_l1e_empty();
+
+    return (shadow_l1e_t) { (SH_L1E_MMIO_MAGIC | gfn_val |
+                             (gflags & (_PAGE_USER | _PAGE_RW))) };
 }
 
 static inline bool sh_l1e_is_mmio(shadow_l1e_t sl1e)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Mar 18 14:12:18 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Mar 2021 14:12:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99027.188074 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lMtNq-0006yg-56; Thu, 18 Mar 2021 14:12:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99027.188074; Thu, 18 Mar 2021 14:12: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 1lMtNq-0006yY-2G; Thu, 18 Mar 2021 14:12:18 +0000
Received: by outflank-mailman (input) for mailman id 99027;
 Thu, 18 Mar 2021 14: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 1lMtNo-0006yQ-Tn
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14: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 1lMtNo-0001bl-T0
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:12:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lMtNo-0001Zl-S9
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:12:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UNvBn+Cs2QiHgeK+/LVytwb6ntpkOb4jUcWeCqkLGMM=; b=PIKvzD6DqhWna6chIYHkyvkkGn
	hXnqs3ziBFMbA62TE7SUIHdBtmT/pNWPvR/wx5djGfIEK7AVBmVTafDMlirdUHaRf3pp+Z/fwd9cr
	xAWCawQY/oiswGXhpjqh3cnfNn2+XMxu1fmCEk0GtspssNsnCeLm7+bJofwQhr/QzODk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] vtd: make sure QI/IR are disabled before initialisation
Message-Id: <E1lMtNo-0001Zl-S9@xenbits.xenproject.org>
Date: Thu, 18 Mar 2021 14:12:16 +0000

commit c2aaebbbc4521685bf88fb9cfff8c006fcb821af
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Thu Mar 18 15:06:47 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:06:47 2021 +0100

    vtd: make sure QI/IR are disabled before initialisation
    
    BIOS might pass control to Xen leaving QI and/or IR in enabled and/or
    partially configured state. In case of x2APIC code path where EIM is
    enabled early in boot - those are correctly disabled by Xen before any
    attempt to configure. But for xAPIC that step is missing which was
    proven to cause QI initialization failures on some ICX based platforms
    where QI is left pre-enabled and partially configured by BIOS. That
    problem becomes hard to avoid since those platforms are shipped with
    x2APIC opt out being advertised by default at the same time by firmware.
    
    Unify the behaviour between x2APIC and xAPIC code paths keeping that in
    line with what Linux does.
    
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 04181c6fb543db01f635227c7681ced4073109ba
    master date: 2021-03-12 17:01:52 +0100
---
 xen/drivers/passthrough/vtd/iommu.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 1e61e93d3f..61ba9b496b 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2118,7 +2118,7 @@ static int __must_check init_vtd_hw(void)
     u32 sts;
 
     /*
-     * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults.  
+     * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults, etc.
      */
     for_each_drhd_unit ( drhd )
     {
@@ -2128,6 +2128,16 @@ static int __must_check init_vtd_hw(void)
 
         clear_fault_bits(iommu);
 
+        /*
+         * Disable interrupt remapping and queued invalidation if
+         * already enabled by BIOS in case we've not initialized it yet.
+         */
+        if ( !x2apic_enabled )
+        {
+            disable_intremap(iommu);
+            disable_qinval(iommu);
+        }
+
         spin_lock_irqsave(&iommu->register_lock, flags);
         sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
         sts &= ~DMA_FECTL_IM;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Mar 18 14:12:28 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Mar 2021 14:12:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99028.188079 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lMtO0-00070E-71; Thu, 18 Mar 2021 14:12:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99028.188079; Thu, 18 Mar 2021 14:12: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 1lMtO0-000706-3i; Thu, 18 Mar 2021 14:12:28 +0000
Received: by outflank-mailman (input) for mailman id 99028;
 Thu, 18 Mar 2021 14:12: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 1lMtNz-0006zw-0q
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:12: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 1lMtNz-0001bt-05
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:12:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lMtNy-0001aS-VM
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:12:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9sjjroDfeYMyM12tXvHwJIeUlOAwK5e/Gf3qA6SSpsY=; b=oMZtINFTV9sc5mBjWAKdbjVLsZ
	o3S5+A/BOZAPy/qa3V87mMvmy2AQ1N0xGlZS2dkCD/U7VKDhYcKY+6thigCzp6SbpVerr34UO5/vr
	VIzeQcaTyM+yWgRD1YAAKQgo45bLEiGXVgE+Ys5ajU2/YF6N45D8zhaOthUx7MQLHXqc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] xen: fix for_each_cpu when NR_CPUS=1
Message-Id: <E1lMtNy-0001aS-VM@xenbits.xenproject.org>
Date: Thu, 18 Mar 2021 14:12:26 +0000

commit 520d3b804f52147073f2ca890e6f588f39396990
Author:     Dario Faggioli <dfaggioli@suse.com>
AuthorDate: Thu Mar 18 15:07:17 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:07:17 2021 +0100

    xen: fix for_each_cpu when NR_CPUS=1
    
    When running an hypervisor build with NR_CPUS=1 for_each_cpu does not
    take into account whether the bit of the CPU is set or not in the
    provided mask.
    
    This means that whatever we have in the bodies of these loops is always
    done once, even if the mask was empty and it should never be done. This
    is clearly a bug and was in fact causing an assert to trigger in credit2
    code.
    
    Removing the special casing of NR_CPUS == 1 makes things work again.
    
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: aa50f45332f17e8d6308b996d890d3e83748a1a5
    master date: 2021-03-12 17:02:47 +0100
---
 xen/include/xen/cpumask.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/xen/include/xen/cpumask.h b/xen/include/xen/cpumask.h
index 256b60b106..e69589fc08 100644
--- a/xen/include/xen/cpumask.h
+++ b/xen/include/xen/cpumask.h
@@ -368,15 +368,10 @@ static inline void free_cpumask_var(cpumask_var_t mask)
 #define FREE_CPUMASK_VAR(m) free_cpumask_var(m)
 #endif
 
-#if NR_CPUS > 1
 #define for_each_cpu(cpu, mask)			\
 	for ((cpu) = cpumask_first(mask);	\
 	     (cpu) < nr_cpu_ids;		\
 	     (cpu) = cpumask_next(cpu, mask))
-#else /* NR_CPUS == 1 */
-#define for_each_cpu(cpu, mask)			\
-	for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)(mask))
-#endif /* NR_CPUS */
 
 /*
  * The following particular system cpumasks and operations manage
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Mar 18 14:12:38 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Mar 2021 14:12:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99029.188083 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lMtOA-00071U-8T; Thu, 18 Mar 2021 14:12:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99029.188083; Thu, 18 Mar 2021 14:12: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 1lMtOA-00071L-57; Thu, 18 Mar 2021 14:12:38 +0000
Received: by outflank-mailman (input) for mailman id 99029;
 Thu, 18 Mar 2021 14:12: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 1lMtO9-00071D-4V
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:12: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 1lMtO9-0001cP-3n
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:12:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lMtO9-0001az-2v
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:12: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=LNiksrLfNuQUGBpMjokseeV7UbzPwga0JDkk9p7RNWA=; b=ZDIANH9Xj0UxmRk8jWoGlTsbiN
	pOgA6hBXPg2Sfy0XxO2Xg7+Ghr8jUb0AwXOSlBd+JN9rpIJZ303g05AY08vHql5X3S72B0ap4S8si
	HK4L5rEELXQTEKTkuAtqXeceIwTsz/awbESzPka3PuFGGYQins7QstocJLuEjOCafysI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] libxl: Fix domain soft reset state handling
Message-Id: <E1lMtO9-0001az-2v@xenbits.xenproject.org>
Date: Thu, 18 Mar 2021 14:12:37 +0000

commit 4547f01640f43ab04458da0f75854b3377ae4dbd
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Mar 18 15:07:59 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:07:59 2021 +0100

    libxl: Fix domain soft reset state handling
    
    In do_domain_soft_reset(), a `libxl__domain_suspend_state' is used
    without been properly initialised and disposed of. This lead do a
    abort() in libxl due to the `dsps.qmp' state been used before been
    initialised:
        libxl__ev_qmp_send: Assertion `ev->state == qmp_state_disconnected || ev->state == qmp_state_connected' failed.
    
    Once initialised, `dsps' also needs to be disposed of as the `qmp'
    state might still be in the `Connected' state in the callback for
    libxl__domain_suspend_device_model(). So this patch adds
    libxl__domain_suspend_dispose() which can be called from the two
    places where we need to dispose of `dsps'.
    
    This is XSA-368.
    
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Tested-by: Olaf Hering <olaf@aepfle.de>
    master commit: dae3c3e8b257cd27d6b35a467a34bf79a6650340
    master date: 2021-03-18 14:56:33 +0100
---
 tools/libxl/libxl_create.c      | 11 ++++++++---
 tools/libxl/libxl_dom_suspend.c | 15 +++++++++++----
 tools/libxl/libxl_internal.h    |  2 ++
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 32d45dcef0..651ad18d2d 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -1974,9 +1974,7 @@ static int do_domain_soft_reset(libxl_ctx *ctx,
     state->console_tty = libxl__strdup(gc, console_tty);
 
     dss->ao = ao;
-    dss->domid = dss->dsps.domid = domid_soft_reset;
-    dss->dsps.dm_savefile = GCSPRINTF(LIBXL_DEVICE_MODEL_SAVE_FILE".%d",
-                                      domid_soft_reset);
+    dss->domid = domid_soft_reset;
 
     rc = libxl__save_emulator_xenstore_data(dss, &srs->toolstack_buf,
                                             &srs->toolstack_len);
@@ -1986,6 +1984,11 @@ static int do_domain_soft_reset(libxl_ctx *ctx,
     }
 
     dss->dsps.ao = ao;
+    dss->dsps.domid = domid_soft_reset;
+    dss->dsps.live = false;
+    rc = libxl__domain_suspend_init(egc, &dss->dsps, d_config->b_info.type);
+    if (rc)
+        goto out;
     dss->dsps.callback_device_model_done = soft_reset_dm_suspended;
     libxl__domain_suspend_device_model(egc, &dss->dsps); /* must be last */
 
@@ -2004,6 +2007,8 @@ static void soft_reset_dm_suspended(libxl__egc *egc,
         CONTAINER_OF(dsps, *srs, dss.dsps);
     libxl__app_domain_create_state *cdcs = &srs->cdcs;
 
+    libxl__domain_suspend_dispose(gc, dsps);
+
     /*
      * Ask all backends to disconnect by removing the domain from
      * xenstore. On the creation path the domain will be introduced to
diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libxl/libxl_dom_suspend.c
index 25d1571895..2a280f69a1 100644
--- a/tools/libxl/libxl_dom_suspend.c
+++ b/tools/libxl/libxl_dom_suspend.c
@@ -67,6 +67,16 @@ out:
     return rc;
 }
 
+void libxl__domain_suspend_dispose(libxl__gc *gc,
+                                   libxl__domain_suspend_state  *dsps)
+{
+    libxl__xswait_stop(gc, &dsps->pvcontrol);
+    libxl__ev_evtchn_cancel(gc, &dsps->guest_evtchn);
+    libxl__ev_xswatch_deregister(gc, &dsps->guest_watch);
+    libxl__ev_time_deregister(gc, &dsps->guest_timeout);
+    libxl__ev_qmp_dispose(gc, &dsps->qmp);
+}
+
 /*----- callbacks, called by xc_domain_save -----*/
 
 void libxl__domain_suspend_device_model(libxl__egc *egc,
@@ -388,10 +398,7 @@ static void domain_suspend_common_done(libxl__egc *egc,
 {
     EGC_GC;
     assert(!libxl__xswait_inuse(&dsps->pvcontrol));
-    libxl__ev_evtchn_cancel(gc, &dsps->guest_evtchn);
-    libxl__ev_xswatch_deregister(gc, &dsps->guest_watch);
-    libxl__ev_time_deregister(gc, &dsps->guest_timeout);
-    libxl__ev_qmp_dispose(gc, &dsps->qmp);
+    libxl__domain_suspend_dispose(gc, dsps);
     dsps->callback_common_done(egc, dsps, rc);
 }
 
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 247518a7ac..5b4795908b 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -3569,6 +3569,8 @@ struct libxl__domain_suspend_state {
 int libxl__domain_suspend_init(libxl__egc *egc,
                                libxl__domain_suspend_state *dsps,
                                libxl_domain_type type);
+void libxl__domain_suspend_dispose(libxl__gc *gc,
+                                   libxl__domain_suspend_state  *dsps);
 
 /* calls dsps->callback_device_model_done when done
  * may synchronously calls this callback */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Mar 18 14:12:49 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Mar 2021 14:12:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99030.188087 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lMtOL-00072m-9h; Thu, 18 Mar 2021 14:12:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99030.188087; Thu, 18 Mar 2021 14:12:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lMtOL-00072e-6e; Thu, 18 Mar 2021 14:12:49 +0000
Received: by outflank-mailman (input) for mailman id 99030;
 Thu, 18 Mar 2021 14:12: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 1lMtOK-00072V-0d
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:12: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 1lMtOJ-0001cW-W6
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:12:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lMtOJ-0001bw-VF
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:12:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=z+mNGU6ilH3dSZsuxf8ARS8dYG8N4D14O0qCH+75DIo=; b=S3ETypTS0aErB3j5Npf0/zJAvO
	HYVsaoLhbq/YNrUn5kQrj83/oOztIGIYQT+FVOVIRWhrDfBeBU044RYa9B1RrNo1EE6SqvWKmOGmU
	bW9ipVYEkbh0d+5db2LLpvOAcbDsG4Oq+3Ekmof0mC1AA7mMwqH4ajMZYKN6LMtvTGlQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] crypto: adjust rijndaelEncrypt() prototype for gcc11
Message-Id: <E1lMtOJ-0001bw-VF@xenbits.xenproject.org>
Date: Thu, 18 Mar 2021 14:12:47 +0000

commit 70c53eaf596ef34c202257418e6684803cd96a4c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Mar 18 15:09:38 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:09:38 2021 +0100

    crypto: adjust rijndaelEncrypt() prototype for gcc11
    
    The upcoming release complains, not entirely unreasonably:
    
    In file included from rijndael.c:33:
    .../xen/include/crypto/rijndael.h:55:53: note: previously declared as 'const unsigned char[]'
       55 | void    rijndaelEncrypt(const unsigned int [], int, const unsigned char [],
          |                                                     ^~~~~~~~~~~~~~~~~~~~~~
    rijndael.c:865:8: error: argument 4 of type 'u8[16]' {aka 'unsigned char[16]'} with mismatched bound [-Werror=array-parameter=]
      865 |     u8 ct[16])
          |     ~~~^~~~~~
    In file included from rijndael.c:33:
    .../xen/include/crypto/rijndael.h:56:13: note: previously declared as 'unsigned char[]'
       56 |             unsigned char []);
          |             ^~~~~~~~~~~~~~~~
    
    Simply declare the correct array dimensions right away. This then allows
    compilers to apply checking at call sites, which seems desirable anyway.
    
    For the moment I'm leaving untouched the disagreement between u8/u32
    used in the function definition and unsigned {char,int} used in the
    declaration, as making this consistent would call for touching further
    functions.
    
    Reported-by: Charles Arnold <carnold@suse.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    master commit: c6ad5a701b9a6df443a6c98d9e7201c958bbcafc
    master date: 2021-03-04 16:47:51 +0100
---
 xen/include/crypto/rijndael.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/crypto/rijndael.h b/xen/include/crypto/rijndael.h
index 69965783c5..4386be5878 100644
--- a/xen/include/crypto/rijndael.h
+++ b/xen/include/crypto/rijndael.h
@@ -52,7 +52,7 @@ void	 rijndael_encrypt(rijndael_ctx *, const unsigned char *, unsigned char *);
 
 int	rijndaelKeySetupEnc(unsigned int [], const unsigned char [], int);
 int	rijndaelKeySetupDec(unsigned int [], const unsigned char [], int);
-void	rijndaelEncrypt(const unsigned int [], int, const unsigned char [],
-	    unsigned char []);
+void	rijndaelEncrypt(const unsigned int [], int, const unsigned char [16],
+	    unsigned char [16]);
 
 #endif /* __RIJNDAEL_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Thu Mar 18 14:12:59 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Mar 2021 14:12:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99031.188091 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lMtOV-00074C-Cr; Thu, 18 Mar 2021 14:12:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99031.188091; Thu, 18 Mar 2021 14:12: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 1lMtOV-000744-9V; Thu, 18 Mar 2021 14:12:59 +0000
Received: by outflank-mailman (input) for mailman id 99031;
 Thu, 18 Mar 2021 14:12: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 1lMtOU-00073y-4F
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:12: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 1lMtOU-0001cg-3b
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:12:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lMtOU-0001cp-2i
 for xen-changelog@lists.xenproject.org; Thu, 18 Mar 2021 14:12:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=57eVmxbSixM3j7I1gJkNGWlY+uwdETqjnquon84tOm0=; b=wy03tjtlDatlM8IQAyrrhGVBZw
	gY9FkUFgwoysJ3GuAQrcMFuDzRSJQ2WYt5qqhDOwHIitKSuY+8N2GNaIhailIhdfNAqi4zlhAFxpf
	9dEVLklZMM7b3EZol/pF/bT3Vjyu6dxjwGTXlr9yXrapa0GGMJUhJAyQ08CoRn96cjlA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] libxl: Fix domain soft reset state handling
Message-Id: <E1lMtOU-0001cp-2i@xenbits.xenproject.org>
Date: Thu, 18 Mar 2021 14:12:58 +0000

commit b8737d236e525315504fc7b271de21101288d67f
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Mar 18 15:10:37 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:10:37 2021 +0100

    libxl: Fix domain soft reset state handling
    
    In do_domain_soft_reset(), a `libxl__domain_suspend_state' is used
    without been properly initialised and disposed of. This lead do a
    abort() in libxl due to the `dsps.qmp' state been used before been
    initialised:
        libxl__ev_qmp_send: Assertion `ev->state == qmp_state_disconnected || ev->state == qmp_state_connected' failed.
    
    Once initialised, `dsps' also needs to be disposed of as the `qmp'
    state might still be in the `Connected' state in the callback for
    libxl__domain_suspend_device_model(). So this patch adds
    libxl__domain_suspend_dispose() which can be called from the two
    places where we need to dispose of `dsps'.
    
    This is XSA-368.
    
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Tested-by: Olaf Hering <olaf@aepfle.de>
    master commit: dae3c3e8b257cd27d6b35a467a34bf79a6650340
    master date: 2021-03-18 14:56:33 +0100
---
 tools/libxl/libxl_create.c      | 11 ++++++++---
 tools/libxl/libxl_dom_suspend.c | 15 +++++++++++----
 tools/libxl/libxl_internal.h    |  2 ++
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index a4e74a5cd2..f436a967aa 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -1848,9 +1848,7 @@ static int do_domain_soft_reset(libxl_ctx *ctx,
     state->console_tty = libxl__strdup(gc, console_tty);
 
     dss->ao = ao;
-    dss->domid = dss->dsps.domid = domid_soft_reset;
-    dss->dsps.dm_savefile = GCSPRINTF(LIBXL_DEVICE_MODEL_SAVE_FILE".%d",
-                                      domid_soft_reset);
+    dss->domid = domid_soft_reset;
 
     rc = libxl__save_emulator_xenstore_data(dss, &srs->toolstack_buf,
                                             &srs->toolstack_len);
@@ -1860,6 +1858,11 @@ static int do_domain_soft_reset(libxl_ctx *ctx,
     }
 
     dss->dsps.ao = ao;
+    dss->dsps.domid = domid_soft_reset;
+    dss->dsps.live = false;
+    rc = libxl__domain_suspend_init(egc, &dss->dsps, d_config->b_info.type);
+    if (rc)
+        goto out;
     dss->dsps.callback_device_model_done = soft_reset_dm_suspended;
     libxl__domain_suspend_device_model(egc, &dss->dsps); /* must be last */
 
@@ -1878,6 +1881,8 @@ static void soft_reset_dm_suspended(libxl__egc *egc,
         CONTAINER_OF(dsps, *srs, dss.dsps);
     libxl__app_domain_create_state *cdcs = &srs->cdcs;
 
+    libxl__domain_suspend_dispose(gc, dsps);
+
     /*
      * Ask all backends to disconnect by removing the domain from
      * xenstore. On the creation path the domain will be introduced to
diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libxl/libxl_dom_suspend.c
index d1af3a6573..8e7c3464ae 100644
--- a/tools/libxl/libxl_dom_suspend.c
+++ b/tools/libxl/libxl_dom_suspend.c
@@ -67,6 +67,16 @@ out:
     return rc;
 }
 
+void libxl__domain_suspend_dispose(libxl__gc *gc,
+                                   libxl__domain_suspend_state  *dsps)
+{
+    libxl__xswait_stop(gc, &dsps->pvcontrol);
+    libxl__ev_evtchn_cancel(gc, &dsps->guest_evtchn);
+    libxl__ev_xswatch_deregister(gc, &dsps->guest_watch);
+    libxl__ev_time_deregister(gc, &dsps->guest_timeout);
+    libxl__ev_qmp_dispose(gc, &dsps->qmp);
+}
+
 /*----- callbacks, called by xc_domain_save -----*/
 
 void libxl__domain_suspend_device_model(libxl__egc *egc,
@@ -393,10 +403,7 @@ static void domain_suspend_common_done(libxl__egc *egc,
 {
     EGC_GC;
     assert(!libxl__xswait_inuse(&dsps->pvcontrol));
-    libxl__ev_evtchn_cancel(gc, &dsps->guest_evtchn);
-    libxl__ev_xswatch_deregister(gc, &dsps->guest_watch);
-    libxl__ev_time_deregister(gc, &dsps->guest_timeout);
-    libxl__ev_qmp_dispose(gc, &dsps->qmp);
+    libxl__domain_suspend_dispose(gc, dsps);
     dsps->callback_common_done(egc, dsps, rc);
 }
 
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index a119de7136..6e1caff2c3 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -3443,6 +3443,8 @@ struct libxl__domain_suspend_state {
 int libxl__domain_suspend_init(libxl__egc *egc,
                                libxl__domain_suspend_state *dsps,
                                libxl_domain_type type);
+void libxl__domain_suspend_dispose(libxl__gc *gc,
+                                   libxl__domain_suspend_state  *dsps);
 
 /* calls dsps->callback_device_model_done when done
  * may synchronously calls this callback */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 05:55:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 05:55:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99117.188278 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lN86B-0005Go-V9; Fri, 19 Mar 2021 05:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99117.188278; Fri, 19 Mar 2021 05: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 1lN86B-0005Gf-Re; Fri, 19 Mar 2021 05:55:03 +0000
Received: by outflank-mailman (input) for mailman id 99117;
 Fri, 19 Mar 2021 05: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 1lN86A-0005Ga-MB
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 05: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 1lN86A-00044t-I8
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 05:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lN86A-0005Ex-GO
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 05: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=HdGZt7kBMrQeVdy5DvgGiUR5r7VTzIAC2jo2Ws5K3PM=; b=JrtVAcdP3arh2Ju8vgyG1YRBv1
	Thd0+Av+iLhn92I4FdPwYbqjA+5UZyTCkK39EB/bTTc44okRQkL+qBykTNfsKhR8bR33eeewF+PVM
	878XuWCY2uDaC31FUfI4n2lFFFzYjTP+YZ3lkZUlL+3h/UvWN93g1R3F2jTUCLyx6sjg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] crypto: adjust rijndaelEncrypt() prototype for gcc11
Message-Id: <E1lN86A-0005Ex-GO@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 05:55:02 +0000

commit 576844d1b677000ab0eb557247075a05f9aafec8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Mar 18 15:01:04 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:01:04 2021 +0100

    crypto: adjust rijndaelEncrypt() prototype for gcc11
    
    The upcoming release complains, not entirely unreasonably:
    
    In file included from rijndael.c:33:
    .../xen/include/crypto/rijndael.h:55:53: note: previously declared as 'const unsigned char[]'
       55 | void    rijndaelEncrypt(const unsigned int [], int, const unsigned char [],
          |                                                     ^~~~~~~~~~~~~~~~~~~~~~
    rijndael.c:865:8: error: argument 4 of type 'u8[16]' {aka 'unsigned char[16]'} with mismatched bound [-Werror=array-parameter=]
      865 |     u8 ct[16])
          |     ~~~^~~~~~
    In file included from rijndael.c:33:
    .../xen/include/crypto/rijndael.h:56:13: note: previously declared as 'unsigned char[]'
       56 |             unsigned char []);
          |             ^~~~~~~~~~~~~~~~
    
    Simply declare the correct array dimensions right away. This then allows
    compilers to apply checking at call sites, which seems desirable anyway.
    
    For the moment I'm leaving untouched the disagreement between u8/u32
    used in the function definition and unsigned {char,int} used in the
    declaration, as making this consistent would call for touching further
    functions.
    
    Reported-by: Charles Arnold <carnold@suse.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    master commit: c6ad5a701b9a6df443a6c98d9e7201c958bbcafc
    master date: 2021-03-04 16:47:51 +0100
---
 xen/include/crypto/rijndael.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/crypto/rijndael.h b/xen/include/crypto/rijndael.h
index 69965783c5..4386be5878 100644
--- a/xen/include/crypto/rijndael.h
+++ b/xen/include/crypto/rijndael.h
@@ -52,7 +52,7 @@ void	 rijndael_encrypt(rijndael_ctx *, const unsigned char *, unsigned char *);
 
 int	rijndaelKeySetupEnc(unsigned int [], const unsigned char [], int);
 int	rijndaelKeySetupDec(unsigned int [], const unsigned char [], int);
-void	rijndaelEncrypt(const unsigned int [], int, const unsigned char [],
-	    unsigned char []);
+void	rijndaelEncrypt(const unsigned int [], int, const unsigned char [16],
+	    unsigned char [16]);
 
 #endif /* __RIJNDAEL_H */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 05:55:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 05:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99118.188282 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lN86M-0005HU-0K; Fri, 19 Mar 2021 05:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99118.188282; Fri, 19 Mar 2021 05: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 1lN86L-0005HL-TS; Fri, 19 Mar 2021 05:55:13 +0000
Received: by outflank-mailman (input) for mailman id 99118;
 Fri, 19 Mar 2021 05: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 1lN86K-0005HG-RU
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 05: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 1lN86K-000450-Nd
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 05:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lN86K-0005FT-Kf
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 05: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=g10fXMLgRktiXvs1osjNR4COq/k/3njBhvUhHaZHr/I=; b=DrYLWg+ZRxjY7xrHVfJJeOLoGR
	bwolHAJrR6fo7huVSS3+UojrCgcec/AObNCPB3EmMRHD/Id1aM36WQT63SUJ4roAsyXUj9Mz67TDD
	KQXupDepua1TT0BiMgBspCu0GeI73gJQ9MzHk8CbN26eKllTrc/WBJXkoekcNyaCMZcA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/shadow: suppress "fast fault path" optimization without reserved bits
Message-Id: <E1lN86K-0005FT-Kf@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 05:55:12 +0000

commit e7654716903461792d271ca3feab244827b970bd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Mar 18 15:01:50 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:01:50 2021 +0100

    x86/shadow: suppress "fast fault path" optimization without reserved bits
    
    When none of the physical address bits in PTEs are reserved, we can't
    create any 4k (leaf) PTEs which would trigger reserved bit faults. Hence
    the present SHOPT_FAST_FAULT_PATH machinery needs to be suppressed in
    this case, which is most easily achieved by never creating any magic
    entries.
    
    To compensate a little, eliminate sh_write_p2m_entry_post()'s impact on
    such hardware.
    
    While at it, also avoid using an MMIO magic entry when that would
    truncate the incoming GFN.
    
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    
    x86/shadow: suppress "fast fault path" optimization when running virtualized
    
    We can't make correctness of our own behavior dependent upon a
    hypervisor underneath us correctly telling us the true physical address
    with hardware uses. Without knowing this, we can't be certain reserved
    bit faults can actually be observed. Therefore, besides evaluating the
    number of address bits when deciding whether to use the optimization,
    also check whether we're running virtualized ourselves. (Note that since
    we may get migrated when running virtualized, the number of address bits
    may also change.)
    
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 9318fdf757ec234f0ee6c5cd381326b2f581d065
    master date: 2021-03-05 13:29:28 +0100
    master commit: 60c0444fae2148452f9ed0b7c49af1fa41f8f522
    master date: 2021-03-08 10:41:50 +0100
---
 xen/arch/x86/mm/shadow/multi.c |  3 ++-
 xen/arch/x86/mm/shadow/types.h | 34 ++++++++++++++++++++++++++++------
 2 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 7d16d1c1a9..99e410d999 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -530,7 +530,8 @@ _sh_propagate(struct vcpu *v,
     {
         /* Guest l1e maps emulated MMIO space */
         *sp = sh_l1e_mmio(target_gfn, gflags);
-        d->arch.paging.shadow.has_fast_mmio_entries = true;
+        if ( sh_l1e_is_magic(*sp) )
+            d->arch.paging.shadow.has_fast_mmio_entries = true;
         goto done;
     }
 
diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index d5096748ac..71d8c322ad 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -290,24 +290,41 @@ void sh_destroy_monitor_table(struct vcpu *v, mfn_t mmfn);
  * pagetables.
  *
  * This is only feasible for PAE and 64bit Xen: 32-bit non-PAE PTEs don't
- * have reserved bits that we can use for this.
+ * have reserved bits that we can use for this.  And even there it can only
+ * be used if we can be certain the processor doesn't use all 52 address bits.
  */
 
 #define SH_L1E_MAGIC 0xffffffff00000001ULL
+
+static inline bool sh_have_pte_rsvd_bits(void)
+{
+    return paddr_bits < PADDR_BITS && !cpu_has_hypervisor;
+}
+
 static inline bool sh_l1e_is_magic(shadow_l1e_t sl1e)
 {
     return (sl1e.l1 & SH_L1E_MAGIC) == SH_L1E_MAGIC;
 }
 
 /* Guest not present: a single magic value */
-static inline shadow_l1e_t sh_l1e_gnp(void)
+static inline shadow_l1e_t sh_l1e_gnp_raw(void)
 {
     return (shadow_l1e_t){ -1ULL };
 }
 
+static inline shadow_l1e_t sh_l1e_gnp(void)
+{
+    /*
+     * On systems with no reserved physical address bits we can't engage the
+     * fast fault path.
+     */
+    return sh_have_pte_rsvd_bits() ? sh_l1e_gnp_raw()
+                                   : shadow_l1e_empty();
+}
+
 static inline bool sh_l1e_is_gnp(shadow_l1e_t sl1e)
 {
-    return sl1e.l1 == sh_l1e_gnp().l1;
+    return sl1e.l1 == sh_l1e_gnp_raw().l1;
 }
 
 /*
@@ -322,9 +339,14 @@ static inline bool sh_l1e_is_gnp(shadow_l1e_t sl1e)
 
 static inline shadow_l1e_t sh_l1e_mmio(gfn_t gfn, u32 gflags)
 {
-    return (shadow_l1e_t) { (SH_L1E_MMIO_MAGIC
-                             | MASK_INSR(gfn_x(gfn), SH_L1E_MMIO_GFN_MASK)
-                             | (gflags & (_PAGE_USER|_PAGE_RW))) };
+    unsigned long gfn_val = MASK_INSR(gfn_x(gfn), SH_L1E_MMIO_GFN_MASK);
+
+    if ( !sh_have_pte_rsvd_bits() ||
+         gfn_x(gfn) != MASK_EXTR(gfn_val, SH_L1E_MMIO_GFN_MASK) )
+        return shadow_l1e_empty();
+
+    return (shadow_l1e_t) { (SH_L1E_MMIO_MAGIC | gfn_val |
+                             (gflags & (_PAGE_USER | _PAGE_RW))) };
 }
 
 static inline bool sh_l1e_is_mmio(shadow_l1e_t sl1e)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 05:55:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 05:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99119.188286 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lN86W-0005IZ-23; Fri, 19 Mar 2021 05:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99119.188286; Fri, 19 Mar 2021 05: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 1lN86V-0005IR-V2; Fri, 19 Mar 2021 05:55:23 +0000
Received: by outflank-mailman (input) for mailman id 99119;
 Fri, 19 Mar 2021 05: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 1lN86U-0005II-TT
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 05: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 1lN86U-00045D-Rp
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 05:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lN86U-0005G3-Q9
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 05: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=Xd2WsupRnDyWUwseemaTBOiKJoEohLxXiUHq2t8iiJM=; b=z9eEVE4lBB71POJ7Lez5offMyz
	VpioPAVRRs09pjLCAe38dku2n79BKWT2SxwksPPM6e47mFZQUAGit3pxhI4bKsQRbXhMn9XnpcFYv
	R+BfdalRkMeCcfO1x8ayyokCiBn545EAGCWkndL2A7703NWNGFmZpEN+ITdslk2gmsww=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] vtd: make sure QI/IR are disabled before initialisation
Message-Id: <E1lN86U-0005G3-Q9@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 05:55:22 +0000

commit 57ced58d26b2131e61b0b1b7c22de1e8ff712861
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Thu Mar 18 15:02:15 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:02:15 2021 +0100

    vtd: make sure QI/IR are disabled before initialisation
    
    BIOS might pass control to Xen leaving QI and/or IR in enabled and/or
    partially configured state. In case of x2APIC code path where EIM is
    enabled early in boot - those are correctly disabled by Xen before any
    attempt to configure. But for xAPIC that step is missing which was
    proven to cause QI initialization failures on some ICX based platforms
    where QI is left pre-enabled and partially configured by BIOS. That
    problem becomes hard to avoid since those platforms are shipped with
    x2APIC opt out being advertised by default at the same time by firmware.
    
    Unify the behaviour between x2APIC and xAPIC code paths keeping that in
    line with what Linux does.
    
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 04181c6fb543db01f635227c7681ced4073109ba
    master date: 2021-03-12 17:01:52 +0100
---
 xen/arch/x86/apic.c                 |  2 +-
 xen/drivers/passthrough/vtd/iommu.c | 12 +++++++++++-
 xen/include/asm-x86/apic.h          |  1 +
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 60627fd6e6..4a2740ccea 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -46,7 +46,7 @@ static bool __read_mostly tdt_enabled;
 static bool __initdata tdt_enable = true;
 boolean_param("tdt", tdt_enable);
 
-static bool __read_mostly iommu_x2apic_enabled;
+bool __read_mostly iommu_x2apic_enabled;
 
 static struct {
     int active;
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 2a99cd208f..58128be8b5 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2121,7 +2121,7 @@ static int __must_check init_vtd_hw(void)
     u32 sts;
 
     /*
-     * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults.  
+     * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults, etc.
      */
     for_each_drhd_unit ( drhd )
     {
@@ -2131,6 +2131,16 @@ static int __must_check init_vtd_hw(void)
 
         clear_fault_bits(iommu);
 
+        /*
+         * Disable interrupt remapping and queued invalidation if
+         * already enabled by BIOS in case we've not initialized it yet.
+         */
+        if ( !iommu_x2apic_enabled )
+        {
+            disable_intremap(iommu);
+            disable_qinval(iommu);
+        }
+
         spin_lock_irqsave(&iommu->register_lock, flags);
         sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
         sts &= ~DMA_FECTL_IM;
diff --git a/xen/include/asm-x86/apic.h b/xen/include/asm-x86/apic.h
index 8ddb896ee9..2fe54bbf1c 100644
--- a/xen/include/asm-x86/apic.h
+++ b/xen/include/asm-x86/apic.h
@@ -24,6 +24,7 @@ enum apic_mode {
     APIC_MODE_X2APIC    /* x2APIC mode - common for large MP machines */
 };
 
+extern bool iommu_x2apic_enabled;
 extern u8 apic_verbosity;
 extern bool directed_eoi_enabled;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 05:55:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 05:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99120.188290 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lN86g-0005KG-3m; Fri, 19 Mar 2021 05:55:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99120.188290; Fri, 19 Mar 2021 05:55: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 1lN86g-0005K8-0L; Fri, 19 Mar 2021 05:55:34 +0000
Received: by outflank-mailman (input) for mailman id 99120;
 Fri, 19 Mar 2021 05:55: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 1lN86e-0005Jy-Vt
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 05: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 1lN86e-00045M-V4
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 05:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lN86e-0005Gf-UB
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 05: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=tB/qz6bFE7rmfJDGbLSBgWhlUsdHEiFT02eACN3qeL4=; b=teMZZ6JYyHkAPLDOIUNoI6YnTN
	um+pRCM2EcVVXYcntP74q53rDgxkRf6PXOEJyt65DWBI8Ru4Nn86ALoSeRs8n4rIHBZ3S9GCWK3NC
	z52QOY6izjXh/kdca1pVxg790/ruVwqCGEfSrxiuThDZ5clwapYWx2Uw6yoJD3kYmphs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] xen: fix for_each_cpu when NR_CPUS=1
Message-Id: <E1lN86e-0005Gf-UB@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 05:55:32 +0000

commit 1d6fa27b6b003e3589e6cae2b6d2fc3f842e0a6d
Author:     Dario Faggioli <dfaggioli@suse.com>
AuthorDate: Thu Mar 18 15:02:43 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:02:43 2021 +0100

    xen: fix for_each_cpu when NR_CPUS=1
    
    When running an hypervisor build with NR_CPUS=1 for_each_cpu does not
    take into account whether the bit of the CPU is set or not in the
    provided mask.
    
    This means that whatever we have in the bodies of these loops is always
    done once, even if the mask was empty and it should never be done. This
    is clearly a bug and was in fact causing an assert to trigger in credit2
    code.
    
    Removing the special casing of NR_CPUS == 1 makes things work again.
    
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: aa50f45332f17e8d6308b996d890d3e83748a1a5
    master date: 2021-03-12 17:02:47 +0100
---
 xen/include/xen/cpumask.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/xen/include/xen/cpumask.h b/xen/include/xen/cpumask.h
index 256b60b106..e69589fc08 100644
--- a/xen/include/xen/cpumask.h
+++ b/xen/include/xen/cpumask.h
@@ -368,15 +368,10 @@ static inline void free_cpumask_var(cpumask_var_t mask)
 #define FREE_CPUMASK_VAR(m) free_cpumask_var(m)
 #endif
 
-#if NR_CPUS > 1
 #define for_each_cpu(cpu, mask)			\
 	for ((cpu) = cpumask_first(mask);	\
 	     (cpu) < nr_cpu_ids;		\
 	     (cpu) = cpumask_next(cpu, mask))
-#else /* NR_CPUS == 1 */
-#define for_each_cpu(cpu, mask)			\
-	for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)(mask))
-#endif /* NR_CPUS */
 
 /*
  * The following particular system cpumasks and operations manage
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 05:55:44 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 05:55:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99121.188293 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lN86q-0005Lg-5e; Fri, 19 Mar 2021 05:55:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99121.188293; Fri, 19 Mar 2021 05:55: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 1lN86q-0005Lb-24; Fri, 19 Mar 2021 05:55:44 +0000
Received: by outflank-mailman (input) for mailman id 99121;
 Fri, 19 Mar 2021 05:55: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 1lN86p-0005LR-8m
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 05:55: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 1lN86p-00045j-33
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 05:55:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lN86p-0005HF-1P
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 05:55: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=XKiIzIko5nKaUOYTrKAmz1xkRIum1CkNS0xXLWhxG8g=; b=D6qBAGN0Nt7efENE63ulIL2FIc
	FKZSBKzDA/DDRcBe3F8VQsdj7e15MOeJBI5X79jg4M8UJAJB04gODtk/OIK/FkXAQ/VvXFIi/NKAx
	mM0g+whI3W6FT5FJc7XEvMJNUmur4iSa3W0IR8uRhBCcLzk+hv5EzYTj9LY9sNz6ILjc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] libxl: Fix domain soft reset state handling
Message-Id: <E1lN86p-0005HF-1P@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 05:55:43 +0000

commit b0d7739f10dc93d9565220b4e79ebc6675548c02
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Mar 18 15:03:28 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:03:28 2021 +0100

    libxl: Fix domain soft reset state handling
    
    In do_domain_soft_reset(), a `libxl__domain_suspend_state' is used
    without been properly initialised and disposed of. This lead do a
    abort() in libxl due to the `dsps.qmp' state been used before been
    initialised:
        libxl__ev_qmp_send: Assertion `ev->state == qmp_state_disconnected || ev->state == qmp_state_connected' failed.
    
    Once initialised, `dsps' also needs to be disposed of as the `qmp'
    state might still be in the `Connected' state in the callback for
    libxl__domain_suspend_device_model(). So this patch adds
    libxl__domain_suspend_dispose() which can be called from the two
    places where we need to dispose of `dsps'.
    
    This is XSA-368.
    
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Tested-by: Olaf Hering <olaf@aepfle.de>
    master commit: dae3c3e8b257cd27d6b35a467a34bf79a6650340
    master date: 2021-03-18 14:56:33 +0100
---
 tools/libxl/libxl_create.c      | 11 ++++++++---
 tools/libxl/libxl_dom_suspend.c | 15 +++++++++++----
 tools/libxl/libxl_internal.h    |  2 ++
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 2814818e34..83b0eb00bf 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -2174,9 +2174,7 @@ static int do_domain_soft_reset(libxl_ctx *ctx,
     state->console_tty = libxl__strdup(gc, console_tty);
 
     dss->ao = ao;
-    dss->domid = dss->dsps.domid = domid;
-    dss->dsps.dm_savefile = GCSPRINTF(LIBXL_DEVICE_MODEL_SAVE_FILE".%d",
-                                      domid);
+    dss->domid = domid;
 
     rc = libxl__save_emulator_xenstore_data(dss, &srs->toolstack_buf,
                                             &srs->toolstack_len);
@@ -2186,6 +2184,11 @@ static int do_domain_soft_reset(libxl_ctx *ctx,
     }
 
     dss->dsps.ao = ao;
+    dss->dsps.domid = domid;
+    dss->dsps.live = false;
+    rc = libxl__domain_suspend_init(egc, &dss->dsps, d_config->b_info.type);
+    if (rc)
+        goto out;
     dss->dsps.callback_device_model_done = soft_reset_dm_suspended;
     libxl__domain_suspend_device_model(egc, &dss->dsps); /* must be last */
 
@@ -2204,6 +2207,8 @@ static void soft_reset_dm_suspended(libxl__egc *egc,
         CONTAINER_OF(dsps, *srs, dss.dsps);
     libxl__app_domain_create_state *cdcs = &srs->cdcs;
 
+    libxl__domain_suspend_dispose(gc, dsps);
+
     /*
      * Ask all backends to disconnect by removing the domain from
      * xenstore. On the creation path the domain will be introduced to
diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libxl/libxl_dom_suspend.c
index 25d1571895..2a280f69a1 100644
--- a/tools/libxl/libxl_dom_suspend.c
+++ b/tools/libxl/libxl_dom_suspend.c
@@ -67,6 +67,16 @@ out:
     return rc;
 }
 
+void libxl__domain_suspend_dispose(libxl__gc *gc,
+                                   libxl__domain_suspend_state  *dsps)
+{
+    libxl__xswait_stop(gc, &dsps->pvcontrol);
+    libxl__ev_evtchn_cancel(gc, &dsps->guest_evtchn);
+    libxl__ev_xswatch_deregister(gc, &dsps->guest_watch);
+    libxl__ev_time_deregister(gc, &dsps->guest_timeout);
+    libxl__ev_qmp_dispose(gc, &dsps->qmp);
+}
+
 /*----- callbacks, called by xc_domain_save -----*/
 
 void libxl__domain_suspend_device_model(libxl__egc *egc,
@@ -388,10 +398,7 @@ static void domain_suspend_common_done(libxl__egc *egc,
 {
     EGC_GC;
     assert(!libxl__xswait_inuse(&dsps->pvcontrol));
-    libxl__ev_evtchn_cancel(gc, &dsps->guest_evtchn);
-    libxl__ev_xswatch_deregister(gc, &dsps->guest_watch);
-    libxl__ev_time_deregister(gc, &dsps->guest_timeout);
-    libxl__ev_qmp_dispose(gc, &dsps->qmp);
+    libxl__domain_suspend_dispose(gc, dsps);
     dsps->callback_common_done(egc, dsps, rc);
 }
 
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 94a23179d3..3bc3bbcf84 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -3615,6 +3615,8 @@ struct libxl__domain_suspend_state {
 int libxl__domain_suspend_init(libxl__egc *egc,
                                libxl__domain_suspend_state *dsps,
                                libxl_domain_type type);
+void libxl__domain_suspend_dispose(libxl__gc *gc,
+                                   libxl__domain_suspend_state  *dsps);
 
 /* calls dsps->callback_device_model_done when done
  * may synchronously calls this callback */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 12:55:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 12:55:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99232.188538 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNEed-0004ML-Jg; Fri, 19 Mar 2021 12:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99232.188538; Fri, 19 Mar 2021 12: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 1lNEed-0004MD-Ga; Fri, 19 Mar 2021 12:55:03 +0000
Received: by outflank-mailman (input) for mailman id 99232;
 Fri, 19 Mar 2021 12: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 1lNEec-0004M8-5Q
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 12: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 1lNEec-0003KS-4Y
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 12:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNEec-0005zM-3B
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 12: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=QZkvYvYDcFkxMCcOc/8g2SnSQOGhHtBYAYfep7w73/k=; b=ELdjIX8jL4f9cLV6joytVfpx49
	FapaB4GUDCLJGNyPS0YIib8S9akFBKbgVKuqZQbAmPzRhRl4uKNc2XqeBwEoI+On8aa4Hu5u5Kwqj
	Rg9hmUwzgX8rzp1ta+mG/7IyR1sqbrOJDrRYannluyDxdMoDP55A0bfjqt7wbEh+dhtY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] crypto: adjust rijndaelEncrypt() prototype for gcc11
Message-Id: <E1lNEec-0005zM-3B@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 12:55:02 +0000

commit b127def25683a0d42c9c640bfda901fd2b3d5e0a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Mar 18 15:05:33 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:05:33 2021 +0100

    crypto: adjust rijndaelEncrypt() prototype for gcc11
    
    The upcoming release complains, not entirely unreasonably:
    
    In file included from rijndael.c:33:
    .../xen/include/crypto/rijndael.h:55:53: note: previously declared as 'const unsigned char[]'
       55 | void    rijndaelEncrypt(const unsigned int [], int, const unsigned char [],
          |                                                     ^~~~~~~~~~~~~~~~~~~~~~
    rijndael.c:865:8: error: argument 4 of type 'u8[16]' {aka 'unsigned char[16]'} with mismatched bound [-Werror=array-parameter=]
      865 |     u8 ct[16])
          |     ~~~^~~~~~
    In file included from rijndael.c:33:
    .../xen/include/crypto/rijndael.h:56:13: note: previously declared as 'unsigned char[]'
       56 |             unsigned char []);
          |             ^~~~~~~~~~~~~~~~
    
    Simply declare the correct array dimensions right away. This then allows
    compilers to apply checking at call sites, which seems desirable anyway.
    
    For the moment I'm leaving untouched the disagreement between u8/u32
    used in the function definition and unsigned {char,int} used in the
    declaration, as making this consistent would call for touching further
    functions.
    
    Reported-by: Charles Arnold <carnold@suse.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    master commit: c6ad5a701b9a6df443a6c98d9e7201c958bbcafc
    master date: 2021-03-04 16:47:51 +0100
---
 xen/include/crypto/rijndael.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/crypto/rijndael.h b/xen/include/crypto/rijndael.h
index 69965783c5..4386be5878 100644
--- a/xen/include/crypto/rijndael.h
+++ b/xen/include/crypto/rijndael.h
@@ -52,7 +52,7 @@ void	 rijndael_encrypt(rijndael_ctx *, const unsigned char *, unsigned char *);
 
 int	rijndaelKeySetupEnc(unsigned int [], const unsigned char [], int);
 int	rijndaelKeySetupDec(unsigned int [], const unsigned char [], int);
-void	rijndaelEncrypt(const unsigned int [], int, const unsigned char [],
-	    unsigned char []);
+void	rijndaelEncrypt(const unsigned int [], int, const unsigned char [16],
+	    unsigned char [16]);
 
 #endif /* __RIJNDAEL_H */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 12:55:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 12:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99233.188542 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNEen-0004N8-LI; Fri, 19 Mar 2021 12:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99233.188542; Fri, 19 Mar 2021 12: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 1lNEen-0004N0-I5; Fri, 19 Mar 2021 12:55:13 +0000
Received: by outflank-mailman (input) for mailman id 99233;
 Fri, 19 Mar 2021 12: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 1lNEem-0004Mu-A8
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 12: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 1lNEem-0003Kg-8w
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 12:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNEem-000605-7A
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 12: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=Lac3BVf+A1HtaSmqPdHbjtZIPqn3r0ArLtBkmgcxZ/0=; b=jS65wIGxpWQczky7o2hcDbEFK0
	eIfvi6m83DtVemuBQRyvLRTWyRts5063CyXwPYxQvecPsSFxuNkItcvLG2mCEl9X8CwMzTb5IWU3j
	WUXMs56/O57hWxllpyuT6oHWrjxUWUJiFJEkRFL92w1MDejEcPPBUO1yARWq0npK7JoY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/shadow: suppress "fast fault path" optimization without reserved bits
Message-Id: <E1lNEem-000605-7A@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 12:55:12 +0000

commit d4ac369247dae56642c60cbd5aea3c3504069977
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Mar 18 15:06:12 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:06:12 2021 +0100

    x86/shadow: suppress "fast fault path" optimization without reserved bits
    
    When none of the physical address bits in PTEs are reserved, we can't
    create any 4k (leaf) PTEs which would trigger reserved bit faults. Hence
    the present SHOPT_FAST_FAULT_PATH machinery needs to be suppressed in
    this case, which is most easily achieved by never creating any magic
    entries.
    
    To compensate a little, eliminate sh_write_p2m_entry_post()'s impact on
    such hardware.
    
    While at it, also avoid using an MMIO magic entry when that would
    truncate the incoming GFN.
    
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    
    x86/shadow: suppress "fast fault path" optimization when running virtualized
    
    We can't make correctness of our own behavior dependent upon a
    hypervisor underneath us correctly telling us the true physical address
    with hardware uses. Without knowing this, we can't be certain reserved
    bit faults can actually be observed. Therefore, besides evaluating the
    number of address bits when deciding whether to use the optimization,
    also check whether we're running virtualized ourselves. (Note that since
    we may get migrated when running virtualized, the number of address bits
    may also change.)
    
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 9318fdf757ec234f0ee6c5cd381326b2f581d065
    master date: 2021-03-05 13:29:28 +0100
    master commit: 60c0444fae2148452f9ed0b7c49af1fa41f8f522
    master date: 2021-03-08 10:41:50 +0100
---
 xen/arch/x86/mm/shadow/multi.c |  3 ++-
 xen/arch/x86/mm/shadow/types.h | 34 ++++++++++++++++++++++++++++------
 2 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 26798b317c..61e9cc951e 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -520,7 +520,8 @@ _sh_propagate(struct vcpu *v,
     {
         /* Guest l1e maps emulated MMIO space */
         *sp = sh_l1e_mmio(target_gfn, gflags);
-        d->arch.paging.shadow.has_fast_mmio_entries = true;
+        if ( sh_l1e_is_magic(*sp) )
+            d->arch.paging.shadow.has_fast_mmio_entries = true;
         goto done;
     }
 
diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index d5096748ac..71d8c322ad 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -290,24 +290,41 @@ void sh_destroy_monitor_table(struct vcpu *v, mfn_t mmfn);
  * pagetables.
  *
  * This is only feasible for PAE and 64bit Xen: 32-bit non-PAE PTEs don't
- * have reserved bits that we can use for this.
+ * have reserved bits that we can use for this.  And even there it can only
+ * be used if we can be certain the processor doesn't use all 52 address bits.
  */
 
 #define SH_L1E_MAGIC 0xffffffff00000001ULL
+
+static inline bool sh_have_pte_rsvd_bits(void)
+{
+    return paddr_bits < PADDR_BITS && !cpu_has_hypervisor;
+}
+
 static inline bool sh_l1e_is_magic(shadow_l1e_t sl1e)
 {
     return (sl1e.l1 & SH_L1E_MAGIC) == SH_L1E_MAGIC;
 }
 
 /* Guest not present: a single magic value */
-static inline shadow_l1e_t sh_l1e_gnp(void)
+static inline shadow_l1e_t sh_l1e_gnp_raw(void)
 {
     return (shadow_l1e_t){ -1ULL };
 }
 
+static inline shadow_l1e_t sh_l1e_gnp(void)
+{
+    /*
+     * On systems with no reserved physical address bits we can't engage the
+     * fast fault path.
+     */
+    return sh_have_pte_rsvd_bits() ? sh_l1e_gnp_raw()
+                                   : shadow_l1e_empty();
+}
+
 static inline bool sh_l1e_is_gnp(shadow_l1e_t sl1e)
 {
-    return sl1e.l1 == sh_l1e_gnp().l1;
+    return sl1e.l1 == sh_l1e_gnp_raw().l1;
 }
 
 /*
@@ -322,9 +339,14 @@ static inline bool sh_l1e_is_gnp(shadow_l1e_t sl1e)
 
 static inline shadow_l1e_t sh_l1e_mmio(gfn_t gfn, u32 gflags)
 {
-    return (shadow_l1e_t) { (SH_L1E_MMIO_MAGIC
-                             | MASK_INSR(gfn_x(gfn), SH_L1E_MMIO_GFN_MASK)
-                             | (gflags & (_PAGE_USER|_PAGE_RW))) };
+    unsigned long gfn_val = MASK_INSR(gfn_x(gfn), SH_L1E_MMIO_GFN_MASK);
+
+    if ( !sh_have_pte_rsvd_bits() ||
+         gfn_x(gfn) != MASK_EXTR(gfn_val, SH_L1E_MMIO_GFN_MASK) )
+        return shadow_l1e_empty();
+
+    return (shadow_l1e_t) { (SH_L1E_MMIO_MAGIC | gfn_val |
+                             (gflags & (_PAGE_USER | _PAGE_RW))) };
 }
 
 static inline bool sh_l1e_is_mmio(shadow_l1e_t sl1e)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 12:55:23 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 12:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99234.188546 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNEex-0004OP-Mt; Fri, 19 Mar 2021 12:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99234.188546; Fri, 19 Mar 2021 12: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 1lNEex-0004OH-JZ; Fri, 19 Mar 2021 12:55:23 +0000
Received: by outflank-mailman (input) for mailman id 99234;
 Fri, 19 Mar 2021 12: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 1lNEew-0004O6-E3
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 12: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 1lNEew-0003Kx-DE
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 12:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNEew-00060i-BB
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 12: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=7/A0DcGx3l2JbFsaUUuV/F6Jnz32fVkRVsJ5Kkg0tuw=; b=juPrakqgot2t5xcG/xHMiOTuvN
	NZbCQhiqgYnXH8EWoUE2d1L9M9PODyKMJ4zJtrw1LlgPGra9lpRcP2NP7Pw3eE48td66kL0rmYIys
	hxRRDj2dN2QSNRhkUox6R7CBkqKmIPdEgp3gkR8yrBHsroqWIRQbduuVT6ZvWTmj1Jv0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] vtd: make sure QI/IR are disabled before initialisation
Message-Id: <E1lNEew-00060i-BB@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 12:55:22 +0000

commit c2aaebbbc4521685bf88fb9cfff8c006fcb821af
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Thu Mar 18 15:06:47 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:06:47 2021 +0100

    vtd: make sure QI/IR are disabled before initialisation
    
    BIOS might pass control to Xen leaving QI and/or IR in enabled and/or
    partially configured state. In case of x2APIC code path where EIM is
    enabled early in boot - those are correctly disabled by Xen before any
    attempt to configure. But for xAPIC that step is missing which was
    proven to cause QI initialization failures on some ICX based platforms
    where QI is left pre-enabled and partially configured by BIOS. That
    problem becomes hard to avoid since those platforms are shipped with
    x2APIC opt out being advertised by default at the same time by firmware.
    
    Unify the behaviour between x2APIC and xAPIC code paths keeping that in
    line with what Linux does.
    
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 04181c6fb543db01f635227c7681ced4073109ba
    master date: 2021-03-12 17:01:52 +0100
---
 xen/drivers/passthrough/vtd/iommu.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 1e61e93d3f..61ba9b496b 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2118,7 +2118,7 @@ static int __must_check init_vtd_hw(void)
     u32 sts;
 
     /*
-     * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults.  
+     * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults, etc.
      */
     for_each_drhd_unit ( drhd )
     {
@@ -2128,6 +2128,16 @@ static int __must_check init_vtd_hw(void)
 
         clear_fault_bits(iommu);
 
+        /*
+         * Disable interrupt remapping and queued invalidation if
+         * already enabled by BIOS in case we've not initialized it yet.
+         */
+        if ( !x2apic_enabled )
+        {
+            disable_intremap(iommu);
+            disable_qinval(iommu);
+        }
+
         spin_lock_irqsave(&iommu->register_lock, flags);
         sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
         sts &= ~DMA_FECTL_IM;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 12:55:33 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 12:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99235.188550 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNEf7-0004Py-Oe; Fri, 19 Mar 2021 12:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99235.188550; Fri, 19 Mar 2021 12: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 1lNEf7-0004Pr-LF; Fri, 19 Mar 2021 12:55:33 +0000
Received: by outflank-mailman (input) for mailman id 99235;
 Fri, 19 Mar 2021 12: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 1lNEf6-0004PS-IU
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 12: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 1lNEf6-0003L4-Gh
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 12:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNEf6-00061V-Ff
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 12: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=yS64gMY5RmFafWE/Q7ztf4XoQcZnCJm45BrbribbQ0s=; b=aNk1ge7hKqkXw/suPi1o/rOXs2
	45/TlsAxChIweL8FjcaBeXSVniO/z/qH03oO5tJNztDj0AUdcJsNR4lyFZr0Nt0/zuTBoTI4GdANp
	YNAC4dzdNqzN9NMIJscmqcuK9uf0JAwhVG+zdi+g3TjGEE61uEb2oY6uJj2xX2wB719Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen: fix for_each_cpu when NR_CPUS=1
Message-Id: <E1lNEf6-00061V-Ff@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 12:55:32 +0000

commit 520d3b804f52147073f2ca890e6f588f39396990
Author:     Dario Faggioli <dfaggioli@suse.com>
AuthorDate: Thu Mar 18 15:07:17 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:07:17 2021 +0100

    xen: fix for_each_cpu when NR_CPUS=1
    
    When running an hypervisor build with NR_CPUS=1 for_each_cpu does not
    take into account whether the bit of the CPU is set or not in the
    provided mask.
    
    This means that whatever we have in the bodies of these loops is always
    done once, even if the mask was empty and it should never be done. This
    is clearly a bug and was in fact causing an assert to trigger in credit2
    code.
    
    Removing the special casing of NR_CPUS == 1 makes things work again.
    
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: aa50f45332f17e8d6308b996d890d3e83748a1a5
    master date: 2021-03-12 17:02:47 +0100
---
 xen/include/xen/cpumask.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/xen/include/xen/cpumask.h b/xen/include/xen/cpumask.h
index 256b60b106..e69589fc08 100644
--- a/xen/include/xen/cpumask.h
+++ b/xen/include/xen/cpumask.h
@@ -368,15 +368,10 @@ static inline void free_cpumask_var(cpumask_var_t mask)
 #define FREE_CPUMASK_VAR(m) free_cpumask_var(m)
 #endif
 
-#if NR_CPUS > 1
 #define for_each_cpu(cpu, mask)			\
 	for ((cpu) = cpumask_first(mask);	\
 	     (cpu) < nr_cpu_ids;		\
 	     (cpu) = cpumask_next(cpu, mask))
-#else /* NR_CPUS == 1 */
-#define for_each_cpu(cpu, mask)			\
-	for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)(mask))
-#endif /* NR_CPUS */
 
 /*
  * The following particular system cpumasks and operations manage
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 12:55:43 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 12:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99236.188554 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNEfH-0004RR-Q8; Fri, 19 Mar 2021 12:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99236.188554; Fri, 19 Mar 2021 12: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 1lNEfH-0004RJ-N1; Fri, 19 Mar 2021 12:55:43 +0000
Received: by outflank-mailman (input) for mailman id 99236;
 Fri, 19 Mar 2021 12: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 1lNEfG-0004RB-LC
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 12: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 1lNEfG-0003LE-KU
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 12:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNEfG-000625-JT
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 12: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=vnx9iZsm+fFQc2iHiO54tpbUiE5iPaTGlcemICUTYok=; b=TaSxyU4gcgSRgLPNBfPGKpkgYT
	/hhCf8BZPSfwCShLetIv9E8YArl0NGmK/5aI9Dyyjp+D1vsMHWgpBqQFNe6sFeY39wJSEpHvv04B6
	ujFrnlSX0SRGcJNa1c/I3l2f3O9SsCWPqrxZj73jCGwtNg/XgSquGpdpojhkRoWv8+kI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] libxl: Fix domain soft reset state handling
Message-Id: <E1lNEfG-000625-JT@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 12:55:42 +0000

commit 4547f01640f43ab04458da0f75854b3377ae4dbd
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Mar 18 15:07:59 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 15:07:59 2021 +0100

    libxl: Fix domain soft reset state handling
    
    In do_domain_soft_reset(), a `libxl__domain_suspend_state' is used
    without been properly initialised and disposed of. This lead do a
    abort() in libxl due to the `dsps.qmp' state been used before been
    initialised:
        libxl__ev_qmp_send: Assertion `ev->state == qmp_state_disconnected || ev->state == qmp_state_connected' failed.
    
    Once initialised, `dsps' also needs to be disposed of as the `qmp'
    state might still be in the `Connected' state in the callback for
    libxl__domain_suspend_device_model(). So this patch adds
    libxl__domain_suspend_dispose() which can be called from the two
    places where we need to dispose of `dsps'.
    
    This is XSA-368.
    
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Tested-by: Olaf Hering <olaf@aepfle.de>
    master commit: dae3c3e8b257cd27d6b35a467a34bf79a6650340
    master date: 2021-03-18 14:56:33 +0100
---
 tools/libxl/libxl_create.c      | 11 ++++++++---
 tools/libxl/libxl_dom_suspend.c | 15 +++++++++++----
 tools/libxl/libxl_internal.h    |  2 ++
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 32d45dcef0..651ad18d2d 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -1974,9 +1974,7 @@ static int do_domain_soft_reset(libxl_ctx *ctx,
     state->console_tty = libxl__strdup(gc, console_tty);
 
     dss->ao = ao;
-    dss->domid = dss->dsps.domid = domid_soft_reset;
-    dss->dsps.dm_savefile = GCSPRINTF(LIBXL_DEVICE_MODEL_SAVE_FILE".%d",
-                                      domid_soft_reset);
+    dss->domid = domid_soft_reset;
 
     rc = libxl__save_emulator_xenstore_data(dss, &srs->toolstack_buf,
                                             &srs->toolstack_len);
@@ -1986,6 +1984,11 @@ static int do_domain_soft_reset(libxl_ctx *ctx,
     }
 
     dss->dsps.ao = ao;
+    dss->dsps.domid = domid_soft_reset;
+    dss->dsps.live = false;
+    rc = libxl__domain_suspend_init(egc, &dss->dsps, d_config->b_info.type);
+    if (rc)
+        goto out;
     dss->dsps.callback_device_model_done = soft_reset_dm_suspended;
     libxl__domain_suspend_device_model(egc, &dss->dsps); /* must be last */
 
@@ -2004,6 +2007,8 @@ static void soft_reset_dm_suspended(libxl__egc *egc,
         CONTAINER_OF(dsps, *srs, dss.dsps);
     libxl__app_domain_create_state *cdcs = &srs->cdcs;
 
+    libxl__domain_suspend_dispose(gc, dsps);
+
     /*
      * Ask all backends to disconnect by removing the domain from
      * xenstore. On the creation path the domain will be introduced to
diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libxl/libxl_dom_suspend.c
index 25d1571895..2a280f69a1 100644
--- a/tools/libxl/libxl_dom_suspend.c
+++ b/tools/libxl/libxl_dom_suspend.c
@@ -67,6 +67,16 @@ out:
     return rc;
 }
 
+void libxl__domain_suspend_dispose(libxl__gc *gc,
+                                   libxl__domain_suspend_state  *dsps)
+{
+    libxl__xswait_stop(gc, &dsps->pvcontrol);
+    libxl__ev_evtchn_cancel(gc, &dsps->guest_evtchn);
+    libxl__ev_xswatch_deregister(gc, &dsps->guest_watch);
+    libxl__ev_time_deregister(gc, &dsps->guest_timeout);
+    libxl__ev_qmp_dispose(gc, &dsps->qmp);
+}
+
 /*----- callbacks, called by xc_domain_save -----*/
 
 void libxl__domain_suspend_device_model(libxl__egc *egc,
@@ -388,10 +398,7 @@ static void domain_suspend_common_done(libxl__egc *egc,
 {
     EGC_GC;
     assert(!libxl__xswait_inuse(&dsps->pvcontrol));
-    libxl__ev_evtchn_cancel(gc, &dsps->guest_evtchn);
-    libxl__ev_xswatch_deregister(gc, &dsps->guest_watch);
-    libxl__ev_time_deregister(gc, &dsps->guest_timeout);
-    libxl__ev_qmp_dispose(gc, &dsps->qmp);
+    libxl__domain_suspend_dispose(gc, dsps);
     dsps->callback_common_done(egc, dsps, rc);
 }
 
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 247518a7ac..5b4795908b 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -3569,6 +3569,8 @@ struct libxl__domain_suspend_state {
 int libxl__domain_suspend_init(libxl__egc *egc,
                                libxl__domain_suspend_state *dsps,
                                libxl_domain_type type);
+void libxl__domain_suspend_dispose(libxl__gc *gc,
+                                   libxl__domain_suspend_state  *dsps);
 
 /* calls dsps->callback_device_model_done when done
  * may synchronously calls this callback */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:55:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:55:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99275.188666 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFak-0002g2-H8; Fri, 19 Mar 2021 13:55:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99275.188666; Fri, 19 Mar 2021 13: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 1lNFak-0002fu-E2; Fri, 19 Mar 2021 13:55:06 +0000
Received: by outflank-mailman (input) for mailman id 99275;
 Fri, 19 Mar 2021 13: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 1lNFaj-0002fp-3N
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13: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 1lNFai-0004QN-VK
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:55:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFai-0001bF-TU
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13: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=bUDT7sqWcY6vCzVFzdpRa6if9YtZeRpylm6fEfkvrIs=; b=ey9syUaZg8Q9GCrV0butRn93Xz
	z9ciGVvMkBCGo0bzYQTx7r704Pd0KcKpAkN6S05YacuLFUWldWzKui54vmrwl6TF6QI1HOHwIq4xM
	sl53vtCmQWI2lsII/Sdmi7PwsXhYIAq6yulx9yF3Ih0eW5jla2r7/GdtVYcq100V8jWM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] oxenstored: fix ABI breakage introduced in Xen 4.9.0
Message-Id: <E1lNFai-0001bF-TU@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:55:04 +0000

commit 9503a6df19924d2d9bf5b5a663342ba1507819c5
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Wed Jul 15 16:10:56 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:24:06 2021 +0000

    oxenstored: fix ABI breakage introduced in Xen 4.9.0
    
    dbc84d2983969bb47d294131ed9e6bbbdc2aec49 (Xen >= 4.9.0) deleted XS_RESTRICT
    from oxenstored, which caused all the following opcodes to be shifted by 1:
    reset_watches became off-by-one compared to the C version of xenstored.
    
    Looking at the C code the opcode for reset watches needs:
    XS_RESET_WATCHES = XS_SET_TARGET + 2
    
    So add the placeholder `Invalid` in the OCaml<->C mapping list.
    (Note that the code here doesn't simply convert the OCaml constructor to
     an integer, so we don't need to introduce a dummy constructor).
    
    Igor says that with a suitably patched xenopsd to enable watch reset,
    we now see `reset watches` during kdump of a guest in xenstored-access.log.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Tested-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit a6ed77f1e0334c26e6e216aea45f8674d9284856)
---
 tools/ocaml/libs/xb/op.ml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ocaml/libs/xb/op.ml b/tools/ocaml/libs/xb/op.ml
index d4f1f08185..9bcab0f38c 100644
--- a/tools/ocaml/libs/xb/op.ml
+++ b/tools/ocaml/libs/xb/op.ml
@@ -28,7 +28,7 @@ let operation_c_mapping =
            Transaction_end; Introduce; Release;
            Getdomainpath; Write; Mkdir; Rm;
            Setperms; Watchevent; Error; Isintroduced;
-           Resume; Set_target; Reset_watches |]
+           Resume; Set_target; Invalid; Reset_watches |]
 let size = Array.length operation_c_mapping
 
 let array_search el a =
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:55:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:55:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99276.188670 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFat-0002h0-K4; Fri, 19 Mar 2021 13:55:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99276.188670; Fri, 19 Mar 2021 13: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 1lNFat-0002gs-HD; Fri, 19 Mar 2021 13:55:15 +0000
Received: by outflank-mailman (input) for mailman id 99276;
 Fri, 19 Mar 2021 13: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 1lNFat-0002gn-3A
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13: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 1lNFat-0004Qa-2R
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:55:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFat-0001bp-1E
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:55:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rIOoAubE4bRQmATyK6Ax3AaZBCnHYFfnOno1W8VPCPM=; b=0n32gGPNoXqZ5evjuX9yeV2L92
	uYdY2QF7W0ZbjiWOdK+DN/fagGjCGzwfHGXTiTYH8hp6aFnrn6261bInHAcuf2YMuDh1NBH5xrSQn
	SfHpzJGm8/o91qJwa0SsoSAyUjNEnls4jmkluuksPxG6piQBms69vehyFY5MNb1DeHSs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] tools/ocaml/libs/xb: Do not crash after xenbus is unmapped
Message-Id: <E1lNFat-0001bp-1E@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:55:15 +0000

commit 78a22dee01f24974448e79774d1e48338b4846d0
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 18:23:10 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:43:29 2021 +0000

    tools/ocaml/libs/xb: Do not crash after xenbus is unmapped
    
    Xenmmap.unmap sets the address to MAP_FAILED in xenmmap_stubs.c.  If due to a
    bug there were still references to the Xenbus and we attempt to use it then we
    crash.  Raise an exception instead of crashing.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 5e317896342d553f0b55f72948bbf93a0f1147d3)
---
 tools/ocaml/libs/xb/xs_ring_stubs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/ocaml/libs/xb/xs_ring_stubs.c b/tools/ocaml/libs/xb/xs_ring_stubs.c
index 7537a23949..7a91fdee75 100644
--- a/tools/ocaml/libs/xb/xs_ring_stubs.c
+++ b/tools/ocaml/libs/xb/xs_ring_stubs.c
@@ -32,6 +32,7 @@
 #include <caml/fail.h>
 #include <caml/callback.h>
 
+#include <sys/mman.h>
 #include "mmap_stubs.h"
 
 #define GET_C_STRUCT(a) ((struct mmap_interface *) a)
@@ -166,6 +167,8 @@ CAMLprim value ml_interface_set_server_features(value interface, value v)
 {
 	CAMLparam2(interface, v);
 	struct xenstore_domain_interface *intf = GET_C_STRUCT(interface)->addr;
+	if (intf == (void*)MAP_FAILED)
+		caml_failwith("Interface closed");
 
 	intf->server_features = Int_val(v);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:55:25 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:55:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99277.188674 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFb3-0002iP-Lq; Fri, 19 Mar 2021 13:55:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99277.188674; Fri, 19 Mar 2021 13: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 1lNFb3-0002iH-Ik; Fri, 19 Mar 2021 13:55:25 +0000
Received: by outflank-mailman (input) for mailman id 99277;
 Fri, 19 Mar 2021 13: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 1lNFb3-0002i9-7g
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13: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 1lNFb3-0004Qk-5j
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:55:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFb3-0001cP-4n
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13: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=gFrXh/YbiCVxe+xaO4Ant4FRFvDFS7v1qnWNMwsVNlg=; b=su2m8s3m7o8TKruCgbXOFm9EWb
	3ojuL2o4cyipTt9t+1yfCmZxwkeZQP1J0E3CkAbFHkvTMw5OlEwSn8y6nJgz62Ixqr6kpirTpNhsT
	wtJ/QEHU7ZnKw1PgNQzSJTn8bWtspsEF2pZXU2/MLBFr4NnoKBv1dl/a4LGAAMZyaEE0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] tools/oxenstored: Trim txhistory on xenbus reconnect
Message-Id: <E1lNFb3-0001cP-4n@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:55:25 +0000

commit bcd9d2ee060121198ca58dbf3c275b3e534e01b1
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 8 11:57:37 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:43:32 2021 +0000

    tools/oxenstored: Trim txhistory on xenbus reconnect
    
    There is a global history, containing transactions from the past 0.05s, which
    get trimmed whenever any transaction commits or aborts.  Destroying a domain
    will cause xenopsd to perform some transactions deleting the tree, so that is
    fine.  But I think that a domain can abuse the xenbus reconnect facility to
    cause a large history to be recorded - provided that noone does any
    transactions on the system inbetween, which may be difficult to achieve given
    squeezed's constant pinging.
    
    The theoretical situation is like this:
    - a domain starts a transaction, creates as large a tree as it can, commits
      it. Then repeatedly:
        - start a transaction, do nothing with it, start a transaction, delete
          part of the large tree, write some new unique data there, don't commit
        - cause a xenbus reconnect (I think this can be done by writing something
          to the ring). This causes all transactions/watches for the connection to
          be cleared, but NOT the history, there were no commits, so nobody
          trimmed the history, i.e. it the history can contain transactions from
          more than just 0.05s
        - loop back and start more transactions, you can keep this up indefinitely
          without hitting quotas
    
    Now there is a periodic History.trim running every 0.05s, so I don't think you
    can do much damage with it.  But lets be safe an trim the transaction history
    anyway on reconnect.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit 2a47797d1f3b14aab4f0368ab833abd311f94a70)
---
 tools/ocaml/xenstored/connection.ml | 2 +-
 tools/ocaml/xenstored/history.ml    | 4 ++++
 tools/ocaml/xenstored/process.ml    | 4 ++--
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index fa0d3c4d92..850539e43a 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -47,7 +47,7 @@ let mark_as_bad con =
 
 let initial_next_tid = 1
 
-let reconnect con =
+let do_reconnect con =
 	Xenbus.Xb.reconnect con.xb;
 	(* dom is the same *)
 	Hashtbl.clear con.transactions;
diff --git a/tools/ocaml/xenstored/history.ml b/tools/ocaml/xenstored/history.ml
index f39565bff5..3899353da8 100644
--- a/tools/ocaml/xenstored/history.ml
+++ b/tools/ocaml/xenstored/history.ml
@@ -53,6 +53,10 @@ let end_transaction txn con tid commit =
 	trim ~txn ();
 	success
 
+let reconnect con =
+	trim ();
+	Connection.do_reconnect con
+
 let push (x: history_record) =
 	let dom = x.con.Connection.dom in
 	match dom with
diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml
index 437d2dcf9e..3ab09c6ce9 100644
--- a/tools/ocaml/xenstored/process.ml
+++ b/tools/ocaml/xenstored/process.ml
@@ -566,7 +566,7 @@ let do_input store cons doms con =
 			Connection.do_input con
 		with Xenbus.Xb.Reconnect ->
 			info "%s requests a reconnect" (Connection.get_domstr con);
-			Connection.reconnect con;
+			History.reconnect con;
 			info "%s reconnection complete" (Connection.get_domstr con);
 			false
 		| Failure exp ->
@@ -605,7 +605,7 @@ let do_output _store _cons _doms con =
 			ignore (Connection.do_output con)
 		with Xenbus.Xb.Reconnect ->
 			info "%s requests a reconnect" (Connection.get_domstr con);
-			Connection.reconnect con;
+			History.reconnect con;
 			info "%s reconnection complete" (Connection.get_domstr con)
 	)
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:55:35 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:55:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99278.188678 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFbD-0002jq-Nl; Fri, 19 Mar 2021 13:55:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99278.188678; Fri, 19 Mar 2021 13:55: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 1lNFbD-0002ji-Kx; Fri, 19 Mar 2021 13:55:35 +0000
Received: by outflank-mailman (input) for mailman id 99278;
 Fri, 19 Mar 2021 13: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 1lNFbD-0002jd-Bo
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13: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 1lNFbD-0004Qs-AI
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:55:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFbD-0001d8-7y
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13: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=sSsXMYB5pESKoLEshdml2esCuLjFUkPzcw6ecIOj2x8=; b=Kh1Zav8lEAsRRlNuFyS9CrUMgq
	zygSC04Q64eUd3Yh2weIdZc7yjhs8dy/afUOJvlcRAcGuC0HAs1cAgIQToXguk3usJnFc2kPstu4B
	AyQNuy1zm/vV/Cv3rDoeBWiuxbtuMnRTx+EkErwC+45x8JhOcgOzqpiIOmEuCAatFhWk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] tools/oxenstored: Fix quota calculation for mkdir EEXIST
Message-Id: <E1lNFbD-0001d8-7y@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:55:35 +0000

commit 004be86c81b866365919292f98a5d6effa6f053c
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:11:32 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:43:36 2021 +0000

    tools/oxenstored: Fix quota calculation for mkdir EEXIST
    
    We increment the domain's quota on mkdir even when the node already exists.
    This results in a quota inconsistency after live update, where reconstructing
    the tree from scratch results in a different quota.
    
    Not a security issue because the domain uses up quota faster, so it will only
    get a Quota error sooner than it should.
    
    Found by the structured fuzzer.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit c8b96708252a436da44005307f7c195d699bd7c5)
---
 tools/ocaml/xenstored/store.ml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml
index e20767372f..328d3a5198 100644
--- a/tools/ocaml/xenstored/store.ml
+++ b/tools/ocaml/xenstored/store.ml
@@ -421,6 +421,7 @@ let mkdir store perm path =
 	(* It's upt to the mkdir logic to decide what to do with existing path *)
 	if not (existing || (Perms.Connection.is_dom0 perm)) then Quota.check store.quota owner 0;
 	store.root <- path_mkdir store perm path;
+	if not existing then
 	Quota.add_entry store.quota owner
 
 let rm store perm path =
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:55:46 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:55:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99279.188683 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFbO-0002lL-Pw; Fri, 19 Mar 2021 13:55:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99279.188683; Fri, 19 Mar 2021 13: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 1lNFbO-0002lD-MY; Fri, 19 Mar 2021 13:55:46 +0000
Received: by outflank-mailman (input) for mailman id 99279;
 Fri, 19 Mar 2021 13: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 1lNFbN-0002l0-F9
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13: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 1lNFbN-0004R1-EQ
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:55:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFbN-0001e8-CY
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13: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=7H2eNKsDJs9OGo/U7V/g0ls0+BW5CQ1KyFwZ5IciZOk=; b=WYkdtVMB+thEhmOIBWUnant1U2
	4zVN9k6YY+72sCMwgtWjzsfBgH4chmwaw9v8PDStmDSpBZtXqYvCPf0xiu+264ivNlrgmeI8lmcRP
	VL3g7A8Kdc6UoieuGVR0GpF0h44aUdMy2+UR75s5kPKYZAZ9T7tV70fqVlL7WCINDEEM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] tools/oxenstored: Reject invalid watch paths early
Message-Id: <E1lNFbN-0001e8-CY@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:55:45 +0000

commit d5ed41d3b01e314a64ccaf4f4540a3bc502f4979
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:28:37 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:43:39 2021 +0000

    tools/oxenstored: Reject invalid watch paths early
    
    Watches on invalid paths were accepted, but they would never trigger.  The
    client also got no notification that its watch is bad and would never trigger.
    
    Found again by the structured fuzzer, due to an error on live update reload:
    the invalid watch paths would get rejected during live update and the list of
    watches would be different pre/post live update.
    
    The testcase is watch on `//`, which is an invalid path.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit dc8caf214fb882546b0e93317b9828247a7c9da8)
---
 tools/ocaml/xenstored/connection.ml  | 5 ++---
 tools/ocaml/xenstored/connections.ml | 4 +++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index 850539e43a..daf8d804f7 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -158,18 +158,17 @@ let get_children_watches con path =
 let is_dom0 con =
 	Perms.Connection.is_dom0 (get_perm con)
 
-let add_watch con path token =
+let add_watch con (path, apath) token =
 	if !Quota.activate && !Define.maxwatch > 0 &&
 	   not (is_dom0 con) && con.nb_watches > !Define.maxwatch then
 		raise Quota.Limit_reached;
-	let apath = get_watch_path con path in
 	let l = get_watches con apath in
 	if List.exists (fun w -> w.token = token) l then
 		raise Define.Already_exist;
 	let watch = watch_create ~con ~token ~path in
 	Hashtbl.replace con.watches apath (watch :: l);
 	con.nb_watches <- con.nb_watches + 1;
-	apath, watch
+	watch
 
 let del_watch con path token =
 	let apath = get_watch_path con path in
diff --git a/tools/ocaml/xenstored/connections.ml b/tools/ocaml/xenstored/connections.ml
index 1a70d412d5..7efdf3e5e0 100644
--- a/tools/ocaml/xenstored/connections.ml
+++ b/tools/ocaml/xenstored/connections.ml
@@ -114,8 +114,10 @@ let key_of_path path =
 	"" :: Store.Path.to_string_list path
 
 let add_watch cons con path token =
-	let apath, watch = Connection.add_watch con path token in
+	let apath = Connection.get_watch_path con path in
+	(* fail on invalid paths early by calling key_of_str before adding watch *)
 	let key = key_of_str apath in
+	let watch = Connection.add_watch con (path, apath) token in
 	let watches =
  		if Trie.mem cons.watches key
  		then Trie.find cons.watches key
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:55:56 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:55:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99280.188685 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFbY-0002mS-R7; Fri, 19 Mar 2021 13:55:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99280.188685; Fri, 19 Mar 2021 13: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 1lNFbY-0002mK-OH; Fri, 19 Mar 2021 13:55:56 +0000
Received: by outflank-mailman (input) for mailman id 99280;
 Fri, 19 Mar 2021 13: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 1lNFbX-0002mC-IN
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13: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 1lNFbX-0004RR-HY
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:55:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFbX-0001ek-Gb
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13: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=gnNa9T+SkqlbgaGqfu8XvRv6wKgj3q5SOP8JFnW7U14=; b=w+d6J1yP42zATtNr5iZG/2X+mr
	mRvXdwz2TdHwVq84n58Ypscmycxe+fWg20DY8RYb077kiI7HZaGcwSeCRCHUWzLNwwpbR5fTTfqwz
	pD9qnyclaeRtO7EHIj9+FuXwS2XiDKlNrq5myAtLJ8Qo9ndPtSFImPuS42mT5FoTIU3o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] tools/oxenstored: mkdir conflicts were sometimes missed
Message-Id: <E1lNFbX-0001ek-Gb@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:55:55 +0000

commit 048af4453c2cfaf63ff5a1abd811fc7625c20c3c
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:38:58 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:43:44 2021 +0000

    tools/oxenstored: mkdir conflicts were sometimes missed
    
    Due to how set_write_lowpath was used here it didn't detect create/delete
    conflicts.  When we create an entry we must mark our parent as modified
    (this is what creating a new node via write does).
    
    Otherwise we can have 2 transactions one creating, and another deleting a node
    both succeeding depending on timing.  Or one transaction reading an entry,
    concluding it doesn't exist, do some other work based on that information and
    successfully commit even if another transaction creates the node via mkdir
    meanwhile.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit 45dee7d92b493bb531e7e77a6f9c0180ab152f87)
---
 tools/ocaml/xenstored/transaction.ml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/transaction.ml b/tools/ocaml/xenstored/transaction.ml
index 25bc8c3b4a..17b1bdf2ea 100644
--- a/tools/ocaml/xenstored/transaction.ml
+++ b/tools/ocaml/xenstored/transaction.ml
@@ -165,7 +165,7 @@ let write t perm path value =
 
 let mkdir ?(with_watch=true) t perm path =
 	Store.mkdir t.store perm path;
-	set_write_lowpath t path;
+	set_write_lowpath t (Store.Path.get_parent path);
 	if with_watch then
 		add_wop t Xenbus.Xb.Op.Mkdir path
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:56:07 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:56:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99281.188690 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFbj-0002nk-Sk; Fri, 19 Mar 2021 13:56:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99281.188690; Fri, 19 Mar 2021 13:56: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 1lNFbj-0002nd-Pu; Fri, 19 Mar 2021 13:56:07 +0000
Received: by outflank-mailman (input) for mailman id 99281;
 Fri, 19 Mar 2021 13:56: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 1lNFbi-0002nS-IM
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:56: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 1lNFbi-0004Rp-Hf
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:56:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFbi-0001gv-FP
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:56:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3bqkeLN8d1VQg8cPL+f15OT1M5rxPdLYZDDUonfkC2o=; b=s8ibZHES8owR7POGN8tjcM/+un
	+XdNe+owErhSuawVpbB6d7rh8jaZMHTTW1N+04Iry5lVuSFWRPL5icvKID+NuasF3a68jbOF6NiE9
	EHMb/xmtkZyh6GPwbEsEPlE/0logv/43xg9SLMyk9Wh4hqI2cY+83j99jiQRScsMCSzE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] tools/ocaml: libxb: Harden stub_header_of_string()
Message-Id: <E1lNFbi-0001gv-FP@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:56:06 +0000

commit 0e904b781f05faf58243ff22b24e40492b2e4ef7
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Mar 30 14:29:10 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:41:01 2021 +0000

    tools/ocaml: libxb: Harden stub_header_of_string()
    
    stub_header_of_string() should not modify the header. So mark the
    variable 'hdr' as const.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit d92ba1aa7cf877a77abdcbd94a6a19fc55886a75)
---
 tools/ocaml/libs/xb/xenbus_stubs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xb/xenbus_stubs.c b/tools/ocaml/libs/xb/xenbus_stubs.c
index a68e783f70..001bb03371 100644
--- a/tools/ocaml/libs/xb/xenbus_stubs.c
+++ b/tools/ocaml/libs/xb/xenbus_stubs.c
@@ -40,12 +40,12 @@ CAMLprim value stub_header_of_string(value s)
 {
 	CAMLparam1(s);
 	CAMLlocal1(ret);
-	struct xsd_sockmsg *hdr;
+	const struct xsd_sockmsg *hdr;
 
 	if (caml_string_length(s) != sizeof(struct xsd_sockmsg))
 		caml_failwith("xb header incomplete");
 	ret = caml_alloc_tuple(4);
-	hdr = (struct xsd_sockmsg *) String_val(s);
+	hdr = (const struct xsd_sockmsg *) String_val(s);
 	Store_field(ret, 0, Val_int(hdr->tx_id));
 	Store_field(ret, 1, Val_int(hdr->req_id));
 	Store_field(ret, 2, Val_int(hdr->type));
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:56:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:56:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99282.188694 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFbt-0002p3-UM; Fri, 19 Mar 2021 13:56:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99282.188694; Fri, 19 Mar 2021 13: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 1lNFbt-0002ov-RV; Fri, 19 Mar 2021 13:56:17 +0000
Received: by outflank-mailman (input) for mailman id 99282;
 Fri, 19 Mar 2021 13:56: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 1lNFbs-0002ol-Np
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:56: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 1lNFbs-0004Rx-N4
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:56:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFbs-0001hk-Jw
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:56:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Vhm5Nw8qfKUT3992g9BbxF1sExymAn52F75vrIyXEOo=; b=SeppzVMclBfFy1tzCV5xcvS9tm
	CfPBfNExxuHvVKaRURr+8qp05kslHzpboHZOZ5XL+2b+7hLzk1Vn0yFsyaqLA/UFNJb1qlH8Mrtwm
	32XDqs4Mejpg1+EVWMJppQHQvW1Pn339LCf59lSUrmWBSuRnjoghCNE1FwvsPF+wpOhk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] tools/ocaml: Fix stubs build when OCaml has been compiled with -safe-string
Message-Id: <E1lNFbs-0001hk-Jw@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:56:16 +0000

commit 1cd059ae93261374527cc678551510bfb4a8858e
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Mar 30 15:14:23 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:41:05 2021 +0000

    tools/ocaml: Fix stubs build when OCaml has been compiled with -safe-string
    
    The OCaml code has been fixed to handle properly -safe-string in Xen
    4.11, however the stubs part were missed.
    
    On OCaml newer than 4.06.1, String_Val() will return a const char *
    when using -safe-string leading to build failure when this is used
    in place where char * is expected.
    
    The main use in Xen code base is when a new string is allocated. The
    suggested approach by the OCaml community [1] is to use the helper
    caml_alloc_initialized_string() but it was introduced by OCaml 4.06.1.
    
    The next best approach is to cast String_val() to (char *) as the helper
    would have done. So use it when we need to update the new string using
    memcpy().
    
    Take the opportunity to remove the unnecessary cast of the source as
    mempcy() is expecting a void *.
    
    [1] https://github.com/ocaml/ocaml/pull/1274
    
    Reported-by: Dario Faggioli <dfaggioli@suse.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit 59b087e3954402c487e0abb4ad9bd05f43669436)
---
 tools/ocaml/libs/xb/xenbus_stubs.c  | 2 +-
 tools/ocaml/libs/xc/xenctrl_stubs.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/ocaml/libs/xb/xenbus_stubs.c b/tools/ocaml/libs/xb/xenbus_stubs.c
index 001bb03371..3065181a55 100644
--- a/tools/ocaml/libs/xb/xenbus_stubs.c
+++ b/tools/ocaml/libs/xb/xenbus_stubs.c
@@ -65,7 +65,7 @@ CAMLprim value stub_string_of_header(value tid, value rid, value ty, value len)
 	};
 
 	ret = caml_alloc_string(sizeof(struct xsd_sockmsg));
-	memcpy(String_val(ret), &xsd, sizeof(struct xsd_sockmsg));
+	memcpy((char *) String_val(ret), &xsd, sizeof(struct xsd_sockmsg));
 
 	CAMLreturn(ret);
 }
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 48f39f81d5..e16ed15b86 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -505,7 +505,7 @@ CAMLprim value stub_xc_vcpu_context_get(value xch, value domid,
 	ret = xc_vcpu_getcontext(_H(xch), _D(domid), Int_val(cpu), &ctxt);
 
 	context = caml_alloc_string(sizeof(ctxt));
-	memcpy(String_val(context), (char *) &ctxt.c, sizeof(ctxt.c));
+	memcpy((char *) String_val(context), &ctxt.c, sizeof(ctxt.c));
 
 	CAMLreturn(context);
 }
@@ -684,7 +684,7 @@ CAMLprim value stub_xc_readconsolering(value xch)
 		conring_size = size;
 
 	ring = caml_alloc_string(count);
-	memcpy(String_val(ring), str, count);
+	memcpy((char *) String_val(ring), str, count);
 	free(str);
 
 	CAMLreturn(ring);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:56:28 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:56:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99284.188710 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFc4-0002rX-At; Fri, 19 Mar 2021 13:56:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99284.188710; Fri, 19 Mar 2021 13:56: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 1lNFc4-0002rN-7G; Fri, 19 Mar 2021 13:56:28 +0000
Received: by outflank-mailman (input) for mailman id 99284;
 Fri, 19 Mar 2021 13:56: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 1lNFc2-0002qM-Qq
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:56: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 1lNFc2-0004S7-Q4
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:56:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFc2-0001iH-PF
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:56: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=7gldYQdpWEeSigXFRrMwC2jRL0mOpuhru4OryJu0/kg=; b=gLhfTij5fyzUXqtm5L7i4vJRnY
	7K3HMXGYFkACOpXLlMpMEGNt5ONso1ob7QfNxEYvDQt0pxSRPSjXqB+bGijQZLfLB040olEZvKG4z
	F2KZCiWPz4wd6C7h/FjsGlvjfg0OSNVMWeF8DNdSWP8PAGVBlRGxEVFEtSATTKYgWaVk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] tools/ocaml: libxb: Avoid to use String_val() when value is bytes
Message-Id: <E1lNFc2-0001iH-PF@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:56:26 +0000

commit 23f3adaa37f85c2863633e76f9ccce6447b5571c
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Mar 30 18:50:08 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:41:10 2021 +0000

    tools/ocaml: libxb: Avoid to use String_val() when value is bytes
    
    Commit ec7d54dd1a "ocaml/libs/xb: Use bytes in place of strings for
    mutable buffers" switch mutable buffers from string to bytes. However
    the C code were still using String_Val() to access them.
    
    While the underlying structure is the same between string and bytes, a
    string is meant to be immutable. OCaml 4.06.1 and later will enforce it.
    Therefore, it will not be possible to build the OCaml libs when using
    -safe-string. This is because String_val() will return a const value.
    
    To avoid plain cast in the code, the code is now switched to use
    Bytes_val(). As the macro is not defined in older OCaml version, we need
    to provide a stub.
    
    Take the opportunity to switch to const the buffer in
    ml_interface_write() as it should not be modified.
    
    Reported-by: Dario Faggioli <dfaggioli@suse.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit 78686437e949a85a207ae1a0d637efe2d3778bbe)
---
 tools/ocaml/libs/xb/xs_ring_stubs.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xb/xs_ring_stubs.c b/tools/ocaml/libs/xb/xs_ring_stubs.c
index 473787064a..7537a23949 100644
--- a/tools/ocaml/libs/xb/xs_ring_stubs.c
+++ b/tools/ocaml/libs/xb/xs_ring_stubs.c
@@ -36,6 +36,14 @@
 
 #define GET_C_STRUCT(a) ((struct mmap_interface *) a)
 
+/*
+ * Bytes_val has been introduced by Ocaml 4.06.1. So define our own version
+ * if needed.
+ */
+#ifndef Bytes_val
+#define Bytes_val(x) ((unsigned char *) Bp_val(x))
+#endif
+
 CAMLprim value ml_interface_read(value ml_interface,
                                  value ml_buffer,
                                  value ml_len)
@@ -44,7 +52,7 @@ CAMLprim value ml_interface_read(value ml_interface,
 	CAMLlocal1(ml_result);
 
 	struct mmap_interface *interface = GET_C_STRUCT(ml_interface);
-	char *buffer = String_val(ml_buffer);
+	unsigned char *buffer = Bytes_val(ml_buffer);
 	int len = Int_val(ml_len);
 	int result;
 
@@ -103,7 +111,7 @@ CAMLprim value ml_interface_write(value ml_interface,
 	CAMLlocal1(ml_result);
 
 	struct mmap_interface *interface = GET_C_STRUCT(ml_interface);
-	char *buffer = String_val(ml_buffer);
+	const unsigned char *buffer = Bytes_val(ml_buffer);
 	int len = Int_val(ml_len);
 	int result;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:56:38 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:56:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99285.188714 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFcE-0002wg-CF; Fri, 19 Mar 2021 13:56:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99285.188714; Fri, 19 Mar 2021 13:56: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 1lNFcE-0002wY-8t; Fri, 19 Mar 2021 13:56:38 +0000
Received: by outflank-mailman (input) for mailman id 99285;
 Fri, 19 Mar 2021 13:56: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 1lNFcC-0002wA-Ug
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:56: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 1lNFcC-0004SI-TY
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:56:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFcC-0001it-Sh
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:56:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9d0/+ms4chMUX7pHMfUX/rb/nrsASxr1yVC63byp4fo=; b=UsSV0YcSnyLVCvrY9/5YMCjPt/
	ppsl30tOGNTq0Fg7V6TCXkzlz+sd1v2UZbZLjP+yzxBOoJyLXaDILIEtRzWL6/OBAFZCIBHhyxcCC
	PYS8gPHAVuuFAJ1sYkbMFIvg6efoK9TAk4o9ahwfTKeeBT+HpIIyWY6rY0N2hYySsOLY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] tools/libxc: misc: Mark const the parameter 'keys' of xc_send_debug_keys()
Message-Id: <E1lNFcC-0001it-Sh@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:56:36 +0000

commit 5c65f9d5fcc3e1cbe4c07a0d2c9223205c1f819a
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Mar 30 20:21:52 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:41:20 2021 +0000

    tools/libxc: misc: Mark const the parameter 'keys' of xc_send_debug_keys()
    
    OCaml is using a string to describe the parameter 'keys' of
    xc_send_debug_keys(). Since Ocaml 4.06.01, String_val() will return a
    const char * when using -safe-string. This will result to a build
    failure because xc_send_debug_keys() expects a char *.
    
    The function should never modify the parameter 'keys' and therefore the
    parameter should be const. Unfortunately, this is not directly possible
    because DECLARE_HYPERCALL_BOUNCE() is expecting a non-const variable.
    
    A new macro DECLARE_HYPERCALL_BOUNCE_IN() is introduced and will take
    care of const parameter. The first user will be xc_send_debug_keys() but
    this can be used in more place in the future.
    
    Reported-by: Dario Faggioli <dfaggioli@suse.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 2b8079610ec55413613ad071cc81cd9f97232a7e)
---
 tools/libxc/include/xenctrl.h | 2 +-
 tools/libxc/xc_misc.c         | 4 ++--
 tools/libxc/xc_private.h      | 8 ++++++++
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index f4431687b3..0bd593157c 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1225,7 +1225,7 @@ int xc_readconsolering(xc_interface *xch,
                        unsigned int *pnr_chars,
                        int clear, int incremental, uint32_t *pindex);
 
-int xc_send_debug_keys(xc_interface *xch, char *keys);
+int xc_send_debug_keys(xc_interface *xch, const char *keys);
 int xc_set_parameters(xc_interface *xch, char *params);
 
 typedef struct xen_sysctl_physinfo xc_physinfo_t;
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index 8e60b6e9f0..564da16e18 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -167,11 +167,11 @@ int xc_readconsolering(xc_interface *xch,
     return ret;
 }
 
-int xc_send_debug_keys(xc_interface *xch, char *keys)
+int xc_send_debug_keys(xc_interface *xch, const char *keys)
 {
     int ret, len = strlen(keys);
     DECLARE_SYSCTL;
-    DECLARE_HYPERCALL_BOUNCE(keys, len, XC_HYPERCALL_BUFFER_BOUNCE_IN);
+    DECLARE_HYPERCALL_BOUNCE_IN(keys, len);
 
     if ( xc_hypercall_bounce_pre(xch, keys) )
         return -1;
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index adc3b6a571..c77edb3c4c 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -181,6 +181,14 @@ enum {
  */
 #define DECLARE_HYPERCALL_BOUNCE(_ubuf, _sz, _dir) DECLARE_NAMED_HYPERCALL_BOUNCE(_ubuf, _ubuf, _sz, _dir)
 
+/*
+ * Declare a bounce buffer shadowing the named user data pointer that
+ * cannot be modified.
+ */
+#define DECLARE_HYPERCALL_BOUNCE_IN(_ubuf, _sz)                     \
+    DECLARE_NAMED_HYPERCALL_BOUNCE(_ubuf, (void *)(_ubuf), _sz,     \
+                                   XC_HYPERCALL_BUFFER_BOUNCE_IN)
+
 /*
  * Set the size of data to bounce. Useful when the size is not known
  * when the bounce buffer is declared.
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:56:48 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:56:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99286.188717 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFcO-0002ys-E9; Fri, 19 Mar 2021 13:56:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99286.188717; Fri, 19 Mar 2021 13:56: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 1lNFcO-0002yj-Ag; Fri, 19 Mar 2021 13:56:48 +0000
Received: by outflank-mailman (input) for mailman id 99286;
 Fri, 19 Mar 2021 13:56: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 1lNFcN-0002yX-10
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:56: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 1lNFcN-0004Sj-0K
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:56:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFcM-0001jP-Vj
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:56: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=+37WmsFwTW0bzxHePcaMM1CAGGv4qFd7cOnJJCLfiBc=; b=hlzY+qNVxTqkC6UmYVV0sKvFpN
	DG/NUPLDa2+4hBpDlxbt9pJaLTUGUClV7noUkcmkGirzFIDSn5QJlcPFm6iYUAQmjUNp8AtUk4ZjY
	/krpwnHRqPDyoCnq3MuMrRgsuVDRoX90v7HFQXK+pT0/i0J5aehTtCZ38R4N3hh7KhWo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] oxenstored: fix ABI breakage introduced in Xen 4.9.0
Message-Id: <E1lNFcM-0001jP-Vj@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:56:46 +0000

commit f95c227c758b1838e91d0ca54c8b4a47b9ba0d6d
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Wed Jul 15 16:10:56 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:41:26 2021 +0000

    oxenstored: fix ABI breakage introduced in Xen 4.9.0
    
    dbc84d2983969bb47d294131ed9e6bbbdc2aec49 (Xen >= 4.9.0) deleted XS_RESTRICT
    from oxenstored, which caused all the following opcodes to be shifted by 1:
    reset_watches became off-by-one compared to the C version of xenstored.
    
    Looking at the C code the opcode for reset watches needs:
    XS_RESET_WATCHES = XS_SET_TARGET + 2
    
    So add the placeholder `Invalid` in the OCaml<->C mapping list.
    (Note that the code here doesn't simply convert the OCaml constructor to
     an integer, so we don't need to introduce a dummy constructor).
    
    Igor says that with a suitably patched xenopsd to enable watch reset,
    we now see `reset watches` during kdump of a guest in xenstored-access.log.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Tested-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit a6ed77f1e0334c26e6e216aea45f8674d9284856)
    (cherry picked from commit 9503a6df19924d2d9bf5b5a663342ba1507819c5)
---
 tools/ocaml/libs/xb/op.ml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ocaml/libs/xb/op.ml b/tools/ocaml/libs/xb/op.ml
index d4f1f08185..9bcab0f38c 100644
--- a/tools/ocaml/libs/xb/op.ml
+++ b/tools/ocaml/libs/xb/op.ml
@@ -28,7 +28,7 @@ let operation_c_mapping =
            Transaction_end; Introduce; Release;
            Getdomainpath; Write; Mkdir; Rm;
            Setperms; Watchevent; Error; Isintroduced;
-           Resume; Set_target; Reset_watches |]
+           Resume; Set_target; Invalid; Reset_watches |]
 let size = Array.length operation_c_mapping
 
 let array_search el a =
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:56:58 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:56:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99288.188721 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFcY-00030L-FN; Fri, 19 Mar 2021 13:56:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99288.188721; Fri, 19 Mar 2021 13:56: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 1lNFcY-00030D-CK; Fri, 19 Mar 2021 13:56:58 +0000
Received: by outflank-mailman (input) for mailman id 99288;
 Fri, 19 Mar 2021 13:56: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 1lNFcX-000304-4K
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:56: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 1lNFcX-0004Sq-36
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:56:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFcX-0001kE-2L
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:56: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=4UBbPJI3zmjDbUASmStc0evmjNKOoyTV0FCv1B2i2qs=; b=Kwk9dudJnRhZ+EfMT1yEP+9lD9
	/N1uYgNX8LBLQLu7FDCqVT7Waz7V7pRUtg8lyIs5Ag1xRsKBzvtexnvAg8W7Icj4NgT2p31g42Jch
	v9N1aYgqA/mU6nlVsaBGpoGdgv1/GnP5AhWC6hc0kQfrAzoPHWnnObKmNscxjI6gUqlI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] tools/ocaml/libs/xb: Do not crash after xenbus is unmapped
Message-Id: <E1lNFcX-0001kE-2L@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:56:57 +0000

commit 9e2ee42fb9ae1b0491e900454e6d908f48cbe77e
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 18:23:10 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:44:12 2021 +0000

    tools/ocaml/libs/xb: Do not crash after xenbus is unmapped
    
    Xenmmap.unmap sets the address to MAP_FAILED in xenmmap_stubs.c.  If due to a
    bug there were still references to the Xenbus and we attempt to use it then we
    crash.  Raise an exception instead of crashing.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 5e317896342d553f0b55f72948bbf93a0f1147d3)
---
 tools/ocaml/libs/xb/xs_ring_stubs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/ocaml/libs/xb/xs_ring_stubs.c b/tools/ocaml/libs/xb/xs_ring_stubs.c
index 7537a23949..7a91fdee75 100644
--- a/tools/ocaml/libs/xb/xs_ring_stubs.c
+++ b/tools/ocaml/libs/xb/xs_ring_stubs.c
@@ -32,6 +32,7 @@
 #include <caml/fail.h>
 #include <caml/callback.h>
 
+#include <sys/mman.h>
 #include "mmap_stubs.h"
 
 #define GET_C_STRUCT(a) ((struct mmap_interface *) a)
@@ -166,6 +167,8 @@ CAMLprim value ml_interface_set_server_features(value interface, value v)
 {
 	CAMLparam2(interface, v);
 	struct xenstore_domain_interface *intf = GET_C_STRUCT(interface)->addr;
+	if (intf == (void*)MAP_FAILED)
+		caml_failwith("Interface closed");
 
 	intf->server_features = Int_val(v);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:57:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:57:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99289.188725 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFci-00032A-Gk; Fri, 19 Mar 2021 13:57:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99289.188725; Fri, 19 Mar 2021 13:57: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 1lNFci-000322-Dg; Fri, 19 Mar 2021 13:57:08 +0000
Received: by outflank-mailman (input) for mailman id 99289;
 Fri, 19 Mar 2021 13:57: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 1lNFch-00031m-7L
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:57: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 1lNFch-0004TD-6i
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:57:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFch-0001l2-5s
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:57: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=NQFwcH8LkfjnF4bl9mCDeaRz/PbVR6zHYgIZVQkMdsQ=; b=BRqo0wIQdC/JZTL/lwBRMmb6Ly
	LLE0mqeMHceABzA7AqMUrFg0ozeLU6zJ/V8+UnsEUnkag3F0tIbNDdrny43rosQLEsxr9NvvI1zvf
	cILclamLPcUWY4uHJ83SDe8hoAVmuAVdvP8yZM9W56FVNOowxw6KYeyG0PMl5GY3+zBI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] tools/oxenstored: Trim txhistory on xenbus reconnect
Message-Id: <E1lNFch-0001l2-5s@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:57:07 +0000

commit 7660e7949d6dc2176f3e1efe0fa5b0aeb1e9fb0e
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 8 11:57:37 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:44:13 2021 +0000

    tools/oxenstored: Trim txhistory on xenbus reconnect
    
    There is a global history, containing transactions from the past 0.05s, which
    get trimmed whenever any transaction commits or aborts.  Destroying a domain
    will cause xenopsd to perform some transactions deleting the tree, so that is
    fine.  But I think that a domain can abuse the xenbus reconnect facility to
    cause a large history to be recorded - provided that noone does any
    transactions on the system inbetween, which may be difficult to achieve given
    squeezed's constant pinging.
    
    The theoretical situation is like this:
    - a domain starts a transaction, creates as large a tree as it can, commits
      it. Then repeatedly:
        - start a transaction, do nothing with it, start a transaction, delete
          part of the large tree, write some new unique data there, don't commit
        - cause a xenbus reconnect (I think this can be done by writing something
          to the ring). This causes all transactions/watches for the connection to
          be cleared, but NOT the history, there were no commits, so nobody
          trimmed the history, i.e. it the history can contain transactions from
          more than just 0.05s
        - loop back and start more transactions, you can keep this up indefinitely
          without hitting quotas
    
    Now there is a periodic History.trim running every 0.05s, so I don't think you
    can do much damage with it.  But lets be safe an trim the transaction history
    anyway on reconnect.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit 2a47797d1f3b14aab4f0368ab833abd311f94a70)
---
 tools/ocaml/xenstored/connection.ml | 2 +-
 tools/ocaml/xenstored/history.ml    | 4 ++++
 tools/ocaml/xenstored/process.ml    | 4 ++--
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index fa0d3c4d92..850539e43a 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -47,7 +47,7 @@ let mark_as_bad con =
 
 let initial_next_tid = 1
 
-let reconnect con =
+let do_reconnect con =
 	Xenbus.Xb.reconnect con.xb;
 	(* dom is the same *)
 	Hashtbl.clear con.transactions;
diff --git a/tools/ocaml/xenstored/history.ml b/tools/ocaml/xenstored/history.ml
index f39565bff5..3899353da8 100644
--- a/tools/ocaml/xenstored/history.ml
+++ b/tools/ocaml/xenstored/history.ml
@@ -53,6 +53,10 @@ let end_transaction txn con tid commit =
 	trim ~txn ();
 	success
 
+let reconnect con =
+	trim ();
+	Connection.do_reconnect con
+
 let push (x: history_record) =
 	let dom = x.con.Connection.dom in
 	match dom with
diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml
index 437d2dcf9e..3ab09c6ce9 100644
--- a/tools/ocaml/xenstored/process.ml
+++ b/tools/ocaml/xenstored/process.ml
@@ -566,7 +566,7 @@ let do_input store cons doms con =
 			Connection.do_input con
 		with Xenbus.Xb.Reconnect ->
 			info "%s requests a reconnect" (Connection.get_domstr con);
-			Connection.reconnect con;
+			History.reconnect con;
 			info "%s reconnection complete" (Connection.get_domstr con);
 			false
 		| Failure exp ->
@@ -605,7 +605,7 @@ let do_output _store _cons _doms con =
 			ignore (Connection.do_output con)
 		with Xenbus.Xb.Reconnect ->
 			info "%s requests a reconnect" (Connection.get_domstr con);
-			Connection.reconnect con;
+			History.reconnect con;
 			info "%s reconnection complete" (Connection.get_domstr con)
 	)
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:57:18 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:57:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99291.188730 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFcs-00033t-IR; Fri, 19 Mar 2021 13:57:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99291.188730; Fri, 19 Mar 2021 13:57: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 1lNFcs-00033l-FJ; Fri, 19 Mar 2021 13:57:18 +0000
Received: by outflank-mailman (input) for mailman id 99291;
 Fri, 19 Mar 2021 13:57: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 1lNFcr-00033X-Ag
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:57: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 1lNFcr-0004TL-9v
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:57:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFcr-0001ld-8z
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:57:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/NgKi3/RFjyQsblvTmCQ8rCOZJhMWI3ln4X6zqDp1LM=; b=sIa5yZbmiPo4FHBJxL9zaO4TMT
	jhuS2IgdzkVfWxW4yOqWk6e5nmqSAJUHhxGWYCquf2YFbGuP3LaJ23n1dFANSKDkx1rXInupFis2j
	gQ9+qQLocAI+2rkG7+Ohkf3DY9VfSw+hE4OuUqBYhw++PG/Zn0wPneV3tl40CS4V7Zc0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] tools/oxenstored: Fix quota calculation for mkdir EEXIST
Message-Id: <E1lNFcr-0001ld-8z@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:57:17 +0000

commit 0a9bf01eab595b00c1f717b81dce442850da23fb
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:11:32 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:44:13 2021 +0000

    tools/oxenstored: Fix quota calculation for mkdir EEXIST
    
    We increment the domain's quota on mkdir even when the node already exists.
    This results in a quota inconsistency after live update, where reconstructing
    the tree from scratch results in a different quota.
    
    Not a security issue because the domain uses up quota faster, so it will only
    get a Quota error sooner than it should.
    
    Found by the structured fuzzer.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit c8b96708252a436da44005307f7c195d699bd7c5)
---
 tools/ocaml/xenstored/store.ml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml
index e20767372f..328d3a5198 100644
--- a/tools/ocaml/xenstored/store.ml
+++ b/tools/ocaml/xenstored/store.ml
@@ -421,6 +421,7 @@ let mkdir store perm path =
 	(* It's upt to the mkdir logic to decide what to do with existing path *)
 	if not (existing || (Perms.Connection.is_dom0 perm)) then Quota.check store.quota owner 0;
 	store.root <- path_mkdir store perm path;
+	if not existing then
 	Quota.add_entry store.quota owner
 
 let rm store perm path =
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:57:28 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:57:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99292.188733 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFd2-00035U-KR; Fri, 19 Mar 2021 13:57:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99292.188733; Fri, 19 Mar 2021 13:57: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 1lNFd2-00035M-H8; Fri, 19 Mar 2021 13:57:28 +0000
Received: by outflank-mailman (input) for mailman id 99292;
 Fri, 19 Mar 2021 13:57: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 1lNFd1-00035C-Dp
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:57: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 1lNFd1-0004TV-D9
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:57:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFd1-0001mE-CA
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:57: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=bNajmOatJAIk6HN94D77JXfy6fJx4XF6P+bcsedrwWY=; b=lkq8cMLhDkWlyZuoLDhs9aHy3R
	LmRBHI2Sd+KT+qIj5XeVoDoyxZHQ2LxzXDLVAOPmGD5IdeuLnsWedn84DK6tlwx26xXMypofkNA0P
	5Wm40a1PSP1+5ubXQm4NdmwP5irgJtxJhBzkJ4Xqx3CI1ycnmsvSFlb1TqE62tr5mUt8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] tools/oxenstored: Reject invalid watch paths early
Message-Id: <E1lNFd1-0001mE-CA@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:57:27 +0000

commit 00cf603e6a798943f034babb8ece7764d185c232
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:28:37 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:44:13 2021 +0000

    tools/oxenstored: Reject invalid watch paths early
    
    Watches on invalid paths were accepted, but they would never trigger.  The
    client also got no notification that its watch is bad and would never trigger.
    
    Found again by the structured fuzzer, due to an error on live update reload:
    the invalid watch paths would get rejected during live update and the list of
    watches would be different pre/post live update.
    
    The testcase is watch on `//`, which is an invalid path.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit dc8caf214fb882546b0e93317b9828247a7c9da8)
---
 tools/ocaml/xenstored/connection.ml  | 5 ++---
 tools/ocaml/xenstored/connections.ml | 4 +++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index 850539e43a..daf8d804f7 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -158,18 +158,17 @@ let get_children_watches con path =
 let is_dom0 con =
 	Perms.Connection.is_dom0 (get_perm con)
 
-let add_watch con path token =
+let add_watch con (path, apath) token =
 	if !Quota.activate && !Define.maxwatch > 0 &&
 	   not (is_dom0 con) && con.nb_watches > !Define.maxwatch then
 		raise Quota.Limit_reached;
-	let apath = get_watch_path con path in
 	let l = get_watches con apath in
 	if List.exists (fun w -> w.token = token) l then
 		raise Define.Already_exist;
 	let watch = watch_create ~con ~token ~path in
 	Hashtbl.replace con.watches apath (watch :: l);
 	con.nb_watches <- con.nb_watches + 1;
-	apath, watch
+	watch
 
 let del_watch con path token =
 	let apath = get_watch_path con path in
diff --git a/tools/ocaml/xenstored/connections.ml b/tools/ocaml/xenstored/connections.ml
index 1a70d412d5..7efdf3e5e0 100644
--- a/tools/ocaml/xenstored/connections.ml
+++ b/tools/ocaml/xenstored/connections.ml
@@ -114,8 +114,10 @@ let key_of_path path =
 	"" :: Store.Path.to_string_list path
 
 let add_watch cons con path token =
-	let apath, watch = Connection.add_watch con path token in
+	let apath = Connection.get_watch_path con path in
+	(* fail on invalid paths early by calling key_of_str before adding watch *)
 	let key = key_of_str apath in
+	let watch = Connection.add_watch con (path, apath) token in
 	let watches =
  		if Trie.mem cons.watches key
  		then Trie.find cons.watches key
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:57:38 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:57:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99293.188738 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFdC-00037S-NY; Fri, 19 Mar 2021 13:57:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99293.188738; Fri, 19 Mar 2021 13:57: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 1lNFdC-00037M-Kd; Fri, 19 Mar 2021 13:57:38 +0000
Received: by outflank-mailman (input) for mailman id 99293;
 Fri, 19 Mar 2021 13:57: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 1lNFdB-00037B-Gi
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:57: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 1lNFdB-0004Tf-G6
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:57:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFdB-0001ms-FM
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:57: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=MQ0SY7p/URAg1ojVnf2i+G+XNmPp1dZSwLWRkhUgiy8=; b=Yn1VVfiyh5n251t1yR8NtaQsyM
	cMROn/rtHmsj0S1KcJcqFhXHKhNwFXa3/add9p7oIx1RaiKU5cYd0FInLVGumYtaKM4GIsE4TOy0F
	W7i42Vo+ELo+JVjyAY2OJOqgx0YBZfsbfCtJmMPa/UoADMWXjYu4El8lT9nkdWHKokQQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] tools/oxenstored: mkdir conflicts were sometimes missed
Message-Id: <E1lNFdB-0001ms-FM@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:57:37 +0000

commit f2e50a048a1430117f14fa42bde75c31ff85a7aa
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:38:58 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:44:13 2021 +0000

    tools/oxenstored: mkdir conflicts were sometimes missed
    
    Due to how set_write_lowpath was used here it didn't detect create/delete
    conflicts.  When we create an entry we must mark our parent as modified
    (this is what creating a new node via write does).
    
    Otherwise we can have 2 transactions one creating, and another deleting a node
    both succeeding depending on timing.  Or one transaction reading an entry,
    concluding it doesn't exist, do some other work based on that information and
    successfully commit even if another transaction creates the node via mkdir
    meanwhile.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit 45dee7d92b493bb531e7e77a6f9c0180ab152f87)
---
 tools/ocaml/xenstored/transaction.ml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/transaction.ml b/tools/ocaml/xenstored/transaction.ml
index 25bc8c3b4a..17b1bdf2ea 100644
--- a/tools/ocaml/xenstored/transaction.ml
+++ b/tools/ocaml/xenstored/transaction.ml
@@ -165,7 +165,7 @@ let write t perm path value =
 
 let mkdir ?(with_watch=true) t perm path =
 	Store.mkdir t.store perm path;
-	set_write_lowpath t path;
+	set_write_lowpath t (Store.Path.get_parent path);
 	if with_watch then
 		add_wop t Xenbus.Xb.Op.Mkdir path
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:57:49 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:57:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99294.188742 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFdN-0003AB-PD; Fri, 19 Mar 2021 13:57:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99294.188742; Fri, 19 Mar 2021 13:57:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFdN-0003A3-MM; Fri, 19 Mar 2021 13:57:49 +0000
Received: by outflank-mailman (input) for mailman id 99294;
 Fri, 19 Mar 2021 13:57: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 1lNFdM-00039s-Cj
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:57: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 1lNFdM-0004U4-By
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:57:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFdM-0001on-B9
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:57: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=onBY2qrkouL1BSYTXXzksOpbmvsqml8tLZI/AKA9CI4=; b=b03yLWt68gum4A1qMxCA5NS7Ao
	w2CAhlj3ifdTAm9QtOpys3Y4EP2JyIINKgyUufx9VUKsNIooa2Vh7p99l3NrltNE81Dm4QBxkvvD7
	SSFWKq9xoNbPqCzI411BtK3Y4fRh/vxnkBKNLHLZslS80Zl2cg5QVzXG1/PGquro2uyQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] tools/ocaml: libxb: Harden stub_header_of_string()
Message-Id: <E1lNFdM-0001on-B9@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:57:48 +0000

commit 652a259ea8115c25ee081f022ab06c9d4b748429
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Mar 30 14:29:10 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:43 2021 +0000

    tools/ocaml: libxb: Harden stub_header_of_string()
    
    stub_header_of_string() should not modify the header. So mark the
    variable 'hdr' as const.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit d92ba1aa7cf877a77abdcbd94a6a19fc55886a75)
---
 tools/ocaml/libs/xb/xenbus_stubs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xb/xenbus_stubs.c b/tools/ocaml/libs/xb/xenbus_stubs.c
index a68e783f70..001bb03371 100644
--- a/tools/ocaml/libs/xb/xenbus_stubs.c
+++ b/tools/ocaml/libs/xb/xenbus_stubs.c
@@ -40,12 +40,12 @@ CAMLprim value stub_header_of_string(value s)
 {
 	CAMLparam1(s);
 	CAMLlocal1(ret);
-	struct xsd_sockmsg *hdr;
+	const struct xsd_sockmsg *hdr;
 
 	if (caml_string_length(s) != sizeof(struct xsd_sockmsg))
 		caml_failwith("xb header incomplete");
 	ret = caml_alloc_tuple(4);
-	hdr = (struct xsd_sockmsg *) String_val(s);
+	hdr = (const struct xsd_sockmsg *) String_val(s);
 	Store_field(ret, 0, Val_int(hdr->tx_id));
 	Store_field(ret, 1, Val_int(hdr->req_id));
 	Store_field(ret, 2, Val_int(hdr->type));
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:57:59 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:57:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99295.188746 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFdX-0003DX-RA; Fri, 19 Mar 2021 13:57:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99295.188746; Fri, 19 Mar 2021 13:57: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 1lNFdX-0003DP-Nu; Fri, 19 Mar 2021 13:57:59 +0000
Received: by outflank-mailman (input) for mailman id 99295;
 Fri, 19 Mar 2021 13:57: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 1lNFdW-0003BM-FT
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:57: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 1lNFdW-0004UO-Eo
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:57:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFdW-0001pU-E8
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:57: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=F9bMVds4N+NwN8afisUeSTNuSG0wc4z0E2ahWzozev8=; b=A77df+5bbquL+kK2hImyy0A1rX
	vap2eUx37Sml6xKO84hemI7zkhaZ/fONMNO9qpNeQUKfTQ8rI+PbkpdzbhAwqjaXlFlWiNdyFu1ai
	4kXGWiL80tgDSDgdXwI2JK8cVAGy4t6ugQwcL0RItlyCvS9AKg7/pTR9E3k+KxaGeNvY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] tools/ocaml: Fix stubs build when OCaml has been compiled with -safe-string
Message-Id: <E1lNFdW-0001pU-E8@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:57:58 +0000

commit 2e9e9e440f9257f7db12a744d0de0b7ab7746dfd
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Mar 30 15:14:23 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:43 2021 +0000

    tools/ocaml: Fix stubs build when OCaml has been compiled with -safe-string
    
    The OCaml code has been fixed to handle properly -safe-string in Xen
    4.11, however the stubs part were missed.
    
    On OCaml newer than 4.06.1, String_Val() will return a const char *
    when using -safe-string leading to build failure when this is used
    in place where char * is expected.
    
    The main use in Xen code base is when a new string is allocated. The
    suggested approach by the OCaml community [1] is to use the helper
    caml_alloc_initialized_string() but it was introduced by OCaml 4.06.1.
    
    The next best approach is to cast String_val() to (char *) as the helper
    would have done. So use it when we need to update the new string using
    memcpy().
    
    Take the opportunity to remove the unnecessary cast of the source as
    mempcy() is expecting a void *.
    
    [1] https://github.com/ocaml/ocaml/pull/1274
    
    Reported-by: Dario Faggioli <dfaggioli@suse.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit 59b087e3954402c487e0abb4ad9bd05f43669436)
---
 tools/ocaml/libs/xb/xenbus_stubs.c  | 2 +-
 tools/ocaml/libs/xc/xenctrl_stubs.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/ocaml/libs/xb/xenbus_stubs.c b/tools/ocaml/libs/xb/xenbus_stubs.c
index 001bb03371..3065181a55 100644
--- a/tools/ocaml/libs/xb/xenbus_stubs.c
+++ b/tools/ocaml/libs/xb/xenbus_stubs.c
@@ -65,7 +65,7 @@ CAMLprim value stub_string_of_header(value tid, value rid, value ty, value len)
 	};
 
 	ret = caml_alloc_string(sizeof(struct xsd_sockmsg));
-	memcpy(String_val(ret), &xsd, sizeof(struct xsd_sockmsg));
+	memcpy((char *) String_val(ret), &xsd, sizeof(struct xsd_sockmsg));
 
 	CAMLreturn(ret);
 }
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index c4fdc58b2d..cae33a8cb2 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -436,7 +436,7 @@ CAMLprim value stub_xc_vcpu_context_get(value xch, value domid,
 	ret = xc_vcpu_getcontext(_H(xch), _D(domid), Int_val(cpu), &ctxt);
 
 	context = caml_alloc_string(sizeof(ctxt));
-	memcpy(String_val(context), (char *) &ctxt.c, sizeof(ctxt.c));
+	memcpy((char *) String_val(context), &ctxt.c, sizeof(ctxt.c));
 
 	CAMLreturn(context);
 }
@@ -615,7 +615,7 @@ CAMLprim value stub_xc_readconsolering(value xch)
 		conring_size = size;
 
 	ring = caml_alloc_string(count);
-	memcpy(String_val(ring), str, count);
+	memcpy((char *) String_val(ring), str, count);
 	free(str);
 
 	CAMLreturn(ring);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:58:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:58:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99296.188750 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFdh-0003ID-Se; Fri, 19 Mar 2021 13:58:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99296.188750; Fri, 19 Mar 2021 13:58:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFdh-0003I5-PT; Fri, 19 Mar 2021 13:58:09 +0000
Received: by outflank-mailman (input) for mailman id 99296;
 Fri, 19 Mar 2021 13:58: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 1lNFdg-0003Ht-IG
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:58: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 1lNFdg-0004Ut-Hc
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:58:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFdg-0001q9-Gr
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:58:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7KqUYEki3hk+oXT9r/Bv/7xlxvmLJTE0bsP2Tro5AGM=; b=yoGqT9aic4a/uYsNjPihA3Wnxq
	lC8HkKwh58l3FyMtmbP7vht0OXXGUI6BPjZQrLnMxVzqQtOGfz1lCavucufz8oC/lRamAl057qoJz
	yAFiuCZnwwBMEyNvRGuQBFSY+7c+kbhR9EOF4+RkprSgnotA2NxBRnp2xPFzFLh6/tas=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] tools/ocaml: libxb: Avoid to use String_val() when value is bytes
Message-Id: <E1lNFdg-0001q9-Gr@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:58:08 +0000

commit 17db0ba37c16753bfbe3be07875a3aaa579c316b
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Mar 30 18:50:08 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:43 2021 +0000

    tools/ocaml: libxb: Avoid to use String_val() when value is bytes
    
    Commit ec7d54dd1a "ocaml/libs/xb: Use bytes in place of strings for
    mutable buffers" switch mutable buffers from string to bytes. However
    the C code were still using String_Val() to access them.
    
    While the underlying structure is the same between string and bytes, a
    string is meant to be immutable. OCaml 4.06.1 and later will enforce it.
    Therefore, it will not be possible to build the OCaml libs when using
    -safe-string. This is because String_val() will return a const value.
    
    To avoid plain cast in the code, the code is now switched to use
    Bytes_val(). As the macro is not defined in older OCaml version, we need
    to provide a stub.
    
    Take the opportunity to switch to const the buffer in
    ml_interface_write() as it should not be modified.
    
    Reported-by: Dario Faggioli <dfaggioli@suse.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit 78686437e949a85a207ae1a0d637efe2d3778bbe)
---
 tools/ocaml/libs/xb/xs_ring_stubs.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xb/xs_ring_stubs.c b/tools/ocaml/libs/xb/xs_ring_stubs.c
index 473787064a..7537a23949 100644
--- a/tools/ocaml/libs/xb/xs_ring_stubs.c
+++ b/tools/ocaml/libs/xb/xs_ring_stubs.c
@@ -36,6 +36,14 @@
 
 #define GET_C_STRUCT(a) ((struct mmap_interface *) a)
 
+/*
+ * Bytes_val has been introduced by Ocaml 4.06.1. So define our own version
+ * if needed.
+ */
+#ifndef Bytes_val
+#define Bytes_val(x) ((unsigned char *) Bp_val(x))
+#endif
+
 CAMLprim value ml_interface_read(value ml_interface,
                                  value ml_buffer,
                                  value ml_len)
@@ -44,7 +52,7 @@ CAMLprim value ml_interface_read(value ml_interface,
 	CAMLlocal1(ml_result);
 
 	struct mmap_interface *interface = GET_C_STRUCT(ml_interface);
-	char *buffer = String_val(ml_buffer);
+	unsigned char *buffer = Bytes_val(ml_buffer);
 	int len = Int_val(ml_len);
 	int result;
 
@@ -103,7 +111,7 @@ CAMLprim value ml_interface_write(value ml_interface,
 	CAMLlocal1(ml_result);
 
 	struct mmap_interface *interface = GET_C_STRUCT(ml_interface);
-	char *buffer = String_val(ml_buffer);
+	const unsigned char *buffer = Bytes_val(ml_buffer);
 	int len = Int_val(ml_len);
 	int result;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:58:19 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:58:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99297.188754 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFdr-0003Jp-U2; Fri, 19 Mar 2021 13:58:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99297.188754; Fri, 19 Mar 2021 13:58:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFdr-0003Jg-Qy; Fri, 19 Mar 2021 13:58:19 +0000
Received: by outflank-mailman (input) for mailman id 99297;
 Fri, 19 Mar 2021 13:58:18 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFdq-0003JU-L9
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:58:18 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFdq-0004VV-KV
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:58:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFdq-0001ql-Jo
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:58:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DQaoMuXAy0jZRgshDo5SmVVw2N5P43KfkSGoIWmSMNM=; b=Ck/USLdnq5dE8aB9gWbnnnfn7e
	U2gBEdDLvGu7ERoCHtFVUCfjRf8v2XGE8bWKXK6ex9FJPcE3msUG+93H1lsIctG7WNhAs950utFIG
	2ZlF3abjzRN/Hkk6N+p0Ie5MEJEDFp/4AsQKGNsHPvSFGR6b77aH0UdBy2X+hb+gX2EE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] tools/libxc: misc: Mark const the parameter 'keys' of xc_send_debug_keys()
Message-Id: <E1lNFdq-0001ql-Jo@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:58:18 +0000

commit b100d3e9acef5b0259b1826c310e90801cf29c01
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Mar 30 20:21:52 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:44 2021 +0000

    tools/libxc: misc: Mark const the parameter 'keys' of xc_send_debug_keys()
    
    OCaml is using a string to describe the parameter 'keys' of
    xc_send_debug_keys(). Since Ocaml 4.06.01, String_val() will return a
    const char * when using -safe-string. This will result to a build
    failure because xc_send_debug_keys() expects a char *.
    
    The function should never modify the parameter 'keys' and therefore the
    parameter should be const. Unfortunately, this is not directly possible
    because DECLARE_HYPERCALL_BOUNCE() is expecting a non-const variable.
    
    A new macro DECLARE_HYPERCALL_BOUNCE_IN() is introduced and will take
    care of const parameter. The first user will be xc_send_debug_keys() but
    this can be used in more place in the future.
    
    Reported-by: Dario Faggioli <dfaggioli@suse.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 2b8079610ec55413613ad071cc81cd9f97232a7e)
---
 tools/libxc/include/xenctrl.h | 2 +-
 tools/libxc/xc_misc.c         | 4 ++--
 tools/libxc/xc_private.h      | 8 ++++++++
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 31cdda76c6..833e12d5a1 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1226,7 +1226,7 @@ int xc_readconsolering(xc_interface *xch,
                        unsigned int *pnr_chars,
                        int clear, int incremental, uint32_t *pindex);
 
-int xc_send_debug_keys(xc_interface *xch, char *keys);
+int xc_send_debug_keys(xc_interface *xch, const char *keys);
 int xc_set_parameters(xc_interface *xch, char *params);
 
 typedef struct xen_sysctl_physinfo xc_physinfo_t;
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index 5e6714ae2b..8f2a2dee36 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -167,11 +167,11 @@ int xc_readconsolering(xc_interface *xch,
     return ret;
 }
 
-int xc_send_debug_keys(xc_interface *xch, char *keys)
+int xc_send_debug_keys(xc_interface *xch, const char *keys)
 {
     int ret, len = strlen(keys);
     DECLARE_SYSCTL;
-    DECLARE_HYPERCALL_BOUNCE(keys, len, XC_HYPERCALL_BUFFER_BOUNCE_IN);
+    DECLARE_HYPERCALL_BOUNCE_IN(keys, len);
 
     if ( xc_hypercall_bounce_pre(xch, keys) )
         return -1;
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index adc3b6a571..c77edb3c4c 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -181,6 +181,14 @@ enum {
  */
 #define DECLARE_HYPERCALL_BOUNCE(_ubuf, _sz, _dir) DECLARE_NAMED_HYPERCALL_BOUNCE(_ubuf, _ubuf, _sz, _dir)
 
+/*
+ * Declare a bounce buffer shadowing the named user data pointer that
+ * cannot be modified.
+ */
+#define DECLARE_HYPERCALL_BOUNCE_IN(_ubuf, _sz)                     \
+    DECLARE_NAMED_HYPERCALL_BOUNCE(_ubuf, (void *)(_ubuf), _sz,     \
+                                   XC_HYPERCALL_BUFFER_BOUNCE_IN)
+
 /*
  * Set the size of data to bounce. Useful when the size is not known
  * when the bounce buffer is declared.
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:58:29 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:58:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99298.188758 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFe1-0003L9-VM; Fri, 19 Mar 2021 13:58:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99298.188758; Fri, 19 Mar 2021 13:58:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFe1-0003L0-SW; Fri, 19 Mar 2021 13:58:29 +0000
Received: by outflank-mailman (input) for mailman id 99298;
 Fri, 19 Mar 2021 13:58: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 1lNFe0-0003Kr-Nm
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:58:28 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFe0-0004WW-N9
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:58:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFe0-0001rM-MV
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:58:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NjEkG3Uw0okLJWQwzIPaHKp+YUBq1hJMiQfNa9uD/qU=; b=cKnw4es6vyXK0d2l9TazWaUvHY
	gtvz7ns1D2B6R2W5cPlV2FKaiBUwG+hfX6U4VBnF/pOL1VqUEBVK+R67TmWYfSMlqh2UcmXjrNHQx
	taGJm58363DLysggfOLvKhFD7raf3J4WGo7lie4pfY8Ue+rZfTgXJMY76vsv/hBmlZeg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] oxenstored: fix ABI breakage introduced in Xen 4.9.0
Message-Id: <E1lNFe0-0001rM-MV@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:58:28 +0000

commit 26764c58a4d5e733d7ba7266c85b6f23b6701ec2
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Wed Jul 15 16:10:56 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:44 2021 +0000

    oxenstored: fix ABI breakage introduced in Xen 4.9.0
    
    dbc84d2983969bb47d294131ed9e6bbbdc2aec49 (Xen >= 4.9.0) deleted XS_RESTRICT
    from oxenstored, which caused all the following opcodes to be shifted by 1:
    reset_watches became off-by-one compared to the C version of xenstored.
    
    Looking at the C code the opcode for reset watches needs:
    XS_RESET_WATCHES = XS_SET_TARGET + 2
    
    So add the placeholder `Invalid` in the OCaml<->C mapping list.
    (Note that the code here doesn't simply convert the OCaml constructor to
     an integer, so we don't need to introduce a dummy constructor).
    
    Igor says that with a suitably patched xenopsd to enable watch reset,
    we now see `reset watches` during kdump of a guest in xenstored-access.log.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Tested-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit a6ed77f1e0334c26e6e216aea45f8674d9284856)
    (cherry picked from commit 9503a6df19924d2d9bf5b5a663342ba1507819c5)
---
 tools/ocaml/libs/xb/op.ml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ocaml/libs/xb/op.ml b/tools/ocaml/libs/xb/op.ml
index d4f1f08185..9bcab0f38c 100644
--- a/tools/ocaml/libs/xb/op.ml
+++ b/tools/ocaml/libs/xb/op.ml
@@ -28,7 +28,7 @@ let operation_c_mapping =
            Transaction_end; Introduce; Release;
            Getdomainpath; Write; Mkdir; Rm;
            Setperms; Watchevent; Error; Isintroduced;
-           Resume; Set_target; Reset_watches |]
+           Resume; Set_target; Invalid; Reset_watches |]
 let size = Array.length operation_c_mapping
 
 let array_search el a =
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:58:41 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:58:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99299.188762 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFeD-0003Mf-17; Fri, 19 Mar 2021 13:58:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99299.188762; Fri, 19 Mar 2021 13:58:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFeC-0003MX-U5; Fri, 19 Mar 2021 13:58:40 +0000
Received: by outflank-mailman (input) for mailman id 99299;
 Fri, 19 Mar 2021 13:58: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 1lNFeA-0003MN-Qt
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:58: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 1lNFeA-0004Wn-QA
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:58:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFeA-0001s5-PO
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:58: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=oGunUqajDE/l8jzNeyK53mjJiXUgscZlhiVb936Fx/8=; b=FaZm+W7a/Xxq6mLya93JhiTTZ4
	hCmSupedhIxjmrRyQP1Inm1u6I9iLyOEugMPPB6yshfHUoxEI85C5TbGM4ePRftqEsIg8s2UMqG6y
	gpwqGuCpx0GNWa2dGtaqOxxe9pwg+HefWDpXlwPK11vkTDUQorr0vuypEPVm/wP2m6Ok=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] tools/ocaml/libs/xb: Do not crash after xenbus is unmapped
Message-Id: <E1lNFeA-0001s5-PO@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:58:38 +0000

commit f66542f5d2217f3868d78ff64d11a2a02674fed9
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 18:23:10 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:44 2021 +0000

    tools/ocaml/libs/xb: Do not crash after xenbus is unmapped
    
    Xenmmap.unmap sets the address to MAP_FAILED in xenmmap_stubs.c.  If due to a
    bug there were still references to the Xenbus and we attempt to use it then we
    crash.  Raise an exception instead of crashing.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 5e317896342d553f0b55f72948bbf93a0f1147d3)
---
 tools/ocaml/libs/xb/xs_ring_stubs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/ocaml/libs/xb/xs_ring_stubs.c b/tools/ocaml/libs/xb/xs_ring_stubs.c
index 7537a23949..7a91fdee75 100644
--- a/tools/ocaml/libs/xb/xs_ring_stubs.c
+++ b/tools/ocaml/libs/xb/xs_ring_stubs.c
@@ -32,6 +32,7 @@
 #include <caml/fail.h>
 #include <caml/callback.h>
 
+#include <sys/mman.h>
 #include "mmap_stubs.h"
 
 #define GET_C_STRUCT(a) ((struct mmap_interface *) a)
@@ -166,6 +167,8 @@ CAMLprim value ml_interface_set_server_features(value interface, value v)
 {
 	CAMLparam2(interface, v);
 	struct xenstore_domain_interface *intf = GET_C_STRUCT(interface)->addr;
+	if (intf == (void*)MAP_FAILED)
+		caml_failwith("Interface closed");
 
 	intf->server_features = Int_val(v);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:58:50 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:58:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99300.188766 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFeM-0003O6-3z; Fri, 19 Mar 2021 13:58:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99300.188766; Fri, 19 Mar 2021 13:58:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFeM-0003Ny-12; Fri, 19 Mar 2021 13:58:50 +0000
Received: by outflank-mailman (input) for mailman id 99300;
 Fri, 19 Mar 2021 13:58: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 1lNFeK-0003Nq-U1
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:58: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 1lNFeK-0004XH-TI
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:58:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFeK-0001se-ST
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:58: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=GYevS6gIekUGdtZ5qGhG/+oDusJM5gcMVmTbEGOw2Gw=; b=xz3Rf9bvXt2jRxIpSQVccZypu+
	Y8ejOXtY0aZNwNSHP98F5C4v3UtD8iATu3znLSIysu4f2Os4geAE8r407Qq4hrjfwg3e27BqLAY5R
	sgROCAtNom8qqmskoDUo1NvfcnrrKaw8ZiQ1YF1K1VdMQuqrgp0lYV27QTgbwQB0SxY4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] tools/oxenstored: Trim txhistory on xenbus reconnect
Message-Id: <E1lNFeK-0001se-ST@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:58:48 +0000

commit b406997251c508209e0359e3d34208ced4f60d3c
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 8 11:57:37 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:44 2021 +0000

    tools/oxenstored: Trim txhistory on xenbus reconnect
    
    There is a global history, containing transactions from the past 0.05s, which
    get trimmed whenever any transaction commits or aborts.  Destroying a domain
    will cause xenopsd to perform some transactions deleting the tree, so that is
    fine.  But I think that a domain can abuse the xenbus reconnect facility to
    cause a large history to be recorded - provided that noone does any
    transactions on the system inbetween, which may be difficult to achieve given
    squeezed's constant pinging.
    
    The theoretical situation is like this:
    - a domain starts a transaction, creates as large a tree as it can, commits
      it. Then repeatedly:
        - start a transaction, do nothing with it, start a transaction, delete
          part of the large tree, write some new unique data there, don't commit
        - cause a xenbus reconnect (I think this can be done by writing something
          to the ring). This causes all transactions/watches for the connection to
          be cleared, but NOT the history, there were no commits, so nobody
          trimmed the history, i.e. it the history can contain transactions from
          more than just 0.05s
        - loop back and start more transactions, you can keep this up indefinitely
          without hitting quotas
    
    Now there is a periodic History.trim running every 0.05s, so I don't think you
    can do much damage with it.  But lets be safe an trim the transaction history
    anyway on reconnect.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit 2a47797d1f3b14aab4f0368ab833abd311f94a70)
---
 tools/ocaml/xenstored/connection.ml | 2 +-
 tools/ocaml/xenstored/history.ml    | 4 ++++
 tools/ocaml/xenstored/process.ml    | 4 ++--
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index fa0d3c4d92..850539e43a 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -47,7 +47,7 @@ let mark_as_bad con =
 
 let initial_next_tid = 1
 
-let reconnect con =
+let do_reconnect con =
 	Xenbus.Xb.reconnect con.xb;
 	(* dom is the same *)
 	Hashtbl.clear con.transactions;
diff --git a/tools/ocaml/xenstored/history.ml b/tools/ocaml/xenstored/history.ml
index f39565bff5..3899353da8 100644
--- a/tools/ocaml/xenstored/history.ml
+++ b/tools/ocaml/xenstored/history.ml
@@ -53,6 +53,10 @@ let end_transaction txn con tid commit =
 	trim ~txn ();
 	success
 
+let reconnect con =
+	trim ();
+	Connection.do_reconnect con
+
 let push (x: history_record) =
 	let dom = x.con.Connection.dom in
 	match dom with
diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml
index f51979926a..e9e2fc4810 100644
--- a/tools/ocaml/xenstored/process.ml
+++ b/tools/ocaml/xenstored/process.ml
@@ -560,7 +560,7 @@ let do_input store cons doms con =
 			Connection.do_input con
 		with Xenbus.Xb.Reconnect ->
 			info "%s requests a reconnect" (Connection.get_domstr con);
-			Connection.reconnect con;
+			History.reconnect con;
 			info "%s reconnection complete" (Connection.get_domstr con);
 			false
 		| Failure exp ->
@@ -599,7 +599,7 @@ let do_output _store _cons _doms con =
 			ignore (Connection.do_output con)
 		with Xenbus.Xb.Reconnect ->
 			info "%s requests a reconnect" (Connection.get_domstr con);
-			Connection.reconnect con;
+			History.reconnect con;
 			info "%s reconnection complete" (Connection.get_domstr con)
 	)
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:59:00 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:59:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99301.188769 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFeW-0003PQ-5T; Fri, 19 Mar 2021 13:59:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99301.188769; Fri, 19 Mar 2021 13:59:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFeW-0003PI-2d; Fri, 19 Mar 2021 13:59:00 +0000
Received: by outflank-mailman (input) for mailman id 99301;
 Fri, 19 Mar 2021 13:58:59 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFeV-0003PA-0T
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:58:59 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFeU-0004XO-W4
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:58:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFeU-0001uu-VM
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:58: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=co4sJ13Doiuv6nzHeognN3ukdpip6ePMo7gac5EyUJ4=; b=M3vU0f4AWRKs8gPGQtQBNd9bOo
	Vv6p4/JEvgoq/HCJEmTV43fkRdzUjpBQWzcUYTcCdlB9Ibidyl2BEffuPLG2/HAWHphEB9coIH9sO
	97TNalXWd1bSLqTM4c4lHunUWhjBxuLC12Xaxj5AaE9RK6/SWcrDR/iYmB0SNEm269lU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] tools/oxenstored: Fix quota calculation for mkdir EEXIST
Message-Id: <E1lNFeU-0001uu-VM@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:58:58 +0000

commit 1df73ab47bde4a83676f74ed28b48cda9ff881db
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:11:32 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:44 2021 +0000

    tools/oxenstored: Fix quota calculation for mkdir EEXIST
    
    We increment the domain's quota on mkdir even when the node already exists.
    This results in a quota inconsistency after live update, where reconstructing
    the tree from scratch results in a different quota.
    
    Not a security issue because the domain uses up quota faster, so it will only
    get a Quota error sooner than it should.
    
    Found by the structured fuzzer.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit c8b96708252a436da44005307f7c195d699bd7c5)
---
 tools/ocaml/xenstored/store.ml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml
index e20767372f..328d3a5198 100644
--- a/tools/ocaml/xenstored/store.ml
+++ b/tools/ocaml/xenstored/store.ml
@@ -421,6 +421,7 @@ let mkdir store perm path =
 	(* It's upt to the mkdir logic to decide what to do with existing path *)
 	if not (existing || (Perms.Connection.is_dom0 perm)) then Quota.check store.quota owner 0;
 	store.root <- path_mkdir store perm path;
+	if not existing then
 	Quota.add_entry store.quota owner
 
 let rm store perm path =
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:59:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:59:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99302.188774 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFeg-0003Qi-7H; Fri, 19 Mar 2021 13:59:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99302.188774; Fri, 19 Mar 2021 13:59: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 1lNFeg-0003Qa-4D; Fri, 19 Mar 2021 13:59:10 +0000
Received: by outflank-mailman (input) for mailman id 99302;
 Fri, 19 Mar 2021 13:59:09 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFef-0003QS-3N
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:59:09 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFef-0004Xl-2l
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:59:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFef-0001vn-1q
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:59:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9x+RuYcN766ngPH3YTPJ7ryJkbBupKrS9PMH87WGjJE=; b=3TESXdDxG97+UTDGeF4xnPY5LV
	cRDrHR5p7I2ePKpfTmK4hbb6bcOqwH0R5etonEnqYxynSO34UW1LnrMZC8T0N1fEDdCxDXBP3Btur
	bFc2YubZH2p5WBCD/Ef+Lh7rHwest7cbLy+KmHawXoC5RpfuncI0dXZH0kliBVDQjQRw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] tools/oxenstored: Reject invalid watch paths early
Message-Id: <E1lNFef-0001vn-1q@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:59:09 +0000

commit cd5666c62f9eca819eb8d89054023c703d2c9994
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:28:37 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:44 2021 +0000

    tools/oxenstored: Reject invalid watch paths early
    
    Watches on invalid paths were accepted, but they would never trigger.  The
    client also got no notification that its watch is bad and would never trigger.
    
    Found again by the structured fuzzer, due to an error on live update reload:
    the invalid watch paths would get rejected during live update and the list of
    watches would be different pre/post live update.
    
    The testcase is watch on `//`, which is an invalid path.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit dc8caf214fb882546b0e93317b9828247a7c9da8)
---
 tools/ocaml/xenstored/connection.ml  | 5 ++---
 tools/ocaml/xenstored/connections.ml | 4 +++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index 850539e43a..daf8d804f7 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -158,18 +158,17 @@ let get_children_watches con path =
 let is_dom0 con =
 	Perms.Connection.is_dom0 (get_perm con)
 
-let add_watch con path token =
+let add_watch con (path, apath) token =
 	if !Quota.activate && !Define.maxwatch > 0 &&
 	   not (is_dom0 con) && con.nb_watches > !Define.maxwatch then
 		raise Quota.Limit_reached;
-	let apath = get_watch_path con path in
 	let l = get_watches con apath in
 	if List.exists (fun w -> w.token = token) l then
 		raise Define.Already_exist;
 	let watch = watch_create ~con ~token ~path in
 	Hashtbl.replace con.watches apath (watch :: l);
 	con.nb_watches <- con.nb_watches + 1;
-	apath, watch
+	watch
 
 let del_watch con path token =
 	let apath = get_watch_path con path in
diff --git a/tools/ocaml/xenstored/connections.ml b/tools/ocaml/xenstored/connections.ml
index 1a70d412d5..7efdf3e5e0 100644
--- a/tools/ocaml/xenstored/connections.ml
+++ b/tools/ocaml/xenstored/connections.ml
@@ -114,8 +114,10 @@ let key_of_path path =
 	"" :: Store.Path.to_string_list path
 
 let add_watch cons con path token =
-	let apath, watch = Connection.add_watch con path token in
+	let apath = Connection.get_watch_path con path in
+	(* fail on invalid paths early by calling key_of_str before adding watch *)
 	let key = key_of_str apath in
+	let watch = Connection.add_watch con (path, apath) token in
 	let watches =
  		if Trie.mem cons.watches key
  		then Trie.find cons.watches key
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:59:20 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:59:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99303.188778 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFeq-0003Ry-8v; Fri, 19 Mar 2021 13:59:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99303.188778; Fri, 19 Mar 2021 13:59:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFeq-0003Rq-5r; Fri, 19 Mar 2021 13:59:20 +0000
Received: by outflank-mailman (input) for mailman id 99303;
 Fri, 19 Mar 2021 13:59:19 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFep-0003Ri-6X
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:59:19 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFep-0004Xo-5q
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:59:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFep-0001wH-4p
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:59:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Mr3Uh0DgA/ZbuPN2Xz8E1HuSq6htWMkmfYdZXoHN/IM=; b=KIB2C1/dPDF2LE3nZZqCNo+RmY
	rR4COhum8hLUQOW2fl5YnFPkFObGmFltf3DYqK2cSL9gxQ/ZZRtHrxeemz5SP4yOJjziz9YoUA7by
	oRFCoK+6SN2V7pO+khtLfct2sPrw9K+xdacmnbAUrGXgic9lOxKFGPNo+bXRJLz6spQk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] tools/oxenstored: mkdir conflicts were sometimes missed
Message-Id: <E1lNFep-0001wH-4p@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:59:19 +0000

commit 955c60401a62bcdd0549bec958eaae4f9f17fb89
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:38:58 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:44 2021 +0000

    tools/oxenstored: mkdir conflicts were sometimes missed
    
    Due to how set_write_lowpath was used here it didn't detect create/delete
    conflicts.  When we create an entry we must mark our parent as modified
    (this is what creating a new node via write does).
    
    Otherwise we can have 2 transactions one creating, and another deleting a node
    both succeeding depending on timing.  Or one transaction reading an entry,
    concluding it doesn't exist, do some other work based on that information and
    successfully commit even if another transaction creates the node via mkdir
    meanwhile.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit 45dee7d92b493bb531e7e77a6f9c0180ab152f87)
---
 tools/ocaml/xenstored/transaction.ml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/transaction.ml b/tools/ocaml/xenstored/transaction.ml
index 25bc8c3b4a..17b1bdf2ea 100644
--- a/tools/ocaml/xenstored/transaction.ml
+++ b/tools/ocaml/xenstored/transaction.ml
@@ -165,7 +165,7 @@ let write t perm path value =
 
 let mkdir ?(with_watch=true) t perm path =
 	Store.mkdir t.store perm path;
-	set_write_lowpath t path;
+	set_write_lowpath t (Store.Path.get_parent path);
 	if with_watch then
 		add_wop t Xenbus.Xb.Op.Mkdir path
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:59:31 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:59:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99304.188782 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFf1-0003TS-AJ; Fri, 19 Mar 2021 13:59:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99304.188782; Fri, 19 Mar 2021 13:59: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 1lNFf1-0003TK-7M; Fri, 19 Mar 2021 13:59:31 +0000
Received: by outflank-mailman (input) for mailman id 99304;
 Fri, 19 Mar 2021 13:59: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 1lNFf0-0003TC-3Q
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:59: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 1lNFf0-0004Xw-2o
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:59:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFf0-0001yf-22
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:59: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=DBEhLHGebvG9fXFMSnw6nx/uGLGaQWCo7FmqsbDtLos=; b=PmUxOonu4aTMJknAVF+ZEG8xMB
	MvSwwmYnjsOMbhq5L6Akc26pj6VsZq+58wrI1ihbV6saZmquEOnKLyqR+67G9G14OlkQQt28ZC8f1
	POlmAh0xawZhVv02ilbxzyLuQGUm8eCfwR+caJFWGI/5lTH6gLaMMDm0W6NfY+QP5xCY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] tools/ocaml: libxb: Harden stub_header_of_string()
Message-Id: <E1lNFf0-0001yf-22@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:59:30 +0000

commit 939164f40a9d060e086554e2d6d36346b9be7637
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Mar 30 14:29:10 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:25 2021 +0000

    tools/ocaml: libxb: Harden stub_header_of_string()
    
    stub_header_of_string() should not modify the header. So mark the
    variable 'hdr' as const.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit d92ba1aa7cf877a77abdcbd94a6a19fc55886a75)
---
 tools/ocaml/libs/xb/xenbus_stubs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xb/xenbus_stubs.c b/tools/ocaml/libs/xb/xenbus_stubs.c
index a68e783f70..001bb03371 100644
--- a/tools/ocaml/libs/xb/xenbus_stubs.c
+++ b/tools/ocaml/libs/xb/xenbus_stubs.c
@@ -40,12 +40,12 @@ CAMLprim value stub_header_of_string(value s)
 {
 	CAMLparam1(s);
 	CAMLlocal1(ret);
-	struct xsd_sockmsg *hdr;
+	const struct xsd_sockmsg *hdr;
 
 	if (caml_string_length(s) != sizeof(struct xsd_sockmsg))
 		caml_failwith("xb header incomplete");
 	ret = caml_alloc_tuple(4);
-	hdr = (struct xsd_sockmsg *) String_val(s);
+	hdr = (const struct xsd_sockmsg *) String_val(s);
 	Store_field(ret, 0, Val_int(hdr->tx_id));
 	Store_field(ret, 1, Val_int(hdr->req_id));
 	Store_field(ret, 2, Val_int(hdr->type));
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:59:41 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:59:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99305.188786 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFfB-0003Ux-Bo; Fri, 19 Mar 2021 13:59:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99305.188786; Fri, 19 Mar 2021 13:59: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 1lNFfB-0003Up-8y; Fri, 19 Mar 2021 13:59:41 +0000
Received: by outflank-mailman (input) for mailman id 99305;
 Fri, 19 Mar 2021 13:59: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 1lNFfA-0003Ug-6S
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:59: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 1lNFfA-0004ZN-5m
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:59:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFfA-0001zI-4z
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:59: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=3QdgpE9HqhhM6KctvL1TwuqseenfWF6GRTBC/VGqUQ4=; b=C5Djg6cknWAIU4T2UAI+12QdxB
	5llNGYteIDU9uFxP8pvB7a4dIVpBBCH10aekpj31aKtJ+vR5ZllibLVXflqCfC8ZDysLj49xHvrBx
	2dii4Ly7cwnsXkpVYAUvdCHFTxt3K9hyK86Gm/7DZ8NbY0Y5D2qFx9sSwGW2qMpGlYMY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] tools/ocaml: Fix stubs build when OCaml has been compiled with -safe-string
Message-Id: <E1lNFfA-0001zI-4z@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:59:40 +0000

commit 4288da8d60def02aa0a176cbc38cf794ab309238
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Mar 30 15:14:23 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:25 2021 +0000

    tools/ocaml: Fix stubs build when OCaml has been compiled with -safe-string
    
    The OCaml code has been fixed to handle properly -safe-string in Xen
    4.11, however the stubs part were missed.
    
    On OCaml newer than 4.06.1, String_Val() will return a const char *
    when using -safe-string leading to build failure when this is used
    in place where char * is expected.
    
    The main use in Xen code base is when a new string is allocated. The
    suggested approach by the OCaml community [1] is to use the helper
    caml_alloc_initialized_string() but it was introduced by OCaml 4.06.1.
    
    The next best approach is to cast String_val() to (char *) as the helper
    would have done. So use it when we need to update the new string using
    memcpy().
    
    Take the opportunity to remove the unnecessary cast of the source as
    mempcy() is expecting a void *.
    
    [1] https://github.com/ocaml/ocaml/pull/1274
    
    Reported-by: Dario Faggioli <dfaggioli@suse.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit 59b087e3954402c487e0abb4ad9bd05f43669436)
---
 tools/ocaml/libs/xb/xenbus_stubs.c  | 2 +-
 tools/ocaml/libs/xc/xenctrl_stubs.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/ocaml/libs/xb/xenbus_stubs.c b/tools/ocaml/libs/xb/xenbus_stubs.c
index 001bb03371..3065181a55 100644
--- a/tools/ocaml/libs/xb/xenbus_stubs.c
+++ b/tools/ocaml/libs/xb/xenbus_stubs.c
@@ -65,7 +65,7 @@ CAMLprim value stub_string_of_header(value tid, value rid, value ty, value len)
 	};
 
 	ret = caml_alloc_string(sizeof(struct xsd_sockmsg));
-	memcpy(String_val(ret), &xsd, sizeof(struct xsd_sockmsg));
+	memcpy((char *) String_val(ret), &xsd, sizeof(struct xsd_sockmsg));
 
 	CAMLreturn(ret);
 }
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index d4309ad97e..14f4f111c1 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -405,7 +405,7 @@ CAMLprim value stub_xc_vcpu_context_get(value xch, value domid,
 	ret = xc_vcpu_getcontext(_H(xch), _D(domid), Int_val(cpu), &ctxt);
 
 	context = caml_alloc_string(sizeof(ctxt));
-	memcpy(String_val(context), (char *) &ctxt.c, sizeof(ctxt.c));
+	memcpy((char *) String_val(context), &ctxt.c, sizeof(ctxt.c));
 
 	CAMLreturn(context);
 }
@@ -584,7 +584,7 @@ CAMLprim value stub_xc_readconsolering(value xch)
 		conring_size = size;
 
 	ring = caml_alloc_string(count);
-	memcpy(String_val(ring), str, count);
+	memcpy((char *) String_val(ring), str, count);
 	free(str);
 
 	CAMLreturn(ring);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 13:59:51 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 13:59:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99306.188789 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFfL-0003WH-Du; Fri, 19 Mar 2021 13:59:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99306.188789; Fri, 19 Mar 2021 13:59:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFfL-0003W7-AT; Fri, 19 Mar 2021 13:59:51 +0000
Received: by outflank-mailman (input) for mailman id 99306;
 Fri, 19 Mar 2021 13:59:50 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFfK-0003Vx-9E
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:59:50 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFfK-0004a0-8c
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:59:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFfK-0001zv-7s
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 13:59:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WqnF++RhXy6MH4ASYXGJ9p+cT237uICE3XWCLMpvgSo=; b=MCWHSIwtgLICPU9pk26535LQ4D
	CvwdDA5X/9B1ZhnlH+NuAicZZF7Pw5eAUmmjostQ1aX7xqgw7rcSXvlJGhUU20G9CIhr+d0NlP7pR
	Mbb9hZSC0avjpFbEXmbyilQ8qqp4OGbYzaufR+PYplkfGI0IERsDgF9b69gFoXfCcTrw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] tools/ocaml: libxb: Avoid to use String_val() when value is bytes
Message-Id: <E1lNFfK-0001zv-7s@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 13:59:50 +0000

commit e8067088d255333487e01bfa59f4a0524172719c
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Mar 30 18:50:08 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:25 2021 +0000

    tools/ocaml: libxb: Avoid to use String_val() when value is bytes
    
    Commit ec7d54dd1a "ocaml/libs/xb: Use bytes in place of strings for
    mutable buffers" switch mutable buffers from string to bytes. However
    the C code were still using String_Val() to access them.
    
    While the underlying structure is the same between string and bytes, a
    string is meant to be immutable. OCaml 4.06.1 and later will enforce it.
    Therefore, it will not be possible to build the OCaml libs when using
    -safe-string. This is because String_val() will return a const value.
    
    To avoid plain cast in the code, the code is now switched to use
    Bytes_val(). As the macro is not defined in older OCaml version, we need
    to provide a stub.
    
    Take the opportunity to switch to const the buffer in
    ml_interface_write() as it should not be modified.
    
    Reported-by: Dario Faggioli <dfaggioli@suse.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit 78686437e949a85a207ae1a0d637efe2d3778bbe)
---
 tools/ocaml/libs/xb/xs_ring_stubs.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xb/xs_ring_stubs.c b/tools/ocaml/libs/xb/xs_ring_stubs.c
index 473787064a..7537a23949 100644
--- a/tools/ocaml/libs/xb/xs_ring_stubs.c
+++ b/tools/ocaml/libs/xb/xs_ring_stubs.c
@@ -36,6 +36,14 @@
 
 #define GET_C_STRUCT(a) ((struct mmap_interface *) a)
 
+/*
+ * Bytes_val has been introduced by Ocaml 4.06.1. So define our own version
+ * if needed.
+ */
+#ifndef Bytes_val
+#define Bytes_val(x) ((unsigned char *) Bp_val(x))
+#endif
+
 CAMLprim value ml_interface_read(value ml_interface,
                                  value ml_buffer,
                                  value ml_len)
@@ -44,7 +52,7 @@ CAMLprim value ml_interface_read(value ml_interface,
 	CAMLlocal1(ml_result);
 
 	struct mmap_interface *interface = GET_C_STRUCT(ml_interface);
-	char *buffer = String_val(ml_buffer);
+	unsigned char *buffer = Bytes_val(ml_buffer);
 	int len = Int_val(ml_len);
 	int result;
 
@@ -103,7 +111,7 @@ CAMLprim value ml_interface_write(value ml_interface,
 	CAMLlocal1(ml_result);
 
 	struct mmap_interface *interface = GET_C_STRUCT(ml_interface);
-	char *buffer = String_val(ml_buffer);
+	const unsigned char *buffer = Bytes_val(ml_buffer);
 	int len = Int_val(ml_len);
 	int result;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 14:00:01 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 14:00:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99307.188793 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFfV-0003Xg-Gd; Fri, 19 Mar 2021 14:00:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99307.188793; Fri, 19 Mar 2021 14:00:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFfV-0003XZ-DY; Fri, 19 Mar 2021 14:00:01 +0000
Received: by outflank-mailman (input) for mailman id 99307;
 Fri, 19 Mar 2021 14:00:00 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFfU-0003XQ-CA
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:00:00 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFfU-0004aB-BY
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:00:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFfU-00020g-Aq
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:00:00 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RLlrEfZivXhkezkABXMEh/fUWpNG1qfXzoM9YCoIoGY=; b=L6QgYdIug/tY1q+HigvaYJGDUG
	lVty1wsvQldZD/8gkWJV+hBfqtSpakZ+s4SfrVYHLM0tNFClFFznmANHyr2kodlGtlnSyX3LHFvdy
	vaTvHTfd3WzzVlsJzbqfIJ/2MRVkpu49dWabSMyu5vhnWtyyXGsYsIkAzkjfnnjlane8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] tools/libxc: misc: Mark const the parameter 'keys' of xc_send_debug_keys()
Message-Id: <E1lNFfU-00020g-Aq@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 14:00:00 +0000

commit 04dd325167041c2d22571cff72893916a4d93e47
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Mar 30 20:21:52 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:25 2021 +0000

    tools/libxc: misc: Mark const the parameter 'keys' of xc_send_debug_keys()
    
    OCaml is using a string to describe the parameter 'keys' of
    xc_send_debug_keys(). Since Ocaml 4.06.01, String_val() will return a
    const char * when using -safe-string. This will result to a build
    failure because xc_send_debug_keys() expects a char *.
    
    The function should never modify the parameter 'keys' and therefore the
    parameter should be const. Unfortunately, this is not directly possible
    because DECLARE_HYPERCALL_BOUNCE() is expecting a non-const variable.
    
    A new macro DECLARE_HYPERCALL_BOUNCE_IN() is introduced and will take
    care of const parameter. The first user will be xc_send_debug_keys() but
    this can be used in more place in the future.
    
    Reported-by: Dario Faggioli <dfaggioli@suse.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 2b8079610ec55413613ad071cc81cd9f97232a7e)
---
 tools/libxc/include/xenctrl.h | 2 +-
 tools/libxc/xc_misc.c         | 4 ++--
 tools/libxc/xc_private.h      | 8 ++++++++
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 408fa1c6a4..f7f1023231 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1243,7 +1243,7 @@ int xc_readconsolering(xc_interface *xch,
                        unsigned int *pnr_chars,
                        int clear, int incremental, uint32_t *pindex);
 
-int xc_send_debug_keys(xc_interface *xch, char *keys);
+int xc_send_debug_keys(xc_interface *xch, const char *keys);
 int xc_set_parameters(xc_interface *xch, char *params);
 
 typedef struct xen_sysctl_physinfo xc_physinfo_t;
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index 5e6714ae2b..8f2a2dee36 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -167,11 +167,11 @@ int xc_readconsolering(xc_interface *xch,
     return ret;
 }
 
-int xc_send_debug_keys(xc_interface *xch, char *keys)
+int xc_send_debug_keys(xc_interface *xch, const char *keys)
 {
     int ret, len = strlen(keys);
     DECLARE_SYSCTL;
-    DECLARE_HYPERCALL_BOUNCE(keys, len, XC_HYPERCALL_BUFFER_BOUNCE_IN);
+    DECLARE_HYPERCALL_BOUNCE_IN(keys, len);
 
     if ( xc_hypercall_bounce_pre(xch, keys) )
         return -1;
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 03bdfca7d4..c2921e1ee9 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -187,6 +187,14 @@ enum {
  */
 #define DECLARE_HYPERCALL_BOUNCE(_ubuf, _sz, _dir) DECLARE_NAMED_HYPERCALL_BOUNCE(_ubuf, _ubuf, _sz, _dir)
 
+/*
+ * Declare a bounce buffer shadowing the named user data pointer that
+ * cannot be modified.
+ */
+#define DECLARE_HYPERCALL_BOUNCE_IN(_ubuf, _sz)                     \
+    DECLARE_NAMED_HYPERCALL_BOUNCE(_ubuf, (void *)(_ubuf), _sz,     \
+                                   XC_HYPERCALL_BUFFER_BOUNCE_IN)
+
 /*
  * Set the size of data to bounce. Useful when the size is not known
  * when the bounce buffer is declared.
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 14:00:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 14:00:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99308.188798 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFff-0004LJ-I3; Fri, 19 Mar 2021 14:00:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99308.188798; Fri, 19 Mar 2021 14:00: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 1lNFff-0004LB-F9; Fri, 19 Mar 2021 14:00:11 +0000
Received: by outflank-mailman (input) for mailman id 99308;
 Fri, 19 Mar 2021 14:00: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 1lNFfe-0004L2-Pp
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:00: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 1lNFfe-0004gr-Ey
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:00:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFfe-00022x-Dy
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:00:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MmZZq00a5jHPhb3gPw0HSvnR6Xi/pit0ZovzxIhxJIo=; b=KfUMNFRuopRzulrlCI48ASQtNY
	Mw5AXPC32SzhOwBrsa78WNm34Dx9atae7uzf38mYbCZk5gb2KsUU+vjtBJkrY2hnRxLkEgSWWxJ3R
	y7FS8HFdfL4gRLD4BwGwRnIQUgUr2eMyBjjw+SD43Nwc/H0LngCmq8ADKb/Jfnh2V7fc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] oxenstored: fix ABI breakage introduced in Xen 4.9.0
Message-Id: <E1lNFfe-00022x-Dy@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 14:00:10 +0000

commit a0ae69c94d471eb7113b146526520a5d75852051
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Wed Jul 15 16:10:56 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:25 2021 +0000

    oxenstored: fix ABI breakage introduced in Xen 4.9.0
    
    dbc84d2983969bb47d294131ed9e6bbbdc2aec49 (Xen >= 4.9.0) deleted XS_RESTRICT
    from oxenstored, which caused all the following opcodes to be shifted by 1:
    reset_watches became off-by-one compared to the C version of xenstored.
    
    Looking at the C code the opcode for reset watches needs:
    XS_RESET_WATCHES = XS_SET_TARGET + 2
    
    So add the placeholder `Invalid` in the OCaml<->C mapping list.
    (Note that the code here doesn't simply convert the OCaml constructor to
     an integer, so we don't need to introduce a dummy constructor).
    
    Igor says that with a suitably patched xenopsd to enable watch reset,
    we now see `reset watches` during kdump of a guest in xenstored-access.log.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Tested-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit a6ed77f1e0334c26e6e216aea45f8674d9284856)
    (cherry picked from commit 9503a6df19924d2d9bf5b5a663342ba1507819c5)
---
 tools/ocaml/libs/xb/op.ml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ocaml/libs/xb/op.ml b/tools/ocaml/libs/xb/op.ml
index d4f1f08185..9bcab0f38c 100644
--- a/tools/ocaml/libs/xb/op.ml
+++ b/tools/ocaml/libs/xb/op.ml
@@ -28,7 +28,7 @@ let operation_c_mapping =
            Transaction_end; Introduce; Release;
            Getdomainpath; Write; Mkdir; Rm;
            Setperms; Watchevent; Error; Isintroduced;
-           Resume; Set_target; Reset_watches |]
+           Resume; Set_target; Invalid; Reset_watches |]
 let size = Array.length operation_c_mapping
 
 let array_search el a =
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 14:00:21 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 14:00:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99309.188802 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFfp-0004MS-Jd; Fri, 19 Mar 2021 14:00:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99309.188802; Fri, 19 Mar 2021 14:00: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 1lNFfp-0004MK-Gf; Fri, 19 Mar 2021 14:00:21 +0000
Received: by outflank-mailman (input) for mailman id 99309;
 Fri, 19 Mar 2021 14:00: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 1lNFfo-0004MC-KF
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:00: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 1lNFfo-0004h3-Jd
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:00:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFfo-00024b-Gy
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:00: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=xJ1wknSYxf3lwj6tGAAJEzI6+M4rbbxgeVLhJX/yNqA=; b=OPqoo07t9SyefcWLahgnpT9vRM
	qHKFkZJRvmtf4h4wHdblNjcEHl1grlNwftQ5qGHUvc4BEctRy1OWwy3aveC5S0xL5TW3fkhg3VLr4
	c5CoN99qmiDEybJBihEbiRIbRVKjaufkW8CbfjuG52LkUm+UqUe+hMSKUN6qLuFIRTRU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] tools/ocaml/libs/xb: Do not crash after xenbus is unmapped
Message-Id: <E1lNFfo-00024b-Gy@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 14:00:20 +0000

commit efe63c57ede19aa6fb518b04678bbe5148833c35
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 18:23:10 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:25 2021 +0000

    tools/ocaml/libs/xb: Do not crash after xenbus is unmapped
    
    Xenmmap.unmap sets the address to MAP_FAILED in xenmmap_stubs.c.  If due to a
    bug there were still references to the Xenbus and we attempt to use it then we
    crash.  Raise an exception instead of crashing.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 5e317896342d553f0b55f72948bbf93a0f1147d3)
---
 tools/ocaml/libs/xb/xs_ring_stubs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/ocaml/libs/xb/xs_ring_stubs.c b/tools/ocaml/libs/xb/xs_ring_stubs.c
index 7537a23949..7a91fdee75 100644
--- a/tools/ocaml/libs/xb/xs_ring_stubs.c
+++ b/tools/ocaml/libs/xb/xs_ring_stubs.c
@@ -32,6 +32,7 @@
 #include <caml/fail.h>
 #include <caml/callback.h>
 
+#include <sys/mman.h>
 #include "mmap_stubs.h"
 
 #define GET_C_STRUCT(a) ((struct mmap_interface *) a)
@@ -166,6 +167,8 @@ CAMLprim value ml_interface_set_server_features(value interface, value v)
 {
 	CAMLparam2(interface, v);
 	struct xenstore_domain_interface *intf = GET_C_STRUCT(interface)->addr;
+	if (intf == (void*)MAP_FAILED)
+		caml_failwith("Interface closed");
 
 	intf->server_features = Int_val(v);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 14:00:31 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 14:00:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99310.188806 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFfz-0004Nk-LL; Fri, 19 Mar 2021 14:00:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99310.188806; Fri, 19 Mar 2021 14:00: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 1lNFfz-0004Nc-IE; Fri, 19 Mar 2021 14:00:31 +0000
Received: by outflank-mailman (input) for mailman id 99310;
 Fri, 19 Mar 2021 14:00: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 1lNFfy-0004NW-OM
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:00: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 1lNFfy-0004hB-Nf
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:00:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFfy-00025M-M3
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:00: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=iwoprjogAzeyYMq21WRl+hLcZBZVNRACoyZBfPMDJHU=; b=bsyjdvdBqp0Lhrl+2GY6jxPN0l
	KKqiWbu3wmVwqM2B16eyDOCNI4dD+PrEBvMzdKyXbJUV9FM78qxV68Dpsz/qPP8+7Gk0OHFZC/o1m
	V+VTYn+22MH49ZQgE6t91YgUxzHOZe4W7UP3h+0W2ErPBvi7EKK+rhZRMFrQKO9EuwQA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] tools/oxenstored: Trim txhistory on xenbus reconnect
Message-Id: <E1lNFfy-00025M-M3@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 14:00:30 +0000

commit f4adc4dbea4793d07faa52a85350322aed5ca8a2
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 8 11:57:37 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:25 2021 +0000

    tools/oxenstored: Trim txhistory on xenbus reconnect
    
    There is a global history, containing transactions from the past 0.05s, which
    get trimmed whenever any transaction commits or aborts.  Destroying a domain
    will cause xenopsd to perform some transactions deleting the tree, so that is
    fine.  But I think that a domain can abuse the xenbus reconnect facility to
    cause a large history to be recorded - provided that noone does any
    transactions on the system inbetween, which may be difficult to achieve given
    squeezed's constant pinging.
    
    The theoretical situation is like this:
    - a domain starts a transaction, creates as large a tree as it can, commits
      it. Then repeatedly:
        - start a transaction, do nothing with it, start a transaction, delete
          part of the large tree, write some new unique data there, don't commit
        - cause a xenbus reconnect (I think this can be done by writing something
          to the ring). This causes all transactions/watches for the connection to
          be cleared, but NOT the history, there were no commits, so nobody
          trimmed the history, i.e. it the history can contain transactions from
          more than just 0.05s
        - loop back and start more transactions, you can keep this up indefinitely
          without hitting quotas
    
    Now there is a periodic History.trim running every 0.05s, so I don't think you
    can do much damage with it.  But lets be safe an trim the transaction history
    anyway on reconnect.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit 2a47797d1f3b14aab4f0368ab833abd311f94a70)
---
 tools/ocaml/xenstored/connection.ml | 2 +-
 tools/ocaml/xenstored/history.ml    | 4 ++++
 tools/ocaml/xenstored/process.ml    | 4 ++--
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index 698f721345..0d4dcda771 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -47,7 +47,7 @@ let mark_as_bad con =
 
 let initial_next_tid = 1
 
-let reconnect con =
+let do_reconnect con =
 	Xenbus.Xb.reconnect con.xb;
 	(* dom is the same *)
 	Hashtbl.clear con.transactions;
diff --git a/tools/ocaml/xenstored/history.ml b/tools/ocaml/xenstored/history.ml
index f39565bff5..3899353da8 100644
--- a/tools/ocaml/xenstored/history.ml
+++ b/tools/ocaml/xenstored/history.ml
@@ -53,6 +53,10 @@ let end_transaction txn con tid commit =
 	trim ~txn ();
 	success
 
+let reconnect con =
+	trim ();
+	Connection.do_reconnect con
+
 let push (x: history_record) =
 	let dom = x.con.Connection.dom in
 	match dom with
diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml
index 12ad66fce6..59efae447d 100644
--- a/tools/ocaml/xenstored/process.ml
+++ b/tools/ocaml/xenstored/process.ml
@@ -560,7 +560,7 @@ let do_input store cons doms con =
 			Connection.do_input con
 		with Xenbus.Xb.Reconnect ->
 			info "%s requests a reconnect" (Connection.get_domstr con);
-			Connection.reconnect con;
+			History.reconnect con;
 			info "%s reconnection complete" (Connection.get_domstr con);
 			false
 		| Failure exp ->
@@ -599,7 +599,7 @@ let do_output store cons doms con =
 			ignore (Connection.do_output con)
 		with Xenbus.Xb.Reconnect ->
 			info "%s requests a reconnect" (Connection.get_domstr con);
-			Connection.reconnect con;
+			History.reconnect con;
 			info "%s reconnection complete" (Connection.get_domstr con)
 	)
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 14:00:41 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 14:00:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99311.188810 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFg9-0004PE-Mt; Fri, 19 Mar 2021 14:00:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99311.188810; Fri, 19 Mar 2021 14:00: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 1lNFg9-0004P5-Jn; Fri, 19 Mar 2021 14:00:41 +0000
Received: by outflank-mailman (input) for mailman id 99311;
 Fri, 19 Mar 2021 14:00: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 1lNFg8-0004Oy-Sd
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:00: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 1lNFg8-0004hJ-Qr
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:00:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFg8-00026H-Px
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:00:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pKPiJa4tlvlvn8HmMXjIadrnbdf2/2YKRxSSYPQE4eg=; b=XqbZHVFSTXGZXdtoNlYQMCQOHO
	j6lHnNFPRxE5ABKItpPLxFULIe8VVSzg983AInSB3t1FkyELXP9/o/b2OX1Hli4CXheUTPQVe8Bwg
	XUH1Cqav36AeJEVNv1DvWha/j/oEoja1sbeF4MLTc/hXhrTBJGT43ATvhtI5iG07SIIs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] tools/oxenstored: Fix quota calculation for mkdir EEXIST
Message-Id: <E1lNFg8-00026H-Px@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 14:00:40 +0000

commit 131d98fcd47fdb62548f022635fb4adc09e83a32
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:11:32 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:25 2021 +0000

    tools/oxenstored: Fix quota calculation for mkdir EEXIST
    
    We increment the domain's quota on mkdir even when the node already exists.
    This results in a quota inconsistency after live update, where reconstructing
    the tree from scratch results in a different quota.
    
    Not a security issue because the domain uses up quota faster, so it will only
    get a Quota error sooner than it should.
    
    Found by the structured fuzzer.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit c8b96708252a436da44005307f7c195d699bd7c5)
---
 tools/ocaml/xenstored/store.ml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml
index 2a694562bb..7253ac0fcf 100644
--- a/tools/ocaml/xenstored/store.ml
+++ b/tools/ocaml/xenstored/store.ml
@@ -421,6 +421,7 @@ let mkdir store perm path =
 	(* It's upt to the mkdir logic to decide what to do with existing path *)
 	if not (existing || (Perms.Connection.is_dom0 perm)) then Quota.check store.quota owner 0;
 	store.root <- path_mkdir store perm path;
+	if not existing then
 	Quota.add_entry store.quota owner
 
 let rm store perm path =
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 14:00:51 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 14:00:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99312.188813 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFgJ-0004QK-OL; Fri, 19 Mar 2021 14:00:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99312.188813; Fri, 19 Mar 2021 14:00:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFgJ-0004QC-LT; Fri, 19 Mar 2021 14:00:51 +0000
Received: by outflank-mailman (input) for mailman id 99312;
 Fri, 19 Mar 2021 14:00: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 1lNFgI-0004Q3-Uy
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:00:50 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFgI-0004hk-UJ
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:00:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFgI-000275-T4
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:00:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XfpIh+oApEKol7CYaJovivLckZn+N4AaGT9jOokLJtM=; b=bXlhWfv7XCLkoT/v/UjQQQLQKk
	pj1Ej1X1XFn6HW6jCiOAi1e7sJUHmbhmqvRGZ2b07WT3OEb711I9nONvW6N/qykysD1elFibLiI55
	cWCcDDceAOotiXer7Uw2k8/P3Jwq3BuHicabXsLlHf1FQhj1CsRQBscGpVhY2terqVs4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] tools/oxenstored: Reject invalid watch paths early
Message-Id: <E1lNFgI-000275-T4@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 14:00:50 +0000

commit 9b299ec2ebd80b40b731ce81a77dc9e09c74c1e2
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:28:37 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:25 2021 +0000

    tools/oxenstored: Reject invalid watch paths early
    
    Watches on invalid paths were accepted, but they would never trigger.  The
    client also got no notification that its watch is bad and would never trigger.
    
    Found again by the structured fuzzer, due to an error on live update reload:
    the invalid watch paths would get rejected during live update and the list of
    watches would be different pre/post live update.
    
    The testcase is watch on `//`, which is an invalid path.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit dc8caf214fb882546b0e93317b9828247a7c9da8)
---
 tools/ocaml/xenstored/connection.ml  | 5 ++---
 tools/ocaml/xenstored/connections.ml | 4 +++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index 0d4dcda771..daf4099473 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -158,18 +158,17 @@ let get_children_watches con path =
 let is_dom0 con =
 	Perms.Connection.is_dom0 (get_perm con)
 
-let add_watch con path token =
+let add_watch con (path, apath) token =
 	if !Quota.activate && !Define.maxwatch > 0 &&
 	   not (is_dom0 con) && con.nb_watches > !Define.maxwatch then
 		raise Quota.Limit_reached;
-	let apath = get_watch_path con path in
 	let l = get_watches con apath in
 	if List.exists (fun w -> w.token = token) l then
 		raise Define.Already_exist;
 	let watch = watch_create ~con ~token ~path in
 	Hashtbl.replace con.watches apath (watch :: l);
 	con.nb_watches <- con.nb_watches + 1;
-	apath, watch
+	watch
 
 let del_watch con path token =
 	let apath = get_watch_path con path in
diff --git a/tools/ocaml/xenstored/connections.ml b/tools/ocaml/xenstored/connections.ml
index 4e69de1d42..04840b0680 100644
--- a/tools/ocaml/xenstored/connections.ml
+++ b/tools/ocaml/xenstored/connections.ml
@@ -114,8 +114,10 @@ let key_of_path path =
 	"" :: Store.Path.to_string_list path
 
 let add_watch cons con path token =
-	let apath, watch = Connection.add_watch con path token in
+	let apath = Connection.get_watch_path con path in
+	(* fail on invalid paths early by calling key_of_str before adding watch *)
 	let key = key_of_str apath in
+	let watch = Connection.add_watch con (path, apath) token in
 	let watches =
  		if Trie.mem cons.watches key
  		then Trie.find cons.watches key
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 14:01:01 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 14:01:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99313.188818 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFgT-0004Rq-Qb; Fri, 19 Mar 2021 14:01:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99313.188818; Fri, 19 Mar 2021 14:01:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNFgT-0004Rg-My; Fri, 19 Mar 2021 14:01:01 +0000
Received: by outflank-mailman (input) for mailman id 99313;
 Fri, 19 Mar 2021 14:01: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 1lNFgT-0004RX-2q
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:01: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 1lNFgT-0004hu-28
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:01:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNFgT-00027x-07
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:01: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=klXofg0qhNwUmcoZa0OpObd41wRqkqSLk0JSntn0MCk=; b=h/3zF8Blz2QZE6JeqN7vIJJw1E
	YL4zcj1aGVVxImRFyBAttpgepWaZPxu0jteqIHII56SZTVu7C0rKl8oVAluuTPSWurEdh72z1iLgc
	YBepBywLk6XuHqt4jO4srHWj1DOHz0N0HdCye5NShSyaatbMkseci7sxA1JXmpdm1RuU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] tools/oxenstored: mkdir conflicts were sometimes missed
Message-Id: <E1lNFgT-00027x-07@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 14:01:01 +0000

commit 1d5581d352f7bb6408636e8aeaf0edda7d321aee
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:38:58 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:25 2021 +0000

    tools/oxenstored: mkdir conflicts were sometimes missed
    
    Due to how set_write_lowpath was used here it didn't detect create/delete
    conflicts.  When we create an entry we must mark our parent as modified
    (this is what creating a new node via write does).
    
    Otherwise we can have 2 transactions one creating, and another deleting a node
    both succeeding depending on timing.  Or one transaction reading an entry,
    concluding it doesn't exist, do some other work based on that information and
    successfully commit even if another transaction creates the node via mkdir
    meanwhile.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit 45dee7d92b493bb531e7e77a6f9c0180ab152f87)
---
 tools/ocaml/xenstored/transaction.ml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/transaction.ml b/tools/ocaml/xenstored/transaction.ml
index 9e9e28db9b..7c5be17588 100644
--- a/tools/ocaml/xenstored/transaction.ml
+++ b/tools/ocaml/xenstored/transaction.ml
@@ -165,7 +165,7 @@ let write t perm path value =
 
 let mkdir ?(with_watch=true) t perm path =
 	Store.mkdir t.store perm path;
-	set_write_lowpath t path;
+	set_write_lowpath t (Store.Path.get_parent path);
 	if with_watch then
 		add_wop t Xenbus.Xb.Op.Mkdir path
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 14:44:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 14:44:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99326.188850 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNGMA-0008PO-Jr; Fri, 19 Mar 2021 14:44:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99326.188850; Fri, 19 Mar 2021 14:44: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 1lNGMA-0008PG-GX; Fri, 19 Mar 2021 14:44:06 +0000
Received: by outflank-mailman (input) for mailman id 99326;
 Fri, 19 Mar 2021 14:44: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 1lNGMA-0008PB-1J
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:44: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 1lNGMA-0005S2-0H
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:44:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNGM9-0005Rr-UJ
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:44:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mwRxpl1o6LwY4G/ENPizI6NPIv2Rk2KgQQVBYHBQMpI=; b=iHaJ7Vj4RO7pX7fy+ZWMFB7/gm
	Zf3To+E7WXJLchap4q7TBhUc5rzlQory6tbVhRY1MYFTloe2ToE2WpDQGFmyGsTj7R8q7JB25WheK
	s1k05iMukVsARfSVYoPhWzm3t9bTnkXuQ+8UOx6SVc4Q6GcbIRLKEaKN+dgQoGNDGkEg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/ucode/amd: Fix microcode payload size for Fam19 processors
Message-Id: <E1lNGM9-0005Rr-UJ@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 14:44:05 +0000

commit 93fbbb3b10daf58d2aa8e7c21bc31e0c4de59a61
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 19 15:33:15 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 19 15:33:15 2021 +0100

    x86/ucode/amd: Fix microcode payload size for Fam19 processors
    
    The original limit provided wasn't accurate.  Blobs are in fact rather larger.
    
    Fixes: fe36a173d1 ("x86/amd: Initial support for Fam19h processors")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 90b014a6e6ecad036ec5846426afd19b305dedff
    master date: 2021-02-10 13:23:51 +0000
---
 xen/arch/x86/cpu/microcode/amd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 5b45530d93..5eb93195c3 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -111,7 +111,7 @@ static bool_t verify_patch_size(uint32_t patch_size)
 #define F15H_MPB_MAX_SIZE 4096
 #define F16H_MPB_MAX_SIZE 3458
 #define F17H_MPB_MAX_SIZE 3200
-#define F19H_MPB_MAX_SIZE 4800
+#define F19H_MPB_MAX_SIZE 5568
 
     switch (boot_cpu_data.x86)
     {
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 14:44:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 14:44:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99327.188853 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNGML-0008QB-L7; Fri, 19 Mar 2021 14:44:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99327.188853; Fri, 19 Mar 2021 14:44: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 1lNGML-0008Q3-I9; Fri, 19 Mar 2021 14:44:17 +0000
Received: by outflank-mailman (input) for mailman id 99327;
 Fri, 19 Mar 2021 14:44: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 1lNGMK-0008Pu-OH
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:44: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 1lNGMK-0005S8-Mg
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:44:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNGMK-0005TP-LZ
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 14:44:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UXWRUOZAlbZos3GpuPO8T74VaDZvE+79YIWERH9iEK8=; b=K2KCqNrC0ky8XBAWUfURhxr+Kn
	WVsHhZk7Vm/nsaXfKJ9NtJ25fSo80zIKl//As7VLh/F7POrT9rj5ZNwrsLAcIHNzQ5/Ea5uBRu/CB
	rbncLt/wEtmhZrzTsfqPeVE3lAvkxrMUhz8Xvfon68YKcRs0EovSmCqZUi5SV2WzraTI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/amd: Initial support for Fam19h processors
Message-Id: <E1lNGMK-0005TP-LZ@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 14:44:16 +0000

commit 015e51a0bcf3be2e552c7b54ae64512caa679f3c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 19 15:39:42 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 19 15:39:42 2021 +0100

    x86/amd: Initial support for Fam19h processors
    
    Fam19h is very similar to Fam17h in these regards.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    
    x86/ucode/amd: Fix microcode payload size for Fam19 processors
    
    The original limit provided wasn't accurate.  Blobs are in fact rather larger.
    
    Fixes: fe36a173d1 ("x86/amd: Initial support for Fam19h processors")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: fe36a173d110fd792f5e337e208a5ed714df1536
    master date: 2020-05-04 11:04:29 +0100
    master commit: 90b014a6e6ecad036ec5846426afd19b305dedff
    master date: 2021-02-10 13:23:51 +0000
---
 xen/arch/x86/acpi/cpu_idle.c | 1 +
 xen/arch/x86/cpu/vpmu_amd.c  | 1 +
 xen/arch/x86/microcode_amd.c | 4 ++++
 xen/arch/x86/nmi.c           | 2 +-
 xen/arch/x86/traps.c         | 2 +-
 5 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 1dea781442..b8477c2cf4 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -1405,6 +1405,7 @@ static void amd_cpuidle_init(struct acpi_processor_power *power)
 
     switch ( c->x86 )
     {
+    case 0x19:
     case 0x18:
         if ( boot_cpu_data.x86_vendor != X86_VENDOR_HYGON )
         {
diff --git a/xen/arch/x86/cpu/vpmu_amd.c b/xen/arch/x86/cpu/vpmu_amd.c
index 3c6799b42c..eba47cd2a0 100644
--- a/xen/arch/x86/cpu/vpmu_amd.c
+++ b/xen/arch/x86/cpu/vpmu_amd.c
@@ -576,6 +576,7 @@ int __init amd_vpmu_init(void)
     {
     case 0x15:
     case 0x17:
+    case 0x19:
         num_counters = F15H_NUM_COUNTERS;
         counters = AMD_F15H_COUNTERS;
         ctrls = AMD_F15H_CTRLS;
diff --git a/xen/arch/x86/microcode_amd.c b/xen/arch/x86/microcode_amd.c
index d678357bb4..67c8a54cac 100644
--- a/xen/arch/x86/microcode_amd.c
+++ b/xen/arch/x86/microcode_amd.c
@@ -105,6 +105,7 @@ static bool_t verify_patch_size(uint32_t patch_size)
 #define F15H_MPB_MAX_SIZE 4096
 #define F16H_MPB_MAX_SIZE 3458
 #define F17H_MPB_MAX_SIZE 3200
+#define F19H_MPB_MAX_SIZE 5568
 
     switch (boot_cpu_data.x86)
     {
@@ -120,6 +121,9 @@ static bool_t verify_patch_size(uint32_t patch_size)
     case 0x17:
         max_size = F17H_MPB_MAX_SIZE;
         break;
+    case 0x19:
+        max_size = F19H_MPB_MAX_SIZE;
+        break;
     default:
         max_size = F1XH_MPB_MAX_SIZE;
         break;
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index e26121a737..856dc0b0ce 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -398,7 +398,7 @@ void setup_apic_nmi_watchdog(void)
     case X86_VENDOR_AMD:
         switch (boot_cpu_data.x86) {
         case 6:
-        case 0xf ... 0x17:
+        case 0xf ... 0x19:
             setup_k7_watchdog();
             break;
         default:
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 54aca36714..d19a771a02 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1927,7 +1927,7 @@ static unsigned int calc_ler_msr(void)
         switch ( boot_cpu_data.x86 )
         {
         case 6:
-        case 0xf ... 0x17:
+        case 0xf ... 0x19:
             return MSR_IA32_LASTINTFROMIP;
         }
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 15:33:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 15:33:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99334.188871 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNH7a-0004ip-Dg; Fri, 19 Mar 2021 15:33:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99334.188871; Fri, 19 Mar 2021 15: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 1lNH7a-0004if-A0; Fri, 19 Mar 2021 15:33:06 +0000
Received: by outflank-mailman (input) for mailman id 99334;
 Fri, 19 Mar 2021 15: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 1lNH7Y-0004iY-TY
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 15: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 1lNH7Y-0006Hd-Px
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 15:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNH7Y-00010v-Np
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 15: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=2eKEOJkQJkK/Ov5tB1g/Qe9l4HadYj5fdAS40D1we7M=; b=Emd+S2Jm6HmK4mLPtCEVTXJFiY
	3Hk80j2WFUSmCDCV7z+mt6jND5/0n7+YeYzR2Y6kVqZmk1Rr3LgzHYLvBWE+p4HK3ZBVc7TH9IHRo
	I0CuvwZTnWdRbe83YIY22sZnyPyIvpWuDvIf29f9fCwah2PvSr3ZNr/g6wWmuM1YMC4Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] Revert "x86/timer: Fix boot on Intel systems using ITSSPRC static PIT clock gating"
Message-Id: <E1lNH7Y-00010v-Np@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 15:33:04 +0000

commit 53e83edb8dc9caf9faf46412e971a97781f0b73a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 19 16:23:24 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 19 16:23:24 2021 +0100

    Revert "x86/timer: Fix boot on Intel systems using ITSSPRC static PIT clock gating"
    
    This reverts commit c11bd12218365e31ee4d00f315a075b21a015914,
    as it has been reported to cause symptoms similar to what it
    fixes on other hardware.
---
 xen/arch/x86/hpet.c | 67 +----------------------------------------------------
 1 file changed, 1 insertion(+), 66 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 86b4e88f9b..e99d7116b6 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -767,7 +767,7 @@ static u32 *hpet_boot_cfg;
 u64 __init hpet_setup(void)
 {
     static u64 __initdata hpet_rate;
-    unsigned int hpet_id, hpet_period, hpet_cfg;
+    u32 hpet_id, hpet_period;
     unsigned int last;
 
     if ( hpet_rate )
@@ -800,71 +800,6 @@ u64 __init hpet_setup(void)
     hpet_rate = 1000000000000000ULL; /* 10^15 */
     (void)do_div(hpet_rate, hpet_period);
 
-    /*
-     * Intel chipsets from Skylake/ApolloLake onwards can statically clock
-     * gate the 8259 PIT.  This option is enabled by default in slightly later
-     * systems, as turning the PIT off is a prerequisite to entering the C11
-     * power saving state.
-     *
-     * Xen currently depends on the legacy timer interrupt being active while
-     * IRQ routing is configured.
-     *
-     * Reconfigure the HPET into legacy mode to re-establish the timer
-     * interrupt.
-     */
-    if ( hpet_id & HPET_ID_LEGSUP &&
-         !((hpet_cfg = hpet_read32(HPET_CFG)) & HPET_CFG_LEGACY) )
-    {
-        unsigned int c0_cfg, ticks, count;
-
-        /* Stop the main counter. */
-        hpet_write32(hpet_cfg & ~HPET_CFG_ENABLE, HPET_CFG);
-
-        /* Reconfigure channel 0 to be 32bit periodic. */
-        c0_cfg = hpet_read32(HPET_Tn_CFG(0));
-        c0_cfg |= (HPET_TN_ENABLE | HPET_TN_PERIODIC | HPET_TN_SETVAL |
-                   HPET_TN_32BIT);
-        hpet_write32(c0_cfg, HPET_Tn_CFG(0));
-
-        /*
-         * The exact period doesn't have to match a legacy PIT.  All we need
-         * is an interrupt queued up via the IO-APIC to check routing.
-         *
-         * Use HZ as the frequency.
-         */
-        ticks = ((SECONDS(1) / HZ) * div_sc(hpet_rate, SECONDS(1), 32)) >> 32;
-
-        count = hpet_read32(HPET_COUNTER);
-
-        /*
-         * HPET_TN_SETVAL above is atrociously documented in the spec.
-         *
-         * Periodic HPET channels have a main comparator register, and
-         * separate "accumulator" register.  Despite being named accumulator
-         * in the spec, this is not an accurate description of its behaviour
-         * or purpose.
-         *
-         * Each time an interrupt is generated, the "accumulator" register is
-         * re-added to the comparator set up the new period.
-         *
-         * Normally, writes to the CMP register update both registers.
-         * However, under these semantics, it is impossible to set up a
-         * periodic timer correctly without the main HPET counter being at 0.
-         *
-         * Instead, HPET_TN_SETVAL is a self-clearing control bit which we can
-         * use for periodic timers to mean that the second write to CMP
-         * updates the accumulator only, and not the absolute comparator
-         * value.
-         *
-         * This lets us set a period when the main counter isn't at 0.
-         */
-        hpet_write32(count + ticks, HPET_Tn_CMP(0));
-        hpet_write32(ticks,         HPET_Tn_CMP(0));
-
-        /* Restart the main counter, and legacy mode. */
-        hpet_write32(hpet_cfg | HPET_CFG_ENABLE | HPET_CFG_LEGACY, HPET_CFG);
-    }
-
     return hpet_rate;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 17:11:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 17:11:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99345.188896 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNIeN-0006Gx-Ri; Fri, 19 Mar 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 99345.188896; Fri, 19 Mar 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 1lNIeN-0006Gp-Og; Fri, 19 Mar 2021 17:11:03 +0000
Received: by outflank-mailman (input) for mailman id 99345;
 Fri, 19 Mar 2021 17: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 1lNIeM-0006Gk-3U
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 17: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 1lNIeL-0008S8-VC
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 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 1lNIeL-0006n4-Tr
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 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=u18DzIeu14KNTm9SFSFaMwJYPh5x07njmYtE21cC4+I=; b=UkNE/WCb+faHNHqXLXDlbOq0O4
	A/ewEt/Xvh/MJ5EDrvRZEzI0x5gHf1PiBkv83CnTZxeS3hDcIxCA3p1btvI92z5Mc7w2tnawG32Ib
	Bt7l3UryLIhgSuH7awogN8ewBYHXARQiiEr0hPJO03gTdzOH1Tp1UJHZ7Xf4UL8XuSGo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libxl: Fix domain soft reset state handling
Message-Id: <E1lNIeL-0006n4-Tr@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 17:11:01 +0000

commit dae3c3e8b257cd27d6b35a467a34bf79a6650340
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed Feb 24 18:39:20 2021 +0000
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 18 14:56:33 2021 +0100

    libxl: Fix domain soft reset state handling
    
    In do_domain_soft_reset(), a `libxl__domain_suspend_state' is used
    without been properly initialised and disposed of. This lead do a
    abort() in libxl due to the `dsps.qmp' state been used before been
    initialised:
        libxl__ev_qmp_send: Assertion `ev->state == qmp_state_disconnected || ev->state == qmp_state_connected' failed.
    
    Once initialised, `dsps' also needs to be disposed of as the `qmp'
    state might still be in the `Connected' state in the callback for
    libxl__domain_suspend_device_model(). So this patch adds
    libxl__domain_suspend_dispose() which can be called from the two
    places where we need to dispose of `dsps'.
    
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Tested-by: Olaf Hering <olaf@aepfle.de>
---
 tools/libs/light/libxl_create.c      | 11 ++++++++---
 tools/libs/light/libxl_dom_suspend.c | 15 +++++++++++----
 tools/libs/light/libxl_internal.h    |  2 ++
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c
index 1131b2a733..0c64268f66 100644
--- a/tools/libs/light/libxl_create.c
+++ b/tools/libs/light/libxl_create.c
@@ -2179,9 +2179,7 @@ static int do_domain_soft_reset(libxl_ctx *ctx,
     state->console_tty = libxl__strdup(gc, console_tty);
 
     dss->ao = ao;
-    dss->domid = dss->dsps.domid = domid;
-    dss->dsps.dm_savefile = GCSPRINTF(LIBXL_DEVICE_MODEL_SAVE_FILE".%d",
-                                      domid);
+    dss->domid = domid;
 
     rc = libxl__save_emulator_xenstore_data(dss, &srs->toolstack_buf,
                                             &srs->toolstack_len);
@@ -2191,6 +2189,11 @@ static int do_domain_soft_reset(libxl_ctx *ctx,
     }
 
     dss->dsps.ao = ao;
+    dss->dsps.domid = domid;
+    dss->dsps.live = false;
+    rc = libxl__domain_suspend_init(egc, &dss->dsps, d_config->b_info.type);
+    if (rc)
+        goto out;
     dss->dsps.callback_device_model_done = soft_reset_dm_suspended;
     libxl__domain_suspend_device_model(egc, &dss->dsps); /* must be last */
 
@@ -2209,6 +2212,8 @@ static void soft_reset_dm_suspended(libxl__egc *egc,
         CONTAINER_OF(dsps, *srs, dss.dsps);
     libxl__app_domain_create_state *cdcs = &srs->cdcs;
 
+    libxl__domain_suspend_dispose(gc, dsps);
+
     /*
      * Ask all backends to disconnect by removing the domain from
      * xenstore. On the creation path the domain will be introduced to
diff --git a/tools/libs/light/libxl_dom_suspend.c b/tools/libs/light/libxl_dom_suspend.c
index f7823bbc8f..4fa22bb739 100644
--- a/tools/libs/light/libxl_dom_suspend.c
+++ b/tools/libs/light/libxl_dom_suspend.c
@@ -67,6 +67,16 @@ out:
     return rc;
 }
 
+void libxl__domain_suspend_dispose(libxl__gc *gc,
+                                   libxl__domain_suspend_state  *dsps)
+{
+    libxl__xswait_stop(gc, &dsps->pvcontrol);
+    libxl__ev_evtchn_cancel(gc, &dsps->guest_evtchn);
+    libxl__ev_xswatch_deregister(gc, &dsps->guest_watch);
+    libxl__ev_time_deregister(gc, &dsps->guest_timeout);
+    libxl__ev_qmp_dispose(gc, &dsps->qmp);
+}
+
 /*----- callbacks, called by xc_domain_save -----*/
 
 void libxl__domain_suspend_device_model(libxl__egc *egc,
@@ -388,10 +398,7 @@ static void domain_suspend_common_done(libxl__egc *egc,
 {
     EGC_GC;
     assert(!libxl__xswait_inuse(&dsps->pvcontrol));
-    libxl__ev_evtchn_cancel(gc, &dsps->guest_evtchn);
-    libxl__ev_xswatch_deregister(gc, &dsps->guest_watch);
-    libxl__ev_time_deregister(gc, &dsps->guest_timeout);
-    libxl__ev_qmp_dispose(gc, &dsps->qmp);
+    libxl__domain_suspend_dispose(gc, dsps);
     dsps->callback_common_done(egc, dsps, rc);
 }
 
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index 028bc013d9..c6a4a187f5 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -3617,6 +3617,8 @@ struct libxl__domain_suspend_state {
 int libxl__domain_suspend_init(libxl__egc *egc,
                                libxl__domain_suspend_state *dsps,
                                libxl_domain_type type);
+void libxl__domain_suspend_dispose(libxl__gc *gc,
+                                   libxl__domain_suspend_state  *dsps);
 
 /* calls dsps->callback_device_model_done when done
  * may synchronously calls this callback */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 19:33:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 19:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99378.188981 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNKrq-00034n-Nk; Fri, 19 Mar 2021 19:33:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99378.188981; Fri, 19 Mar 2021 19: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 1lNKrq-00034f-Kn; Fri, 19 Mar 2021 19:33:06 +0000
Received: by outflank-mailman (input) for mailman id 99378;
 Fri, 19 Mar 2021 19:33: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 1lNKrp-00034a-UX
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19: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 1lNKrp-0002OG-Pu
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNKrp-0000V0-OQ
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19: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=ZMNWh1HmtzNzx5JlXfiz9g8AxLma5lF6EGkTKOVhUy4=; b=h+B1WLyxRJhKxkaDk7ilUsza9z
	YLA41lc6uWlJIWtlG+V+WHAabEI0p6O7XfA9oBd159c5bwOh8T9yPP01n5Tdo+TQpRjddABoKHe2+
	+yB+lxOHvt49Rv60vkh6I6eT1hmQSqr+GZLrtdE6oudiUIFWgNqk6o49Wda49Q/tdMXM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] xen/arm: sched: Ensure the vCPU context is seen before vcpu_pause() returns
Message-Id: <E1lNKrp-0000V0-OQ@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 19:33:05 +0000

commit b2c4b77bffd3ac3e627de4dc535f624c52376d01
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Tue Sep 22 20:31:04 2020 +0100
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 11:20:07 2021 -0700

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

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


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 19:33:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 19:33:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99379.188986 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNKs0-00035a-PA; Fri, 19 Mar 2021 19:33:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99379.188986; Fri, 19 Mar 2021 19: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 1lNKs0-00035T-MJ; Fri, 19 Mar 2021 19:33:16 +0000
Received: by outflank-mailman (input) for mailman id 99379;
 Fri, 19 Mar 2021 19:33: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 1lNKrz-00035M-Uw
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19: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 1lNKrz-0002OP-UD
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:33:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNKrz-0000W2-SE
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19: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=zFFS/pcVd8KpiUQdM7RnSo218vsvbotDk0oIMzZ6EOk=; b=k4cjbUNkxZ7rlCYaNK/PDeTdAq
	HNlVHoZBdkzeguamgDRGDctdd4gUu9by9B+cPsDyjnp2jno9x+mIbeGDPDAEzWQteH9IQXLqSsaeI
	l4/5V99mz1T2jQw0zrCflZtx/35ecVkX68Q6eMO3KORsboezGiOD7GSW+AzqrT+y+MLg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] xen/arm: mm: Access a PT entry before the table is unmapped
Message-Id: <E1lNKrz-0000W2-SE@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 19:33:15 +0000

commit 24567a631e732d19e8eeee07336c2aa4b2d0c6d1
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Sun Jun 7 16:51:54 2020 +0100
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 11:20:26 2021 -0700

    xen/arm: mm: Access a PT entry before the table is unmapped
    
    xen_pt_next_level() will retrieve the MFN from the entry right after the
    page-table has been unmapped.
    
    After calling xen_unmap_table(), there is no guarantee the mapping will
    still be valid. Depending on the implementation, this may result to a
    data abort in Xen.
    
    Re-order the code to retrieve the MFN before the table is unmapped.
    
    Fixes: 53abb9a1dcd9 ("xen/arm: mm: Rework Xen page-tables walk during update")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-acked-by: Paul Durrant <paul@xen.org>
    (cherry picked from commit 63b4c9bfb788ebfd35d0172f7e8e2e41ef948f70)
---
 xen/arch/arm/mm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 774cf62272..8958eefd13 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1033,6 +1033,7 @@ static int xen_pt_next_level(bool read_only, unsigned int level,
 {
     lpae_t *entry;
     int ret;
+    mfn_t mfn;
 
     entry = *table + offset;
 
@@ -1050,8 +1051,10 @@ static int xen_pt_next_level(bool read_only, unsigned int level,
     if ( lpae_is_mapping(*entry, level) )
         return XEN_TABLE_SUPER_PAGE;
 
+    mfn = lpae_get_mfn(*entry);
+
     xen_unmap_table(*table);
-    *table = xen_map_table(lpae_get_mfn(*entry));
+    *table = xen_map_table(mfn);
 
     return XEN_TABLE_NORMAL_PAGE;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 19:33:26 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 19:33:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99380.188990 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNKsA-00037S-ST; Fri, 19 Mar 2021 19:33:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99380.188990; Fri, 19 Mar 2021 19: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 1lNKsA-00037I-PM; Fri, 19 Mar 2021 19:33:26 +0000
Received: by outflank-mailman (input) for mailman id 99380;
 Fri, 19 Mar 2021 19:33: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 1lNKsA-00037C-3Z
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:33: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 1lNKsA-0002OX-28
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:33:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNKsA-0000Wc-0K
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:33:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5Y9AH8xiLx2womtchKG5mvBjuVvl2kBvZo5BJn0rrdg=; b=fpNm/bRQA8a05mAclQadW+at/A
	Z2T7wB2dA/nq40WJ7yfQHyoeY2f6qlawe6Ex8Oq1WOKdk+wbvH81V3QRZV1FFSk/XXapJAIwVFrpU
	cWsBQhZ19KjFpYefwn7X+GnIG+FUZbT+l+yNmVe1yTVsmDCfQ08egs/2745/E035JSJk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] xen/arm: Document the erratum #853709 related to Cortex A72
Message-Id: <E1lNKsA-0000Wc-0K@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 19:33:26 +0000

commit 934bb4c87cf2a7c816ca5f585818172baadebe6f
Author:     Michal Orzel <michal.orzel@arm.com>
AuthorDate: Wed Oct 14 12:05:41 2020 +0200
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 11:23:18 2021 -0700

    xen/arm: Document the erratum #853709 related to Cortex A72
    
    The Cortex-A72 erratum #853709 is the same as the Cortex-A57
    erratum #852523. As the latter is already workaround, we only
    need to update the documentation.
    
    Signed-off-by: Michal Orzel <michal.orzel@arm.com>
    [julieng: Reworded the commit message]
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    (cherry picked from commit f776e5fb3ee699745f6442ec8c47d0fa647e0575)
---
 docs/misc/arm/silicon-errata.txt | 1 +
 xen/arch/arm/domain.c            | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index e15d0923e9..1f18a9df58 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -50,6 +50,7 @@ stable hypervisors.
 | ARM            | Cortex-A57      | #834220         | ARM64_ERRATUM_834220    |
 | ARM            | Cortex-A57      | #1319537        | N/A                     |
 | ARM            | Cortex-A72      | #1319367        | N/A                     |
+| ARM            | Cortex-A72      | #853709         | N/A                     |
 | ARM            | Cortex-A76      | #1165522        | N/A                     |
 | ARM            | Neoverse-N1     | #1165522        | N/A
 | ARM            | MMU-500         | #842869         | N/A                     |
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 4504c64467..dfbd711325 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -216,7 +216,8 @@ static void ctxt_switch_to(struct vcpu *n)
     WRITE_SYSREG64(n->arch.ttbr1, TTBR1_EL1);
 
     /*
-     * Erratum #852523: DACR32_EL2 must be restored before one of the
+     * Erratum #852523 (Cortex-A57) or erratum #853709 (Cortex-A72):
+     * DACR32_EL2 must be restored before one of the
      * following sysregs: SCTLR_EL1, TCR_EL1, TTBR0_EL1, TTBR1_EL1 or
      * CONTEXTIDR_EL1.
      */
@@ -245,7 +246,8 @@ static void ctxt_switch_to(struct vcpu *n)
 
     /*
      * This write to sysreg CONTEXTIDR_EL1 ensures we don't hit erratum
-     * #852523. I.e DACR32_EL2 is not correctly synchronized.
+     * #852523 (Cortex-A57) or #853709 (Cortex-A72).
+     * I.e DACR32_EL2 is not correctly synchronized.
      */
     WRITE_SYSREG(n->arch.contextidr, CONTEXTIDR_EL1);
     WRITE_SYSREG(n->arch.tpidr_el0, TPIDR_EL0);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 19:33:36 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 19:33:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99381.188995 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNKsK-00038c-UO; Fri, 19 Mar 2021 19:33:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99381.188995; Fri, 19 Mar 2021 19: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 1lNKsK-00038T-Qt; Fri, 19 Mar 2021 19:33:36 +0000
Received: by outflank-mailman (input) for mailman id 99381;
 Fri, 19 Mar 2021 19: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 1lNKsK-00038N-6p
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19: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 1lNKsK-0002Oj-62
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:33:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNKsK-0000XE-4e
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:33:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pXOjj2aSBtK+aRI2G/DUgtJIbsIQM9BqRla8B2iT/vs=; b=NDm41Ao81gHFUrblVrsCcH1DIE
	YpXvHijP4RVN/9jQIQ6d4Bxhm/h4GQh8lcCAaAe0D44I1651SL9pmhcW3UB3Ockt1Q5v3vWUCMx19
	byNYw4+6PgrZSYAmCN11vCAtrth32hACSMhQRT+FjdqYFNHfrQBTFU/hIZKvZWRKsShI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] xen/arm: Add Cortex-A73 erratum 858921 workaround
Message-Id: <E1lNKsK-0000XE-4e@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 19:33:36 +0000

commit 96fbc00d1d73b1f3344644b7aa607ff0355c206a
Author:     Penny Zheng <penny.zheng@arm.com>
AuthorDate: Mon Nov 9 16:21:10 2020 +0800
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 11:26:33 2021 -0700

    xen/arm: Add Cortex-A73 erratum 858921 workaround
    
    CNTVCT_EL0 or CNTPCT_EL0 counter read in Cortex-A73 (all versions)
    might return a wrong value when the counter crosses a 32bit boundary.
    
    Until now, there is no case for Xen itself to access CNTVCT_EL0,
    and it also should be the Guest OS's responsibility to deal with
    this part.
    
    But for CNTPCT, there exists several cases in Xen involving reading
    CNTPCT, so a possible workaround is that performing the read twice,
    and to return one or the other depending on whether a transition has
    taken place.
    
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Reviewed-by: Wei Chen <Wei.Chen@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 5505f5f8e7e805365cfe70b6a4af6115940bb749)
---
 docs/misc/arm/silicon-errata.txt |  1 +
 xen/arch/arm/Kconfig             | 18 ++++++++++++++++++
 xen/arch/arm/cpuerrata.c         |  8 ++++++++
 xen/arch/arm/vtimer.c            |  2 +-
 xen/include/asm-arm/cpuerrata.h  |  2 ++
 xen/include/asm-arm/cpufeature.h |  3 ++-
 xen/include/asm-arm/time.h       | 22 +++++++++++++++++++++-
 7 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index 1f18a9df58..552c4151d3 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -51,6 +51,7 @@ stable hypervisors.
 | ARM            | Cortex-A57      | #1319537        | N/A                     |
 | ARM            | Cortex-A72      | #1319367        | N/A                     |
 | ARM            | Cortex-A72      | #853709         | N/A                     |
+| ARM            | Cortex-A73      | #858921         | ARM_ERRATUM_858921      |
 | ARM            | Cortex-A76      | #1165522        | N/A                     |
 | ARM            | Neoverse-N1     | #1165522        | N/A
 | ARM            | MMU-500         | #842869         | N/A                     |
diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index a51aa7bfa8..bcd05c4f02 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -228,6 +228,24 @@ config ARM64_ERRATUM_834220
 
 	  If unsure, say Y.
 
+config ARM_ERRATUM_858921
+	bool "Cortex-A73: 858921: Possible wrong read value for CNTVCT or CNTPCT"
+	default y
+	help
+	  This option adds an alternative code sequence to work around ARM
+	  erratum 858921 on Cortex-A73 (all versions).
+
+	  Affected Cortex-A73 might return wrong read value for CNTVCT or CNTPCT
+	  when the counter crosses a 32bit boundary.
+
+	  The workaround involves performing the read twice, and to return
+	  one or the other value depending on whether a transition has taken place.
+	  Please note that this does not necessarily enable the workaround,
+	  as it depends on the alternative framework, which will only patch
+	  the kernel if an affected CPU is detected.
+
+	  If unsure, say Y.
+
 endmenu
 
 config ARM64_HARDEN_BRANCH_PREDICTOR
diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
index 9f7169a6a6..12063c9001 100644
--- a/xen/arch/arm/cpuerrata.c
+++ b/xen/arch/arm/cpuerrata.c
@@ -474,6 +474,14 @@ static const struct arm_cpu_capabilities arm_errata[] = {
         .capability = ARM_SSBD,
         .matches = has_ssbd_mitigation,
     },
+#endif
+#ifdef CONFIG_ARM_ERRATUM_858921
+    {
+        /* Cortex-A73 (all versions) */
+        .desc = "ARM erratum 858921",
+        .capability = ARM_WORKAROUND_858921,
+        MIDR_ALL_VERSIONS(MIDR_CORTEX_A73),
+    },
 #endif
     {
         /* Neoverse r0p0 - r2p0 */
diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index a80009882f..43a0f1fde8 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -62,7 +62,7 @@ static void virt_timer_expired(void *data)
 
 int domain_vtimer_init(struct domain *d, struct xen_arch_domainconfig *config)
 {
-    d->arch.virt_timer_base.offset = READ_SYSREG64(CNTPCT_EL0);
+    d->arch.virt_timer_base.offset = get_cycles();
     d->time_offset_seconds = ticks_to_ns(d->arch.virt_timer_base.offset - boot_count);
     do_div(d->time_offset_seconds, 1000000000);
 
diff --git a/xen/include/asm-arm/cpuerrata.h b/xen/include/asm-arm/cpuerrata.h
index 88ef3ca934..8d7e7b9375 100644
--- a/xen/include/asm-arm/cpuerrata.h
+++ b/xen/include/asm-arm/cpuerrata.h
@@ -28,6 +28,8 @@ static inline bool check_workaround_##erratum(void)             \
 CHECK_WORKAROUND_HELPER(766422, ARM32_WORKAROUND_766422, CONFIG_ARM_32)
 CHECK_WORKAROUND_HELPER(834220, ARM64_WORKAROUND_834220, CONFIG_ARM_64)
 CHECK_WORKAROUND_HELPER(ssbd, ARM_SSBD, CONFIG_ARM_SSBD)
+CHECK_WORKAROUND_HELPER(858921, ARM_WORKAROUND_858921,
+                        CONFIG_ARM_ERRATUM_858921)
 
 #undef CHECK_WORKAROUND_HELPER
 
diff --git a/xen/include/asm-arm/cpufeature.h b/xen/include/asm-arm/cpufeature.h
index 6bff5ce131..29753fee78 100644
--- a/xen/include/asm-arm/cpufeature.h
+++ b/xen/include/asm-arm/cpufeature.h
@@ -45,8 +45,9 @@
 #define ARM_SSBD 7
 #define ARM_SMCCC_1_1 8
 #define ARM64_WORKAROUND_AT_SPECULATE 9
+#define ARM_WORKAROUND_858921 10
 
-#define ARM_NCAPS           10
+#define ARM_NCAPS           11
 
 #ifndef __ASSEMBLY__
 
diff --git a/xen/include/asm-arm/time.h b/xen/include/asm-arm/time.h
index 9cb6f9b0b4..1b2c13614b 100644
--- a/xen/include/asm-arm/time.h
+++ b/xen/include/asm-arm/time.h
@@ -3,6 +3,7 @@
 
 #include <asm/sysregs.h>
 #include <asm/system.h>
+#include <asm/cpuerrata.h>
 
 #define DT_MATCH_TIMER                      \
     DT_MATCH_COMPATIBLE("arm,armv7-timer"), \
@@ -13,7 +14,26 @@ typedef uint64_t cycles_t;
 static inline cycles_t get_cycles (void)
 {
         isb();
-        return READ_SYSREG64(CNTPCT_EL0);
+        /*
+         * ARM_WORKAROUND_858921: Cortex-A73 (all versions) counter read
+         * can return a wrong value when the counter crosses a 32bit boundary.
+         */
+        if ( !check_workaround_858921() )
+            return READ_SYSREG64(CNTPCT_EL0);
+        else
+        {
+            /*
+             * A recommended workaround for erratum 858921 is to:
+             *  1- Read twice CNTPCT.
+             *  2- Compare bit[32] of the two read values.
+             *      - If bit[32] is different, keep the old value.
+             *      - If bit[32] is the same, keep the new value.
+             */
+            cycles_t old, new;
+            old = READ_SYSREG64(CNTPCT_EL0);
+            new = READ_SYSREG64(CNTPCT_EL0);
+            return (((old ^ new) >> 32) & 1) ? old : new;
+        }
 }
 
 /* List of timer's IRQ */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 19:33:47 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 19:33:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99382.188998 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNKsU-0003AA-VZ; Fri, 19 Mar 2021 19:33:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99382.188998; Fri, 19 Mar 2021 19: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 1lNKsU-0003A2-SW; Fri, 19 Mar 2021 19:33:46 +0000
Received: by outflank-mailman (input) for mailman id 99382;
 Fri, 19 Mar 2021 19: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 1lNKsU-00039w-BI
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19: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 1lNKsU-0002Or-AS
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:33:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNKsU-0000Y5-8o
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19: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=KZgWHxFLcO9YdXf0/vNDg/pk77m/o8tJYh5epjjG2UM=; b=RXebxAj+vOrwIsgsQIz0kKu7rK
	6T/o1J0TEbCDpW1YI+HhxpdkwnOLj7Cc95Sh6pXuEBuf6HbLGdx3ESqLzzLaaTZrPo3VY9hcMhUtW
	z5QLglFY82/qUS1lC+OfHiEiy+fGKsWmmn8FgXdmNkY82vjOol5VmvRVy0Y+xA1gT3y4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] xen/arm: Add workaround for Cortex-A55 erratum #1530923
Message-Id: <E1lNKsU-0000Y5-8o@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 19:33:46 +0000

commit c552d976e1fdfb2a49f97865b69d0f568fb7f1e8
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Tue Nov 24 11:12:15 2020 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 11:28:03 2021 -0700

    xen/arm: Add workaround for Cortex-A55 erratum #1530923
    
    On the Cortex A55, TLB entries can be allocated by a speculative AT
    instruction. If this is happening during a guest context switch with an
    inconsistent page table state in the guest, TLBs with wrong values might
    be allocated.
    The ARM64_WORKAROUND_AT_SPECULATE workaround is used as for erratum
    1165522 on Cortex A76 or Neoverse N1.
    
    This change is also introducing the MIDR identifier for the Cortex-A55.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Rahul Singh <rahul.singh@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit fd7479b9aec25885cc17d33b326b9babae59faee)
---
 docs/misc/arm/silicon-errata.txt | 1 +
 xen/arch/arm/cpuerrata.c         | 6 ++++++
 xen/include/asm-arm/processor.h  | 2 ++
 3 files changed, 9 insertions(+)

diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index 552c4151d3..a15290285f 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -45,6 +45,7 @@ stable hypervisors.
 | ARM            | Cortex-A53      | #827319         | ARM64_ERRATUM_827319    |
 | ARM            | Cortex-A53      | #824069         | ARM64_ERRATUM_824069    |
 | ARM            | Cortex-A53      | #819472         | ARM64_ERRATUM_819472    |
+| ARM            | Cortex-A55      | #1530923        | N/A                     |
 | ARM            | Cortex-A57      | #852523         | N/A                     |
 | ARM            | Cortex-A57      | #832075         | ARM64_ERRATUM_832075    |
 | ARM            | Cortex-A57      | #834220         | ARM64_ERRATUM_834220    |
diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
index 12063c9001..f94bcf74cc 100644
--- a/xen/arch/arm/cpuerrata.c
+++ b/xen/arch/arm/cpuerrata.c
@@ -505,6 +505,12 @@ static const struct arm_cpu_capabilities arm_errata[] = {
         .capability = ARM64_WORKAROUND_AT_SPECULATE,
         MIDR_ALL_VERSIONS(MIDR_CORTEX_A57),
     },
+    {
+        /* Cortex-A55 (All versions as erratum is open in SDEN v14) */
+        .desc = "ARM erratum 1530923",
+        .capability = ARM64_WORKAROUND_AT_SPECULATE,
+        MIDR_ALL_VERSIONS(MIDR_CORTEX_A55),
+    },
     {},
 };
 
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index d3d12a9d19..87c8136022 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -53,6 +53,7 @@
 #define ARM_CPU_PART_CORTEX_A17     0xC0E
 #define ARM_CPU_PART_CORTEX_A15     0xC0F
 #define ARM_CPU_PART_CORTEX_A53     0xD03
+#define ARM_CPU_PART_CORTEX_A55     0xD05
 #define ARM_CPU_PART_CORTEX_A57     0xD07
 #define ARM_CPU_PART_CORTEX_A72     0xD08
 #define ARM_CPU_PART_CORTEX_A73     0xD09
@@ -64,6 +65,7 @@
 #define MIDR_CORTEX_A17 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A17)
 #define MIDR_CORTEX_A15 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A15)
 #define MIDR_CORTEX_A53 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A53)
+#define MIDR_CORTEX_A55 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A55)
 #define MIDR_CORTEX_A57 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A57)
 #define MIDR_CORTEX_A72 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A72)
 #define MIDR_CORTEX_A73 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A73)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 19:33:58 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 19:33:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99383.189001 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNKsg-0003BZ-0u; Fri, 19 Mar 2021 19:33:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99383.189001; Fri, 19 Mar 2021 19:33: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 1lNKsf-0003BR-U6; Fri, 19 Mar 2021 19:33:57 +0000
Received: by outflank-mailman (input) for mailman id 99383;
 Fri, 19 Mar 2021 19: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 1lNKse-0003BH-EO
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19: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 1lNKse-0002PF-DZ
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:33:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNKse-0000ZU-Cf
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19: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=fJFSjdw6pPriwy30m80FGbUD5/5y/m/e9ra7G+ABUD4=; b=YJVZajWXKix3foUMdWpqn6IH85
	IDbqHgs/OTAmHwOpa0eIBkU/YsO9U3jPw1p8o9LJc7UE5P+/4xb4ZVN+5VahvhGGsw7NUn5MbNn1/
	nyKknNdmTGpm84/wOJQ4FR05OoDvbuNIFFpmIMRkUwZ9S7Mq7A0tv2tX9MnzdYn0voSU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] xen/arm: Add workaround for Cortex-A53 erratum #843419
Message-Id: <E1lNKse-0000ZU-Cf@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 19:33:56 +0000

commit 8505e8a10e422daf9af086a9e61207bca8f4d28c
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Fri Mar 19 11:55:03 2021 -0700
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:20:52 2021 -0700

    xen/arm: Add workaround for Cortex-A53 erratum #843419
    
    On the Cortex A53, when executing in AArch64 state, a load or store instruction
    which uses the result of an ADRP instruction as a base register, or which uses
    a base register written by an instruction immediately after an ADRP to the
    same register, might access an incorrect address.
    
    The workaround is to enable the linker flag --fix-cortex-a53-843419
    if present, to check and fix the affected sequence. Otherwise print a warning
    that Xen may be susceptible to this errata
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    [backport: LDFLAGS/XEN_LDFLAGS, move ld-option to Config.mk]
    (cherry picked from commit d81133d45d81d35a4e7445778bfd1179190cbd31)
---
 Config.mk                        | 12 ++++++++++++
 docs/misc/arm/silicon-errata.txt |  1 +
 xen/arch/arm/Kconfig             | 19 +++++++++++++++++++
 xen/arch/arm/Makefile            |  8 ++++++++
 4 files changed, 40 insertions(+)

diff --git a/Config.mk b/Config.mk
index 6f0321a9ee..75f4eadbf9 100644
--- a/Config.mk
+++ b/Config.mk
@@ -130,6 +130,18 @@ define cc-ver-check-closure
     endif
 endef
 
+# $(if-success,<command>,<then>,<else>)
+# Return <then> if <command> exits with 0, <else> otherwise.
+if-success = $(shell { $(1); } >/dev/null 2>&1 && echo "$(2)" || echo "$(3)")
+
+# $(success,<command>)
+# Return y if <command> exits with 0, n otherwise
+success = $(call if-success,$(1),y,n)
+
+# $(ld-option,<flag>)
+# Return y if the linker supports <flag>, n otherwise
+ld-option = $(call success,$(LD) -v $(1))
+
 # cc-ifversion: Check compiler version and take branch accordingly
 # Usage $(call cc-ifversion,lt,0x040700,string_if_y,string_if_n)
 cc-ifversion = $(shell [ $(call cc-ver,$(CC),$(1),$(2)) = "y" ] \
diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index a15290285f..67f9f3b395 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -45,6 +45,7 @@ stable hypervisors.
 | ARM            | Cortex-A53      | #827319         | ARM64_ERRATUM_827319    |
 | ARM            | Cortex-A53      | #824069         | ARM64_ERRATUM_824069    |
 | ARM            | Cortex-A53      | #819472         | ARM64_ERRATUM_819472    |
+| ARM            | Cortex-A53      | #843419         | ARM64_ERRATUM_843419    |
 | ARM            | Cortex-A55      | #1530923        | N/A                     |
 | ARM            | Cortex-A57      | #852523         | N/A                     |
 | ARM            | Cortex-A57      | #832075         | ARM64_ERRATUM_832075    |
diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index bcd05c4f02..87413543d1 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -188,6 +188,25 @@ config ARM64_ERRATUM_819472
 
 	  If unsure, say Y.
 
+config ARM64_ERRATUM_843419
+	bool "Cortex-A53: 843419: A load or store might access an incorrect address"
+	default y
+	depends on ARM_64
+	help
+	  This option adds an alternative code sequence to work around ARM
+	  erratum 843419 on Cortex-A53 parts up to r0p4.
+
+	  When executing in AArch64 state, a load or store instruction which uses
+	  the result of an ADRP instruction as a base register, or which uses a
+	  base register written by an instruction immediately after an ADRP to the
+	  same register, might access an incorrect address.
+
+	  The workaround enables the linker to check if the affected sequence is
+	  produced and it will fix it with an alternative not affected sequence
+	  that produce the same behavior.
+
+	  If unsure, say Y.
+
 config ARM64_ERRATUM_832075
 	bool "Cortex-A57: 832075: possible deadlock on mixing exclusive memory accesses with device loads"
 	default y
diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 8edb200245..d7618d52a7 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -102,6 +102,14 @@ prelink.o: $(ALL_OBJS)
 	$(LD) $(LDFLAGS) -r -o $@ $^
 endif
 
+ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
+    ifeq ($(call ld-option, --fix-cortex-a53-843419),n)
+        $(warning ld does not support --fix-cortex-a53-843419; xen may be susceptible to erratum)
+    else
+        LDFLAGS += --fix-cortex-a53-843419
+    endif
+endif
+
 $(TARGET)-syms: prelink.o xen.lds
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
 	    $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).0
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 19:34:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 19:34:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99384.189005 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNKsq-0003Ce-2w; Fri, 19 Mar 2021 19:34:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99384.189005; Fri, 19 Mar 2021 19: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 1lNKsp-0003CW-Vm; Fri, 19 Mar 2021 19:34:07 +0000
Received: by outflank-mailman (input) for mailman id 99384;
 Fri, 19 Mar 2021 19: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 1lNKso-0003CO-Hs
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19: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 1lNKso-0002Pa-HA
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:34:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNKso-0000bM-Fv
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19: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=EZZij6K9p/iF9m0w4Ix/nELDEf2vQEKXxhARWYEz1Us=; b=xpKv4EFisLI0cL3qnUg/hExrH5
	GA1q6s9ZhDvrSd1ufwOPvPAL2sPPuqgeT8Jqt+S0L7Xx8zLw+5ytuOSGQPYjigdQedvvrYywKuQd4
	R8lwdYtwtPzcl8XCBLuo5kd6u4O6kdiP826+m1DAEKH1cKTqvKyAXgXrXTPz/Xqc1bIA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] xen/arm: call iomem_permit_access for passthrough devices
Message-Id: <E1lNKso-0000bM-Fv@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 19:34:06 +0000

commit a702c80ec1936c2ecf00a4628af6a4cfdbc5b909
Author:     Stefano Stabellini <sstabellini@kernel.org>
AuthorDate: Tue Apr 14 18:02:55 2020 -0700
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:20:52 2021 -0700

    xen/arm: call iomem_permit_access for passthrough devices
    
    iomem_permit_access should be called for MMIO regions of devices
    assigned to a domain. Currently it is not called for MMIO regions of
    passthrough devices of Dom0less guests. This patch fixes it.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
    Acked-by: Julien Grall <julien@xen.org>
    (cherry picked from commit 6b75c7a95420acbb9c118624ff0a5e973287c1e4)
---
 xen/arch/arm/domain_build.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index dd9c3b73ba..8c5ff11cdc 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1798,6 +1798,17 @@ static int __init handle_passthrough_prop(struct kernel_info *kinfo,
             return -EINVAL;
         }
 
+        res = iomem_permit_access(kinfo->d, paddr_to_pfn(mstart),
+                                  paddr_to_pfn(PAGE_ALIGN(mstart + size - 1)));
+        if ( res )
+        {
+            printk(XENLOG_ERR "Unable to permit to dom%d access to"
+                   " 0x%"PRIx64" - 0x%"PRIx64"\n",
+                   kinfo->d->domain_id,
+                   mstart & PAGE_MASK, PAGE_ALIGN(mstart + size) - 1);
+            return res;
+        }
+
         res = map_regions_p2mt(kinfo->d,
                                gaddr_to_gfn(gstart),
                                PFN_DOWN(size),
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 19:34:18 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 19:34:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99385.189010 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNKt0-0003E2-6D; Fri, 19 Mar 2021 19:34:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99385.189010; Fri, 19 Mar 2021 19: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 1lNKt0-0003Dw-2y; Fri, 19 Mar 2021 19:34:18 +0000
Received: by outflank-mailman (input) for mailman id 99385;
 Fri, 19 Mar 2021 19: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 1lNKsy-0003Dj-LD
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19: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 1lNKsy-0002Pi-KV
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:34:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNKsy-0000cN-JT
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19: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=wo6K3SN27cOeN/KhPlX0dGnjRP9IszB1V3HFNV+oLvo=; b=Y8sefFt6AFMgkLvtSZDe9mi5E9
	KU6gP/VKmyUqBqzHdjiGRwvcrD8QXqetBDuCiH7VpF/ofzum5taLwQThA2emfC6WtHJRWdI5tbqdG
	8JSJqGqcK0WXSzErFZwzJtQS7NTNz1l8BVRUFdFdfFnIR/90gl9A+RzbMDPmSq6bCroo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] xen/arm: mm: Remove ; at the end of mm_printk()
Message-Id: <E1lNKsy-0000cN-JT@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 19:34:16 +0000

commit 2fb361c36aa965de09922d9f87a29769b029b2fb
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Nov 19 19:07:47 2020 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:20:52 2021 -0700

    xen/arm: mm: Remove ; at the end of mm_printk()
    
    The ; at the end of mm_printk() means the following code will not build
    correctly:
    
    if ( ... )
        mm_printk(...);
    else
        ...
    
    As we treat the macro as a function, we want to remove the ; at the end
    of it.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    (cherry picked from commit bfe67a17d4df2efbedaaf5cfbadc8a8627debf5c)
---
 xen/arch/arm/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 8958eefd13..67853d58d7 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -59,7 +59,7 @@ mm_printk(const char *fmt, ...) {}
     {                                       \
         dprintk(XENLOG_ERR, fmt, ## args);  \
         WARN();                             \
-    } while (0);
+    } while (0)
 #endif
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 19:34:28 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 19:34:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99386.189013 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNKtA-0003FA-7M; Fri, 19 Mar 2021 19:34:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99386.189013; Fri, 19 Mar 2021 19: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 1lNKtA-0003F2-4X; Fri, 19 Mar 2021 19:34:28 +0000
Received: by outflank-mailman (input) for mailman id 99386;
 Fri, 19 Mar 2021 19: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 1lNKt8-0003Es-Qf
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19: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 1lNKt8-0002Pp-Pr
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:34:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNKt8-0000dZ-NM
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19: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=A3GZP0ag3cUN2UVACvvxTS05XqwUgIbLU7qu16xaOZM=; b=udn6c9GQ22SORyJqqwfpBJebXe
	/SELkB3JITrdZLm3WQS8wG6Mgf/ray5KAp8vIBRdgGiT9HuKn1w0Ouw1d71tNYm/r4rGAcQqLrBLk
	FArzvOBiifjOtIhqVyUyjQV+FCYlIr+x81+Q9Z8uXAvEmrp5/xzONv9chUmq0BJqUToE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] xen/arm: vgic-v3: fix GICD_ISACTIVER range
Message-Id: <E1lNKt8-0000dZ-NM@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 19:34:26 +0000

commit 284aed024f58da4e1791bf4aa43ca19d9ac320c5
Author:     Peng Fan <peng.fan@nxp.com>
AuthorDate: Fri Apr 17 15:16:09 2020 -0700
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:20:52 2021 -0700

    xen/arm: vgic-v3: fix GICD_ISACTIVER range
    
    The end should be GICD_ISACTIVERN not GICD_ISACTIVER.
    
    See https://marc.info/?l=xen-devel&m=158527653730795 for a discussion on
    what it would take to implement GICD_ISACTIVER/GICD_ICACTIVER properly.
    
    We chose v1 instead of v2 of this patch to avoid spamming the console:
    v2 adds a printk for every read, and reads can happen often.
    
    Signed-off-by: Peng Fan <peng.fan@nxp.com>
    [Stefano: improve commit message]
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit 0796cb907f2c31046427510a6da6f4941f678b76)
---
 xen/arch/arm/vgic-v3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 4e60ba15cc..fd8cfc156d 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -713,7 +713,7 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
         goto read_as_zero;
 
     /* Read the active status of an IRQ via GICD/GICR is not supported */
-    case VRANGE32(GICD_ISACTIVER, GICD_ISACTIVER):
+    case VRANGE32(GICD_ISACTIVER, GICD_ISACTIVERN):
     case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
         goto read_as_zero;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 19:34:38 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 19:34:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99387.189018 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNKtK-0003Gb-9W; Fri, 19 Mar 2021 19:34:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99387.189018; Fri, 19 Mar 2021 19: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 1lNKtK-0003GR-68; Fri, 19 Mar 2021 19:34:38 +0000
Received: by outflank-mailman (input) for mailman id 99387;
 Fri, 19 Mar 2021 19:34: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 1lNKtI-0003GG-UQ
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19: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 1lNKtI-0002Px-Tb
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:34:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNKtI-0000eb-SZ
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19: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=btIBVDPzpsyqxqFMwBp6/nm8gzr3Msdlr+w/JJHkuUc=; b=L0ltgTps40rOFkPt/ytyU1UY18
	HEAr3Nt2NroeZUGhx6p6ByNMsSzmf6PxFt6Wi2My3atXk1ZRJ0aEzAQhmfknCrFsz9WU3fTzH9H8q
	tACyCpfFOJAlMbYa2SBww6SSheMVmt1bI+Sid6LUeqzhiz4SMfIob2faa6dDbL5ZgH6g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] xen/vgic: Implement write to ISPENDR in vGICv{2, 3}
Message-Id: <E1lNKtI-0000eb-SZ@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 19:34:36 +0000

commit 29e9ca276314881f9adef2b5902a3dc9a88ce946
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Sat Feb 20 14:04:12 2021 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:20:52 2021 -0700

    xen/vgic: Implement write to ISPENDR in vGICv{2, 3}
    
    Currently, Xen will send a data abort to a guest trying to write to the
    ISPENDR.
    
    Unfortunately, recent version of Linux (at least 5.9+) will start
    writing to the register if the interrupt needs to be re-triggered
    (see the callback irq_retrigger). This can happen when a driver (such as
    the xgbe network driver on AMD Seattle) re-enable an interrupt:
    
    (XEN) d0v0: vGICD: unhandled word write 0x00000004000000 to ISPENDR44
    [...]
    [   25.635837] Unhandled fault at 0xffff80001000522c
    [...]
    [   25.818716]  gic_retrigger+0x2c/0x38
    [   25.822361]  irq_startup+0x78/0x138
    [   25.825920]  __enable_irq+0x70/0x80
    [   25.829478]  enable_irq+0x50/0xa0
    [   25.832864]  xgbe_one_poll+0xc8/0xd8
    [   25.836509]  net_rx_action+0x110/0x3a8
    [   25.840328]  __do_softirq+0x124/0x288
    [   25.844061]  irq_exit+0xe0/0xf0
    [   25.847272]  __handle_domain_irq+0x68/0xc0
    [   25.851442]  gic_handle_irq+0xa8/0xe0
    [   25.855171]  el1_irq+0xb0/0x180
    [   25.858383]  arch_cpu_idle+0x18/0x28
    [   25.862028]  default_idle_call+0x24/0x5c
    [   25.866021]  do_idle+0x204/0x278
    [   25.869319]  cpu_startup_entry+0x24/0x68
    [   25.873313]  rest_init+0xd4/0xe4
    [   25.876611]  arch_call_rest_init+0x10/0x1c
    [   25.880777]  start_kernel+0x5b8/0x5ec
    
    As a consequence, the OS may become unusable.
    
    Implementing the write part of ISPENDR is somewhat easy. For
    virtual interrupt, we only need to inject the interrupt again.
    
    For physical interrupt, we need to be more careful as the de-activation
    of the virtual interrupt will be propagated to the physical distributor.
    For simplicity, the physical interrupt will be set pending so the
    workflow will not differ from a "real" interrupt.
    
    Longer term, we could possible directly activate the physical interrupt
    and avoid taking an exception to inject the interrupt to the domain.
    (This is the approach taken by the new vGIC based on KVM).
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit 067935804a8e7a33ff7170a2db8ce94bb46d9a63)
---
 xen/arch/arm/vgic-v2.c     | 10 ++++++----
 xen/arch/arm/vgic-v3.c     | 18 +++++++-----------
 xen/arch/arm/vgic.c        | 47 ++++++++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/vgic.h |  2 ++
 4 files changed, 62 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 64b141fea5..b2da886adc 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -472,10 +472,12 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        printk(XENLOG_G_ERR
-               "%pv: vGICD: unhandled word write %#"PRIregister" to ISPENDR%d\n",
-               v, r, gicd_reg - GICD_ISPENDR);
-        return 0;
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ISPENDR, DABT_WORD);
+        if ( rank == NULL ) goto write_ignore;
+
+        vgic_set_irqs_pending(v, r, rank->index);
+
+        return 1;
 
     case VRANGE32(GICD_ICPENDR, GICD_ICPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index fd8cfc156d..613f37abab 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -808,10 +808,12 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
 
     case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        printk(XENLOG_G_ERR
-               "%pv: %s: unhandled word write %#"PRIregister" to ISPENDR%d\n",
-               v, name, r, reg - GICD_ISPENDR);
-        return 0;
+        rank = vgic_rank_offset(v, 1, reg - GICD_ISPENDR, DABT_WORD);
+        if ( rank == NULL ) goto write_ignore;
+
+        vgic_set_irqs_pending(v, r, rank->index);
+
+        return 1;
 
     case VRANGE32(GICD_ICPENDR, GICD_ICPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
@@ -975,6 +977,7 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
     case VREG32(GICR_ICACTIVER0):
     case VREG32(GICR_ICFGR1):
     case VRANGE32(GICR_IPRIORITYR0, GICR_IPRIORITYR7):
+    case VREG32(GICR_ISPENDR0):
          /*
           * Above registers offset are common with GICD.
           * So handle common with GICD handling
@@ -982,13 +985,6 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
         return __vgic_v3_distr_common_mmio_write("vGICR: SGI", v,
                                                  info, gicr_reg, r);
 
-    case VREG32(GICR_ISPENDR0):
-        if ( dabt.size != DABT_WORD ) goto bad_width;
-        printk(XENLOG_G_ERR
-               "%pv: vGICR: SGI: unhandled word write %#"PRIregister" to ISPENDR0\n",
-               v, r);
-        return 0;
-
     case VREG32(GICR_ICPENDR0):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 82f524a35c..8f9400a519 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -423,6 +423,53 @@ void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
     }
 }
 
+void vgic_set_irqs_pending(struct vcpu *v, uint32_t r, unsigned int rank)
+{
+    const unsigned long mask = r;
+    unsigned int i;
+    /* The first rank is always per-vCPU */
+    bool private = rank == 0;
+
+    /* LPIs will never be set pending via this function */
+    ASSERT(!is_lpi(32 * rank + 31));
+
+    for_each_set_bit( i, &mask, 32 )
+    {
+        unsigned int irq = i + 32 * rank;
+
+        if ( !private )
+        {
+            struct pending_irq *p = spi_to_pending(v->domain, irq);
+
+            /*
+             * When the domain sets the pending state for a HW interrupt on
+             * the virtual distributor, we set the pending state on the
+             * physical distributor.
+             *
+             * XXX: Investigate whether we would be able to set the
+             * physical interrupt active and save an interruption. (This
+             * is what the new vGIC does).
+             */
+            if ( p->desc != NULL )
+            {
+                unsigned long flags;
+
+                spin_lock_irqsave(&p->desc->lock, flags);
+                gic_set_pending_state(p->desc, true);
+                spin_unlock_irqrestore(&p->desc->lock, flags);
+                continue;
+            }
+        }
+
+        /*
+         * If the interrupt is per-vCPU, then we want to inject the vIRQ
+         * to v, otherwise we should let the function figuring out the
+         * correct vCPU.
+         */
+        vgic_inject_irq(v->domain, private ? v : NULL, irq, true);
+    }
+}
+
 bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
                  int virq, const struct sgi_target *target)
 {
diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index 447d24ea59..037c99f27a 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -288,6 +288,8 @@ extern struct vgic_irq_rank *vgic_rank_offset(struct vcpu *v, int b, int n, int
 extern struct vgic_irq_rank *vgic_rank_irq(struct vcpu *v, unsigned int irq);
 extern void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n);
 extern void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n);
+extern void vgic_set_irqs_pending(struct vcpu *v, uint32_t r,
+                                  unsigned int rank);
 extern void register_vgic_ops(struct domain *d, const struct vgic_ops *ops);
 int vgic_v2_init(struct domain *d, int *mmio_count);
 int vgic_v3_init(struct domain *d, int *mmio_count);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 19:34:48 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 19:34:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99388.189023 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNKtU-0003IG-BT; Fri, 19 Mar 2021 19:34:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99388.189023; Fri, 19 Mar 2021 19: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 1lNKtU-0003I6-7Q; Fri, 19 Mar 2021 19:34:48 +0000
Received: by outflank-mailman (input) for mailman id 99388;
 Fri, 19 Mar 2021 19:34: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 1lNKtT-0003Hy-2I
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:34: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 1lNKtT-0002Rc-1a
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:34:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNKtS-0000fn-WA
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19: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=41y/m5ngMwBfpxz4zHQwCyS5WFuWxRuuqVe1hg1SP+k=; b=wPGgFpWHMw6cCy73UWWVGuIWCL
	/qz0CyEA6uf41brhG+EZQ90E2ih+/MVqbkTN5sApZf5znMdx6l+fvtFh5JEFljDSktZa0LvWJ2PGk
	Zv12FPHDYhyJVOf0wXV9bWN1LES0O2jZrvWBZhOsv1unagqLQtoM5nK3hkuOHEA85m2w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] SUPPORT.MD: Clarify the support state for the Arm SMMUv{1, 2} drivers
Message-Id: <E1lNKtS-0000fn-WA@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 19:34:46 +0000

commit d705cba5ae917aece3921f38df1bc0a579267d12
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Wed Sep 23 09:28:32 2020 +0100
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:20:52 2021 -0700

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

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


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 19:34:59 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 19:34:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99389.189026 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNKtf-0003JL-Cf; Fri, 19 Mar 2021 19:34:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99389.189026; Fri, 19 Mar 2021 19:34: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 1lNKtf-0003JD-94; Fri, 19 Mar 2021 19:34:59 +0000
Received: by outflank-mailman (input) for mailman id 99389;
 Fri, 19 Mar 2021 19:34: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 1lNKtd-0003J1-Mz
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:34: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 1lNKtd-0002S9-M7
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:34:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNKtd-0000hB-Jm
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:34:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Dfu59YLXmAmz79vEnTObac1gJhIAbw51hy9W491OebY=; b=r9FAqDeNokkBZbaflV1Yz67s9F
	fytAHlLCUZ06En+1zlm71c16sKJCD4+MjgEgcNArKohbE+lToLGNlfUmIfr5D8WMfniP4d7kyeeBI
	ktkQl9Qhw5bCaBytJJbveTIkNMJeB2FjsoyDDiRyXGIVozQ5dfzdVnUHxZJ5dOrTRXrk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] SUPPORT.MD: Clarify the support state for the Arm SMMUv{1, 2} drivers
Message-Id: <E1lNKtd-0000hB-Jm@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 19:34:57 +0000

commit 5b280a59c4dd8dad6cc8da28db981b193d10acee
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Wed Sep 23 09:28:32 2020 +0100
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:25:19 2021 -0700

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

diff --git a/SUPPORT.md b/SUPPORT.md
index b4038974f9..79ebd51fb8 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -62,8 +62,8 @@ supported in this document.
 
     Status, AMD IOMMU: Supported
     Status, Intel VT-d: Supported
-    Status, ARM SMMUv1: Supported
-    Status, ARM SMMUv2: Supported
+    Status, ARM SMMUv1: Supported, not security supported
+    Status, ARM SMMUv2: Supported, not security supported
 
 ### ARM/GICv3 ITS
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 19:35:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 19:35:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99390.189029 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNKtp-0003KN-DT; Fri, 19 Mar 2021 19:35:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99390.189029; Fri, 19 Mar 2021 19:35:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNKtp-0003KH-AY; Fri, 19 Mar 2021 19:35:09 +0000
Received: by outflank-mailman (input) for mailman id 99390;
 Fri, 19 Mar 2021 19:35: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 1lNKto-0003K9-9r
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:35: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 1lNKto-0002Sb-96
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:35:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNKto-0000is-8G
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:35: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=8Gc/7UWTgCIu/tzJM1TuHvm5UwuAp033Gab0KYjtD9k=; b=cQi+qXtfl7ALTluOxWkxCxyHB/
	DFNjvw/VnYTTgPOEO/A9C7BiAE8b+PqYU7IGF5V0Ovh4ehqOFK8b9SuhFOl0CTjMvuoVvJtriNAR+
	mqWuwcMUldvqFcAd8ewnm08Cg9WNdfeogHtCIgXnErMQvQS2Z6E+jzREfs6Sjq6atogM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] SUPPORT.MD: Clarify the support state for the Arm SMMUv{1, 2} drivers
Message-Id: <E1lNKto-0000is-8G@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 19:35:08 +0000

commit 8bce4698f6264f4b359643233b1878d0f61ed7b0
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Wed Sep 23 09:28:32 2020 +0100
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:27:05 2021 -0700

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

diff --git a/SUPPORT.md b/SUPPORT.md
index 0c5bb6d4bc..8a28a4c0e9 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -56,8 +56,8 @@ Release Notes
 
     Status, AMD IOMMU: Supported
     Status, Intel VT-d: Supported
-    Status, ARM SMMUv1: Supported
-    Status, ARM SMMUv2: Supported
+    Status, ARM SMMUv1: Supported, not security supported
+    Status, ARM SMMUv2: Supported, not security supported
 
 ### ARM/GICv3 ITS
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 19:44:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 19:44:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99394.189046 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNL2V-0004OA-Bl; Fri, 19 Mar 2021 19:44:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99394.189046; Fri, 19 Mar 2021 19:44: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 1lNL2V-0004O2-8C; Fri, 19 Mar 2021 19:44:07 +0000
Received: by outflank-mailman (input) for mailman id 99394;
 Fri, 19 Mar 2021 19:44: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 1lNL2T-0004Nx-Ry
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:44: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 1lNL2T-0002bM-R0
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:44:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNL2T-0001Of-P1
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:44:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IZ6SKLP+g+HUdgiA7dgnIWB0ILjnONrLz+hTM/FxxHc=; b=BIVc3hKy2Pm/oakugTHc9hWko3
	uXOTs6jrsBpjh+p41IbInYZdyd5/JsusmR44IHyalSJp07HB/ZZ+UeR21x6Zt53BzjHjUYc5Pv7cB
	d6frPUIFqd5UAdhU4GLFHqcJoSuJagCOt85B5nRCe46uBh/WA/jmZaxYzJbfBWlDeYYM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] xen/arm: Document the erratum #853709 related to Cortex A72
Message-Id: <E1lNL2T-0001Of-P1@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 19:44:05 +0000

commit f43374f8c3af637f245d4ea2625bf98f1a7af84c
Author:     Michal Orzel <michal.orzel@arm.com>
AuthorDate: Wed Oct 14 12:05:41 2020 +0200
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:31:25 2021 -0700

    xen/arm: Document the erratum #853709 related to Cortex A72
    
    The Cortex-A72 erratum #853709 is the same as the Cortex-A57
    erratum #852523. As the latter is already workaround, we only
    need to update the documentation.
    
    Signed-off-by: Michal Orzel <michal.orzel@arm.com>
    [julieng: Reworded the commit message]
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    (cherry picked from commit f776e5fb3ee699745f6442ec8c47d0fa647e0575)
---
 docs/misc/arm/silicon-errata.txt | 1 +
 xen/arch/arm/domain.c            | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index e15d0923e9..1f18a9df58 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -50,6 +50,7 @@ stable hypervisors.
 | ARM            | Cortex-A57      | #834220         | ARM64_ERRATUM_834220    |
 | ARM            | Cortex-A57      | #1319537        | N/A                     |
 | ARM            | Cortex-A72      | #1319367        | N/A                     |
+| ARM            | Cortex-A72      | #853709         | N/A                     |
 | ARM            | Cortex-A76      | #1165522        | N/A                     |
 | ARM            | Neoverse-N1     | #1165522        | N/A
 | ARM            | MMU-500         | #842869         | N/A                     |
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index ac6a419f55..c94d2f48f1 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -216,7 +216,8 @@ static void ctxt_switch_to(struct vcpu *n)
     WRITE_SYSREG64(n->arch.ttbr1, TTBR1_EL1);
 
     /*
-     * Erratum #852523: DACR32_EL2 must be restored before one of the
+     * Erratum #852523 (Cortex-A57) or erratum #853709 (Cortex-A72):
+     * DACR32_EL2 must be restored before one of the
      * following sysregs: SCTLR_EL1, TCR_EL1, TTBR0_EL1, TTBR1_EL1 or
      * CONTEXTIDR_EL1.
      */
@@ -245,7 +246,8 @@ static void ctxt_switch_to(struct vcpu *n)
 
     /*
      * This write to sysreg CONTEXTIDR_EL1 ensures we don't hit erratum
-     * #852523. I.e DACR32_EL2 is not correctly synchronized.
+     * #852523 (Cortex-A57) or #853709 (Cortex-A72).
+     * I.e DACR32_EL2 is not correctly synchronized.
      */
     WRITE_SYSREG(n->arch.contextidr, CONTEXTIDR_EL1);
     WRITE_SYSREG(n->arch.tpidr_el0, TPIDR_EL0);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 19:44:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 19:44:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99395.189050 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNL2e-0004PH-EL; Fri, 19 Mar 2021 19:44:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99395.189050; Fri, 19 Mar 2021 19:44: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 1lNL2e-0004P9-BR; Fri, 19 Mar 2021 19:44:16 +0000
Received: by outflank-mailman (input) for mailman id 99395;
 Fri, 19 Mar 2021 19:44: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 1lNL2e-0004P3-17
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:44: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 1lNL2d-0002bU-Vi
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:44:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNL2d-0001PI-TR
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:44:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nqenUY9Bi/rsR79xOxgnmciTmb4ePIavCpRnyl3zlNc=; b=U/xl2O1dvkNh38OtSNq42C2Cav
	kuz2uhEnNupoqVq2xTYSUoyn7zSwz+BSYw4Uz701QUwerrlUawzrUbqhBNDRiEfl0guS9I0Rj190W
	yVdb8///bw6UDVFZ3/8ubXSM4f+Bss41S4g01JK87FpPfwxji3zslzHpTy3kDthRyJwQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] xen/arm: Add Cortex-A73 erratum 858921 workaround
Message-Id: <E1lNL2d-0001PI-TR@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 19:44:15 +0000

commit 2c46385e5ac44276cdb5d17da3e8ede6cd1f50f1
Author:     Penny Zheng <penny.zheng@arm.com>
AuthorDate: Mon Nov 9 16:21:10 2020 +0800
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:32:42 2021 -0700

    xen/arm: Add Cortex-A73 erratum 858921 workaround
    
    CNTVCT_EL0 or CNTPCT_EL0 counter read in Cortex-A73 (all versions)
    might return a wrong value when the counter crosses a 32bit boundary.
    
    Until now, there is no case for Xen itself to access CNTVCT_EL0,
    and it also should be the Guest OS's responsibility to deal with
    this part.
    
    But for CNTPCT, there exists several cases in Xen involving reading
    CNTPCT, so a possible workaround is that performing the read twice,
    and to return one or the other depending on whether a transition has
    taken place.
    
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Reviewed-by: Wei Chen <Wei.Chen@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 5505f5f8e7e805365cfe70b6a4af6115940bb749)
---
 docs/misc/arm/silicon-errata.txt |  1 +
 xen/arch/arm/Kconfig             | 18 ++++++++++++++++++
 xen/arch/arm/cpuerrata.c         |  8 ++++++++
 xen/arch/arm/vtimer.c            |  2 +-
 xen/include/asm-arm/cpuerrata.h  |  2 ++
 xen/include/asm-arm/cpufeature.h |  3 ++-
 xen/include/asm-arm/time.h       | 22 +++++++++++++++++++++-
 7 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index 1f18a9df58..552c4151d3 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -51,6 +51,7 @@ stable hypervisors.
 | ARM            | Cortex-A57      | #1319537        | N/A                     |
 | ARM            | Cortex-A72      | #1319367        | N/A                     |
 | ARM            | Cortex-A72      | #853709         | N/A                     |
+| ARM            | Cortex-A73      | #858921         | ARM_ERRATUM_858921      |
 | ARM            | Cortex-A76      | #1165522        | N/A                     |
 | ARM            | Neoverse-N1     | #1165522        | N/A
 | ARM            | MMU-500         | #842869         | N/A                     |
diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 2777388265..f938dd21bd 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -226,6 +226,24 @@ config ARM64_ERRATUM_834220
 
 	  If unsure, say Y.
 
+config ARM_ERRATUM_858921
+	bool "Cortex-A73: 858921: Possible wrong read value for CNTVCT or CNTPCT"
+	default y
+	help
+	  This option adds an alternative code sequence to work around ARM
+	  erratum 858921 on Cortex-A73 (all versions).
+
+	  Affected Cortex-A73 might return wrong read value for CNTVCT or CNTPCT
+	  when the counter crosses a 32bit boundary.
+
+	  The workaround involves performing the read twice, and to return
+	  one or the other value depending on whether a transition has taken place.
+	  Please note that this does not necessarily enable the workaround,
+	  as it depends on the alternative framework, which will only patch
+	  the kernel if an affected CPU is detected.
+
+	  If unsure, say Y.
+
 endmenu
 
 config ARM64_HARDEN_BRANCH_PREDICTOR
diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
index 6c09017515..739d302c54 100644
--- a/xen/arch/arm/cpuerrata.c
+++ b/xen/arch/arm/cpuerrata.c
@@ -475,6 +475,14 @@ static const struct arm_cpu_capabilities arm_errata[] = {
         .capability = ARM_SSBD,
         .matches = has_ssbd_mitigation,
     },
+#endif
+#ifdef CONFIG_ARM_ERRATUM_858921
+    {
+        /* Cortex-A73 (all versions) */
+        .desc = "ARM erratum 858921",
+        .capability = ARM_WORKAROUND_858921,
+        MIDR_ALL_VERSIONS(MIDR_CORTEX_A73),
+    },
 #endif
     {
         /* Neoverse r0p0 - r2p0 */
diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 6d39fc944f..c2b27915c6 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -62,7 +62,7 @@ static void virt_timer_expired(void *data)
 
 int domain_vtimer_init(struct domain *d, struct xen_arch_domainconfig *config)
 {
-    d->arch.virt_timer_base.offset = READ_SYSREG64(CNTPCT_EL0);
+    d->arch.virt_timer_base.offset = get_cycles();
     d->time_offset.seconds = ticks_to_ns(d->arch.virt_timer_base.offset - boot_count);
     do_div(d->time_offset.seconds, 1000000000);
 
diff --git a/xen/include/asm-arm/cpuerrata.h b/xen/include/asm-arm/cpuerrata.h
index 88ef3ca934..8d7e7b9375 100644
--- a/xen/include/asm-arm/cpuerrata.h
+++ b/xen/include/asm-arm/cpuerrata.h
@@ -28,6 +28,8 @@ static inline bool check_workaround_##erratum(void)             \
 CHECK_WORKAROUND_HELPER(766422, ARM32_WORKAROUND_766422, CONFIG_ARM_32)
 CHECK_WORKAROUND_HELPER(834220, ARM64_WORKAROUND_834220, CONFIG_ARM_64)
 CHECK_WORKAROUND_HELPER(ssbd, ARM_SSBD, CONFIG_ARM_SSBD)
+CHECK_WORKAROUND_HELPER(858921, ARM_WORKAROUND_858921,
+                        CONFIG_ARM_ERRATUM_858921)
 
 #undef CHECK_WORKAROUND_HELPER
 
diff --git a/xen/include/asm-arm/cpufeature.h b/xen/include/asm-arm/cpufeature.h
index 10878ead8a..016a9fe203 100644
--- a/xen/include/asm-arm/cpufeature.h
+++ b/xen/include/asm-arm/cpufeature.h
@@ -45,8 +45,9 @@
 #define ARM_SSBD 7
 #define ARM_SMCCC_1_1 8
 #define ARM64_WORKAROUND_AT_SPECULATE 9
+#define ARM_WORKAROUND_858921 10
 
-#define ARM_NCAPS           10
+#define ARM_NCAPS           11
 
 #ifndef __ASSEMBLY__
 
diff --git a/xen/include/asm-arm/time.h b/xen/include/asm-arm/time.h
index 9cb6f9b0b4..1b2c13614b 100644
--- a/xen/include/asm-arm/time.h
+++ b/xen/include/asm-arm/time.h
@@ -3,6 +3,7 @@
 
 #include <asm/sysregs.h>
 #include <asm/system.h>
+#include <asm/cpuerrata.h>
 
 #define DT_MATCH_TIMER                      \
     DT_MATCH_COMPATIBLE("arm,armv7-timer"), \
@@ -13,7 +14,26 @@ typedef uint64_t cycles_t;
 static inline cycles_t get_cycles (void)
 {
         isb();
-        return READ_SYSREG64(CNTPCT_EL0);
+        /*
+         * ARM_WORKAROUND_858921: Cortex-A73 (all versions) counter read
+         * can return a wrong value when the counter crosses a 32bit boundary.
+         */
+        if ( !check_workaround_858921() )
+            return READ_SYSREG64(CNTPCT_EL0);
+        else
+        {
+            /*
+             * A recommended workaround for erratum 858921 is to:
+             *  1- Read twice CNTPCT.
+             *  2- Compare bit[32] of the two read values.
+             *      - If bit[32] is different, keep the old value.
+             *      - If bit[32] is the same, keep the new value.
+             */
+            cycles_t old, new;
+            old = READ_SYSREG64(CNTPCT_EL0);
+            new = READ_SYSREG64(CNTPCT_EL0);
+            return (((old ^ new) >> 32) & 1) ? old : new;
+        }
 }
 
 /* List of timer's IRQ */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 19:44:26 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 19:44:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99396.189053 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNL2o-0004Qn-Fx; Fri, 19 Mar 2021 19:44:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99396.189053; Fri, 19 Mar 2021 19:44: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 1lNL2o-0004Qf-Cz; Fri, 19 Mar 2021 19:44:26 +0000
Received: by outflank-mailman (input) for mailman id 99396;
 Fri, 19 Mar 2021 19:44: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 1lNL2o-0004Qa-57
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:44: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 1lNL2o-0002bb-3Q
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:44:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNL2o-0001Q4-1d
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:44:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6XNwJAg+FU6LEVG9XEZkvxkpVLDAwmGqfrem7V2iItk=; b=ESjDzHWxU1JrmOUFMxxe2P8XZ7
	Lu0XTNznCYyriLQEQJkG9RdZNDni4swuVmQ0bidmEloOw6hP577AvhZDcXm+AXX8OxKDgQ2/or9dq
	bE2vI92iAqnC+BGaf4LaWnVc3lJfisnjOUnMs7IzmJsc5oQxYPGuMDKStFqGVP1KrAPM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] xen/arm: Add workaround for Cortex-A55 erratum #1530923
Message-Id: <E1lNL2o-0001Q4-1d@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 19:44:26 +0000

commit 8d6755fb4466a0c9af6c8953392327022ec61428
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Tue Nov 24 11:12:15 2020 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:33:12 2021 -0700

    xen/arm: Add workaround for Cortex-A55 erratum #1530923
    
    On the Cortex A55, TLB entries can be allocated by a speculative AT
    instruction. If this is happening during a guest context switch with an
    inconsistent page table state in the guest, TLBs with wrong values might
    be allocated.
    The ARM64_WORKAROUND_AT_SPECULATE workaround is used as for erratum
    1165522 on Cortex A76 or Neoverse N1.
    
    This change is also introducing the MIDR identifier for the Cortex-A55.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Rahul Singh <rahul.singh@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit fd7479b9aec25885cc17d33b326b9babae59faee)
---
 docs/misc/arm/silicon-errata.txt | 1 +
 xen/arch/arm/cpuerrata.c         | 6 ++++++
 xen/include/asm-arm/processor.h  | 2 ++
 3 files changed, 9 insertions(+)

diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index 552c4151d3..a15290285f 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -45,6 +45,7 @@ stable hypervisors.
 | ARM            | Cortex-A53      | #827319         | ARM64_ERRATUM_827319    |
 | ARM            | Cortex-A53      | #824069         | ARM64_ERRATUM_824069    |
 | ARM            | Cortex-A53      | #819472         | ARM64_ERRATUM_819472    |
+| ARM            | Cortex-A55      | #1530923        | N/A                     |
 | ARM            | Cortex-A57      | #852523         | N/A                     |
 | ARM            | Cortex-A57      | #832075         | ARM64_ERRATUM_832075    |
 | ARM            | Cortex-A57      | #834220         | ARM64_ERRATUM_834220    |
diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
index 739d302c54..66d9a1e45c 100644
--- a/xen/arch/arm/cpuerrata.c
+++ b/xen/arch/arm/cpuerrata.c
@@ -506,6 +506,12 @@ static const struct arm_cpu_capabilities arm_errata[] = {
         .capability = ARM64_WORKAROUND_AT_SPECULATE,
         MIDR_ALL_VERSIONS(MIDR_CORTEX_A57),
     },
+    {
+        /* Cortex-A55 (All versions as erratum is open in SDEN v14) */
+        .desc = "ARM erratum 1530923",
+        .capability = ARM64_WORKAROUND_AT_SPECULATE,
+        MIDR_ALL_VERSIONS(MIDR_CORTEX_A55),
+    },
     {},
 };
 
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index d3d12a9d19..87c8136022 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -53,6 +53,7 @@
 #define ARM_CPU_PART_CORTEX_A17     0xC0E
 #define ARM_CPU_PART_CORTEX_A15     0xC0F
 #define ARM_CPU_PART_CORTEX_A53     0xD03
+#define ARM_CPU_PART_CORTEX_A55     0xD05
 #define ARM_CPU_PART_CORTEX_A57     0xD07
 #define ARM_CPU_PART_CORTEX_A72     0xD08
 #define ARM_CPU_PART_CORTEX_A73     0xD09
@@ -64,6 +65,7 @@
 #define MIDR_CORTEX_A17 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A17)
 #define MIDR_CORTEX_A15 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A15)
 #define MIDR_CORTEX_A53 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A53)
+#define MIDR_CORTEX_A55 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A55)
 #define MIDR_CORTEX_A57 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A57)
 #define MIDR_CORTEX_A72 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A72)
 #define MIDR_CORTEX_A73 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A73)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 19:44:37 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 19:44:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99397.189058 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNL2z-0004S8-Hx; Fri, 19 Mar 2021 19:44:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99397.189058; Fri, 19 Mar 2021 19:44: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 1lNL2z-0004S0-Ef; Fri, 19 Mar 2021 19:44:37 +0000
Received: by outflank-mailman (input) for mailman id 99397;
 Fri, 19 Mar 2021 19:44: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 1lNL2y-0004Rq-7D
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:44: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 1lNL2y-0002bn-6N
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:44:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNL2y-0001Qi-5U
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:44:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lCgHhsnp0g0My2b1xDeuiMXk4yuBVpisY7gVRSkXl8g=; b=BEPVSdGUoUX1Hvd8CVrlPIYiQJ
	ibQ/UFJPqGWVaySN4IZYUiJYTgQZ90HoK3Q8E0GnOBU8vNJcmFn05n4hvfEvX4/9EoseouqxlOm9G
	tz0HLlBHMEWZWF7q7kjLC5RUjhRQPmwsWQYf9eLfF57VBluCS3BPEXk5ydu6QefrczxE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] xen/arm: Add workaround for Cortex-A53 erratum #843419
Message-Id: <E1lNL2y-0001Qi-5U@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 19:44:36 +0000

commit a8a6736c976f1ab14439952bd78dfd5bf3daffe9
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Thu Dec 10 10:42:58 2020 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:33:22 2021 -0700

    xen/arm: Add workaround for Cortex-A53 erratum #843419
    
    On the Cortex A53, when executing in AArch64 state, a load or store instruction
    which uses the result of an ADRP instruction as a base register, or which uses
    a base register written by an instruction immediately after an ADRP to the
    same register, might access an incorrect address.
    
    The workaround is to enable the linker flag --fix-cortex-a53-843419
    if present, to check and fix the affected sequence. Otherwise print a warning
    that Xen may be susceptible to this errata
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit d81133d45d81d35a4e7445778bfd1179190cbd31)
---
 docs/misc/arm/silicon-errata.txt |  1 +
 xen/arch/arm/Kconfig             | 19 +++++++++++++++++++
 xen/arch/arm/Makefile            |  8 ++++++++
 xen/scripts/Kbuild.include       | 12 ++++++++++++
 4 files changed, 40 insertions(+)

diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index a15290285f..67f9f3b395 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -45,6 +45,7 @@ stable hypervisors.
 | ARM            | Cortex-A53      | #827319         | ARM64_ERRATUM_827319    |
 | ARM            | Cortex-A53      | #824069         | ARM64_ERRATUM_824069    |
 | ARM            | Cortex-A53      | #819472         | ARM64_ERRATUM_819472    |
+| ARM            | Cortex-A53      | #843419         | ARM64_ERRATUM_843419    |
 | ARM            | Cortex-A55      | #1530923        | N/A                     |
 | ARM            | Cortex-A57      | #852523         | N/A                     |
 | ARM            | Cortex-A57      | #832075         | ARM64_ERRATUM_832075    |
diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index f938dd21bd..3a17c9e319 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -186,6 +186,25 @@ config ARM64_ERRATUM_819472
 
 	  If unsure, say Y.
 
+config ARM64_ERRATUM_843419
+	bool "Cortex-A53: 843419: A load or store might access an incorrect address"
+	default y
+	depends on ARM_64
+	help
+	  This option adds an alternative code sequence to work around ARM
+	  erratum 843419 on Cortex-A53 parts up to r0p4.
+
+	  When executing in AArch64 state, a load or store instruction which uses
+	  the result of an ADRP instruction as a base register, or which uses a
+	  base register written by an instruction immediately after an ADRP to the
+	  same register, might access an incorrect address.
+
+	  The workaround enables the linker to check if the affected sequence is
+	  produced and it will fix it with an alternative not affected sequence
+	  that produce the same behavior.
+
+	  If unsure, say Y.
+
 config ARM64_ERRATUM_832075
 	bool "Cortex-A57: 832075: possible deadlock on mixing exclusive memory accesses with device loads"
 	default y
diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 1ded44d200..ced90495ce 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -101,6 +101,14 @@ prelink.o: $(ALL_OBJS) FORCE
 	$(call if_changed,ld)
 endif
 
+ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
+    ifeq ($(call ld-option, --fix-cortex-a53-843419),n)
+        $(warning ld does not support --fix-cortex-a53-843419; xen may be susceptible to erratum)
+    else
+        XEN_LDFLAGS += --fix-cortex-a53-843419
+    endif
+endif
+
 targets += prelink.o
 
 $(TARGET)-syms: prelink.o xen.lds
diff --git a/xen/scripts/Kbuild.include b/xen/scripts/Kbuild.include
index e62eddc365..83c7e1457b 100644
--- a/xen/scripts/Kbuild.include
+++ b/xen/scripts/Kbuild.include
@@ -43,6 +43,18 @@ define as-option-add-closure
     endif
 endef
 
+# $(if-success,<command>,<then>,<else>)
+# Return <then> if <command> exits with 0, <else> otherwise.
+if-success = $(shell { $(1); } >/dev/null 2>&1 && echo "$(2)" || echo "$(3)")
+
+# $(success,<command>)
+# Return y if <command> exits with 0, n otherwise
+success = $(call if-success,$(1),y,n)
+
+# $(ld-option,<flag>)
+# Return y if the linker supports <flag>, n otherwise
+ld-option = $(call success,$(LD) -v $(1))
+
 # cc-ifversion
 # Usage:  EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
 cc-ifversion = $(shell [ $(CONFIG_GCC_VERSION)0 $(1) $(2)000 ] && echo $(3) || echo $(4))
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 19:44:47 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 19:44:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99398.189062 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNL39-0004Tg-J7; Fri, 19 Mar 2021 19:44:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99398.189062; Fri, 19 Mar 2021 19:44: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 1lNL39-0004TY-GE; Fri, 19 Mar 2021 19:44:47 +0000
Received: by outflank-mailman (input) for mailman id 99398;
 Fri, 19 Mar 2021 19:44: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 1lNL38-0004TQ-AU
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:44: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 1lNL38-0002dU-9j
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:44:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNL38-0001SI-8o
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:44: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=rKADwzTSovaVRjs5M6DyjntoPqKc5kYK4i0VeSpRoj8=; b=SmKX4zpDB9Qk9tWhjQ6O08Y43J
	BibPPXPwFAuVDpkoih5NLapc+qbeivPzKoJI45+Ny4ZCuOf9SvTcJsV4Rpgd6r2rm8+jx9U3gQeME
	EnI+wHv93OMVMlU5Plgq4e95PRj6ffziPiJni4OYwywGKF2Z9QyZzddUlYfN4XkSFLvw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] xen/arm: mm: Remove ; at the end of mm_printk()
Message-Id: <E1lNL38-0001SI-8o@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 19:44:46 +0000

commit b22b824f2eac90e1f2cac1df407c2e853aa997ed
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Nov 19 19:07:47 2020 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:34:19 2021 -0700

    xen/arm: mm: Remove ; at the end of mm_printk()
    
    The ; at the end of mm_printk() means the following code will not build
    correctly:
    
    if ( ... )
        mm_printk(...);
    else
        ...
    
    As we treat the macro as a function, we want to remove the ; at the end
    of it.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    (cherry picked from commit bfe67a17d4df2efbedaaf5cfbadc8a8627debf5c)
---
 xen/arch/arm/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 4aba9015b9..38200e2533 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -59,7 +59,7 @@ mm_printk(const char *fmt, ...) {}
     {                                       \
         dprintk(XENLOG_ERR, fmt, ## args);  \
         WARN();                             \
-    } while (0);
+    } while (0)
 #endif
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 19:44:57 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 19:44:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99399.189065 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNL3J-0004Us-Kl; Fri, 19 Mar 2021 19:44:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99399.189065; Fri, 19 Mar 2021 19:44: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 1lNL3J-0004Uk-Hm; Fri, 19 Mar 2021 19:44:57 +0000
Received: by outflank-mailman (input) for mailman id 99399;
 Fri, 19 Mar 2021 19:44: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 1lNL3I-0004Ud-Dq
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:44: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 1lNL3I-0002dy-D5
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:44:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNL3I-0001T9-CH
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:44:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jjd3aS8oKZO67m6dfT3lxT3XOO4Z4YA3iDs0I+8fzFM=; b=o3ge4hxQaKnYg5cbgZzPm77JOa
	pJZFLp9UJyFeN69HtVy3vF3upt5wigXSfeyJZjPtTeXzQSNWr268KmsTumAu9OR3jKhPC/zsZC9lN
	IREqeX7Mjl+NT+G6csh9o9HxNhJEdFD8Sz0KHg1ZfgumIvlpTZrEC/tVYlATXs5k4+tk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] xen/vgic: Implement write to ISPENDR in vGICv{2, 3}
Message-Id: <E1lNL3I-0001T9-CH@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 19:44:56 +0000

commit 679907201145ad9b74984cce961f1706b07cb0ac
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Sat Feb 20 14:04:12 2021 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:34:43 2021 -0700

    xen/vgic: Implement write to ISPENDR in vGICv{2, 3}
    
    Currently, Xen will send a data abort to a guest trying to write to the
    ISPENDR.
    
    Unfortunately, recent version of Linux (at least 5.9+) will start
    writing to the register if the interrupt needs to be re-triggered
    (see the callback irq_retrigger). This can happen when a driver (such as
    the xgbe network driver on AMD Seattle) re-enable an interrupt:
    
    (XEN) d0v0: vGICD: unhandled word write 0x00000004000000 to ISPENDR44
    [...]
    [   25.635837] Unhandled fault at 0xffff80001000522c
    [...]
    [   25.818716]  gic_retrigger+0x2c/0x38
    [   25.822361]  irq_startup+0x78/0x138
    [   25.825920]  __enable_irq+0x70/0x80
    [   25.829478]  enable_irq+0x50/0xa0
    [   25.832864]  xgbe_one_poll+0xc8/0xd8
    [   25.836509]  net_rx_action+0x110/0x3a8
    [   25.840328]  __do_softirq+0x124/0x288
    [   25.844061]  irq_exit+0xe0/0xf0
    [   25.847272]  __handle_domain_irq+0x68/0xc0
    [   25.851442]  gic_handle_irq+0xa8/0xe0
    [   25.855171]  el1_irq+0xb0/0x180
    [   25.858383]  arch_cpu_idle+0x18/0x28
    [   25.862028]  default_idle_call+0x24/0x5c
    [   25.866021]  do_idle+0x204/0x278
    [   25.869319]  cpu_startup_entry+0x24/0x68
    [   25.873313]  rest_init+0xd4/0xe4
    [   25.876611]  arch_call_rest_init+0x10/0x1c
    [   25.880777]  start_kernel+0x5b8/0x5ec
    
    As a consequence, the OS may become unusable.
    
    Implementing the write part of ISPENDR is somewhat easy. For
    virtual interrupt, we only need to inject the interrupt again.
    
    For physical interrupt, we need to be more careful as the de-activation
    of the virtual interrupt will be propagated to the physical distributor.
    For simplicity, the physical interrupt will be set pending so the
    workflow will not differ from a "real" interrupt.
    
    Longer term, we could possible directly activate the physical interrupt
    and avoid taking an exception to inject the interrupt to the domain.
    (This is the approach taken by the new vGIC based on KVM).
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit 067935804a8e7a33ff7170a2db8ce94bb46d9a63)
---
 xen/arch/arm/vgic-v2.c     | 10 ++++++----
 xen/arch/arm/vgic-v3.c     | 18 +++++++-----------
 xen/arch/arm/vgic.c        | 47 ++++++++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/vgic.h |  2 ++
 4 files changed, 62 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 64b141fea5..b2da886adc 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -472,10 +472,12 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        printk(XENLOG_G_ERR
-               "%pv: vGICD: unhandled word write %#"PRIregister" to ISPENDR%d\n",
-               v, r, gicd_reg - GICD_ISPENDR);
-        return 0;
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ISPENDR, DABT_WORD);
+        if ( rank == NULL ) goto write_ignore;
+
+        vgic_set_irqs_pending(v, r, rank->index);
+
+        return 1;
 
     case VRANGE32(GICD_ICPENDR, GICD_ICPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index fd8cfc156d..613f37abab 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -808,10 +808,12 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
 
     case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        printk(XENLOG_G_ERR
-               "%pv: %s: unhandled word write %#"PRIregister" to ISPENDR%d\n",
-               v, name, r, reg - GICD_ISPENDR);
-        return 0;
+        rank = vgic_rank_offset(v, 1, reg - GICD_ISPENDR, DABT_WORD);
+        if ( rank == NULL ) goto write_ignore;
+
+        vgic_set_irqs_pending(v, r, rank->index);
+
+        return 1;
 
     case VRANGE32(GICD_ICPENDR, GICD_ICPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
@@ -975,6 +977,7 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
     case VREG32(GICR_ICACTIVER0):
     case VREG32(GICR_ICFGR1):
     case VRANGE32(GICR_IPRIORITYR0, GICR_IPRIORITYR7):
+    case VREG32(GICR_ISPENDR0):
          /*
           * Above registers offset are common with GICD.
           * So handle common with GICD handling
@@ -982,13 +985,6 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
         return __vgic_v3_distr_common_mmio_write("vGICR: SGI", v,
                                                  info, gicr_reg, r);
 
-    case VREG32(GICR_ISPENDR0):
-        if ( dabt.size != DABT_WORD ) goto bad_width;
-        printk(XENLOG_G_ERR
-               "%pv: vGICR: SGI: unhandled word write %#"PRIregister" to ISPENDR0\n",
-               v, r);
-        return 0;
-
     case VREG32(GICR_ICPENDR0):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 82f524a35c..8f9400a519 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -423,6 +423,53 @@ void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
     }
 }
 
+void vgic_set_irqs_pending(struct vcpu *v, uint32_t r, unsigned int rank)
+{
+    const unsigned long mask = r;
+    unsigned int i;
+    /* The first rank is always per-vCPU */
+    bool private = rank == 0;
+
+    /* LPIs will never be set pending via this function */
+    ASSERT(!is_lpi(32 * rank + 31));
+
+    for_each_set_bit( i, &mask, 32 )
+    {
+        unsigned int irq = i + 32 * rank;
+
+        if ( !private )
+        {
+            struct pending_irq *p = spi_to_pending(v->domain, irq);
+
+            /*
+             * When the domain sets the pending state for a HW interrupt on
+             * the virtual distributor, we set the pending state on the
+             * physical distributor.
+             *
+             * XXX: Investigate whether we would be able to set the
+             * physical interrupt active and save an interruption. (This
+             * is what the new vGIC does).
+             */
+            if ( p->desc != NULL )
+            {
+                unsigned long flags;
+
+                spin_lock_irqsave(&p->desc->lock, flags);
+                gic_set_pending_state(p->desc, true);
+                spin_unlock_irqrestore(&p->desc->lock, flags);
+                continue;
+            }
+        }
+
+        /*
+         * If the interrupt is per-vCPU, then we want to inject the vIRQ
+         * to v, otherwise we should let the function figuring out the
+         * correct vCPU.
+         */
+        vgic_inject_irq(v->domain, private ? v : NULL, irq, true);
+    }
+}
+
 bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
                  int virq, const struct sgi_target *target)
 {
diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index ce1e3c4bbd..62c2ae538d 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -288,6 +288,8 @@ extern struct vgic_irq_rank *vgic_rank_offset(struct vcpu *v, int b, int n, int
 extern struct vgic_irq_rank *vgic_rank_irq(struct vcpu *v, unsigned int irq);
 extern void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n);
 extern void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n);
+extern void vgic_set_irqs_pending(struct vcpu *v, uint32_t r,
+                                  unsigned int rank);
 extern void register_vgic_ops(struct domain *d, const struct vgic_ops *ops);
 int vgic_v2_init(struct domain *d, int *mmio_count);
 int vgic_v3_init(struct domain *d, int *mmio_count);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Mar 19 19:45:07 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Mar 2021 19:45:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99400.189070 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNL3T-0004WI-O2; Fri, 19 Mar 2021 19:45:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99400.189070; Fri, 19 Mar 2021 19:45: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 1lNL3T-0004WA-Ki; Fri, 19 Mar 2021 19:45:07 +0000
Received: by outflank-mailman (input) for mailman id 99400;
 Fri, 19 Mar 2021 19:45: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 1lNL3S-0004W0-I5
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:45: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 1lNL3S-0002ee-HL
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:45:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNL3S-0001UG-FV
 for xen-changelog@lists.xenproject.org; Fri, 19 Mar 2021 19:45:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KAk+87+RKbweBnqBWcelkb8ZwH5sLYtNciMEeIHaT+o=; b=OvOuPA4+DYZ6oOeJveETp+4c8k
	T8EHd9ZeU0WgikEZddETePef55TauXmE9NNvJT/ymvRm4CsCK1YBnBVXgldg0gb2/BtMLnxa50wBe
	IeSFfQrzHlZdMcrhehvBDj2eLgRotbnrMPuEOfl/cCx7JCIjPayuTSvtXHm6b8mtgRgY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] SUPPORT.MD: Clarify the support state for the Arm SMMUv{1, 2} drivers
Message-Id: <E1lNL3S-0001UG-FV@xenbits.xenproject.org>
Date: Fri, 19 Mar 2021 19:45:06 +0000

commit ddb39ba714257debb9b66936abb0dd3039e85abd
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Wed Sep 23 09:28:32 2020 +0100
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:35:22 2021 -0700

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

diff --git a/SUPPORT.md b/SUPPORT.md
index 8070b2df99..12e77ab66b 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -62,8 +62,8 @@ supported in this document.
 
     Status, AMD IOMMU: Supported
     Status, Intel VT-d: Supported
-    Status, ARM SMMUv1: Supported
-    Status, ARM SMMUv2: Supported
+    Status, ARM SMMUv1: Supported, not security supported
+    Status, ARM SMMUv2: Supported, not security supported
     Status, Renesas IPMMU-VMSA: Tech Preview
 
 ### ARM/GICv3 ITS
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 12:44:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 12:44:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99484.189213 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNaxY-0002rm-CW; Sat, 20 Mar 2021 12:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99484.189213; Sat, 20 Mar 2021 12: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 1lNaxY-0002rd-8x; Sat, 20 Mar 2021 12:44:04 +0000
Received: by outflank-mailman (input) for mailman id 99484;
 Sat, 20 Mar 2021 12: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 1lNaxW-0002rY-M7
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12: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 1lNaxW-0006Db-GQ
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNaxW-0007zI-Eo
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12: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=IBGydd54PClsl8rgmfaAYFkNyBnOIJEElDozRbUgcN0=; b=qbmyeqAj19JT9ql+OZgWQuo9Bu
	Eg28rIat/IPktCEpGD/Sq1Bl0bjXOTqX3gWxaazqE2npSpwd/f8aJqZAeL6ZSRh96vo2eP5VCjNG5
	bEi0rjKN3gIn2ZsdKg/mhOtau3tvef0KImHxR63bfqxpC2iOX0NKH3h0k4fd/9LSDEcA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] tools/ocaml: libxb: Harden stub_header_of_string()
Message-Id: <E1lNaxW-0007zI-Eo@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 12:44:02 +0000

commit 0e904b781f05faf58243ff22b24e40492b2e4ef7
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Mar 30 14:29:10 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:41:01 2021 +0000

    tools/ocaml: libxb: Harden stub_header_of_string()
    
    stub_header_of_string() should not modify the header. So mark the
    variable 'hdr' as const.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit d92ba1aa7cf877a77abdcbd94a6a19fc55886a75)
---
 tools/ocaml/libs/xb/xenbus_stubs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xb/xenbus_stubs.c b/tools/ocaml/libs/xb/xenbus_stubs.c
index a68e783f70..001bb03371 100644
--- a/tools/ocaml/libs/xb/xenbus_stubs.c
+++ b/tools/ocaml/libs/xb/xenbus_stubs.c
@@ -40,12 +40,12 @@ CAMLprim value stub_header_of_string(value s)
 {
 	CAMLparam1(s);
 	CAMLlocal1(ret);
-	struct xsd_sockmsg *hdr;
+	const struct xsd_sockmsg *hdr;
 
 	if (caml_string_length(s) != sizeof(struct xsd_sockmsg))
 		caml_failwith("xb header incomplete");
 	ret = caml_alloc_tuple(4);
-	hdr = (struct xsd_sockmsg *) String_val(s);
+	hdr = (const struct xsd_sockmsg *) String_val(s);
 	Store_field(ret, 0, Val_int(hdr->tx_id));
 	Store_field(ret, 1, Val_int(hdr->req_id));
 	Store_field(ret, 2, Val_int(hdr->type));
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 12:44:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 12:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99485.189216 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNaxi-0002sc-Dj; Sat, 20 Mar 2021 12:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99485.189216; Sat, 20 Mar 2021 12: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 1lNaxi-0002sU-Ah; Sat, 20 Mar 2021 12:44:14 +0000
Received: by outflank-mailman (input) for mailman id 99485;
 Sat, 20 Mar 2021 12: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 1lNaxg-0002sL-Lr
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12: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 1lNaxg-0006De-Kc
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNaxg-0007zs-Ii
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12: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=HMdXkPKXT1ziYH5uKRJS1qSPDGkeDSS1Jo3wgJof5gA=; b=gyZJKfVArI/DL/EOSHSZlBA4SR
	2h7vxxQJ0gECj0LQnKkdfYPoGKe26WHzKAxvhiP2/ENfOwN4iwEnJqJU/NdC3EU7IbG7SGkVuV9Gf
	nXE1SvZ6tVXc/aCgYl6pgamk69/r9cCP0itwLUNX4R7m3CQSiE9qpjCUw27rm/FX+4qY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] tools/ocaml: Fix stubs build when OCaml has been compiled with -safe-string
Message-Id: <E1lNaxg-0007zs-Ii@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 12:44:12 +0000

commit 1cd059ae93261374527cc678551510bfb4a8858e
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Mar 30 15:14:23 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:41:05 2021 +0000

    tools/ocaml: Fix stubs build when OCaml has been compiled with -safe-string
    
    The OCaml code has been fixed to handle properly -safe-string in Xen
    4.11, however the stubs part were missed.
    
    On OCaml newer than 4.06.1, String_Val() will return a const char *
    when using -safe-string leading to build failure when this is used
    in place where char * is expected.
    
    The main use in Xen code base is when a new string is allocated. The
    suggested approach by the OCaml community [1] is to use the helper
    caml_alloc_initialized_string() but it was introduced by OCaml 4.06.1.
    
    The next best approach is to cast String_val() to (char *) as the helper
    would have done. So use it when we need to update the new string using
    memcpy().
    
    Take the opportunity to remove the unnecessary cast of the source as
    mempcy() is expecting a void *.
    
    [1] https://github.com/ocaml/ocaml/pull/1274
    
    Reported-by: Dario Faggioli <dfaggioli@suse.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit 59b087e3954402c487e0abb4ad9bd05f43669436)
---
 tools/ocaml/libs/xb/xenbus_stubs.c  | 2 +-
 tools/ocaml/libs/xc/xenctrl_stubs.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/ocaml/libs/xb/xenbus_stubs.c b/tools/ocaml/libs/xb/xenbus_stubs.c
index 001bb03371..3065181a55 100644
--- a/tools/ocaml/libs/xb/xenbus_stubs.c
+++ b/tools/ocaml/libs/xb/xenbus_stubs.c
@@ -65,7 +65,7 @@ CAMLprim value stub_string_of_header(value tid, value rid, value ty, value len)
 	};
 
 	ret = caml_alloc_string(sizeof(struct xsd_sockmsg));
-	memcpy(String_val(ret), &xsd, sizeof(struct xsd_sockmsg));
+	memcpy((char *) String_val(ret), &xsd, sizeof(struct xsd_sockmsg));
 
 	CAMLreturn(ret);
 }
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 48f39f81d5..e16ed15b86 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -505,7 +505,7 @@ CAMLprim value stub_xc_vcpu_context_get(value xch, value domid,
 	ret = xc_vcpu_getcontext(_H(xch), _D(domid), Int_val(cpu), &ctxt);
 
 	context = caml_alloc_string(sizeof(ctxt));
-	memcpy(String_val(context), (char *) &ctxt.c, sizeof(ctxt.c));
+	memcpy((char *) String_val(context), &ctxt.c, sizeof(ctxt.c));
 
 	CAMLreturn(context);
 }
@@ -684,7 +684,7 @@ CAMLprim value stub_xc_readconsolering(value xch)
 		conring_size = size;
 
 	ring = caml_alloc_string(count);
-	memcpy(String_val(ring), str, count);
+	memcpy((char *) String_val(ring), str, count);
 	free(str);
 
 	CAMLreturn(ring);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 12:44:23 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 12:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99486.189220 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNaxr-0002tx-FJ; Sat, 20 Mar 2021 12:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99486.189220; Sat, 20 Mar 2021 12: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 1lNaxr-0002tl-CD; Sat, 20 Mar 2021 12:44:23 +0000
Received: by outflank-mailman (input) for mailman id 99486;
 Sat, 20 Mar 2021 12: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 1lNaxq-0002tg-PZ
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12: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 1lNaxq-0006Dk-Nt
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNaxq-00080V-Mz
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12: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=8KP13Z1g4xFItvAlUZOwGC3418O28LpAh+2xy07U+Jo=; b=1/rGREAv0oWhct4NrOHhYRa1bu
	fEZxhy+Jg/nusXwk737IEAnlAOGuw+i1ZwX1J9ezCUbuS3N/1JChzh43WHq60Fv8HkKU/EjOt2cBD
	eW8JcUvjFEVfWiPNFOKYraipOhlFfdsifNckgjLvB/NKfwV+uDbzseUqLxP3+kN0WUVE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] tools/ocaml: libxb: Avoid to use String_val() when value is bytes
Message-Id: <E1lNaxq-00080V-Mz@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 12:44:22 +0000

commit 23f3adaa37f85c2863633e76f9ccce6447b5571c
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Mar 30 18:50:08 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:41:10 2021 +0000

    tools/ocaml: libxb: Avoid to use String_val() when value is bytes
    
    Commit ec7d54dd1a "ocaml/libs/xb: Use bytes in place of strings for
    mutable buffers" switch mutable buffers from string to bytes. However
    the C code were still using String_Val() to access them.
    
    While the underlying structure is the same between string and bytes, a
    string is meant to be immutable. OCaml 4.06.1 and later will enforce it.
    Therefore, it will not be possible to build the OCaml libs when using
    -safe-string. This is because String_val() will return a const value.
    
    To avoid plain cast in the code, the code is now switched to use
    Bytes_val(). As the macro is not defined in older OCaml version, we need
    to provide a stub.
    
    Take the opportunity to switch to const the buffer in
    ml_interface_write() as it should not be modified.
    
    Reported-by: Dario Faggioli <dfaggioli@suse.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit 78686437e949a85a207ae1a0d637efe2d3778bbe)
---
 tools/ocaml/libs/xb/xs_ring_stubs.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xb/xs_ring_stubs.c b/tools/ocaml/libs/xb/xs_ring_stubs.c
index 473787064a..7537a23949 100644
--- a/tools/ocaml/libs/xb/xs_ring_stubs.c
+++ b/tools/ocaml/libs/xb/xs_ring_stubs.c
@@ -36,6 +36,14 @@
 
 #define GET_C_STRUCT(a) ((struct mmap_interface *) a)
 
+/*
+ * Bytes_val has been introduced by Ocaml 4.06.1. So define our own version
+ * if needed.
+ */
+#ifndef Bytes_val
+#define Bytes_val(x) ((unsigned char *) Bp_val(x))
+#endif
+
 CAMLprim value ml_interface_read(value ml_interface,
                                  value ml_buffer,
                                  value ml_len)
@@ -44,7 +52,7 @@ CAMLprim value ml_interface_read(value ml_interface,
 	CAMLlocal1(ml_result);
 
 	struct mmap_interface *interface = GET_C_STRUCT(ml_interface);
-	char *buffer = String_val(ml_buffer);
+	unsigned char *buffer = Bytes_val(ml_buffer);
 	int len = Int_val(ml_len);
 	int result;
 
@@ -103,7 +111,7 @@ CAMLprim value ml_interface_write(value ml_interface,
 	CAMLlocal1(ml_result);
 
 	struct mmap_interface *interface = GET_C_STRUCT(ml_interface);
-	char *buffer = String_val(ml_buffer);
+	const unsigned char *buffer = Bytes_val(ml_buffer);
 	int len = Int_val(ml_len);
 	int result;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 12:44:33 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 12:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99487.189225 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNay1-0002vM-HE; Sat, 20 Mar 2021 12:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99487.189225; Sat, 20 Mar 2021 12: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 1lNay1-0002vE-Dd; Sat, 20 Mar 2021 12:44:33 +0000
Received: by outflank-mailman (input) for mailman id 99487;
 Sat, 20 Mar 2021 12: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 1lNay0-0002v6-SG
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12: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 1lNay0-0006Du-RP
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNay0-00081G-QY
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12: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=YPuKXzpHXo4SIa2GQaSGxXZyjlSryJL52EawgeYjEps=; b=6nF3tCg/+YoZBsR0GQEG4j3vp8
	x4hjBGM0N9cOUs6Sj7sslgO8OWPDiVt0BhOEeE2vyqELFxNWsTFbDM7mgvvfPjbiyvk+sJhA/Sj+/
	MjkPlu/mndmMnESxK3J52SZKrWV3fS5kz27O8k9WPhRWXqgpSPSSLxg3OlP06C2cB+aI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] tools/libxc: misc: Mark const the parameter 'keys' of xc_send_debug_keys()
Message-Id: <E1lNay0-00081G-QY@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 12:44:32 +0000

commit 5c65f9d5fcc3e1cbe4c07a0d2c9223205c1f819a
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Mar 30 20:21:52 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:41:20 2021 +0000

    tools/libxc: misc: Mark const the parameter 'keys' of xc_send_debug_keys()
    
    OCaml is using a string to describe the parameter 'keys' of
    xc_send_debug_keys(). Since Ocaml 4.06.01, String_val() will return a
    const char * when using -safe-string. This will result to a build
    failure because xc_send_debug_keys() expects a char *.
    
    The function should never modify the parameter 'keys' and therefore the
    parameter should be const. Unfortunately, this is not directly possible
    because DECLARE_HYPERCALL_BOUNCE() is expecting a non-const variable.
    
    A new macro DECLARE_HYPERCALL_BOUNCE_IN() is introduced and will take
    care of const parameter. The first user will be xc_send_debug_keys() but
    this can be used in more place in the future.
    
    Reported-by: Dario Faggioli <dfaggioli@suse.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 2b8079610ec55413613ad071cc81cd9f97232a7e)
---
 tools/libxc/include/xenctrl.h | 2 +-
 tools/libxc/xc_misc.c         | 4 ++--
 tools/libxc/xc_private.h      | 8 ++++++++
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index f4431687b3..0bd593157c 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1225,7 +1225,7 @@ int xc_readconsolering(xc_interface *xch,
                        unsigned int *pnr_chars,
                        int clear, int incremental, uint32_t *pindex);
 
-int xc_send_debug_keys(xc_interface *xch, char *keys);
+int xc_send_debug_keys(xc_interface *xch, const char *keys);
 int xc_set_parameters(xc_interface *xch, char *params);
 
 typedef struct xen_sysctl_physinfo xc_physinfo_t;
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index 8e60b6e9f0..564da16e18 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -167,11 +167,11 @@ int xc_readconsolering(xc_interface *xch,
     return ret;
 }
 
-int xc_send_debug_keys(xc_interface *xch, char *keys)
+int xc_send_debug_keys(xc_interface *xch, const char *keys)
 {
     int ret, len = strlen(keys);
     DECLARE_SYSCTL;
-    DECLARE_HYPERCALL_BOUNCE(keys, len, XC_HYPERCALL_BUFFER_BOUNCE_IN);
+    DECLARE_HYPERCALL_BOUNCE_IN(keys, len);
 
     if ( xc_hypercall_bounce_pre(xch, keys) )
         return -1;
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index adc3b6a571..c77edb3c4c 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -181,6 +181,14 @@ enum {
  */
 #define DECLARE_HYPERCALL_BOUNCE(_ubuf, _sz, _dir) DECLARE_NAMED_HYPERCALL_BOUNCE(_ubuf, _ubuf, _sz, _dir)
 
+/*
+ * Declare a bounce buffer shadowing the named user data pointer that
+ * cannot be modified.
+ */
+#define DECLARE_HYPERCALL_BOUNCE_IN(_ubuf, _sz)                     \
+    DECLARE_NAMED_HYPERCALL_BOUNCE(_ubuf, (void *)(_ubuf), _sz,     \
+                                   XC_HYPERCALL_BUFFER_BOUNCE_IN)
+
 /*
  * Set the size of data to bounce. Useful when the size is not known
  * when the bounce buffer is declared.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 12:44:43 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 12:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99488.189228 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNayB-0002wf-I6; Sat, 20 Mar 2021 12:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99488.189228; Sat, 20 Mar 2021 12: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 1lNayB-0002wY-FB; Sat, 20 Mar 2021 12:44:43 +0000
Received: by outflank-mailman (input) for mailman id 99488;
 Sat, 20 Mar 2021 12: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 1lNayA-0002wQ-Vf
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12: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 1lNayA-0006Fa-Uo
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNayA-00082S-Ti
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12: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=Uh7qI6geQk/NZuKlA4HPNF+MyFAg4gVjSPraqwy1+Q8=; b=lyy+u3n7M2DEosx9d15ciYvn51
	OCkQYsAHFm5MuiJsTv3IxjgLQ7+Vg6udhi39Dux3uv0BiNR94nAiWAl8XoqvzI4EiKGrsB78YgmE2
	0sLYGPWNqGjTts4sdG0hQn72RDZ8jv5T0kdl2Y5Rjf0ZmGgvWmOLNZ1Nto027qEdW+JI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] oxenstored: fix ABI breakage introduced in Xen 4.9.0
Message-Id: <E1lNayA-00082S-Ti@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 12:44:42 +0000

commit f95c227c758b1838e91d0ca54c8b4a47b9ba0d6d
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Wed Jul 15 16:10:56 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:41:26 2021 +0000

    oxenstored: fix ABI breakage introduced in Xen 4.9.0
    
    dbc84d2983969bb47d294131ed9e6bbbdc2aec49 (Xen >= 4.9.0) deleted XS_RESTRICT
    from oxenstored, which caused all the following opcodes to be shifted by 1:
    reset_watches became off-by-one compared to the C version of xenstored.
    
    Looking at the C code the opcode for reset watches needs:
    XS_RESET_WATCHES = XS_SET_TARGET + 2
    
    So add the placeholder `Invalid` in the OCaml<->C mapping list.
    (Note that the code here doesn't simply convert the OCaml constructor to
     an integer, so we don't need to introduce a dummy constructor).
    
    Igor says that with a suitably patched xenopsd to enable watch reset,
    we now see `reset watches` during kdump of a guest in xenstored-access.log.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Tested-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit a6ed77f1e0334c26e6e216aea45f8674d9284856)
    (cherry picked from commit 9503a6df19924d2d9bf5b5a663342ba1507819c5)
---
 tools/ocaml/libs/xb/op.ml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ocaml/libs/xb/op.ml b/tools/ocaml/libs/xb/op.ml
index d4f1f08185..9bcab0f38c 100644
--- a/tools/ocaml/libs/xb/op.ml
+++ b/tools/ocaml/libs/xb/op.ml
@@ -28,7 +28,7 @@ let operation_c_mapping =
            Transaction_end; Introduce; Release;
            Getdomainpath; Write; Mkdir; Rm;
            Setperms; Watchevent; Error; Isintroduced;
-           Resume; Set_target; Reset_watches |]
+           Resume; Set_target; Invalid; Reset_watches |]
 let size = Array.length operation_c_mapping
 
 let array_search el a =
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 12:44:53 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 12:44:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99489.189232 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNayL-0002yE-Ks; Sat, 20 Mar 2021 12:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99489.189232; Sat, 20 Mar 2021 12: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 1lNayL-0002y6-H1; Sat, 20 Mar 2021 12:44:53 +0000
Received: by outflank-mailman (input) for mailman id 99489;
 Sat, 20 Mar 2021 12: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 1lNayL-0002y1-4S
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12: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 1lNayL-0006Fl-1z
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12:44:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNayL-00083k-0o
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12: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=6e28yn4xodPkmd1dtH3xzw0lADWbfDlN8b49vbvYJ3k=; b=5N49bsMof33Nz4ERgdbyAdkG7Z
	9fW9FNvBbtY9nM3OftR7a5C8E8Y7wm0/bF7ktB5R64MQrtRPMXK7olAgwSF/kT1kRvsMq33FqJP46
	Y39JgpH8BmAuyMglD4/BwlB5DXgOqChKnTDV4TOC9Ky7TK11jdqH+Av30XEIjeWk4vuI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] tools/ocaml/libs/xb: Do not crash after xenbus is unmapped
Message-Id: <E1lNayL-00083k-0o@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 12:44:53 +0000

commit 9e2ee42fb9ae1b0491e900454e6d908f48cbe77e
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 18:23:10 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:44:12 2021 +0000

    tools/ocaml/libs/xb: Do not crash after xenbus is unmapped
    
    Xenmmap.unmap sets the address to MAP_FAILED in xenmmap_stubs.c.  If due to a
    bug there were still references to the Xenbus and we attempt to use it then we
    crash.  Raise an exception instead of crashing.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 5e317896342d553f0b55f72948bbf93a0f1147d3)
---
 tools/ocaml/libs/xb/xs_ring_stubs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/ocaml/libs/xb/xs_ring_stubs.c b/tools/ocaml/libs/xb/xs_ring_stubs.c
index 7537a23949..7a91fdee75 100644
--- a/tools/ocaml/libs/xb/xs_ring_stubs.c
+++ b/tools/ocaml/libs/xb/xs_ring_stubs.c
@@ -32,6 +32,7 @@
 #include <caml/fail.h>
 #include <caml/callback.h>
 
+#include <sys/mman.h>
 #include "mmap_stubs.h"
 
 #define GET_C_STRUCT(a) ((struct mmap_interface *) a)
@@ -166,6 +167,8 @@ CAMLprim value ml_interface_set_server_features(value interface, value v)
 {
 	CAMLparam2(interface, v);
 	struct xenstore_domain_interface *intf = GET_C_STRUCT(interface)->addr;
+	if (intf == (void*)MAP_FAILED)
+		caml_failwith("Interface closed");
 
 	intf->server_features = Int_val(v);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 12:45:04 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 12:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99490.189236 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNayV-0002zR-Mp; Sat, 20 Mar 2021 12:45:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99490.189236; Sat, 20 Mar 2021 12: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 1lNayV-0002zK-J7; Sat, 20 Mar 2021 12:45:03 +0000
Received: by outflank-mailman (input) for mailman id 99490;
 Sat, 20 Mar 2021 12: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 1lNayV-0002zF-6A
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12: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 1lNayV-0006Gk-5A
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12:45:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNayV-00084b-4F
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12: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=xS3tuDtr2dt6UGT1tRcqyF2YMYbrU9jv1Tf3MN8Lkmw=; b=NDK8+buZSkjQitBX5iz7WhjWiF
	sNOKF/pgYt2aoifu8x59fQzokr/Yr4fyGuHhx/NtN/mW6CLj1h5G/UHmChMeAGdVjHfTi7JMhWW1Y
	NlW16HtStkydoltn80nB5XvA7cfKyR8qSNkFWfm28Q6ZccVmWHRFgydIXeg6LOyOZqTQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] tools/oxenstored: Trim txhistory on xenbus reconnect
Message-Id: <E1lNayV-00084b-4F@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 12:45:03 +0000

commit 7660e7949d6dc2176f3e1efe0fa5b0aeb1e9fb0e
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 8 11:57:37 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:44:13 2021 +0000

    tools/oxenstored: Trim txhistory on xenbus reconnect
    
    There is a global history, containing transactions from the past 0.05s, which
    get trimmed whenever any transaction commits or aborts.  Destroying a domain
    will cause xenopsd to perform some transactions deleting the tree, so that is
    fine.  But I think that a domain can abuse the xenbus reconnect facility to
    cause a large history to be recorded - provided that noone does any
    transactions on the system inbetween, which may be difficult to achieve given
    squeezed's constant pinging.
    
    The theoretical situation is like this:
    - a domain starts a transaction, creates as large a tree as it can, commits
      it. Then repeatedly:
        - start a transaction, do nothing with it, start a transaction, delete
          part of the large tree, write some new unique data there, don't commit
        - cause a xenbus reconnect (I think this can be done by writing something
          to the ring). This causes all transactions/watches for the connection to
          be cleared, but NOT the history, there were no commits, so nobody
          trimmed the history, i.e. it the history can contain transactions from
          more than just 0.05s
        - loop back and start more transactions, you can keep this up indefinitely
          without hitting quotas
    
    Now there is a periodic History.trim running every 0.05s, so I don't think you
    can do much damage with it.  But lets be safe an trim the transaction history
    anyway on reconnect.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit 2a47797d1f3b14aab4f0368ab833abd311f94a70)
---
 tools/ocaml/xenstored/connection.ml | 2 +-
 tools/ocaml/xenstored/history.ml    | 4 ++++
 tools/ocaml/xenstored/process.ml    | 4 ++--
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index fa0d3c4d92..850539e43a 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -47,7 +47,7 @@ let mark_as_bad con =
 
 let initial_next_tid = 1
 
-let reconnect con =
+let do_reconnect con =
 	Xenbus.Xb.reconnect con.xb;
 	(* dom is the same *)
 	Hashtbl.clear con.transactions;
diff --git a/tools/ocaml/xenstored/history.ml b/tools/ocaml/xenstored/history.ml
index f39565bff5..3899353da8 100644
--- a/tools/ocaml/xenstored/history.ml
+++ b/tools/ocaml/xenstored/history.ml
@@ -53,6 +53,10 @@ let end_transaction txn con tid commit =
 	trim ~txn ();
 	success
 
+let reconnect con =
+	trim ();
+	Connection.do_reconnect con
+
 let push (x: history_record) =
 	let dom = x.con.Connection.dom in
 	match dom with
diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml
index 437d2dcf9e..3ab09c6ce9 100644
--- a/tools/ocaml/xenstored/process.ml
+++ b/tools/ocaml/xenstored/process.ml
@@ -566,7 +566,7 @@ let do_input store cons doms con =
 			Connection.do_input con
 		with Xenbus.Xb.Reconnect ->
 			info "%s requests a reconnect" (Connection.get_domstr con);
-			Connection.reconnect con;
+			History.reconnect con;
 			info "%s reconnection complete" (Connection.get_domstr con);
 			false
 		| Failure exp ->
@@ -605,7 +605,7 @@ let do_output _store _cons _doms con =
 			ignore (Connection.do_output con)
 		with Xenbus.Xb.Reconnect ->
 			info "%s requests a reconnect" (Connection.get_domstr con);
-			Connection.reconnect con;
+			History.reconnect con;
 			info "%s reconnection complete" (Connection.get_domstr con)
 	)
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 12:45:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 12:45:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99491.189240 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNayf-00030h-RZ; Sat, 20 Mar 2021 12:45:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99491.189240; Sat, 20 Mar 2021 12: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 1lNayf-00030Z-OR; Sat, 20 Mar 2021 12:45:13 +0000
Received: by outflank-mailman (input) for mailman id 99491;
 Sat, 20 Mar 2021 12: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 1lNayf-00030S-9C
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12: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 1lNayf-0006Gv-8U
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12:45:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNayf-000859-7S
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12: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=cvoFZ3zGj3qD0Pxqccq+2mh5XHZWNRvl1lafnv/hAX8=; b=jZdhWDiF1t3rnUZifWA6oLjF9Y
	kSir6tAfP8xu9Pwm6tmwtaLdI/KCqNmNEirO3NkPMHRlo9p6xDHLCtd1Hc3g7FoFKyTs9auv560hC
	jTHXbIlkxh50sPcFI925Y3i25LUtXnB/9k4A2pLHcC3taZ0SuuLRcBy9EHfCDfYYR4fw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] tools/oxenstored: Fix quota calculation for mkdir EEXIST
Message-Id: <E1lNayf-000859-7S@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 12:45:13 +0000

commit 0a9bf01eab595b00c1f717b81dce442850da23fb
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:11:32 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:44:13 2021 +0000

    tools/oxenstored: Fix quota calculation for mkdir EEXIST
    
    We increment the domain's quota on mkdir even when the node already exists.
    This results in a quota inconsistency after live update, where reconstructing
    the tree from scratch results in a different quota.
    
    Not a security issue because the domain uses up quota faster, so it will only
    get a Quota error sooner than it should.
    
    Found by the structured fuzzer.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit c8b96708252a436da44005307f7c195d699bd7c5)
---
 tools/ocaml/xenstored/store.ml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml
index e20767372f..328d3a5198 100644
--- a/tools/ocaml/xenstored/store.ml
+++ b/tools/ocaml/xenstored/store.ml
@@ -421,6 +421,7 @@ let mkdir store perm path =
 	(* It's upt to the mkdir logic to decide what to do with existing path *)
 	if not (existing || (Perms.Connection.is_dom0 perm)) then Quota.check store.quota owner 0;
 	store.root <- path_mkdir store perm path;
+	if not existing then
 	Quota.add_entry store.quota owner
 
 let rm store perm path =
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 12:45:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 12:45:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99492.189244 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNayq-00031s-T9; Sat, 20 Mar 2021 12:45:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99492.189244; Sat, 20 Mar 2021 12: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 1lNayq-00031k-Q9; Sat, 20 Mar 2021 12:45:24 +0000
Received: by outflank-mailman (input) for mailman id 99492;
 Sat, 20 Mar 2021 12: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 1lNayp-00031a-Cd
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12: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 1lNayp-0006H7-Bm
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12:45:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNayp-00085p-Ar
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12: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=cNIng6DUzXuD9uHiRE7c/iluIsrFAzRsBQUkfCIetWI=; b=sILzi3cVxnxnyQwi22M+5+Ydd2
	NbS5PX3oDr/yDGsrE5sOnzKyhTvmNYFmjKpOFE+Majc2hoav2wib8pGt5d4+JIVz5gCYt1P2ZSqym
	4mx7Jqa2fHEjh3WS+SgT3fT0MlA0q7ycMorLUZIYdBgHk6LpkGuXea3Eexjd9Bu0ezLU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] tools/oxenstored: Reject invalid watch paths early
Message-Id: <E1lNayp-00085p-Ar@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 12:45:23 +0000

commit 00cf603e6a798943f034babb8ece7764d185c232
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:28:37 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:44:13 2021 +0000

    tools/oxenstored: Reject invalid watch paths early
    
    Watches on invalid paths were accepted, but they would never trigger.  The
    client also got no notification that its watch is bad and would never trigger.
    
    Found again by the structured fuzzer, due to an error on live update reload:
    the invalid watch paths would get rejected during live update and the list of
    watches would be different pre/post live update.
    
    The testcase is watch on `//`, which is an invalid path.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit dc8caf214fb882546b0e93317b9828247a7c9da8)
---
 tools/ocaml/xenstored/connection.ml  | 5 ++---
 tools/ocaml/xenstored/connections.ml | 4 +++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index 850539e43a..daf8d804f7 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -158,18 +158,17 @@ let get_children_watches con path =
 let is_dom0 con =
 	Perms.Connection.is_dom0 (get_perm con)
 
-let add_watch con path token =
+let add_watch con (path, apath) token =
 	if !Quota.activate && !Define.maxwatch > 0 &&
 	   not (is_dom0 con) && con.nb_watches > !Define.maxwatch then
 		raise Quota.Limit_reached;
-	let apath = get_watch_path con path in
 	let l = get_watches con apath in
 	if List.exists (fun w -> w.token = token) l then
 		raise Define.Already_exist;
 	let watch = watch_create ~con ~token ~path in
 	Hashtbl.replace con.watches apath (watch :: l);
 	con.nb_watches <- con.nb_watches + 1;
-	apath, watch
+	watch
 
 let del_watch con path token =
 	let apath = get_watch_path con path in
diff --git a/tools/ocaml/xenstored/connections.ml b/tools/ocaml/xenstored/connections.ml
index 1a70d412d5..7efdf3e5e0 100644
--- a/tools/ocaml/xenstored/connections.ml
+++ b/tools/ocaml/xenstored/connections.ml
@@ -114,8 +114,10 @@ let key_of_path path =
 	"" :: Store.Path.to_string_list path
 
 let add_watch cons con path token =
-	let apath, watch = Connection.add_watch con path token in
+	let apath = Connection.get_watch_path con path in
+	(* fail on invalid paths early by calling key_of_str before adding watch *)
 	let key = key_of_str apath in
+	let watch = Connection.add_watch con (path, apath) token in
 	let watches =
  		if Trie.mem cons.watches key
  		then Trie.find cons.watches key
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 12:45:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 12:45:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99493.189248 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNaz0-000335-Ut; Sat, 20 Mar 2021 12:45:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99493.189248; Sat, 20 Mar 2021 12: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 1lNaz0-00032x-Rh; Sat, 20 Mar 2021 12:45:34 +0000
Received: by outflank-mailman (input) for mailman id 99493;
 Sat, 20 Mar 2021 12: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 1lNayz-00032o-Fh
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12: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 1lNayz-0006HI-Ew
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12:45:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNayz-00086R-E5
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 12: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=AeJm+0a6rMtUiXKqP30W+CGDAf4t5E4JS0uV6wSzhTs=; b=mawzCSNXNF7nf3xeg6sRScH87y
	9488v3zWrcJ0WunWIfoeYWHsLI7VGVkDy6vD4lTd3vnmC8TBtsQeuL/oHEKUrcrcFoL9ifJ/F5ExL
	NI6S+F4SkhmjuLtjvAVV3jfSZT0u2n1Y5q0YCoI/m01ZVK17VsEd4upy3rqQCE+GTWfE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] tools/oxenstored: mkdir conflicts were sometimes missed
Message-Id: <E1lNayz-00086R-E5@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 12:45:33 +0000

commit f2e50a048a1430117f14fa42bde75c31ff85a7aa
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:38:58 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:44:13 2021 +0000

    tools/oxenstored: mkdir conflicts were sometimes missed
    
    Due to how set_write_lowpath was used here it didn't detect create/delete
    conflicts.  When we create an entry we must mark our parent as modified
    (this is what creating a new node via write does).
    
    Otherwise we can have 2 transactions one creating, and another deleting a node
    both succeeding depending on timing.  Or one transaction reading an entry,
    concluding it doesn't exist, do some other work based on that information and
    successfully commit even if another transaction creates the node via mkdir
    meanwhile.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit 45dee7d92b493bb531e7e77a6f9c0180ab152f87)
---
 tools/ocaml/xenstored/transaction.ml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/transaction.ml b/tools/ocaml/xenstored/transaction.ml
index 25bc8c3b4a..17b1bdf2ea 100644
--- a/tools/ocaml/xenstored/transaction.ml
+++ b/tools/ocaml/xenstored/transaction.ml
@@ -165,7 +165,7 @@ let write t perm path value =
 
 let mkdir ?(with_watch=true) t perm path =
 	Store.mkdir t.store perm path;
-	set_write_lowpath t path;
+	set_write_lowpath t (Store.Path.get_parent path);
 	if with_watch then
 		add_wop t Xenbus.Xb.Op.Mkdir path
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 13:33:07 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 13:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99502.189263 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNbix-0007pW-OO; Sat, 20 Mar 2021 13:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99502.189263; Sat, 20 Mar 2021 13: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 1lNbix-0007pP-LZ; Sat, 20 Mar 2021 13:33:03 +0000
Received: by outflank-mailman (input) for mailman id 99502;
 Sat, 20 Mar 2021 13: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 1lNbiw-0007pK-IN
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13: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 1lNbiw-00072Q-DN
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNbiw-0002V5-BS
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13: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=aEFuPTdWZ+vfkpMqXg2tyfrLpQUtBUj4sYUthSVJcTM=; b=eBO6dzNyXz7LgjuMz0p7bakxTm
	Srp+oy/VEVD80uFKwLDbVeLEIWJXdX73b7O7lQepYcxkPATbr3lRJxhvWVSSLtqWzbjh05uGtSltb
	BLh8AStceAPN4QNzCeAv2oz9wFvkrcJ+55zMtBWklo+YPofbDWgIX9ylFKe7K5nLJiLA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] tools/ocaml: libxb: Harden stub_header_of_string()
Message-Id: <E1lNbiw-0002V5-BS@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 13:33:02 +0000

commit 939164f40a9d060e086554e2d6d36346b9be7637
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Mar 30 14:29:10 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:25 2021 +0000

    tools/ocaml: libxb: Harden stub_header_of_string()
    
    stub_header_of_string() should not modify the header. So mark the
    variable 'hdr' as const.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit d92ba1aa7cf877a77abdcbd94a6a19fc55886a75)
---
 tools/ocaml/libs/xb/xenbus_stubs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xb/xenbus_stubs.c b/tools/ocaml/libs/xb/xenbus_stubs.c
index a68e783f70..001bb03371 100644
--- a/tools/ocaml/libs/xb/xenbus_stubs.c
+++ b/tools/ocaml/libs/xb/xenbus_stubs.c
@@ -40,12 +40,12 @@ CAMLprim value stub_header_of_string(value s)
 {
 	CAMLparam1(s);
 	CAMLlocal1(ret);
-	struct xsd_sockmsg *hdr;
+	const struct xsd_sockmsg *hdr;
 
 	if (caml_string_length(s) != sizeof(struct xsd_sockmsg))
 		caml_failwith("xb header incomplete");
 	ret = caml_alloc_tuple(4);
-	hdr = (struct xsd_sockmsg *) String_val(s);
+	hdr = (const struct xsd_sockmsg *) String_val(s);
 	Store_field(ret, 0, Val_int(hdr->tx_id));
 	Store_field(ret, 1, Val_int(hdr->req_id));
 	Store_field(ret, 2, Val_int(hdr->type));
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 13:33:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 13:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99503.189268 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNbj7-0007qT-QK; Sat, 20 Mar 2021 13:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99503.189268; Sat, 20 Mar 2021 13:33: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 1lNbj7-0007qL-NA; Sat, 20 Mar 2021 13:33:13 +0000
Received: by outflank-mailman (input) for mailman id 99503;
 Sat, 20 Mar 2021 13:33: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 1lNbj6-0007qF-JK
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:33: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 1lNbj6-00072c-Hh
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNbj6-0002Vf-Fq
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Cfie1IeRdk/XMmvBJn5rjoT4KgRPW+Emq+2S1AJIZxs=; b=C1R0RlnY/ASFM7Y3Y3WZ+6kREH
	/RJRBztW4f++OaEh6IkMFp0VGy52YgzkFatM7lrSR9VmRSRIiL4nJhvHAxAiYLskr44ENpC9IB2IT
	2NNdSdDBr+o0JCRWUbpPEkWeOagJQ25lhW5I+9FuB39CS50rLOh72RwD4HTqQqwFRuVk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] tools/ocaml: Fix stubs build when OCaml has been compiled with -safe-string
Message-Id: <E1lNbj6-0002Vf-Fq@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 13:33:12 +0000

commit 4288da8d60def02aa0a176cbc38cf794ab309238
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Mar 30 15:14:23 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:25 2021 +0000

    tools/ocaml: Fix stubs build when OCaml has been compiled with -safe-string
    
    The OCaml code has been fixed to handle properly -safe-string in Xen
    4.11, however the stubs part were missed.
    
    On OCaml newer than 4.06.1, String_Val() will return a const char *
    when using -safe-string leading to build failure when this is used
    in place where char * is expected.
    
    The main use in Xen code base is when a new string is allocated. The
    suggested approach by the OCaml community [1] is to use the helper
    caml_alloc_initialized_string() but it was introduced by OCaml 4.06.1.
    
    The next best approach is to cast String_val() to (char *) as the helper
    would have done. So use it when we need to update the new string using
    memcpy().
    
    Take the opportunity to remove the unnecessary cast of the source as
    mempcy() is expecting a void *.
    
    [1] https://github.com/ocaml/ocaml/pull/1274
    
    Reported-by: Dario Faggioli <dfaggioli@suse.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit 59b087e3954402c487e0abb4ad9bd05f43669436)
---
 tools/ocaml/libs/xb/xenbus_stubs.c  | 2 +-
 tools/ocaml/libs/xc/xenctrl_stubs.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/ocaml/libs/xb/xenbus_stubs.c b/tools/ocaml/libs/xb/xenbus_stubs.c
index 001bb03371..3065181a55 100644
--- a/tools/ocaml/libs/xb/xenbus_stubs.c
+++ b/tools/ocaml/libs/xb/xenbus_stubs.c
@@ -65,7 +65,7 @@ CAMLprim value stub_string_of_header(value tid, value rid, value ty, value len)
 	};
 
 	ret = caml_alloc_string(sizeof(struct xsd_sockmsg));
-	memcpy(String_val(ret), &xsd, sizeof(struct xsd_sockmsg));
+	memcpy((char *) String_val(ret), &xsd, sizeof(struct xsd_sockmsg));
 
 	CAMLreturn(ret);
 }
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index d4309ad97e..14f4f111c1 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -405,7 +405,7 @@ CAMLprim value stub_xc_vcpu_context_get(value xch, value domid,
 	ret = xc_vcpu_getcontext(_H(xch), _D(domid), Int_val(cpu), &ctxt);
 
 	context = caml_alloc_string(sizeof(ctxt));
-	memcpy(String_val(context), (char *) &ctxt.c, sizeof(ctxt.c));
+	memcpy((char *) String_val(context), &ctxt.c, sizeof(ctxt.c));
 
 	CAMLreturn(context);
 }
@@ -584,7 +584,7 @@ CAMLprim value stub_xc_readconsolering(value xch)
 		conring_size = size;
 
 	ring = caml_alloc_string(count);
-	memcpy(String_val(ring), str, count);
+	memcpy((char *) String_val(ring), str, count);
 	free(str);
 
 	CAMLreturn(ring);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 13:33:23 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 13:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99504.189271 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNbjH-0007rv-Rh; Sat, 20 Mar 2021 13:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99504.189271; Sat, 20 Mar 2021 13:33: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 1lNbjH-0007rn-On; Sat, 20 Mar 2021 13:33:23 +0000
Received: by outflank-mailman (input) for mailman id 99504;
 Sat, 20 Mar 2021 13:33: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 1lNbjG-0007rg-Lm
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:33: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 1lNbjG-00072j-Kx
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNbjG-0002WH-K5
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0vtweVHDkxPx1g5Ss+1R1WAGGEeuImv0nPmdC/Sz9bA=; b=hftcw5mwbkoBKLam8P+5axGWkQ
	3X2c8E5pzOOuqS66QNBBrgsi/yE1cyrBlwerH4ydC3EDnPwnmVyAiqgDV2+2tJmh18FntWi9sKKht
	Jp0juwoUyTx+7j+LQsuw65bz0/CoSRuEL2mVMOReocTt0vN4LuyTcDIa1gA+XpbPuhBA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] tools/ocaml: libxb: Avoid to use String_val() when value is bytes
Message-Id: <E1lNbjG-0002WH-K5@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 13:33:22 +0000

commit e8067088d255333487e01bfa59f4a0524172719c
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Mar 30 18:50:08 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:25 2021 +0000

    tools/ocaml: libxb: Avoid to use String_val() when value is bytes
    
    Commit ec7d54dd1a "ocaml/libs/xb: Use bytes in place of strings for
    mutable buffers" switch mutable buffers from string to bytes. However
    the C code were still using String_Val() to access them.
    
    While the underlying structure is the same between string and bytes, a
    string is meant to be immutable. OCaml 4.06.1 and later will enforce it.
    Therefore, it will not be possible to build the OCaml libs when using
    -safe-string. This is because String_val() will return a const value.
    
    To avoid plain cast in the code, the code is now switched to use
    Bytes_val(). As the macro is not defined in older OCaml version, we need
    to provide a stub.
    
    Take the opportunity to switch to const the buffer in
    ml_interface_write() as it should not be modified.
    
    Reported-by: Dario Faggioli <dfaggioli@suse.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit 78686437e949a85a207ae1a0d637efe2d3778bbe)
---
 tools/ocaml/libs/xb/xs_ring_stubs.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xb/xs_ring_stubs.c b/tools/ocaml/libs/xb/xs_ring_stubs.c
index 473787064a..7537a23949 100644
--- a/tools/ocaml/libs/xb/xs_ring_stubs.c
+++ b/tools/ocaml/libs/xb/xs_ring_stubs.c
@@ -36,6 +36,14 @@
 
 #define GET_C_STRUCT(a) ((struct mmap_interface *) a)
 
+/*
+ * Bytes_val has been introduced by Ocaml 4.06.1. So define our own version
+ * if needed.
+ */
+#ifndef Bytes_val
+#define Bytes_val(x) ((unsigned char *) Bp_val(x))
+#endif
+
 CAMLprim value ml_interface_read(value ml_interface,
                                  value ml_buffer,
                                  value ml_len)
@@ -44,7 +52,7 @@ CAMLprim value ml_interface_read(value ml_interface,
 	CAMLlocal1(ml_result);
 
 	struct mmap_interface *interface = GET_C_STRUCT(ml_interface);
-	char *buffer = String_val(ml_buffer);
+	unsigned char *buffer = Bytes_val(ml_buffer);
 	int len = Int_val(ml_len);
 	int result;
 
@@ -103,7 +111,7 @@ CAMLprim value ml_interface_write(value ml_interface,
 	CAMLlocal1(ml_result);
 
 	struct mmap_interface *interface = GET_C_STRUCT(ml_interface);
-	char *buffer = String_val(ml_buffer);
+	const unsigned char *buffer = Bytes_val(ml_buffer);
 	int len = Int_val(ml_len);
 	int result;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 13:33:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 13:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99505.189277 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNbjS-0007tD-UN; Sat, 20 Mar 2021 13:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99505.189277; Sat, 20 Mar 2021 13:33: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 1lNbjS-0007t5-QQ; Sat, 20 Mar 2021 13:33:34 +0000
Received: by outflank-mailman (input) for mailman id 99505;
 Sat, 20 Mar 2021 13:33: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 1lNbjQ-0007sv-RT
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:33: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 1lNbjQ-00072q-PW
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNbjQ-0002Wp-NW
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:33:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UgMJZo2tAfFR71sz1IYtV9UJgxZnw78YmvY1ysiBEGU=; b=tVi5a/zTEGcv4/ybWAGGiNiy0/
	WS1gMuGhfvIMWvU0yRAO0EbILeko+xnRaevAgT1EULUpdBkQasvh84L57RIbc4zRvGcl96Xh6QwUR
	hRGySootnCgeOl0V9Upd449P/LboC1GRrqiTLrBHil3Te4w5d8/E/MOKz3l/c56yB7Xw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] tools/libxc: misc: Mark const the parameter 'keys' of xc_send_debug_keys()
Message-Id: <E1lNbjQ-0002Wp-NW@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 13:33:32 +0000

commit 04dd325167041c2d22571cff72893916a4d93e47
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Mar 30 20:21:52 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:25 2021 +0000

    tools/libxc: misc: Mark const the parameter 'keys' of xc_send_debug_keys()
    
    OCaml is using a string to describe the parameter 'keys' of
    xc_send_debug_keys(). Since Ocaml 4.06.01, String_val() will return a
    const char * when using -safe-string. This will result to a build
    failure because xc_send_debug_keys() expects a char *.
    
    The function should never modify the parameter 'keys' and therefore the
    parameter should be const. Unfortunately, this is not directly possible
    because DECLARE_HYPERCALL_BOUNCE() is expecting a non-const variable.
    
    A new macro DECLARE_HYPERCALL_BOUNCE_IN() is introduced and will take
    care of const parameter. The first user will be xc_send_debug_keys() but
    this can be used in more place in the future.
    
    Reported-by: Dario Faggioli <dfaggioli@suse.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 2b8079610ec55413613ad071cc81cd9f97232a7e)
---
 tools/libxc/include/xenctrl.h | 2 +-
 tools/libxc/xc_misc.c         | 4 ++--
 tools/libxc/xc_private.h      | 8 ++++++++
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 408fa1c6a4..f7f1023231 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1243,7 +1243,7 @@ int xc_readconsolering(xc_interface *xch,
                        unsigned int *pnr_chars,
                        int clear, int incremental, uint32_t *pindex);
 
-int xc_send_debug_keys(xc_interface *xch, char *keys);
+int xc_send_debug_keys(xc_interface *xch, const char *keys);
 int xc_set_parameters(xc_interface *xch, char *params);
 
 typedef struct xen_sysctl_physinfo xc_physinfo_t;
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index 5e6714ae2b..8f2a2dee36 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -167,11 +167,11 @@ int xc_readconsolering(xc_interface *xch,
     return ret;
 }
 
-int xc_send_debug_keys(xc_interface *xch, char *keys)
+int xc_send_debug_keys(xc_interface *xch, const char *keys)
 {
     int ret, len = strlen(keys);
     DECLARE_SYSCTL;
-    DECLARE_HYPERCALL_BOUNCE(keys, len, XC_HYPERCALL_BUFFER_BOUNCE_IN);
+    DECLARE_HYPERCALL_BOUNCE_IN(keys, len);
 
     if ( xc_hypercall_bounce_pre(xch, keys) )
         return -1;
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 03bdfca7d4..c2921e1ee9 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -187,6 +187,14 @@ enum {
  */
 #define DECLARE_HYPERCALL_BOUNCE(_ubuf, _sz, _dir) DECLARE_NAMED_HYPERCALL_BOUNCE(_ubuf, _ubuf, _sz, _dir)
 
+/*
+ * Declare a bounce buffer shadowing the named user data pointer that
+ * cannot be modified.
+ */
+#define DECLARE_HYPERCALL_BOUNCE_IN(_ubuf, _sz)                     \
+    DECLARE_NAMED_HYPERCALL_BOUNCE(_ubuf, (void *)(_ubuf), _sz,     \
+                                   XC_HYPERCALL_BUFFER_BOUNCE_IN)
+
 /*
  * Set the size of data to bounce. Useful when the size is not known
  * when the bounce buffer is declared.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 13:33:45 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 13:33:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99506.189280 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNbjd-0007uj-08; Sat, 20 Mar 2021 13:33:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99506.189280; Sat, 20 Mar 2021 13:33: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 1lNbjc-0007ua-TH; Sat, 20 Mar 2021 13:33:44 +0000
Received: by outflank-mailman (input) for mailman id 99506;
 Sat, 20 Mar 2021 13:33: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 1lNbja-0007uM-U5
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:33: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 1lNbja-00072x-TJ
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNbja-0002XZ-Rz
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:33:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QgZhnoFWA746TbVoE0Cs2Ak3NKL+KKmZVs7bGJ2ZUTI=; b=HMGJ0Xk48Y1YsUYXZdka+74Bhp
	99iodRhnF08LGjLldu3XU6Wt6rCHVrqIB9xbC1l6RWInXIAsvhcBnuIilc4qwBbO68vmfZBbgWCvO
	9UusmsMpL4AxeegDL/OubgjsmAhzXplvqF1LBELOWhsidD/hqSdzj0hfLBjYURlc7wdA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] oxenstored: fix ABI breakage introduced in Xen 4.9.0
Message-Id: <E1lNbja-0002XZ-Rz@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 13:33:42 +0000

commit a0ae69c94d471eb7113b146526520a5d75852051
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Wed Jul 15 16:10:56 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:25 2021 +0000

    oxenstored: fix ABI breakage introduced in Xen 4.9.0
    
    dbc84d2983969bb47d294131ed9e6bbbdc2aec49 (Xen >= 4.9.0) deleted XS_RESTRICT
    from oxenstored, which caused all the following opcodes to be shifted by 1:
    reset_watches became off-by-one compared to the C version of xenstored.
    
    Looking at the C code the opcode for reset watches needs:
    XS_RESET_WATCHES = XS_SET_TARGET + 2
    
    So add the placeholder `Invalid` in the OCaml<->C mapping list.
    (Note that the code here doesn't simply convert the OCaml constructor to
     an integer, so we don't need to introduce a dummy constructor).
    
    Igor says that with a suitably patched xenopsd to enable watch reset,
    we now see `reset watches` during kdump of a guest in xenstored-access.log.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Tested-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit a6ed77f1e0334c26e6e216aea45f8674d9284856)
    (cherry picked from commit 9503a6df19924d2d9bf5b5a663342ba1507819c5)
---
 tools/ocaml/libs/xb/op.ml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ocaml/libs/xb/op.ml b/tools/ocaml/libs/xb/op.ml
index d4f1f08185..9bcab0f38c 100644
--- a/tools/ocaml/libs/xb/op.ml
+++ b/tools/ocaml/libs/xb/op.ml
@@ -28,7 +28,7 @@ let operation_c_mapping =
            Transaction_end; Introduce; Release;
            Getdomainpath; Write; Mkdir; Rm;
            Setperms; Watchevent; Error; Isintroduced;
-           Resume; Set_target; Reset_watches |]
+           Resume; Set_target; Invalid; Reset_watches |]
 let size = Array.length operation_c_mapping
 
 let array_search el a =
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 13:33:55 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 13:33:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99507.189284 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNbjn-0007wC-1a; Sat, 20 Mar 2021 13:33:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99507.189284; Sat, 20 Mar 2021 13:33: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 1lNbjm-0007w4-Un; Sat, 20 Mar 2021 13:33:54 +0000
Received: by outflank-mailman (input) for mailman id 99507;
 Sat, 20 Mar 2021 13:33: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 1lNbjl-0007vt-1t
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:33: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 1lNbjk-000735-WE
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:33:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNbjk-0002YB-VU
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:33:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ffSjJNmdPL4LDHjoAqktfUn3L4+s2hlJTJI+oAkhmQQ=; b=ExVocqCaYOswy/OXzCunJhxI5y
	Q04oHQco8Cz8j9wtFyuUp1hyh/At0uTSSd5b6Zo1aO1+w0pLY4dIyGaKbBO+M/0MPDBHNkwYGrNrp
	EkXIsLtiktnIRFZM0IkGAUpWxjfZP6fnmUwR+S646nf42w7WdOnGDXyki5montVWeSbY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] tools/ocaml/libs/xb: Do not crash after xenbus is unmapped
Message-Id: <E1lNbjk-0002YB-VU@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 13:33:52 +0000

commit efe63c57ede19aa6fb518b04678bbe5148833c35
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 18:23:10 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:25 2021 +0000

    tools/ocaml/libs/xb: Do not crash after xenbus is unmapped
    
    Xenmmap.unmap sets the address to MAP_FAILED in xenmmap_stubs.c.  If due to a
    bug there were still references to the Xenbus and we attempt to use it then we
    crash.  Raise an exception instead of crashing.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 5e317896342d553f0b55f72948bbf93a0f1147d3)
---
 tools/ocaml/libs/xb/xs_ring_stubs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/ocaml/libs/xb/xs_ring_stubs.c b/tools/ocaml/libs/xb/xs_ring_stubs.c
index 7537a23949..7a91fdee75 100644
--- a/tools/ocaml/libs/xb/xs_ring_stubs.c
+++ b/tools/ocaml/libs/xb/xs_ring_stubs.c
@@ -32,6 +32,7 @@
 #include <caml/fail.h>
 #include <caml/callback.h>
 
+#include <sys/mman.h>
 #include "mmap_stubs.h"
 
 #define GET_C_STRUCT(a) ((struct mmap_interface *) a)
@@ -166,6 +167,8 @@ CAMLprim value ml_interface_set_server_features(value interface, value v)
 {
 	CAMLparam2(interface, v);
 	struct xenstore_domain_interface *intf = GET_C_STRUCT(interface)->addr;
+	if (intf == (void*)MAP_FAILED)
+		caml_failwith("Interface closed");
 
 	intf->server_features = Int_val(v);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 13:34:05 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 13:34:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99508.189288 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNbjx-0007xT-3J; Sat, 20 Mar 2021 13:34:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99508.189288; Sat, 20 Mar 2021 13:34: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 1lNbjx-0007xL-09; Sat, 20 Mar 2021 13:34:05 +0000
Received: by outflank-mailman (input) for mailman id 99508;
 Sat, 20 Mar 2021 13:34: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 1lNbjv-0007xB-4J
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:34: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 1lNbjv-00073i-3Z
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:34:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNbjv-0002aR-2E
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:34: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=8qD9K/xDpJ7xwuI8dnLYrTIj7IajZS3XQfzFxaa9pk0=; b=JjmZtuFwlZuiC0QUveI19XT8H9
	lSO22noGqAfVrVM9bgcxN7h9GVbMz/5+H0Ltq1EVCXjw3zeWVBp9Wp1kD2+CM4DMY9CQ5NuROcTyT
	4nQ2MU6jiS5yl8V/P0+kBGNjnE/aS6OdY8umltQUdKsgp15bPI0pxS56C4V0yK1+zRgo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] tools/oxenstored: Trim txhistory on xenbus reconnect
Message-Id: <E1lNbjv-0002aR-2E@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 13:34:03 +0000

commit f4adc4dbea4793d07faa52a85350322aed5ca8a2
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 8 11:57:37 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:25 2021 +0000

    tools/oxenstored: Trim txhistory on xenbus reconnect
    
    There is a global history, containing transactions from the past 0.05s, which
    get trimmed whenever any transaction commits or aborts.  Destroying a domain
    will cause xenopsd to perform some transactions deleting the tree, so that is
    fine.  But I think that a domain can abuse the xenbus reconnect facility to
    cause a large history to be recorded - provided that noone does any
    transactions on the system inbetween, which may be difficult to achieve given
    squeezed's constant pinging.
    
    The theoretical situation is like this:
    - a domain starts a transaction, creates as large a tree as it can, commits
      it. Then repeatedly:
        - start a transaction, do nothing with it, start a transaction, delete
          part of the large tree, write some new unique data there, don't commit
        - cause a xenbus reconnect (I think this can be done by writing something
          to the ring). This causes all transactions/watches for the connection to
          be cleared, but NOT the history, there were no commits, so nobody
          trimmed the history, i.e. it the history can contain transactions from
          more than just 0.05s
        - loop back and start more transactions, you can keep this up indefinitely
          without hitting quotas
    
    Now there is a periodic History.trim running every 0.05s, so I don't think you
    can do much damage with it.  But lets be safe an trim the transaction history
    anyway on reconnect.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit 2a47797d1f3b14aab4f0368ab833abd311f94a70)
---
 tools/ocaml/xenstored/connection.ml | 2 +-
 tools/ocaml/xenstored/history.ml    | 4 ++++
 tools/ocaml/xenstored/process.ml    | 4 ++--
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index 698f721345..0d4dcda771 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -47,7 +47,7 @@ let mark_as_bad con =
 
 let initial_next_tid = 1
 
-let reconnect con =
+let do_reconnect con =
 	Xenbus.Xb.reconnect con.xb;
 	(* dom is the same *)
 	Hashtbl.clear con.transactions;
diff --git a/tools/ocaml/xenstored/history.ml b/tools/ocaml/xenstored/history.ml
index f39565bff5..3899353da8 100644
--- a/tools/ocaml/xenstored/history.ml
+++ b/tools/ocaml/xenstored/history.ml
@@ -53,6 +53,10 @@ let end_transaction txn con tid commit =
 	trim ~txn ();
 	success
 
+let reconnect con =
+	trim ();
+	Connection.do_reconnect con
+
 let push (x: history_record) =
 	let dom = x.con.Connection.dom in
 	match dom with
diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml
index 12ad66fce6..59efae447d 100644
--- a/tools/ocaml/xenstored/process.ml
+++ b/tools/ocaml/xenstored/process.ml
@@ -560,7 +560,7 @@ let do_input store cons doms con =
 			Connection.do_input con
 		with Xenbus.Xb.Reconnect ->
 			info "%s requests a reconnect" (Connection.get_domstr con);
-			Connection.reconnect con;
+			History.reconnect con;
 			info "%s reconnection complete" (Connection.get_domstr con);
 			false
 		| Failure exp ->
@@ -599,7 +599,7 @@ let do_output store cons doms con =
 			ignore (Connection.do_output con)
 		with Xenbus.Xb.Reconnect ->
 			info "%s requests a reconnect" (Connection.get_domstr con);
-			Connection.reconnect con;
+			History.reconnect con;
 			info "%s reconnection complete" (Connection.get_domstr con)
 	)
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 13:34:15 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 13:34:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99509.189292 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNbk7-0007yd-4j; Sat, 20 Mar 2021 13:34:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99509.189292; Sat, 20 Mar 2021 13:34: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 1lNbk7-0007yV-1j; Sat, 20 Mar 2021 13:34:15 +0000
Received: by outflank-mailman (input) for mailman id 99509;
 Sat, 20 Mar 2021 13:34: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 1lNbk5-0007yL-7g
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:34: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 1lNbk5-00073r-6v
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:34:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNbk5-0002bH-6A
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:34: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=YT3X0NV/bDUVaCNy27n1HsLHfjteBXz2PCHaX9Hnwic=; b=Tw33qRpS30K0GX3HnPvjJ2voJy
	aGWBiiR3Bv6O2i1xRhISQG4GNGfGhZma4kuPCSOTo2xFOkM1N+e8rh1YTrkrOdhZiYnRh+UkWYubW
	DgTtXmyzDPVtgBL9srRAmR4ddWSKeJ8FFWgvkZCDfov9jlu0Pww2AruXF8s4MmtNuo4Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] tools/oxenstored: Fix quota calculation for mkdir EEXIST
Message-Id: <E1lNbk5-0002bH-6A@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 13:34:13 +0000

commit 131d98fcd47fdb62548f022635fb4adc09e83a32
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:11:32 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:25 2021 +0000

    tools/oxenstored: Fix quota calculation for mkdir EEXIST
    
    We increment the domain's quota on mkdir even when the node already exists.
    This results in a quota inconsistency after live update, where reconstructing
    the tree from scratch results in a different quota.
    
    Not a security issue because the domain uses up quota faster, so it will only
    get a Quota error sooner than it should.
    
    Found by the structured fuzzer.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit c8b96708252a436da44005307f7c195d699bd7c5)
---
 tools/ocaml/xenstored/store.ml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml
index 2a694562bb..7253ac0fcf 100644
--- a/tools/ocaml/xenstored/store.ml
+++ b/tools/ocaml/xenstored/store.ml
@@ -421,6 +421,7 @@ let mkdir store perm path =
 	(* It's upt to the mkdir logic to decide what to do with existing path *)
 	if not (existing || (Perms.Connection.is_dom0 perm)) then Quota.check store.quota owner 0;
 	store.root <- path_mkdir store perm path;
+	if not existing then
 	Quota.add_entry store.quota owner
 
 let rm store perm path =
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 13:34:25 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 13:34:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99510.189296 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNbkH-0007zz-6t; Sat, 20 Mar 2021 13:34:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99510.189296; Sat, 20 Mar 2021 13:34: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 1lNbkH-0007zr-3d; Sat, 20 Mar 2021 13:34:25 +0000
Received: by outflank-mailman (input) for mailman id 99510;
 Sat, 20 Mar 2021 13:34: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 1lNbkF-0007ze-B8
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:34: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 1lNbkF-00073z-AN
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:34:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNbkF-0002cD-9T
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:34: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=S4jG/4ZYiuxmyNXzHu5JGWJ+cj7ESMlODLhorEGYTos=; b=eCbrmFUdgWLfSdhCZSIT+OY3/9
	XJFgAoc3098w9N/gi9bNmGgN8pmx840qLWEhF+BgCMLlVh0R5Ef+BsupmMRjet3x4tTSUk7r9013c
	qLlMnTEYpFq9yBs4DBhHrsShZsgzeCaYiJM6npgfD/tSzVpdglWrZPZgVSosj+CGRdks=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] tools/oxenstored: Reject invalid watch paths early
Message-Id: <E1lNbkF-0002cD-9T@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 13:34:23 +0000

commit 9b299ec2ebd80b40b731ce81a77dc9e09c74c1e2
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:28:37 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:25 2021 +0000

    tools/oxenstored: Reject invalid watch paths early
    
    Watches on invalid paths were accepted, but they would never trigger.  The
    client also got no notification that its watch is bad and would never trigger.
    
    Found again by the structured fuzzer, due to an error on live update reload:
    the invalid watch paths would get rejected during live update and the list of
    watches would be different pre/post live update.
    
    The testcase is watch on `//`, which is an invalid path.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit dc8caf214fb882546b0e93317b9828247a7c9da8)
---
 tools/ocaml/xenstored/connection.ml  | 5 ++---
 tools/ocaml/xenstored/connections.ml | 4 +++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index 0d4dcda771..daf4099473 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -158,18 +158,17 @@ let get_children_watches con path =
 let is_dom0 con =
 	Perms.Connection.is_dom0 (get_perm con)
 
-let add_watch con path token =
+let add_watch con (path, apath) token =
 	if !Quota.activate && !Define.maxwatch > 0 &&
 	   not (is_dom0 con) && con.nb_watches > !Define.maxwatch then
 		raise Quota.Limit_reached;
-	let apath = get_watch_path con path in
 	let l = get_watches con apath in
 	if List.exists (fun w -> w.token = token) l then
 		raise Define.Already_exist;
 	let watch = watch_create ~con ~token ~path in
 	Hashtbl.replace con.watches apath (watch :: l);
 	con.nb_watches <- con.nb_watches + 1;
-	apath, watch
+	watch
 
 let del_watch con path token =
 	let apath = get_watch_path con path in
diff --git a/tools/ocaml/xenstored/connections.ml b/tools/ocaml/xenstored/connections.ml
index 4e69de1d42..04840b0680 100644
--- a/tools/ocaml/xenstored/connections.ml
+++ b/tools/ocaml/xenstored/connections.ml
@@ -114,8 +114,10 @@ let key_of_path path =
 	"" :: Store.Path.to_string_list path
 
 let add_watch cons con path token =
-	let apath, watch = Connection.add_watch con path token in
+	let apath = Connection.get_watch_path con path in
+	(* fail on invalid paths early by calling key_of_str before adding watch *)
 	let key = key_of_str apath in
+	let watch = Connection.add_watch con (path, apath) token in
 	let watches =
  		if Trie.mem cons.watches key
  		then Trie.find cons.watches key
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 13:34:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 13:34:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99511.189299 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNbkQ-00081D-87; Sat, 20 Mar 2021 13:34:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99511.189299; Sat, 20 Mar 2021 13:34: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 1lNbkQ-000815-5E; Sat, 20 Mar 2021 13:34:34 +0000
Received: by outflank-mailman (input) for mailman id 99511;
 Sat, 20 Mar 2021 13:34: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 1lNbkP-00080z-EQ
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:34: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 1lNbkP-000745-Dd
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNbkP-0002d5-Cw
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 13:34: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=UGKPEh5ALUYIt2GaeWWBHNVSFNljfpKVfX1UDHTo24A=; b=Q/c5ldk4kK1QqfAeg+1aOX5xLn
	VE5RviDyvpTuNSYrKt4bFkNNpQZXLvNGiHmzFsH9cb+qiLmdN4jQ0gO/r/PxK4HKPZwp7+JeLMfSG
	03GWCNuc+I1MQFP33bA7W/SSbQgg/qF41lecVYgHEUURHm8C+0FcV2b/LcDyjdK0bau4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] tools/oxenstored: mkdir conflicts were sometimes missed
Message-Id: <E1lNbkP-0002d5-Cw@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 13:34:33 +0000

commit 1d5581d352f7bb6408636e8aeaf0edda7d321aee
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:38:58 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:46:25 2021 +0000

    tools/oxenstored: mkdir conflicts were sometimes missed
    
    Due to how set_write_lowpath was used here it didn't detect create/delete
    conflicts.  When we create an entry we must mark our parent as modified
    (this is what creating a new node via write does).
    
    Otherwise we can have 2 transactions one creating, and another deleting a node
    both succeeding depending on timing.  Or one transaction reading an entry,
    concluding it doesn't exist, do some other work based on that information and
    successfully commit even if another transaction creates the node via mkdir
    meanwhile.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit 45dee7d92b493bb531e7e77a6f9c0180ab152f87)
---
 tools/ocaml/xenstored/transaction.ml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/transaction.ml b/tools/ocaml/xenstored/transaction.ml
index 9e9e28db9b..7c5be17588 100644
--- a/tools/ocaml/xenstored/transaction.ml
+++ b/tools/ocaml/xenstored/transaction.ml
@@ -165,7 +165,7 @@ let write t perm path value =
 
 let mkdir ?(with_watch=true) t perm path =
 	Store.mkdir t.store perm path;
-	set_write_lowpath t path;
+	set_write_lowpath t (Store.Path.get_parent path);
 	if with_watch then
 		add_wop t Xenbus.Xb.Op.Mkdir path
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 17:11:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 17:11:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99550.189331 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNf7v-0003qR-F7; Sat, 20 Mar 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 99550.189331; Sat, 20 Mar 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 1lNf7v-0003qJ-CD; Sat, 20 Mar 2021 17:11:03 +0000
Received: by outflank-mailman (input) for mailman id 99550;
 Sat, 20 Mar 2021 17: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 1lNf7u-0003qE-75
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 17: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 1lNf7u-0002gt-4c
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 17:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNf7u-0001Yt-3Y
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 17: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=X96IDsJW9JCF8Ol/+dug2WYEe2L/6UbhW94O8D5bUWk=; b=yt077TWA4qpK9B13wEkgjMe0BL
	peUQytJmANjFXIDzaVXYTqFc+i/gW2oU2HuAxluXGTvZK5AnMoouBsvr2ruHd/FHVLUVZ+KcqRuj3
	5TLtq6wCOMVVEs30SIy/Wi0UC7qZZ3rNDxBL1Qg1BxvKgsMwri5stdk685/dh7x+HACU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] oxenstored: fix ABI breakage introduced in Xen 4.9.0
Message-Id: <E1lNf7u-0001Yt-3Y@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 17:11:02 +0000

commit 9503a6df19924d2d9bf5b5a663342ba1507819c5
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Wed Jul 15 16:10:56 2020 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:24:06 2021 +0000

    oxenstored: fix ABI breakage introduced in Xen 4.9.0
    
    dbc84d2983969bb47d294131ed9e6bbbdc2aec49 (Xen >= 4.9.0) deleted XS_RESTRICT
    from oxenstored, which caused all the following opcodes to be shifted by 1:
    reset_watches became off-by-one compared to the C version of xenstored.
    
    Looking at the C code the opcode for reset watches needs:
    XS_RESET_WATCHES = XS_SET_TARGET + 2
    
    So add the placeholder `Invalid` in the OCaml<->C mapping list.
    (Note that the code here doesn't simply convert the OCaml constructor to
     an integer, so we don't need to introduce a dummy constructor).
    
    Igor says that with a suitably patched xenopsd to enable watch reset,
    we now see `reset watches` during kdump of a guest in xenstored-access.log.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Tested-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit a6ed77f1e0334c26e6e216aea45f8674d9284856)
---
 tools/ocaml/libs/xb/op.ml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ocaml/libs/xb/op.ml b/tools/ocaml/libs/xb/op.ml
index d4f1f08185..9bcab0f38c 100644
--- a/tools/ocaml/libs/xb/op.ml
+++ b/tools/ocaml/libs/xb/op.ml
@@ -28,7 +28,7 @@ let operation_c_mapping =
            Transaction_end; Introduce; Release;
            Getdomainpath; Write; Mkdir; Rm;
            Setperms; Watchevent; Error; Isintroduced;
-           Resume; Set_target; Reset_watches |]
+           Resume; Set_target; Invalid; Reset_watches |]
 let size = Array.length operation_c_mapping
 
 let array_search el a =
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 17:11:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 17:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99551.189335 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNf85-0003r8-Gt; Sat, 20 Mar 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 99551.189335; Sat, 20 Mar 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 1lNf85-0003r0-Dl; Sat, 20 Mar 2021 17:11:13 +0000
Received: by outflank-mailman (input) for mailman id 99551;
 Sat, 20 Mar 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 1lNf84-0003qv-AZ
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 17: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 1lNf84-0002hF-9k
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 17:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNf84-0001ZZ-6s
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 17: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=o802kKCn+htZz6XZXtu+/VJilWwUsJIuaqOLEoUZlCk=; b=O80zdzVRQuXXr1MQu51zFkmEkR
	Kd8p1bNiE8CjbnJ9mynAT6nqixf0LHEIDRj7u0pM9MSvwIJt02oWpX7wlvCEwFbrNENMHheyhqR0Y
	H3O9IeLRhGnslSN4vRzYaPzihXE8je+rw/VVa5YVEaAA7qoxXuovHgHUQuD8ocnWdzzg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] tools/ocaml/libs/xb: Do not crash after xenbus is unmapped
Message-Id: <E1lNf84-0001ZZ-6s@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 17:11:12 +0000

commit 78a22dee01f24974448e79774d1e48338b4846d0
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 18:23:10 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:43:29 2021 +0000

    tools/ocaml/libs/xb: Do not crash after xenbus is unmapped
    
    Xenmmap.unmap sets the address to MAP_FAILED in xenmmap_stubs.c.  If due to a
    bug there were still references to the Xenbus and we attempt to use it then we
    crash.  Raise an exception instead of crashing.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 5e317896342d553f0b55f72948bbf93a0f1147d3)
---
 tools/ocaml/libs/xb/xs_ring_stubs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/ocaml/libs/xb/xs_ring_stubs.c b/tools/ocaml/libs/xb/xs_ring_stubs.c
index 7537a23949..7a91fdee75 100644
--- a/tools/ocaml/libs/xb/xs_ring_stubs.c
+++ b/tools/ocaml/libs/xb/xs_ring_stubs.c
@@ -32,6 +32,7 @@
 #include <caml/fail.h>
 #include <caml/callback.h>
 
+#include <sys/mman.h>
 #include "mmap_stubs.h"
 
 #define GET_C_STRUCT(a) ((struct mmap_interface *) a)
@@ -166,6 +167,8 @@ CAMLprim value ml_interface_set_server_features(value interface, value v)
 {
 	CAMLparam2(interface, v);
 	struct xenstore_domain_interface *intf = GET_C_STRUCT(interface)->addr;
+	if (intf == (void*)MAP_FAILED)
+		caml_failwith("Interface closed");
 
 	intf->server_features = Int_val(v);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 17:11:23 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 17:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99552.189338 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNf8F-0003sb-KF; Sat, 20 Mar 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 99552.189338; Sat, 20 Mar 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 1lNf8F-0003sT-Gl; Sat, 20 Mar 2021 17:11:23 +0000
Received: by outflank-mailman (input) for mailman id 99552;
 Sat, 20 Mar 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 1lNf8E-0003sJ-HE
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 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 1lNf8E-0002hT-Em
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 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 1lNf8E-0001aK-C4
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 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=ygVlCPkBH/TX7VRPmo/47TY0PWl79uq/TtKRdNvu/UM=; b=Ud+e7ef5wvTtUGqbGXhWzMUTQ6
	YnoSu60CJ8KEs5H3YNNITySM+YL0ruw+Dsy9hjpFnk4Y6ITOPQs5l8zVH5c6u75NxKMOzn5x2Dw07
	8uaSYdfH4jL+J5QGpbdGsnIKqquNQ0WEIAiDA8jPS4+3M7+bTtCd8i12b2Gus/sDUQsw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] tools/oxenstored: Trim txhistory on xenbus reconnect
Message-Id: <E1lNf8E-0001aK-C4@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 17:11:22 +0000

commit bcd9d2ee060121198ca58dbf3c275b3e534e01b1
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 8 11:57:37 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:43:32 2021 +0000

    tools/oxenstored: Trim txhistory on xenbus reconnect
    
    There is a global history, containing transactions from the past 0.05s, which
    get trimmed whenever any transaction commits or aborts.  Destroying a domain
    will cause xenopsd to perform some transactions deleting the tree, so that is
    fine.  But I think that a domain can abuse the xenbus reconnect facility to
    cause a large history to be recorded - provided that noone does any
    transactions on the system inbetween, which may be difficult to achieve given
    squeezed's constant pinging.
    
    The theoretical situation is like this:
    - a domain starts a transaction, creates as large a tree as it can, commits
      it. Then repeatedly:
        - start a transaction, do nothing with it, start a transaction, delete
          part of the large tree, write some new unique data there, don't commit
        - cause a xenbus reconnect (I think this can be done by writing something
          to the ring). This causes all transactions/watches for the connection to
          be cleared, but NOT the history, there were no commits, so nobody
          trimmed the history, i.e. it the history can contain transactions from
          more than just 0.05s
        - loop back and start more transactions, you can keep this up indefinitely
          without hitting quotas
    
    Now there is a periodic History.trim running every 0.05s, so I don't think you
    can do much damage with it.  But lets be safe an trim the transaction history
    anyway on reconnect.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    (cherry picked from commit 2a47797d1f3b14aab4f0368ab833abd311f94a70)
---
 tools/ocaml/xenstored/connection.ml | 2 +-
 tools/ocaml/xenstored/history.ml    | 4 ++++
 tools/ocaml/xenstored/process.ml    | 4 ++--
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index fa0d3c4d92..850539e43a 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -47,7 +47,7 @@ let mark_as_bad con =
 
 let initial_next_tid = 1
 
-let reconnect con =
+let do_reconnect con =
 	Xenbus.Xb.reconnect con.xb;
 	(* dom is the same *)
 	Hashtbl.clear con.transactions;
diff --git a/tools/ocaml/xenstored/history.ml b/tools/ocaml/xenstored/history.ml
index f39565bff5..3899353da8 100644
--- a/tools/ocaml/xenstored/history.ml
+++ b/tools/ocaml/xenstored/history.ml
@@ -53,6 +53,10 @@ let end_transaction txn con tid commit =
 	trim ~txn ();
 	success
 
+let reconnect con =
+	trim ();
+	Connection.do_reconnect con
+
 let push (x: history_record) =
 	let dom = x.con.Connection.dom in
 	match dom with
diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml
index 437d2dcf9e..3ab09c6ce9 100644
--- a/tools/ocaml/xenstored/process.ml
+++ b/tools/ocaml/xenstored/process.ml
@@ -566,7 +566,7 @@ let do_input store cons doms con =
 			Connection.do_input con
 		with Xenbus.Xb.Reconnect ->
 			info "%s requests a reconnect" (Connection.get_domstr con);
-			Connection.reconnect con;
+			History.reconnect con;
 			info "%s reconnection complete" (Connection.get_domstr con);
 			false
 		| Failure exp ->
@@ -605,7 +605,7 @@ let do_output _store _cons _doms con =
 			ignore (Connection.do_output con)
 		with Xenbus.Xb.Reconnect ->
 			info "%s requests a reconnect" (Connection.get_domstr con);
-			Connection.reconnect con;
+			History.reconnect con;
 			info "%s reconnection complete" (Connection.get_domstr con)
 	)
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 17:11:33 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 17:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99553.189343 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNf8P-0003vd-M9; Sat, 20 Mar 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 99553.189343; Sat, 20 Mar 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 1lNf8P-0003vT-IT; Sat, 20 Mar 2021 17:11:33 +0000
Received: by outflank-mailman (input) for mailman id 99553;
 Sat, 20 Mar 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 1lNf8O-0003uY-Ja
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 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 1lNf8O-0002hb-Im
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 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 1lNf8O-0001aq-Gy
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 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=7cc+vlbfwM6hvXrm2ww61X3Ve39p6Gia/dgXkaofkpA=; b=H9SuY/2JvLeml6tdm2jrw9Y+dT
	TtJbsRf5u3DJSrd3FeGulNJxU2NmMkGuYA4IakNlnFNJlJDaGamMPe8QDgd5nghlM1/Gf3r/gYYZ4
	N6Rz45zKf63PM6yd9SIbqZpULd4AqDKoHpdWE8VbEuVeUx1gyesMdqR2FdULWwe0zm/0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] tools/oxenstored: Fix quota calculation for mkdir EEXIST
Message-Id: <E1lNf8O-0001aq-Gy@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 17:11:32 +0000

commit 004be86c81b866365919292f98a5d6effa6f053c
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:11:32 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:43:36 2021 +0000

    tools/oxenstored: Fix quota calculation for mkdir EEXIST
    
    We increment the domain's quota on mkdir even when the node already exists.
    This results in a quota inconsistency after live update, where reconstructing
    the tree from scratch results in a different quota.
    
    Not a security issue because the domain uses up quota faster, so it will only
    get a Quota error sooner than it should.
    
    Found by the structured fuzzer.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit c8b96708252a436da44005307f7c195d699bd7c5)
---
 tools/ocaml/xenstored/store.ml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml
index e20767372f..328d3a5198 100644
--- a/tools/ocaml/xenstored/store.ml
+++ b/tools/ocaml/xenstored/store.ml
@@ -421,6 +421,7 @@ let mkdir store perm path =
 	(* It's upt to the mkdir logic to decide what to do with existing path *)
 	if not (existing || (Perms.Connection.is_dom0 perm)) then Quota.check store.quota owner 0;
 	store.root <- path_mkdir store perm path;
+	if not existing then
 	Quota.add_entry store.quota owner
 
 let rm store perm path =
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 17:11:43 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 17:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99554.189348 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNf8Z-0003xB-Nu; Sat, 20 Mar 2021 17:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99554.189348; Sat, 20 Mar 2021 17:11: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 1lNf8Z-0003x3-KA; Sat, 20 Mar 2021 17:11:43 +0000
Received: by outflank-mailman (input) for mailman id 99554;
 Sat, 20 Mar 2021 17: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 1lNf8Y-0003wu-Mg
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 17: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 1lNf8Y-0002hj-Lt
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 17:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNf8Y-0001bK-Kz
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 17: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=AvyOkyzLZI3tV+hUqCeTzZ6hRyh731StWs0uBmPqk2I=; b=nak2AxNiM0dMsfjSEsE+Pq4RWM
	6Jk0Mn+aKmfbFjiRyzNrWUz91CnYiHcs0W5pywMf8qQm8G6QZyGJiLOsmVl8NLqjGVN2PX5cjlFnT
	BzHd0BTGmY8DQdcp89NWKlS8rDGO1lAefHKwh4YsN69eH4tO6A1CCwwqNuY0VW+oj5+Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] tools/oxenstored: Reject invalid watch paths early
Message-Id: <E1lNf8Y-0001bK-Kz@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 17:11:42 +0000

commit d5ed41d3b01e314a64ccaf4f4540a3bc502f4979
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:28:37 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:43:39 2021 +0000

    tools/oxenstored: Reject invalid watch paths early
    
    Watches on invalid paths were accepted, but they would never trigger.  The
    client also got no notification that its watch is bad and would never trigger.
    
    Found again by the structured fuzzer, due to an error on live update reload:
    the invalid watch paths would get rejected during live update and the list of
    watches would be different pre/post live update.
    
    The testcase is watch on `//`, which is an invalid path.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit dc8caf214fb882546b0e93317b9828247a7c9da8)
---
 tools/ocaml/xenstored/connection.ml  | 5 ++---
 tools/ocaml/xenstored/connections.ml | 4 +++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index 850539e43a..daf8d804f7 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -158,18 +158,17 @@ let get_children_watches con path =
 let is_dom0 con =
 	Perms.Connection.is_dom0 (get_perm con)
 
-let add_watch con path token =
+let add_watch con (path, apath) token =
 	if !Quota.activate && !Define.maxwatch > 0 &&
 	   not (is_dom0 con) && con.nb_watches > !Define.maxwatch then
 		raise Quota.Limit_reached;
-	let apath = get_watch_path con path in
 	let l = get_watches con apath in
 	if List.exists (fun w -> w.token = token) l then
 		raise Define.Already_exist;
 	let watch = watch_create ~con ~token ~path in
 	Hashtbl.replace con.watches apath (watch :: l);
 	con.nb_watches <- con.nb_watches + 1;
-	apath, watch
+	watch
 
 let del_watch con path token =
 	let apath = get_watch_path con path in
diff --git a/tools/ocaml/xenstored/connections.ml b/tools/ocaml/xenstored/connections.ml
index 1a70d412d5..7efdf3e5e0 100644
--- a/tools/ocaml/xenstored/connections.ml
+++ b/tools/ocaml/xenstored/connections.ml
@@ -114,8 +114,10 @@ let key_of_path path =
 	"" :: Store.Path.to_string_list path
 
 let add_watch cons con path token =
-	let apath, watch = Connection.add_watch con path token in
+	let apath = Connection.get_watch_path con path in
+	(* fail on invalid paths early by calling key_of_str before adding watch *)
 	let key = key_of_str apath in
+	let watch = Connection.add_watch con (path, apath) token in
 	let watches =
  		if Trie.mem cons.watches key
  		then Trie.find cons.watches key
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Mar 20 17:11:53 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Mar 2021 17:11:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99555.189350 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lNf8j-0003ye-Oi; Sat, 20 Mar 2021 17:11:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99555.189350; Sat, 20 Mar 2021 17: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 1lNf8j-0003yV-Lk; Sat, 20 Mar 2021 17:11:53 +0000
Received: by outflank-mailman (input) for mailman id 99555;
 Sat, 20 Mar 2021 17: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 1lNf8i-0003y7-Qb
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 17: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 1lNf8i-0002ht-P8
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 17:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lNf8i-0001by-O5
 for xen-changelog@lists.xenproject.org; Sat, 20 Mar 2021 17: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=thWX0LyrcPXzxXay68KtntVg6z17QjyWaIg+A3rFrnA=; b=yDkmZMscn1+TnDUdjktsCGdT76
	8AWYtTzN1wJEQTLOEnIdptFVPCe8xxIjY4Nyk7tD8DtZIohQYKhuWUBIOHhv2t9gqrM4r0B9MqcyR
	UeeMOBUcYbDNn0Od6/yjN0cP+cIZ+UyLEHk+VPAPUDTsMnwpN2ZN1v6xeOVQS4iYOp3E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] tools/oxenstored: mkdir conflicts were sometimes missed
Message-Id: <E1lNf8i-0001by-O5@xenbits.xenproject.org>
Date: Sat, 20 Mar 2021 17:11:52 +0000

commit 048af4453c2cfaf63ff5a1abd811fc7625c20c3c
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Jan 15 19:38:58 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 19 13:43:44 2021 +0000

    tools/oxenstored: mkdir conflicts were sometimes missed
    
    Due to how set_write_lowpath was used here it didn't detect create/delete
    conflicts.  When we create an entry we must mark our parent as modified
    (this is what creating a new node via write does).
    
    Otherwise we can have 2 transactions one creating, and another deleting a node
    both succeeding depending on timing.  Or one transaction reading an entry,
    concluding it doesn't exist, do some other work based on that information and
    successfully commit even if another transaction creates the node via mkdir
    meanwhile.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit 45dee7d92b493bb531e7e77a6f9c0180ab152f87)
---
 tools/ocaml/xenstored/transaction.ml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/transaction.ml b/tools/ocaml/xenstored/transaction.ml
index 25bc8c3b4a..17b1bdf2ea 100644
--- a/tools/ocaml/xenstored/transaction.ml
+++ b/tools/ocaml/xenstored/transaction.ml
@@ -165,7 +165,7 @@ let write t perm path value =
 
 let mkdir ?(with_watch=true) t perm path =
 	Store.mkdir t.store perm path;
-	set_write_lowpath t path;
+	set_write_lowpath t (Store.Path.get_parent path);
 	if with_watch then
 		add_wop t Xenbus.Xb.Op.Mkdir path
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sun Mar 21 19:00:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 21 Mar 2021 19:00:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99815.189826 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lO3Ix-0000dP-Vd; Sun, 21 Mar 2021 19:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99815.189826; Sun, 21 Mar 2021 19: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 1lO3Ix-0000cz-SC; Sun, 21 Mar 2021 19:00:03 +0000
Received: by outflank-mailman (input) for mailman id 99815;
 Sun, 21 Mar 2021 19: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 1lO3Iw-0000SC-DZ
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19: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 1lO3Iw-00076l-Bu
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lO3Iw-0006Tm-8k
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19: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=C8P1FwhXLBEvu9VSgV1ywpH9q0cpI+MkqXdxLMRuPF0=; b=SmZHtwpYE0RWHb9ZmFSSSe7y3c
	nCjiyVXC3QHY2SwFFa0XMG/eqnB5hJ/Y5CTWQ8skowp3gbsAlY01n3pwoQN8jYT34rYWf7SG8356U
	vbRuoN3/NWOMtkTpUco4gnPmqM8yNVgrX/4hFeXawGVFPiWvUP3EcFM9hZQH4ME+DKNU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/amd: Initial support for Fam19h processors
Message-Id: <E1lO3Iw-0006Tm-8k@xenbits.xenproject.org>
Date: Sun, 21 Mar 2021 19:00:02 +0000

commit 015e51a0bcf3be2e552c7b54ae64512caa679f3c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 19 15:39:42 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 19 15:39:42 2021 +0100

    x86/amd: Initial support for Fam19h processors
    
    Fam19h is very similar to Fam17h in these regards.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    
    x86/ucode/amd: Fix microcode payload size for Fam19 processors
    
    The original limit provided wasn't accurate.  Blobs are in fact rather larger.
    
    Fixes: fe36a173d1 ("x86/amd: Initial support for Fam19h processors")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: fe36a173d110fd792f5e337e208a5ed714df1536
    master date: 2020-05-04 11:04:29 +0100
    master commit: 90b014a6e6ecad036ec5846426afd19b305dedff
    master date: 2021-02-10 13:23:51 +0000
---
 xen/arch/x86/acpi/cpu_idle.c | 1 +
 xen/arch/x86/cpu/vpmu_amd.c  | 1 +
 xen/arch/x86/microcode_amd.c | 4 ++++
 xen/arch/x86/nmi.c           | 2 +-
 xen/arch/x86/traps.c         | 2 +-
 5 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 1dea781442..b8477c2cf4 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -1405,6 +1405,7 @@ static void amd_cpuidle_init(struct acpi_processor_power *power)
 
     switch ( c->x86 )
     {
+    case 0x19:
     case 0x18:
         if ( boot_cpu_data.x86_vendor != X86_VENDOR_HYGON )
         {
diff --git a/xen/arch/x86/cpu/vpmu_amd.c b/xen/arch/x86/cpu/vpmu_amd.c
index 3c6799b42c..eba47cd2a0 100644
--- a/xen/arch/x86/cpu/vpmu_amd.c
+++ b/xen/arch/x86/cpu/vpmu_amd.c
@@ -576,6 +576,7 @@ int __init amd_vpmu_init(void)
     {
     case 0x15:
     case 0x17:
+    case 0x19:
         num_counters = F15H_NUM_COUNTERS;
         counters = AMD_F15H_COUNTERS;
         ctrls = AMD_F15H_CTRLS;
diff --git a/xen/arch/x86/microcode_amd.c b/xen/arch/x86/microcode_amd.c
index d678357bb4..67c8a54cac 100644
--- a/xen/arch/x86/microcode_amd.c
+++ b/xen/arch/x86/microcode_amd.c
@@ -105,6 +105,7 @@ static bool_t verify_patch_size(uint32_t patch_size)
 #define F15H_MPB_MAX_SIZE 4096
 #define F16H_MPB_MAX_SIZE 3458
 #define F17H_MPB_MAX_SIZE 3200
+#define F19H_MPB_MAX_SIZE 5568
 
     switch (boot_cpu_data.x86)
     {
@@ -120,6 +121,9 @@ static bool_t verify_patch_size(uint32_t patch_size)
     case 0x17:
         max_size = F17H_MPB_MAX_SIZE;
         break;
+    case 0x19:
+        max_size = F19H_MPB_MAX_SIZE;
+        break;
     default:
         max_size = F1XH_MPB_MAX_SIZE;
         break;
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index e26121a737..856dc0b0ce 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -398,7 +398,7 @@ void setup_apic_nmi_watchdog(void)
     case X86_VENDOR_AMD:
         switch (boot_cpu_data.x86) {
         case 6:
-        case 0xf ... 0x17:
+        case 0xf ... 0x19:
             setup_k7_watchdog();
             break;
         default:
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 54aca36714..d19a771a02 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1927,7 +1927,7 @@ static unsigned int calc_ler_msr(void)
         switch ( boot_cpu_data.x86 )
         {
         case 6:
-        case 0xf ... 0x17:
+        case 0xf ... 0x19:
             return MSR_IA32_LASTINTFROMIP;
         }
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sun Mar 21 19:00:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 21 Mar 2021 19:00:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99816.189830 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lO3J8-00010R-0Z; Sun, 21 Mar 2021 19:00:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99816.189830; Sun, 21 Mar 2021 19:00: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 1lO3J7-00010J-Tq; Sun, 21 Mar 2021 19:00:13 +0000
Received: by outflank-mailman (input) for mailman id 99816;
 Sun, 21 Mar 2021 19: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 1lO3J6-00010D-Ia
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19: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 1lO3J6-00076w-Hs
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:00:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lO3J6-0006VG-E6
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:00:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cXQMUacOO9jsfOKbbShUljwagtqrjK6tDfe3DG9NuQc=; b=EZWdlmUVfQhP8FHorgt7p4xgJ9
	nHRM5ZS+wav5Md0Qm5DgExXViwEa96IzmCoPsBt6eZ0driFu4HrzMq1JvmmLu/s/81tISBDWbpkk5
	pTWaA4EOe24Y6wkuRODcAw8aWcxioWoOZfgq6Zrbhep+2UNkWki68KbwXYWJPmK3zu2Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] Revert "x86/timer: Fix boot on Intel systems using ITSSPRC static PIT clock gating"
Message-Id: <E1lO3J6-0006VG-E6@xenbits.xenproject.org>
Date: Sun, 21 Mar 2021 19:00:12 +0000

commit 53e83edb8dc9caf9faf46412e971a97781f0b73a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Mar 19 16:23:24 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 19 16:23:24 2021 +0100

    Revert "x86/timer: Fix boot on Intel systems using ITSSPRC static PIT clock gating"
    
    This reverts commit c11bd12218365e31ee4d00f315a075b21a015914,
    as it has been reported to cause symptoms similar to what it
    fixes on other hardware.
---
 xen/arch/x86/hpet.c | 67 +----------------------------------------------------
 1 file changed, 1 insertion(+), 66 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 86b4e88f9b..e99d7116b6 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -767,7 +767,7 @@ static u32 *hpet_boot_cfg;
 u64 __init hpet_setup(void)
 {
     static u64 __initdata hpet_rate;
-    unsigned int hpet_id, hpet_period, hpet_cfg;
+    u32 hpet_id, hpet_period;
     unsigned int last;
 
     if ( hpet_rate )
@@ -800,71 +800,6 @@ u64 __init hpet_setup(void)
     hpet_rate = 1000000000000000ULL; /* 10^15 */
     (void)do_div(hpet_rate, hpet_period);
 
-    /*
-     * Intel chipsets from Skylake/ApolloLake onwards can statically clock
-     * gate the 8259 PIT.  This option is enabled by default in slightly later
-     * systems, as turning the PIT off is a prerequisite to entering the C11
-     * power saving state.
-     *
-     * Xen currently depends on the legacy timer interrupt being active while
-     * IRQ routing is configured.
-     *
-     * Reconfigure the HPET into legacy mode to re-establish the timer
-     * interrupt.
-     */
-    if ( hpet_id & HPET_ID_LEGSUP &&
-         !((hpet_cfg = hpet_read32(HPET_CFG)) & HPET_CFG_LEGACY) )
-    {
-        unsigned int c0_cfg, ticks, count;
-
-        /* Stop the main counter. */
-        hpet_write32(hpet_cfg & ~HPET_CFG_ENABLE, HPET_CFG);
-
-        /* Reconfigure channel 0 to be 32bit periodic. */
-        c0_cfg = hpet_read32(HPET_Tn_CFG(0));
-        c0_cfg |= (HPET_TN_ENABLE | HPET_TN_PERIODIC | HPET_TN_SETVAL |
-                   HPET_TN_32BIT);
-        hpet_write32(c0_cfg, HPET_Tn_CFG(0));
-
-        /*
-         * The exact period doesn't have to match a legacy PIT.  All we need
-         * is an interrupt queued up via the IO-APIC to check routing.
-         *
-         * Use HZ as the frequency.
-         */
-        ticks = ((SECONDS(1) / HZ) * div_sc(hpet_rate, SECONDS(1), 32)) >> 32;
-
-        count = hpet_read32(HPET_COUNTER);
-
-        /*
-         * HPET_TN_SETVAL above is atrociously documented in the spec.
-         *
-         * Periodic HPET channels have a main comparator register, and
-         * separate "accumulator" register.  Despite being named accumulator
-         * in the spec, this is not an accurate description of its behaviour
-         * or purpose.
-         *
-         * Each time an interrupt is generated, the "accumulator" register is
-         * re-added to the comparator set up the new period.
-         *
-         * Normally, writes to the CMP register update both registers.
-         * However, under these semantics, it is impossible to set up a
-         * periodic timer correctly without the main HPET counter being at 0.
-         *
-         * Instead, HPET_TN_SETVAL is a self-clearing control bit which we can
-         * use for periodic timers to mean that the second write to CMP
-         * updates the accumulator only, and not the absolute comparator
-         * value.
-         *
-         * This lets us set a period when the main counter isn't at 0.
-         */
-        hpet_write32(count + ticks, HPET_Tn_CMP(0));
-        hpet_write32(ticks,         HPET_Tn_CMP(0));
-
-        /* Restart the main counter, and legacy mode. */
-        hpet_write32(hpet_cfg | HPET_CFG_ENABLE | HPET_CFG_LEGACY, HPET_CFG);
-    }
-
     return hpet_rate;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sun Mar 21 19:00:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 21 Mar 2021 19:00:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99817.189834 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lO3JI-00011e-2N; Sun, 21 Mar 2021 19:00:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99817.189834; Sun, 21 Mar 2021 19: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 1lO3JH-00011X-VP; Sun, 21 Mar 2021 19:00:23 +0000
Received: by outflank-mailman (input) for mailman id 99817;
 Sun, 21 Mar 2021 19: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 1lO3JG-00011L-MS
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19: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 1lO3JG-00077M-Lk
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:00:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lO3JG-0006Vo-K0
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19: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=NSC96G/Vj9hCICaBfM32oBmZQkmy28OtWhmPq5JXmsc=; b=pbm6c2mxCrIo0YzMMVRcx0vQ40
	dEX2wofaRjdbN00C3s3UI97kS7VNkkjYeHJMXvyyB+IqEYGwNXzrQxEnjoIahowl/8+60bJumZ3oj
	NzHi3VyD4Kez6su+7us3Y2Lur7Yz82cTLyLQ7tBSYQNFHSmG4Wx8xQKyK7x1hptgpbag=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/arm: sched: Ensure the vCPU context is seen before vcpu_pause() returns
Message-Id: <E1lO3JG-0006Vo-K0@xenbits.xenproject.org>
Date: Sun, 21 Mar 2021 19:00:22 +0000

commit b2c4b77bffd3ac3e627de4dc535f624c52376d01
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Tue Sep 22 20:31:04 2020 +0100
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 11:20:07 2021 -0700

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

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


From xen-changelog-bounces@lists.xenproject.org Sun Mar 21 19:00:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 21 Mar 2021 19:00:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99818.189838 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lO3JS-00013A-4F; Sun, 21 Mar 2021 19:00:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99818.189838; Sun, 21 Mar 2021 19:00: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 1lO3JS-000130-0t; Sun, 21 Mar 2021 19:00:34 +0000
Received: by outflank-mailman (input) for mailman id 99818;
 Sun, 21 Mar 2021 19: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 1lO3JQ-00012q-U4
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19: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 1lO3JQ-00077W-Or
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:00:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lO3JQ-0006WP-Nu
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19: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=gLy3h6deOQIqGcbC81SXSwsPSBWxnxOn3J/RDvf2Uv0=; b=YxIApCf++fURKg3ueA33ZPI3JI
	Eg0UqKgjgtz/tcBUl5bNpMdPqxw2JAoLPj8n4BUniBIrK692n299zdNTTy2eI1eKmhhi+kFr86rjt
	bQBBMFWYvhSt5IRtEsqkAA0lhdJWKdMFLTm2RyQ6tLCSQgsGqcs39FhkqW9WRMnn9CgA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/arm: mm: Access a PT entry before the table is unmapped
Message-Id: <E1lO3JQ-0006WP-Nu@xenbits.xenproject.org>
Date: Sun, 21 Mar 2021 19:00:32 +0000

commit 24567a631e732d19e8eeee07336c2aa4b2d0c6d1
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Sun Jun 7 16:51:54 2020 +0100
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 11:20:26 2021 -0700

    xen/arm: mm: Access a PT entry before the table is unmapped
    
    xen_pt_next_level() will retrieve the MFN from the entry right after the
    page-table has been unmapped.
    
    After calling xen_unmap_table(), there is no guarantee the mapping will
    still be valid. Depending on the implementation, this may result to a
    data abort in Xen.
    
    Re-order the code to retrieve the MFN before the table is unmapped.
    
    Fixes: 53abb9a1dcd9 ("xen/arm: mm: Rework Xen page-tables walk during update")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-acked-by: Paul Durrant <paul@xen.org>
    (cherry picked from commit 63b4c9bfb788ebfd35d0172f7e8e2e41ef948f70)
---
 xen/arch/arm/mm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 774cf62272..8958eefd13 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1033,6 +1033,7 @@ static int xen_pt_next_level(bool read_only, unsigned int level,
 {
     lpae_t *entry;
     int ret;
+    mfn_t mfn;
 
     entry = *table + offset;
 
@@ -1050,8 +1051,10 @@ static int xen_pt_next_level(bool read_only, unsigned int level,
     if ( lpae_is_mapping(*entry, level) )
         return XEN_TABLE_SUPER_PAGE;
 
+    mfn = lpae_get_mfn(*entry);
+
     xen_unmap_table(*table);
-    *table = xen_map_table(lpae_get_mfn(*entry));
+    *table = xen_map_table(mfn);
 
     return XEN_TABLE_NORMAL_PAGE;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sun Mar 21 19:00:44 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 21 Mar 2021 19:00:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99819.189842 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lO3Jc-00014a-5c; Sun, 21 Mar 2021 19:00:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99819.189842; Sun, 21 Mar 2021 19:00: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 1lO3Jc-00014S-2P; Sun, 21 Mar 2021 19:00:44 +0000
Received: by outflank-mailman (input) for mailman id 99819;
 Sun, 21 Mar 2021 19: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 1lO3Ja-00014G-TH
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19: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 1lO3Ja-00077d-S6
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:00:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lO3Ja-0006Wy-R3
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19: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=2f6nLSBddJuVrYDnt8VVQhyQW7Y20ZM+Yl5jYtQL1b4=; b=yLC22SDSyslRS+rjUin9zPnZRT
	GAGSkZSyu34roq644Y8gtWKGhlhRjV7S3YBXBcWNhdjt5F1JJbxQFP0k5RxutysIdCYOuxf6nIgd6
	RmAP4X6Ph17Jo0FK7y+G8AjKuMWLlh8LaUBDdP6z1exVBxQLuaPUcYV9Yt86XQEVpADM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/arm: Document the erratum #853709 related to Cortex A72
Message-Id: <E1lO3Ja-0006Wy-R3@xenbits.xenproject.org>
Date: Sun, 21 Mar 2021 19:00:42 +0000

commit 934bb4c87cf2a7c816ca5f585818172baadebe6f
Author:     Michal Orzel <michal.orzel@arm.com>
AuthorDate: Wed Oct 14 12:05:41 2020 +0200
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 11:23:18 2021 -0700

    xen/arm: Document the erratum #853709 related to Cortex A72
    
    The Cortex-A72 erratum #853709 is the same as the Cortex-A57
    erratum #852523. As the latter is already workaround, we only
    need to update the documentation.
    
    Signed-off-by: Michal Orzel <michal.orzel@arm.com>
    [julieng: Reworded the commit message]
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    (cherry picked from commit f776e5fb3ee699745f6442ec8c47d0fa647e0575)
---
 docs/misc/arm/silicon-errata.txt | 1 +
 xen/arch/arm/domain.c            | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index e15d0923e9..1f18a9df58 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -50,6 +50,7 @@ stable hypervisors.
 | ARM            | Cortex-A57      | #834220         | ARM64_ERRATUM_834220    |
 | ARM            | Cortex-A57      | #1319537        | N/A                     |
 | ARM            | Cortex-A72      | #1319367        | N/A                     |
+| ARM            | Cortex-A72      | #853709         | N/A                     |
 | ARM            | Cortex-A76      | #1165522        | N/A                     |
 | ARM            | Neoverse-N1     | #1165522        | N/A
 | ARM            | MMU-500         | #842869         | N/A                     |
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 4504c64467..dfbd711325 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -216,7 +216,8 @@ static void ctxt_switch_to(struct vcpu *n)
     WRITE_SYSREG64(n->arch.ttbr1, TTBR1_EL1);
 
     /*
-     * Erratum #852523: DACR32_EL2 must be restored before one of the
+     * Erratum #852523 (Cortex-A57) or erratum #853709 (Cortex-A72):
+     * DACR32_EL2 must be restored before one of the
      * following sysregs: SCTLR_EL1, TCR_EL1, TTBR0_EL1, TTBR1_EL1 or
      * CONTEXTIDR_EL1.
      */
@@ -245,7 +246,8 @@ static void ctxt_switch_to(struct vcpu *n)
 
     /*
      * This write to sysreg CONTEXTIDR_EL1 ensures we don't hit erratum
-     * #852523. I.e DACR32_EL2 is not correctly synchronized.
+     * #852523 (Cortex-A57) or #853709 (Cortex-A72).
+     * I.e DACR32_EL2 is not correctly synchronized.
      */
     WRITE_SYSREG(n->arch.contextidr, CONTEXTIDR_EL1);
     WRITE_SYSREG(n->arch.tpidr_el0, TPIDR_EL0);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sun Mar 21 19:00:54 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 21 Mar 2021 19:00:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99820.189845 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lO3Jm-00015q-7Z; Sun, 21 Mar 2021 19:00:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99820.189845; Sun, 21 Mar 2021 19:00: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 1lO3Jm-00015i-3z; Sun, 21 Mar 2021 19:00:54 +0000
Received: by outflank-mailman (input) for mailman id 99820;
 Sun, 21 Mar 2021 19:00: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 1lO3Jk-00015Z-WB
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:00: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 1lO3Jk-00077k-VK
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:00:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lO3Jk-0006XY-UK
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:00:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=h6NoG/2U3zqrzkoSi2eP9poHeQgzZ6NA8s5NMI0frDQ=; b=6ECA+0cnh+pILWVJTRsKHNFI09
	I+fJdmzO/IN2Ac1LdpAkqkxGtB2RKABkzMxIfAZb7LrpqQukM4P7MPwkFCvmqSRO396lsOeVxW4DJ
	UR8JI9M0DwpfPMsPNkYgdGtpEttRrkYDgMZdU+Kv9+gf6yHYO0g/7wOoerJZ+ar8lLKM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/arm: Add Cortex-A73 erratum 858921 workaround
Message-Id: <E1lO3Jk-0006XY-UK@xenbits.xenproject.org>
Date: Sun, 21 Mar 2021 19:00:52 +0000

commit 96fbc00d1d73b1f3344644b7aa607ff0355c206a
Author:     Penny Zheng <penny.zheng@arm.com>
AuthorDate: Mon Nov 9 16:21:10 2020 +0800
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 11:26:33 2021 -0700

    xen/arm: Add Cortex-A73 erratum 858921 workaround
    
    CNTVCT_EL0 or CNTPCT_EL0 counter read in Cortex-A73 (all versions)
    might return a wrong value when the counter crosses a 32bit boundary.
    
    Until now, there is no case for Xen itself to access CNTVCT_EL0,
    and it also should be the Guest OS's responsibility to deal with
    this part.
    
    But for CNTPCT, there exists several cases in Xen involving reading
    CNTPCT, so a possible workaround is that performing the read twice,
    and to return one or the other depending on whether a transition has
    taken place.
    
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Reviewed-by: Wei Chen <Wei.Chen@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 5505f5f8e7e805365cfe70b6a4af6115940bb749)
---
 docs/misc/arm/silicon-errata.txt |  1 +
 xen/arch/arm/Kconfig             | 18 ++++++++++++++++++
 xen/arch/arm/cpuerrata.c         |  8 ++++++++
 xen/arch/arm/vtimer.c            |  2 +-
 xen/include/asm-arm/cpuerrata.h  |  2 ++
 xen/include/asm-arm/cpufeature.h |  3 ++-
 xen/include/asm-arm/time.h       | 22 +++++++++++++++++++++-
 7 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index 1f18a9df58..552c4151d3 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -51,6 +51,7 @@ stable hypervisors.
 | ARM            | Cortex-A57      | #1319537        | N/A                     |
 | ARM            | Cortex-A72      | #1319367        | N/A                     |
 | ARM            | Cortex-A72      | #853709         | N/A                     |
+| ARM            | Cortex-A73      | #858921         | ARM_ERRATUM_858921      |
 | ARM            | Cortex-A76      | #1165522        | N/A                     |
 | ARM            | Neoverse-N1     | #1165522        | N/A
 | ARM            | MMU-500         | #842869         | N/A                     |
diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index a51aa7bfa8..bcd05c4f02 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -228,6 +228,24 @@ config ARM64_ERRATUM_834220
 
 	  If unsure, say Y.
 
+config ARM_ERRATUM_858921
+	bool "Cortex-A73: 858921: Possible wrong read value for CNTVCT or CNTPCT"
+	default y
+	help
+	  This option adds an alternative code sequence to work around ARM
+	  erratum 858921 on Cortex-A73 (all versions).
+
+	  Affected Cortex-A73 might return wrong read value for CNTVCT or CNTPCT
+	  when the counter crosses a 32bit boundary.
+
+	  The workaround involves performing the read twice, and to return
+	  one or the other value depending on whether a transition has taken place.
+	  Please note that this does not necessarily enable the workaround,
+	  as it depends on the alternative framework, which will only patch
+	  the kernel if an affected CPU is detected.
+
+	  If unsure, say Y.
+
 endmenu
 
 config ARM64_HARDEN_BRANCH_PREDICTOR
diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
index 9f7169a6a6..12063c9001 100644
--- a/xen/arch/arm/cpuerrata.c
+++ b/xen/arch/arm/cpuerrata.c
@@ -474,6 +474,14 @@ static const struct arm_cpu_capabilities arm_errata[] = {
         .capability = ARM_SSBD,
         .matches = has_ssbd_mitigation,
     },
+#endif
+#ifdef CONFIG_ARM_ERRATUM_858921
+    {
+        /* Cortex-A73 (all versions) */
+        .desc = "ARM erratum 858921",
+        .capability = ARM_WORKAROUND_858921,
+        MIDR_ALL_VERSIONS(MIDR_CORTEX_A73),
+    },
 #endif
     {
         /* Neoverse r0p0 - r2p0 */
diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index a80009882f..43a0f1fde8 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -62,7 +62,7 @@ static void virt_timer_expired(void *data)
 
 int domain_vtimer_init(struct domain *d, struct xen_arch_domainconfig *config)
 {
-    d->arch.virt_timer_base.offset = READ_SYSREG64(CNTPCT_EL0);
+    d->arch.virt_timer_base.offset = get_cycles();
     d->time_offset_seconds = ticks_to_ns(d->arch.virt_timer_base.offset - boot_count);
     do_div(d->time_offset_seconds, 1000000000);
 
diff --git a/xen/include/asm-arm/cpuerrata.h b/xen/include/asm-arm/cpuerrata.h
index 88ef3ca934..8d7e7b9375 100644
--- a/xen/include/asm-arm/cpuerrata.h
+++ b/xen/include/asm-arm/cpuerrata.h
@@ -28,6 +28,8 @@ static inline bool check_workaround_##erratum(void)             \
 CHECK_WORKAROUND_HELPER(766422, ARM32_WORKAROUND_766422, CONFIG_ARM_32)
 CHECK_WORKAROUND_HELPER(834220, ARM64_WORKAROUND_834220, CONFIG_ARM_64)
 CHECK_WORKAROUND_HELPER(ssbd, ARM_SSBD, CONFIG_ARM_SSBD)
+CHECK_WORKAROUND_HELPER(858921, ARM_WORKAROUND_858921,
+                        CONFIG_ARM_ERRATUM_858921)
 
 #undef CHECK_WORKAROUND_HELPER
 
diff --git a/xen/include/asm-arm/cpufeature.h b/xen/include/asm-arm/cpufeature.h
index 6bff5ce131..29753fee78 100644
--- a/xen/include/asm-arm/cpufeature.h
+++ b/xen/include/asm-arm/cpufeature.h
@@ -45,8 +45,9 @@
 #define ARM_SSBD 7
 #define ARM_SMCCC_1_1 8
 #define ARM64_WORKAROUND_AT_SPECULATE 9
+#define ARM_WORKAROUND_858921 10
 
-#define ARM_NCAPS           10
+#define ARM_NCAPS           11
 
 #ifndef __ASSEMBLY__
 
diff --git a/xen/include/asm-arm/time.h b/xen/include/asm-arm/time.h
index 9cb6f9b0b4..1b2c13614b 100644
--- a/xen/include/asm-arm/time.h
+++ b/xen/include/asm-arm/time.h
@@ -3,6 +3,7 @@
 
 #include <asm/sysregs.h>
 #include <asm/system.h>
+#include <asm/cpuerrata.h>
 
 #define DT_MATCH_TIMER                      \
     DT_MATCH_COMPATIBLE("arm,armv7-timer"), \
@@ -13,7 +14,26 @@ typedef uint64_t cycles_t;
 static inline cycles_t get_cycles (void)
 {
         isb();
-        return READ_SYSREG64(CNTPCT_EL0);
+        /*
+         * ARM_WORKAROUND_858921: Cortex-A73 (all versions) counter read
+         * can return a wrong value when the counter crosses a 32bit boundary.
+         */
+        if ( !check_workaround_858921() )
+            return READ_SYSREG64(CNTPCT_EL0);
+        else
+        {
+            /*
+             * A recommended workaround for erratum 858921 is to:
+             *  1- Read twice CNTPCT.
+             *  2- Compare bit[32] of the two read values.
+             *      - If bit[32] is different, keep the old value.
+             *      - If bit[32] is the same, keep the new value.
+             */
+            cycles_t old, new;
+            old = READ_SYSREG64(CNTPCT_EL0);
+            new = READ_SYSREG64(CNTPCT_EL0);
+            return (((old ^ new) >> 32) & 1) ? old : new;
+        }
 }
 
 /* List of timer's IRQ */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sun Mar 21 19:01:04 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 21 Mar 2021 19:01:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99821.189850 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lO3Jw-00017G-AL; Sun, 21 Mar 2021 19:01:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99821.189850; Sun, 21 Mar 2021 19:01: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 1lO3Jw-000178-7T; Sun, 21 Mar 2021 19:01:04 +0000
Received: by outflank-mailman (input) for mailman id 99821;
 Sun, 21 Mar 2021 19:01: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 1lO3Jv-00016z-3M
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:01: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 1lO3Jv-000786-2X
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:01:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lO3Jv-0006Yk-1S
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:01: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=ba9VvFMwggy9PHTjY0HvCafZfkSo6zrhA9su0+zuKgE=; b=u382UyhAa9knRPgFx3if+ezUu2
	qgxNJdns0nf8+60QuCrPm5XuI/dekaNGplNrABEFXqPlT+8nHUfZ9POf+lJNhF6iWAhLaSMhO0+sL
	kozsbH8bYb/Rn6SoYgfn7ev19YBpsLPVIwlBYrP61sGckwT+bvFgfjSg58M2CjtvefSk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/arm: Add workaround for Cortex-A55 erratum #1530923
Message-Id: <E1lO3Jv-0006Yk-1S@xenbits.xenproject.org>
Date: Sun, 21 Mar 2021 19:01:03 +0000

commit c552d976e1fdfb2a49f97865b69d0f568fb7f1e8
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Tue Nov 24 11:12:15 2020 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 11:28:03 2021 -0700

    xen/arm: Add workaround for Cortex-A55 erratum #1530923
    
    On the Cortex A55, TLB entries can be allocated by a speculative AT
    instruction. If this is happening during a guest context switch with an
    inconsistent page table state in the guest, TLBs with wrong values might
    be allocated.
    The ARM64_WORKAROUND_AT_SPECULATE workaround is used as for erratum
    1165522 on Cortex A76 or Neoverse N1.
    
    This change is also introducing the MIDR identifier for the Cortex-A55.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Rahul Singh <rahul.singh@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit fd7479b9aec25885cc17d33b326b9babae59faee)
---
 docs/misc/arm/silicon-errata.txt | 1 +
 xen/arch/arm/cpuerrata.c         | 6 ++++++
 xen/include/asm-arm/processor.h  | 2 ++
 3 files changed, 9 insertions(+)

diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index 552c4151d3..a15290285f 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -45,6 +45,7 @@ stable hypervisors.
 | ARM            | Cortex-A53      | #827319         | ARM64_ERRATUM_827319    |
 | ARM            | Cortex-A53      | #824069         | ARM64_ERRATUM_824069    |
 | ARM            | Cortex-A53      | #819472         | ARM64_ERRATUM_819472    |
+| ARM            | Cortex-A55      | #1530923        | N/A                     |
 | ARM            | Cortex-A57      | #852523         | N/A                     |
 | ARM            | Cortex-A57      | #832075         | ARM64_ERRATUM_832075    |
 | ARM            | Cortex-A57      | #834220         | ARM64_ERRATUM_834220    |
diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
index 12063c9001..f94bcf74cc 100644
--- a/xen/arch/arm/cpuerrata.c
+++ b/xen/arch/arm/cpuerrata.c
@@ -505,6 +505,12 @@ static const struct arm_cpu_capabilities arm_errata[] = {
         .capability = ARM64_WORKAROUND_AT_SPECULATE,
         MIDR_ALL_VERSIONS(MIDR_CORTEX_A57),
     },
+    {
+        /* Cortex-A55 (All versions as erratum is open in SDEN v14) */
+        .desc = "ARM erratum 1530923",
+        .capability = ARM64_WORKAROUND_AT_SPECULATE,
+        MIDR_ALL_VERSIONS(MIDR_CORTEX_A55),
+    },
     {},
 };
 
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index d3d12a9d19..87c8136022 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -53,6 +53,7 @@
 #define ARM_CPU_PART_CORTEX_A17     0xC0E
 #define ARM_CPU_PART_CORTEX_A15     0xC0F
 #define ARM_CPU_PART_CORTEX_A53     0xD03
+#define ARM_CPU_PART_CORTEX_A55     0xD05
 #define ARM_CPU_PART_CORTEX_A57     0xD07
 #define ARM_CPU_PART_CORTEX_A72     0xD08
 #define ARM_CPU_PART_CORTEX_A73     0xD09
@@ -64,6 +65,7 @@
 #define MIDR_CORTEX_A17 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A17)
 #define MIDR_CORTEX_A15 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A15)
 #define MIDR_CORTEX_A53 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A53)
+#define MIDR_CORTEX_A55 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A55)
 #define MIDR_CORTEX_A57 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A57)
 #define MIDR_CORTEX_A72 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A72)
 #define MIDR_CORTEX_A73 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A73)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sun Mar 21 19:01:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 21 Mar 2021 19:01:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99822.189853 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lO3K6-00018r-C1; Sun, 21 Mar 2021 19:01:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99822.189853; Sun, 21 Mar 2021 19:01: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 1lO3K6-00018j-8w; Sun, 21 Mar 2021 19:01:14 +0000
Received: by outflank-mailman (input) for mailman id 99822;
 Sun, 21 Mar 2021 19:01: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 1lO3K5-00018Z-6j
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:01: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 1lO3K5-00078D-5y
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:01:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lO3K5-0006ZN-4l
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:01: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=XfrsDqXXiJQXI595sbC425sIPvuzU7xZm3RGDY1iC4A=; b=WDuU/kQ1sr7dQJsz3zClyGYgng
	SLbdOrG8KhPWt9Ty291MieALdk+3FdJ2F1Kajk3mGXeKRRaF9ygwd3Nb+eQCCKX1RaFuhci7ldYlO
	ohUeibW8aFRH55lS9wQD0IVqW3kBl/JO8Fu+zn8oS5dzmvwlaNT/zydu04HomN2OVNIo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/arm: Add workaround for Cortex-A53 erratum #843419
Message-Id: <E1lO3K5-0006ZN-4l@xenbits.xenproject.org>
Date: Sun, 21 Mar 2021 19:01:13 +0000

commit 8505e8a10e422daf9af086a9e61207bca8f4d28c
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Fri Mar 19 11:55:03 2021 -0700
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:20:52 2021 -0700

    xen/arm: Add workaround for Cortex-A53 erratum #843419
    
    On the Cortex A53, when executing in AArch64 state, a load or store instruction
    which uses the result of an ADRP instruction as a base register, or which uses
    a base register written by an instruction immediately after an ADRP to the
    same register, might access an incorrect address.
    
    The workaround is to enable the linker flag --fix-cortex-a53-843419
    if present, to check and fix the affected sequence. Otherwise print a warning
    that Xen may be susceptible to this errata
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    [backport: LDFLAGS/XEN_LDFLAGS, move ld-option to Config.mk]
    (cherry picked from commit d81133d45d81d35a4e7445778bfd1179190cbd31)
---
 Config.mk                        | 12 ++++++++++++
 docs/misc/arm/silicon-errata.txt |  1 +
 xen/arch/arm/Kconfig             | 19 +++++++++++++++++++
 xen/arch/arm/Makefile            |  8 ++++++++
 4 files changed, 40 insertions(+)

diff --git a/Config.mk b/Config.mk
index 6f0321a9ee..75f4eadbf9 100644
--- a/Config.mk
+++ b/Config.mk
@@ -130,6 +130,18 @@ define cc-ver-check-closure
     endif
 endef
 
+# $(if-success,<command>,<then>,<else>)
+# Return <then> if <command> exits with 0, <else> otherwise.
+if-success = $(shell { $(1); } >/dev/null 2>&1 && echo "$(2)" || echo "$(3)")
+
+# $(success,<command>)
+# Return y if <command> exits with 0, n otherwise
+success = $(call if-success,$(1),y,n)
+
+# $(ld-option,<flag>)
+# Return y if the linker supports <flag>, n otherwise
+ld-option = $(call success,$(LD) -v $(1))
+
 # cc-ifversion: Check compiler version and take branch accordingly
 # Usage $(call cc-ifversion,lt,0x040700,string_if_y,string_if_n)
 cc-ifversion = $(shell [ $(call cc-ver,$(CC),$(1),$(2)) = "y" ] \
diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index a15290285f..67f9f3b395 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -45,6 +45,7 @@ stable hypervisors.
 | ARM            | Cortex-A53      | #827319         | ARM64_ERRATUM_827319    |
 | ARM            | Cortex-A53      | #824069         | ARM64_ERRATUM_824069    |
 | ARM            | Cortex-A53      | #819472         | ARM64_ERRATUM_819472    |
+| ARM            | Cortex-A53      | #843419         | ARM64_ERRATUM_843419    |
 | ARM            | Cortex-A55      | #1530923        | N/A                     |
 | ARM            | Cortex-A57      | #852523         | N/A                     |
 | ARM            | Cortex-A57      | #832075         | ARM64_ERRATUM_832075    |
diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index bcd05c4f02..87413543d1 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -188,6 +188,25 @@ config ARM64_ERRATUM_819472
 
 	  If unsure, say Y.
 
+config ARM64_ERRATUM_843419
+	bool "Cortex-A53: 843419: A load or store might access an incorrect address"
+	default y
+	depends on ARM_64
+	help
+	  This option adds an alternative code sequence to work around ARM
+	  erratum 843419 on Cortex-A53 parts up to r0p4.
+
+	  When executing in AArch64 state, a load or store instruction which uses
+	  the result of an ADRP instruction as a base register, or which uses a
+	  base register written by an instruction immediately after an ADRP to the
+	  same register, might access an incorrect address.
+
+	  The workaround enables the linker to check if the affected sequence is
+	  produced and it will fix it with an alternative not affected sequence
+	  that produce the same behavior.
+
+	  If unsure, say Y.
+
 config ARM64_ERRATUM_832075
 	bool "Cortex-A57: 832075: possible deadlock on mixing exclusive memory accesses with device loads"
 	default y
diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 8edb200245..d7618d52a7 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -102,6 +102,14 @@ prelink.o: $(ALL_OBJS)
 	$(LD) $(LDFLAGS) -r -o $@ $^
 endif
 
+ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
+    ifeq ($(call ld-option, --fix-cortex-a53-843419),n)
+        $(warning ld does not support --fix-cortex-a53-843419; xen may be susceptible to erratum)
+    else
+        LDFLAGS += --fix-cortex-a53-843419
+    endif
+endif
+
 $(TARGET)-syms: prelink.o xen.lds
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
 	    $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).0
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sun Mar 21 19:01:25 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 21 Mar 2021 19:01:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99823.189858 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lO3KH-0001A1-Dk; Sun, 21 Mar 2021 19:01:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99823.189858; Sun, 21 Mar 2021 19:01: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 1lO3KH-00019t-AZ; Sun, 21 Mar 2021 19:01:25 +0000
Received: by outflank-mailman (input) for mailman id 99823;
 Sun, 21 Mar 2021 19:01: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 1lO3KF-00019j-Ah
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:01: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 1lO3KF-00078d-9u
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:01:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lO3KF-0006Zr-8G
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:01: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=1w5M+b1SMEY5FunnR9wdwuvmpiK2jbcMS/BoXB+Nr5Y=; b=Fh8/fM6BP5J7Q1yZhQElFcI8et
	7RDCD4cFq/LEQxkHyiUwZVRqBU8cAQh4EjMgPGv1v++kSi/iuWtGwfkujMZYQNUfP8CCtWOYAdcNG
	jynf4Dzl2b4Q9QjEdjfhKH3BEc4coQ2HfG0g/1YNW9KecOghlivZnWX0OZKo0ABjWwrg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/arm: call iomem_permit_access for passthrough devices
Message-Id: <E1lO3KF-0006Zr-8G@xenbits.xenproject.org>
Date: Sun, 21 Mar 2021 19:01:23 +0000

commit a702c80ec1936c2ecf00a4628af6a4cfdbc5b909
Author:     Stefano Stabellini <sstabellini@kernel.org>
AuthorDate: Tue Apr 14 18:02:55 2020 -0700
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:20:52 2021 -0700

    xen/arm: call iomem_permit_access for passthrough devices
    
    iomem_permit_access should be called for MMIO regions of devices
    assigned to a domain. Currently it is not called for MMIO regions of
    passthrough devices of Dom0less guests. This patch fixes it.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
    Acked-by: Julien Grall <julien@xen.org>
    (cherry picked from commit 6b75c7a95420acbb9c118624ff0a5e973287c1e4)
---
 xen/arch/arm/domain_build.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index dd9c3b73ba..8c5ff11cdc 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1798,6 +1798,17 @@ static int __init handle_passthrough_prop(struct kernel_info *kinfo,
             return -EINVAL;
         }
 
+        res = iomem_permit_access(kinfo->d, paddr_to_pfn(mstart),
+                                  paddr_to_pfn(PAGE_ALIGN(mstart + size - 1)));
+        if ( res )
+        {
+            printk(XENLOG_ERR "Unable to permit to dom%d access to"
+                   " 0x%"PRIx64" - 0x%"PRIx64"\n",
+                   kinfo->d->domain_id,
+                   mstart & PAGE_MASK, PAGE_ALIGN(mstart + size) - 1);
+            return res;
+        }
+
         res = map_regions_p2mt(kinfo->d,
                                gaddr_to_gfn(gstart),
                                PFN_DOWN(size),
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sun Mar 21 19:01:35 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 21 Mar 2021 19:01:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99824.189861 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lO3KR-0001Cz-F2; Sun, 21 Mar 2021 19:01:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99824.189861; Sun, 21 Mar 2021 19:01: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 1lO3KR-0001Cr-C6; Sun, 21 Mar 2021 19:01:35 +0000
Received: by outflank-mailman (input) for mailman id 99824;
 Sun, 21 Mar 2021 19:01: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 1lO3KP-0001CZ-Ec
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:01: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 1lO3KP-00078g-Dn
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:01:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lO3KP-0006aN-C7
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:01: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=4AaPl5G/l7D5UOPl6cK6FjU0nuHBOBrSAGQVaPeL3E8=; b=NmJc2bNqQ/FJ56IlCeRm8OZNf/
	ls/6dHg/RM3qm2LSEXaxKFzW1NGnRjmeS4O9gLSTpOOtYqY67WypJNeO46kMAODDRvM8XwED1GdKO
	wj1p0v3bYC+R+aLNtdwoIlAUSm1gTZBv0PkeonhVXAupS1uHagaxL/zFU0B/RmgZwIqY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/arm: mm: Remove ; at the end of mm_printk()
Message-Id: <E1lO3KP-0006aN-C7@xenbits.xenproject.org>
Date: Sun, 21 Mar 2021 19:01:33 +0000

commit 2fb361c36aa965de09922d9f87a29769b029b2fb
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Nov 19 19:07:47 2020 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:20:52 2021 -0700

    xen/arm: mm: Remove ; at the end of mm_printk()
    
    The ; at the end of mm_printk() means the following code will not build
    correctly:
    
    if ( ... )
        mm_printk(...);
    else
        ...
    
    As we treat the macro as a function, we want to remove the ; at the end
    of it.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    (cherry picked from commit bfe67a17d4df2efbedaaf5cfbadc8a8627debf5c)
---
 xen/arch/arm/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 8958eefd13..67853d58d7 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -59,7 +59,7 @@ mm_printk(const char *fmt, ...) {}
     {                                       \
         dprintk(XENLOG_ERR, fmt, ## args);  \
         WARN();                             \
-    } while (0);
+    } while (0)
 #endif
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sun Mar 21 19:01:45 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 21 Mar 2021 19:01:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99825.189866 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lO3Kb-0001EG-Gj; Sun, 21 Mar 2021 19:01:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99825.189866; Sun, 21 Mar 2021 19:01: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 1lO3Kb-0001E8-DW; Sun, 21 Mar 2021 19:01:45 +0000
Received: by outflank-mailman (input) for mailman id 99825;
 Sun, 21 Mar 2021 19:01: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 1lO3KZ-0001Dx-JN
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:01: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 1lO3KZ-00078j-Ho
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:01:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lO3KZ-0006az-Fx
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:01: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=SZxi2oFin8dchk6uNMoQMony1xEq36OMaBmgJ4Kaebw=; b=FrR2w7eDdkmvsqPQyRRL4ffTNV
	uwY9Tv0fzwv6VKeKhLWpwu+yd7SeZzwCLz7CB5cylbg24gHUkxusFiuiY9xdb7Er/Ij8aTMXLdnlG
	3OekniuM9tj0oa8gE8t3mlnfoHQ8gO1G50Jx6CqOxXG+OOTGRHnskettJgMwf9TLcvjg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/arm: vgic-v3: fix GICD_ISACTIVER range
Message-Id: <E1lO3KZ-0006az-Fx@xenbits.xenproject.org>
Date: Sun, 21 Mar 2021 19:01:43 +0000

commit 284aed024f58da4e1791bf4aa43ca19d9ac320c5
Author:     Peng Fan <peng.fan@nxp.com>
AuthorDate: Fri Apr 17 15:16:09 2020 -0700
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:20:52 2021 -0700

    xen/arm: vgic-v3: fix GICD_ISACTIVER range
    
    The end should be GICD_ISACTIVERN not GICD_ISACTIVER.
    
    See https://marc.info/?l=xen-devel&m=158527653730795 for a discussion on
    what it would take to implement GICD_ISACTIVER/GICD_ICACTIVER properly.
    
    We chose v1 instead of v2 of this patch to avoid spamming the console:
    v2 adds a printk for every read, and reads can happen often.
    
    Signed-off-by: Peng Fan <peng.fan@nxp.com>
    [Stefano: improve commit message]
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit 0796cb907f2c31046427510a6da6f4941f678b76)
---
 xen/arch/arm/vgic-v3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 4e60ba15cc..fd8cfc156d 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -713,7 +713,7 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
         goto read_as_zero;
 
     /* Read the active status of an IRQ via GICD/GICR is not supported */
-    case VRANGE32(GICD_ISACTIVER, GICD_ISACTIVER):
+    case VRANGE32(GICD_ISACTIVER, GICD_ISACTIVERN):
     case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
         goto read_as_zero;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sun Mar 21 19:01:55 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 21 Mar 2021 19:01:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99826.189870 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lO3Kl-0001FR-IR; Sun, 21 Mar 2021 19:01:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99826.189870; Sun, 21 Mar 2021 19:01: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 1lO3Kl-0001FJ-F8; Sun, 21 Mar 2021 19:01:55 +0000
Received: by outflank-mailman (input) for mailman id 99826;
 Sun, 21 Mar 2021 19:01: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 1lO3Kj-0001F8-LZ
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:01: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 1lO3Kj-00078m-Kn
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:01:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lO3Kj-0006bV-KB
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:01: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=uHoSV183rsGpbHJPqBM+hDRYIXqVKnE9VN8cz1PjBts=; b=hARz+d7Kyq28jtiGV1JIdoBum9
	3WGm9SGhzr7UUAoBRzPpBbJCm1+f5n+jRZePGR/6V3JhL07zZLGfnqLPnI4N4EerSrFOnPKmfLyns
	zIrYt3omQysfYT2E7A/uGN16rbQfssU7yEv+cPYn/utoVDJ2/KeeIyEg6zn6iv/Ack1I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/vgic: Implement write to ISPENDR in vGICv{2, 3}
Message-Id: <E1lO3Kj-0006bV-KB@xenbits.xenproject.org>
Date: Sun, 21 Mar 2021 19:01:53 +0000

commit 29e9ca276314881f9adef2b5902a3dc9a88ce946
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Sat Feb 20 14:04:12 2021 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:20:52 2021 -0700

    xen/vgic: Implement write to ISPENDR in vGICv{2, 3}
    
    Currently, Xen will send a data abort to a guest trying to write to the
    ISPENDR.
    
    Unfortunately, recent version of Linux (at least 5.9+) will start
    writing to the register if the interrupt needs to be re-triggered
    (see the callback irq_retrigger). This can happen when a driver (such as
    the xgbe network driver on AMD Seattle) re-enable an interrupt:
    
    (XEN) d0v0: vGICD: unhandled word write 0x00000004000000 to ISPENDR44
    [...]
    [   25.635837] Unhandled fault at 0xffff80001000522c
    [...]
    [   25.818716]  gic_retrigger+0x2c/0x38
    [   25.822361]  irq_startup+0x78/0x138
    [   25.825920]  __enable_irq+0x70/0x80
    [   25.829478]  enable_irq+0x50/0xa0
    [   25.832864]  xgbe_one_poll+0xc8/0xd8
    [   25.836509]  net_rx_action+0x110/0x3a8
    [   25.840328]  __do_softirq+0x124/0x288
    [   25.844061]  irq_exit+0xe0/0xf0
    [   25.847272]  __handle_domain_irq+0x68/0xc0
    [   25.851442]  gic_handle_irq+0xa8/0xe0
    [   25.855171]  el1_irq+0xb0/0x180
    [   25.858383]  arch_cpu_idle+0x18/0x28
    [   25.862028]  default_idle_call+0x24/0x5c
    [   25.866021]  do_idle+0x204/0x278
    [   25.869319]  cpu_startup_entry+0x24/0x68
    [   25.873313]  rest_init+0xd4/0xe4
    [   25.876611]  arch_call_rest_init+0x10/0x1c
    [   25.880777]  start_kernel+0x5b8/0x5ec
    
    As a consequence, the OS may become unusable.
    
    Implementing the write part of ISPENDR is somewhat easy. For
    virtual interrupt, we only need to inject the interrupt again.
    
    For physical interrupt, we need to be more careful as the de-activation
    of the virtual interrupt will be propagated to the physical distributor.
    For simplicity, the physical interrupt will be set pending so the
    workflow will not differ from a "real" interrupt.
    
    Longer term, we could possible directly activate the physical interrupt
    and avoid taking an exception to inject the interrupt to the domain.
    (This is the approach taken by the new vGIC based on KVM).
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit 067935804a8e7a33ff7170a2db8ce94bb46d9a63)
---
 xen/arch/arm/vgic-v2.c     | 10 ++++++----
 xen/arch/arm/vgic-v3.c     | 18 +++++++-----------
 xen/arch/arm/vgic.c        | 47 ++++++++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/vgic.h |  2 ++
 4 files changed, 62 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 64b141fea5..b2da886adc 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -472,10 +472,12 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        printk(XENLOG_G_ERR
-               "%pv: vGICD: unhandled word write %#"PRIregister" to ISPENDR%d\n",
-               v, r, gicd_reg - GICD_ISPENDR);
-        return 0;
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ISPENDR, DABT_WORD);
+        if ( rank == NULL ) goto write_ignore;
+
+        vgic_set_irqs_pending(v, r, rank->index);
+
+        return 1;
 
     case VRANGE32(GICD_ICPENDR, GICD_ICPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index fd8cfc156d..613f37abab 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -808,10 +808,12 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
 
     case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        printk(XENLOG_G_ERR
-               "%pv: %s: unhandled word write %#"PRIregister" to ISPENDR%d\n",
-               v, name, r, reg - GICD_ISPENDR);
-        return 0;
+        rank = vgic_rank_offset(v, 1, reg - GICD_ISPENDR, DABT_WORD);
+        if ( rank == NULL ) goto write_ignore;
+
+        vgic_set_irqs_pending(v, r, rank->index);
+
+        return 1;
 
     case VRANGE32(GICD_ICPENDR, GICD_ICPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
@@ -975,6 +977,7 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
     case VREG32(GICR_ICACTIVER0):
     case VREG32(GICR_ICFGR1):
     case VRANGE32(GICR_IPRIORITYR0, GICR_IPRIORITYR7):
+    case VREG32(GICR_ISPENDR0):
          /*
           * Above registers offset are common with GICD.
           * So handle common with GICD handling
@@ -982,13 +985,6 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
         return __vgic_v3_distr_common_mmio_write("vGICR: SGI", v,
                                                  info, gicr_reg, r);
 
-    case VREG32(GICR_ISPENDR0):
-        if ( dabt.size != DABT_WORD ) goto bad_width;
-        printk(XENLOG_G_ERR
-               "%pv: vGICR: SGI: unhandled word write %#"PRIregister" to ISPENDR0\n",
-               v, r);
-        return 0;
-
     case VREG32(GICR_ICPENDR0):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 82f524a35c..8f9400a519 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -423,6 +423,53 @@ void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
     }
 }
 
+void vgic_set_irqs_pending(struct vcpu *v, uint32_t r, unsigned int rank)
+{
+    const unsigned long mask = r;
+    unsigned int i;
+    /* The first rank is always per-vCPU */
+    bool private = rank == 0;
+
+    /* LPIs will never be set pending via this function */
+    ASSERT(!is_lpi(32 * rank + 31));
+
+    for_each_set_bit( i, &mask, 32 )
+    {
+        unsigned int irq = i + 32 * rank;
+
+        if ( !private )
+        {
+            struct pending_irq *p = spi_to_pending(v->domain, irq);
+
+            /*
+             * When the domain sets the pending state for a HW interrupt on
+             * the virtual distributor, we set the pending state on the
+             * physical distributor.
+             *
+             * XXX: Investigate whether we would be able to set the
+             * physical interrupt active and save an interruption. (This
+             * is what the new vGIC does).
+             */
+            if ( p->desc != NULL )
+            {
+                unsigned long flags;
+
+                spin_lock_irqsave(&p->desc->lock, flags);
+                gic_set_pending_state(p->desc, true);
+                spin_unlock_irqrestore(&p->desc->lock, flags);
+                continue;
+            }
+        }
+
+        /*
+         * If the interrupt is per-vCPU, then we want to inject the vIRQ
+         * to v, otherwise we should let the function figuring out the
+         * correct vCPU.
+         */
+        vgic_inject_irq(v->domain, private ? v : NULL, irq, true);
+    }
+}
+
 bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
                  int virq, const struct sgi_target *target)
 {
diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index 447d24ea59..037c99f27a 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -288,6 +288,8 @@ extern struct vgic_irq_rank *vgic_rank_offset(struct vcpu *v, int b, int n, int
 extern struct vgic_irq_rank *vgic_rank_irq(struct vcpu *v, unsigned int irq);
 extern void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n);
 extern void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n);
+extern void vgic_set_irqs_pending(struct vcpu *v, uint32_t r,
+                                  unsigned int rank);
 extern void register_vgic_ops(struct domain *d, const struct vgic_ops *ops);
 int vgic_v2_init(struct domain *d, int *mmio_count);
 int vgic_v3_init(struct domain *d, int *mmio_count);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Sun Mar 21 19:02:05 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 21 Mar 2021 19:02:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99827.189874 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lO3Kv-0001Gw-LZ; Sun, 21 Mar 2021 19:02:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99827.189874; Sun, 21 Mar 2021 19:02: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 1lO3Kv-0001Go-I8; Sun, 21 Mar 2021 19:02:05 +0000
Received: by outflank-mailman (input) for mailman id 99827;
 Sun, 21 Mar 2021 19:02: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 1lO3Kt-0001Gd-OQ
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:02: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 1lO3Kt-000795-Na
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:02:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lO3Kt-0006c8-Mt
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 19:02: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=CO15kdUwaRDvahg6Ndit/ZO1m/qko3WaebiL6OEKkSk=; b=szQpVGc2G+WCys4B4hyfNvPWVS
	4SVKOpffVKJ4J/SRYQC5HlSnxZHl7GnpBsN5rphRzMaiQbOv4AYS2ftiVnB8PtTpvY+uOHyGDEHLM
	pX1SPfwwrD7FecXwirK603hfVPZytMvgJuXIsZVLxuLZt1RywGAFWOujbVhZlzi4gxvk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] SUPPORT.MD: Clarify the support state for the Arm SMMUv{1, 2} drivers
Message-Id: <E1lO3Kt-0006c8-Mt@xenbits.xenproject.org>
Date: Sun, 21 Mar 2021 19:02:03 +0000

commit d705cba5ae917aece3921f38df1bc0a579267d12
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Wed Sep 23 09:28:32 2020 +0100
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:20:52 2021 -0700

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

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


From xen-changelog-bounces@lists.xenproject.org Sun Mar 21 23:11:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 21 Mar 2021 23:11:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99898.190064 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lO7Dr-0007rQ-8a; Sun, 21 Mar 2021 23:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99898.190064; Sun, 21 Mar 2021 23: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 1lO7Dr-0007rI-5o; Sun, 21 Mar 2021 23:11:03 +0000
Received: by outflank-mailman (input) for mailman id 99898;
 Sun, 21 Mar 2021 23: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 1lO7Dq-0007rD-7E
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 23: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 1lO7Dq-0002nh-5A
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 23:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lO7Dq-0004VN-31
 for xen-changelog@lists.xenproject.org; Sun, 21 Mar 2021 23: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=jkOyCGO+JOPB5NulChfiG3oY8bz3FUh1vaIGpkV1S0k=; b=u5n48DLYEervS3wR6PCKxqoUnf
	u3Tll465r95wEI2kFzG6i2+a8chslKZBXsj0bI3jk5blwpgIpbEeKnECIPwh5GcarmRorGBmN+J04
	V336YaXaZh9NhCPLxTQOk7IfENVEm1RsKhKOfWgYyhwO7pTiumf2Cwz8JyhAu2eN1Qrs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] SUPPORT.MD: Clarify the support state for the Arm SMMUv{1, 2} drivers
Message-Id: <E1lO7Dq-0004VN-31@xenbits.xenproject.org>
Date: Sun, 21 Mar 2021 23:11:02 +0000

commit 8bce4698f6264f4b359643233b1878d0f61ed7b0
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Wed Sep 23 09:28:32 2020 +0100
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:27:05 2021 -0700

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

diff --git a/SUPPORT.md b/SUPPORT.md
index 0c5bb6d4bc..8a28a4c0e9 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -56,8 +56,8 @@ Release Notes
 
     Status, AMD IOMMU: Supported
     Status, Intel VT-d: Supported
-    Status, ARM SMMUv1: Supported
-    Status, ARM SMMUv2: Supported
+    Status, ARM SMMUv1: Supported, not security supported
+    Status, ARM SMMUv2: Supported, not security supported
 
 ### ARM/GICv3 ITS
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Mon Mar 22 04:33:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Mar 2021 04:33:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99959.190234 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lOCFT-0007E9-Sc; Mon, 22 Mar 2021 04:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99959.190234; Mon, 22 Mar 2021 04: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 1lOCFT-0007E1-OR; Mon, 22 Mar 2021 04:33:03 +0000
Received: by outflank-mailman (input) for mailman id 99959;
 Mon, 22 Mar 2021 04:33: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 1lOCFS-0007Dw-VP
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:33: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 1lOCFS-0002kA-Ti
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lOCFS-0005OT-RO
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04: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=2v1O6RHxQlCFAkzWw8v+u+VC9Az5MWV7tRWSUTYcbeU=; b=0uGsKkJs2YC4vUSIH77W/I2iBZ
	kREUTYH0uVgbMDkqV+8DTf1cD0qXaAAirMRiJFcL0SajN6WL7Xq4+qM2FdguuVjqfN2EPEbg2pXEj
	G9OuyJRPtSvC0bEM0ooIIWrweUXPQsZx4c9XCj69tjmXSGAV3+EHWmmXqO4avv1OWDj8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/ucode/amd: Fix microcode payload size for Fam19 processors
Message-Id: <E1lOCFS-0005OT-RO@xenbits.xenproject.org>
Date: Mon, 22 Mar 2021 04:33:02 +0000

commit 93fbbb3b10daf58d2aa8e7c21bc31e0c4de59a61
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 19 15:33:15 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 19 15:33:15 2021 +0100

    x86/ucode/amd: Fix microcode payload size for Fam19 processors
    
    The original limit provided wasn't accurate.  Blobs are in fact rather larger.
    
    Fixes: fe36a173d1 ("x86/amd: Initial support for Fam19h processors")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 90b014a6e6ecad036ec5846426afd19b305dedff
    master date: 2021-02-10 13:23:51 +0000
---
 xen/arch/x86/cpu/microcode/amd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 5b45530d93..5eb93195c3 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -111,7 +111,7 @@ static bool_t verify_patch_size(uint32_t patch_size)
 #define F15H_MPB_MAX_SIZE 4096
 #define F16H_MPB_MAX_SIZE 3458
 #define F17H_MPB_MAX_SIZE 3200
-#define F19H_MPB_MAX_SIZE 4800
+#define F19H_MPB_MAX_SIZE 5568
 
     switch (boot_cpu_data.x86)
     {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Mar 22 04:33:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Mar 2021 04:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99960.190237 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lOCFe-0007F1-Sy; Mon, 22 Mar 2021 04:33:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99960.190237; Mon, 22 Mar 2021 04:33: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 1lOCFe-0007Et-Q4; Mon, 22 Mar 2021 04:33:14 +0000
Received: by outflank-mailman (input) for mailman id 99960;
 Mon, 22 Mar 2021 04:33: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 1lOCFd-0007Ei-5L
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:33: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 1lOCFd-0002kJ-0j
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:33:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lOCFc-0005Ox-W7
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oXFRrTgZLx21RxLq6a5qYoFwVFHo1nQe0nm8e/un49g=; b=F3Uz5RJxHwC5az+rT8+qut6pLA
	X1IEZIaLGzQKQxtBwfVJi2KOmgGmgmsUSjKHoO7YUhMS/LWytWgOY0KpI4WTyiSl4fTRQNBQmaQaQ
	G4hySnXIVlhKl5s+LO0kb59XTY5mVmu7539epTvCe+GjSYSmt1TpsqgRt7dm63Ct9V3Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] xen/arm: Document the erratum #853709 related to Cortex A72
Message-Id: <E1lOCFc-0005Ox-W7@xenbits.xenproject.org>
Date: Mon, 22 Mar 2021 04:33:12 +0000

commit f43374f8c3af637f245d4ea2625bf98f1a7af84c
Author:     Michal Orzel <michal.orzel@arm.com>
AuthorDate: Wed Oct 14 12:05:41 2020 +0200
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:31:25 2021 -0700

    xen/arm: Document the erratum #853709 related to Cortex A72
    
    The Cortex-A72 erratum #853709 is the same as the Cortex-A57
    erratum #852523. As the latter is already workaround, we only
    need to update the documentation.
    
    Signed-off-by: Michal Orzel <michal.orzel@arm.com>
    [julieng: Reworded the commit message]
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    (cherry picked from commit f776e5fb3ee699745f6442ec8c47d0fa647e0575)
---
 docs/misc/arm/silicon-errata.txt | 1 +
 xen/arch/arm/domain.c            | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index e15d0923e9..1f18a9df58 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -50,6 +50,7 @@ stable hypervisors.
 | ARM            | Cortex-A57      | #834220         | ARM64_ERRATUM_834220    |
 | ARM            | Cortex-A57      | #1319537        | N/A                     |
 | ARM            | Cortex-A72      | #1319367        | N/A                     |
+| ARM            | Cortex-A72      | #853709         | N/A                     |
 | ARM            | Cortex-A76      | #1165522        | N/A                     |
 | ARM            | Neoverse-N1     | #1165522        | N/A
 | ARM            | MMU-500         | #842869         | N/A                     |
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index ac6a419f55..c94d2f48f1 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -216,7 +216,8 @@ static void ctxt_switch_to(struct vcpu *n)
     WRITE_SYSREG64(n->arch.ttbr1, TTBR1_EL1);
 
     /*
-     * Erratum #852523: DACR32_EL2 must be restored before one of the
+     * Erratum #852523 (Cortex-A57) or erratum #853709 (Cortex-A72):
+     * DACR32_EL2 must be restored before one of the
      * following sysregs: SCTLR_EL1, TCR_EL1, TTBR0_EL1, TTBR1_EL1 or
      * CONTEXTIDR_EL1.
      */
@@ -245,7 +246,8 @@ static void ctxt_switch_to(struct vcpu *n)
 
     /*
      * This write to sysreg CONTEXTIDR_EL1 ensures we don't hit erratum
-     * #852523. I.e DACR32_EL2 is not correctly synchronized.
+     * #852523 (Cortex-A57) or #853709 (Cortex-A72).
+     * I.e DACR32_EL2 is not correctly synchronized.
      */
     WRITE_SYSREG(n->arch.contextidr, CONTEXTIDR_EL1);
     WRITE_SYSREG(n->arch.tpidr_el0, TPIDR_EL0);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Mar 22 04:33:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Mar 2021 04:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99961.190241 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lOCFo-0007Gj-Us; Mon, 22 Mar 2021 04:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99961.190241; Mon, 22 Mar 2021 04:33: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 1lOCFo-0007Gb-Rc; Mon, 22 Mar 2021 04:33:24 +0000
Received: by outflank-mailman (input) for mailman id 99961;
 Mon, 22 Mar 2021 04:33: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 1lOCFn-0007GP-6O
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:33: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 1lOCFn-0002kR-5W
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:33:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lOCFn-0005PN-3J
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:33: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=o02eWHmFCy6qtw8zRI+yDl/D7QLNoY6yntRHqWmrWSY=; b=PmjsCFm0c8YZUnpJ8qRZYaifeW
	KhPhTpenNsdBjUQZHl5iDlUscKhZJ2blMXR3XiqCSmkqkJbZH47fN0HNaHzZ/IMPBVX/08auECk1Y
	rVv7+9BH/fnhIGb6j8GOBmC2bAfvhm9XXkl/o4w2K+jMyRMdH8xYTJyIceD2aIvyT3Ck=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] xen/arm: Add Cortex-A73 erratum 858921 workaround
Message-Id: <E1lOCFn-0005PN-3J@xenbits.xenproject.org>
Date: Mon, 22 Mar 2021 04:33:23 +0000

commit 2c46385e5ac44276cdb5d17da3e8ede6cd1f50f1
Author:     Penny Zheng <penny.zheng@arm.com>
AuthorDate: Mon Nov 9 16:21:10 2020 +0800
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:32:42 2021 -0700

    xen/arm: Add Cortex-A73 erratum 858921 workaround
    
    CNTVCT_EL0 or CNTPCT_EL0 counter read in Cortex-A73 (all versions)
    might return a wrong value when the counter crosses a 32bit boundary.
    
    Until now, there is no case for Xen itself to access CNTVCT_EL0,
    and it also should be the Guest OS's responsibility to deal with
    this part.
    
    But for CNTPCT, there exists several cases in Xen involving reading
    CNTPCT, so a possible workaround is that performing the read twice,
    and to return one or the other depending on whether a transition has
    taken place.
    
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Reviewed-by: Wei Chen <Wei.Chen@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 5505f5f8e7e805365cfe70b6a4af6115940bb749)
---
 docs/misc/arm/silicon-errata.txt |  1 +
 xen/arch/arm/Kconfig             | 18 ++++++++++++++++++
 xen/arch/arm/cpuerrata.c         |  8 ++++++++
 xen/arch/arm/vtimer.c            |  2 +-
 xen/include/asm-arm/cpuerrata.h  |  2 ++
 xen/include/asm-arm/cpufeature.h |  3 ++-
 xen/include/asm-arm/time.h       | 22 +++++++++++++++++++++-
 7 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index 1f18a9df58..552c4151d3 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -51,6 +51,7 @@ stable hypervisors.
 | ARM            | Cortex-A57      | #1319537        | N/A                     |
 | ARM            | Cortex-A72      | #1319367        | N/A                     |
 | ARM            | Cortex-A72      | #853709         | N/A                     |
+| ARM            | Cortex-A73      | #858921         | ARM_ERRATUM_858921      |
 | ARM            | Cortex-A76      | #1165522        | N/A                     |
 | ARM            | Neoverse-N1     | #1165522        | N/A
 | ARM            | MMU-500         | #842869         | N/A                     |
diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 2777388265..f938dd21bd 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -226,6 +226,24 @@ config ARM64_ERRATUM_834220
 
 	  If unsure, say Y.
 
+config ARM_ERRATUM_858921
+	bool "Cortex-A73: 858921: Possible wrong read value for CNTVCT or CNTPCT"
+	default y
+	help
+	  This option adds an alternative code sequence to work around ARM
+	  erratum 858921 on Cortex-A73 (all versions).
+
+	  Affected Cortex-A73 might return wrong read value for CNTVCT or CNTPCT
+	  when the counter crosses a 32bit boundary.
+
+	  The workaround involves performing the read twice, and to return
+	  one or the other value depending on whether a transition has taken place.
+	  Please note that this does not necessarily enable the workaround,
+	  as it depends on the alternative framework, which will only patch
+	  the kernel if an affected CPU is detected.
+
+	  If unsure, say Y.
+
 endmenu
 
 config ARM64_HARDEN_BRANCH_PREDICTOR
diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
index 6c09017515..739d302c54 100644
--- a/xen/arch/arm/cpuerrata.c
+++ b/xen/arch/arm/cpuerrata.c
@@ -475,6 +475,14 @@ static const struct arm_cpu_capabilities arm_errata[] = {
         .capability = ARM_SSBD,
         .matches = has_ssbd_mitigation,
     },
+#endif
+#ifdef CONFIG_ARM_ERRATUM_858921
+    {
+        /* Cortex-A73 (all versions) */
+        .desc = "ARM erratum 858921",
+        .capability = ARM_WORKAROUND_858921,
+        MIDR_ALL_VERSIONS(MIDR_CORTEX_A73),
+    },
 #endif
     {
         /* Neoverse r0p0 - r2p0 */
diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 6d39fc944f..c2b27915c6 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -62,7 +62,7 @@ static void virt_timer_expired(void *data)
 
 int domain_vtimer_init(struct domain *d, struct xen_arch_domainconfig *config)
 {
-    d->arch.virt_timer_base.offset = READ_SYSREG64(CNTPCT_EL0);
+    d->arch.virt_timer_base.offset = get_cycles();
     d->time_offset.seconds = ticks_to_ns(d->arch.virt_timer_base.offset - boot_count);
     do_div(d->time_offset.seconds, 1000000000);
 
diff --git a/xen/include/asm-arm/cpuerrata.h b/xen/include/asm-arm/cpuerrata.h
index 88ef3ca934..8d7e7b9375 100644
--- a/xen/include/asm-arm/cpuerrata.h
+++ b/xen/include/asm-arm/cpuerrata.h
@@ -28,6 +28,8 @@ static inline bool check_workaround_##erratum(void)             \
 CHECK_WORKAROUND_HELPER(766422, ARM32_WORKAROUND_766422, CONFIG_ARM_32)
 CHECK_WORKAROUND_HELPER(834220, ARM64_WORKAROUND_834220, CONFIG_ARM_64)
 CHECK_WORKAROUND_HELPER(ssbd, ARM_SSBD, CONFIG_ARM_SSBD)
+CHECK_WORKAROUND_HELPER(858921, ARM_WORKAROUND_858921,
+                        CONFIG_ARM_ERRATUM_858921)
 
 #undef CHECK_WORKAROUND_HELPER
 
diff --git a/xen/include/asm-arm/cpufeature.h b/xen/include/asm-arm/cpufeature.h
index 10878ead8a..016a9fe203 100644
--- a/xen/include/asm-arm/cpufeature.h
+++ b/xen/include/asm-arm/cpufeature.h
@@ -45,8 +45,9 @@
 #define ARM_SSBD 7
 #define ARM_SMCCC_1_1 8
 #define ARM64_WORKAROUND_AT_SPECULATE 9
+#define ARM_WORKAROUND_858921 10
 
-#define ARM_NCAPS           10
+#define ARM_NCAPS           11
 
 #ifndef __ASSEMBLY__
 
diff --git a/xen/include/asm-arm/time.h b/xen/include/asm-arm/time.h
index 9cb6f9b0b4..1b2c13614b 100644
--- a/xen/include/asm-arm/time.h
+++ b/xen/include/asm-arm/time.h
@@ -3,6 +3,7 @@
 
 #include <asm/sysregs.h>
 #include <asm/system.h>
+#include <asm/cpuerrata.h>
 
 #define DT_MATCH_TIMER                      \
     DT_MATCH_COMPATIBLE("arm,armv7-timer"), \
@@ -13,7 +14,26 @@ typedef uint64_t cycles_t;
 static inline cycles_t get_cycles (void)
 {
         isb();
-        return READ_SYSREG64(CNTPCT_EL0);
+        /*
+         * ARM_WORKAROUND_858921: Cortex-A73 (all versions) counter read
+         * can return a wrong value when the counter crosses a 32bit boundary.
+         */
+        if ( !check_workaround_858921() )
+            return READ_SYSREG64(CNTPCT_EL0);
+        else
+        {
+            /*
+             * A recommended workaround for erratum 858921 is to:
+             *  1- Read twice CNTPCT.
+             *  2- Compare bit[32] of the two read values.
+             *      - If bit[32] is different, keep the old value.
+             *      - If bit[32] is the same, keep the new value.
+             */
+            cycles_t old, new;
+            old = READ_SYSREG64(CNTPCT_EL0);
+            new = READ_SYSREG64(CNTPCT_EL0);
+            return (((old ^ new) >> 32) & 1) ? old : new;
+        }
 }
 
 /* List of timer's IRQ */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Mar 22 04:33:35 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Mar 2021 04:33:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99962.190245 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lOCFz-0007I0-0A; Mon, 22 Mar 2021 04:33:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99962.190245; Mon, 22 Mar 2021 04:33: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 1lOCFy-0007Hr-TJ; Mon, 22 Mar 2021 04:33:34 +0000
Received: by outflank-mailman (input) for mailman id 99962;
 Mon, 22 Mar 2021 04:33: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 1lOCFx-0007Hg-9k
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:33: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 1lOCFx-0002ku-8w
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:33:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lOCFx-0005Po-7x
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:33: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=dj+eXWIeiQ8oPUhYBIbUwTESQ2uMVRnEoTpBvsdupcc=; b=EIneLe5/pa64rW9xUq1Sc+N3w/
	EOxJ+9BdiHwCtFvpigQX1k5m9BpyL0I8FuYXIvbNoJP8pByTERH/q+iricBfNMq7d8t6XRoUqe+UL
	A91W6ETTsstRfTjFoEO4E0TnouQVwUYQooiZWtPjZfNij7dunyBMbdfVNx9Iuv2dfUSA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] xen/arm: Add workaround for Cortex-A55 erratum #1530923
Message-Id: <E1lOCFx-0005Po-7x@xenbits.xenproject.org>
Date: Mon, 22 Mar 2021 04:33:33 +0000

commit 8d6755fb4466a0c9af6c8953392327022ec61428
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Tue Nov 24 11:12:15 2020 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:33:12 2021 -0700

    xen/arm: Add workaround for Cortex-A55 erratum #1530923
    
    On the Cortex A55, TLB entries can be allocated by a speculative AT
    instruction. If this is happening during a guest context switch with an
    inconsistent page table state in the guest, TLBs with wrong values might
    be allocated.
    The ARM64_WORKAROUND_AT_SPECULATE workaround is used as for erratum
    1165522 on Cortex A76 or Neoverse N1.
    
    This change is also introducing the MIDR identifier for the Cortex-A55.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Rahul Singh <rahul.singh@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit fd7479b9aec25885cc17d33b326b9babae59faee)
---
 docs/misc/arm/silicon-errata.txt | 1 +
 xen/arch/arm/cpuerrata.c         | 6 ++++++
 xen/include/asm-arm/processor.h  | 2 ++
 3 files changed, 9 insertions(+)

diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index 552c4151d3..a15290285f 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -45,6 +45,7 @@ stable hypervisors.
 | ARM            | Cortex-A53      | #827319         | ARM64_ERRATUM_827319    |
 | ARM            | Cortex-A53      | #824069         | ARM64_ERRATUM_824069    |
 | ARM            | Cortex-A53      | #819472         | ARM64_ERRATUM_819472    |
+| ARM            | Cortex-A55      | #1530923        | N/A                     |
 | ARM            | Cortex-A57      | #852523         | N/A                     |
 | ARM            | Cortex-A57      | #832075         | ARM64_ERRATUM_832075    |
 | ARM            | Cortex-A57      | #834220         | ARM64_ERRATUM_834220    |
diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
index 739d302c54..66d9a1e45c 100644
--- a/xen/arch/arm/cpuerrata.c
+++ b/xen/arch/arm/cpuerrata.c
@@ -506,6 +506,12 @@ static const struct arm_cpu_capabilities arm_errata[] = {
         .capability = ARM64_WORKAROUND_AT_SPECULATE,
         MIDR_ALL_VERSIONS(MIDR_CORTEX_A57),
     },
+    {
+        /* Cortex-A55 (All versions as erratum is open in SDEN v14) */
+        .desc = "ARM erratum 1530923",
+        .capability = ARM64_WORKAROUND_AT_SPECULATE,
+        MIDR_ALL_VERSIONS(MIDR_CORTEX_A55),
+    },
     {},
 };
 
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index d3d12a9d19..87c8136022 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -53,6 +53,7 @@
 #define ARM_CPU_PART_CORTEX_A17     0xC0E
 #define ARM_CPU_PART_CORTEX_A15     0xC0F
 #define ARM_CPU_PART_CORTEX_A53     0xD03
+#define ARM_CPU_PART_CORTEX_A55     0xD05
 #define ARM_CPU_PART_CORTEX_A57     0xD07
 #define ARM_CPU_PART_CORTEX_A72     0xD08
 #define ARM_CPU_PART_CORTEX_A73     0xD09
@@ -64,6 +65,7 @@
 #define MIDR_CORTEX_A17 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A17)
 #define MIDR_CORTEX_A15 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A15)
 #define MIDR_CORTEX_A53 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A53)
+#define MIDR_CORTEX_A55 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A55)
 #define MIDR_CORTEX_A57 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A57)
 #define MIDR_CORTEX_A72 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A72)
 #define MIDR_CORTEX_A73 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A73)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Mar 22 04:33:45 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Mar 2021 04:33:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99963.190249 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lOCG9-0007JM-1v; Mon, 22 Mar 2021 04:33:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99963.190249; Mon, 22 Mar 2021 04:33: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 1lOCG8-0007JE-Ur; Mon, 22 Mar 2021 04:33:44 +0000
Received: by outflank-mailman (input) for mailman id 99963;
 Mon, 22 Mar 2021 04:33: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 1lOCG7-0007J2-EZ
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:33: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 1lOCG7-0002l4-DL
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:33:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lOCG7-0005QS-BW
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:33:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UzkVtX9pPGkKmI1ExxrP6PWGEQrGo3dYMb6oEeipXNU=; b=KmO+ICLf9KhhDYuREEZn6Cs6p8
	w0vMwNYp6e2Caae5w3M68wmETTgDvjzOdYLB1PasaZD1fpeKlCKaccMy38Jhr/tMLgPWEdcy6SwLw
	+M6kfS/Swb1zxd/Lo1yi/DkOyBRNtJ2xlQ6QasMkq7LFJDwERXFlGArQ/wUNUM4hYlX0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] xen/arm: Add workaround for Cortex-A53 erratum #843419
Message-Id: <E1lOCG7-0005QS-BW@xenbits.xenproject.org>
Date: Mon, 22 Mar 2021 04:33:43 +0000

commit a8a6736c976f1ab14439952bd78dfd5bf3daffe9
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Thu Dec 10 10:42:58 2020 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:33:22 2021 -0700

    xen/arm: Add workaround for Cortex-A53 erratum #843419
    
    On the Cortex A53, when executing in AArch64 state, a load or store instruction
    which uses the result of an ADRP instruction as a base register, or which uses
    a base register written by an instruction immediately after an ADRP to the
    same register, might access an incorrect address.
    
    The workaround is to enable the linker flag --fix-cortex-a53-843419
    if present, to check and fix the affected sequence. Otherwise print a warning
    that Xen may be susceptible to this errata
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit d81133d45d81d35a4e7445778bfd1179190cbd31)
---
 docs/misc/arm/silicon-errata.txt |  1 +
 xen/arch/arm/Kconfig             | 19 +++++++++++++++++++
 xen/arch/arm/Makefile            |  8 ++++++++
 xen/scripts/Kbuild.include       | 12 ++++++++++++
 4 files changed, 40 insertions(+)

diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index a15290285f..67f9f3b395 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -45,6 +45,7 @@ stable hypervisors.
 | ARM            | Cortex-A53      | #827319         | ARM64_ERRATUM_827319    |
 | ARM            | Cortex-A53      | #824069         | ARM64_ERRATUM_824069    |
 | ARM            | Cortex-A53      | #819472         | ARM64_ERRATUM_819472    |
+| ARM            | Cortex-A53      | #843419         | ARM64_ERRATUM_843419    |
 | ARM            | Cortex-A55      | #1530923        | N/A                     |
 | ARM            | Cortex-A57      | #852523         | N/A                     |
 | ARM            | Cortex-A57      | #832075         | ARM64_ERRATUM_832075    |
diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index f938dd21bd..3a17c9e319 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -186,6 +186,25 @@ config ARM64_ERRATUM_819472
 
 	  If unsure, say Y.
 
+config ARM64_ERRATUM_843419
+	bool "Cortex-A53: 843419: A load or store might access an incorrect address"
+	default y
+	depends on ARM_64
+	help
+	  This option adds an alternative code sequence to work around ARM
+	  erratum 843419 on Cortex-A53 parts up to r0p4.
+
+	  When executing in AArch64 state, a load or store instruction which uses
+	  the result of an ADRP instruction as a base register, or which uses a
+	  base register written by an instruction immediately after an ADRP to the
+	  same register, might access an incorrect address.
+
+	  The workaround enables the linker to check if the affected sequence is
+	  produced and it will fix it with an alternative not affected sequence
+	  that produce the same behavior.
+
+	  If unsure, say Y.
+
 config ARM64_ERRATUM_832075
 	bool "Cortex-A57: 832075: possible deadlock on mixing exclusive memory accesses with device loads"
 	default y
diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 1ded44d200..ced90495ce 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -101,6 +101,14 @@ prelink.o: $(ALL_OBJS) FORCE
 	$(call if_changed,ld)
 endif
 
+ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
+    ifeq ($(call ld-option, --fix-cortex-a53-843419),n)
+        $(warning ld does not support --fix-cortex-a53-843419; xen may be susceptible to erratum)
+    else
+        XEN_LDFLAGS += --fix-cortex-a53-843419
+    endif
+endif
+
 targets += prelink.o
 
 $(TARGET)-syms: prelink.o xen.lds
diff --git a/xen/scripts/Kbuild.include b/xen/scripts/Kbuild.include
index e62eddc365..83c7e1457b 100644
--- a/xen/scripts/Kbuild.include
+++ b/xen/scripts/Kbuild.include
@@ -43,6 +43,18 @@ define as-option-add-closure
     endif
 endef
 
+# $(if-success,<command>,<then>,<else>)
+# Return <then> if <command> exits with 0, <else> otherwise.
+if-success = $(shell { $(1); } >/dev/null 2>&1 && echo "$(2)" || echo "$(3)")
+
+# $(success,<command>)
+# Return y if <command> exits with 0, n otherwise
+success = $(call if-success,$(1),y,n)
+
+# $(ld-option,<flag>)
+# Return y if the linker supports <flag>, n otherwise
+ld-option = $(call success,$(LD) -v $(1))
+
 # cc-ifversion
 # Usage:  EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
 cc-ifversion = $(shell [ $(CONFIG_GCC_VERSION)0 $(1) $(2)000 ] && echo $(3) || echo $(4))
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Mar 22 04:33:55 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Mar 2021 04:33:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99964.190252 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lOCGJ-0007Kn-4U; Mon, 22 Mar 2021 04:33:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99964.190252; Mon, 22 Mar 2021 04:33: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 1lOCGJ-0007Kf-1f; Mon, 22 Mar 2021 04:33:55 +0000
Received: by outflank-mailman (input) for mailman id 99964;
 Mon, 22 Mar 2021 04:33: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 1lOCGH-0007KW-If
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:33: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 1lOCGH-0002lC-Gr
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:33:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lOCGH-0005Qu-Ft
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:33:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Q2sWAC4llvWX+JqaDY0r+ygON9NcYl54cPFX86s5z5U=; b=OjiyCCO7ThDwwA6QUHPN6LNEPq
	VrDRBQd3rQx+hpvH6hdlVD2ErE4V3jooJH8kBicZN4nbpRbfOdFjv38Am7SbaF51SN/TbTDieIXqz
	CcSZ6QdIfZqflDFljLZRAiXuELXNyKBADGDrmmceoJUaOy1Xe5u8vf6uvTEEdHGa8G0Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] xen/arm: mm: Remove ; at the end of mm_printk()
Message-Id: <E1lOCGH-0005Qu-Ft@xenbits.xenproject.org>
Date: Mon, 22 Mar 2021 04:33:53 +0000

commit b22b824f2eac90e1f2cac1df407c2e853aa997ed
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Nov 19 19:07:47 2020 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:34:19 2021 -0700

    xen/arm: mm: Remove ; at the end of mm_printk()
    
    The ; at the end of mm_printk() means the following code will not build
    correctly:
    
    if ( ... )
        mm_printk(...);
    else
        ...
    
    As we treat the macro as a function, we want to remove the ; at the end
    of it.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    (cherry picked from commit bfe67a17d4df2efbedaaf5cfbadc8a8627debf5c)
---
 xen/arch/arm/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 4aba9015b9..38200e2533 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -59,7 +59,7 @@ mm_printk(const char *fmt, ...) {}
     {                                       \
         dprintk(XENLOG_ERR, fmt, ## args);  \
         WARN();                             \
-    } while (0);
+    } while (0)
 #endif
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Mar 22 04:34:05 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Mar 2021 04:34:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99965.190257 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lOCGT-0007M6-6A; Mon, 22 Mar 2021 04:34:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99965.190257; Mon, 22 Mar 2021 04:34: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 1lOCGT-0007Ly-3D; Mon, 22 Mar 2021 04:34:05 +0000
Received: by outflank-mailman (input) for mailman id 99965;
 Mon, 22 Mar 2021 04:34: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 1lOCGR-0007Lo-L8
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:34: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 1lOCGR-0002lX-KH
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:34:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lOCGR-0005T0-JN
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:34: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=2WiUvegEbK1fudPRkno5Nj6i6rN0hjvIOePBFFEsgLI=; b=0NVn8oeoahYTxOWQv2GY4iPDuq
	bLJokt3ZOJ/gkbNQ+Y5wdUDJzWtzPQjdwiHh7cXDMC6DLIqTwMD7lB8s52z4q6JTPODFds5CtIzva
	S8jnAWqaREX3xXSd2r8YUa5bAZTJmmA4FMCjhzh4JbldOVZQcOUOrGyn406oBQfEdPuU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] xen/vgic: Implement write to ISPENDR in vGICv{2, 3}
Message-Id: <E1lOCGR-0005T0-JN@xenbits.xenproject.org>
Date: Mon, 22 Mar 2021 04:34:03 +0000

commit 679907201145ad9b74984cce961f1706b07cb0ac
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Sat Feb 20 14:04:12 2021 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:34:43 2021 -0700

    xen/vgic: Implement write to ISPENDR in vGICv{2, 3}
    
    Currently, Xen will send a data abort to a guest trying to write to the
    ISPENDR.
    
    Unfortunately, recent version of Linux (at least 5.9+) will start
    writing to the register if the interrupt needs to be re-triggered
    (see the callback irq_retrigger). This can happen when a driver (such as
    the xgbe network driver on AMD Seattle) re-enable an interrupt:
    
    (XEN) d0v0: vGICD: unhandled word write 0x00000004000000 to ISPENDR44
    [...]
    [   25.635837] Unhandled fault at 0xffff80001000522c
    [...]
    [   25.818716]  gic_retrigger+0x2c/0x38
    [   25.822361]  irq_startup+0x78/0x138
    [   25.825920]  __enable_irq+0x70/0x80
    [   25.829478]  enable_irq+0x50/0xa0
    [   25.832864]  xgbe_one_poll+0xc8/0xd8
    [   25.836509]  net_rx_action+0x110/0x3a8
    [   25.840328]  __do_softirq+0x124/0x288
    [   25.844061]  irq_exit+0xe0/0xf0
    [   25.847272]  __handle_domain_irq+0x68/0xc0
    [   25.851442]  gic_handle_irq+0xa8/0xe0
    [   25.855171]  el1_irq+0xb0/0x180
    [   25.858383]  arch_cpu_idle+0x18/0x28
    [   25.862028]  default_idle_call+0x24/0x5c
    [   25.866021]  do_idle+0x204/0x278
    [   25.869319]  cpu_startup_entry+0x24/0x68
    [   25.873313]  rest_init+0xd4/0xe4
    [   25.876611]  arch_call_rest_init+0x10/0x1c
    [   25.880777]  start_kernel+0x5b8/0x5ec
    
    As a consequence, the OS may become unusable.
    
    Implementing the write part of ISPENDR is somewhat easy. For
    virtual interrupt, we only need to inject the interrupt again.
    
    For physical interrupt, we need to be more careful as the de-activation
    of the virtual interrupt will be propagated to the physical distributor.
    For simplicity, the physical interrupt will be set pending so the
    workflow will not differ from a "real" interrupt.
    
    Longer term, we could possible directly activate the physical interrupt
    and avoid taking an exception to inject the interrupt to the domain.
    (This is the approach taken by the new vGIC based on KVM).
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit 067935804a8e7a33ff7170a2db8ce94bb46d9a63)
---
 xen/arch/arm/vgic-v2.c     | 10 ++++++----
 xen/arch/arm/vgic-v3.c     | 18 +++++++-----------
 xen/arch/arm/vgic.c        | 47 ++++++++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/vgic.h |  2 ++
 4 files changed, 62 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 64b141fea5..b2da886adc 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -472,10 +472,12 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        printk(XENLOG_G_ERR
-               "%pv: vGICD: unhandled word write %#"PRIregister" to ISPENDR%d\n",
-               v, r, gicd_reg - GICD_ISPENDR);
-        return 0;
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ISPENDR, DABT_WORD);
+        if ( rank == NULL ) goto write_ignore;
+
+        vgic_set_irqs_pending(v, r, rank->index);
+
+        return 1;
 
     case VRANGE32(GICD_ICPENDR, GICD_ICPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index fd8cfc156d..613f37abab 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -808,10 +808,12 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
 
     case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        printk(XENLOG_G_ERR
-               "%pv: %s: unhandled word write %#"PRIregister" to ISPENDR%d\n",
-               v, name, r, reg - GICD_ISPENDR);
-        return 0;
+        rank = vgic_rank_offset(v, 1, reg - GICD_ISPENDR, DABT_WORD);
+        if ( rank == NULL ) goto write_ignore;
+
+        vgic_set_irqs_pending(v, r, rank->index);
+
+        return 1;
 
     case VRANGE32(GICD_ICPENDR, GICD_ICPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
@@ -975,6 +977,7 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
     case VREG32(GICR_ICACTIVER0):
     case VREG32(GICR_ICFGR1):
     case VRANGE32(GICR_IPRIORITYR0, GICR_IPRIORITYR7):
+    case VREG32(GICR_ISPENDR0):
          /*
           * Above registers offset are common with GICD.
           * So handle common with GICD handling
@@ -982,13 +985,6 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
         return __vgic_v3_distr_common_mmio_write("vGICR: SGI", v,
                                                  info, gicr_reg, r);
 
-    case VREG32(GICR_ISPENDR0):
-        if ( dabt.size != DABT_WORD ) goto bad_width;
-        printk(XENLOG_G_ERR
-               "%pv: vGICR: SGI: unhandled word write %#"PRIregister" to ISPENDR0\n",
-               v, r);
-        return 0;
-
     case VREG32(GICR_ICPENDR0):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 82f524a35c..8f9400a519 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -423,6 +423,53 @@ void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
     }
 }
 
+void vgic_set_irqs_pending(struct vcpu *v, uint32_t r, unsigned int rank)
+{
+    const unsigned long mask = r;
+    unsigned int i;
+    /* The first rank is always per-vCPU */
+    bool private = rank == 0;
+
+    /* LPIs will never be set pending via this function */
+    ASSERT(!is_lpi(32 * rank + 31));
+
+    for_each_set_bit( i, &mask, 32 )
+    {
+        unsigned int irq = i + 32 * rank;
+
+        if ( !private )
+        {
+            struct pending_irq *p = spi_to_pending(v->domain, irq);
+
+            /*
+             * When the domain sets the pending state for a HW interrupt on
+             * the virtual distributor, we set the pending state on the
+             * physical distributor.
+             *
+             * XXX: Investigate whether we would be able to set the
+             * physical interrupt active and save an interruption. (This
+             * is what the new vGIC does).
+             */
+            if ( p->desc != NULL )
+            {
+                unsigned long flags;
+
+                spin_lock_irqsave(&p->desc->lock, flags);
+                gic_set_pending_state(p->desc, true);
+                spin_unlock_irqrestore(&p->desc->lock, flags);
+                continue;
+            }
+        }
+
+        /*
+         * If the interrupt is per-vCPU, then we want to inject the vIRQ
+         * to v, otherwise we should let the function figuring out the
+         * correct vCPU.
+         */
+        vgic_inject_irq(v->domain, private ? v : NULL, irq, true);
+    }
+}
+
 bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
                  int virq, const struct sgi_target *target)
 {
diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index ce1e3c4bbd..62c2ae538d 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -288,6 +288,8 @@ extern struct vgic_irq_rank *vgic_rank_offset(struct vcpu *v, int b, int n, int
 extern struct vgic_irq_rank *vgic_rank_irq(struct vcpu *v, unsigned int irq);
 extern void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n);
 extern void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n);
+extern void vgic_set_irqs_pending(struct vcpu *v, uint32_t r,
+                                  unsigned int rank);
 extern void register_vgic_ops(struct domain *d, const struct vgic_ops *ops);
 int vgic_v2_init(struct domain *d, int *mmio_count);
 int vgic_v3_init(struct domain *d, int *mmio_count);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Mar 22 04:34:15 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Mar 2021 04:34:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.99968.190275 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lOCGd-0007P8-Hp; Mon, 22 Mar 2021 04:34:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 99968.190275; Mon, 22 Mar 2021 04:34: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 1lOCGd-0007P0-El; Mon, 22 Mar 2021 04:34:15 +0000
Received: by outflank-mailman (input) for mailman id 99968;
 Mon, 22 Mar 2021 04:34: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 1lOCGb-0007Oe-PR
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:34: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 1lOCGb-0002lk-OZ
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:34:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lOCGb-0005To-Mn
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 04:34: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=PNhLQFgdw+V/LDU+uFv+YzoZuK+hq5Qa5Ly2zmc7174=; b=Yih8JhVbn8Ycn4wNLaYN6hfr6R
	ZtkirO7Ul6jjeOxNTCPZ9gZxzSwwDFaSJ7pMgLWQsg3cucGqp7o86ApZBs+jFhSQyTMQWRQoD5ryE
	joL6DDAOnRWku+B4NiQNJicEa91HRrxNV6mPwTy+oQ9eO5KvuqmfBnoGkeo4Esset6Jg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] SUPPORT.MD: Clarify the support state for the Arm SMMUv{1, 2} drivers
Message-Id: <E1lOCGb-0005To-Mn@xenbits.xenproject.org>
Date: Mon, 22 Mar 2021 04:34:13 +0000

commit ddb39ba714257debb9b66936abb0dd3039e85abd
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Wed Sep 23 09:28:32 2020 +0100
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Mar 19 12:35:22 2021 -0700

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

diff --git a/SUPPORT.md b/SUPPORT.md
index 8070b2df99..12e77ab66b 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -62,8 +62,8 @@ supported in this document.
 
     Status, AMD IOMMU: Supported
     Status, Intel VT-d: Supported
-    Status, ARM SMMUv1: Supported
-    Status, ARM SMMUv2: Supported
+    Status, ARM SMMUv1: Supported, not security supported
+    Status, ARM SMMUv2: Supported, not security supported
     Status, Renesas IPMMU-VMSA: Tech Preview
 
 ### ARM/GICv3 ITS
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Mar 22 10:44:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Mar 2021 10:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.100133.190586 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lOI2X-0001iV-To; Mon, 22 Mar 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 100133.190586; Mon, 22 Mar 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 1lOI2X-0001iN-Qp; Mon, 22 Mar 2021 10:44:05 +0000
Received: by outflank-mailman (input) for mailman id 100133;
 Mon, 22 Mar 2021 10:44: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 1lOI2X-0001iI-1J
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 10:44: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 1lOI2W-0001OV-UQ
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 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 1lOI2W-0003aF-RU
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 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=062s3PNTVauXUtaHi07wxmAUOBuXTNilv0ZOf+Mg75E=; b=PUCY+VJznYQkNzohryGU4Q0oil
	8eF/Obvwvl6sYRyW1JQ367SW0gsNh9539kwp8xELjExFzyPs0f5qGx5fW3yi8uo+tw+lO5wvjb9ab
	Eb7hpaNGWvM5fxu4kmI6uyFsQLqmEl7RTfWsPwHioKKQvxYNqouCZw+BipAHZQlKMW60=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] SUPPORT.MD: Mark LiveUpdate of C/OCaml xenstored daemon as Tech Preview
Message-Id: <E1lOI2W-0003aF-RU@xenbits.xenproject.org>
Date: Mon, 22 Mar 2021 10:44:04 +0000

commit ecdff2f5a03210119b71806c3f5571d6906dd85e
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Sat Mar 13 13:50:44 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Mar 22 10:40:23 2021 +0000

    SUPPORT.MD: Mark LiveUpdate of C/OCaml xenstored daemon as Tech Preview
    
    Support to liveupdate C/OCaml xenstored daemon was added during the
    4.15 development cycle. Add two new sections in SUPPORT.MD to explain
    what is the support state.
    
    For now, it is a tech preview.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 SUPPORT.md | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/SUPPORT.md b/SUPPORT.md
index 7db4568f1a..a1efd8fcfd 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -177,6 +177,14 @@ Support for running qemu-xen device model in a linux stubdomain.
 
     Status: Tech Preview
 
+## Liveupdate of C xenstored daemon
+
+    Status: Tech Preview
+
+## Liveupdate of OCaml xenstored daemon
+
+    Status: Tech Preview
+
 ## Toolstack/3rd party
 
 ### libvirt driver for xl
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Mar 22 17:00:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Mar 2021 17:00:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.100387.191229 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lONuP-0007i8-Dm; Mon, 22 Mar 2021 17:00:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 100387.191229; Mon, 22 Mar 2021 17:00: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 1lONuP-0007hj-AL; Mon, 22 Mar 2021 17:00:05 +0000
Received: by outflank-mailman (input) for mailman id 100387;
 Mon, 22 Mar 2021 17: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 1lONuO-0007dr-TD
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 17: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 1lONuO-0008IR-Q2
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 17:00:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lONuO-0007qh-NG
 for xen-changelog@lists.xenproject.org; Mon, 22 Mar 2021 17: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=SBah9klDdQSaZwuJwS4qzFyVH7/GuNpvM1FV7RY4FX8=; b=x3r8xPg+IJOqq+ad9/onYgxbv2
	LtAfOQegbkECpjI8fk8Y4+/DQdjdCn+uqHSX1Ts7o2uw2xSlwenE/IxVIEE+32tvMY39bEeXeXuUW
	7wcNenXHiVhAricopSOOh078bHE5zG7j4M+JzGPBr+Z4ivDDmjBEPE/j/uFJD7Yqfaqs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] update Xen version to 4.13.3
Message-Id: <E1lONuO-0007qh-NG@xenbits.xenproject.org>
Date: Mon, 22 Mar 2021 17:00:04 +0000

commit 57a60c1f2779ce6d6ab5c2f677c4d0c66b09b08b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Mar 22 17:57:42 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Mar 22 17:57:42 2021 +0100

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

diff --git a/Config.mk b/Config.mk
index 75f4eadbf9..53f2fa76e4 100644
--- a/Config.mk
+++ b/Config.mk
@@ -288,15 +288,15 @@ SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= 20d2e5a125e34fc8501026613a71549b2a1a3e54
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.13.2
-MINIOS_UPSTREAM_REVISION ?= xen-RELEASE-4.13.2
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.13.3
+MINIOS_UPSTREAM_REVISION ?= xen-RELEASE-4.13.3
 
 SEABIOS_UPSTREAM_REVISION ?= rel-1.12.1
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= xen-4.13.2
+QEMU_TRADITIONAL_REVISION ?= xen-4.13.3
 # Wed Oct 10 18:52:54 2018 +0000
 # xen/pt: allow QEMU to request MSI unmasking at bind time
 
diff --git a/xen/Makefile b/xen/Makefile
index 0fe43409a8..5dc4c51371 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 13
-export XEN_EXTRAVERSION ?= .3-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .3$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Tue Mar 23 10:22:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 23 Mar 2021 10:22:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.100627.191884 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lOeAl-0003aB-CR; Tue, 23 Mar 2021 10:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 100627.191884; Tue, 23 Mar 2021 10:22: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 1lOeAl-0003a2-93; Tue, 23 Mar 2021 10:22:03 +0000
Received: by outflank-mailman (input) for mailman id 100627;
 Tue, 23 Mar 2021 10: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 1lOeAj-0003Zw-Nj
 for xen-changelog@lists.xenproject.org; Tue, 23 Mar 2021 10: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 1lOeAj-000418-Lb
 for xen-changelog@lists.xenproject.org; Tue, 23 Mar 2021 10:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lOeAj-0005h7-KV
 for xen-changelog@lists.xenproject.org; Tue, 23 Mar 2021 10: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=Qa8R7sRwQObsqSXsHP3FwGNL6f0u8qEuUzPCU9qyDdM=; b=Ukho4KUeVMaMYxlZltEsn4tQvO
	Yz/oJxyvFoLxrtXrknqVsd6sSZKVmmBz6dk+wJe1ch9Sz80gC/GE0C1jaT9Lno2TkRZUzIZsQ7QXa
	DUvDIukJ+nrhVbuwwJTr9SFDMWi8gSQZ0FosleQsnpA0gVrU8+ShlNVXOGujgcjIEv1c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] update Xen version to 4.13.3
Message-Id: <E1lOeAj-0005h7-KV@xenbits.xenproject.org>
Date: Tue, 23 Mar 2021 10:22:01 +0000

commit 57a60c1f2779ce6d6ab5c2f677c4d0c66b09b08b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Mar 22 17:57:42 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Mar 22 17:57:42 2021 +0100

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

diff --git a/Config.mk b/Config.mk
index 75f4eadbf9..53f2fa76e4 100644
--- a/Config.mk
+++ b/Config.mk
@@ -288,15 +288,15 @@ SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= 20d2e5a125e34fc8501026613a71549b2a1a3e54
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.13.2
-MINIOS_UPSTREAM_REVISION ?= xen-RELEASE-4.13.2
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.13.3
+MINIOS_UPSTREAM_REVISION ?= xen-RELEASE-4.13.3
 
 SEABIOS_UPSTREAM_REVISION ?= rel-1.12.1
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= xen-4.13.2
+QEMU_TRADITIONAL_REVISION ?= xen-4.13.3
 # Wed Oct 10 18:52:54 2018 +0000
 # xen/pt: allow QEMU to request MSI unmasking at bind time
 
diff --git a/xen/Makefile b/xen/Makefile
index 0fe43409a8..5dc4c51371 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 13
-export XEN_EXTRAVERSION ?= .3-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .3$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Tue Mar 23 16:11:12 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 23 Mar 2021 16:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.100740.192119 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lOjcY-0007eN-LR; Tue, 23 Mar 2021 16:11:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 100740.192119; Tue, 23 Mar 2021 16: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 1lOjcY-0007eF-IK; Tue, 23 Mar 2021 16:11:06 +0000
Received: by outflank-mailman (input) for mailman id 100740;
 Tue, 23 Mar 2021 16: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 1lOjcX-0007eA-4h
 for xen-changelog@lists.xenproject.org; Tue, 23 Mar 2021 16: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 1lOjcX-0001xJ-3X
 for xen-changelog@lists.xenproject.org; Tue, 23 Mar 2021 16:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lOjcX-0003cq-1d
 for xen-changelog@lists.xenproject.org; Tue, 23 Mar 2021 16: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=/wpikp7ODqNivKGBc9mV4Bq0U3pOgQk6BMzcOoXREyc=; b=EZ6NJAklDPr12tfAYj3VnP+snj
	mdd7YAJ8otA8Udj927RN8zrVA/Eu8IBGxPPz2iarpjqFZXUABUVP0Sei4OvB9dR3ube+0UIketbIQ
	UF24+7/KRpQOFUc95LrmAjhwfFrxWDqxPse6pyuyzrHOBySa986xdOfNJNy9Q7q53Myo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] VT-d: correct off-by-1 in number-of-IOMMUs check
Message-Id: <E1lOjcX-0003cq-1d@xenbits.xenproject.org>
Date: Tue, 23 Mar 2021 16:11:05 +0000

commit b9b3082002cac68726fb303e0abd2ff0113d4657
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 23 17:01:30 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 23 17:01:30 2021 +0100

    VT-d: correct off-by-1 in number-of-IOMMUs check
    
    Otherwise, if we really run on a system with this many IOMMUs,
    entering/leaving S3 would overrun iommu_state[].
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/drivers/passthrough/vtd/iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 9b58d566c8..44e407d19f 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1168,10 +1168,10 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
     unsigned long sagaw, nr_dom;
     int agaw;
 
-    if ( nr_iommus > MAX_IOMMUS )
+    if ( nr_iommus >= MAX_IOMMUS )
     {
         dprintk(XENLOG_ERR VTDPREFIX,
-                 "IOMMU: nr_iommus %d > MAX_IOMMUS\n", nr_iommus);
+                "IOMMU: nr_iommus %d > MAX_IOMMUS\n", nr_iommus + 1);
         return -ENOMEM;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Mar 24 03:22:07 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Mar 2021 03:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.100849.192381 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lOu5q-000219-Su; Wed, 24 Mar 2021 03:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 100849.192381; Wed, 24 Mar 2021 03: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 1lOu5q-000210-PY; Wed, 24 Mar 2021 03:22:02 +0000
Received: by outflank-mailman (input) for mailman id 100849;
 Wed, 24 Mar 2021 03: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 1lOu5p-00020u-Nz
 for xen-changelog@lists.xenproject.org; Wed, 24 Mar 2021 03: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 1lOu5p-0007Wr-Mo
 for xen-changelog@lists.xenproject.org; Wed, 24 Mar 2021 03:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lOu5p-0007Xk-Lc
 for xen-changelog@lists.xenproject.org; Wed, 24 Mar 2021 03: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=KeYpg+SL5Awk/rsfvzBhLn7+/r+mqUW7WpcrbdLJ9so=; b=fywwJNOgJ4nVc/iUlcyzXoZTL4
	4V/3865mdV+0nJA0ZICu56CrXauLSz9us6C3YHNy2QXNqhkA3Sy/y9Ibks7i/p7YrCHdxFKFV4p5q
	4Rdo555uIfGvH6iaLtsKhb0PuqQE/iGkiCu2OXUrtttG54haA+HBPhWkNzs8hTh8Isk4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] SUPPORT.MD: Mark LiveUpdate of C/OCaml xenstored daemon as Tech Preview
Message-Id: <E1lOu5p-0007Xk-Lc@xenbits.xenproject.org>
Date: Wed, 24 Mar 2021 03:22:01 +0000

commit ecdff2f5a03210119b71806c3f5571d6906dd85e
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Sat Mar 13 13:50:44 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Mar 22 10:40:23 2021 +0000

    SUPPORT.MD: Mark LiveUpdate of C/OCaml xenstored daemon as Tech Preview
    
    Support to liveupdate C/OCaml xenstored daemon was added during the
    4.15 development cycle. Add two new sections in SUPPORT.MD to explain
    what is the support state.
    
    For now, it is a tech preview.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 SUPPORT.md | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/SUPPORT.md b/SUPPORT.md
index 7db4568f1a..a1efd8fcfd 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -177,6 +177,14 @@ Support for running qemu-xen device model in a linux stubdomain.
 
     Status: Tech Preview
 
+## Liveupdate of C xenstored daemon
+
+    Status: Tech Preview
+
+## Liveupdate of OCaml xenstored daemon
+
+    Status: Tech Preview
+
 ## Toolstack/3rd party
 
 ### libvirt driver for xl
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Mar 24 16:33:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Mar 2021 16:33:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101087.193051 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lP6RN-00089A-EQ; Wed, 24 Mar 2021 16:33:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101087.193051; Wed, 24 Mar 2021 16: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 1lP6RN-000892-BA; Wed, 24 Mar 2021 16:33:05 +0000
Received: by outflank-mailman (input) for mailman id 101087;
 Wed, 24 Mar 2021 16: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 1lP6RN-00088x-3a
 for xen-changelog@lists.xenproject.org; Wed, 24 Mar 2021 16: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 1lP6RN-0005MQ-1c
 for xen-changelog@lists.xenproject.org; Wed, 24 Mar 2021 16:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lP6RN-0002nW-0f
 for xen-changelog@lists.xenproject.org; Wed, 24 Mar 2021 16: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=0j4KSxP/WWfBgYbOL+eFuU+iSJVhTW2VByoX43oRmPQ=; b=p/XnK8CB3gcud/hMuz6E0h9JZR
	KFPt2r62Dy8ff5EkgkCmFbXHqa+2HV7cgu2u/oaSE1irM/IKhbkuqZ4Y11h2/5NXxDzey5KtEhP/u
	CVtKJguMaj+8NdJkEGInBGm3k9C0UtvdUFsq9SBdphREjqNsNz6JuWCrJLDNRly0zuBE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Branching: Update version files etc. for newly unstable
Message-Id: <E1lP6RN-0002nW-0f@xenbits.xenproject.org>
Date: Wed, 24 Mar 2021 16:33:05 +0000

commit a04509d34d72cfb96c8a4f14602ac4fea5b8e290
Author:     Ian Jackson <iwj@xenproject.org>
AuthorDate: Wed Mar 24 16:26:36 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Wed Mar 24 16:28:00 2021 +0000

    Branching: Update version files etc. for newly unstable
    
    Signed-off-by: Ian Jackson <iwj@xenproject.org>
---
 CHANGELOG.md |  2 ++
 Config.mk    |  4 ++--
 README       | 16 ++++++++--------
 SUPPORT.md   |  2 +-
 xen/Makefile |  4 ++--
 5 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index c407f6bb2f..f76fadf8c7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,8 @@ Notable changes to Xen will be documented in this file.
 
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 
+## [unstable UNRELEASED](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=staging) - TBD
+
 ## [4.15.0 UNRELEASED](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.15.0) - TBD
 
 ## Added / support upgraded
diff --git a/Config.mk b/Config.mk
index a56a971028..9a174c77f3 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 ?= a3741780fe3535e19e02efa869a7cac481891129
+OVMF_UPSTREAM_REVISION ?= master
 QEMU_UPSTREAM_REVISION ?= 7ea428895af2840d85c524f0bd11a38aac308308
 MINIOS_UPSTREAM_REVISION ?= 051b87bb9c19609976fb038f386920e1ce5454c5
 
@@ -253,7 +253,7 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.14.0
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= xen-4.15.0-rc1
+QEMU_TRADITIONAL_REVISION ?= 3d273dd05e51e5a1ffba3d98c7437ee84e8f8764
 # Wed Jul 15 10:01:40 2020 +0100
 # qemu-trad: remove Xen path dependencies
 
diff --git a/README b/README
index aa8b4fe126..fad96672af 100644
--- a/README
+++ b/README
@@ -1,11 +1,11 @@
-#################################
- _  _    _ ____
-| || |  / | ___|       _ __ ___
-| || |_ | |___ \ _____| '__/ __|
-|__   _|| |___) |_____| | | (__
-   |_|(_)_|____/      |_|  \___|
-
-#################################
+############################################################
+__  __                                _        _     _
+\ \/ /___ _ __        _   _ _ __  ___| |_ __ _| |__ | | ___
+ \  // _ \ '_ \ _____| | | | '_ \/ __| __/ _` | '_ \| |/ _ \
+ /  \  __/ | | |_____| |_| | | | \__ \ || (_| | |_) | |  __/
+/_/\_\___|_| |_|      \__,_|_| |_|___/\__\__,_|_.__/|_|\___|
+
+############################################################
 
 https://www.xen.org/
 
diff --git a/SUPPORT.md b/SUPPORT.md
index a1efd8fcfd..3ef072681b 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -9,7 +9,7 @@ for the definitions of the support status levels etc.
 
 # Release Support
 
-    Xen-Version: 4.15-rc
+    Xen-Version: unstable
     Initial-Release: n/a
     Supported-Until: TBD
     Security-Support-Until: Unreleased - not yet security-supported
diff --git a/xen/Makefile b/xen/Makefile
index 0b97e459e2..ab7d86d226 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -1,8 +1,8 @@
 # This is the correct place to edit the build version.
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
-export XEN_SUBVERSION    = 15
-export XEN_EXTRAVERSION ?= .0-rc$(XEN_VENDORVERSION)
+export XEN_SUBVERSION    = 16
+export XEN_EXTRAVERSION ?= -unstable-rc$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Mar 24 16:33:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Mar 2021 16:33:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101088.193055 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lP6RY-0008AH-GB; Wed, 24 Mar 2021 16:33:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101088.193055; Wed, 24 Mar 2021 16: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 1lP6RY-0008A9-Ct; Wed, 24 Mar 2021 16:33:16 +0000
Received: by outflank-mailman (input) for mailman id 101088;
 Wed, 24 Mar 2021 16: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 1lP6RX-0008A1-6e
 for xen-changelog@lists.xenproject.org; Wed, 24 Mar 2021 16: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 1lP6RX-0005Mn-5n
 for xen-changelog@lists.xenproject.org; Wed, 24 Mar 2021 16:33:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lP6RX-0002oE-4s
 for xen-changelog@lists.xenproject.org; Wed, 24 Mar 2021 16: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=TYUYbCO7yle2Zu+o4mhHOHCWsSI31VcIcMhILOc11Pk=; b=61L1VsUmWIFYNGG+SSdWCI7iBN
	gaiUf6bATAQEyMKiDolYSqN03VKms3QGQmTiRXUgG+vJFo8vFKII5R2xcIaxUGHCUscyUTUmKnhS0
	IIuC/lkM3/5gj9Dcl0zxR566Ajo5M+o5TAvA0mKB3ud0bSdVnABpI+bxyQafWJD53pIg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Branching: Rerun autoconf to put version right
Message-Id: <E1lP6RX-0002oE-4s@xenbits.xenproject.org>
Date: Wed, 24 Mar 2021 16:33:15 +0000

commit 64d07691755e9aa6d3453ef3bb9109fde2b8da1e
Author:     Ian Jackson <iwj@xenproject.org>
AuthorDate: Wed Mar 24 16:27:45 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Wed Mar 24 16:28:05 2021 +0000

    Branching: Rerun autoconf to put version right
    
    Signed-off-by: Ian Jackson <iwj@xenproject.org>
---
 configure         | 18 +++++++++---------
 docs/configure    | 18 +++++++++---------
 stubdom/configure | 18 +++++++++---------
 tools/configure   | 18 +++++++++---------
 4 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/configure b/configure
index a2789ae480..62f6c2d47a 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for Xen Hypervisor 4.15.
+# Generated by GNU Autoconf 2.69 for Xen Hypervisor 4.16.
 #
 # Report bugs to <xen-devel@lists.xen.org>.
 #
@@ -579,8 +579,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='Xen Hypervisor'
 PACKAGE_TARNAME='xen'
-PACKAGE_VERSION='4.15'
-PACKAGE_STRING='Xen Hypervisor 4.15'
+PACKAGE_VERSION='4.16'
+PACKAGE_STRING='Xen Hypervisor 4.16'
 PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='https://www.xen.org/'
 
@@ -1236,7 +1236,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures Xen Hypervisor 4.15 to adapt to many kinds of systems.
+\`configure' configures Xen Hypervisor 4.16 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1302,7 +1302,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Xen Hypervisor 4.15:";;
+     short | recursive ) echo "Configuration of Xen Hypervisor 4.16:";;
    esac
   cat <<\_ACEOF
 
@@ -1403,7 +1403,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Xen Hypervisor configure 4.15
+Xen Hypervisor configure 4.16
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1420,7 +1420,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Xen Hypervisor $as_me 4.15, which was
+It was created by Xen Hypervisor $as_me 4.16, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2868,7 +2868,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by Xen Hypervisor $as_me 4.15, which was
+This file was extended by Xen Hypervisor $as_me 4.16, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -2922,7 +2922,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-Xen Hypervisor config.status 4.15
+Xen Hypervisor config.status 4.16
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/docs/configure b/docs/configure
index e9c040cb84..569bd4c2ff 100755
--- a/docs/configure
+++ b/docs/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for Xen Hypervisor Documentation 4.15.
+# Generated by GNU Autoconf 2.69 for Xen Hypervisor Documentation 4.16.
 #
 # Report bugs to <xen-devel@lists.xen.org>.
 #
@@ -579,8 +579,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='Xen Hypervisor Documentation'
 PACKAGE_TARNAME='xen'
-PACKAGE_VERSION='4.15'
-PACKAGE_STRING='Xen Hypervisor Documentation 4.15'
+PACKAGE_VERSION='4.16'
+PACKAGE_STRING='Xen Hypervisor Documentation 4.16'
 PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='https://www.xen.org/'
 
@@ -1224,7 +1224,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures Xen Hypervisor Documentation 4.15 to adapt to many kinds of systems.
+\`configure' configures Xen Hypervisor Documentation 4.16 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1286,7 +1286,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Xen Hypervisor Documentation 4.15:";;
+     short | recursive ) echo "Configuration of Xen Hypervisor Documentation 4.16:";;
    esac
   cat <<\_ACEOF
 
@@ -1387,7 +1387,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Xen Hypervisor Documentation configure 4.15
+Xen Hypervisor Documentation configure 4.16
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1404,7 +1404,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Xen Hypervisor Documentation $as_me 4.15, which was
+It was created by Xen Hypervisor Documentation $as_me 4.16, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2821,7 +2821,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by Xen Hypervisor Documentation $as_me 4.15, which was
+This file was extended by Xen Hypervisor Documentation $as_me 4.16, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -2875,7 +2875,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-Xen Hypervisor Documentation config.status 4.15
+Xen Hypervisor Documentation config.status 4.16
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/stubdom/configure b/stubdom/configure
index 6068f58d12..aa48df986d 100755
--- a/stubdom/configure
+++ b/stubdom/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for Xen Hypervisor Stub Domains 4.15.
+# Generated by GNU Autoconf 2.69 for Xen Hypervisor Stub Domains 4.16.
 #
 # Report bugs to <xen-devel@lists.xen.org>.
 #
@@ -579,8 +579,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='Xen Hypervisor Stub Domains'
 PACKAGE_TARNAME='xen'
-PACKAGE_VERSION='4.15'
-PACKAGE_STRING='Xen Hypervisor Stub Domains 4.15'
+PACKAGE_VERSION='4.16'
+PACKAGE_STRING='Xen Hypervisor Stub Domains 4.16'
 PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='https://www.xen.org/'
 
@@ -1265,7 +1265,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures Xen Hypervisor Stub Domains 4.15 to adapt to many kinds of systems.
+\`configure' configures Xen Hypervisor Stub Domains 4.16 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1331,7 +1331,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Xen Hypervisor Stub Domains 4.15:";;
+     short | recursive ) echo "Configuration of Xen Hypervisor Stub Domains 4.16:";;
    esac
   cat <<\_ACEOF
 
@@ -1444,7 +1444,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Xen Hypervisor Stub Domains configure 4.15
+Xen Hypervisor Stub Domains configure 4.16
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1499,7 +1499,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Xen Hypervisor Stub Domains $as_me 4.15, which was
+It was created by Xen Hypervisor Stub Domains $as_me 4.16, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -4295,7 +4295,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by Xen Hypervisor Stub Domains $as_me 4.15, which was
+This file was extended by Xen Hypervisor Stub Domains $as_me 4.16, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -4349,7 +4349,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-Xen Hypervisor Stub Domains config.status 4.15
+Xen Hypervisor Stub Domains config.status 4.16
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/tools/configure b/tools/configure
index bb5acf9d43..99d08a4d81 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for Xen Hypervisor Tools 4.15.
+# Generated by GNU Autoconf 2.69 for Xen Hypervisor Tools 4.16.
 #
 # Report bugs to <xen-devel@lists.xen.org>.
 #
@@ -580,8 +580,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='Xen Hypervisor Tools'
 PACKAGE_TARNAME='xen'
-PACKAGE_VERSION='4.15'
-PACKAGE_STRING='Xen Hypervisor Tools 4.15'
+PACKAGE_VERSION='4.16'
+PACKAGE_STRING='Xen Hypervisor Tools 4.16'
 PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='https://www.xen.org/'
 
@@ -1417,7 +1417,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures Xen Hypervisor Tools 4.15 to adapt to many kinds of systems.
+\`configure' configures Xen Hypervisor Tools 4.16 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1483,7 +1483,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Xen Hypervisor Tools 4.15:";;
+     short | recursive ) echo "Configuration of Xen Hypervisor Tools 4.16:";;
    esac
   cat <<\_ACEOF
 
@@ -1693,7 +1693,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Xen Hypervisor Tools configure 4.15
+Xen Hypervisor Tools configure 4.16
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2108,7 +2108,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Xen Hypervisor Tools $as_me 4.15, which was
+It was created by Xen Hypervisor Tools $as_me 4.16, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -10752,7 +10752,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by Xen Hypervisor Tools $as_me 4.15, which was
+This file was extended by Xen Hypervisor Tools $as_me 4.16, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -10815,7 +10815,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-Xen Hypervisor Tools config.status 4.15
+Xen Hypervisor Tools config.status 4.16
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Mar 24 16:33:26 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Mar 2021 16:33:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101089.193061 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lP6Ri-0008Bc-IU; Wed, 24 Mar 2021 16:33:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101089.193061; Wed, 24 Mar 2021 16: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 1lP6Ri-0008BU-Eh; Wed, 24 Mar 2021 16:33:26 +0000
Received: by outflank-mailman (input) for mailman id 101089;
 Wed, 24 Mar 2021 16:33: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 1lP6Ri-0008BO-1S
 for xen-changelog@lists.xenproject.org; Wed, 24 Mar 2021 16:33: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 1lP6Ri-0005Mx-0i
 for xen-changelog@lists.xenproject.org; Wed, 24 Mar 2021 16:33:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lP6Rh-0002pR-Ur
 for xen-changelog@lists.xenproject.org; Wed, 24 Mar 2021 16: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=V2n39kE8Vn1+tIk9xk376nmdwZ+LdOxv6H+SwaxU6WY=; b=gFH8uOb3FJf/3/Ibna8ZsaFPAm
	UYcm/zpvwpnNjsAMnwHlQjAInDFpq0JWPeeYE20dMquj9w/gwwPaKk0yYmh6Iw9OHXeg5TkrrMsGT
	CvetaTtYk5fPP50DtopSj8fU94XLitTGjNR9qQqqDyfcmolN4IBsvLUHLXhnuhb/6k9o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] 4.15: Turn off debug on the stable branch
Message-Id: <E1lP6Rh-0002pR-Ur@xenbits.xenproject.org>
Date: Wed, 24 Mar 2021 16:33:25 +0000

commit 2c7096b2f8cf9faf28d7f961ea6181961fa847e9
Author:     Ian Jackson <iwj@xenproject.org>
AuthorDate: Wed Mar 24 16:31:11 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Wed Mar 24 16:31:32 2021 +0000

    4.15: Turn off debug on the stable branch
    
    Signed-off-by: Ian Jackson <iwj@xenproject.org>
---
 tools/Rules.mk    | 2 +-
 xen/Kconfig.debug | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index 2907ed2d39..444e5bacdd 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -20,7 +20,7 @@ CFLAGS_xeninclude = -I$(XEN_INCLUDE)
 XENSTORE_XENSTORED ?= y
 
 # A debug build of tools?
-debug ?= y
+debug ?= n
 debug_symbols ?= $(debug)
 
 XEN_GOCODE_URL    = golang.xenproject.org
diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug
index fad3050d4f..4419030235 100644
--- a/xen/Kconfig.debug
+++ b/xen/Kconfig.debug
@@ -3,7 +3,7 @@ menu "Debugging Options"
 
 config DEBUG
 	bool "Developer Checks"
-	default y
+	default n
 	---help---
 	  If you say Y here this will enable developer checks such as asserts
 	  and extra printks. This option is intended for development purposes
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Wed Mar 24 16:33:36 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Mar 2021 16:33:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101090.193063 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lP6Rs-0008DJ-JE; Wed, 24 Mar 2021 16:33:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101090.193063; Wed, 24 Mar 2021 16: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 1lP6Rs-0008DB-GA; Wed, 24 Mar 2021 16:33:36 +0000
Received: by outflank-mailman (input) for mailman id 101090;
 Wed, 24 Mar 2021 16: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 1lP6Rs-0008D2-4L
 for xen-changelog@lists.xenproject.org; Wed, 24 Mar 2021 16: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 1lP6Rs-0005N8-3d
 for xen-changelog@lists.xenproject.org; Wed, 24 Mar 2021 16:33:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lP6Rs-0002q3-2q
 for xen-changelog@lists.xenproject.org; Wed, 24 Mar 2021 16:33:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UstbdPpIZaV2MoCbKjTp5PWQYD8RoO4KL54piHw8WW4=; b=w3Sb7oursUDWvRuDovcsNsK8xD
	0EqA0rjFpWY9GMt5WI2cexV9zZmqeKIX77R29y0FY8vk1ywPFBuWADrMVzgjo6JiUqgPdt1dsNydg
	mbD4Y6CHMiYtstWi2Jb/LwHQ1cjynJ/+H/LODEQHMVz6t0Z0DYypmTH8KyrpE1SB/L+M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] CHANGELOG: Correct sub-section headings
Message-Id: <E1lP6Rs-0002q3-2q@xenbits.xenproject.org>
Date: Wed, 24 Mar 2021 16:33:36 +0000

commit 0f93d79a97121c55d3f3e26304d437ddb38de6a7
Author:     Ian Jackson <iwj@xenproject.org>
AuthorDate: Wed Mar 24 16:30:30 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Wed Mar 24 16:31:32 2021 +0000

    CHANGELOG: Correct sub-section headings
    
    Signed-off-by: Ian Jackson <iwj@xenproject.org>
---
 CHANGELOG.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index c407f6bb2f..07f240b6ab 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,12 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 
 ## [4.15.0 UNRELEASED](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.15.0) - TBD
 
-## Added / support upgraded
+### Added / support upgraded
  - ARM IOREQ servers (device emulation etc.) (Tech Preview)
  - Renesas IPMMU-VMSA (Supported, not security supported; was Tech Preview)
  - ARM SMMUv3 (Tech Preview)
 
-## Removed / support downgraded
+### Removed / support downgraded
 
  - qemu-xen-traditional as host process device model, now "No security
    support, not recommended".  (Use as stub domain device model is still
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Thu Mar 25 03:55:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Mar 2021 03:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101249.193499 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPH5L-0006Gd-Ip; Thu, 25 Mar 2021 03:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101249.193499; Thu, 25 Mar 2021 03: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 1lPH5L-0006GV-Fi; Thu, 25 Mar 2021 03:55:03 +0000
Received: by outflank-mailman (input) for mailman id 101249;
 Thu, 25 Mar 2021 03: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 1lPH5K-0006GQ-6c
 for xen-changelog@lists.xenproject.org; Thu, 25 Mar 2021 03: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 1lPH5K-0002Rm-5i
 for xen-changelog@lists.xenproject.org; Thu, 25 Mar 2021 03:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPH5K-0008QM-47
 for xen-changelog@lists.xenproject.org; Thu, 25 Mar 2021 03: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=eoP2/MoXaGehXBJ+Dvk6S8xgaPTHeQrKp6GKdO/ND04=; b=7Ne/0OL78yB7E13YmozCieZjd4
	uJM9JaGhT8U3GWqmP10oMJrY7sBhsBYSqs8FOI8gSoUbz1tIod8i2mN8qtEjr2Bj+OKDm0bclvRu1
	6pjLTtUypswjkm6+mDSW0Id2Iy3H+JNDED8Y83WZcNA8NSZ+od0FrNrOhJPC1SRSIBT4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] VT-d: correct off-by-1 in number-of-IOMMUs check
Message-Id: <E1lPH5K-0008QM-47@xenbits.xenproject.org>
Date: Thu, 25 Mar 2021 03:55:02 +0000

commit b9b3082002cac68726fb303e0abd2ff0113d4657
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 23 17:01:30 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 23 17:01:30 2021 +0100

    VT-d: correct off-by-1 in number-of-IOMMUs check
    
    Otherwise, if we really run on a system with this many IOMMUs,
    entering/leaving S3 would overrun iommu_state[].
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/drivers/passthrough/vtd/iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 9b58d566c8..44e407d19f 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1168,10 +1168,10 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
     unsigned long sagaw, nr_dom;
     int agaw;
 
-    if ( nr_iommus > MAX_IOMMUS )
+    if ( nr_iommus >= MAX_IOMMUS )
     {
         dprintk(XENLOG_ERR VTDPREFIX,
-                 "IOMMU: nr_iommus %d > MAX_IOMMUS\n", nr_iommus);
+                "IOMMU: nr_iommus %d > MAX_IOMMUS\n", nr_iommus + 1);
         return -ENOMEM;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Mar 25 17:00:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Mar 2021 17:00:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101494.194208 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPTL5-0001EY-0F; Thu, 25 Mar 2021 17:00:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101494.194208; Thu, 25 Mar 2021 17: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 1lPTL4-0001EA-TS; Thu, 25 Mar 2021 17:00:06 +0000
Received: by outflank-mailman (input) for mailman id 101494;
 Thu, 25 Mar 2021 17: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 1lPTL4-0001A4-Cy
 for xen-changelog@lists.xenproject.org; Thu, 25 Mar 2021 17: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 1lPTL4-0000Br-Az
 for xen-changelog@lists.xenproject.org; Thu, 25 Mar 2021 17:00:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPTL3-0002f9-Fe
 for xen-changelog@lists.xenproject.org; Thu, 25 Mar 2021 17: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=GLmmudZLvkUVY/OaB1UxTaS2co5iiIpKcRoBA7RbHAQ=; b=LBKUDSfeHA1+2vJBUUMo5wF1CT
	/NhIZZjXOtoLLjXRg9qjMCpfTk9qOiA8YPXjS287YzEXOXftgfWmYyZzOW8u93uCnBCqPQlN68e3q
	Dn39mRlFJLuT7eeuRHpXWhWs+2jwLb20NBkv59XFgHPRwJynmfHRnwMJdU67Gi6EnmGY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Drop "-rc" suffix from XEN_EXTRAVERSION
Message-Id: <E1lPTL3-0002f9-Fe@xenbits.xenproject.org>
Date: Thu, 25 Mar 2021 17:00:05 +0000

commit 4ca6217bef99128027a9b64c055e4967a5dabd0c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Mar 25 15:05:55 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Mar 25 16:58:10 2021 +0000

    xen: Drop "-rc" suffix from XEN_EXTRAVERSION
    
    Fixes: a04509d34d ("Branching: Update version files etc. for newly unstable")
    Signed-off-by: Andrew Cooper <andrew.cooper3@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 ab7d86d226..9f3be7766d 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 16
-export XEN_EXTRAVERSION ?= -unstable-rc$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= -unstable$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Mar 26 06:22:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Mar 2021 06:22:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101595.194446 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPfr9-0006Ly-KR; Fri, 26 Mar 2021 06:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101595.194446; Fri, 26 Mar 2021 06:22: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 1lPfr9-0006Lp-H1; Fri, 26 Mar 2021 06:22:03 +0000
Received: by outflank-mailman (input) for mailman id 101595;
 Fri, 26 Mar 2021 06: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 1lPfr7-0006Lj-Vm
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 06: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 1lPfr7-0008Kk-UY
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 06:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPfr7-0002p7-Rn
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 06: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=2yeEbsvTzS1UzWN51rO1dcS/Ajgn9f4ETUBeFGOIu+E=; b=R1+caRYNy6uEzgdPafEvpaT5xr
	C4fg13IPXHAhhPsWkjuKh7pasdW9lcAUQ5IMFJACAj3k4BQqzTUkSCvaJsuGlntGaZgKta89vnMYk
	dBnWhjYEGMfEoWgSj/YUEF3bVFcKThXeTGO9X32gJJTvjcLQGrILwxp07ndaFeFvaMvI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Branching: Update version files etc. for newly unstable
Message-Id: <E1lPfr7-0002p7-Rn@xenbits.xenproject.org>
Date: Fri, 26 Mar 2021 06:22:01 +0000

commit a04509d34d72cfb96c8a4f14602ac4fea5b8e290
Author:     Ian Jackson <iwj@xenproject.org>
AuthorDate: Wed Mar 24 16:26:36 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Wed Mar 24 16:28:00 2021 +0000

    Branching: Update version files etc. for newly unstable
    
    Signed-off-by: Ian Jackson <iwj@xenproject.org>
---
 CHANGELOG.md |  2 ++
 Config.mk    |  4 ++--
 README       | 16 ++++++++--------
 SUPPORT.md   |  2 +-
 xen/Makefile |  4 ++--
 5 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index c407f6bb2f..f76fadf8c7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,8 @@ Notable changes to Xen will be documented in this file.
 
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 
+## [unstable UNRELEASED](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=staging) - TBD
+
 ## [4.15.0 UNRELEASED](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.15.0) - TBD
 
 ## Added / support upgraded
diff --git a/Config.mk b/Config.mk
index a56a971028..9a174c77f3 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 ?= a3741780fe3535e19e02efa869a7cac481891129
+OVMF_UPSTREAM_REVISION ?= master
 QEMU_UPSTREAM_REVISION ?= 7ea428895af2840d85c524f0bd11a38aac308308
 MINIOS_UPSTREAM_REVISION ?= 051b87bb9c19609976fb038f386920e1ce5454c5
 
@@ -253,7 +253,7 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.14.0
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= xen-4.15.0-rc1
+QEMU_TRADITIONAL_REVISION ?= 3d273dd05e51e5a1ffba3d98c7437ee84e8f8764
 # Wed Jul 15 10:01:40 2020 +0100
 # qemu-trad: remove Xen path dependencies
 
diff --git a/README b/README
index aa8b4fe126..fad96672af 100644
--- a/README
+++ b/README
@@ -1,11 +1,11 @@
-#################################
- _  _    _ ____
-| || |  / | ___|       _ __ ___
-| || |_ | |___ \ _____| '__/ __|
-|__   _|| |___) |_____| | | (__
-   |_|(_)_|____/      |_|  \___|
-
-#################################
+############################################################
+__  __                                _        _     _
+\ \/ /___ _ __        _   _ _ __  ___| |_ __ _| |__ | | ___
+ \  // _ \ '_ \ _____| | | | '_ \/ __| __/ _` | '_ \| |/ _ \
+ /  \  __/ | | |_____| |_| | | | \__ \ || (_| | |_) | |  __/
+/_/\_\___|_| |_|      \__,_|_| |_|___/\__\__,_|_.__/|_|\___|
+
+############################################################
 
 https://www.xen.org/
 
diff --git a/SUPPORT.md b/SUPPORT.md
index a1efd8fcfd..3ef072681b 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -9,7 +9,7 @@ for the definitions of the support status levels etc.
 
 # Release Support
 
-    Xen-Version: 4.15-rc
+    Xen-Version: unstable
     Initial-Release: n/a
     Supported-Until: TBD
     Security-Support-Until: Unreleased - not yet security-supported
diff --git a/xen/Makefile b/xen/Makefile
index 0b97e459e2..ab7d86d226 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -1,8 +1,8 @@
 # This is the correct place to edit the build version.
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
-export XEN_SUBVERSION    = 15
-export XEN_EXTRAVERSION ?= .0-rc$(XEN_VENDORVERSION)
+export XEN_SUBVERSION    = 16
+export XEN_EXTRAVERSION ?= -unstable-rc$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Mar 26 06:22:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Mar 2021 06:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101596.194450 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPfrJ-0006Ml-Lu; Fri, 26 Mar 2021 06:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101596.194450; Fri, 26 Mar 2021 06:22: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 1lPfrJ-0006Mc-Ig; Fri, 26 Mar 2021 06:22:13 +0000
Received: by outflank-mailman (input) for mailman id 101596;
 Fri, 26 Mar 2021 06: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 1lPfrI-0006MV-4R
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 06: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 1lPfrI-0008Ko-3c
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 06:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPfrI-0002px-1a
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 06: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=PGIy4BiaGLBRV5JPAPdkPjiItMUYRR3LhKEmQBezXhc=; b=aZMJhTMnCG044qAJqblWNzcQ9V
	aSrOhG+zewttpipUeEwjZsuTok/4odws/SKcMjq3qakbcfYGCQpJyfsxQ+C3hr67gr5MZKybJ7hTM
	SUvFoxUbEMIIPMBO9Vw6BCn5ymABDGqVv2yMEhlkByWvZmopFuNgPKzdI8wtThGnoUgw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Branching: Rerun autoconf to put version right
Message-Id: <E1lPfrI-0002px-1a@xenbits.xenproject.org>
Date: Fri, 26 Mar 2021 06:22:12 +0000

commit 64d07691755e9aa6d3453ef3bb9109fde2b8da1e
Author:     Ian Jackson <iwj@xenproject.org>
AuthorDate: Wed Mar 24 16:27:45 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Wed Mar 24 16:28:05 2021 +0000

    Branching: Rerun autoconf to put version right
    
    Signed-off-by: Ian Jackson <iwj@xenproject.org>
---
 configure         | 18 +++++++++---------
 docs/configure    | 18 +++++++++---------
 stubdom/configure | 18 +++++++++---------
 tools/configure   | 18 +++++++++---------
 4 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/configure b/configure
index a2789ae480..62f6c2d47a 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for Xen Hypervisor 4.15.
+# Generated by GNU Autoconf 2.69 for Xen Hypervisor 4.16.
 #
 # Report bugs to <xen-devel@lists.xen.org>.
 #
@@ -579,8 +579,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='Xen Hypervisor'
 PACKAGE_TARNAME='xen'
-PACKAGE_VERSION='4.15'
-PACKAGE_STRING='Xen Hypervisor 4.15'
+PACKAGE_VERSION='4.16'
+PACKAGE_STRING='Xen Hypervisor 4.16'
 PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='https://www.xen.org/'
 
@@ -1236,7 +1236,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures Xen Hypervisor 4.15 to adapt to many kinds of systems.
+\`configure' configures Xen Hypervisor 4.16 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1302,7 +1302,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Xen Hypervisor 4.15:";;
+     short | recursive ) echo "Configuration of Xen Hypervisor 4.16:";;
    esac
   cat <<\_ACEOF
 
@@ -1403,7 +1403,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Xen Hypervisor configure 4.15
+Xen Hypervisor configure 4.16
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1420,7 +1420,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Xen Hypervisor $as_me 4.15, which was
+It was created by Xen Hypervisor $as_me 4.16, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2868,7 +2868,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by Xen Hypervisor $as_me 4.15, which was
+This file was extended by Xen Hypervisor $as_me 4.16, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -2922,7 +2922,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-Xen Hypervisor config.status 4.15
+Xen Hypervisor config.status 4.16
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/docs/configure b/docs/configure
index e9c040cb84..569bd4c2ff 100755
--- a/docs/configure
+++ b/docs/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for Xen Hypervisor Documentation 4.15.
+# Generated by GNU Autoconf 2.69 for Xen Hypervisor Documentation 4.16.
 #
 # Report bugs to <xen-devel@lists.xen.org>.
 #
@@ -579,8 +579,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='Xen Hypervisor Documentation'
 PACKAGE_TARNAME='xen'
-PACKAGE_VERSION='4.15'
-PACKAGE_STRING='Xen Hypervisor Documentation 4.15'
+PACKAGE_VERSION='4.16'
+PACKAGE_STRING='Xen Hypervisor Documentation 4.16'
 PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='https://www.xen.org/'
 
@@ -1224,7 +1224,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures Xen Hypervisor Documentation 4.15 to adapt to many kinds of systems.
+\`configure' configures Xen Hypervisor Documentation 4.16 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1286,7 +1286,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Xen Hypervisor Documentation 4.15:";;
+     short | recursive ) echo "Configuration of Xen Hypervisor Documentation 4.16:";;
    esac
   cat <<\_ACEOF
 
@@ -1387,7 +1387,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Xen Hypervisor Documentation configure 4.15
+Xen Hypervisor Documentation configure 4.16
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1404,7 +1404,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Xen Hypervisor Documentation $as_me 4.15, which was
+It was created by Xen Hypervisor Documentation $as_me 4.16, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2821,7 +2821,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by Xen Hypervisor Documentation $as_me 4.15, which was
+This file was extended by Xen Hypervisor Documentation $as_me 4.16, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -2875,7 +2875,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-Xen Hypervisor Documentation config.status 4.15
+Xen Hypervisor Documentation config.status 4.16
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/stubdom/configure b/stubdom/configure
index 6068f58d12..aa48df986d 100755
--- a/stubdom/configure
+++ b/stubdom/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for Xen Hypervisor Stub Domains 4.15.
+# Generated by GNU Autoconf 2.69 for Xen Hypervisor Stub Domains 4.16.
 #
 # Report bugs to <xen-devel@lists.xen.org>.
 #
@@ -579,8 +579,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='Xen Hypervisor Stub Domains'
 PACKAGE_TARNAME='xen'
-PACKAGE_VERSION='4.15'
-PACKAGE_STRING='Xen Hypervisor Stub Domains 4.15'
+PACKAGE_VERSION='4.16'
+PACKAGE_STRING='Xen Hypervisor Stub Domains 4.16'
 PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='https://www.xen.org/'
 
@@ -1265,7 +1265,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures Xen Hypervisor Stub Domains 4.15 to adapt to many kinds of systems.
+\`configure' configures Xen Hypervisor Stub Domains 4.16 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1331,7 +1331,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Xen Hypervisor Stub Domains 4.15:";;
+     short | recursive ) echo "Configuration of Xen Hypervisor Stub Domains 4.16:";;
    esac
   cat <<\_ACEOF
 
@@ -1444,7 +1444,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Xen Hypervisor Stub Domains configure 4.15
+Xen Hypervisor Stub Domains configure 4.16
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1499,7 +1499,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Xen Hypervisor Stub Domains $as_me 4.15, which was
+It was created by Xen Hypervisor Stub Domains $as_me 4.16, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -4295,7 +4295,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by Xen Hypervisor Stub Domains $as_me 4.15, which was
+This file was extended by Xen Hypervisor Stub Domains $as_me 4.16, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -4349,7 +4349,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-Xen Hypervisor Stub Domains config.status 4.15
+Xen Hypervisor Stub Domains config.status 4.16
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/tools/configure b/tools/configure
index bb5acf9d43..99d08a4d81 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for Xen Hypervisor Tools 4.15.
+# Generated by GNU Autoconf 2.69 for Xen Hypervisor Tools 4.16.
 #
 # Report bugs to <xen-devel@lists.xen.org>.
 #
@@ -580,8 +580,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='Xen Hypervisor Tools'
 PACKAGE_TARNAME='xen'
-PACKAGE_VERSION='4.15'
-PACKAGE_STRING='Xen Hypervisor Tools 4.15'
+PACKAGE_VERSION='4.16'
+PACKAGE_STRING='Xen Hypervisor Tools 4.16'
 PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='https://www.xen.org/'
 
@@ -1417,7 +1417,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures Xen Hypervisor Tools 4.15 to adapt to many kinds of systems.
+\`configure' configures Xen Hypervisor Tools 4.16 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1483,7 +1483,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Xen Hypervisor Tools 4.15:";;
+     short | recursive ) echo "Configuration of Xen Hypervisor Tools 4.16:";;
    esac
   cat <<\_ACEOF
 
@@ -1693,7 +1693,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Xen Hypervisor Tools configure 4.15
+Xen Hypervisor Tools configure 4.16
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2108,7 +2108,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Xen Hypervisor Tools $as_me 4.15, which was
+It was created by Xen Hypervisor Tools $as_me 4.16, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -10752,7 +10752,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by Xen Hypervisor Tools $as_me 4.15, which was
+This file was extended by Xen Hypervisor Tools $as_me 4.16, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -10815,7 +10815,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-Xen Hypervisor Tools config.status 4.15
+Xen Hypervisor Tools config.status 4.16
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Mar 26 12:22:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Mar 2021 12:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101770.194839 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPlTb-0006YW-CM; Fri, 26 Mar 2021 12:22:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101770.194839; Fri, 26 Mar 2021 12: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 1lPlTb-0006YO-9N; Fri, 26 Mar 2021 12:22:07 +0000
Received: by outflank-mailman (input) for mailman id 101770;
 Fri, 26 Mar 2021 12: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 1lPlTZ-0006YJ-OW
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 12: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 1lPlTZ-0006Qf-M0
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 12:22:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPlTZ-0002CG-IG
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 12: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=fJtgE7T+KqpCKYa1f/+lHuQZ5ic4408z/Mw9mxIfZVQ=; b=1KXZp8FdgkLNgjBG1G9XgsweOT
	pNfwWXz/hDdAEvmhYwdT9IHfaVV/ItDymQd9Y1VwsM2ac1+UJXCkFe2nB5ZsX+9qYh6I+31ItfYPm
	3oKeOG7YV83Q70+SnY/c7nbrYHwO6845NRuvfM/PZUFfNKzozonlKnosgbDD2qgqsp6E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] docs/design: Update xenstore-migration.md
Message-Id: <E1lPlTZ-0002CG-IG@xenbits.xenproject.org>
Date: Fri, 26 Mar 2021 12:22:05 +0000

commit 7b6d288ef648c76da70fd9e41e73617631025cfe
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Mar 25 10:42:46 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Mar 26 12:08:53 2021 +0000

    docs/design: Update xenstore-migration.md
    
    It is not very clear the shared page adddress is not contained in the
    connection record. Additionally, it is misleading to say the grant
    will always point to the share paged as a domain is free to revoke the
    permission. The restore code would need to make sure it doesn't
    fail/crash if this is happening.
    
    The sentence is now replaced with a paragraph explaining why the GFN is
    not preserved and that the grant is not guarantee to exist during
    restore.
    
    Take the opportunity to replace "code" with "node" when description the
    permission.
    
    Reported-by: Raphael Ning <raphning@amazon.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 docs/designs/xenstore-migration.md | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/docs/designs/xenstore-migration.md b/docs/designs/xenstore-migration.md
index 1a5b94b31d..5f1155273e 100644
--- a/docs/designs/xenstore-migration.md
+++ b/docs/designs/xenstore-migration.md
@@ -216,8 +216,10 @@ For `shared ring` connections it is as follows:
 |           | by xenstored to communicate with `domid`          |
 |           |                                                   |
 
-Since the ABI guarantees that entry 1 in `domid`'s grant table will always
-contain the GFN of the shared page.
+The GFN of the shared page is not preserved because the ABI reserves
+entry 1 in `domid`'s grant table to point to the xenstore shared page.
+Note there is no guarantee the page will still be valid at the time of
+the restore because a domain can revoke the permission.
 
 For `socket` connections it is as follows:
 
@@ -398,7 +400,7 @@ A node permission specifier has the following format:
 |         |                                                     |
 | `domid` | The domain-id to which the permission relates       |
 
-Note that perm1 defines the domain owning the code. See [4] for more
+Note that perm1 defines the domain owning the node. See [4] for more
 explanation of node permissions.
 
 * * *
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Mar 26 12:22:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Mar 2021 12:22:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101771.194843 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPlTl-0006ZT-E8; Fri, 26 Mar 2021 12:22:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101771.194843; Fri, 26 Mar 2021 12: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 1lPlTl-0006ZJ-Av; Fri, 26 Mar 2021 12:22:17 +0000
Received: by outflank-mailman (input) for mailman id 101771;
 Fri, 26 Mar 2021 12: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 1lPlTj-0006Z8-R8
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 12: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 1lPlTj-0006Qm-QI
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 12:22:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPlTj-0002D0-OK
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 12: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=Y3Z6SvGAv/kYJ3r/pjicxJu2bSNPfq1LvoYmnbXNrWE=; b=58gNASdVbLCnpdP6Y4vkgxteYD
	sSqH11LJjtK58WLCWx8PcpoWsidFoc1F4UQOkrWxqFNbBkRKTebqekMoXUNE8jVSqP8GuD97WmYKL
	ZAXcWXAXPoHgeUTigfsFaZx/xY+7JHYPHbUuDy0bd5YTNyEoppNk7IwnVsr9GpXj2htU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] docs/misc: xenstored: Re-instate and tweak the documentation for XS_RESUME
Message-Id: <E1lPlTj-0002D0-OK@xenbits.xenproject.org>
Date: Fri, 26 Mar 2021 12:22:15 +0000

commit 03bee3fd475cb755572dd21214daecf9a77a6bb4
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Mar 25 17:46:30 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Mar 26 12:11:43 2021 +0000

    docs/misc: xenstored: Re-instate and tweak the documentation for XS_RESUME
    
    Commit 13dd372834a4 removed the documentation for XS_RESUME, however
    this command is still implemented (at least in C Xenstored) and used by
    libxl when resuming a domain.
    
    So re-instate the documentation for the XS_RESUME. Take the opportunity
    to update it as there is a user of the command.
    
    Fixes: 13dd372834a4 ("docs/designs: re-work the xenstore migration document...")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 docs/misc/xenstore.txt | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/docs/misc/xenstore.txt b/docs/misc/xenstore.txt
index 1480742330..334dc8b6fd 100644
--- a/docs/misc/xenstore.txt
+++ b/docs/misc/xenstore.txt
@@ -294,6 +294,22 @@ IS_DOMAIN_INTRODUCED	<domid>|		T| or F|
 	ie, if INTRODUCE for the domain has not yet been followed by
 	domain destruction or explicit RELEASE.
 
+RESUME			<domid>|
+
+	Arranges that @releaseDomain events will once more be
+	generated when the domain becomes shut down.  This might have
+	to be used if a domain were to be shut down (generating one
+	@releaseDomain) and then subsequently restarted, since the
+	state-sensitive algorithm in xenstored will not otherwise send
+	further watch event notifications if the domain were to be
+	shut down again.
+
+	This command will be issued in place such as resume because
+	Xen will "shutdown" the domain on suspend.
+
+	xenstored prevents the use of RESUME other than by dom0.
+
+
 SET_TARGET		<domid>|<tdomid>|
 	Notifies xenstored that domain <domid> is targeting domain
 	<tdomid>. This grants domain <domid> full access to paths
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Mar 26 12:22:27 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Mar 2021 12:22:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101772.194847 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPlTv-0006an-FQ; Fri, 26 Mar 2021 12:22:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101772.194847; Fri, 26 Mar 2021 12:22: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 1lPlTv-0006ae-CW; Fri, 26 Mar 2021 12:22:27 +0000
Received: by outflank-mailman (input) for mailman id 101772;
 Fri, 26 Mar 2021 12:22: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 1lPlTu-0006aV-P8
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 12:22: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 1lPlTu-0006Qw-OM
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 12:22:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPlTu-0002EJ-Mz
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 12:22:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RhESJW+/S9RqRGa+75ZxDPo0p2Xu4zLNkDxZ5VM83Lg=; b=BuLnsp5fMKJGZtDxOKox9M4Fpk
	9C4iGVa2rt98RXYVYAjvMROTwAu6rzqOYzIGhxHTpGgfEr84oBRqK0vkmtxccgCxVDEsoQbyjZn1x
	qSej8doimmsoKsPbEEcpAwX5lKcB2WZBumT2BVElzvwN9ZEk/07EkS7sp9CVBph/Hgec=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] docs/design: Update xenstore-migration.md
Message-Id: <E1lPlTu-0002EJ-Mz@xenbits.xenproject.org>
Date: Fri, 26 Mar 2021 12:22:26 +0000

commit 7ff29c96dee274826bc375b77dee8db0ce930344
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Mar 25 10:42:46 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Mar 26 12:13:16 2021 +0000

    docs/design: Update xenstore-migration.md
    
    It is not very clear the shared page adddress is not contained in the
    connection record. Additionally, it is misleading to say the grant
    will always point to the share paged as a domain is free to revoke the
    permission. The restore code would need to make sure it doesn't
    fail/crash if this is happening.
    
    The sentence is now replaced with a paragraph explaining why the GFN is
    not preserved and that the grant is not guarantee to exist during
    restore.
    
    Take the opportunity to replace "code" with "node" when description the
    permission.
    
    Reported-by: Raphael Ning <raphning@amazon.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit 7b6d288ef648c76da70fd9e41e73617631025cfe)
---
 docs/designs/xenstore-migration.md | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/docs/designs/xenstore-migration.md b/docs/designs/xenstore-migration.md
index 1a5b94b31d..5f1155273e 100644
--- a/docs/designs/xenstore-migration.md
+++ b/docs/designs/xenstore-migration.md
@@ -216,8 +216,10 @@ For `shared ring` connections it is as follows:
 |           | by xenstored to communicate with `domid`          |
 |           |                                                   |
 
-Since the ABI guarantees that entry 1 in `domid`'s grant table will always
-contain the GFN of the shared page.
+The GFN of the shared page is not preserved because the ABI reserves
+entry 1 in `domid`'s grant table to point to the xenstore shared page.
+Note there is no guarantee the page will still be valid at the time of
+the restore because a domain can revoke the permission.
 
 For `socket` connections it is as follows:
 
@@ -398,7 +400,7 @@ A node permission specifier has the following format:
 |         |                                                     |
 | `domid` | The domain-id to which the permission relates       |
 
-Note that perm1 defines the domain owning the code. See [4] for more
+Note that perm1 defines the domain owning the node. See [4] for more
 explanation of node permissions.
 
 * * *
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Mar 26 12:22:38 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Mar 2021 12:22:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101773.194851 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPlU6-0006cU-HQ; Fri, 26 Mar 2021 12:22:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101773.194851; Fri, 26 Mar 2021 12:22: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 1lPlU6-0006cL-E1; Fri, 26 Mar 2021 12:22:38 +0000
Received: by outflank-mailman (input) for mailman id 101773;
 Fri, 26 Mar 2021 12:22: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 1lPlU4-0006c8-Vt
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 12:22: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 1lPlU4-0006R4-SL
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 12:22:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPlU4-0002F4-Qd
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 12:22:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5hp3JC9TMMazl/fGsJR9PVyQaL4Z7xxjEhS0/sypezY=; b=fhmtuM2MpwiJ90sXysB70tTvvb
	R/vnVyzEtZIPjGpIPWBJpM1m30GhsRIWWQ7cbirFBwspXVha+EZiVFnJDGNQ8+x2v2WVHqoK/NOdh
	qAo9FbgQ0MIrPsZMd5YcvYX+SXCYHuN4ukMEYG5DANwvx25ieTeDoKnCFjEVdQblX3ag=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] docs/misc: xenstored: Re-instate and tweak the documentation for XS_RESUME
Message-Id: <E1lPlU4-0002F4-Qd@xenbits.xenproject.org>
Date: Fri, 26 Mar 2021 12:22:36 +0000

commit 7087b61fc4bfc19367d39f48649cfe0837ee45e2
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Mar 25 17:46:30 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Mar 26 12:13:17 2021 +0000

    docs/misc: xenstored: Re-instate and tweak the documentation for XS_RESUME
    
    Commit 13dd372834a4 removed the documentation for XS_RESUME, however
    this command is still implemented (at least in C Xenstored) and used by
    libxl when resuming a domain.
    
    So re-instate the documentation for the XS_RESUME. Take the opportunity
    to update it as there is a user of the command.
    
    Fixes: 13dd372834a4 ("docs/designs: re-work the xenstore migration document...")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit 03bee3fd475cb755572dd21214daecf9a77a6bb4)
---
 docs/misc/xenstore.txt | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/docs/misc/xenstore.txt b/docs/misc/xenstore.txt
index 1480742330..334dc8b6fd 100644
--- a/docs/misc/xenstore.txt
+++ b/docs/misc/xenstore.txt
@@ -294,6 +294,22 @@ IS_DOMAIN_INTRODUCED	<domid>|		T| or F|
 	ie, if INTRODUCE for the domain has not yet been followed by
 	domain destruction or explicit RELEASE.
 
+RESUME			<domid>|
+
+	Arranges that @releaseDomain events will once more be
+	generated when the domain becomes shut down.  This might have
+	to be used if a domain were to be shut down (generating one
+	@releaseDomain) and then subsequently restarted, since the
+	state-sensitive algorithm in xenstored will not otherwise send
+	further watch event notifications if the domain were to be
+	shut down again.
+
+	This command will be issued in place such as resume because
+	Xen will "shutdown" the domain on suspend.
+
+	xenstored prevents the use of RESUME other than by dom0.
+
+
 SET_TARGET		<domid>|<tdomid>|
 	Notifies xenstored that domain <domid> is targeting domain
 	<tdomid>. This grants domain <domid> full access to paths
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Mar 26 15:22:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Mar 2021 15:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101907.195227 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPoHn-0004xp-O8; Fri, 26 Mar 2021 15:22:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101907.195227; Fri, 26 Mar 2021 15: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 1lPoHn-0004xh-Kx; Fri, 26 Mar 2021 15:22:07 +0000
Received: by outflank-mailman (input) for mailman id 101907;
 Fri, 26 Mar 2021 15:22: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 1lPoHl-0004xY-UP
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15: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 1lPoHl-0001B3-RD
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15:22:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPoHl-00006h-Nf
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15: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=r/O5O5tRc4bb1HTntR7b5vYwKnH4IfqKx2N0yQ6Jggc=; b=qMDLHbC7fJ7Igf9XOcjDRcvn/M
	lD+GXeE582I1i6hNiYts6c8FdIfIAGtOpc71KMCfyw8kYPNKay2gTHu7Y1UtFJKCXjJfDn/22EEE7
	COroYP5swmRnVpUbpxY7WlIJrdvFDkZ1v+LtJ/nbSWz3DRKqjJVa4saeIJRqdalO958s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Revert "x86/msr: drop compatibility #GP handling in guest_{rd,wr}msr()"
Message-Id: <E1lPoHl-00006h-Nf@xenbits.xenproject.org>
Date: Fri, 26 Mar 2021 15:22:05 +0000

commit 486cbda6dfbd1ba604cf51564dbc194ca5d0ead7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 26 16:08:39 2021 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 26 15:14:31 2021 +0000

    Revert "x86/msr: drop compatibility #GP handling in guest_{rd,wr}msr()"
    
    In hindsight, this was a poor move.  Some of these MSRs require probing for,
    cause unhelpful spew into xl dmesg, or cause spew from unit tests explicitly
    checking behaviour.
    
    This restores behaviour close to that of Xen 4.14, meaning in particular
    that for all of the MSRs getting re-added explicitly a #GP fault will get
    raised irrespective of the new "msr_relaxed" setting.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/arch/x86/msr.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index 0ebcb04259..c3a988bd11 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -175,6 +175,30 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
 
     switch ( msr )
     {
+        /* Write-only */
+    case MSR_AMD_PATCHLOADER:
+    case MSR_IA32_UCODE_WRITE:
+    case MSR_PRED_CMD:
+    case MSR_FLUSH_CMD:
+
+        /* Not offered to guests. */
+    case MSR_TEST_CTRL:
+    case MSR_CORE_CAPABILITIES:
+    case MSR_TSX_FORCE_ABORT:
+    case MSR_TSX_CTRL:
+    case MSR_MCU_OPT_CTRL:
+    case MSR_RTIT_OUTPUT_BASE ... MSR_RTIT_ADDR_B(7):
+    case MSR_U_CET:
+    case MSR_S_CET:
+    case MSR_PL0_SSP ... MSR_INTERRUPT_SSP_TABLE:
+    case MSR_AMD64_LWP_CFG:
+    case MSR_AMD64_LWP_CBADDR:
+    case MSR_PPIN_CTL:
+    case MSR_PPIN:
+    case MSR_AMD_PPIN_CTL:
+    case MSR_AMD_PPIN:
+        goto gp_fault;
+
     case MSR_IA32_FEATURE_CONTROL:
         /*
          * Architecturally, availability of this MSR is enumerated by the
@@ -382,6 +406,30 @@ int guest_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
     {
         uint64_t rsvd;
 
+        /* Read-only */
+    case MSR_IA32_PLATFORM_ID:
+    case MSR_CORE_CAPABILITIES:
+    case MSR_INTEL_CORE_THREAD_COUNT:
+    case MSR_INTEL_PLATFORM_INFO:
+    case MSR_ARCH_CAPABILITIES:
+
+        /* Not offered to guests. */
+    case MSR_TEST_CTRL:
+    case MSR_TSX_FORCE_ABORT:
+    case MSR_TSX_CTRL:
+    case MSR_MCU_OPT_CTRL:
+    case MSR_RTIT_OUTPUT_BASE ... MSR_RTIT_ADDR_B(7):
+    case MSR_U_CET:
+    case MSR_S_CET:
+    case MSR_PL0_SSP ... MSR_INTERRUPT_SSP_TABLE:
+    case MSR_AMD64_LWP_CFG:
+    case MSR_AMD64_LWP_CBADDR:
+    case MSR_PPIN_CTL:
+    case MSR_PPIN:
+    case MSR_AMD_PPIN_CTL:
+    case MSR_AMD_PPIN:
+        goto gp_fault;
+
     case MSR_AMD_PATCHLEVEL:
         BUILD_BUG_ON(MSR_IA32_UCODE_REV != MSR_AMD_PATCHLEVEL);
         /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Mar 26 15:22:19 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Mar 2021 15:22:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101908.195231 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPoHx-0004yi-Pm; Fri, 26 Mar 2021 15:22:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101908.195231; Fri, 26 Mar 2021 15: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 1lPoHx-0004ya-Mj; Fri, 26 Mar 2021 15:22:17 +0000
Received: by outflank-mailman (input) for mailman id 101908;
 Fri, 26 Mar 2021 15:22: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 1lPoHv-0004yR-Uy
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15: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 1lPoHv-0001BE-UB
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15:22:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPoHv-000086-TH
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15: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=dF9VcmOduCETvXT3Gr+vIspcZ3zwyZyw+tg6BRSp/xM=; b=z/VH13gQxuoHDtMUzFlsjmWLwp
	nJo1yu4vsndg4vnkl5p5cH3pCTttaoihN/kFrKkJOBCNTkQXn59lyy+w9BN2/XbL/D5O1YHcE+cv2
	axjiIM3L9jMCXCsPp1L4vlPxEGK6MTOvrKoWP4Xd8Yg2y2740ZYlgobyOEdEvmvha3iY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] changelog: note MSR access change
Message-Id: <E1lPoHv-000086-TH@xenbits.xenproject.org>
Date: Fri, 26 Mar 2021 15:22:15 +0000

commit 439085b2a797b627974f2bc224bdc19dc49b005d
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Mar 26 16:16:48 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 26 16:16:48 2021 +0100

    changelog: note MSR access change
    
    The change to deny all accesses to MSRs indexes not explicitly handled
    prevents leaking unwanted data into guests.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index f76fadf8c7..d81608af4d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  - ARM IOREQ servers (device emulation etc.) (Tech Preview)
  - Renesas IPMMU-VMSA (Supported, not security supported; was Tech Preview)
  - ARM SMMUv3 (Tech Preview)
+ - Switched MSR accesses to deny by default policy.
 
 ## Removed / support downgraded
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Mar 26 15:22:27 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Mar 2021 15:22:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101911.195251 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPoI7-00053r-F7; Fri, 26 Mar 2021 15:22:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101911.195251; Fri, 26 Mar 2021 15:22: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 1lPoI7-00053h-Ar; Fri, 26 Mar 2021 15:22:27 +0000
Received: by outflank-mailman (input) for mailman id 101911;
 Fri, 26 Mar 2021 15:22: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 1lPoI6-00053I-2p
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15:22: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 1lPoI6-0001BW-11
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15:22:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPoI6-0000AE-0A
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15:22:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oiCxK64/s4s/U+PMbytncka8IW4LGXWNACJeGLmIAuk=; b=3sklKPtErXxQ4vbn7hP33OWXuI
	CQ2DsuyW1tOQcxaidHGeLEx/29oDLe2YkIUKn7LICedi6CqGwmERj+SmOCI1whMkJZVi3HQQkktOS
	ITMUJrg8GofVl/q3uhNISoGgtIvq4b55RC5FCIQh5A+u9o6CL/2BUwHZwazFWPy5F88U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mem_sharing: copy parent VM's hostp2m's max_mapped_pfn during forking
Message-Id: <E1lPoI6-0000AE-0A@xenbits.xenproject.org>
Date: Fri, 26 Mar 2021 15:22:26 +0000

commit f10c41537113dc2406c26cdf134403864df02a7d
Author:     Tamas K Lengyel <tamas.lengyel@intel.com>
AuthorDate: Fri Mar 26 16:17:07 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 26 16:17:07 2021 +0100

    x86/mem_sharing: copy parent VM's hostp2m's max_mapped_pfn during forking
    
    When creating a VM fork copy the parent VM's hostp2m max_mapped_pfn value. Some
    toolstack relies on the XENMEM_maximum_gpfn value to establish the maximum
    addressable physical memory in the VM and for forks that have not yet been
    unpaused that value is not going to reflect the correct max gpfn that's
    possible to populate into the p2m. This patch fixes the issue.
    
    Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/arch/x86/mm/mem_sharing.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 00ada05c10..98b14f7b0a 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1761,6 +1761,7 @@ static int copy_settings(struct domain *cd, struct domain *d)
         return rc;
 
     copy_tsc(cd, d);
+    p2m_get_hostp2m(cd)->max_mapped_pfn = p2m_get_hostp2m(d)->max_mapped_pfn;
 
     return rc;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Mar 26 15:22:37 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Mar 2021 15:22:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101913.195253 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPoIH-00057F-Fm; Fri, 26 Mar 2021 15:22:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101913.195253; Fri, 26 Mar 2021 15:22: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 1lPoIH-000577-CW; Fri, 26 Mar 2021 15:22:37 +0000
Received: by outflank-mailman (input) for mailman id 101913;
 Fri, 26 Mar 2021 15:22: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 1lPoIG-00056u-5Q
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15:22: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 1lPoIG-0001Be-4g
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15:22:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPoIG-0000K7-3d
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15:22:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IEZ4AiWsim3HkAQAH10EgoU2qCk83pigUslhFbMzNBM=; b=Lc7MZeF91wI/EFVUqMrd1Ogar0
	1H1wpKXxd+GbErvqQyODe3pfgoaoq2/NPr8clqUeEt65ymHwyXCSPytaZbW237Ky3wOqRHv9SLAKP
	zHjV/iG3SG7mRpQyGWZQa1eTqE3MSZtG+Lg0qWNLNzlBTMhIAK/st8LbU8etnOh5Ul+Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libfsimage: Bump SONAME to 4.16
Message-Id: <E1lPoIG-0000K7-3d@xenbits.xenproject.org>
Date: Fri, 26 Mar 2021 15:22:36 +0000

commit b9005bb34f051e5da82a9b6fd5097182148c8539
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Mar 25 19:40:58 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Mar 26 15:19:05 2021 +0000

    tools/libfsimage: Bump SONAME to 4.16
    
    Fixes: a04509d34d ("Branching: Update version files etc. for newly unstable")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libfsimage/common/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libfsimage/common/Makefile b/tools/libfsimage/common/Makefile
index 060f029ca9..24bc90e73e 100644
--- a/tools/libfsimage/common/Makefile
+++ b/tools/libfsimage/common/Makefile
@@ -1,7 +1,7 @@
 XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/libfsimage/Rules.mk
 
-MAJOR = 4.15
+MAJOR = 4.16
 MINOR = 0
 
 LDFLAGS-$(CONFIG_SunOS) = -Wl,-M -Wl,mapfile-SunOS
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Mar 26 15:22:47 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Mar 2021 15:22:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101916.195259 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPoIR-00059o-J4; Fri, 26 Mar 2021 15:22:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101916.195259; Fri, 26 Mar 2021 15:22: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 1lPoIR-00059g-Fd; Fri, 26 Mar 2021 15:22:47 +0000
Received: by outflank-mailman (input) for mailman id 101916;
 Fri, 26 Mar 2021 15:22: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 1lPoIQ-00059V-Ok
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15:22: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 1lPoIQ-0001C5-Mx
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15:22:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPoIQ-0000LJ-LY
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15:22:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=o3JrbXVDm1Z/gz/rUVwjvFbZ01U+VJXIfdRytin9Jzo=; b=cJl1i+W+XfEjnFzlVuMga1rUUT
	EuRLAyNIUZZvy38EEJW/u9FbjDUbsUqSqQcfPSoGVC/RsQUrDPg0Yw+YV5/kxS2dBxGE/xFWhvI9l
	vJ6NgkfzJoltWciSn2wDBxJUYixgGGCTISlCfzlbLkqwazhZJrt/qoU9uJHII98cmEn0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] Revert "x86/msr: drop compatibility #GP handling in guest_{rd,wr}msr()"
Message-Id: <E1lPoIQ-0000LJ-LY@xenbits.xenproject.org>
Date: Fri, 26 Mar 2021 15:22:46 +0000

commit 80ee67bec31769aad8e1b6ff043b5fe5ad5f82ad
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 26 16:08:39 2021 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 26 15:15:19 2021 +0000

    Revert "x86/msr: drop compatibility #GP handling in guest_{rd,wr}msr()"
    
    In hindsight, this was a poor move.  Some of these MSRs require probing for,
    cause unhelpful spew into xl dmesg, or cause spew from unit tests explicitly
    checking behaviour.
    
    This restores behaviour close to that of Xen 4.14, meaning in particular
    that for all of the MSRs getting re-added explicitly a #GP fault will get
    raised irrespective of the new "msr_relaxed" setting.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit 486cbda6dfbd1ba604cf51564dbc194ca5d0ead7)
---
 xen/arch/x86/msr.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index 0ebcb04259..c3a988bd11 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -175,6 +175,30 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
 
     switch ( msr )
     {
+        /* Write-only */
+    case MSR_AMD_PATCHLOADER:
+    case MSR_IA32_UCODE_WRITE:
+    case MSR_PRED_CMD:
+    case MSR_FLUSH_CMD:
+
+        /* Not offered to guests. */
+    case MSR_TEST_CTRL:
+    case MSR_CORE_CAPABILITIES:
+    case MSR_TSX_FORCE_ABORT:
+    case MSR_TSX_CTRL:
+    case MSR_MCU_OPT_CTRL:
+    case MSR_RTIT_OUTPUT_BASE ... MSR_RTIT_ADDR_B(7):
+    case MSR_U_CET:
+    case MSR_S_CET:
+    case MSR_PL0_SSP ... MSR_INTERRUPT_SSP_TABLE:
+    case MSR_AMD64_LWP_CFG:
+    case MSR_AMD64_LWP_CBADDR:
+    case MSR_PPIN_CTL:
+    case MSR_PPIN:
+    case MSR_AMD_PPIN_CTL:
+    case MSR_AMD_PPIN:
+        goto gp_fault;
+
     case MSR_IA32_FEATURE_CONTROL:
         /*
          * Architecturally, availability of this MSR is enumerated by the
@@ -382,6 +406,30 @@ int guest_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
     {
         uint64_t rsvd;
 
+        /* Read-only */
+    case MSR_IA32_PLATFORM_ID:
+    case MSR_CORE_CAPABILITIES:
+    case MSR_INTEL_CORE_THREAD_COUNT:
+    case MSR_INTEL_PLATFORM_INFO:
+    case MSR_ARCH_CAPABILITIES:
+
+        /* Not offered to guests. */
+    case MSR_TEST_CTRL:
+    case MSR_TSX_FORCE_ABORT:
+    case MSR_TSX_CTRL:
+    case MSR_MCU_OPT_CTRL:
+    case MSR_RTIT_OUTPUT_BASE ... MSR_RTIT_ADDR_B(7):
+    case MSR_U_CET:
+    case MSR_S_CET:
+    case MSR_PL0_SSP ... MSR_INTERRUPT_SSP_TABLE:
+    case MSR_AMD64_LWP_CFG:
+    case MSR_AMD64_LWP_CBADDR:
+    case MSR_PPIN_CTL:
+    case MSR_PPIN:
+    case MSR_AMD_PPIN_CTL:
+    case MSR_AMD_PPIN:
+        goto gp_fault;
+
     case MSR_AMD_PATCHLEVEL:
         BUILD_BUG_ON(MSR_IA32_UCODE_REV != MSR_AMD_PATCHLEVEL);
         /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Mar 26 15:33:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Mar 2021 15:33:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101924.195274 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPoSQ-0006Rk-Jo; Fri, 26 Mar 2021 15:33:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101924.195274; Fri, 26 Mar 2021 15: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 1lPoSQ-0006Rc-Gc; Fri, 26 Mar 2021 15:33:06 +0000
Received: by outflank-mailman (input) for mailman id 101924;
 Fri, 26 Mar 2021 15: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 1lPoSP-0006RX-6Z
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15: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 1lPoSP-0001Ok-4j
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPoSP-0001CF-1J
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15: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=hb9by8ac/rK196ftNk2hziR0lB7O+6zEyAxK0Djgvl0=; b=PqFK7wttL95DI73JpQgH4X+pSl
	BuVBPWeH8MdKvWDnzQcfOU5mTLDhKkLyKLpSkW+QwX+cXp7VpJ6PnKO74Ugi3XXZK8M8MU0GzTVSF
	i/YJqbG/tWAFG5bOkBkKrEwFSsg1DtN0dqkx70dRgb1n3UiyX0mDoT6+XV7hYAQVQBL0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CHANGELOG: Correct sub-section headings
Message-Id: <E1lPoSP-0001CF-1J@xenbits.xenproject.org>
Date: Fri, 26 Mar 2021 15:33:05 +0000

commit 8bfceeed789e4394a9c45403a19f29909f2b2641
Author:     Ian Jackson <iwj@xenproject.org>
AuthorDate: Wed Mar 24 16:30:30 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 26 15:25:54 2021 +0000

    CHANGELOG: Correct sub-section headings
    
    Signed-off-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit 0f93d79a97121c55d3f3e26304d437ddb38de6a7)
---
 CHANGELOG.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index d81608af4d..ffbf71fcb9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,13 +8,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 
 ## [4.15.0 UNRELEASED](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.15.0) - TBD
 
-## Added / support upgraded
+### Added / support upgraded
  - ARM IOREQ servers (device emulation etc.) (Tech Preview)
  - Renesas IPMMU-VMSA (Supported, not security supported; was Tech Preview)
  - ARM SMMUv3 (Tech Preview)
  - Switched MSR accesses to deny by default policy.
 
-## Removed / support downgraded
+### Removed / support downgraded
 
  - qemu-xen-traditional as host process device model, now "No security
    support, not recommended".  (Use as stub domain device model is still
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Mar 26 15:33:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Mar 2021 15:33:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101925.195278 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPoSb-0006Sc-LM; Fri, 26 Mar 2021 15:33:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101925.195278; Fri, 26 Mar 2021 15: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 1lPoSb-0006SU-II; Fri, 26 Mar 2021 15:33:17 +0000
Received: by outflank-mailman (input) for mailman id 101925;
 Fri, 26 Mar 2021 15:33: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 1lPoSa-0006SN-3c
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15:33: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 1lPoSa-0001Oq-28
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15:33:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPoSa-0001DV-0U
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15:33:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=m2s71a0CPIf6dmD/TUDh8e/j7rrZ4q6ynAaxO4QYCjM=; b=I3rWgNZ196sDQyd1wMjE0UNq6T
	lpUG1GJ8wp+bfBZgCrvcB9pat/odoLGpIxhfC0jiEwV0vthgsGQ0IP6XFynNzncXzLXx6TweNOGXi
	zt8WTreRb9dVjvza58PedI58Bl0VHrROzhNf5A39XQp+P0ChmKxOeLSnrDEs/puBIhg4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] changelog: note MSR access change
Message-Id: <E1lPoSa-0001DV-0U@xenbits.xenproject.org>
Date: Fri, 26 Mar 2021 15:33:16 +0000

commit cbc8a90dc2ed6dac1333d2cb83044610b1d5f587
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Mar 26 16:22:40 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 26 16:22:40 2021 +0100

    changelog: note MSR access change
    
    The change to deny all accesses to MSRs indexes not explicitly handled
    prevents leaking unwanted data into guests.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    master commit: 439085b2a797b627974f2bc224bdc19dc49b005d
    master date: 2021-03-26 16:16:48 +0100
---
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 07f240b6ab..30b53e73e8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  - ARM IOREQ servers (device emulation etc.) (Tech Preview)
  - Renesas IPMMU-VMSA (Supported, not security supported; was Tech Preview)
  - ARM SMMUv3 (Tech Preview)
+ - Switched MSR accesses to deny by default policy.
 
 ### Removed / support downgraded
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Mar 26 15:33:27 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Mar 2021 15:33:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101926.195282 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPoSl-0006Tk-Mk; Fri, 26 Mar 2021 15:33:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101926.195282; Fri, 26 Mar 2021 15: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 1lPoSl-0006Tc-Jp; Fri, 26 Mar 2021 15:33:27 +0000
Received: by outflank-mailman (input) for mailman id 101926;
 Fri, 26 Mar 2021 15:33: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 1lPoSk-0006TU-7V
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15:33: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 1lPoSk-0001P0-5i
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15:33:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPoSk-0001ET-4N
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 15:33:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=l1uBAN7g3mLOmWsMJK8ZnM/xRokDtusG3Y65DV298A4=; b=iJI92B1U736xtHoBp5bsR1NgC9
	3sUgwCpELXySQt+Hzfptve5J+ANUthBiHOf6/LrobYZvhzY27u5LMQsT72m16AkF2OtnX8Q0bFgSc
	RXLzgZnXWwXZtBhyPh37uAtBKj7m0kiEnuFrtvDpL0sG8DoNJPOx92LyJh2/Kj/wtneA=;
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: copy parent VM's hostp2m's max_mapped_pfn during forking
Message-Id: <E1lPoSk-0001ET-4N@xenbits.xenproject.org>
Date: Fri, 26 Mar 2021 15:33:26 +0000

commit b712639084b91917a24304dc3d6b019c386b279a
Author:     Tamas K Lengyel <tamas.lengyel@intel.com>
AuthorDate: Fri Mar 26 16:23:00 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 26 16:23:00 2021 +0100

    x86/mem_sharing: copy parent VM's hostp2m's max_mapped_pfn during forking
    
    When creating a VM fork copy the parent VM's hostp2m max_mapped_pfn value. Some
    toolstack relies on the XENMEM_maximum_gpfn value to establish the maximum
    addressable physical memory in the VM and for forks that have not yet been
    unpaused that value is not going to reflect the correct max gpfn that's
    possible to populate into the p2m. This patch fixes the issue.
    
    Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    master commit: f10c41537113dc2406c26cdf134403864df02a7d
    master date: 2021-03-26 16:17:07 +0100
---
 xen/arch/x86/mm/mem_sharing.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 00ada05c10..98b14f7b0a 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1761,6 +1761,7 @@ static int copy_settings(struct domain *cd, struct domain *d)
         return rc;
 
     copy_tsc(cd, d);
+    p2m_get_hostp2m(cd)->max_mapped_pfn = p2m_get_hostp2m(d)->max_mapped_pfn;
 
     return rc;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Mar 26 17:22:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Mar 2021 17:22:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101985.195409 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPq9u-0003gZ-8K; Fri, 26 Mar 2021 17:22:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101985.195409; Fri, 26 Mar 2021 17: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 1lPq9u-0003gR-5H; Fri, 26 Mar 2021 17:22:06 +0000
Received: by outflank-mailman (input) for mailman id 101985;
 Fri, 26 Mar 2021 17: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 1lPq9t-0003gM-7K
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 17: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 1lPq9t-0003iM-5R
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 17:22:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPq9t-0006Bs-2W
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 17: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=B1D3cVHBPVirBD/0vdOkdxzY+Jk3k7ffuYeYcl707B0=; b=b/kc2M/XDfmgrWeVFqvh8SV0bF
	hIuHNY8foEETH/UVUoxE0ahAVUyxTSe4/vzQHo07mY5DpDkkNodQBNc2SwC768IeRwcUQ//xm6E5F
	9iKqLQn9hvmmcG/WVuA09FlJqtsSm5/WAWpvB8xoQ7FwhR0J48n/C/5Kjzl6SsG35684=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/HPET: don't enable legacy replacement mode unconditionally
Message-Id: <E1lPq9t-0006Bs-2W@xenbits.xenproject.org>
Date: Fri, 26 Mar 2021 17:22:05 +0000

commit e680cc48b7184d3489873d6776f84ba1fc238ced
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Mar 24 11:34:32 2021 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 26 17:02:55 2021 +0000

    x86/HPET: don't enable legacy replacement mode unconditionally
    
    Commit e1de4c196a2e ("x86/timer: Fix boot on Intel systems using ITSSPRC
    static PIT clock gating") was reported to cause boot failures on certain
    AMD Ryzen systems. Until we can figure out what the actual issue there
    is, skip this new part of HPET setup by default. Introduce a "hpet"
    command line option to allow enabling this on hardware where it's really
    needed for Xen to boot successfully (i.e. where the PIT doesn't drive
    the timer interrupt).
    
    Since it makes little sense to introduce just "hpet=legacy-replacement",
    also allow for a boolean argument as well as "broadcast" to replace the
    separate "hpetbroadcast" option.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 docs/misc/xen-command-line.pandoc | 17 +++++++++++++++++
 xen/arch/x86/hpet.c               | 37 +++++++++++++++++++++++++++++++------
 2 files changed, 48 insertions(+), 6 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index a0601ff838..deef6d0b4c 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1274,9 +1274,26 @@ supported. See docs/misc/arm/big.LITTLE.txt for more information.
 When the hmp-unsafe option is disabled (default), CPUs that are not
 identical to the boot CPU will be parked and not used by Xen.
 
+### hpet (x86)
+> `= List of [ <boolean> | broadcast | legacy-replacement ]`
+
+> Default : `true`, `no-broadcast`, 'no-legacy-replacement`
+
+Controls Xen's use of the system's High Precision Event Timer.  The boolean
+allows to turn off use altogether.
+
+`broadcast` forces Xen to keep using the broadcast for CPUs in deep C-states
+even when an RTC interrupt got enabled.
+
+`legacy-replacement` is intended to be used on platforms where the timer
+interrupt doesn't get raised by the legacy PIT.  This then also affects
+raising of the RTC interrupt.
+
 ### hpetbroadcast (x86)
 > `= <boolean>`
 
+Deprecated alternative of `hpet=broadcast`.
+
 ### hvm_debug (x86)
 > `= <integer>`
 
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 1ff005fb4a..76d9ef2c02 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -52,6 +52,8 @@ static unsigned int __read_mostly num_hpets_used;
 DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel);
 
 unsigned long __initdata hpet_address;
+static bool __initdata opt_hpet = true;
+static bool __initdata opt_legacy_replacement;
 u8 __initdata hpet_blockid;
 u8 __initdata hpet_flags;
 
@@ -63,6 +65,32 @@ u8 __initdata hpet_flags;
 static bool __initdata force_hpet_broadcast;
 boolean_param("hpetbroadcast", force_hpet_broadcast);
 
+static int __init parse_hpet_param(const char *s)
+{
+    const char *ss;
+    int val, rc = 0;
+
+    do {
+        ss = strchr(s, ',');
+        if ( !ss )
+            ss = strchr(s, '\0');
+
+        if ( (val = parse_bool(s, ss)) >= 0 )
+            opt_hpet = val;
+        else if ( (val = parse_boolean("broadcast", s, ss)) >= 0 )
+            force_hpet_broadcast = val;
+        else if ( (val = parse_boolean("legacy-replacement", s, ss)) >= 0 )
+            opt_legacy_replacement = val;
+        else
+            rc = -EINVAL;
+
+        s = ss + 1;
+    } while ( *ss );
+
+    return rc;
+}
+custom_param("hpet", parse_hpet_param);
+
 /*
  * Calculate a multiplication factor for scaled math, which is used to convert
  * nanoseconds based values to clock ticks:
@@ -761,12 +789,9 @@ u64 __init hpet_setup(void)
     unsigned int hpet_id, hpet_period, hpet_cfg;
     unsigned int last, rem;
 
-    if ( hpet_rate )
+    if ( hpet_rate || !hpet_address || !opt_hpet )
         return hpet_rate;
 
-    if ( hpet_address == 0 )
-        return 0;
-
     set_fixmap_nocache(FIX_HPET_BASE, hpet_address);
 
     hpet_id = hpet_read32(HPET_ID);
@@ -803,9 +828,9 @@ u64 __init hpet_setup(void)
      * IRQ routing is configured.
      *
      * Reconfigure the HPET into legacy mode to re-establish the timer
-     * interrupt.
+     * interrupt, if available and if so requested.
      */
-    if ( hpet_id & HPET_ID_LEGSUP &&
+    if ( opt_legacy_replacement && (hpet_id & HPET_ID_LEGSUP) &&
          !((hpet_cfg = hpet_read32(HPET_CFG)) & HPET_CFG_LEGACY) )
     {
         unsigned int c0_cfg, ticks, count;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Mar 26 17:22:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Mar 2021 17:22:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.101986.195413 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPqA4-0003hQ-9v; Fri, 26 Mar 2021 17:22:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 101986.195413; Fri, 26 Mar 2021 17:22: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 1lPqA4-0003hI-6t; Fri, 26 Mar 2021 17:22:16 +0000
Received: by outflank-mailman (input) for mailman id 101986;
 Fri, 26 Mar 2021 17: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 1lPqA3-0003hD-R3
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 17: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 1lPqA3-0003iT-PT
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 17:22:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPqA3-0006DD-OJ
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 17: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=m5XDXOkxcEZuxyQJObn0Yl4YyXjyQMdC7QAyNCSs47Y=; b=wfYNvEyf3ZO4mBciADV6AW8c4R
	GsmL1v8bOEK6bvHWlbzwjWsOtAYtlaIM3D4nZa4ziWuVPPtJoQZMEF01pvrUl2RjuxqkwOzkMLr1z
	CiKpX3tp98ighJZM7g652qrWlW7V+TEz0/4YbzTSbUOWku+RbBByRnv7bXnYU3xxvHxg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.15] x86/HPET: don't enable legacy replacement mode unconditionally
Message-Id: <E1lPqA3-0006DD-OJ@xenbits.xenproject.org>
Date: Fri, 26 Mar 2021 17:22:15 +0000

commit 7fa14f3f525b4a2d660794424fd787cfdf9c904b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Mar 24 11:34:32 2021 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 26 17:12:54 2021 +0000

    x86/HPET: don't enable legacy replacement mode unconditionally
    
    Commit e1de4c196a2e ("x86/timer: Fix boot on Intel systems using ITSSPRC
    static PIT clock gating") was reported to cause boot failures on certain
    AMD Ryzen systems. Until we can figure out what the actual issue there
    is, skip this new part of HPET setup by default. Introduce a "hpet"
    command line option to allow enabling this on hardware where it's really
    needed for Xen to boot successfully (i.e. where the PIT doesn't drive
    the timer interrupt).
    
    Since it makes little sense to introduce just "hpet=legacy-replacement",
    also allow for a boolean argument as well as "broadcast" to replace the
    separate "hpetbroadcast" option.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit e680cc48b7184d3489873d6776f84ba1fc238ced)
---
 docs/misc/xen-command-line.pandoc | 17 +++++++++++++++++
 xen/arch/x86/hpet.c               | 37 +++++++++++++++++++++++++++++++------
 2 files changed, 48 insertions(+), 6 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index a0601ff838..deef6d0b4c 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1274,9 +1274,26 @@ supported. See docs/misc/arm/big.LITTLE.txt for more information.
 When the hmp-unsafe option is disabled (default), CPUs that are not
 identical to the boot CPU will be parked and not used by Xen.
 
+### hpet (x86)
+> `= List of [ <boolean> | broadcast | legacy-replacement ]`
+
+> Default : `true`, `no-broadcast`, 'no-legacy-replacement`
+
+Controls Xen's use of the system's High Precision Event Timer.  The boolean
+allows to turn off use altogether.
+
+`broadcast` forces Xen to keep using the broadcast for CPUs in deep C-states
+even when an RTC interrupt got enabled.
+
+`legacy-replacement` is intended to be used on platforms where the timer
+interrupt doesn't get raised by the legacy PIT.  This then also affects
+raising of the RTC interrupt.
+
 ### hpetbroadcast (x86)
 > `= <boolean>`
 
+Deprecated alternative of `hpet=broadcast`.
+
 ### hvm_debug (x86)
 > `= <integer>`
 
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 1ff005fb4a..76d9ef2c02 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -52,6 +52,8 @@ static unsigned int __read_mostly num_hpets_used;
 DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel);
 
 unsigned long __initdata hpet_address;
+static bool __initdata opt_hpet = true;
+static bool __initdata opt_legacy_replacement;
 u8 __initdata hpet_blockid;
 u8 __initdata hpet_flags;
 
@@ -63,6 +65,32 @@ u8 __initdata hpet_flags;
 static bool __initdata force_hpet_broadcast;
 boolean_param("hpetbroadcast", force_hpet_broadcast);
 
+static int __init parse_hpet_param(const char *s)
+{
+    const char *ss;
+    int val, rc = 0;
+
+    do {
+        ss = strchr(s, ',');
+        if ( !ss )
+            ss = strchr(s, '\0');
+
+        if ( (val = parse_bool(s, ss)) >= 0 )
+            opt_hpet = val;
+        else if ( (val = parse_boolean("broadcast", s, ss)) >= 0 )
+            force_hpet_broadcast = val;
+        else if ( (val = parse_boolean("legacy-replacement", s, ss)) >= 0 )
+            opt_legacy_replacement = val;
+        else
+            rc = -EINVAL;
+
+        s = ss + 1;
+    } while ( *ss );
+
+    return rc;
+}
+custom_param("hpet", parse_hpet_param);
+
 /*
  * Calculate a multiplication factor for scaled math, which is used to convert
  * nanoseconds based values to clock ticks:
@@ -761,12 +789,9 @@ u64 __init hpet_setup(void)
     unsigned int hpet_id, hpet_period, hpet_cfg;
     unsigned int last, rem;
 
-    if ( hpet_rate )
+    if ( hpet_rate || !hpet_address || !opt_hpet )
         return hpet_rate;
 
-    if ( hpet_address == 0 )
-        return 0;
-
     set_fixmap_nocache(FIX_HPET_BASE, hpet_address);
 
     hpet_id = hpet_read32(HPET_ID);
@@ -803,9 +828,9 @@ u64 __init hpet_setup(void)
      * IRQ routing is configured.
      *
      * Reconfigure the HPET into legacy mode to re-establish the timer
-     * interrupt.
+     * interrupt, if available and if so requested.
      */
-    if ( hpet_id & HPET_ID_LEGSUP &&
+    if ( opt_legacy_replacement && (hpet_id & HPET_ID_LEGSUP) &&
          !((hpet_cfg = hpet_read32(HPET_CFG)) & HPET_CFG_LEGACY) )
     {
         unsigned int c0_cfg, ticks, count;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Mar 26 20:11:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Mar 2021 20:11:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.102089.195571 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPsnP-0007pt-Sz; Fri, 26 Mar 2021 20:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 102089.195571; Fri, 26 Mar 2021 20: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 1lPsnP-0007pl-Pp; Fri, 26 Mar 2021 20:11:03 +0000
Received: by outflank-mailman (input) for mailman id 102089;
 Fri, 26 Mar 2021 20: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 1lPsnO-0007pe-MD
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 20: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 1lPsnO-0006Zs-Kx
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 20:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPsnO-0001sF-J6
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 20: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=a+Ad2JqRQt4allW8KCmF7URbtgRj3tKj1ygDdjqCTL0=; b=KrwA5oIedxLKglzowiOmcRV6L7
	HRQnPzbtql8lRZyx0PHzNz/A4/JD/Mifwb94cdG9uNG0bU5aSHFHaCPAJv8H4LIgQGNciF+l88S3r
	4LohNHBbxY9MN3NnIRcdK2rGkzGLyGOsbB/+K6DJxHO4T+diVdajgQhhUm8uxlLUt9Ok=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] VT-d: correct off-by-1 in number-of-IOMMUs check
Message-Id: <E1lPsnO-0001sF-J6@xenbits.xenproject.org>
Date: Fri, 26 Mar 2021 20:11:02 +0000

commit b9b3082002cac68726fb303e0abd2ff0113d4657
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 23 17:01:30 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 23 17:01:30 2021 +0100

    VT-d: correct off-by-1 in number-of-IOMMUs check
    
    Otherwise, if we really run on a system with this many IOMMUs,
    entering/leaving S3 would overrun iommu_state[].
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/drivers/passthrough/vtd/iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 9b58d566c8..44e407d19f 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1168,10 +1168,10 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
     unsigned long sagaw, nr_dom;
     int agaw;
 
-    if ( nr_iommus > MAX_IOMMUS )
+    if ( nr_iommus >= MAX_IOMMUS )
     {
         dprintk(XENLOG_ERR VTDPREFIX,
-                 "IOMMU: nr_iommus %d > MAX_IOMMUS\n", nr_iommus);
+                "IOMMU: nr_iommus %d > MAX_IOMMUS\n", nr_iommus + 1);
         return -ENOMEM;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Mar 26 20:11:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Mar 2021 20:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.102090.195574 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPsnZ-0007r3-Vt; Fri, 26 Mar 2021 20:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 102090.195574; Fri, 26 Mar 2021 20: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 1lPsnZ-0007qv-Ss; Fri, 26 Mar 2021 20:11:13 +0000
Received: by outflank-mailman (input) for mailman id 102090;
 Fri, 26 Mar 2021 20: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 1lPsnY-0007qo-Or
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 20: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 1lPsnY-0006Zy-O6
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 20:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPsnY-0001sp-ND
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 20: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=8zHOsHPFlA/3nGayyo+0AgdfCKrNUaljutq+p+VuwwY=; b=6C/4NELbxmYaKUED2TqF2sTkEi
	ylEAalYJC1QDQZhteOWN2uYTWNk+5pXqSRfogN5sRhG9oILiHBh6QnrUmeMNyI1ESBsVvgBnqzvGM
	Y34eC5cY7lpTlP5YcjVtynZAvrWoHaGeGmZhT0qNeBTDO83c8RSjmPFuQouRDY5U2ZWg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] 4.15: Turn off debug on the stable branch
Message-Id: <E1lPsnY-0001sp-ND@xenbits.xenproject.org>
Date: Fri, 26 Mar 2021 20:11:12 +0000

commit 2c7096b2f8cf9faf28d7f961ea6181961fa847e9
Author:     Ian Jackson <iwj@xenproject.org>
AuthorDate: Wed Mar 24 16:31:11 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Wed Mar 24 16:31:32 2021 +0000

    4.15: Turn off debug on the stable branch
    
    Signed-off-by: Ian Jackson <iwj@xenproject.org>
---
 tools/Rules.mk    | 2 +-
 xen/Kconfig.debug | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index 2907ed2d39..444e5bacdd 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -20,7 +20,7 @@ CFLAGS_xeninclude = -I$(XEN_INCLUDE)
 XENSTORE_XENSTORED ?= y
 
 # A debug build of tools?
-debug ?= y
+debug ?= n
 debug_symbols ?= $(debug)
 
 XEN_GOCODE_URL    = golang.xenproject.org
diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug
index fad3050d4f..4419030235 100644
--- a/xen/Kconfig.debug
+++ b/xen/Kconfig.debug
@@ -3,7 +3,7 @@ menu "Debugging Options"
 
 config DEBUG
 	bool "Developer Checks"
-	default y
+	default n
 	---help---
 	  If you say Y here this will enable developer checks such as asserts
 	  and extra printks. This option is intended for development purposes
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Fri Mar 26 20:11:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Mar 2021 20:11:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.102091.195579 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lPsnk-0007sa-19; Fri, 26 Mar 2021 20:11:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 102091.195579; Fri, 26 Mar 2021 20: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 1lPsnj-0007sS-UN; Fri, 26 Mar 2021 20:11:23 +0000
Received: by outflank-mailman (input) for mailman id 102091;
 Fri, 26 Mar 2021 20: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 1lPsni-0007sH-U3
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 20: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 1lPsni-0006a8-Re
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 20:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lPsni-0001tP-QZ
 for xen-changelog@lists.xenproject.org; Fri, 26 Mar 2021 20: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=0j9zBD3gEKhxE05kTPojEz9Xj6DdO7NocWx7eMFrh14=; b=nJzm1OtgsNGouOyvM25gkCH7kg
	q3UT8I3XOT6wlUFxnDt8OQENkDuq/rl8tvKRmBjoBSvcUNARXT33p95tSG6umdIp+ozxqAzdY20ph
	/tO+VurcWl4gjeqtESXY7dPIgSLKdSaysVv5nyyzhBck2yEd0ucCPCedJUCdCu2uP1SU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] CHANGELOG: Correct sub-section headings
Message-Id: <E1lPsni-0001tP-QZ@xenbits.xenproject.org>
Date: Fri, 26 Mar 2021 20:11:22 +0000

commit 0f93d79a97121c55d3f3e26304d437ddb38de6a7
Author:     Ian Jackson <iwj@xenproject.org>
AuthorDate: Wed Mar 24 16:30:30 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Wed Mar 24 16:31:32 2021 +0000

    CHANGELOG: Correct sub-section headings
    
    Signed-off-by: Ian Jackson <iwj@xenproject.org>
---
 CHANGELOG.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index c407f6bb2f..07f240b6ab 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,12 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 
 ## [4.15.0 UNRELEASED](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.15.0) - TBD
 
-## Added / support upgraded
+### Added / support upgraded
  - ARM IOREQ servers (device emulation etc.) (Tech Preview)
  - Renesas IPMMU-VMSA (Supported, not security supported; was Tech Preview)
  - ARM SMMUv3 (Tech Preview)
 
-## Removed / support downgraded
+### Removed / support downgraded
 
  - qemu-xen-traditional as host process device model, now "No security
    support, not recommended".  (Use as stub domain device model is still
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Sat Mar 27 10:33:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Mar 2021 10:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.102195.195754 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lQ6Fc-0001Kf-MK; Sat, 27 Mar 2021 10:33:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 102195.195754; Sat, 27 Mar 2021 10:33: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 1lQ6Fc-0001KW-J2; Sat, 27 Mar 2021 10:33:04 +0000
Received: by outflank-mailman (input) for mailman id 102195;
 Sat, 27 Mar 2021 10: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 1lQ6Fa-0001KR-Kh
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 2021 10: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 1lQ6Fa-0007NZ-FU
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 2021 10:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lQ6Fa-0007HA-D5
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 2021 10: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=HG2poTETrUolemQLe9voJH9gWbM+co5MKnh5Xsr4AuM=; b=oXC6XIcTNNc/7zJ+INXxYQ409o
	T63VCz0HyO5Xwd8IVVtYZtBRtfvAdE5XrREuYfhc6HkdJndppRppFjcOEvorbUwq1iAmuJxQ0g3ne
	rYkI18JotGzUkHt4CCDU+cnMWQxr2totx//7bi9TC8k0ssPekMs/7itKehcAtMTuRdKE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Drop "-rc" suffix from XEN_EXTRAVERSION
Message-Id: <E1lQ6Fa-0007HA-D5@xenbits.xenproject.org>
Date: Sat, 27 Mar 2021 10:33:02 +0000

commit 4ca6217bef99128027a9b64c055e4967a5dabd0c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Mar 25 15:05:55 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Mar 25 16:58:10 2021 +0000

    xen: Drop "-rc" suffix from XEN_EXTRAVERSION
    
    Fixes: a04509d34d ("Branching: Update version files etc. for newly unstable")
    Signed-off-by: Andrew Cooper <andrew.cooper3@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 ab7d86d226..9f3be7766d 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 16
-export XEN_EXTRAVERSION ?= -unstable-rc$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= -unstable$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Mar 27 21:11:09 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Mar 2021 21:11:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.102297.195890 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lQGD1-0006et-TO; Sat, 27 Mar 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 102297.195890; Sat, 27 Mar 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 1lQGD1-0006ek-Q4; Sat, 27 Mar 2021 21:11:03 +0000
Received: by outflank-mailman (input) for mailman id 102297;
 Sat, 27 Mar 2021 21: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 1lQGD0-0006ef-K1
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 2021 21: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 1lQGD0-0001bc-IB
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 2021 21:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lQGD0-0000LK-GR
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 2021 21: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=PKD/4fbmf+0JxgcAckryZKGW4sKPhYTT75xALgR6acg=; b=lyQ6P+AUWqe/nWjXiOiWFFih2I
	8biF0tWVwkb12Hh+hQHSsGMKaUWEZcrmnOHMDtsthNoJShInao+l/qxIof50bxdkhWHISoywYTpxK
	PT60OP0P2w4McHTZST+Od5cwsD2vjTwV/zYERk4IEs5pNLD/co8mKWOewLh4hs1C58Kg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] docs/design: Update xenstore-migration.md
Message-Id: <E1lQGD0-0000LK-GR@xenbits.xenproject.org>
Date: Sat, 27 Mar 2021 21:11:02 +0000

commit 7ff29c96dee274826bc375b77dee8db0ce930344
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Mar 25 10:42:46 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Mar 26 12:13:16 2021 +0000

    docs/design: Update xenstore-migration.md
    
    It is not very clear the shared page adddress is not contained in the
    connection record. Additionally, it is misleading to say the grant
    will always point to the share paged as a domain is free to revoke the
    permission. The restore code would need to make sure it doesn't
    fail/crash if this is happening.
    
    The sentence is now replaced with a paragraph explaining why the GFN is
    not preserved and that the grant is not guarantee to exist during
    restore.
    
    Take the opportunity to replace "code" with "node" when description the
    permission.
    
    Reported-by: Raphael Ning <raphning@amazon.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit 7b6d288ef648c76da70fd9e41e73617631025cfe)
---
 docs/designs/xenstore-migration.md | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/docs/designs/xenstore-migration.md b/docs/designs/xenstore-migration.md
index 1a5b94b31d..5f1155273e 100644
--- a/docs/designs/xenstore-migration.md
+++ b/docs/designs/xenstore-migration.md
@@ -216,8 +216,10 @@ For `shared ring` connections it is as follows:
 |           | by xenstored to communicate with `domid`          |
 |           |                                                   |
 
-Since the ABI guarantees that entry 1 in `domid`'s grant table will always
-contain the GFN of the shared page.
+The GFN of the shared page is not preserved because the ABI reserves
+entry 1 in `domid`'s grant table to point to the xenstore shared page.
+Note there is no guarantee the page will still be valid at the time of
+the restore because a domain can revoke the permission.
 
 For `socket` connections it is as follows:
 
@@ -398,7 +400,7 @@ A node permission specifier has the following format:
 |         |                                                     |
 | `domid` | The domain-id to which the permission relates       |
 
-Note that perm1 defines the domain owning the code. See [4] for more
+Note that perm1 defines the domain owning the node. See [4] for more
 explanation of node permissions.
 
 * * *
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Sat Mar 27 21:11:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Mar 2021 21:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.102298.195894 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lQGDB-0006fl-Uq; Sat, 27 Mar 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 102298.195894; Sat, 27 Mar 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 1lQGDB-0006fd-Rl; Sat, 27 Mar 2021 21:11:13 +0000
Received: by outflank-mailman (input) for mailman id 102298;
 Sat, 27 Mar 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 1lQGDA-0006fW-MT
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 2021 21: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 1lQGDA-0001bf-Lf
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 2021 21:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lQGDA-0000M6-KS
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 2021 21:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ciDpM14NjNAtM5Ifsz0tMcCNqnif3gAwqDE9RdtqaJM=; b=uFesCp8xSzFESsL0fUpWdE/LT2
	JD0yRg0M3dhqOeaqs/8w6CTQp8T+pI5aOF7rMt55piHUzHx2siNQOYWlqScZ+PZrAt+8ukMxAuFO/
	D07ENjlKRa3UmgaM8BdCWPapz+16lsHwkKf79kcz9YWNrOxfoPb+S191RJsRig2Bt9/E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] docs/misc: xenstored: Re-instate and tweak the documentation for XS_RESUME
Message-Id: <E1lQGDA-0000M6-KS@xenbits.xenproject.org>
Date: Sat, 27 Mar 2021 21:11:12 +0000

commit 7087b61fc4bfc19367d39f48649cfe0837ee45e2
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Mar 25 17:46:30 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Mar 26 12:13:17 2021 +0000

    docs/misc: xenstored: Re-instate and tweak the documentation for XS_RESUME
    
    Commit 13dd372834a4 removed the documentation for XS_RESUME, however
    this command is still implemented (at least in C Xenstored) and used by
    libxl when resuming a domain.
    
    So re-instate the documentation for the XS_RESUME. Take the opportunity
    to update it as there is a user of the command.
    
    Fixes: 13dd372834a4 ("docs/designs: re-work the xenstore migration document...")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit 03bee3fd475cb755572dd21214daecf9a77a6bb4)
---
 docs/misc/xenstore.txt | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/docs/misc/xenstore.txt b/docs/misc/xenstore.txt
index 1480742330..334dc8b6fd 100644
--- a/docs/misc/xenstore.txt
+++ b/docs/misc/xenstore.txt
@@ -294,6 +294,22 @@ IS_DOMAIN_INTRODUCED	<domid>|		T| or F|
 	ie, if INTRODUCE for the domain has not yet been followed by
 	domain destruction or explicit RELEASE.
 
+RESUME			<domid>|
+
+	Arranges that @releaseDomain events will once more be
+	generated when the domain becomes shut down.  This might have
+	to be used if a domain were to be shut down (generating one
+	@releaseDomain) and then subsequently restarted, since the
+	state-sensitive algorithm in xenstored will not otherwise send
+	further watch event notifications if the domain were to be
+	shut down again.
+
+	This command will be issued in place such as resume because
+	Xen will "shutdown" the domain on suspend.
+
+	xenstored prevents the use of RESUME other than by dom0.
+
+
 SET_TARGET		<domid>|<tdomid>|
 	Notifies xenstored that domain <domid> is targeting domain
 	<tdomid>. This grants domain <domid> full access to paths
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Sat Mar 27 21:11:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Mar 2021 21:11:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.102299.195898 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lQGDM-0006gs-0I; Sat, 27 Mar 2021 21:11:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 102299.195898; Sat, 27 Mar 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 1lQGDL-0006gk-TR; Sat, 27 Mar 2021 21:11:23 +0000
Received: by outflank-mailman (input) for mailman id 102299;
 Sat, 27 Mar 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 1lQGDK-0006gd-Rk
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 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 1lQGDK-0001bo-QY
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 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 1lQGDK-0000Ma-Nw
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 2021 21: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=cEVUioasYjdSRbCyLfP6WF9qUeRrEHJaVNAZaWslicA=; b=3nKuCbrgcSv1OruMfRl57FWd7d
	PejLgZTkO+uVor0tqznHl67aGlICtLpmVKmB9Vib8rOwbwg0pLx9YoJHjorQ5dB8M5y4AoSMV6I69
	ZKHHueZEQHOBTCo96zaky1GqeKgojlbNsQD6s8OHUeQcphb56qWMbsEIqOXo0fKF1g7g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] Revert "x86/msr: drop compatibility #GP handling in guest_{rd,wr}msr()"
Message-Id: <E1lQGDK-0000Ma-Nw@xenbits.xenproject.org>
Date: Sat, 27 Mar 2021 21:11:22 +0000

commit 80ee67bec31769aad8e1b6ff043b5fe5ad5f82ad
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 26 16:08:39 2021 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 26 15:15:19 2021 +0000

    Revert "x86/msr: drop compatibility #GP handling in guest_{rd,wr}msr()"
    
    In hindsight, this was a poor move.  Some of these MSRs require probing for,
    cause unhelpful spew into xl dmesg, or cause spew from unit tests explicitly
    checking behaviour.
    
    This restores behaviour close to that of Xen 4.14, meaning in particular
    that for all of the MSRs getting re-added explicitly a #GP fault will get
    raised irrespective of the new "msr_relaxed" setting.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit 486cbda6dfbd1ba604cf51564dbc194ca5d0ead7)
---
 xen/arch/x86/msr.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index 0ebcb04259..c3a988bd11 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -175,6 +175,30 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
 
     switch ( msr )
     {
+        /* Write-only */
+    case MSR_AMD_PATCHLOADER:
+    case MSR_IA32_UCODE_WRITE:
+    case MSR_PRED_CMD:
+    case MSR_FLUSH_CMD:
+
+        /* Not offered to guests. */
+    case MSR_TEST_CTRL:
+    case MSR_CORE_CAPABILITIES:
+    case MSR_TSX_FORCE_ABORT:
+    case MSR_TSX_CTRL:
+    case MSR_MCU_OPT_CTRL:
+    case MSR_RTIT_OUTPUT_BASE ... MSR_RTIT_ADDR_B(7):
+    case MSR_U_CET:
+    case MSR_S_CET:
+    case MSR_PL0_SSP ... MSR_INTERRUPT_SSP_TABLE:
+    case MSR_AMD64_LWP_CFG:
+    case MSR_AMD64_LWP_CBADDR:
+    case MSR_PPIN_CTL:
+    case MSR_PPIN:
+    case MSR_AMD_PPIN_CTL:
+    case MSR_AMD_PPIN:
+        goto gp_fault;
+
     case MSR_IA32_FEATURE_CONTROL:
         /*
          * Architecturally, availability of this MSR is enumerated by the
@@ -382,6 +406,30 @@ int guest_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
     {
         uint64_t rsvd;
 
+        /* Read-only */
+    case MSR_IA32_PLATFORM_ID:
+    case MSR_CORE_CAPABILITIES:
+    case MSR_INTEL_CORE_THREAD_COUNT:
+    case MSR_INTEL_PLATFORM_INFO:
+    case MSR_ARCH_CAPABILITIES:
+
+        /* Not offered to guests. */
+    case MSR_TEST_CTRL:
+    case MSR_TSX_FORCE_ABORT:
+    case MSR_TSX_CTRL:
+    case MSR_MCU_OPT_CTRL:
+    case MSR_RTIT_OUTPUT_BASE ... MSR_RTIT_ADDR_B(7):
+    case MSR_U_CET:
+    case MSR_S_CET:
+    case MSR_PL0_SSP ... MSR_INTERRUPT_SSP_TABLE:
+    case MSR_AMD64_LWP_CFG:
+    case MSR_AMD64_LWP_CBADDR:
+    case MSR_PPIN_CTL:
+    case MSR_PPIN:
+    case MSR_AMD_PPIN_CTL:
+    case MSR_AMD_PPIN:
+        goto gp_fault;
+
     case MSR_AMD_PATCHLEVEL:
         BUILD_BUG_ON(MSR_IA32_UCODE_REV != MSR_AMD_PATCHLEVEL);
         /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Sat Mar 27 21:11:35 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Mar 2021 21:11:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.102300.195901 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lQGDX-0006ik-1k; Sat, 27 Mar 2021 21:11:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 102300.195901; Sat, 27 Mar 2021 21: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 1lQGDW-0006ic-V0; Sat, 27 Mar 2021 21:11:34 +0000
Received: by outflank-mailman (input) for mailman id 102300;
 Sat, 27 Mar 2021 21:11: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 1lQGDV-0006iR-1G
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 2021 21:11: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 1lQGDU-0001bv-Tu
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 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 1lQGDU-0000NC-Sr
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 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=ThCqDIkX6VA7AkcSzUGuzrn1d7FFTjzmk3Ju0vHI+zI=; b=2lRatsCNDs8khvcGp1Ysoh5tZt
	CAbgdHfZVl+pfqEgKZXEKwq8T0KTkpqt4VMJA8y79sABtAJKAPo0iGD7XlAQEg64hb/p9fsd4MZZG
	KRvfcR1vzbQQMctaCJwd4G9yljL8XmRqBeh5TrYZfCB7tiNtbVul7DB6kih8ZZ13Ab5g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] changelog: note MSR access change
Message-Id: <E1lQGDU-0000NC-Sr@xenbits.xenproject.org>
Date: Sat, 27 Mar 2021 21:11:32 +0000

commit cbc8a90dc2ed6dac1333d2cb83044610b1d5f587
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Mar 26 16:22:40 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 26 16:22:40 2021 +0100

    changelog: note MSR access change
    
    The change to deny all accesses to MSRs indexes not explicitly handled
    prevents leaking unwanted data into guests.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    master commit: 439085b2a797b627974f2bc224bdc19dc49b005d
    master date: 2021-03-26 16:16:48 +0100
---
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 07f240b6ab..30b53e73e8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  - ARM IOREQ servers (device emulation etc.) (Tech Preview)
  - Renesas IPMMU-VMSA (Supported, not security supported; was Tech Preview)
  - ARM SMMUv3 (Tech Preview)
+ - Switched MSR accesses to deny by default policy.
 
 ### Removed / support downgraded
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Sat Mar 27 21:11:45 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Mar 2021 21:11:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.102301.195906 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lQGDh-0006jn-3Q; Sat, 27 Mar 2021 21:11:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 102301.195906; Sat, 27 Mar 2021 21:11: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 1lQGDh-0006jf-0K; Sat, 27 Mar 2021 21:11:45 +0000
Received: by outflank-mailman (input) for mailman id 102301;
 Sat, 27 Mar 2021 21:11: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 1lQGDf-0006jY-1j
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 2021 21:11: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 1lQGDf-0001c5-12
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 2021 21:11:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lQGDf-0000Nm-00
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 2021 21:11: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=+RrVX90rKwxUfviJw4rLrdn48lo/dligrXol8XHySLs=; b=t2UWTAcSZM6gGQgYnD5Jups6l2
	HGYitD/h+X2RAWWGc3dSsQdS8NzKCdOaY7XFW3CDXv4QGGiYIWOAxBc9O6+RF9fr1JAFSMtCq5Tr1
	zy7y0D+sHdyHVEmQkIqQ+k20pvUqBhQVK06GHfpJg9wjHxO3UyEXFZIdPaguNCxtD12U=;
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: copy parent VM's hostp2m's max_mapped_pfn during forking
Message-Id: <E1lQGDf-0000Nm-00@xenbits.xenproject.org>
Date: Sat, 27 Mar 2021 21:11:43 +0000

commit b712639084b91917a24304dc3d6b019c386b279a
Author:     Tamas K Lengyel <tamas.lengyel@intel.com>
AuthorDate: Fri Mar 26 16:23:00 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 26 16:23:00 2021 +0100

    x86/mem_sharing: copy parent VM's hostp2m's max_mapped_pfn during forking
    
    When creating a VM fork copy the parent VM's hostp2m max_mapped_pfn value. Some
    toolstack relies on the XENMEM_maximum_gpfn value to establish the maximum
    addressable physical memory in the VM and for forks that have not yet been
    unpaused that value is not going to reflect the correct max gpfn that's
    possible to populate into the p2m. This patch fixes the issue.
    
    Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    master commit: f10c41537113dc2406c26cdf134403864df02a7d
    master date: 2021-03-26 16:17:07 +0100
---
 xen/arch/x86/mm/mem_sharing.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 00ada05c10..98b14f7b0a 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1761,6 +1761,7 @@ static int copy_settings(struct domain *cd, struct domain *d)
         return rc;
 
     copy_tsc(cd, d);
+    p2m_get_hostp2m(cd)->max_mapped_pfn = p2m_get_hostp2m(d)->max_mapped_pfn;
 
     return rc;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Sat Mar 27 21:11:55 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Mar 2021 21:11:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.102302.195909 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lQGDr-0006lJ-59; Sat, 27 Mar 2021 21:11:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 102302.195909; Sat, 27 Mar 2021 21:11: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 1lQGDr-0006lB-1u; Sat, 27 Mar 2021 21:11:55 +0000
Received: by outflank-mailman (input) for mailman id 102302;
 Sat, 27 Mar 2021 21:11: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 1lQGDp-0006l0-54
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 2021 21:11: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 1lQGDp-0001cI-4M
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 2021 21:11:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lQGDp-0000OO-3M
 for xen-changelog@lists.xenproject.org; Sat, 27 Mar 2021 21:11: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=qdCdYXJw4BMvkC8AM7MBjTMstyfa5Vys5EmyS9mr+e4=; b=MseBBIb/ndnvDSO+eW1hILybUY
	xg0cVP5jGyUOCEKjqtmWi/YXV8ix4Vd/quehs2ly0E5gXPi101YUSW0CQjkmfDHMweOYPM4euhK5q
	0Mj5d5WiVv81nVnuuYIFFo/CI+SEKccfn8AOfYVtSbrnRczYGjrrwnkOUhR1wBlwjvog=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] x86/HPET: don't enable legacy replacement mode unconditionally
Message-Id: <E1lQGDp-0000OO-3M@xenbits.xenproject.org>
Date: Sat, 27 Mar 2021 21:11:53 +0000

commit 7fa14f3f525b4a2d660794424fd787cfdf9c904b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Mar 24 11:34:32 2021 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 26 17:12:54 2021 +0000

    x86/HPET: don't enable legacy replacement mode unconditionally
    
    Commit e1de4c196a2e ("x86/timer: Fix boot on Intel systems using ITSSPRC
    static PIT clock gating") was reported to cause boot failures on certain
    AMD Ryzen systems. Until we can figure out what the actual issue there
    is, skip this new part of HPET setup by default. Introduce a "hpet"
    command line option to allow enabling this on hardware where it's really
    needed for Xen to boot successfully (i.e. where the PIT doesn't drive
    the timer interrupt).
    
    Since it makes little sense to introduce just "hpet=legacy-replacement",
    also allow for a boolean argument as well as "broadcast" to replace the
    separate "hpetbroadcast" option.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit e680cc48b7184d3489873d6776f84ba1fc238ced)
---
 docs/misc/xen-command-line.pandoc | 17 +++++++++++++++++
 xen/arch/x86/hpet.c               | 37 +++++++++++++++++++++++++++++++------
 2 files changed, 48 insertions(+), 6 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index a0601ff838..deef6d0b4c 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1274,9 +1274,26 @@ supported. See docs/misc/arm/big.LITTLE.txt for more information.
 When the hmp-unsafe option is disabled (default), CPUs that are not
 identical to the boot CPU will be parked and not used by Xen.
 
+### hpet (x86)
+> `= List of [ <boolean> | broadcast | legacy-replacement ]`
+
+> Default : `true`, `no-broadcast`, 'no-legacy-replacement`
+
+Controls Xen's use of the system's High Precision Event Timer.  The boolean
+allows to turn off use altogether.
+
+`broadcast` forces Xen to keep using the broadcast for CPUs in deep C-states
+even when an RTC interrupt got enabled.
+
+`legacy-replacement` is intended to be used on platforms where the timer
+interrupt doesn't get raised by the legacy PIT.  This then also affects
+raising of the RTC interrupt.
+
 ### hpetbroadcast (x86)
 > `= <boolean>`
 
+Deprecated alternative of `hpet=broadcast`.
+
 ### hvm_debug (x86)
 > `= <integer>`
 
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 1ff005fb4a..76d9ef2c02 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -52,6 +52,8 @@ static unsigned int __read_mostly num_hpets_used;
 DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel);
 
 unsigned long __initdata hpet_address;
+static bool __initdata opt_hpet = true;
+static bool __initdata opt_legacy_replacement;
 u8 __initdata hpet_blockid;
 u8 __initdata hpet_flags;
 
@@ -63,6 +65,32 @@ u8 __initdata hpet_flags;
 static bool __initdata force_hpet_broadcast;
 boolean_param("hpetbroadcast", force_hpet_broadcast);
 
+static int __init parse_hpet_param(const char *s)
+{
+    const char *ss;
+    int val, rc = 0;
+
+    do {
+        ss = strchr(s, ',');
+        if ( !ss )
+            ss = strchr(s, '\0');
+
+        if ( (val = parse_bool(s, ss)) >= 0 )
+            opt_hpet = val;
+        else if ( (val = parse_boolean("broadcast", s, ss)) >= 0 )
+            force_hpet_broadcast = val;
+        else if ( (val = parse_boolean("legacy-replacement", s, ss)) >= 0 )
+            opt_legacy_replacement = val;
+        else
+            rc = -EINVAL;
+
+        s = ss + 1;
+    } while ( *ss );
+
+    return rc;
+}
+custom_param("hpet", parse_hpet_param);
+
 /*
  * Calculate a multiplication factor for scaled math, which is used to convert
  * nanoseconds based values to clock ticks:
@@ -761,12 +789,9 @@ u64 __init hpet_setup(void)
     unsigned int hpet_id, hpet_period, hpet_cfg;
     unsigned int last, rem;
 
-    if ( hpet_rate )
+    if ( hpet_rate || !hpet_address || !opt_hpet )
         return hpet_rate;
 
-    if ( hpet_address == 0 )
-        return 0;
-
     set_fixmap_nocache(FIX_HPET_BASE, hpet_address);
 
     hpet_id = hpet_read32(HPET_ID);
@@ -803,9 +828,9 @@ u64 __init hpet_setup(void)
      * IRQ routing is configured.
      *
      * Reconfigure the HPET into legacy mode to re-establish the timer
-     * interrupt.
+     * interrupt, if available and if so requested.
      */
-    if ( hpet_id & HPET_ID_LEGSUP &&
+    if ( opt_legacy_replacement && (hpet_id & HPET_ID_LEGSUP) &&
          !((hpet_cfg = hpet_read32(HPET_CFG)) & HPET_CFG_LEGACY) )
     {
         unsigned int c0_cfg, ticks, count;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Sun Mar 28 06:33:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 28 Mar 2021 06:33:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.102330.195972 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lQOyt-0008ED-Ot; Sun, 28 Mar 2021 06:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 102330.195972; Sun, 28 Mar 2021 06: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 1lQOyt-0008E3-LN; Sun, 28 Mar 2021 06:33:03 +0000
Received: by outflank-mailman (input) for mailman id 102330;
 Sun, 28 Mar 2021 06: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 1lQOys-0008Dy-RV
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06: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 1lQOys-0000CS-LW
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lQOys-0004pk-Jh
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06: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=T39POXUfTtQGvwwx3V678FO5BUaLQoedt0MzLQOsW4E=; b=00DHTQSD2aqD2T7X8ehtvnHKTg
	+0+4tDxnnbqrsPIGvZUGR8nKe0YUattjB5PX7ebosZ43odW8jG78FMsUPUfAr8bUAfCyE1S2FFWlx
	uA1JK5Ef20FH76Rf4D9+uhYSmhsa7MS6FhjI9wF+UeQfj2XU3+OabtaNhKhvrSjeBThs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/design: Update xenstore-migration.md
Message-Id: <E1lQOys-0004pk-Jh@xenbits.xenproject.org>
Date: Sun, 28 Mar 2021 06:33:02 +0000

commit 7b6d288ef648c76da70fd9e41e73617631025cfe
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Mar 25 10:42:46 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Mar 26 12:08:53 2021 +0000

    docs/design: Update xenstore-migration.md
    
    It is not very clear the shared page adddress is not contained in the
    connection record. Additionally, it is misleading to say the grant
    will always point to the share paged as a domain is free to revoke the
    permission. The restore code would need to make sure it doesn't
    fail/crash if this is happening.
    
    The sentence is now replaced with a paragraph explaining why the GFN is
    not preserved and that the grant is not guarantee to exist during
    restore.
    
    Take the opportunity to replace "code" with "node" when description the
    permission.
    
    Reported-by: Raphael Ning <raphning@amazon.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 docs/designs/xenstore-migration.md | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/docs/designs/xenstore-migration.md b/docs/designs/xenstore-migration.md
index 1a5b94b31d..5f1155273e 100644
--- a/docs/designs/xenstore-migration.md
+++ b/docs/designs/xenstore-migration.md
@@ -216,8 +216,10 @@ For `shared ring` connections it is as follows:
 |           | by xenstored to communicate with `domid`          |
 |           |                                                   |
 
-Since the ABI guarantees that entry 1 in `domid`'s grant table will always
-contain the GFN of the shared page.
+The GFN of the shared page is not preserved because the ABI reserves
+entry 1 in `domid`'s grant table to point to the xenstore shared page.
+Note there is no guarantee the page will still be valid at the time of
+the restore because a domain can revoke the permission.
 
 For `socket` connections it is as follows:
 
@@ -398,7 +400,7 @@ A node permission specifier has the following format:
 |         |                                                     |
 | `domid` | The domain-id to which the permission relates       |
 
-Note that perm1 defines the domain owning the code. See [4] for more
+Note that perm1 defines the domain owning the node. See [4] for more
 explanation of node permissions.
 
 * * *
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun Mar 28 06:33:13 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 28 Mar 2021 06:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.102331.195975 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lQOz3-0008F5-RZ; Sun, 28 Mar 2021 06:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 102331.195975; Sun, 28 Mar 2021 06:33: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 1lQOz3-0008Ex-Of; Sun, 28 Mar 2021 06:33:13 +0000
Received: by outflank-mailman (input) for mailman id 102331;
 Sun, 28 Mar 2021 06:33: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 1lQOz2-0008Es-QP
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:33: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 1lQOz2-0000Cv-PX
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lQOz2-0004qM-Nd
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Wi+rOa/fPH/2KYhvLBxgMSy0XUoHEMAqR2TWXtbXxjw=; b=gjRma6qMqLTYp+ozJvCBry45rS
	Ki1TwF4lQV3kjvsTPSQbSzJu9ZULhSGUYYeCOe33FAKzCSEYlWvpb21jpnzQx2DnREzTpCANHYV4R
	UUZ6Crs9zFN/XlbCmL2CgpUVtpPGeDBmiUqNb9S/SF7NzU3gVAjuKrhoGN1CSPTqQLDA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/misc: xenstored: Re-instate and tweak the documentation for XS_RESUME
Message-Id: <E1lQOz2-0004qM-Nd@xenbits.xenproject.org>
Date: Sun, 28 Mar 2021 06:33:12 +0000

commit 03bee3fd475cb755572dd21214daecf9a77a6bb4
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Mar 25 17:46:30 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Mar 26 12:11:43 2021 +0000

    docs/misc: xenstored: Re-instate and tweak the documentation for XS_RESUME
    
    Commit 13dd372834a4 removed the documentation for XS_RESUME, however
    this command is still implemented (at least in C Xenstored) and used by
    libxl when resuming a domain.
    
    So re-instate the documentation for the XS_RESUME. Take the opportunity
    to update it as there is a user of the command.
    
    Fixes: 13dd372834a4 ("docs/designs: re-work the xenstore migration document...")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 docs/misc/xenstore.txt | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/docs/misc/xenstore.txt b/docs/misc/xenstore.txt
index 1480742330..334dc8b6fd 100644
--- a/docs/misc/xenstore.txt
+++ b/docs/misc/xenstore.txt
@@ -294,6 +294,22 @@ IS_DOMAIN_INTRODUCED	<domid>|		T| or F|
 	ie, if INTRODUCE for the domain has not yet been followed by
 	domain destruction or explicit RELEASE.
 
+RESUME			<domid>|
+
+	Arranges that @releaseDomain events will once more be
+	generated when the domain becomes shut down.  This might have
+	to be used if a domain were to be shut down (generating one
+	@releaseDomain) and then subsequently restarted, since the
+	state-sensitive algorithm in xenstored will not otherwise send
+	further watch event notifications if the domain were to be
+	shut down again.
+
+	This command will be issued in place such as resume because
+	Xen will "shutdown" the domain on suspend.
+
+	xenstored prevents the use of RESUME other than by dom0.
+
+
 SET_TARGET		<domid>|<tdomid>|
 	Notifies xenstored that domain <domid> is targeting domain
 	<tdomid>. This grants domain <domid> full access to paths
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun Mar 28 06:33:23 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 28 Mar 2021 06:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.102332.195979 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lQOzD-0008GN-TP; Sun, 28 Mar 2021 06:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 102332.195979; Sun, 28 Mar 2021 06:33: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 1lQOzD-0008GF-QG; Sun, 28 Mar 2021 06:33:23 +0000
Received: by outflank-mailman (input) for mailman id 102332;
 Sun, 28 Mar 2021 06:33: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 1lQOzC-0008G7-Ub
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:33: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 1lQOzC-0000D6-Sy
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lQOzC-0004qw-Ro
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hR2+j99ooyZ+gSMQKoVpV5T85BFvZZS9SC4zKCq8YGE=; b=nQ/AS4vIsWeds5iffGD39UcLqp
	PXONHaalPJNq9d8fFfO9tjXi3tY6WQplBjInMAW4U5wtiNw4K8wfcuh4yjJOsIr66JQdOKU+Q0LGb
	BN8BCIh8Q0bnw3PhqAQv0xe063oCth67aGWvkmMKD4gyZ9cQzSeOQDZHI3+VSkR0/izQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Revert "x86/msr: drop compatibility #GP handling in guest_{rd,wr}msr()"
Message-Id: <E1lQOzC-0004qw-Ro@xenbits.xenproject.org>
Date: Sun, 28 Mar 2021 06:33:22 +0000

commit 486cbda6dfbd1ba604cf51564dbc194ca5d0ead7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 26 16:08:39 2021 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 26 15:14:31 2021 +0000

    Revert "x86/msr: drop compatibility #GP handling in guest_{rd,wr}msr()"
    
    In hindsight, this was a poor move.  Some of these MSRs require probing for,
    cause unhelpful spew into xl dmesg, or cause spew from unit tests explicitly
    checking behaviour.
    
    This restores behaviour close to that of Xen 4.14, meaning in particular
    that for all of the MSRs getting re-added explicitly a #GP fault will get
    raised irrespective of the new "msr_relaxed" setting.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/arch/x86/msr.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index 0ebcb04259..c3a988bd11 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -175,6 +175,30 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
 
     switch ( msr )
     {
+        /* Write-only */
+    case MSR_AMD_PATCHLOADER:
+    case MSR_IA32_UCODE_WRITE:
+    case MSR_PRED_CMD:
+    case MSR_FLUSH_CMD:
+
+        /* Not offered to guests. */
+    case MSR_TEST_CTRL:
+    case MSR_CORE_CAPABILITIES:
+    case MSR_TSX_FORCE_ABORT:
+    case MSR_TSX_CTRL:
+    case MSR_MCU_OPT_CTRL:
+    case MSR_RTIT_OUTPUT_BASE ... MSR_RTIT_ADDR_B(7):
+    case MSR_U_CET:
+    case MSR_S_CET:
+    case MSR_PL0_SSP ... MSR_INTERRUPT_SSP_TABLE:
+    case MSR_AMD64_LWP_CFG:
+    case MSR_AMD64_LWP_CBADDR:
+    case MSR_PPIN_CTL:
+    case MSR_PPIN:
+    case MSR_AMD_PPIN_CTL:
+    case MSR_AMD_PPIN:
+        goto gp_fault;
+
     case MSR_IA32_FEATURE_CONTROL:
         /*
          * Architecturally, availability of this MSR is enumerated by the
@@ -382,6 +406,30 @@ int guest_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
     {
         uint64_t rsvd;
 
+        /* Read-only */
+    case MSR_IA32_PLATFORM_ID:
+    case MSR_CORE_CAPABILITIES:
+    case MSR_INTEL_CORE_THREAD_COUNT:
+    case MSR_INTEL_PLATFORM_INFO:
+    case MSR_ARCH_CAPABILITIES:
+
+        /* Not offered to guests. */
+    case MSR_TEST_CTRL:
+    case MSR_TSX_FORCE_ABORT:
+    case MSR_TSX_CTRL:
+    case MSR_MCU_OPT_CTRL:
+    case MSR_RTIT_OUTPUT_BASE ... MSR_RTIT_ADDR_B(7):
+    case MSR_U_CET:
+    case MSR_S_CET:
+    case MSR_PL0_SSP ... MSR_INTERRUPT_SSP_TABLE:
+    case MSR_AMD64_LWP_CFG:
+    case MSR_AMD64_LWP_CBADDR:
+    case MSR_PPIN_CTL:
+    case MSR_PPIN:
+    case MSR_AMD_PPIN_CTL:
+    case MSR_AMD_PPIN:
+        goto gp_fault;
+
     case MSR_AMD_PATCHLEVEL:
         BUILD_BUG_ON(MSR_IA32_UCODE_REV != MSR_AMD_PATCHLEVEL);
         /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun Mar 28 06:33:33 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 28 Mar 2021 06:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.102333.195983 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lQOzN-0008Hf-Uv; Sun, 28 Mar 2021 06:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 102333.195983; Sun, 28 Mar 2021 06:33: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 1lQOzN-0008HW-Ru; Sun, 28 Mar 2021 06:33:33 +0000
Received: by outflank-mailman (input) for mailman id 102333;
 Sun, 28 Mar 2021 06:33: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 1lQOzN-0008HM-1W
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:33: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 1lQOzN-0000DD-0d
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:33:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lQOzM-0004rQ-V9
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:33:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=l9ZBHxFbzCsiHm91qJ+wgr9yJy8zNXGd55RhZhQ9O7I=; b=VI0nif1ZBAU7nXJXuNBGUCVK3q
	fbKCPOh2+EJDnM6nywAvpK/fX3B9gXPLJ36tnN0DC9Xt8pbaLJezZ9kLYCjFcCJgrIeKHfYds3wG9
	ykSP97wX4smHMnDUDbldzN/iC+7q4N1C4cjRJxeTdxVRSXLt+Vjyk/AOCnN7aMNEkXqo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] changelog: note MSR access change
Message-Id: <E1lQOzM-0004rQ-V9@xenbits.xenproject.org>
Date: Sun, 28 Mar 2021 06:33:32 +0000

commit 439085b2a797b627974f2bc224bdc19dc49b005d
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Mar 26 16:16:48 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 26 16:16:48 2021 +0100

    changelog: note MSR access change
    
    The change to deny all accesses to MSRs indexes not explicitly handled
    prevents leaking unwanted data into guests.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index f76fadf8c7..d81608af4d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  - ARM IOREQ servers (device emulation etc.) (Tech Preview)
  - Renesas IPMMU-VMSA (Supported, not security supported; was Tech Preview)
  - ARM SMMUv3 (Tech Preview)
+ - Switched MSR accesses to deny by default policy.
 
 ## Removed / support downgraded
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun Mar 28 06:33:44 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 28 Mar 2021 06:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.102334.195986 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lQOzY-0008JI-09; Sun, 28 Mar 2021 06:33:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 102334.195986; Sun, 28 Mar 2021 06:33: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 1lQOzX-0008JB-TP; Sun, 28 Mar 2021 06:33:43 +0000
Received: by outflank-mailman (input) for mailman id 102334;
 Sun, 28 Mar 2021 06:33: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 1lQOzX-0008J4-4l
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:33: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 1lQOzX-0000DQ-3r
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:33:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lQOzX-0004s3-2y
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:33:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MEDXAMG/sUJ/eFOpusoldS25c/yt5NBrk8J4Ri2rcp8=; b=W+7Fd//mWzS1z/ChY1FrBZZrC8
	WyjjM0EGyNaD5s1OoIO15VeC1EdBGGE54E+137obzejb2UKwDS7S3Rj2OF82jz+yHPtqQxdP8HXnD
	0n9p2Wps62YsES/ccKebsfRPW/mmzlv7jyLWX/Veh6TtzLNCCrWExXU9BtX/2jKNbvA8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mem_sharing: copy parent VM's hostp2m's max_mapped_pfn during forking
Message-Id: <E1lQOzX-0004s3-2y@xenbits.xenproject.org>
Date: Sun, 28 Mar 2021 06:33:43 +0000

commit f10c41537113dc2406c26cdf134403864df02a7d
Author:     Tamas K Lengyel <tamas.lengyel@intel.com>
AuthorDate: Fri Mar 26 16:17:07 2021 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Mar 26 16:17:07 2021 +0100

    x86/mem_sharing: copy parent VM's hostp2m's max_mapped_pfn during forking
    
    When creating a VM fork copy the parent VM's hostp2m max_mapped_pfn value. Some
    toolstack relies on the XENMEM_maximum_gpfn value to establish the maximum
    addressable physical memory in the VM and for forks that have not yet been
    unpaused that value is not going to reflect the correct max gpfn that's
    possible to populate into the p2m. This patch fixes the issue.
    
    Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 xen/arch/x86/mm/mem_sharing.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 00ada05c10..98b14f7b0a 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1761,6 +1761,7 @@ static int copy_settings(struct domain *cd, struct domain *d)
         return rc;
 
     copy_tsc(cd, d);
+    p2m_get_hostp2m(cd)->max_mapped_pfn = p2m_get_hostp2m(d)->max_mapped_pfn;
 
     return rc;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun Mar 28 06:33:55 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 28 Mar 2021 06:33:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.102335.195990 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lQOzj-0008KZ-1i; Sun, 28 Mar 2021 06:33:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 102335.195990; Sun, 28 Mar 2021 06:33: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 1lQOzi-0008KR-V3; Sun, 28 Mar 2021 06:33:54 +0000
Received: by outflank-mailman (input) for mailman id 102335;
 Sun, 28 Mar 2021 06:33: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 1lQOzh-0008KG-8Z
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:33: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 1lQOzh-0000DY-73
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:33:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lQOzh-0004u8-69
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:33:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3SokY2d+OferzoLZ9SrF1Qyb1UEYmK+mKmamhKMEXLw=; b=Z/118o3MYaSPbAqWGsNt+A2j4z
	gDVoDui00rKfdlTGEsxmMmT6cNJEV+2DTiSA2gUAQC4DXVJ3uvpZmT5oD9bRlU6Sz0/Q8IuV9ErgO
	p1Lqd/SVvny0tZf4pYjg/kUTTAUqMHBmekhRjgJcHNjAwbn7epjT0dIYuXMVKtwdWh6Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libfsimage: Bump SONAME to 4.16
Message-Id: <E1lQOzh-0004u8-69@xenbits.xenproject.org>
Date: Sun, 28 Mar 2021 06:33:53 +0000

commit b9005bb34f051e5da82a9b6fd5097182148c8539
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Mar 25 19:40:58 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Mar 26 15:19:05 2021 +0000

    tools/libfsimage: Bump SONAME to 4.16
    
    Fixes: a04509d34d ("Branching: Update version files etc. for newly unstable")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libfsimage/common/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libfsimage/common/Makefile b/tools/libfsimage/common/Makefile
index 060f029ca9..24bc90e73e 100644
--- a/tools/libfsimage/common/Makefile
+++ b/tools/libfsimage/common/Makefile
@@ -1,7 +1,7 @@
 XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/libfsimage/Rules.mk
 
-MAJOR = 4.15
+MAJOR = 4.16
 MINOR = 0
 
 LDFLAGS-$(CONFIG_SunOS) = -Wl,-M -Wl,mapfile-SunOS
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun Mar 28 06:34:05 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 28 Mar 2021 06:34:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.102336.195996 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lQOzt-0008ME-3x; Sun, 28 Mar 2021 06:34:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 102336.195996; Sun, 28 Mar 2021 06:34: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 1lQOzt-0008M6-0X; Sun, 28 Mar 2021 06:34:05 +0000
Received: by outflank-mailman (input) for mailman id 102336;
 Sun, 28 Mar 2021 06:34: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 1lQOzr-0008Ls-Ap
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:34: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 1lQOzr-0000Dy-9v
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:34:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lQOzr-0004uu-9C
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:34: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=o8wCQGx5Nu4QPClucw0uC6cxOAOnLTLH2sTwoy4gRd8=; b=at8Vln5XAmIhKlpHYudUYXpqN8
	7s7vqnx/pIFUm0c42XvkE3WCDJX2n3LvEK3TwUINmnQLG28I6+dl63DslvAqGhRhtStP6o1ZMxvsL
	3EdZD2FOuIfNVOwmO0QUggUhm3uK7jCALJcDlqJ/PJHw3SOHKksRdDzUD6S5p3zwB6s4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CHANGELOG: Correct sub-section headings
Message-Id: <E1lQOzr-0004uu-9C@xenbits.xenproject.org>
Date: Sun, 28 Mar 2021 06:34:03 +0000

commit 8bfceeed789e4394a9c45403a19f29909f2b2641
Author:     Ian Jackson <iwj@xenproject.org>
AuthorDate: Wed Mar 24 16:30:30 2021 +0000
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 26 15:25:54 2021 +0000

    CHANGELOG: Correct sub-section headings
    
    Signed-off-by: Ian Jackson <iwj@xenproject.org>
    (cherry picked from commit 0f93d79a97121c55d3f3e26304d437ddb38de6a7)
---
 CHANGELOG.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index d81608af4d..ffbf71fcb9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,13 +8,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 
 ## [4.15.0 UNRELEASED](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.15.0) - TBD
 
-## Added / support upgraded
+### Added / support upgraded
  - ARM IOREQ servers (device emulation etc.) (Tech Preview)
  - Renesas IPMMU-VMSA (Supported, not security supported; was Tech Preview)
  - ARM SMMUv3 (Tech Preview)
  - Switched MSR accesses to deny by default policy.
 
-## Removed / support downgraded
+### Removed / support downgraded
 
  - qemu-xen-traditional as host process device model, now "No security
    support, not recommended".  (Use as stub domain device model is still
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun Mar 28 06:34:15 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 28 Mar 2021 06:34:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.102337.195999 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lQP03-0008NT-5J; Sun, 28 Mar 2021 06:34:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 102337.195999; Sun, 28 Mar 2021 06:34: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 1lQP03-0008NL-2H; Sun, 28 Mar 2021 06:34:15 +0000
Received: by outflank-mailman (input) for mailman id 102337;
 Sun, 28 Mar 2021 06:34: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 1lQP01-0008ND-Du
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:34: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 1lQP01-0000EL-DA
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:34:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lQP01-0004vv-CU
 for xen-changelog@lists.xenproject.org; Sun, 28 Mar 2021 06:34: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=p1xMyONpCRkNDaqViVcFrKqjZqfDeL3EKhhF15TwfNI=; b=sO4iRyWknmqAtp5D+ub2T+wUX6
	8zte2PF2XaAM5rdZHeieqldaA4HJKgpWUf6O3RPOTH7KbCCBKBIj3OL5hZo4EoxR07pK23HvdGRmw
	7htXA61mXrlLy1dDkyrgQ8bW1+pf5uZJzMNu7d789hXIIZL80d+Xkv6QNbPxbRHfP4O0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/HPET: don't enable legacy replacement mode unconditionally
Message-Id: <E1lQP01-0004vv-CU@xenbits.xenproject.org>
Date: Sun, 28 Mar 2021 06:34:13 +0000

commit e680cc48b7184d3489873d6776f84ba1fc238ced
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Mar 24 11:34:32 2021 +0100
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Mar 26 17:02:55 2021 +0000

    x86/HPET: don't enable legacy replacement mode unconditionally
    
    Commit e1de4c196a2e ("x86/timer: Fix boot on Intel systems using ITSSPRC
    static PIT clock gating") was reported to cause boot failures on certain
    AMD Ryzen systems. Until we can figure out what the actual issue there
    is, skip this new part of HPET setup by default. Introduce a "hpet"
    command line option to allow enabling this on hardware where it's really
    needed for Xen to boot successfully (i.e. where the PIT doesn't drive
    the timer interrupt).
    
    Since it makes little sense to introduce just "hpet=legacy-replacement",
    also allow for a boolean argument as well as "broadcast" to replace the
    separate "hpetbroadcast" option.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
    Release-Acked-by: Ian Jackson <iwj@xenproject.org>
---
 docs/misc/xen-command-line.pandoc | 17 +++++++++++++++++
 xen/arch/x86/hpet.c               | 37 +++++++++++++++++++++++++++++++------
 2 files changed, 48 insertions(+), 6 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index a0601ff838..deef6d0b4c 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1274,9 +1274,26 @@ supported. See docs/misc/arm/big.LITTLE.txt for more information.
 When the hmp-unsafe option is disabled (default), CPUs that are not
 identical to the boot CPU will be parked and not used by Xen.
 
+### hpet (x86)
+> `= List of [ <boolean> | broadcast | legacy-replacement ]`
+
+> Default : `true`, `no-broadcast`, 'no-legacy-replacement`
+
+Controls Xen's use of the system's High Precision Event Timer.  The boolean
+allows to turn off use altogether.
+
+`broadcast` forces Xen to keep using the broadcast for CPUs in deep C-states
+even when an RTC interrupt got enabled.
+
+`legacy-replacement` is intended to be used on platforms where the timer
+interrupt doesn't get raised by the legacy PIT.  This then also affects
+raising of the RTC interrupt.
+
 ### hpetbroadcast (x86)
 > `= <boolean>`
 
+Deprecated alternative of `hpet=broadcast`.
+
 ### hvm_debug (x86)
 > `= <integer>`
 
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 1ff005fb4a..76d9ef2c02 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -52,6 +52,8 @@ static unsigned int __read_mostly num_hpets_used;
 DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel);
 
 unsigned long __initdata hpet_address;
+static bool __initdata opt_hpet = true;
+static bool __initdata opt_legacy_replacement;
 u8 __initdata hpet_blockid;
 u8 __initdata hpet_flags;
 
@@ -63,6 +65,32 @@ u8 __initdata hpet_flags;
 static bool __initdata force_hpet_broadcast;
 boolean_param("hpetbroadcast", force_hpet_broadcast);
 
+static int __init parse_hpet_param(const char *s)
+{
+    const char *ss;
+    int val, rc = 0;
+
+    do {
+        ss = strchr(s, ',');
+        if ( !ss )
+            ss = strchr(s, '\0');
+
+        if ( (val = parse_bool(s, ss)) >= 0 )
+            opt_hpet = val;
+        else if ( (val = parse_boolean("broadcast", s, ss)) >= 0 )
+            force_hpet_broadcast = val;
+        else if ( (val = parse_boolean("legacy-replacement", s, ss)) >= 0 )
+            opt_legacy_replacement = val;
+        else
+            rc = -EINVAL;
+
+        s = ss + 1;
+    } while ( *ss );
+
+    return rc;
+}
+custom_param("hpet", parse_hpet_param);
+
 /*
  * Calculate a multiplication factor for scaled math, which is used to convert
  * nanoseconds based values to clock ticks:
@@ -761,12 +789,9 @@ u64 __init hpet_setup(void)
     unsigned int hpet_id, hpet_period, hpet_cfg;
     unsigned int last, rem;
 
-    if ( hpet_rate )
+    if ( hpet_rate || !hpet_address || !opt_hpet )
         return hpet_rate;
 
-    if ( hpet_address == 0 )
-        return 0;
-
     set_fixmap_nocache(FIX_HPET_BASE, hpet_address);
 
     hpet_id = hpet_read32(HPET_ID);
@@ -803,9 +828,9 @@ u64 __init hpet_setup(void)
      * IRQ routing is configured.
      *
      * Reconfigure the HPET into legacy mode to re-establish the timer
-     * interrupt.
+     * interrupt, if available and if so requested.
      */
-    if ( hpet_id & HPET_ID_LEGSUP &&
+    if ( opt_legacy_replacement && (hpet_id & HPET_ID_LEGSUP) &&
          !((hpet_cfg = hpet_read32(HPET_CFG)) & HPET_CFG_LEGACY) )
     {
         unsigned int c0_cfg, ticks, count;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Mar 29 16:44:15 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Mar 2021 16:44:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.103190.196905 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lQuzm-0002bN-Dw; Mon, 29 Mar 2021 16:44:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 103190.196905; Mon, 29 Mar 2021 16:44: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 1lQuzm-0002bF-At; Mon, 29 Mar 2021 16:44:06 +0000
Received: by outflank-mailman (input) for mailman id 103190;
 Mon, 29 Mar 2021 16:44: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 1lQuzk-0002bA-SD
 for xen-changelog@lists.xenproject.org; Mon, 29 Mar 2021 16: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 1lQuzk-0001Zt-Jm
 for xen-changelog@lists.xenproject.org; Mon, 29 Mar 2021 16:44:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lQuzk-0008GD-IP
 for xen-changelog@lists.xenproject.org; Mon, 29 Mar 2021 16: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=OURzUeD8uSGR4dFiFASvttnxSJgJeW5QofRxBkAaAXs=; b=Kj3WoGG6Z1K0nA5gQvuvcj3umB
	C29ny3P5lfMAze93WtAuLoCblJhGXQkWD2jNkKNk639cYFaL5gC5ZVjG8Oqfkfq/kPs01/GiMKhr8
	K8boz2zmisJM2vHfiIXOSBhBz6IuqRCoVCWJIdaWrPw+RVdq9KblltRSXnGccfMYsS+w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstored: Remove unnecessary define XC_WANT_COMPAT_MAP_FOREIGN_API
Message-Id: <E1lQuzk-0008GD-IP@xenbits.xenproject.org>
Date: Mon, 29 Mar 2021 16:44:04 +0000

commit cead8c0d17462f3a1150b5657d3f4eaa88faf1cb
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Mar 25 11:39:23 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Mar 29 17:39:03 2021 +0100

    tools/xenstored: Remove unnecessary define XC_WANT_COMPAT_MAP_FOREIGN_API
    
    The last use of the compat foreign API was dropped in commit
    38eeb3864de4 "tools/xenstored: Drop mapping of the ring via foreign
    map".
    
    Therefore, we don't need to define XC_WANT_COMPAT_MAP_FOREIGN_API.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstore/xenstored_core.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 0c9a0961b5..1cdbc3dcb5 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -19,7 +19,6 @@
 #ifndef _XENSTORED_CORE_H
 #define _XENSTORED_CORE_H
 
-#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
 #include <xengnttab.h>
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 30 12:44:10 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Mar 2021 12:44:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.103496.197409 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lRDj5-0002kH-3G; Tue, 30 Mar 2021 12:44:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 103496.197409; Tue, 30 Mar 2021 12:44: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 1lRDj4-0002k9-Vr; Tue, 30 Mar 2021 12:44:06 +0000
Received: by outflank-mailman (input) for mailman id 103496;
 Tue, 30 Mar 2021 12:44: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 1lRDj4-0002k4-2d
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:44: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 1lRDj3-0004C0-To
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:44:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lRDj3-0001Xz-Sl
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:44:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4UDUSr6ysRqAqY9qmd6meMq/H7S2mospu2xlhoAMb8c=; b=rp/83b0lq7DzUhzrYsDLAy9CjX
	WOA+eDl596+IyEiywo61dI4SeT51YEfXe+BEhvUEt9mSKz40TXgyIVadRK9XS8OI83L66LNf8T7x1
	ZAKSUuh8lF7hCdRHXmM4bQSItPpenF+nygzD0AF3CbP/DpHuhDY/aCrXDJEXMFiCI8t0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: replace stale literal numbers in hash_{vcpu,domain}_foreach()
Message-Id: <E1lRDj3-0001Xz-Sl@xenbits.xenproject.org>
Date: Tue, 30 Mar 2021 12:44:05 +0000

commit c201d303e801a949b10f9e0f36cdc1938ddd399e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 30 14:32:44 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 30 14:32:44 2021 +0200

    x86/shadow: replace stale literal numbers in hash_{vcpu,domain}_foreach()
    
    15 apparently once used to be the last valid type to request a callback
    for, and the dimension of the respective array. The arrays meanwhile are
    larger than this (in a benign way, i.e. no caller ever sets a mask bit
    higher than 15), dimensioned by SH_type_unused. Have the ASSERT()s
    follow suit and add build time checks at the call sites.
    
    Also adjust a comment naming the wrong of the two functions.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 4a8882430b..31a5ccf4ca 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1623,6 +1623,9 @@ 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);
 
+#define HASH_CALLBACKS_CHECK(mask) \
+    BUILD_BUG_ON((mask) > (1U << ARRAY_SIZE(callbacks)) - 1)
+
 static void hash_vcpu_foreach(struct vcpu *v, unsigned int callback_mask,
                               const hash_vcpu_callback_t callbacks[],
                               mfn_t callback_mfn)
@@ -1658,7 +1661,7 @@ static void hash_vcpu_foreach(struct vcpu *v, unsigned int callback_mask,
         {
             if ( callback_mask & (1 << x->u.sh.type) )
             {
-                ASSERT(x->u.sh.type <= 15);
+                ASSERT(x->u.sh.type < SH_type_unused);
                 ASSERT(callbacks[x->u.sh.type] != NULL);
                 done = callbacks[x->u.sh.type](v, page_to_mfn(x),
                                                callback_mfn);
@@ -1705,7 +1708,7 @@ static void hash_domain_foreach(struct domain *d,
         {
             if ( callback_mask & (1 << x->u.sh.type) )
             {
-                ASSERT(x->u.sh.type <= 15);
+                ASSERT(x->u.sh.type < SH_type_unused);
                 ASSERT(callbacks[x->u.sh.type] != NULL);
                 done = callbacks[x->u.sh.type](d, page_to_mfn(x),
                                                callback_mfn);
@@ -2009,6 +2012,7 @@ 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);
 
     /* If that didn't catch the mapping, then there's some non-pagetable
@@ -2080,6 +2084,7 @@ 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);
 
     /* If that didn't catch the mapping, something is very wrong */
@@ -2246,10 +2251,12 @@ void sh_remove_shadows(struct domain *d, mfn_t gmfn, int fast, int all)
     /* Search for this shadow in all appropriate shadows */
     perfc_incr(shadow_unshadow);
 
-    /* Lower-level shadows need to be excised from upper-level shadows.
-     * This call to hash_vcpu_foreach() looks dangerous but is in fact OK: each
+    /*
+     * Lower-level shadows need to be excised from upper-level shadows. This
+     * call to hash_domain_foreach() looks dangerous but is in fact OK: each
      * call will remove at most one shadow, and terminate immediately when
-     * it does remove it, so we never walk the hash after doing a deletion.  */
+     * it does remove it, so we never walk the hash after doing a deletion.
+     */
 #define DO_UNSHADOW(_type) do {                                         \
     t = (_type);                                                        \
     if( !(pg->count_info & PGC_page_table)                              \
@@ -2270,6 +2277,7 @@ void sh_remove_shadows(struct domain *d, mfn_t gmfn, int fast, int all)
     if( !fast                                                           \
         && (pg->count_info & PGC_page_table)                            \
         && (pg->shadow_flags & (1 << t)) )                              \
+        HASH_CALLBACKS_CHECK(SHF_page_type_mask);                       \
         hash_domain_foreach(d, masks[t], callbacks, smfn);              \
 } while (0)
 
@@ -2370,6 +2378,7 @@ void sh_reset_l3_up_pointers(struct vcpu *v)
     };
     static const unsigned int callback_mask = SHF_L3_64;
 
+    HASH_CALLBACKS_CHECK(callback_mask);
     hash_vcpu_foreach(v, callback_mask, callbacks, INVALID_MFN);
 }
 
@@ -3420,6 +3429,7 @@ void shadow_audit_tables(struct vcpu *v)
         }
     }
 
+    HASH_CALLBACKS_CHECK(SHF_page_type_mask);
     hash_vcpu_foreach(v, mask, callbacks, INVALID_MFN);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 30 12:44:17 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Mar 2021 12:44:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.103497.197412 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lRDjF-0002l6-40; Tue, 30 Mar 2021 12:44:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 103497.197412; Tue, 30 Mar 2021 12:44: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 1lRDjF-0002ky-15; Tue, 30 Mar 2021 12:44:17 +0000
Received: by outflank-mailman (input) for mailman id 103497;
 Tue, 30 Mar 2021 12:44: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 1lRDjE-0002kr-2l
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:44: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 1lRDjE-0004C6-1Q
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:44:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lRDjE-0001Yr-00
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:44:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sj/EFH17kQ6tX562an58uNzNI3Bo3UzAuKTsTXpzIjw=; b=sChgLHAd22MiZZXdP/DlHZpYXp
	xTI90cr1RZA3Sq1ETTdjlfb9txtQhXLmgnRfPQc44nVL6XvyQWrtBBuCbJfNRWSiCYC/xppLUowXL
	SrMbclkwau+2G++jlIK4SULfAbZAJhCFaLGSsM8mzXnQMLjyHAX68cUT6s5NIYKEzONY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/decompress: make helper symbols static
Message-Id: <E1lRDjE-0001Yr-00@xenbits.xenproject.org>
Date: Tue, 30 Mar 2021 12:44:16 +0000

commit eaecd329a56ccbc8158a20a75dcb486d07a412d6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 30 14:33:48 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 30 14:33:48 2021 +0200

    xen/decompress: make helper symbols static
    
    The individual decompression CUs need to only surface their top level
    functions to other code. Arrange for everything else to be static, to
    make sure no undue uses of that code exist or will appear without
    explicitly noticing. (In some cases this also results in code size
    reduction, but since this is all init-only code this probably doesn't
    matter very much.)
    
    In the LZO case also take the opportunity and convert u8 where lines
    get touched anyway.
    
    The downside is that the top level functions will now be non-static
    in stubdom builds of libxenguest, but I think that's acceptable. This
    does require declaring them first, though, as the compiler warns about
    the lack of declarations.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/guest/xg_dom_decompress_unsafe.h |  4 ++++
 xen/common/bunzip2.c                        | 11 +++++------
 xen/common/decompress.h                     |  2 +-
 xen/common/unlz4.c                          | 11 +++++------
 xen/common/unlzma.c                         | 12 +++++-------
 xen/common/unlzo.c                          | 10 +++++-----
 xen/common/unxz.c                           | 10 +++++-----
 xen/common/unzstd.c                         | 11 +++++------
 8 files changed, 35 insertions(+), 36 deletions(-)

diff --git a/tools/libs/guest/xg_dom_decompress_unsafe.h b/tools/libs/guest/xg_dom_decompress_unsafe.h
index 969846cb32..4e0bf23aa5 100644
--- a/tools/libs/guest/xg_dom_decompress_unsafe.h
+++ b/tools/libs/guest/xg_dom_decompress_unsafe.h
@@ -1,8 +1,12 @@
+#ifdef __MINIOS__
+# include "../../xen/include/xen/decompress.h"
+#else
 typedef int decompress_fn(unsigned char *inbuf, unsigned int len,
                           int (*fill)(void*, unsigned int),
                           int (*flush)(void*, unsigned int),
                           unsigned char *outbuf, unsigned int *posp,
                           void (*error)(const char *x));
+#endif
 
 int xc_dom_decompress_unsafe(
     decompress_fn fn, struct xc_dom_image *dom, void **blob, size_t *size)
diff --git a/xen/common/bunzip2.c b/xen/common/bunzip2.c
index 6d6e8b19fd..6aeac79f1a 100644
--- a/xen/common/bunzip2.c
+++ b/xen/common/bunzip2.c
@@ -665,12 +665,11 @@ static int INIT start_bunzip(struct bunzip_data **bdp, void *inbuf, int len,
 
 /* Example usage: decompress src_fd to dst_fd.  (Stops at end of bzip2 data,
    not end of file.) */
-STATIC int INIT bunzip2(unsigned char *buf, unsigned int len,
-			int(*fill)(void*, unsigned int),
-			int(*flush)(void*, unsigned int),
-			unsigned char *outbuf,
-			unsigned int *pos,
-			void(*error)(const char *x))
+int INIT bunzip2(unsigned char *buf, unsigned int len,
+		 int(*fill)(void*, unsigned int),
+		 int(*flush)(void*, unsigned int),
+		 unsigned char *outbuf, unsigned int *pos,
+		 void(*error)(const char *x))
 {
 	struct bunzip_data *bd;
 	int i = -1;
diff --git a/xen/common/decompress.h b/xen/common/decompress.h
index 647b7b1e83..d740a80eeb 100644
--- a/xen/common/decompress.h
+++ b/xen/common/decompress.h
@@ -7,7 +7,7 @@
 #include <xen/types.h>
 #include <xen/xmalloc.h>
 
-#define STATIC
+#define STATIC static
 #define INIT __init
 #define INITDATA __initdata
 
diff --git a/xen/common/unlz4.c b/xen/common/unlz4.c
index 9dcaec7e84..4a8fc55ccb 100644
--- a/xen/common/unlz4.c
+++ b/xen/common/unlz4.c
@@ -22,12 +22,11 @@
 #define LZ4_DEFAULT_UNCOMPRESSED_CHUNK_SIZE (8 << 20)
 #define ARCHIVE_MAGICNUMBER 0x184C2102
 
-STATIC int INIT unlz4(unsigned char *input, unsigned int in_len,
-		      int (*fill)(void *, unsigned int),
-		      int (*flush)(void *, unsigned int),
-		      unsigned char *output,
-		      unsigned int *posp,
-		      void (*error)(const char *x))
+int INIT unlz4(unsigned char *input, unsigned int in_len,
+	       int (*fill)(void *, unsigned int),
+	       int (*flush)(void *, unsigned int),
+	       unsigned char *output, unsigned int *posp,
+	       void (*error)(const char *x))
 {
 	int ret = -1;
 	size_t chunksize = 0;
diff --git a/xen/common/unlzma.c b/xen/common/unlzma.c
index 9134277bba..ea5ab41738 100644
--- a/xen/common/unlzma.c
+++ b/xen/common/unlzma.c
@@ -528,13 +528,11 @@ static inline int INIT process_bit1(struct writer *wr, struct rc *rc,
 
 
 
-STATIC int INIT unlzma(unsigned char *buf, unsigned int in_len,
-		       int(*fill)(void*, unsigned int),
-		       int(*flush)(void*, unsigned int),
-		       unsigned char *output,
-		       unsigned int *posp,
-		       void(*error)(const char *x)
-	)
+int INIT unlzma(unsigned char *buf, unsigned int in_len,
+	        int(*fill)(void*, unsigned int),
+	        int(*flush)(void*, unsigned int),
+	        unsigned char *output, unsigned int *posp,
+	        void(*error)(const char *x))
 {
 	struct lzma_header header;
 	int lc, pb, lp;
diff --git a/xen/common/unlzo.c b/xen/common/unlzo.c
index 11f64fcf3b..df7e53db14 100644
--- a/xen/common/unlzo.c
+++ b/xen/common/unlzo.c
@@ -114,11 +114,11 @@ static int INIT parse_header(u8 *input, int *skip, int in_len)
 	return 1;
 }
 
-STATIC int INIT unlzo(u8 *input, unsigned int in_len,
-		      int (*fill) (void *, unsigned int),
-		      int (*flush) (void *, unsigned int),
-		      u8 *output, unsigned int *posp,
-		      void (*error) (const char *x))
+int INIT unlzo(unsigned char *input, unsigned int in_len,
+	       int (*fill) (void *, unsigned int),
+	       int (*flush) (void *, unsigned int),
+	       unsigned char *output, unsigned int *posp,
+	       void (*error) (const char *x))
 {
 	u8 r = 0;
 	int skip = 0;
diff --git a/xen/common/unxz.c b/xen/common/unxz.c
index cf25c9fc8e..15806f4469 100644
--- a/xen/common/unxz.c
+++ b/xen/common/unxz.c
@@ -157,11 +157,11 @@
  * both input and output buffers are available as a single chunk, i.e. when
  * fill() and flush() won't be used.
  */
-STATIC int INIT unxz(unsigned char *in, unsigned int in_size,
-		     int (*fill)(void *dest, unsigned int size),
-		     int (*flush)(void *src, unsigned int size),
-		     unsigned char *out, unsigned int *in_used,
-		     void (*error)(const char *x))
+int INIT unxz(unsigned char *in, unsigned int in_size,
+	      int (*fill)(void *dest, unsigned int size),
+	      int (*flush)(void *src, unsigned int size),
+	      unsigned char *out, unsigned int *in_used,
+	      void (*error)(const char *x))
 {
 	struct xz_buf b;
 	struct xz_dec *s;
diff --git a/xen/common/unzstd.c b/xen/common/unzstd.c
index a107616427..915a07c21b 100644
--- a/xen/common/unzstd.c
+++ b/xen/common/unzstd.c
@@ -142,12 +142,11 @@ out:
 	return err;
 }
 
-STATIC int INIT unzstd(unsigned char *in_buf, unsigned int in_len,
-		       int (*fill)(void*, unsigned int),
-		       int (*flush)(void*, unsigned int),
-		       unsigned char *out_buf,
-		       unsigned int *in_pos,
-		       void (*error)(const char *x))
+int INIT unzstd(unsigned char *in_buf, unsigned int in_len,
+	        int (*fill)(void*, unsigned int),
+	        int (*flush)(void*, unsigned int),
+	        unsigned char *out_buf, unsigned int *in_pos,
+	        void (*error)(const char *x))
 {
 	ZSTD_inBuffer in;
 	ZSTD_outBuffer out;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 30 12:44:27 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Mar 2021 12:44:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.103498.197416 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lRDjP-0002nr-6H; Tue, 30 Mar 2021 12:44:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 103498.197416; Tue, 30 Mar 2021 12:44: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 1lRDjP-0002ni-2h; Tue, 30 Mar 2021 12:44:27 +0000
Received: by outflank-mailman (input) for mailman id 103498;
 Tue, 30 Mar 2021 12:44: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 1lRDjO-0002nR-5f
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:44: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 1lRDjO-0004CD-4o
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:44:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lRDjO-0001aB-3q
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:44:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=by03dK/rIFC3uzJS2W6kO4tz//l4p77P8TITpNBsRtg=; b=kRpjgVZJOt/J+iknd9AKNBD0Iw
	4Iuia4eh8rK4+XQscCUddN9cQi56yHnscqc7JNYxBerWzZRPyU9zI6JB5GlVfOzy+IrLrUom2Th02
	gTSMPPt5vGztoXHIYjuh30/hypVA5IoWBzaU+blK2wJEBDzD5Ybjx8z4OI13mv4HjUGc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] public: add RING_COPY_RESPONSE()
Message-Id: <E1lRDjO-0001aB-3q@xenbits.xenproject.org>
Date: Tue, 30 Mar 2021 12:44:26 +0000

commit 60081862a8272fb021d4f4b85ee83eafe048f8f0
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Tue Mar 30 14:37:38 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 30 14:37:38 2021 +0200

    public: add RING_COPY_RESPONSE()
    
    Using RING_GET_RESPONSE() on a shared ring is easy to use incorrectly
    (i.e., by not considering that the other end may alter the data in the
    shared ring while it is being inspected). Safe usage of a response
    generally requires taking a local copy.
    
    Provide a RING_COPY_RESPONSE() macro to use instead of
    RING_GET_RESPONSE() and an open-coded memcpy().  This takes care of
    ensuring that the copy is done correctly regardless of any possible
    compiler optimizations.
    
    Use a volatile source to prevent the compiler from reordering or
    omitting the copy.
    
    This generalizes similar RING_COPY_REQUEST() macro added in 3f20b8def0.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 xen/include/public/io/ring.h | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/xen/include/public/io/ring.h b/xen/include/public/io/ring.h
index 6a94a9fe4b..0b08b2697e 100644
--- a/xen/include/public/io/ring.h
+++ b/xen/include/public/io/ring.h
@@ -231,22 +231,25 @@ typedef struct __name##_back_ring __name##_back_ring_t
 #define RING_GET_REQUEST(_r, _idx)                                      \
     (&((_r)->sring->ring[((_idx) & (RING_SIZE(_r) - 1))].req))
 
+#define RING_GET_RESPONSE(_r, _idx)                                     \
+    (&((_r)->sring->ring[((_idx) & (RING_SIZE(_r) - 1))].rsp))
+
 /*
- * Get a local copy of a request.
+ * Get a local copy of a request/response.
  *
- * Use this in preference to RING_GET_REQUEST() so all processing is
+ * Use this in preference to RING_GET_{REQUEST,RESPONSE}() so all processing is
  * done on a local copy that cannot be modified by the other end.
  *
  * Note that https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145 may cause this
- * to be ineffective where _req is a struct which consists of only bitfields.
+ * to be ineffective where dest is a struct which consists of only bitfields.
  */
-#define RING_COPY_REQUEST(_r, _idx, _req) do {				\
-	/* Use volatile to force the copy into _req. */			\
-	*(_req) = *(volatile __typeof__(_req))RING_GET_REQUEST(_r, _idx);	\
+#define RING_COPY_(type, r, idx, dest) do {				\
+	/* Use volatile to force the copy into dest. */			\
+	*(dest) = *(volatile __typeof__(dest))RING_GET_##type(r, idx);	\
 } while (0)
 
-#define RING_GET_RESPONSE(_r, _idx)                                     \
-    (&((_r)->sring->ring[((_idx) & (RING_SIZE(_r) - 1))].rsp))
+#define RING_COPY_REQUEST(r, idx, req)  RING_COPY_(REQUEST, r, idx, req)
+#define RING_COPY_RESPONSE(r, idx, rsp) RING_COPY_(RESPONSE, r, idx, rsp)
 
 /* Loop termination condition: Would the specified index overflow the ring? */
 #define RING_REQUEST_CONS_OVERFLOW(_r, _cons)                           \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 30 12:44:37 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Mar 2021 12:44:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.103499.197420 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lRDjZ-0002p9-7Y; Tue, 30 Mar 2021 12:44:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 103499.197420; Tue, 30 Mar 2021 12:44: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 1lRDjZ-0002p1-4c; Tue, 30 Mar 2021 12:44:37 +0000
Received: by outflank-mailman (input) for mailman id 103499;
 Tue, 30 Mar 2021 12:44: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 1lRDjY-0002ot-AP
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:44: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 1lRDjY-0004CK-9Z
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:44:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lRDjY-0001bk-7K
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:44:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=m5S/zq8R1Z4sLDIYqdJDoPe4RPXwoFB1pSkrc6ilt7k=; b=P39m+FBzctkLwvZe8QMxzY1l6h
	uvqxoPNrBZHr1ww0wblm4lL2GC5Kg3/+B9+8B0es+5Ta6T9i99imZ9V9nuKyI4k0apK5h3fgH3Kg/
	zopw3Vse39KhJ70W3qCaW3MSQtUbaS2BjOr3zo50a1fGfYo3uPLjXKvttfdpY7QQ28hE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] hvm/mtrr: remove unnecessary is_hvm_domain check
Message-Id: <E1lRDjY-0001bk-7K@xenbits.xenproject.org>
Date: Tue, 30 Mar 2021 12:44:36 +0000

commit 14612851867e61cf5b46f13aca5a2ce2c329efb6
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Mar 30 14:37:53 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 30 14:37:53 2021 +0200

    hvm/mtrr: remove unnecessary is_hvm_domain check
    
    epte_get_entry_emt will only be called for HVM domains, so the
    is_hvm_domain check is unnecessary. It's a remnant of PVHv1.
    
    Shouldn't result in any functional change.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/mtrr.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c
index fb051d59c3..82ded1635c 100644
--- a/xen/arch/x86/hvm/mtrr.c
+++ b/xen/arch/x86/hvm/mtrr.c
@@ -851,10 +851,8 @@ int epte_get_entry_emt(struct domain *d, unsigned long gfn, mfn_t mfn,
     if ( gmtrr_mtype == -EADDRNOTAVAIL )
         return -1;
 
-    gmtrr_mtype = is_hvm_domain(d) && v ?
-                  get_mtrr_type(&v->arch.hvm.mtrr,
-                                gfn << PAGE_SHIFT, order) :
-                  MTRR_TYPE_WRBACK;
+    gmtrr_mtype = v ? get_mtrr_type(&v->arch.hvm.mtrr, gfn << PAGE_SHIFT, order)
+                    : MTRR_TYPE_WRBACK;
     hmtrr_mtype = get_mtrr_type(&mtrr_state, mfn_x(mfn) << PAGE_SHIFT, order);
     if ( gmtrr_mtype < 0 || hmtrr_mtype < 0 )
         return -1;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 30 12:44:48 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Mar 2021 12:44:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.103500.197424 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lRDjk-0002qS-95; Tue, 30 Mar 2021 12:44:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 103500.197424; Tue, 30 Mar 2021 12:44: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 1lRDjk-0002qK-67; Tue, 30 Mar 2021 12:44:48 +0000
Received: by outflank-mailman (input) for mailman id 103500;
 Tue, 30 Mar 2021 12:44: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 1lRDji-0002qC-E2
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:44: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 1lRDji-0004Ck-DG
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:44:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lRDji-0001dH-Bu
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:44: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=W4sZmYWslngKS2JGQ3iH9gU6m90T7+PAaS/9E+TtCqs=; b=vIDGym9zHXtdWGX1K5X+GoZUOg
	YCAtvhVhlIByziZTdGwWd8Hi8ilZI5XFQnszli4+Uu+PYKoWESEbeIKyhpSvKnZSTB26irnj4nvwO
	2Maq8u9YLUOgmQ8q0CeRHdBG6WJA4vxq6g+vfm8Sg9Y6jpHcz/Amd2J54A2X+x44UabE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: fix build when NR_CPUS == 1
Message-Id: <E1lRDji-0001dH-Bu@xenbits.xenproject.org>
Date: Tue, 30 Mar 2021 12:44:46 +0000

commit 9e0199726be09761c00791576f902d446b87fe1f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 30 14:38:45 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 30 14:38:45 2021 +0200

    x86: fix build when NR_CPUS == 1
    
    In this case the compiler is recognizing that no valid array indexes
    remain (in x2apic_cluster()'s access to per_cpu(cpu_2_logical_apicid,
    ...)), but oddly enough isn't really consistent about the checking it
    does (see the code comment).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/genapic/x2apic.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c
index 077a576a7f..628b441da5 100644
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -54,7 +54,17 @@ static void init_apic_ldr_x2apic_cluster(void)
     per_cpu(cluster_cpus, this_cpu) = cluster_cpus_spare;
     for_each_online_cpu ( cpu )
     {
-        if (this_cpu == cpu || x2apic_cluster(this_cpu) != x2apic_cluster(cpu))
+        if ( this_cpu == cpu )
+            continue;
+        /*
+         * Guard in particular against the compiler suspecting out-of-bounds
+         * array accesses below when NR_CPUS=1 (oddly enough with gcc 10 it
+         * is the 1st of these alone which actually helps, not the 2nd, nor
+         * are both required together there).
+         */
+        BUG_ON(this_cpu >= NR_CPUS);
+        BUG_ON(cpu >= NR_CPUS);
+        if ( x2apic_cluster(this_cpu) != x2apic_cluster(cpu) )
             continue;
         per_cpu(cluster_cpus, this_cpu) = per_cpu(cluster_cpus, cpu);
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 30 12:44:58 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Mar 2021 12:44:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.103501.197428 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lRDju-0002rn-B1; Tue, 30 Mar 2021 12:44:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 103501.197428; Tue, 30 Mar 2021 12:44: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 1lRDju-0002rf-7Z; Tue, 30 Mar 2021 12:44:58 +0000
Received: by outflank-mailman (input) for mailman id 103501;
 Tue, 30 Mar 2021 12:44: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 1lRDjs-0002rW-IW
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:44: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 1lRDjs-0004Cs-Gx
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:44:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lRDjs-0001dr-Fi
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:44:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rqdUuPxwbqbx4YVwUn4zJuMxoTadHOEvsmrbAHsaggQ=; b=reSd6MUEJjbBWFf7Npy0b4uQ/W
	3p23JYt2F1CxpKZUonv2KNJmHoiOUFY0YTwB02giulyuURmRUpbpBdOwgpnn6Xr7pMEorEv1kPeZX
	NIJsqF+RytNxc1BSbcRKYFBzjsksKhB1BdoQDragl1VYkY5lTjJD2RTNrQV9xuZWdSZY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] VT-d: leave FECTL write to vtd_resume()
Message-Id: <E1lRDjs-0001dr-Fi@xenbits.xenproject.org>
Date: Tue, 30 Mar 2021 12:44:56 +0000

commit 0d597e7bd1bd8a57619690d457f79769777a5834
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 30 14:39:23 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 30 14:39:23 2021 +0200

    VT-d: leave FECTL write to vtd_resume()
    
    We shouldn't blindly unmask the interrupt when resuming. vtd_resume()
    will restore the intended state.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 44e407d19f..058f55f9a0 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2092,7 +2092,7 @@ static int adjust_vtd_irq_affinities(void)
 }
 __initcall(adjust_vtd_irq_affinities);
 
-static int __must_check init_vtd_hw(void)
+static int __must_check init_vtd_hw(bool resume)
 {
     struct acpi_drhd_unit *drhd;
     struct vtd_iommu *iommu;
@@ -2121,6 +2121,10 @@ static int __must_check init_vtd_hw(void)
             disable_qinval(iommu);
         }
 
+        if ( resume )
+            /* FECTL write done by vtd_resume(). */
+            continue;
+
         spin_lock_irqsave(&iommu->register_lock, flags);
         sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
         sts &= ~DMA_FECTL_IM;
@@ -2320,7 +2324,7 @@ static int __init vtd_setup(void)
     P(iommu_hap_pt_share, "Shared EPT tables");
 #undef P
 
-    ret = init_vtd_hw();
+    ret = init_vtd_hw(false);
     if ( ret )
         goto error;
 
@@ -2590,7 +2594,7 @@ static void vtd_resume(void)
     if ( !iommu_enabled )
         return;
 
-    if ( init_vtd_hw() != 0  && force_iommu )
+    if ( init_vtd_hw(true) != 0 && force_iommu )
          panic("IOMMU setup failed, crash Xen for security purpose\n");
 
     for_each_drhd_unit ( drhd )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 30 12:45:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Mar 2021 12:45:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.103502.197433 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lRDk4-0002tF-F5; Tue, 30 Mar 2021 12:45:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 103502.197433; Tue, 30 Mar 2021 12:45: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 1lRDk4-0002t6-BJ; Tue, 30 Mar 2021 12:45:08 +0000
Received: by outflank-mailman (input) for mailman id 103502;
 Tue, 30 Mar 2021 12:45: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 1lRDk2-0002sw-L7
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:45: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 1lRDk2-0004DQ-KL
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:45:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lRDk2-0001ej-JQ
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:45:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IkS42kkRMvLUydE5SRLokosWizioY4I52oZTO7EcALc=; b=my9WwCK00rrpJ3C2/70iITKtTs
	HKDs0YICej+D7OJdIsOUD3+4ABY7257Dt9CVVTEgpSKHLQ6TIRtnSAMAI9GLY8IFjapbo8D/fAkCz
	SoPvO6dWxMr+9eHstSf40a55YF04ggysVTNwOn4LpFh8FLRBhhO1Vo7KbXASAoWDbD34=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] VT-d: re-order register restoring in vtd_resume()
Message-Id: <E1lRDk2-0001ej-JQ@xenbits.xenproject.org>
Date: Tue, 30 Mar 2021 12:45:06 +0000

commit 95e07f8c0e64889ee56015c7f99bdf5309e9e8ef
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 30 14:39:54 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 30 14:39:54 2021 +0200

    VT-d: re-order register restoring in vtd_resume()
    
    For one FECTL must be written last - the interrupt shouldn't be unmasked
    without first having written the data and address needed to actually
    deliver it. In the common case (when dma_msi_set_affinity() doesn't end
    up bailing early) this happens from init_vtd_hw(), but for this to
    actually have the intended effect we shouldn't subsequently overwrite
    what was written there - this is only benign when old and new settings
    match. Instead we should restore the registers ahead of calling
    init_vtd_hw(), just for the unlikely case of dma_msi_set_affinity()
    bailing early.
    
    In the moved code drop some stray casts as well.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 058f55f9a0..114f9512e9 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2594,6 +2594,21 @@ static void vtd_resume(void)
     if ( !iommu_enabled )
         return;
 
+    for_each_drhd_unit ( drhd )
+    {
+        iommu = drhd->iommu;
+        i = iommu->index;
+
+        spin_lock_irqsave(&iommu->register_lock, flags);
+        dmar_writel(iommu->reg, DMAR_FEDATA_REG,
+                    iommu_state[i][DMAR_FEDATA_REG]);
+        dmar_writel(iommu->reg, DMAR_FEADDR_REG,
+                    iommu_state[i][DMAR_FEADDR_REG]);
+        dmar_writel(iommu->reg, DMAR_FEUADDR_REG,
+                    iommu_state[i][DMAR_FEUADDR_REG]);
+        spin_unlock_irqrestore(&iommu->register_lock, flags);
+    }
+
     if ( init_vtd_hw(true) != 0 && force_iommu )
          panic("IOMMU setup failed, crash Xen for security purpose\n");
 
@@ -2605,12 +2620,6 @@ static void vtd_resume(void)
         spin_lock_irqsave(&iommu->register_lock, flags);
         dmar_writel(iommu->reg, DMAR_FECTL_REG,
                     (u32) iommu_state[i][DMAR_FECTL_REG]);
-        dmar_writel(iommu->reg, DMAR_FEDATA_REG,
-                    (u32) iommu_state[i][DMAR_FEDATA_REG]);
-        dmar_writel(iommu->reg, DMAR_FEADDR_REG,
-                    (u32) iommu_state[i][DMAR_FEADDR_REG]);
-        dmar_writel(iommu->reg, DMAR_FEUADDR_REG,
-                    (u32) iommu_state[i][DMAR_FEUADDR_REG]);
         spin_unlock_irqrestore(&iommu->register_lock, flags);
 
         iommu_enable_translation(drhd);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 30 12:45:18 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Mar 2021 12:45:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.103503.197437 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lRDkE-0002ue-GK; Tue, 30 Mar 2021 12:45:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 103503.197437; Tue, 30 Mar 2021 12:45: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 1lRDkE-0002uU-Cw; Tue, 30 Mar 2021 12:45:18 +0000
Received: by outflank-mailman (input) for mailman id 103503;
 Tue, 30 Mar 2021 12:45: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 1lRDkC-0002uM-PX
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:45: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 1lRDkC-0004DY-Nu
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:45:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lRDkC-0001fb-My
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 12:45: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=2C/S9PDlrBMvSEzT506HvSLNX8kmfVxEW6XFoBjXzk0=; b=LPjwJlmoVyE2bsBTAneje/odtq
	K7h0REeX1vFApIKLBqjv5U0l803yhvHD71mVtGTy5Rs7hoXnMWRkRezmgGtNmTcxRhi+XVjPeOHD7
	JG+pE5rDqI4s7xU952jZvrU7Of+HLm3KBcylFt4L73oHp+A9fqjypRg339addBjLxoSo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] VT-d: restore flush hooks when disabling qinval
Message-Id: <E1lRDkC-0001fb-My@xenbits.xenproject.org>
Date: Tue, 30 Mar 2021 12:45:16 +0000

commit 9c39dba2b179c0f4c42c98e97ea0878119718530
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 30 14:40:24 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 30 14:40:24 2021 +0200

    VT-d: restore flush hooks when disabling qinval
    
    Leaving the hooks untouched is at best a latent risk: There may well be
    cases where some flush is needed, which then needs carrying out the
    "register" way.
    
    Switch from u<N> to uint<N>_t while needing to touch the function
    headers anyway.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/extern.h | 10 ++++++++++
 xen/drivers/passthrough/vtd/iommu.c  | 19 ++++++++-----------
 xen/drivers/passthrough/vtd/qinval.c |  3 +++
 3 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index 19a908ab4f..156177bb3f 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -49,6 +49,16 @@ int iommu_flush_iec_global(struct vtd_iommu *iommu);
 int iommu_flush_iec_index(struct vtd_iommu *iommu, u8 im, u16 iidx);
 void clear_fault_bits(struct vtd_iommu *iommu);
 
+int __must_check vtd_flush_context_reg(struct vtd_iommu *iommu, uint16_t did,
+                                       uint16_t source_id,
+                                       uint8_t function_mask, uint64_t type,
+                                       bool flush_non_present_entry);
+int __must_check vtd_flush_iotlb_reg(struct vtd_iommu *iommu, uint16_t did,
+                                     uint64_t addr, unsigned int size_order,
+                                     uint64_t type,
+                                     bool flush_non_present_entry,
+                                     bool flush_dev_iotlb);
+
 struct vtd_iommu *ioapic_to_iommu(unsigned int apic_id);
 struct vtd_iommu *hpet_to_iommu(unsigned int hpet_id);
 struct acpi_drhd_unit *ioapic_to_drhd(unsigned int apic_id);
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 114f9512e9..6428c8fe3e 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -380,10 +380,9 @@ static void iommu_flush_write_buffer(struct vtd_iommu *iommu)
 }
 
 /* return value determine if we need a write buffer flush */
-static int __must_check flush_context_reg(struct vtd_iommu *iommu, u16 did,
-                                          u16 source_id, u8 function_mask,
-                                          u64 type,
-                                          bool flush_non_present_entry)
+int vtd_flush_context_reg(struct vtd_iommu *iommu, uint16_t did,
+                          uint16_t source_id, uint8_t function_mask,
+                          uint64_t type, bool flush_non_present_entry)
 {
     u64 val = 0;
     unsigned long flags;
@@ -449,11 +448,9 @@ static int __must_check iommu_flush_context_device(struct vtd_iommu *iommu,
 }
 
 /* return value determine if we need a write buffer flush */
-static int __must_check flush_iotlb_reg(struct vtd_iommu *iommu, u16 did,
-                                        u64 addr,
-                                        unsigned int size_order, u64 type,
-                                        bool flush_non_present_entry,
-                                        bool flush_dev_iotlb)
+int vtd_flush_iotlb_reg(struct vtd_iommu *iommu, uint16_t did, uint64_t addr,
+                        unsigned int size_order, uint64_t type,
+                        bool flush_non_present_entry, bool flush_dev_iotlb)
 {
     int tlb_offset = ecap_iotlb_offset(iommu->ecap);
     u64 val = 0;
@@ -2144,8 +2141,8 @@ static int __must_check init_vtd_hw(bool resume)
          */
         if ( enable_qinval(iommu) != 0 )
         {
-            iommu->flush.context = flush_context_reg;
-            iommu->flush.iotlb   = flush_iotlb_reg;
+            iommu->flush.context = vtd_flush_context_reg;
+            iommu->flush.iotlb   = vtd_flush_iotlb_reg;
         }
     }
 
diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index 39b7abd009..764ef9f0fc 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -462,4 +462,7 @@ void disable_qinval(struct vtd_iommu *iommu)
                   !(sts & DMA_GSTS_QIES), sts);
 out:
     spin_unlock_irqrestore(&iommu->register_lock, flags);
+
+    iommu->flush.context = vtd_flush_context_reg;
+    iommu->flush.iotlb   = vtd_flush_iotlb_reg;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 30 13:00:06 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Mar 2021 13:00:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.103511.197463 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lRDyV-0004QU-2i; Tue, 30 Mar 2021 13:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 103511.197463; Tue, 30 Mar 2021 13: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 1lRDyU-0004Q7-Vo; Tue, 30 Mar 2021 13:00:02 +0000
Received: by outflank-mailman (input) for mailman id 103511;
 Tue, 30 Mar 2021 13: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 1lRDyU-0004Kf-8a
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 13: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 1lRDyU-0004VM-6P
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 13:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lRDyU-0002tp-4W
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 13:00:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=S82s8J6p8DJBdiDWEfPfRxzDC6/6rmz31a3VF6vISxk=; b=B251oYlPn86g1mEiPAZDd7ZoKB
	LDv8Z0SnfJl+/w4oWTlAY07NDFxNKbqHh7q1t3KPKBl6N8fYPAagIuJphluYJb5NwYbHkl440BdLN
	vfixvcUxiDf2YDFdKZ49fw5iGAfL/fmEUw3CaQVWQZ3GgAcqBnEK/owcasCYGf4bbL6A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: Remove unnecessary define XC_WANT_COMPAT_MAP_FOREIGN_API
Message-Id: <E1lRDyU-0002tp-4W@xenbits.xenproject.org>
Date: Tue, 30 Mar 2021 13:00:02 +0000

commit cead8c0d17462f3a1150b5657d3f4eaa88faf1cb
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Mar 25 11:39:23 2021 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Mar 29 17:39:03 2021 +0100

    tools/xenstored: Remove unnecessary define XC_WANT_COMPAT_MAP_FOREIGN_API
    
    The last use of the compat foreign API was dropped in commit
    38eeb3864de4 "tools/xenstored: Drop mapping of the ring via foreign
    map".
    
    Therefore, we don't need to define XC_WANT_COMPAT_MAP_FOREIGN_API.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstore/xenstored_core.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 0c9a0961b5..1cdbc3dcb5 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -19,7 +19,6 @@
 #ifndef _XENSTORED_CORE_H
 #define _XENSTORED_CORE_H
 
-#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
 #include <xengnttab.h>
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Mar 30 13:44:11 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Mar 2021 13:44:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.103534.197501 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lREf8-00019L-VA; Tue, 30 Mar 2021 13:44:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 103534.197501; Tue, 30 Mar 2021 13:44: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 1lREf8-00019D-SC; Tue, 30 Mar 2021 13:44:06 +0000
Received: by outflank-mailman (input) for mailman id 103534;
 Tue, 30 Mar 2021 13:44: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 1lREf7-000198-Ft
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 13:44: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 1lREf7-0005Ck-Db
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 13:44:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lREf7-0007HK-An
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 13:44:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ox7AWDsjWWBR9WpE3qc11OogpfeXuGg28QUUBAWPeIs=; b=Vnegsgg5Ekj821v7RYw/ZGgGJc
	Wh1hcSgGV9vx9KfGKx7rXeJgpJF0tkkvn9UujC5i5c+Xy54FwHKrm7PxP3S9lL4M84ycLY7lNFhuR
	XyC1yuzOJwaFz+WgvZiuQHoFmTlF+R5m9iUzBmH8yWweCBc4UyYxU75z5jDVoHFPcKhs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Revert "x86/shadow: replace stale literal numbers in hash_{vcpu,domain}_foreach()"
Message-Id: <E1lREf7-0007HK-An@xenbits.xenproject.org>
Date: Tue, 30 Mar 2021 13:44:05 +0000

commit d26a4691ea3a5eea7df9c8b49e09aad7f067cdfc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 30 15:31:25 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 30 15:31:25 2021 +0200

    Revert "x86/shadow: replace stale literal numbers in hash_{vcpu,domain}_foreach()"
    
    This reverts commit c201d303e801a949b10f9e0f36cdc1938ddd399e - a
    stale version (not working with clang) ended up getting committed.
---
 xen/arch/x86/mm/shadow/common.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 31a5ccf4ca..4a8882430b 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1623,9 +1623,6 @@ 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);
 
-#define HASH_CALLBACKS_CHECK(mask) \
-    BUILD_BUG_ON((mask) > (1U << ARRAY_SIZE(callbacks)) - 1)
-
 static void hash_vcpu_foreach(struct vcpu *v, unsigned int callback_mask,
                               const hash_vcpu_callback_t callbacks[],
                               mfn_t callback_mfn)
@@ -1661,7 +1658,7 @@ static void hash_vcpu_foreach(struct vcpu *v, unsigned int callback_mask,
         {
             if ( callback_mask & (1 << x->u.sh.type) )
             {
-                ASSERT(x->u.sh.type < SH_type_unused);
+                ASSERT(x->u.sh.type <= 15);
                 ASSERT(callbacks[x->u.sh.type] != NULL);
                 done = callbacks[x->u.sh.type](v, page_to_mfn(x),
                                                callback_mfn);
@@ -1708,7 +1705,7 @@ static void hash_domain_foreach(struct domain *d,
         {
             if ( callback_mask & (1 << x->u.sh.type) )
             {
-                ASSERT(x->u.sh.type < SH_type_unused);
+                ASSERT(x->u.sh.type <= 15);
                 ASSERT(callbacks[x->u.sh.type] != NULL);
                 done = callbacks[x->u.sh.type](d, page_to_mfn(x),
                                                callback_mfn);
@@ -2012,7 +2009,6 @@ 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);
 
     /* If that didn't catch the mapping, then there's some non-pagetable
@@ -2084,7 +2080,6 @@ 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);
 
     /* If that didn't catch the mapping, something is very wrong */
@@ -2251,12 +2246,10 @@ void sh_remove_shadows(struct domain *d, mfn_t gmfn, int fast, int all)
     /* Search for this shadow in all appropriate shadows */
     perfc_incr(shadow_unshadow);
 
-    /*
-     * Lower-level shadows need to be excised from upper-level shadows. This
-     * call to hash_domain_foreach() looks dangerous but is in fact OK: each
+    /* Lower-level shadows need to be excised from upper-level shadows.
+     * This call to hash_vcpu_foreach() looks dangerous but is in fact OK: each
      * call will remove at most one shadow, and terminate immediately when
-     * it does remove it, so we never walk the hash after doing a deletion.
-     */
+     * it does remove it, so we never walk the hash after doing a deletion.  */
 #define DO_UNSHADOW(_type) do {                                         \
     t = (_type);                                                        \
     if( !(pg->count_info & PGC_page_table)                              \
@@ -2277,7 +2270,6 @@ void sh_remove_shadows(struct domain *d, mfn_t gmfn, int fast, int all)
     if( !fast                                                           \
         && (pg->count_info & PGC_page_table)                            \
         && (pg->shadow_flags & (1 << t)) )                              \
-        HASH_CALLBACKS_CHECK(SHF_page_type_mask);                       \
         hash_domain_foreach(d, masks[t], callbacks, smfn);              \
 } while (0)
 
@@ -2378,7 +2370,6 @@ void sh_reset_l3_up_pointers(struct vcpu *v)
     };
     static const unsigned int callback_mask = SHF_L3_64;
 
-    HASH_CALLBACKS_CHECK(callback_mask);
     hash_vcpu_foreach(v, callback_mask, callbacks, INVALID_MFN);
 }
 
@@ -3429,7 +3420,6 @@ void shadow_audit_tables(struct vcpu *v)
         }
     }
 
-    HASH_CALLBACKS_CHECK(SHF_page_type_mask);
     hash_vcpu_foreach(v, mask, callbacks, INVALID_MFN);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Mar 30 13:44:16 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Mar 2021 13:44:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.103535.197505 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lREfI-0001A6-0b; Tue, 30 Mar 2021 13:44:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 103535.197505; Tue, 30 Mar 2021 13: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 1lREfH-00019y-Tl; Tue, 30 Mar 2021 13:44:15 +0000
Received: by outflank-mailman (input) for mailman id 103535;
 Tue, 30 Mar 2021 13:44: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 1lREfH-00019t-KK
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 13:44: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 1lREfH-0005Cn-JT
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 13:44:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lREfH-0007Ih-Hg
 for xen-changelog@lists.xenproject.org; Tue, 30 Mar 2021 13:44:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lhZPO9dtjsdCzJWjdNZM0CcgGfDoyyQiaaaX7FsOepU=; b=pwJl0K+seMVSJ/ZgM+GA8tWkmn
	B6P6fUGjTUEZfOz6mpnUc7Fyz1YobZDQcfcXpQUmEOFl1OVEVxodDcM6e6Vv73Od7nqjkokxYxpVM
	njgsVT7vcPbOGO9Q/I9otRp3T3Ok/7EOotbv0tMB+Z1xzXmB4+TGpMGJy5ZkMe/IYCA8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: replace stale literal numbers in hash_{vcpu,domain}_foreach()
Message-Id: <E1lREfH-0007Ih-Hg@xenbits.xenproject.org>
Date: Tue, 30 Mar 2021 13:44:15 +0000

commit 90629587e16e2efdb61da77f25c25fba3c4a5fd7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 30 15:32:59 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 30 15:32:59 2021 +0200

    x86/shadow: replace stale literal numbers in hash_{vcpu,domain}_foreach()
    
    15 apparently once used to be the last valid type to request a callback
    for, and the dimension of the respective array. The arrays meanwhile are
    larger than this (in a benign way, i.e. no caller ever sets a mask bit
    higher than 15), dimensioned by SH_type_unused. Have the ASSERT()s
    follow suit and add build time checks at the call sites.
    
    Sadly at least some Clang versions aren't as flexible with
    _Static_assert() as gcc is - they demand a truly integer constant
    expression, while gcc also permits constant variables.
    
    Also adjust a comment naming the wrong of the two functions.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 4a8882430b..c64de3b789 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1623,6 +1623,13 @@ 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[],
                               mfn_t callback_mfn)
@@ -1658,7 +1665,7 @@ static void hash_vcpu_foreach(struct vcpu *v, unsigned int callback_mask,
         {
             if ( callback_mask & (1 << x->u.sh.type) )
             {
-                ASSERT(x->u.sh.type <= 15);
+                ASSERT(x->u.sh.type < SH_type_unused);
                 ASSERT(callbacks[x->u.sh.type] != NULL);
                 done = callbacks[x->u.sh.type](v, page_to_mfn(x),
                                                callback_mfn);
@@ -1705,7 +1712,7 @@ static void hash_domain_foreach(struct domain *d,
         {
             if ( callback_mask & (1 << x->u.sh.type) )
             {
-                ASSERT(x->u.sh.type <= 15);
+                ASSERT(x->u.sh.type < SH_type_unused);
                 ASSERT(callbacks[x->u.sh.type] != NULL);
                 done = callbacks[x->u.sh.type](d, page_to_mfn(x),
                                                callback_mfn);
@@ -2009,6 +2016,7 @@ 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);
 
     /* If that didn't catch the mapping, then there's some non-pagetable
@@ -2080,6 +2088,7 @@ 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);
 
     /* If that didn't catch the mapping, something is very wrong */
@@ -2246,10 +2255,12 @@ void sh_remove_shadows(struct domain *d, mfn_t gmfn, int fast, int all)
     /* Search for this shadow in all appropriate shadows */
     perfc_incr(shadow_unshadow);
 
-    /* Lower-level shadows need to be excised from upper-level shadows.
-     * This call to hash_vcpu_foreach() looks dangerous but is in fact OK: each
+    /*
+     * Lower-level shadows need to be excised from upper-level shadows. This
+     * call to hash_domain_foreach() looks dangerous but is in fact OK: each
      * call will remove at most one shadow, and terminate immediately when
-     * it does remove it, so we never walk the hash after doing a deletion.  */
+     * it does remove it, so we never walk the hash after doing a deletion.
+     */
 #define DO_UNSHADOW(_type) do {                                         \
     t = (_type);                                                        \
     if( !(pg->count_info & PGC_page_table)                              \
@@ -2270,6 +2281,7 @@ void sh_remove_shadows(struct domain *d, mfn_t gmfn, int fast, int all)
     if( !fast                                                           \
         && (pg->count_info & PGC_page_table)                            \
         && (pg->shadow_flags & (1 << t)) )                              \
+        HASH_CALLBACKS_CHECK(SHF_page_type_mask);                       \
         hash_domain_foreach(d, masks[t], callbacks, smfn);              \
 } while (0)
 
@@ -2370,6 +2382,7 @@ void sh_reset_l3_up_pointers(struct vcpu *v)
     };
     static const unsigned int callback_mask = SHF_L3_64;
 
+    HASH_CALLBACKS_CHECK(callback_mask);
     hash_vcpu_foreach(v, callback_mask, callbacks, INVALID_MFN);
 }
 
@@ -3420,6 +3433,7 @@ void shadow_audit_tables(struct vcpu *v)
         }
     }
 
+    HASH_CALLBACKS_CHECK(SHF_page_type_mask);
     hash_vcpu_foreach(v, mask, callbacks, INVALID_MFN);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Mar 31 23:33:08 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 31 Mar 2021 23:33:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.104076.198635 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lRkKd-0000sE-4C; Wed, 31 Mar 2021 23:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 104076.198635; Wed, 31 Mar 2021 23: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 1lRkKd-0000s6-15; Wed, 31 Mar 2021 23:33:03 +0000
Received: by outflank-mailman (input) for mailman id 104076;
 Wed, 31 Mar 2021 23: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 1lRkKc-0000s1-EJ
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23: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 1lRkKc-0005Ud-DQ
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lRkKc-0003bA-AX
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23: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=xbYKcSblW/SvukgPxLnIfG1enb1jU0RSvG891e3MHkQ=; b=mzhAN7wXQkXFM7LM/TC0tg9OT0
	3bqW1mQOqGyLwbXeNbPZKBUjwfb+LBg2s4curcd/TIfgazn9daCEd2FYd9M7lTUk6Wd1up1d4gHca
	LXIy2aLsVKarsCOpoc64OETJMOxxawt9cRfJA903HzyRPpxUJXRL1TJRkwBh3uzxVElc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: replace stale literal numbers in hash_{vcpu,domain}_foreach()
Message-Id: <E1lRkKc-0003bA-AX@xenbits.xenproject.org>
Date: Wed, 31 Mar 2021 23:33:02 +0000

commit c201d303e801a949b10f9e0f36cdc1938ddd399e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 30 14:32:44 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 30 14:32:44 2021 +0200

    x86/shadow: replace stale literal numbers in hash_{vcpu,domain}_foreach()
    
    15 apparently once used to be the last valid type to request a callback
    for, and the dimension of the respective array. The arrays meanwhile are
    larger than this (in a benign way, i.e. no caller ever sets a mask bit
    higher than 15), dimensioned by SH_type_unused. Have the ASSERT()s
    follow suit and add build time checks at the call sites.
    
    Also adjust a comment naming the wrong of the two functions.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 4a8882430b..31a5ccf4ca 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1623,6 +1623,9 @@ 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);
 
+#define HASH_CALLBACKS_CHECK(mask) \
+    BUILD_BUG_ON((mask) > (1U << ARRAY_SIZE(callbacks)) - 1)
+
 static void hash_vcpu_foreach(struct vcpu *v, unsigned int callback_mask,
                               const hash_vcpu_callback_t callbacks[],
                               mfn_t callback_mfn)
@@ -1658,7 +1661,7 @@ static void hash_vcpu_foreach(struct vcpu *v, unsigned int callback_mask,
         {
             if ( callback_mask & (1 << x->u.sh.type) )
             {
-                ASSERT(x->u.sh.type <= 15);
+                ASSERT(x->u.sh.type < SH_type_unused);
                 ASSERT(callbacks[x->u.sh.type] != NULL);
                 done = callbacks[x->u.sh.type](v, page_to_mfn(x),
                                                callback_mfn);
@@ -1705,7 +1708,7 @@ static void hash_domain_foreach(struct domain *d,
         {
             if ( callback_mask & (1 << x->u.sh.type) )
             {
-                ASSERT(x->u.sh.type <= 15);
+                ASSERT(x->u.sh.type < SH_type_unused);
                 ASSERT(callbacks[x->u.sh.type] != NULL);
                 done = callbacks[x->u.sh.type](d, page_to_mfn(x),
                                                callback_mfn);
@@ -2009,6 +2012,7 @@ 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);
 
     /* If that didn't catch the mapping, then there's some non-pagetable
@@ -2080,6 +2084,7 @@ 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);
 
     /* If that didn't catch the mapping, something is very wrong */
@@ -2246,10 +2251,12 @@ void sh_remove_shadows(struct domain *d, mfn_t gmfn, int fast, int all)
     /* Search for this shadow in all appropriate shadows */
     perfc_incr(shadow_unshadow);
 
-    /* Lower-level shadows need to be excised from upper-level shadows.
-     * This call to hash_vcpu_foreach() looks dangerous but is in fact OK: each
+    /*
+     * Lower-level shadows need to be excised from upper-level shadows. This
+     * call to hash_domain_foreach() looks dangerous but is in fact OK: each
      * call will remove at most one shadow, and terminate immediately when
-     * it does remove it, so we never walk the hash after doing a deletion.  */
+     * it does remove it, so we never walk the hash after doing a deletion.
+     */
 #define DO_UNSHADOW(_type) do {                                         \
     t = (_type);                                                        \
     if( !(pg->count_info & PGC_page_table)                              \
@@ -2270,6 +2277,7 @@ void sh_remove_shadows(struct domain *d, mfn_t gmfn, int fast, int all)
     if( !fast                                                           \
         && (pg->count_info & PGC_page_table)                            \
         && (pg->shadow_flags & (1 << t)) )                              \
+        HASH_CALLBACKS_CHECK(SHF_page_type_mask);                       \
         hash_domain_foreach(d, masks[t], callbacks, smfn);              \
 } while (0)
 
@@ -2370,6 +2378,7 @@ void sh_reset_l3_up_pointers(struct vcpu *v)
     };
     static const unsigned int callback_mask = SHF_L3_64;
 
+    HASH_CALLBACKS_CHECK(callback_mask);
     hash_vcpu_foreach(v, callback_mask, callbacks, INVALID_MFN);
 }
 
@@ -3420,6 +3429,7 @@ void shadow_audit_tables(struct vcpu *v)
         }
     }
 
+    HASH_CALLBACKS_CHECK(SHF_page_type_mask);
     hash_vcpu_foreach(v, mask, callbacks, INVALID_MFN);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Mar 31 23:33:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 31 Mar 2021 23:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.104077.198638 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lRkKo-0000t1-5l; Wed, 31 Mar 2021 23:33:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 104077.198638; Wed, 31 Mar 2021 23:33: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 1lRkKo-0000st-2g; Wed, 31 Mar 2021 23:33:14 +0000
Received: by outflank-mailman (input) for mailman id 104077;
 Wed, 31 Mar 2021 23:33: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 1lRkKm-0000sm-Ja
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:33: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 1lRkKm-0005V1-Ig
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lRkKm-0003bq-Fv
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NINPEBqLmA3HQW9Y7Lm5R5aU143/lATeNd6+j7PIgVE=; b=owHJxLrV1FflipAFKKu9lU/TiG
	r/UOXnngdQrou7wZrObMdc6Dje55rxwzhSq4DIOaSW15yKoy/A/aFa688cDPzqGgrn9G25/2rJ2ZW
	L2Cdq42wc4CGfXx7y6YrS1R4ReZfToalKGa9IT3dzhvBq4+3OycIgJBLscoxz05kTPfU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/decompress: make helper symbols static
Message-Id: <E1lRkKm-0003bq-Fv@xenbits.xenproject.org>
Date: Wed, 31 Mar 2021 23:33:12 +0000

commit eaecd329a56ccbc8158a20a75dcb486d07a412d6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 30 14:33:48 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 30 14:33:48 2021 +0200

    xen/decompress: make helper symbols static
    
    The individual decompression CUs need to only surface their top level
    functions to other code. Arrange for everything else to be static, to
    make sure no undue uses of that code exist or will appear without
    explicitly noticing. (In some cases this also results in code size
    reduction, but since this is all init-only code this probably doesn't
    matter very much.)
    
    In the LZO case also take the opportunity and convert u8 where lines
    get touched anyway.
    
    The downside is that the top level functions will now be non-static
    in stubdom builds of libxenguest, but I think that's acceptable. This
    does require declaring them first, though, as the compiler warns about
    the lack of declarations.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/guest/xg_dom_decompress_unsafe.h |  4 ++++
 xen/common/bunzip2.c                        | 11 +++++------
 xen/common/decompress.h                     |  2 +-
 xen/common/unlz4.c                          | 11 +++++------
 xen/common/unlzma.c                         | 12 +++++-------
 xen/common/unlzo.c                          | 10 +++++-----
 xen/common/unxz.c                           | 10 +++++-----
 xen/common/unzstd.c                         | 11 +++++------
 8 files changed, 35 insertions(+), 36 deletions(-)

diff --git a/tools/libs/guest/xg_dom_decompress_unsafe.h b/tools/libs/guest/xg_dom_decompress_unsafe.h
index 969846cb32..4e0bf23aa5 100644
--- a/tools/libs/guest/xg_dom_decompress_unsafe.h
+++ b/tools/libs/guest/xg_dom_decompress_unsafe.h
@@ -1,8 +1,12 @@
+#ifdef __MINIOS__
+# include "../../xen/include/xen/decompress.h"
+#else
 typedef int decompress_fn(unsigned char *inbuf, unsigned int len,
                           int (*fill)(void*, unsigned int),
                           int (*flush)(void*, unsigned int),
                           unsigned char *outbuf, unsigned int *posp,
                           void (*error)(const char *x));
+#endif
 
 int xc_dom_decompress_unsafe(
     decompress_fn fn, struct xc_dom_image *dom, void **blob, size_t *size)
diff --git a/xen/common/bunzip2.c b/xen/common/bunzip2.c
index 6d6e8b19fd..6aeac79f1a 100644
--- a/xen/common/bunzip2.c
+++ b/xen/common/bunzip2.c
@@ -665,12 +665,11 @@ static int INIT start_bunzip(struct bunzip_data **bdp, void *inbuf, int len,
 
 /* Example usage: decompress src_fd to dst_fd.  (Stops at end of bzip2 data,
    not end of file.) */
-STATIC int INIT bunzip2(unsigned char *buf, unsigned int len,
-			int(*fill)(void*, unsigned int),
-			int(*flush)(void*, unsigned int),
-			unsigned char *outbuf,
-			unsigned int *pos,
-			void(*error)(const char *x))
+int INIT bunzip2(unsigned char *buf, unsigned int len,
+		 int(*fill)(void*, unsigned int),
+		 int(*flush)(void*, unsigned int),
+		 unsigned char *outbuf, unsigned int *pos,
+		 void(*error)(const char *x))
 {
 	struct bunzip_data *bd;
 	int i = -1;
diff --git a/xen/common/decompress.h b/xen/common/decompress.h
index 647b7b1e83..d740a80eeb 100644
--- a/xen/common/decompress.h
+++ b/xen/common/decompress.h
@@ -7,7 +7,7 @@
 #include <xen/types.h>
 #include <xen/xmalloc.h>
 
-#define STATIC
+#define STATIC static
 #define INIT __init
 #define INITDATA __initdata
 
diff --git a/xen/common/unlz4.c b/xen/common/unlz4.c
index 9dcaec7e84..4a8fc55ccb 100644
--- a/xen/common/unlz4.c
+++ b/xen/common/unlz4.c
@@ -22,12 +22,11 @@
 #define LZ4_DEFAULT_UNCOMPRESSED_CHUNK_SIZE (8 << 20)
 #define ARCHIVE_MAGICNUMBER 0x184C2102
 
-STATIC int INIT unlz4(unsigned char *input, unsigned int in_len,
-		      int (*fill)(void *, unsigned int),
-		      int (*flush)(void *, unsigned int),
-		      unsigned char *output,
-		      unsigned int *posp,
-		      void (*error)(const char *x))
+int INIT unlz4(unsigned char *input, unsigned int in_len,
+	       int (*fill)(void *, unsigned int),
+	       int (*flush)(void *, unsigned int),
+	       unsigned char *output, unsigned int *posp,
+	       void (*error)(const char *x))
 {
 	int ret = -1;
 	size_t chunksize = 0;
diff --git a/xen/common/unlzma.c b/xen/common/unlzma.c
index 9134277bba..ea5ab41738 100644
--- a/xen/common/unlzma.c
+++ b/xen/common/unlzma.c
@@ -528,13 +528,11 @@ static inline int INIT process_bit1(struct writer *wr, struct rc *rc,
 
 
 
-STATIC int INIT unlzma(unsigned char *buf, unsigned int in_len,
-		       int(*fill)(void*, unsigned int),
-		       int(*flush)(void*, unsigned int),
-		       unsigned char *output,
-		       unsigned int *posp,
-		       void(*error)(const char *x)
-	)
+int INIT unlzma(unsigned char *buf, unsigned int in_len,
+	        int(*fill)(void*, unsigned int),
+	        int(*flush)(void*, unsigned int),
+	        unsigned char *output, unsigned int *posp,
+	        void(*error)(const char *x))
 {
 	struct lzma_header header;
 	int lc, pb, lp;
diff --git a/xen/common/unlzo.c b/xen/common/unlzo.c
index 11f64fcf3b..df7e53db14 100644
--- a/xen/common/unlzo.c
+++ b/xen/common/unlzo.c
@@ -114,11 +114,11 @@ static int INIT parse_header(u8 *input, int *skip, int in_len)
 	return 1;
 }
 
-STATIC int INIT unlzo(u8 *input, unsigned int in_len,
-		      int (*fill) (void *, unsigned int),
-		      int (*flush) (void *, unsigned int),
-		      u8 *output, unsigned int *posp,
-		      void (*error) (const char *x))
+int INIT unlzo(unsigned char *input, unsigned int in_len,
+	       int (*fill) (void *, unsigned int),
+	       int (*flush) (void *, unsigned int),
+	       unsigned char *output, unsigned int *posp,
+	       void (*error) (const char *x))
 {
 	u8 r = 0;
 	int skip = 0;
diff --git a/xen/common/unxz.c b/xen/common/unxz.c
index cf25c9fc8e..15806f4469 100644
--- a/xen/common/unxz.c
+++ b/xen/common/unxz.c
@@ -157,11 +157,11 @@
  * both input and output buffers are available as a single chunk, i.e. when
  * fill() and flush() won't be used.
  */
-STATIC int INIT unxz(unsigned char *in, unsigned int in_size,
-		     int (*fill)(void *dest, unsigned int size),
-		     int (*flush)(void *src, unsigned int size),
-		     unsigned char *out, unsigned int *in_used,
-		     void (*error)(const char *x))
+int INIT unxz(unsigned char *in, unsigned int in_size,
+	      int (*fill)(void *dest, unsigned int size),
+	      int (*flush)(void *src, unsigned int size),
+	      unsigned char *out, unsigned int *in_used,
+	      void (*error)(const char *x))
 {
 	struct xz_buf b;
 	struct xz_dec *s;
diff --git a/xen/common/unzstd.c b/xen/common/unzstd.c
index a107616427..915a07c21b 100644
--- a/xen/common/unzstd.c
+++ b/xen/common/unzstd.c
@@ -142,12 +142,11 @@ out:
 	return err;
 }
 
-STATIC int INIT unzstd(unsigned char *in_buf, unsigned int in_len,
-		       int (*fill)(void*, unsigned int),
-		       int (*flush)(void*, unsigned int),
-		       unsigned char *out_buf,
-		       unsigned int *in_pos,
-		       void (*error)(const char *x))
+int INIT unzstd(unsigned char *in_buf, unsigned int in_len,
+	        int (*fill)(void*, unsigned int),
+	        int (*flush)(void*, unsigned int),
+	        unsigned char *out_buf, unsigned int *in_pos,
+	        void (*error)(const char *x))
 {
 	ZSTD_inBuffer in;
 	ZSTD_outBuffer out;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Mar 31 23:33:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 31 Mar 2021 23:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.104078.198643 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lRkKy-0000uI-7H; Wed, 31 Mar 2021 23:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 104078.198643; Wed, 31 Mar 2021 23:33: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 1lRkKy-0000uA-4H; Wed, 31 Mar 2021 23:33:24 +0000
Received: by outflank-mailman (input) for mailman id 104078;
 Wed, 31 Mar 2021 23:33: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 1lRkKw-0000u0-Ms
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:33: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 1lRkKw-0005VC-M7
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lRkKw-0003cc-Kt
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qgbPlL0txsmodGgGBWAfZ179iOODk4eXyzqqvTUWIZ4=; b=dV9TAR3hJ0+hR0JcXWhC3mOspE
	gLP9nKq/nMNhl77Ci4BrkxmtgnUSN/Hw09Pr7CcrnH45m9knuonN1zzWiE93eAq6KoahDBp59tcdI
	twMTr6cTMJyrZvIjA90CD6DjwzKM277JLYCFCRJG0346rjKsJnato+AAD1q6q9fvpsjk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] public: add RING_COPY_RESPONSE()
Message-Id: <E1lRkKw-0003cc-Kt@xenbits.xenproject.org>
Date: Wed, 31 Mar 2021 23:33:22 +0000

commit 60081862a8272fb021d4f4b85ee83eafe048f8f0
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Tue Mar 30 14:37:38 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 30 14:37:38 2021 +0200

    public: add RING_COPY_RESPONSE()
    
    Using RING_GET_RESPONSE() on a shared ring is easy to use incorrectly
    (i.e., by not considering that the other end may alter the data in the
    shared ring while it is being inspected). Safe usage of a response
    generally requires taking a local copy.
    
    Provide a RING_COPY_RESPONSE() macro to use instead of
    RING_GET_RESPONSE() and an open-coded memcpy().  This takes care of
    ensuring that the copy is done correctly regardless of any possible
    compiler optimizations.
    
    Use a volatile source to prevent the compiler from reordering or
    omitting the copy.
    
    This generalizes similar RING_COPY_REQUEST() macro added in 3f20b8def0.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 xen/include/public/io/ring.h | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/xen/include/public/io/ring.h b/xen/include/public/io/ring.h
index 6a94a9fe4b..0b08b2697e 100644
--- a/xen/include/public/io/ring.h
+++ b/xen/include/public/io/ring.h
@@ -231,22 +231,25 @@ typedef struct __name##_back_ring __name##_back_ring_t
 #define RING_GET_REQUEST(_r, _idx)                                      \
     (&((_r)->sring->ring[((_idx) & (RING_SIZE(_r) - 1))].req))
 
+#define RING_GET_RESPONSE(_r, _idx)                                     \
+    (&((_r)->sring->ring[((_idx) & (RING_SIZE(_r) - 1))].rsp))
+
 /*
- * Get a local copy of a request.
+ * Get a local copy of a request/response.
  *
- * Use this in preference to RING_GET_REQUEST() so all processing is
+ * Use this in preference to RING_GET_{REQUEST,RESPONSE}() so all processing is
  * done on a local copy that cannot be modified by the other end.
  *
  * Note that https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145 may cause this
- * to be ineffective where _req is a struct which consists of only bitfields.
+ * to be ineffective where dest is a struct which consists of only bitfields.
  */
-#define RING_COPY_REQUEST(_r, _idx, _req) do {				\
-	/* Use volatile to force the copy into _req. */			\
-	*(_req) = *(volatile __typeof__(_req))RING_GET_REQUEST(_r, _idx);	\
+#define RING_COPY_(type, r, idx, dest) do {				\
+	/* Use volatile to force the copy into dest. */			\
+	*(dest) = *(volatile __typeof__(dest))RING_GET_##type(r, idx);	\
 } while (0)
 
-#define RING_GET_RESPONSE(_r, _idx)                                     \
-    (&((_r)->sring->ring[((_idx) & (RING_SIZE(_r) - 1))].rsp))
+#define RING_COPY_REQUEST(r, idx, req)  RING_COPY_(REQUEST, r, idx, req)
+#define RING_COPY_RESPONSE(r, idx, rsp) RING_COPY_(RESPONSE, r, idx, rsp)
 
 /* Loop termination condition: Would the specified index overflow the ring? */
 #define RING_REQUEST_CONS_OVERFLOW(_r, _cons)                           \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Mar 31 23:33:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 31 Mar 2021 23:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.104079.198646 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lRkL8-0000vn-8k; Wed, 31 Mar 2021 23:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 104079.198646; Wed, 31 Mar 2021 23:33: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 1lRkL8-0000vf-5r; Wed, 31 Mar 2021 23:33:34 +0000
Received: by outflank-mailman (input) for mailman id 104079;
 Wed, 31 Mar 2021 23:33: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 1lRkL6-0000vW-Rl
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:33: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 1lRkL6-0005VJ-Qu
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lRkL6-0003dJ-OY
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:33:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sj8iKxqsrL6ANNDsFUrprYGtRFr6vUGEBnD5qc7R7CI=; b=bXQps8TKEcOQu1OTQ7FlcKU9gt
	EA9ut1LmUV8/r3cmFOKZC3krjlN1bqeL/ixxmcRQM6Daibw2DxoWDsxxhZFDGcpmokDGUnQRD9+dG
	BEzECwkf+LFbecHEeVdZBcHJTNiYbyemet0zICtWsyGE/v2wwVRhMV+oquSxR7F9MbGQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] hvm/mtrr: remove unnecessary is_hvm_domain check
Message-Id: <E1lRkL6-0003dJ-OY@xenbits.xenproject.org>
Date: Wed, 31 Mar 2021 23:33:32 +0000

commit 14612851867e61cf5b46f13aca5a2ce2c329efb6
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Mar 30 14:37:53 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 30 14:37:53 2021 +0200

    hvm/mtrr: remove unnecessary is_hvm_domain check
    
    epte_get_entry_emt will only be called for HVM domains, so the
    is_hvm_domain check is unnecessary. It's a remnant of PVHv1.
    
    Shouldn't result in any functional change.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/mtrr.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c
index fb051d59c3..82ded1635c 100644
--- a/xen/arch/x86/hvm/mtrr.c
+++ b/xen/arch/x86/hvm/mtrr.c
@@ -851,10 +851,8 @@ int epte_get_entry_emt(struct domain *d, unsigned long gfn, mfn_t mfn,
     if ( gmtrr_mtype == -EADDRNOTAVAIL )
         return -1;
 
-    gmtrr_mtype = is_hvm_domain(d) && v ?
-                  get_mtrr_type(&v->arch.hvm.mtrr,
-                                gfn << PAGE_SHIFT, order) :
-                  MTRR_TYPE_WRBACK;
+    gmtrr_mtype = v ? get_mtrr_type(&v->arch.hvm.mtrr, gfn << PAGE_SHIFT, order)
+                    : MTRR_TYPE_WRBACK;
     hmtrr_mtype = get_mtrr_type(&mtrr_state, mfn_x(mfn) << PAGE_SHIFT, order);
     if ( gmtrr_mtype < 0 || hmtrr_mtype < 0 )
         return -1;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Mar 31 23:33:44 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 31 Mar 2021 23:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.104080.198651 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lRkLI-0000wv-AG; Wed, 31 Mar 2021 23:33:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 104080.198651; Wed, 31 Mar 2021 23:33: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 1lRkLI-0000wn-7I; Wed, 31 Mar 2021 23:33:44 +0000
Received: by outflank-mailman (input) for mailman id 104080;
 Wed, 31 Mar 2021 23:33: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 1lRkLG-0000we-VY
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:33: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 1lRkLG-0005VV-Uf
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lRkLG-0003e3-T9
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:33:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JxWsOwvlKPfV/F9kedk+3U4y2epmW1DG1YraUcAKqFg=; b=O83jRn68yiZnSiHu6++Hi6FdDI
	kKTSMtMUusgA0Nv624x+FHGlP5iXlyrWRFBxYgsNdhqCYYjG2f/QbyvLKXb1jqHtuBCs6rTx2TUnX
	Lm1uDFrAwXhAlZkX0vfkeEatnu4CJGVuMDch8vZxGb35F6CNLfFct80jiLo6s50Fa+Dc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: fix build when NR_CPUS == 1
Message-Id: <E1lRkLG-0003e3-T9@xenbits.xenproject.org>
Date: Wed, 31 Mar 2021 23:33:42 +0000

commit 9e0199726be09761c00791576f902d446b87fe1f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 30 14:38:45 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 30 14:38:45 2021 +0200

    x86: fix build when NR_CPUS == 1
    
    In this case the compiler is recognizing that no valid array indexes
    remain (in x2apic_cluster()'s access to per_cpu(cpu_2_logical_apicid,
    ...)), but oddly enough isn't really consistent about the checking it
    does (see the code comment).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/genapic/x2apic.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c
index 077a576a7f..628b441da5 100644
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -54,7 +54,17 @@ static void init_apic_ldr_x2apic_cluster(void)
     per_cpu(cluster_cpus, this_cpu) = cluster_cpus_spare;
     for_each_online_cpu ( cpu )
     {
-        if (this_cpu == cpu || x2apic_cluster(this_cpu) != x2apic_cluster(cpu))
+        if ( this_cpu == cpu )
+            continue;
+        /*
+         * Guard in particular against the compiler suspecting out-of-bounds
+         * array accesses below when NR_CPUS=1 (oddly enough with gcc 10 it
+         * is the 1st of these alone which actually helps, not the 2nd, nor
+         * are both required together there).
+         */
+        BUG_ON(this_cpu >= NR_CPUS);
+        BUG_ON(cpu >= NR_CPUS);
+        if ( x2apic_cluster(this_cpu) != x2apic_cluster(cpu) )
             continue;
         per_cpu(cluster_cpus, this_cpu) = per_cpu(cluster_cpus, cpu);
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Mar 31 23:33:54 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 31 Mar 2021 23:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.104081.198655 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lRkLS-0000y0-CO; Wed, 31 Mar 2021 23:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 104081.198655; Wed, 31 Mar 2021 23:33: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 1lRkLS-0000xs-8v; Wed, 31 Mar 2021 23:33:54 +0000
Received: by outflank-mailman (input) for mailman id 104081;
 Wed, 31 Mar 2021 23:33: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 1lRkLR-0000xj-2g
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:33: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 1lRkLR-0005Vf-1b
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:33:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lRkLR-0003ep-0k
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:33:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6ZAteZwwHOtYPepahxzEh6RCC1bVAQEESoEKgq4nkm4=; b=Qgx22oJHKHIotSA2DhwbnQYOgh
	mHlgETM1t5bOFetXn9RRJ4cNej+thcUUXjElHzS+8LhYKN6gsVKvaOqE47vq2INhrVP9zrxUJPVcI
	WKXXZPnw7iLbXICrcITpWzaow9Sb4O9zI/ITpNcGAbHV/FpdWjkFJVJ+yU6GwtZ/DUnU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] VT-d: leave FECTL write to vtd_resume()
Message-Id: <E1lRkLR-0003ep-0k@xenbits.xenproject.org>
Date: Wed, 31 Mar 2021 23:33:53 +0000

commit 0d597e7bd1bd8a57619690d457f79769777a5834
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 30 14:39:23 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 30 14:39:23 2021 +0200

    VT-d: leave FECTL write to vtd_resume()
    
    We shouldn't blindly unmask the interrupt when resuming. vtd_resume()
    will restore the intended state.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 44e407d19f..058f55f9a0 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2092,7 +2092,7 @@ static int adjust_vtd_irq_affinities(void)
 }
 __initcall(adjust_vtd_irq_affinities);
 
-static int __must_check init_vtd_hw(void)
+static int __must_check init_vtd_hw(bool resume)
 {
     struct acpi_drhd_unit *drhd;
     struct vtd_iommu *iommu;
@@ -2121,6 +2121,10 @@ static int __must_check init_vtd_hw(void)
             disable_qinval(iommu);
         }
 
+        if ( resume )
+            /* FECTL write done by vtd_resume(). */
+            continue;
+
         spin_lock_irqsave(&iommu->register_lock, flags);
         sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
         sts &= ~DMA_FECTL_IM;
@@ -2320,7 +2324,7 @@ static int __init vtd_setup(void)
     P(iommu_hap_pt_share, "Shared EPT tables");
 #undef P
 
-    ret = init_vtd_hw();
+    ret = init_vtd_hw(false);
     if ( ret )
         goto error;
 
@@ -2590,7 +2594,7 @@ static void vtd_resume(void)
     if ( !iommu_enabled )
         return;
 
-    if ( init_vtd_hw() != 0  && force_iommu )
+    if ( init_vtd_hw(true) != 0 && force_iommu )
          panic("IOMMU setup failed, crash Xen for security purpose\n");
 
     for_each_drhd_unit ( drhd )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Mar 31 23:34:04 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 31 Mar 2021 23:34:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.104082.198659 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lRkLc-0000zf-FG; Wed, 31 Mar 2021 23:34:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 104082.198659; Wed, 31 Mar 2021 23:34: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 1lRkLc-0000zX-CA; Wed, 31 Mar 2021 23:34:04 +0000
Received: by outflank-mailman (input) for mailman id 104082;
 Wed, 31 Mar 2021 23:34: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 1lRkLb-0000zP-5s
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:34: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 1lRkLb-0005W4-57
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:34:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lRkLb-0003fo-46
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:34: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=0Zz9opnTcr8ELO/D2CF1jCBlh2LR89Ho1r4zvUjxiH4=; b=PLlZDEKjooQlWGkEXlETpAUAYY
	/yr4UPjVRremgzRHGMzNqZnxw3ahGTYj3lBTmumf9/GUDRmt83QrfzaUHvjQN+1e02ENROabD766C
	Cy54squ22V3bhr1OFjVJ7PlNa/Rq6VTUlU0bvb+larF/9EPJv6QV19EEdJlhQxTEZMuY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] VT-d: re-order register restoring in vtd_resume()
Message-Id: <E1lRkLb-0003fo-46@xenbits.xenproject.org>
Date: Wed, 31 Mar 2021 23:34:03 +0000

commit 95e07f8c0e64889ee56015c7f99bdf5309e9e8ef
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 30 14:39:54 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 30 14:39:54 2021 +0200

    VT-d: re-order register restoring in vtd_resume()
    
    For one FECTL must be written last - the interrupt shouldn't be unmasked
    without first having written the data and address needed to actually
    deliver it. In the common case (when dma_msi_set_affinity() doesn't end
    up bailing early) this happens from init_vtd_hw(), but for this to
    actually have the intended effect we shouldn't subsequently overwrite
    what was written there - this is only benign when old and new settings
    match. Instead we should restore the registers ahead of calling
    init_vtd_hw(), just for the unlikely case of dma_msi_set_affinity()
    bailing early.
    
    In the moved code drop some stray casts as well.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 058f55f9a0..114f9512e9 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2594,6 +2594,21 @@ static void vtd_resume(void)
     if ( !iommu_enabled )
         return;
 
+    for_each_drhd_unit ( drhd )
+    {
+        iommu = drhd->iommu;
+        i = iommu->index;
+
+        spin_lock_irqsave(&iommu->register_lock, flags);
+        dmar_writel(iommu->reg, DMAR_FEDATA_REG,
+                    iommu_state[i][DMAR_FEDATA_REG]);
+        dmar_writel(iommu->reg, DMAR_FEADDR_REG,
+                    iommu_state[i][DMAR_FEADDR_REG]);
+        dmar_writel(iommu->reg, DMAR_FEUADDR_REG,
+                    iommu_state[i][DMAR_FEUADDR_REG]);
+        spin_unlock_irqrestore(&iommu->register_lock, flags);
+    }
+
     if ( init_vtd_hw(true) != 0 && force_iommu )
          panic("IOMMU setup failed, crash Xen for security purpose\n");
 
@@ -2605,12 +2620,6 @@ static void vtd_resume(void)
         spin_lock_irqsave(&iommu->register_lock, flags);
         dmar_writel(iommu->reg, DMAR_FECTL_REG,
                     (u32) iommu_state[i][DMAR_FECTL_REG]);
-        dmar_writel(iommu->reg, DMAR_FEDATA_REG,
-                    (u32) iommu_state[i][DMAR_FEDATA_REG]);
-        dmar_writel(iommu->reg, DMAR_FEADDR_REG,
-                    (u32) iommu_state[i][DMAR_FEADDR_REG]);
-        dmar_writel(iommu->reg, DMAR_FEUADDR_REG,
-                    (u32) iommu_state[i][DMAR_FEUADDR_REG]);
         spin_unlock_irqrestore(&iommu->register_lock, flags);
 
         iommu_enable_translation(drhd);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Mar 31 23:34:14 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 31 Mar 2021 23:34:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.104083.198663 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lRkLm-00011D-Gg; Wed, 31 Mar 2021 23:34:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 104083.198663; Wed, 31 Mar 2021 23:34: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 1lRkLm-000115-Df; Wed, 31 Mar 2021 23:34:14 +0000
Received: by outflank-mailman (input) for mailman id 104083;
 Wed, 31 Mar 2021 23:34: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 1lRkLl-00010t-9J
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:34: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 1lRkLl-0005WV-8Z
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:34:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lRkLl-0003h2-7i
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:34: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=2A0J6ZkfPgPKrSZ7sluIPBhgqVcm03K/iKaJKrD2RVw=; b=B/jdQciNSujOIYL7++9FTkTesZ
	UcJAlibZTIYtpSia1rpTtDafjSza+gt5V7Sug0UlvCr9tK82RJEn+W2ZEcxCVjukrLtkS0tlHB843
	EBmc0UHQz+Oq9Rb5BoxmfGUscLHC5v/DWvBnX2JbMaXKoIDTxApP46RWOy9xmX/prvIc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] VT-d: restore flush hooks when disabling qinval
Message-Id: <E1lRkLl-0003h2-7i@xenbits.xenproject.org>
Date: Wed, 31 Mar 2021 23:34:13 +0000

commit 9c39dba2b179c0f4c42c98e97ea0878119718530
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 30 14:40:24 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 30 14:40:24 2021 +0200

    VT-d: restore flush hooks when disabling qinval
    
    Leaving the hooks untouched is at best a latent risk: There may well be
    cases where some flush is needed, which then needs carrying out the
    "register" way.
    
    Switch from u<N> to uint<N>_t while needing to touch the function
    headers anyway.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/extern.h | 10 ++++++++++
 xen/drivers/passthrough/vtd/iommu.c  | 19 ++++++++-----------
 xen/drivers/passthrough/vtd/qinval.c |  3 +++
 3 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index 19a908ab4f..156177bb3f 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -49,6 +49,16 @@ int iommu_flush_iec_global(struct vtd_iommu *iommu);
 int iommu_flush_iec_index(struct vtd_iommu *iommu, u8 im, u16 iidx);
 void clear_fault_bits(struct vtd_iommu *iommu);
 
+int __must_check vtd_flush_context_reg(struct vtd_iommu *iommu, uint16_t did,
+                                       uint16_t source_id,
+                                       uint8_t function_mask, uint64_t type,
+                                       bool flush_non_present_entry);
+int __must_check vtd_flush_iotlb_reg(struct vtd_iommu *iommu, uint16_t did,
+                                     uint64_t addr, unsigned int size_order,
+                                     uint64_t type,
+                                     bool flush_non_present_entry,
+                                     bool flush_dev_iotlb);
+
 struct vtd_iommu *ioapic_to_iommu(unsigned int apic_id);
 struct vtd_iommu *hpet_to_iommu(unsigned int hpet_id);
 struct acpi_drhd_unit *ioapic_to_drhd(unsigned int apic_id);
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 114f9512e9..6428c8fe3e 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -380,10 +380,9 @@ static void iommu_flush_write_buffer(struct vtd_iommu *iommu)
 }
 
 /* return value determine if we need a write buffer flush */
-static int __must_check flush_context_reg(struct vtd_iommu *iommu, u16 did,
-                                          u16 source_id, u8 function_mask,
-                                          u64 type,
-                                          bool flush_non_present_entry)
+int vtd_flush_context_reg(struct vtd_iommu *iommu, uint16_t did,
+                          uint16_t source_id, uint8_t function_mask,
+                          uint64_t type, bool flush_non_present_entry)
 {
     u64 val = 0;
     unsigned long flags;
@@ -449,11 +448,9 @@ static int __must_check iommu_flush_context_device(struct vtd_iommu *iommu,
 }
 
 /* return value determine if we need a write buffer flush */
-static int __must_check flush_iotlb_reg(struct vtd_iommu *iommu, u16 did,
-                                        u64 addr,
-                                        unsigned int size_order, u64 type,
-                                        bool flush_non_present_entry,
-                                        bool flush_dev_iotlb)
+int vtd_flush_iotlb_reg(struct vtd_iommu *iommu, uint16_t did, uint64_t addr,
+                        unsigned int size_order, uint64_t type,
+                        bool flush_non_present_entry, bool flush_dev_iotlb)
 {
     int tlb_offset = ecap_iotlb_offset(iommu->ecap);
     u64 val = 0;
@@ -2144,8 +2141,8 @@ static int __must_check init_vtd_hw(bool resume)
          */
         if ( enable_qinval(iommu) != 0 )
         {
-            iommu->flush.context = flush_context_reg;
-            iommu->flush.iotlb   = flush_iotlb_reg;
+            iommu->flush.context = vtd_flush_context_reg;
+            iommu->flush.iotlb   = vtd_flush_iotlb_reg;
         }
     }
 
diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index 39b7abd009..764ef9f0fc 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -462,4 +462,7 @@ void disable_qinval(struct vtd_iommu *iommu)
                   !(sts & DMA_GSTS_QIES), sts);
 out:
     spin_unlock_irqrestore(&iommu->register_lock, flags);
+
+    iommu->flush.context = vtd_flush_context_reg;
+    iommu->flush.iotlb   = vtd_flush_iotlb_reg;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Mar 31 23:34:24 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 31 Mar 2021 23:34:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.104084.198668 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lRkLw-00012i-IT; Wed, 31 Mar 2021 23:34:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 104084.198668; Wed, 31 Mar 2021 23:34: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 1lRkLw-00012X-F5; Wed, 31 Mar 2021 23:34:24 +0000
Received: by outflank-mailman (input) for mailman id 104084;
 Wed, 31 Mar 2021 23:34: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 1lRkLv-00012M-Cd
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:34: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 1lRkLv-0005Wf-Bl
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:34:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lRkLv-0003hz-Ax
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:34: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=XNQUzFYNlO9m9rsTJSTkWPwOX+IeOQ3r0hQetHMpOsQ=; b=cR8KjWHWjYQ2F2FKO5C5jABF81
	DhspDnz81YrdDBXAEM1dsDZwBsYQ0DxrW9eJ3BtI051gdv3Iq30awMKJkUl088Mc964AFbtZ19+I/
	WPx8TGf+mWEyu72iVIRkcCFMsG/ndkJOXIQ5lZiyUjVXqbUWFEWqtr4i9AsgipxiYx1I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Revert "x86/shadow: replace stale literal numbers in hash_{vcpu,domain}_foreach()"
Message-Id: <E1lRkLv-0003hz-Ax@xenbits.xenproject.org>
Date: Wed, 31 Mar 2021 23:34:23 +0000

commit d26a4691ea3a5eea7df9c8b49e09aad7f067cdfc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 30 15:31:25 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 30 15:31:25 2021 +0200

    Revert "x86/shadow: replace stale literal numbers in hash_{vcpu,domain}_foreach()"
    
    This reverts commit c201d303e801a949b10f9e0f36cdc1938ddd399e - a
    stale version (not working with clang) ended up getting committed.
---
 xen/arch/x86/mm/shadow/common.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 31a5ccf4ca..4a8882430b 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1623,9 +1623,6 @@ 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);
 
-#define HASH_CALLBACKS_CHECK(mask) \
-    BUILD_BUG_ON((mask) > (1U << ARRAY_SIZE(callbacks)) - 1)
-
 static void hash_vcpu_foreach(struct vcpu *v, unsigned int callback_mask,
                               const hash_vcpu_callback_t callbacks[],
                               mfn_t callback_mfn)
@@ -1661,7 +1658,7 @@ static void hash_vcpu_foreach(struct vcpu *v, unsigned int callback_mask,
         {
             if ( callback_mask & (1 << x->u.sh.type) )
             {
-                ASSERT(x->u.sh.type < SH_type_unused);
+                ASSERT(x->u.sh.type <= 15);
                 ASSERT(callbacks[x->u.sh.type] != NULL);
                 done = callbacks[x->u.sh.type](v, page_to_mfn(x),
                                                callback_mfn);
@@ -1708,7 +1705,7 @@ static void hash_domain_foreach(struct domain *d,
         {
             if ( callback_mask & (1 << x->u.sh.type) )
             {
-                ASSERT(x->u.sh.type < SH_type_unused);
+                ASSERT(x->u.sh.type <= 15);
                 ASSERT(callbacks[x->u.sh.type] != NULL);
                 done = callbacks[x->u.sh.type](d, page_to_mfn(x),
                                                callback_mfn);
@@ -2012,7 +2009,6 @@ 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);
 
     /* If that didn't catch the mapping, then there's some non-pagetable
@@ -2084,7 +2080,6 @@ 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);
 
     /* If that didn't catch the mapping, something is very wrong */
@@ -2251,12 +2246,10 @@ void sh_remove_shadows(struct domain *d, mfn_t gmfn, int fast, int all)
     /* Search for this shadow in all appropriate shadows */
     perfc_incr(shadow_unshadow);
 
-    /*
-     * Lower-level shadows need to be excised from upper-level shadows. This
-     * call to hash_domain_foreach() looks dangerous but is in fact OK: each
+    /* Lower-level shadows need to be excised from upper-level shadows.
+     * This call to hash_vcpu_foreach() looks dangerous but is in fact OK: each
      * call will remove at most one shadow, and terminate immediately when
-     * it does remove it, so we never walk the hash after doing a deletion.
-     */
+     * it does remove it, so we never walk the hash after doing a deletion.  */
 #define DO_UNSHADOW(_type) do {                                         \
     t = (_type);                                                        \
     if( !(pg->count_info & PGC_page_table)                              \
@@ -2277,7 +2270,6 @@ void sh_remove_shadows(struct domain *d, mfn_t gmfn, int fast, int all)
     if( !fast                                                           \
         && (pg->count_info & PGC_page_table)                            \
         && (pg->shadow_flags & (1 << t)) )                              \
-        HASH_CALLBACKS_CHECK(SHF_page_type_mask);                       \
         hash_domain_foreach(d, masks[t], callbacks, smfn);              \
 } while (0)
 
@@ -2378,7 +2370,6 @@ void sh_reset_l3_up_pointers(struct vcpu *v)
     };
     static const unsigned int callback_mask = SHF_L3_64;
 
-    HASH_CALLBACKS_CHECK(callback_mask);
     hash_vcpu_foreach(v, callback_mask, callbacks, INVALID_MFN);
 }
 
@@ -3429,7 +3420,6 @@ void shadow_audit_tables(struct vcpu *v)
         }
     }
 
-    HASH_CALLBACKS_CHECK(SHF_page_type_mask);
     hash_vcpu_foreach(v, mask, callbacks, INVALID_MFN);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Mar 31 23:34:34 2021
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 31 Mar 2021 23:34:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.104085.198670 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1lRkM6-00015S-Je; Wed, 31 Mar 2021 23:34:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 104085.198670; Wed, 31 Mar 2021 23:34: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 1lRkM6-00015K-GV; Wed, 31 Mar 2021 23:34:34 +0000
Received: by outflank-mailman (input) for mailman id 104085;
 Wed, 31 Mar 2021 23:34: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 1lRkM5-00015D-If
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:34: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 1lRkM5-0005Wn-Hp
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1lRkM5-0003j3-EM
 for xen-changelog@lists.xenproject.org; Wed, 31 Mar 2021 23:34: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=ZuLVePuhypzWOcg0FoI6ZHK2l09dRF/Xse5VN83lSmY=; b=pXnFHAwCtJOVNxnMQVmu9F8+j3
	o5tVrvKpMl0MJC4UI/Of0YbGiQxE4N69AcfyMN+Nnt1ZX7XQd5qQE+/5bGw6kv1lxKz8SYnq+UGWH
	lKNaNkuMUkrzWgnwtMfQvCOXaViYzZWHbbNNPNeoLBoeDP8uohSYrsxVb4eVqt8bs16I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: replace stale literal numbers in hash_{vcpu,domain}_foreach()
Message-Id: <E1lRkM5-0003j3-EM@xenbits.xenproject.org>
Date: Wed, 31 Mar 2021 23:34:33 +0000

commit 90629587e16e2efdb61da77f25c25fba3c4a5fd7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Mar 30 15:32:59 2021 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Mar 30 15:32:59 2021 +0200

    x86/shadow: replace stale literal numbers in hash_{vcpu,domain}_foreach()
    
    15 apparently once used to be the last valid type to request a callback
    for, and the dimension of the respective array. The arrays meanwhile are
    larger than this (in a benign way, i.e. no caller ever sets a mask bit
    higher than 15), dimensioned by SH_type_unused. Have the ASSERT()s
    follow suit and add build time checks at the call sites.
    
    Sadly at least some Clang versions aren't as flexible with
    _Static_assert() as gcc is - they demand a truly integer constant
    expression, while gcc also permits constant variables.
    
    Also adjust a comment naming the wrong of the two functions.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 4a8882430b..c64de3b789 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1623,6 +1623,13 @@ 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[],
                               mfn_t callback_mfn)
@@ -1658,7 +1665,7 @@ static void hash_vcpu_foreach(struct vcpu *v, unsigned int callback_mask,
         {
             if ( callback_mask & (1 << x->u.sh.type) )
             {
-                ASSERT(x->u.sh.type <= 15);
+                ASSERT(x->u.sh.type < SH_type_unused);
                 ASSERT(callbacks[x->u.sh.type] != NULL);
                 done = callbacks[x->u.sh.type](v, page_to_mfn(x),
                                                callback_mfn);
@@ -1705,7 +1712,7 @@ static void hash_domain_foreach(struct domain *d,
         {
             if ( callback_mask & (1 << x->u.sh.type) )
             {
-                ASSERT(x->u.sh.type <= 15);
+                ASSERT(x->u.sh.type < SH_type_unused);
                 ASSERT(callbacks[x->u.sh.type] != NULL);
                 done = callbacks[x->u.sh.type](d, page_to_mfn(x),
                                                callback_mfn);
@@ -2009,6 +2016,7 @@ 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);
 
     /* If that didn't catch the mapping, then there's some non-pagetable
@@ -2080,6 +2088,7 @@ 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);
 
     /* If that didn't catch the mapping, something is very wrong */
@@ -2246,10 +2255,12 @@ void sh_remove_shadows(struct domain *d, mfn_t gmfn, int fast, int all)
     /* Search for this shadow in all appropriate shadows */
     perfc_incr(shadow_unshadow);
 
-    /* Lower-level shadows need to be excised from upper-level shadows.
-     * This call to hash_vcpu_foreach() looks dangerous but is in fact OK: each
+    /*
+     * Lower-level shadows need to be excised from upper-level shadows. This
+     * call to hash_domain_foreach() looks dangerous but is in fact OK: each
      * call will remove at most one shadow, and terminate immediately when
-     * it does remove it, so we never walk the hash after doing a deletion.  */
+     * it does remove it, so we never walk the hash after doing a deletion.
+     */
 #define DO_UNSHADOW(_type) do {                                         \
     t = (_type);                                                        \
     if( !(pg->count_info & PGC_page_table)                              \
@@ -2270,6 +2281,7 @@ void sh_remove_shadows(struct domain *d, mfn_t gmfn, int fast, int all)
     if( !fast                                                           \
         && (pg->count_info & PGC_page_table)                            \
         && (pg->shadow_flags & (1 << t)) )                              \
+        HASH_CALLBACKS_CHECK(SHF_page_type_mask);                       \
         hash_domain_foreach(d, masks[t], callbacks, smfn);              \
 } while (0)
 
@@ -2370,6 +2382,7 @@ void sh_reset_l3_up_pointers(struct vcpu *v)
     };
     static const unsigned int callback_mask = SHF_L3_64;
 
+    HASH_CALLBACKS_CHECK(callback_mask);
     hash_vcpu_foreach(v, callback_mask, callbacks, INVALID_MFN);
 }
 
@@ -3420,6 +3433,7 @@ void shadow_audit_tables(struct vcpu *v)
         }
     }
 
+    HASH_CALLBACKS_CHECK(SHF_page_type_mask);
     hash_vcpu_foreach(v, mask, callbacks, INVALID_MFN);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


