From xen-changelog-bounces@lists.xenproject.org Wed Nov 01 02:55:07 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Nov 2023 02:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626070.976004 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qy1Nm-0004Ms-Tm; Wed, 01 Nov 2023 02:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626070.976004; Wed, 01 Nov 2023 02:55: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 1qy1Nm-0004Mk-R9; Wed, 01 Nov 2023 02:55:02 +0000
Received: by outflank-mailman (input) for mailman id 626070;
 Wed, 01 Nov 2023 02:55: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 1qy1Nl-0004Me-Of
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 02:55: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 1qy1Nl-0002os-Nq
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 02:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qy1Nl-00064f-Mq
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 02:55:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tzSN9A2Sd8bMkIjt8zCvlWhGBhKI7eZf8GqIryQNtr0=; b=Soy1IzMJ/VNxt+pxAa6tgDflnJ
	Kcv0h636eBmBevulJxMys0ke5a7km4PVSanb9d8xgx+M5CALxKXFoyGjEESnRxeEudt4oLZVTNzbY
	7U8yPWdjVbh8bsH13++1gmH23nkDzOjhRUu4YGU0h77V+iP31qYQXvGJQIp/4CVV7y40=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Set version to 4.19; 4.18 has branched
Message-Id: <E1qy1Nl-00064f-Mq@xenbits.xenproject.org>
Date: Wed, 01 Nov 2023 02:55:01 +0000

commit 4294987c7a4b1171b4bb5342f126df0e43a7bd38
Author:     Julien Grall <julien@xen.org>
AuthorDate: Mon Oct 30 09:12:49 2023 +0000
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Oct 30 09:12:54 2023 +0000

    Set version to 4.19; 4.18 has branched
    
    Signed-off-by: Julien Grall <julien@xen.org>
---
 README       | 16 ++++++++--------
 xen/Makefile |  4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/README b/README
index 855db01d36..c8a108449e 100644
--- a/README
+++ b/README
@@ -1,11 +1,11 @@
-#################################################
-__  __            _  _    _  ___
-\ \/ /___ _ __   | || |  / |( _ )       _ __ ___
- \  // _ \ '_ \  | || |_ | |/ _ \ _____| '__/ __|
- /  \  __/ | | | |__   _|| | (_) |_____| | | (__
-/_/\_\___|_| |_|    |_|(_)_|\___/      |_|  \___|
-
-#################################################
+############################################################
+__  __                                _        _     _
+\ \/ /___ _ __        _   _ _ __  ___| |_ __ _| |__ | | ___
+ \  // _ \ '_ \ _____| | | | '_ \/ __| __/ _` | '_ \| |/ _ \
+ /  \  __/ | | |_____| |_| | | | \__ \ || (_| | |_) | |  __/
+/_/\_\___|_| |_|      \__,_|_| |_|___/\__\__,_|_.__/|_|\___|
+
+############################################################
 
 https://www.xen.org/
 
diff --git a/xen/Makefile b/xen/Makefile
index fd0e63d29e..b923235c53 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -5,8 +5,8 @@ this-makefile := $(call lastword,$(MAKEFILE_LIST))
 # 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    = 18
-export XEN_EXTRAVERSION ?= -rc$(XEN_VENDORVERSION)
+export XEN_SUBVERSION    = 19
+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 Wed Nov 01 02:55:12 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Nov 2023 02:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626071.976009 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qy1Nw-0004PD-VE; Wed, 01 Nov 2023 02:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626071.976009; Wed, 01 Nov 2023 02:55:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qy1Nw-0004P5-SZ; Wed, 01 Nov 2023 02:55:12 +0000
Received: by outflank-mailman (input) for mailman id 626071;
 Wed, 01 Nov 2023 02:55:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qy1Nv-0004Ot-Rq
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 02:55:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qy1Nv-0002p7-R0
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 02:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qy1Nv-00065G-Q1
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 02:55:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DzOfursPC4OAMgQyARCA9QhqehYxU+Am8kMrDB+uK1M=; b=bpARvfV1aJz1ICeYkjURWIspy1
	bWrgNL90yJ3aXrtquqN4vVJS2QNW4eXjYWM2pEjSqMhacPcCSBFYySkwrf8RMFadQTKiezecJ/hQf
	JL/z9ZZkikZ2Jlw42PJVnfVTM0mnSJSHUSdfsuNeWPw2U6bEiHvfuKDRoNVnAQRqzBbg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Revert "Config.mk pin QEMU_UPSTREAM_REVISION (prep for Xen 4.18 RC1)"
Message-Id: <E1qy1Nv-00065G-Q1@xenbits.xenproject.org>
Date: Wed, 01 Nov 2023 02:55:11 +0000

commit 7f48e342988e1cc6c24153e8c2c248741f107f0a
Author:     Julien Grall <julien@xen.org>
AuthorDate: Mon Oct 30 09:13:38 2023 +0000
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Oct 30 09:13:38 2023 +0000

    Revert "Config.mk pin QEMU_UPSTREAM_REVISION (prep for Xen 4.18 RC1)"
    
    The branch is unstable again.
    
    This reverts commit 520d18e0ff7917ef86b6a69c7949f15e6a804f3d.
---
 Config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Config.mk b/Config.mk
index 000cf06d41..29c29f8d7f 100644
--- a/Config.mk
+++ b/Config.mk
@@ -223,7 +223,7 @@ OVMF_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/ovmf.git
 OVMF_UPSTREAM_REVISION ?= ba91d0292e593df8528b66f99c1b0b14fadc8e16
 
 QEMU_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/qemu-xen.git
-QEMU_UPSTREAM_REVISION ?= 0df9387c8983e1b1e72d8c574356f572342c03e6
+QEMU_UPSTREAM_REVISION ?= master
 
 MINIOS_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/mini-os.git
 MINIOS_UPSTREAM_REVISION ?= 5bcb28aaeba1c2506a82fab0cdad0201cd9b54b3
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 01 02:55:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Nov 2023 02:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626072.976013 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qy1O7-0004SI-0K; Wed, 01 Nov 2023 02:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626072.976013; Wed, 01 Nov 2023 02:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qy1O6-0004SA-U1; Wed, 01 Nov 2023 02:55:22 +0000
Received: by outflank-mailman (input) for mailman id 626072;
 Wed, 01 Nov 2023 02: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 1qy1O6-0004S0-0Q
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 02: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 1qy1O5-0002pZ-VC
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 02:55:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qy1O5-00067S-U4
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 02:55:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oGNuDffHnndNI+TGjGPw+Wn1KRZ6Xl5EQlLk3W3SOAw=; b=IE0bZKMh1W7ElZQrCYRc0+GC1r
	9X6PpY8SLwRWn3DEVv/TWqmJr+YVTSAnyZFuTYrtL3jQUU604bV4QLs/ZBIYeIx7sQT5HeUn2aREU
	TbrbM2wRvYvNkcnU0An0dyfGZMlLhMgoKgPDpNjWgxHfw2Q86Jf3wD6TuUnqZPEicd7U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Set version to 4.18; return ./autogen.sh
Message-Id: <E1qy1O5-00067S-U4@xenbits.xenproject.org>
Date: Wed, 01 Nov 2023 02:55:21 +0000

commit 9659b2a6d73b14620e187f9c626a09323853c459
Author:     Julien Grall <julien@xen.org>
AuthorDate: Mon Oct 30 09:23:06 2023 +0000
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Oct 30 09:23:06 2023 +0000

    Set version to 4.18; return ./autogen.sh
    
    Signed-off-by: Julien Grall <julien@xen.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 dd05f314f6..df7fec483d 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.18.
+# Generated by GNU Autoconf 2.69 for Xen Hypervisor 4.19.
 #
 # 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.18'
-PACKAGE_STRING='Xen Hypervisor 4.18'
+PACKAGE_VERSION='4.19'
+PACKAGE_STRING='Xen Hypervisor 4.19'
 PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='https://www.xen.org/'
 
@@ -1233,7 +1233,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.18 to adapt to many kinds of systems.
+\`configure' configures Xen Hypervisor 4.19 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1299,7 +1299,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Xen Hypervisor 4.18:";;
+     short | recursive ) echo "Configuration of Xen Hypervisor 4.19:";;
    esac
   cat <<\_ACEOF
 
@@ -1398,7 +1398,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Xen Hypervisor configure 4.18
+Xen Hypervisor configure 4.19
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1415,7 +1415,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.18, which was
+It was created by Xen Hypervisor $as_me 4.19, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2887,7 +2887,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.18, which was
+This file was extended by Xen Hypervisor $as_me 4.19, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -2941,7 +2941,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.18
+Xen Hypervisor config.status 4.19
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/docs/configure b/docs/configure
index b5cb2bf169..b55e67e93a 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.18.
+# Generated by GNU Autoconf 2.69 for Xen Hypervisor Documentation 4.19.
 #
 # 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.18'
-PACKAGE_STRING='Xen Hypervisor Documentation 4.18'
+PACKAGE_VERSION='4.19'
+PACKAGE_STRING='Xen Hypervisor Documentation 4.19'
 PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='https://www.xen.org/'
 
@@ -1223,7 +1223,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.18 to adapt to many kinds of systems.
+\`configure' configures Xen Hypervisor Documentation 4.19 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1285,7 +1285,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Xen Hypervisor Documentation 4.18:";;
+     short | recursive ) echo "Configuration of Xen Hypervisor Documentation 4.19:";;
    esac
   cat <<\_ACEOF
 
@@ -1386,7 +1386,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Xen Hypervisor Documentation configure 4.18
+Xen Hypervisor Documentation configure 4.19
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1403,7 +1403,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.18, which was
+It was created by Xen Hypervisor Documentation $as_me 4.19, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2867,7 +2867,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.18, which was
+This file was extended by Xen Hypervisor Documentation $as_me 4.19, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -2921,7 +2921,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.18
+Xen Hypervisor Documentation config.status 4.19
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/stubdom/configure b/stubdom/configure
index 540e9cd331..9a2226c3b7 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.18.
+# Generated by GNU Autoconf 2.69 for Xen Hypervisor Stub Domains 4.19.
 #
 # 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.18'
-PACKAGE_STRING='Xen Hypervisor Stub Domains 4.18'
+PACKAGE_VERSION='4.19'
+PACKAGE_STRING='Xen Hypervisor Stub Domains 4.19'
 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.18 to adapt to many kinds of systems.
+\`configure' configures Xen Hypervisor Stub Domains 4.19 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.18:";;
+     short | recursive ) echo "Configuration of Xen Hypervisor Stub Domains 4.19:";;
    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.18
+Xen Hypervisor Stub Domains configure 4.19
 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.18, which was
+It was created by Xen Hypervisor Stub Domains $as_me 4.19, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -4268,7 +4268,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.18, which was
+This file was extended by Xen Hypervisor Stub Domains $as_me 4.19, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -4322,7 +4322,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.18
+Xen Hypervisor Stub Domains config.status 4.19
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/tools/configure b/tools/configure
index 38c0808d3a..0135a0059a 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.18.
+# Generated by GNU Autoconf 2.69 for Xen Hypervisor Tools 4.19.
 #
 # 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.18'
-PACKAGE_STRING='Xen Hypervisor Tools 4.18'
+PACKAGE_VERSION='4.19'
+PACKAGE_STRING='Xen Hypervisor Tools 4.19'
 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.18 to adapt to many kinds of systems.
+\`configure' configures Xen Hypervisor Tools 4.19 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.18:";;
+     short | recursive ) echo "Configuration of Xen Hypervisor Tools 4.19:";;
    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.18
+Xen Hypervisor Tools configure 4.19
 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.18, which was
+It was created by Xen Hypervisor Tools $as_me 4.19, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -10740,7 +10740,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.18, which was
+This file was extended by Xen Hypervisor Tools $as_me 4.19, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -10803,7 +10803,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.18
+Xen Hypervisor Tools config.status 4.19
 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 Wed Nov 01 06:00:19 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Nov 2023 06:00:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626076.976020 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qy4H0-0003m6-CV; Wed, 01 Nov 2023 06:00:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626076.976020; Wed, 01 Nov 2023 06:00:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qy4H0-0003ly-9m; Wed, 01 Nov 2023 06:00:14 +0000
Received: by outflank-mailman (input) for mailman id 626076;
 Wed, 01 Nov 2023 06:00:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qy4Gx-0003kq-La
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 06:00:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qy4Gx-0007U3-JX
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 06:00:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qy4Gx-0005Cw-IV
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 06:00:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=o9xb0EljeYuEQ7oksHIJl7KVb9pCIJfSKxvi7cOp3yA=; b=E0Hej8NK6naq9/mlkcMAZJn352
	W/Xx70VMp4evFd1Qdvb8I7eNOtkS/LCaUpl6404474yPC+DpbE4NN9tXv2vtcvJ36B/26Af6XhEYG
	umJN1wfBOeC9Zl037WYyOlTGQgGUUyAOP9qS1N6jd+gECqCViWxyM47f65Y7cnts0LwQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] docs: Fix IOMMU command line docs some more
Message-Id: <E1qy4Gx-0005Cw-IV@xenbits.xenproject.org>
Date: Wed, 01 Nov 2023 06:00:11 +0000

commit 0bcd5b347f3d00df09b3aec4e6b6fa2c732a00eb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 31 12:02:15 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 16:00:42 2023 +0000

    docs: Fix IOMMU command line docs some more
    
    Make the command line docs match the actual implementation, and state that the
    default behaviour is selected at compile time.
    
    Fixes: 980d6acf1517 ("IOMMU: make DMA containment of quarantined devices optional")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
    (cherry picked from commit 850382254b78e07e7ccbf80010c3b43897a158f9)
---
 docs/misc/xen-command-line.pandoc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 6b07d0f3a1..9a19a04157 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1480,7 +1480,8 @@ detection of systems known to misbehave upon accesses to that port.
 > Default: `new` unless directed-EOI is supported
 
 ### iommu
-    = List of [ <bool>, verbose, debug, force, required, quarantine[=scratch-page],
+    = List of [ <bool>, verbose, debug, force, required,
+                quarantine=<bool>|scratch-page,
                 sharept, superpages, intremap, intpost, crash-disable,
                 snoop, qinval, igfx, amd-iommu-perdev-intremap,
                 dom0-{passthrough,strict} ]
@@ -1519,7 +1520,8 @@ boolean (e.g. `iommu=no`) can override this and leave the IOMMUs disabled.
     successfully.
 
 *   The `quarantine` option can be used to control Xen's behavior when
-    de-assigning devices from guests.
+    de-assigning devices from guests.  The default behaviour is chosen at
+    compile time, and is one of `CONFIG_IOMMU_QUARANTINE_{NONE,BASIC,SCRATCH_PAGE}`.
 
     When a PCI device is assigned to an untrusted domain, it is possible
     for that domain to program the device to DMA to an arbitrary address.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Wed Nov 01 06:00:19 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Nov 2023 06:00:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626075.976016 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qy4Gz-0002yf-9P; Wed, 01 Nov 2023 06:00:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626075.976016; Wed, 01 Nov 2023 06:00: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 1qy4Go-0002y9-80; Wed, 01 Nov 2023 06:00:02 +0000
Received: by outflank-mailman (input) for mailman id 626075;
 Wed, 01 Nov 2023 06:00: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 1qy4Gn-0002pf-Oj
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 06:00: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 1qy4Gn-0007Tv-G9
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 06:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qy4Gn-0005BS-FA
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 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=5ga0GqrSTJxd/AQ8tlYSC/PgsV28TQcFpocKJazzx6c=; b=y232GGWb0WL8C5qf5Jm5PyDMQg
	p/P0aG6MbZh7mDdeToKoQL0YWxgWem9vPUWnpkwP9HmDqdOYhQHQM+r20ft2ZNZ5PkiRjVVklU8JC
	/MR+WtCmgfalp3YrAe+6Xgpe/SmQdQvPhFt3f3r69Taixu6kLow4f0AgZJRzaStSv+uM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] automation: fix race condition in adl-suspend test
Message-Id: <E1qy4Gn-0005BS-FA@xenbits.xenproject.org>
Date: Wed, 01 Nov 2023 06:00:01 +0000

commit 2926952b35d648eb1bca921662f0e64ab3fed29f
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Tue Oct 31 03:16:53 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 11:06:16 2023 +0000

    automation: fix race condition in adl-suspend test
    
    If system suspends too quickly, the message for the test controller to
    wake up the system may be not sent to the console before suspending.
    This will cause the test to timeout.
    
    Fix this by calling sync on the console and waiting a bit after printing
    the message. The test controller then resumes the system 30s after the
    message, so as long as the delay + suspending takes less time it is
    okay.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit df43b54590e10b6199e44741b453fcbae2b06d25)
---
 automation/scripts/qubes-x86-64.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index f5dae82358..51323b1ae0 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -54,11 +54,12 @@ until grep 'domU started' /var/log/xen/console/guest-domU.log; do
     sleep 1
 done
 echo \"${wait_and_wakeup}\"
+# let the above message flow to console, then suspend
+sync /dev/stdout
+sleep 5
 set -x
 echo deep > /sys/power/mem_sleep
 echo mem > /sys/power/state
-# now wait for resume
-sleep 5
 xl list
 xl dmesg | grep 'Finishing wakeup from ACPI S3 state' || exit 1
 # check if domU is still alive
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Wed Nov 01 06:00:22 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Nov 2023 06:00:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626077.976024 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qy4H8-0003o0-EA; Wed, 01 Nov 2023 06:00:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626077.976024; Wed, 01 Nov 2023 06:00:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qy4H8-0003nt-BL; Wed, 01 Nov 2023 06:00:22 +0000
Received: by outflank-mailman (input) for mailman id 626077;
 Wed, 01 Nov 2023 06:00:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qy4H7-0003nf-PK
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 06:00:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qy4H7-0007US-Nm
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 06:00:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qy4H7-0005Ew-Ld
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 06:00:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zez1EjeRFe7puZkyqW0My3tYwruG/j0cp1msGPGl2cQ=; b=HNURT9M99tGWPY4B/UWPsoWOJS
	LiKsghkrvIiwfKPfeNZjLmvCytiTiT8gaz3u4W9SJ1XWMGPg7QOtYoWz9s18GN2ahkP2dZvxv2Jul
	HPmWmo+Muhq878UOUSWfZip7vSr6R5hQGAFw2CreZZJd2OVQqAqACgzveapfFuYtxTPk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] CHANGELOG: Reformat
Message-Id: <E1qy4H7-0005Ew-Ld@xenbits.xenproject.org>
Date: Wed, 01 Nov 2023 06:00:21 +0000

commit f9d9dc1934bc2b3f5136956c718441804e54ed5a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 31 13:19:52 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 16:00:42 2023 +0000

    CHANGELOG: Reformat
    
    Collect all x86 and ARM changes together instead of having them scattered.
    Tweak grammar as necessary.
    
    No change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Henry Wang <Henry.Wang@arm.com>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
    (cherry picked from commit d9c11660781942d7af44287732e2f6783840635e)
---
 CHANGELOG.md | 35 +++++++++++++++++++----------------
 1 file changed, 19 insertions(+), 16 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3ca7969699..edc0d69898 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,24 +17,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
    Hotplug" for clarity
 
 ### Added
- - On x86, support for features new in Intel Sapphire Rapids CPUs:
-   - PKS (Protection Key Supervisor) available to HVM/PVH guests.
-   - VM-Notify used by Xen to mitigate certain micro-architectural pipeline
-     livelocks, instead of crashing the entire server.
-   - Bus-lock detection, used by Xen to mitigate (by rate-limiting) the system
-     wide impact of a guest misusing atomic instructions.
- - xl/libxl can customize SMBIOS strings for HVM guests.
- - Add support for AVX512-FP16 on x86.
- - On Arm, Xen supports guests running SVE/SVE2 instructions. (Tech Preview)
- - On Arm, add suport for Firmware Framework for Arm A-profile (FF-A) Mediator
-   (Tech Preview)
- - Add Intel Hardware P-States (HWP) cpufreq driver.
- - On Arm, experimental support for dynamic addition/removal of Xen device tree
-   nodes using a device tree overlay binary (.dtbo).
+ - On x86:
+   - xl/libxl can customize SMBIOS strings for HVM guests.
+   - Support for enforcing system-wide operation in Data Operand Independent
+     Timing Mode.
+   - Add Intel Hardware P-States (HWP) cpufreq driver.
+   - Support for features new in Intel Sapphire Rapids CPUs:
+     - PKS (Protection Key Supervisor) available to HVM/PVH guests.
+     - VM-Notify used by Xen to mitigate certain micro-architectural pipeline
+       livelocks, instead of crashing the entire server.
+     - Bus-lock detection, used by Xen to mitigate (by rate-limiting) the
+       system wide impact of a guest misusing atomic instructions.
+   - Support for features new in Intel Granite Rapids CPUs:
+     - AVX512-FP16.
+ - On Arm:
+   - Xen supports guests running SVE/SVE2 instructions. (Tech Preview)
+   - Add suport for Firmware Framework for Arm A-profile (FF-A) Mediator (Tech
+     Preview)
+   - Experimental support for dynamic addition/removal of Xen device tree
+     nodes using a device tree overlay binary (.dtbo).
  - Introduce two new hypercalls to map the vCPU runstate and time areas by
    physical rather than linear/virtual addresses.
- - On x86, support for enforcing system-wide operation in Data Operand
-   Independent Timing Mode.
  - The project has now officially adopted 6 directives and 65 rules of MISRA-C.
 
 ### Removed
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Wed Nov 01 06:00:32 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Nov 2023 06:00:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626078.976028 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qy4HI-0003qv-IF; Wed, 01 Nov 2023 06:00:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626078.976028; Wed, 01 Nov 2023 06:00:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qy4HI-0003qn-Fk; Wed, 01 Nov 2023 06:00:32 +0000
Received: by outflank-mailman (input) for mailman id 626078;
 Wed, 01 Nov 2023 06:00:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qy4HH-0003qd-Sa
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 06:00:31 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qy4HH-0007Ug-Qz
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 06:00:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qy4HH-0005FR-Q0
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 06:00:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/FtMv8zCrZYvTPGH4IsTEmSxlEBM9CRyFvS8wkpgMnI=; b=cwTcy6gAH5U1HL1L10CHQ6m5NV
	HJr+reP0nKW0p7I6WzcQNf88hRIZSRZjFeyPssJ6X2ta5k/iUUaRRMeI195iLinnsn2kOUBbTsiUd
	+mZqHHRja9DIWziHrbeR55zkgqNuXIUwBRq4teG/mE3mA4d/5cT4VZjclYEcFBwLH9DY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] CHANGELOG: More 4.18 content
Message-Id: <E1qy4HH-0005FR-Q0@xenbits.xenproject.org>
Date: Wed, 01 Nov 2023 06:00:31 +0000

commit 9ac2b6b7492566497b76c4066a28c8c5d59a64b8
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 31 13:19:53 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 16:00:42 2023 +0000

    CHANGELOG: More 4.18 content
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Henry Wang <Henry.Wang@arm.com>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
    (cherry picked from commit bf51f85f20114ca73b95056d5e808a4845f094ee)
---
 CHANGELOG.md | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index edc0d69898..a827054cf2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,10 +18,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 
 ### Added
  - On x86:
+   - On all Intel systems, MSR_ARCH_CAPS is now visible in guests, and
+     controllable from the VM's config file.  For CPUs from ~2019 onwards,
+     this allows guest kernels to see details about hardware fixes for
+     speculative mitigations.  (Backported as XSA-435 to older releases).
    - xl/libxl can customize SMBIOS strings for HVM guests.
    - Support for enforcing system-wide operation in Data Operand Independent
      Timing Mode.
    - Add Intel Hardware P-States (HWP) cpufreq driver.
+   - Support for features new in AMD Genoa CPUs:
+     - CPUID_USER_DIS (CPUID Faulting) used by Xen to control PV guest's view
+       of CPUID data.
    - Support for features new in Intel Sapphire Rapids CPUs:
      - PKS (Protection Key Supervisor) available to HVM/PVH guests.
      - VM-Notify used by Xen to mitigate certain micro-architectural pipeline
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Wed Nov 01 06:00:42 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Nov 2023 06:00:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626079.976033 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qy4HS-0003uK-Jg; Wed, 01 Nov 2023 06:00:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626079.976033; Wed, 01 Nov 2023 06:00:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qy4HS-0003uC-HA; Wed, 01 Nov 2023 06:00:42 +0000
Received: by outflank-mailman (input) for mailman id 626079;
 Wed, 01 Nov 2023 06:00:41 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qy4HR-0003u2-UU
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 06:00:41 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qy4HR-0007Uo-Tm
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 06:00:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qy4HR-0005Fs-Sy
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 06:00:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aw/yU5ydPF6pUcAgCvSowTEaIsJNw+eqEDTVBLDxQDY=; b=UULC2/C1PfzlZ2jP+mcpkXODop
	aRqP4KAtCv0UvNOrs1+kSAJ6s6/EhugSf8LQ/Tbd71xSWUzngGpa55rfm1ZcG9c5dNvGkYjR62aU9
	tzCHg+AFiT20eY2LsFM7jCR+QzEgCmBv77mUKxIxS65kRlCczAh50sDVGMqNTdVe9hlY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] CHANGELOG.md: Finalize the 4.18 release date
Message-Id: <E1qy4HR-0005Fs-Sy@xenbits.xenproject.org>
Date: Wed, 01 Nov 2023 06:00:41 +0000

commit dfd7b3fe0380a0313d1b573afb918ffcd92c4be5
Author:     Henry Wang <Henry.Wang@arm.com>
AuthorDate: Tue Oct 31 22:49:24 2023 +0800
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 16:00:42 2023 +0000

    CHANGELOG.md: Finalize the 4.18 release date
    
    Signed-off-by: Henry Wang <Henry.Wang@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit e4fdec09bb338d62bd339c3c5ce6284aabeb19ee)
---
 CHANGELOG.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index a827054cf2..7fb4d366c3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,7 +4,7 @@ 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/)
 
-## [4.18.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.18.0) - 2023-XX-XX
+## [4.18.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.18.0) - 2023-11-16
 
 ### Changed
  - Repurpose command line gnttab_max_{maptrack_,}frames options so they don't
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Wed Nov 01 17:55:09 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Nov 2023 17:55:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626586.976923 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qyFQm-0002Nq-F0; Wed, 01 Nov 2023 17:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626586.976923; Wed, 01 Nov 2023 17: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 1qyFQm-0002Nj-CL; Wed, 01 Nov 2023 17:55:04 +0000
Received: by outflank-mailman (input) for mailman id 626586;
 Wed, 01 Nov 2023 17: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 1qyFQk-0002Nb-ND
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17: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 1qyFQk-0008Qu-GY
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFQk-00006N-Dq
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17: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=su5yi7lwHFJSBmEjtQVUs3TIz9sE6QUX2NRmsQiXe68=; b=aRU+oQCbuY+h+ceBn1ytfiUt+m
	7PkFD3c8PWrOc9U8jX8r/ckzO+fge8HGBDpc+65TqLwMow4kPIUm1/9iWsYJfk0vcnq85r2BQDQlf
	XOXtvEDZi4k6sNyYKdcW7g7HC5KZHGVXnITItUSsnyYecjZBQQGM+Huo3ztYx9MsCRHU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: fix race condition in adl-suspend test
Message-Id: <E1qyFQk-00006N-Dq@xenbits.xenproject.org>
Date: Wed, 01 Nov 2023 17:55:02 +0000

commit df43b54590e10b6199e44741b453fcbae2b06d25
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Tue Oct 31 03:16:53 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 11:05:05 2023 +0000

    automation: fix race condition in adl-suspend test
    
    If system suspends too quickly, the message for the test controller to
    wake up the system may be not sent to the console before suspending.
    This will cause the test to timeout.
    
    Fix this by calling sync on the console and waiting a bit after printing
    the message. The test controller then resumes the system 30s after the
    message, so as long as the delay + suspending takes less time it is
    okay.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/scripts/qubes-x86-64.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index f5dae82358..51323b1ae0 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -54,11 +54,12 @@ until grep 'domU started' /var/log/xen/console/guest-domU.log; do
     sleep 1
 done
 echo \"${wait_and_wakeup}\"
+# let the above message flow to console, then suspend
+sync /dev/stdout
+sleep 5
 set -x
 echo deep > /sys/power/mem_sleep
 echo mem > /sys/power/state
-# now wait for resume
-sleep 5
 xl list
 xl dmesg | grep 'Finishing wakeup from ACPI S3 state' || exit 1
 # check if domU is still alive
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 01 17:55:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Nov 2023 17:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626587.976928 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qyFQw-0002TC-Gn; Wed, 01 Nov 2023 17:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626587.976928; Wed, 01 Nov 2023 17: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 1qyFQw-0002T4-Dy; Wed, 01 Nov 2023 17:55:14 +0000
Received: by outflank-mailman (input) for mailman id 626587;
 Wed, 01 Nov 2023 17: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 1qyFQu-0002Sp-Mo
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17: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 1qyFQu-0008R6-Ka
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFQu-00006q-Im
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17: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=EbwHpf2e8jmwHpQvpvRFtN41WgzVhqs1Up18X4UKuFs=; b=hNUbWyWS/rzuJreA7oaj9DtJx4
	H+PnW9KELMlgN2Mux5g7GblXAzCElWzQq5NqNh2UCyfU4LnKNGkMA1AuM8bMXVZn6rBUsSA4L85QI
	QzuqaxSmRXIFLzE9HpHFLNqcBM0U7QxKhrBUq60z49GuiJYV6plr57sVLje6/fK8mbLE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs: Fix IOMMU command line docs some more
Message-Id: <E1qyFQu-00006q-Im@xenbits.xenproject.org>
Date: Wed, 01 Nov 2023 17:55:12 +0000

commit 850382254b78e07e7ccbf80010c3b43897a158f9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 31 12:02:15 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 15:48:07 2023 +0000

    docs: Fix IOMMU command line docs some more
    
    Make the command line docs match the actual implementation, and state that the
    default behaviour is selected at compile time.
    
    Fixes: 980d6acf1517 ("IOMMU: make DMA containment of quarantined devices optional")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
---
 docs/misc/xen-command-line.pandoc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 6b07d0f3a1..9a19a04157 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1480,7 +1480,8 @@ detection of systems known to misbehave upon accesses to that port.
 > Default: `new` unless directed-EOI is supported
 
 ### iommu
-    = List of [ <bool>, verbose, debug, force, required, quarantine[=scratch-page],
+    = List of [ <bool>, verbose, debug, force, required,
+                quarantine=<bool>|scratch-page,
                 sharept, superpages, intremap, intpost, crash-disable,
                 snoop, qinval, igfx, amd-iommu-perdev-intremap,
                 dom0-{passthrough,strict} ]
@@ -1519,7 +1520,8 @@ boolean (e.g. `iommu=no`) can override this and leave the IOMMUs disabled.
     successfully.
 
 *   The `quarantine` option can be used to control Xen's behavior when
-    de-assigning devices from guests.
+    de-assigning devices from guests.  The default behaviour is chosen at
+    compile time, and is one of `CONFIG_IOMMU_QUARANTINE_{NONE,BASIC,SCRATCH_PAGE}`.
 
     When a PCI device is assigned to an untrusted domain, it is possible
     for that domain to program the device to DMA to an arbitrary address.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 01 17:55:24 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Nov 2023 17:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626588.976932 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qyFR6-0002W6-Ih; Wed, 01 Nov 2023 17:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626588.976932; Wed, 01 Nov 2023 17: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 1qyFR6-0002Vy-Fh; Wed, 01 Nov 2023 17:55:24 +0000
Received: by outflank-mailman (input) for mailman id 626588;
 Wed, 01 Nov 2023 17: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 1qyFR4-0002Vh-PH
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17: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 1qyFR4-0008RE-Ni
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFR4-00009H-Mm
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17: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=Hhp9e6w2wyano1Jc4JiOArKKcNtWD9UAuRHBDrFIYgg=; b=59z+F1J0eNkzRryDdlmYNBXFg+
	BPGl4j3b15PlyddOLFt1Psn/Tlxq0rystaV5SpMIqAA57sSpcvXDo96RKi6HJhTAgQDvysyUGxLWm
	bDKJyD8FilgUjoyU03JrSejcdmxS8Sl0Gb8R+3hyJ5CB18/I/Up2Zw4Fbb9qIQtV9oBU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CHANGELOG: Reformat
Message-Id: <E1qyFR4-00009H-Mm@xenbits.xenproject.org>
Date: Wed, 01 Nov 2023 17:55:22 +0000

commit d9c11660781942d7af44287732e2f6783840635e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 31 13:19:52 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 15:48:07 2023 +0000

    CHANGELOG: Reformat
    
    Collect all x86 and ARM changes together instead of having them scattered.
    Tweak grammar as necessary.
    
    No change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Henry Wang <Henry.Wang@arm.com>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
---
 CHANGELOG.md | 35 +++++++++++++++++++----------------
 1 file changed, 19 insertions(+), 16 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3ca7969699..edc0d69898 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,24 +17,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
    Hotplug" for clarity
 
 ### Added
- - On x86, support for features new in Intel Sapphire Rapids CPUs:
-   - PKS (Protection Key Supervisor) available to HVM/PVH guests.
-   - VM-Notify used by Xen to mitigate certain micro-architectural pipeline
-     livelocks, instead of crashing the entire server.
-   - Bus-lock detection, used by Xen to mitigate (by rate-limiting) the system
-     wide impact of a guest misusing atomic instructions.
- - xl/libxl can customize SMBIOS strings for HVM guests.
- - Add support for AVX512-FP16 on x86.
- - On Arm, Xen supports guests running SVE/SVE2 instructions. (Tech Preview)
- - On Arm, add suport for Firmware Framework for Arm A-profile (FF-A) Mediator
-   (Tech Preview)
- - Add Intel Hardware P-States (HWP) cpufreq driver.
- - On Arm, experimental support for dynamic addition/removal of Xen device tree
-   nodes using a device tree overlay binary (.dtbo).
+ - On x86:
+   - xl/libxl can customize SMBIOS strings for HVM guests.
+   - Support for enforcing system-wide operation in Data Operand Independent
+     Timing Mode.
+   - Add Intel Hardware P-States (HWP) cpufreq driver.
+   - Support for features new in Intel Sapphire Rapids CPUs:
+     - PKS (Protection Key Supervisor) available to HVM/PVH guests.
+     - VM-Notify used by Xen to mitigate certain micro-architectural pipeline
+       livelocks, instead of crashing the entire server.
+     - Bus-lock detection, used by Xen to mitigate (by rate-limiting) the
+       system wide impact of a guest misusing atomic instructions.
+   - Support for features new in Intel Granite Rapids CPUs:
+     - AVX512-FP16.
+ - On Arm:
+   - Xen supports guests running SVE/SVE2 instructions. (Tech Preview)
+   - Add suport for Firmware Framework for Arm A-profile (FF-A) Mediator (Tech
+     Preview)
+   - Experimental support for dynamic addition/removal of Xen device tree
+     nodes using a device tree overlay binary (.dtbo).
  - Introduce two new hypercalls to map the vCPU runstate and time areas by
    physical rather than linear/virtual addresses.
- - On x86, support for enforcing system-wide operation in Data Operand
-   Independent Timing Mode.
  - The project has now officially adopted 6 directives and 65 rules of MISRA-C.
 
 ### Removed
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 01 17:55:34 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Nov 2023 17:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626589.976937 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qyFRG-0002Yt-Ke; Wed, 01 Nov 2023 17:55:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626589.976937; Wed, 01 Nov 2023 17: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 1qyFRG-0002Yl-HQ; Wed, 01 Nov 2023 17:55:34 +0000
Received: by outflank-mailman (input) for mailman id 626589;
 Wed, 01 Nov 2023 17: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 1qyFRE-0002Yb-SL
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17: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 1qyFRE-0008Rb-Rb
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFRE-00009n-Ps
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17: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=9mueUeEn06MTNDXbl9MVjb1XTngoG2W8+aKH0Cb5NqA=; b=JV4aFqU7meDVvXgK5pWtLLZXZz
	LcyNMw1VGRrHtchIaGJzlgoSTD8vnC+JkjCiJQ3HnoJ1tduKQ4G4RHB7/WOKErdsSF7nUgoDN+78S
	f4LLZ1xFAejcwckFb2i9J7M5ZlRLHp6UHm/PEZKEy3qNT4/K4FYzK5dGVM473hAuDvTw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CHANGELOG: More 4.18 content
Message-Id: <E1qyFRE-00009n-Ps@xenbits.xenproject.org>
Date: Wed, 01 Nov 2023 17:55:32 +0000

commit bf51f85f20114ca73b95056d5e808a4845f094ee
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 31 13:19:53 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 15:48:07 2023 +0000

    CHANGELOG: More 4.18 content
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Henry Wang <Henry.Wang@arm.com>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
---
 CHANGELOG.md | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index edc0d69898..a827054cf2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,10 +18,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 
 ### Added
  - On x86:
+   - On all Intel systems, MSR_ARCH_CAPS is now visible in guests, and
+     controllable from the VM's config file.  For CPUs from ~2019 onwards,
+     this allows guest kernels to see details about hardware fixes for
+     speculative mitigations.  (Backported as XSA-435 to older releases).
    - xl/libxl can customize SMBIOS strings for HVM guests.
    - Support for enforcing system-wide operation in Data Operand Independent
      Timing Mode.
    - Add Intel Hardware P-States (HWP) cpufreq driver.
+   - Support for features new in AMD Genoa CPUs:
+     - CPUID_USER_DIS (CPUID Faulting) used by Xen to control PV guest's view
+       of CPUID data.
    - Support for features new in Intel Sapphire Rapids CPUs:
      - PKS (Protection Key Supervisor) available to HVM/PVH guests.
      - VM-Notify used by Xen to mitigate certain micro-architectural pipeline
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 01 17:55:44 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Nov 2023 17:55:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626590.976939 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qyFRQ-0002f0-LR; Wed, 01 Nov 2023 17:55:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626590.976939; Wed, 01 Nov 2023 17: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 1qyFRQ-0002es-Is; Wed, 01 Nov 2023 17:55:44 +0000
Received: by outflank-mailman (input) for mailman id 626590;
 Wed, 01 Nov 2023 17: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 1qyFRO-0002ee-VO
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17: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 1qyFRO-0008Rk-Ue
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFRO-0000AD-Th
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17: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=xuD/tMaTcIN2DlSDSWHphU4xHG1aIk2E0UQtihTiygw=; b=lsoNbN8JMQU2r6Y9fVq28yaWEu
	tUTx1gpayvcWdAUT0NEqs53V38WkjVwomsqR+cr7GMZ17X8ttZTKn4Ty0uHVLcO2+wtNjzr411aSO
	srgEfGJOGdlFQEps03cjYflcsgwhPVEqYiHdZIyvZrAuPGXdHznKiG5rATwyEpnAFHN0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CHANGELOG.md: Finalize the 4.18 release date
Message-Id: <E1qyFRO-0000AD-Th@xenbits.xenproject.org>
Date: Wed, 01 Nov 2023 17:55:42 +0000

commit e4fdec09bb338d62bd339c3c5ce6284aabeb19ee
Author:     Henry Wang <Henry.Wang@arm.com>
AuthorDate: Tue Oct 31 22:49:24 2023 +0800
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 15:48:07 2023 +0000

    CHANGELOG.md: Finalize the 4.18 release date
    
    Signed-off-by: Henry Wang <Henry.Wang@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 CHANGELOG.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index a827054cf2..7fb4d366c3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,7 +4,7 @@ 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/)
 
-## [4.18.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.18.0) - 2023-XX-XX
+## [4.18.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.18.0) - 2023-11-16
 
 ### Changed
  - Repurpose command line gnttab_max_{maptrack_,}frames options so they don't
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 01 17:55:54 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Nov 2023 17:55:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626591.976944 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qyFRa-0002lF-Ms; Wed, 01 Nov 2023 17:55:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626591.976944; Wed, 01 Nov 2023 17: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 1qyFRa-0002l7-KI; Wed, 01 Nov 2023 17:55:54 +0000
Received: by outflank-mailman (input) for mailman id 626591;
 Wed, 01 Nov 2023 17: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 1qyFRZ-0002kv-Bk
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17: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 1qyFRZ-0008Rr-3F
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:55:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFRZ-0000Ac-0b
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17: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=LiP4XKU/n0UKcQ1Nutkmax3SXMsl2Qq+GgT3LKUnQ9Q=; b=V+qlSiPELq048bIXKLBitCNLds
	Yu8rRytyjrTip4N6miJ5Qj6g0m3JUefzUNKE1svsO7KayFGNq1PjA8dT2Kn4JZibTQExIF9YqJXvv
	F4wsuRhiDrtXzyVPy+12WBptuZY2M7PZKl5f8HXpTQlkCvmJLEvAwEugyMIU1mtWJpwU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CHANGELOG.md: Start new 4.19.0 section
Message-Id: <E1qyFRZ-0000Ac-0b@xenbits.xenproject.org>
Date: Wed, 01 Nov 2023 17:55:53 +0000

commit a944636478e5d8db143920de8db7c4609a44fe8c
Author:     Henry Wang <Henry.Wang@arm.com>
AuthorDate: Tue Oct 31 22:49:25 2023 +0800
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 15:48:07 2023 +0000

    CHANGELOG.md: Start new 4.19.0 section
    
    Signed-off-by: Henry Wang <Henry.Wang@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 CHANGELOG.md | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7fb4d366c3..b184dde8b1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,14 @@ 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/)
 
+## [4.19.0 UNRELEASED](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=staging) - TBD
+
+### Changed
+
+### Added
+
+### Removed
+
 ## [4.18.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.18.0) - 2023-11-16
 
 ### Changed
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 01 17:56:04 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Nov 2023 17:56:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626592.976947 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qyFRk-0002s7-OI; Wed, 01 Nov 2023 17:56:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626592.976947; Wed, 01 Nov 2023 17:56:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qyFRk-0002s0-Le; Wed, 01 Nov 2023 17:56:04 +0000
Received: by outflank-mailman (input) for mailman id 626592;
 Wed, 01 Nov 2023 17:56: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 1qyFRj-0002rm-96
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:56: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 1qyFRj-0008SB-8J
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:56:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFRj-0000BR-5L
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:56: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=KOVbxxuqOXPPyMjfcuF/+r+8J1IsvR2R42XAFyJ6DVw=; b=Zm1x9A2nYPHKpkR2v4Mh1OY3to
	39/N02aiuxUvvliZqSGGxxOpskcB7PhX2JtSkYyHvZVY9TVhHc3igf8M9kH7JIzgN+n5+RUcGHcyh
	i6hAzCloO7IJwoDj/L3XG6s8T4liERVCi1BQSQLl35VWIbAfdYGGxWhAC+i40FfEMUgM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mce: Move MC_NCLASSES into the enum mctelem_class
Message-Id: <E1qyFRj-0000BR-5L@xenbits.xenproject.org>
Date: Wed, 01 Nov 2023 17:56:03 +0000

commit 6386f5585c5afada8b353e4cc46eaf4a0be2b7b2
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Fri Oct 6 10:26:10 2023 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 16:10:14 2023 +0000

    x86/mce: Move MC_NCLASSES into the enum mctelem_class
    
    The definition of MC_NCLASSES contained a violation of MISRA C:2012
    Rule 10.1, therefore by moving it as an enumeration constant resolves the
    violation and makes it more resilient to possible additions to that enum.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/mcheck/mctelem.c | 2 --
 xen/arch/x86/cpu/mcheck/mctelem.h | 5 +++--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mctelem.c b/xen/arch/x86/cpu/mcheck/mctelem.c
index 329ac20faf..77a4d1d5ff 100644
--- a/xen/arch/x86/cpu/mcheck/mctelem.c
+++ b/xen/arch/x86/cpu/mcheck/mctelem.c
@@ -64,8 +64,6 @@ struct mctelem_ent {
 
 #define MC_NENT (MC_URGENT_NENT + MC_NONURGENT_NENT)
 
-#define	MC_NCLASSES		(MC_NONURGENT + 1)
-
 #define	COOKIE2MCTE(c)		((struct mctelem_ent *)(c))
 #define	MCTE2COOKIE(tep)	((mctelem_cookie_t)(tep))
 
diff --git a/xen/arch/x86/cpu/mcheck/mctelem.h b/xen/arch/x86/cpu/mcheck/mctelem.h
index d4eba53ae0..21b251847b 100644
--- a/xen/arch/x86/cpu/mcheck/mctelem.h
+++ b/xen/arch/x86/cpu/mcheck/mctelem.h
@@ -55,8 +55,9 @@
 typedef struct mctelem_cookie *mctelem_cookie_t;
 
 typedef enum mctelem_class {
-	MC_URGENT,
-	MC_NONURGENT
+    MC_URGENT,
+    MC_NONURGENT,
+    MC_NCLASSES
 } mctelem_class_t;
 
 extern void mctelem_init(unsigned int);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 01 17:56:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Nov 2023 17:56:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626593.976952 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qyFRu-0002zZ-Pu; Wed, 01 Nov 2023 17:56:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626593.976952; Wed, 01 Nov 2023 17:56:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qyFRu-0002zR-N5; Wed, 01 Nov 2023 17:56:14 +0000
Received: by outflank-mailman (input) for mailman id 626593;
 Wed, 01 Nov 2023 17:56:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFRt-0002wK-Bv
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:56: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 1qyFRt-0008SL-BF
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:56:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFRt-0000Bt-AQ
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:56: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=+7NP6cfEqef7SCiHTsWlTt/rQyskSuAQOJc6pc+CPTE=; b=wGVSFmAwNowBss2us1dmdB1EdX
	WBkI9G0+gqpkssyLr+OKYJSNjptUFDUo9BzNZFA2Q/OjY3Zh+drxUhhhvRJQXQCQvXRYDt0Fol9Vf
	WCEnhhEAhOijezYDGtUfg7MVurw1kFBPbMJCzevlJxS5xC2DLII5jZFxINRQOvpnstr4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/spinlock: fix use of 0 as a null pointer constant
Message-Id: <E1qyFRt-0000Bt-AQ@xenbits.xenproject.org>
Date: Wed, 01 Nov 2023 17:56:13 +0000

commit 8e74432dd335ce5f2fd83a33b5243c08c7c55c86
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Thu Oct 5 10:45:20 2023 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 16:10:14 2023 +0000

    xen/spinlock: fix use of 0 as a null pointer constant
    
    The constant 0 is used as a null pointer constant, in
    violation of MISRA C:2012 Rule 11.9, in builds with
    CONFIG_DEBUG_LOCK_PROFILE defined.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/include/xen/spinlock.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index e7a1c1aa89..16d933ae7e 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -94,7 +94,7 @@ struct lock_profile_qhead {
     int32_t                   idx;     /* index for printout */
 };
 
-#define _LOCK_PROFILE(name) { 0, #name, &name, 0, 0, 0, 0, 0 }
+#define _LOCK_PROFILE(name) { NULL, #name, &name, 0, 0, 0, 0, 0 }
 #define _LOCK_PROFILE_PTR(name)                                               \
     static struct lock_profile * const __lock_profile_##name                  \
     __used_section(".lockprofile.data") =                                     \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 01 17:56:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Nov 2023 17:56:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626594.976957 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qyFS3-00038D-TW; Wed, 01 Nov 2023 17:56:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626594.976957; Wed, 01 Nov 2023 17:56: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 1qyFS3-000385-QP; Wed, 01 Nov 2023 17:56:23 +0000
Received: by outflank-mailman (input) for mailman id 626594;
 Wed, 01 Nov 2023 17:56:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFS3-00037v-Ek
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:56:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFS3-0008SY-E7
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:56:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFS3-0000CJ-DM
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:56:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nNILV+ScTBGK4+xvazVkDOI5Y6yxJk9AQiFnUO3JxZI=; b=wUlZyfOkl1ITn6DCPZc3YR6z0F
	2Z28+wGVlMt6GFFlhAsGLsy/clypcN6VAv1pwpUB62AeFd2N1yfcpBmbpOoKqJ0M+jsTltCEEzZjs
	RRAK03iyVKvZMAldTHpYmq0y2vItnsdvuVBJp/P5hl9Rd0yxuycYB5msjnUmZhyYgLqg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpu-policy: Adjust CPUID_MAX_SERIALISED_LEAVES to placate MISRA
Message-Id: <E1qyFS3-0000CJ-DM@xenbits.xenproject.org>
Date: Wed, 01 Nov 2023 17:56:23 +0000

commit cfff187ed5f2068f48a3d44f0560b1721902a276
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 10 10:52:53 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 16:10:14 2023 +0000

    x86/cpu-policy: Adjust CPUID_MAX_SERIALISED_LEAVES to placate MISRA
    
    MISRA doesn't like !!CONST being used in place of a 1 (Rule 10.1).  Update the
    expression to just be a plain 1, which still matches the description.
    
    No functional change.
    
    Reported-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/lib/x86/cpu-policy.h | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/xen/include/xen/lib/x86/cpu-policy.h b/xen/include/xen/lib/x86/cpu-policy.h
index bab3eecda6..d5e447e9dc 100644
--- a/xen/include/xen/lib/x86/cpu-policy.h
+++ b/xen/include/xen/lib/x86/cpu-policy.h
@@ -100,13 +100,14 @@ const char *x86_cpuid_vendor_to_str(unsigned int vendor);
  * interaction with the toolstack.  (Sum of all leaves in each union, less the
  * entries in basic which sub-unions hang off of.)
  */
-#define CPUID_MAX_SERIALISED_LEAVES                     \
-    (CPUID_GUEST_NR_BASIC +                             \
-     CPUID_GUEST_NR_FEAT   - !!CPUID_GUEST_NR_FEAT +    \
-     CPUID_GUEST_NR_CACHE  - !!CPUID_GUEST_NR_CACHE +   \
-     CPUID_GUEST_NR_TOPO   - !!CPUID_GUEST_NR_TOPO +    \
-     CPUID_GUEST_NR_XSTATE - !!CPUID_GUEST_NR_XSTATE +  \
-     CPUID_GUEST_NR_EXTD + 2 /* hv_limit and hv2_limit */ )
+#define CPUID_MAX_SERIALISED_LEAVES             \
+    (CPUID_GUEST_NR_BASIC +                     \
+     CPUID_GUEST_NR_FEAT   - 1 +                \
+     CPUID_GUEST_NR_CACHE  - 1 +                \
+     CPUID_GUEST_NR_TOPO   - 1 +                \
+     CPUID_GUEST_NR_XSTATE - 1 +                \
+     CPUID_GUEST_NR_EXTD +                      \
+     2 /* hv_limit and hv2_limit */ )
 
 /* Maximum number of MSRs written when serialising a cpu_policy. */
 #define MSR_MAX_SERIALISED_ENTRIES 2
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 01 17:56:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Nov 2023 17:56:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626595.976960 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qyFSD-0003Cp-US; Wed, 01 Nov 2023 17:56:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626595.976960; Wed, 01 Nov 2023 17:56: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 1qyFSD-0003Ci-Rr; Wed, 01 Nov 2023 17:56:33 +0000
Received: by outflank-mailman (input) for mailman id 626595;
 Wed, 01 Nov 2023 17:56:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFSD-0003Cc-Hn
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:56:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFSD-0008Sy-H2
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:56:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFSD-0000Cm-GG
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:56:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GanBtbG3ZS/y53QKLgFpIpTTbgYKq+p1+opzg9aRpZ8=; b=bYOK1AzLLuf93oLIdtkdqI3r/i
	OZjXb1aSOAwCfBLIRDxaHXF0pASe5+9fIxR4L2TC3sFFggWXNZg8YRqiw5IWkhwENlrd0eBTOTiqe
	9WrHP81kqp2xZ2bmGKJ2zbDbZ5mve7uOLy7qgAn7M70pV73YPvbXD85REuM7lIe0hD60=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mem_sharing: add missing m2p entry when mapping shared_info page
Message-Id: <E1qyFSD-0000Cm-GG@xenbits.xenproject.org>
Date: Wed, 01 Nov 2023 17:56:33 +0000

commit 23eb39acf011ef9bbe02ed4619c55f208fbcd39b
Author:     Tamas K Lengyel <tamas@tklengyel.com>
AuthorDate: Wed Oct 18 04:02:42 2023 -0400
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 16:10:14 2023 +0000

    x86/mem_sharing: add missing m2p entry when mapping shared_info page
    
    When mapping in the shared_info page to a fork the m2p entry wasn't set
    resulting in the shared_info being reset even when the fork reset was called
    with only reset_state and not reset_memory. This results in an extra
    unnecessary TLB flush.
    
    Fixes: 1a0000ac775 ("mem_sharing: map shared_info page to same gfn during fork")
    Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/mem_sharing.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 94b6b782ef..142258f16a 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1847,6 +1847,8 @@ static int copy_special_pages(struct domain *cd, struct domain *d)
                                 p2m_ram_rw, p2m->default_access, -1);
             if ( rc )
                 return rc;
+
+            set_gpfn_from_mfn(mfn_x(new_mfn), gfn_x(old_gfn));
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 01 17:56:44 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Nov 2023 17:56:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626596.976964 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qyFSN-0003Hb-W1; Wed, 01 Nov 2023 17:56:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626596.976964; Wed, 01 Nov 2023 17:56: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 1qyFSN-0003HT-TL; Wed, 01 Nov 2023 17:56:43 +0000
Received: by outflank-mailman (input) for mailman id 626596;
 Wed, 01 Nov 2023 17:56:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFSN-0003HN-Kn
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:56:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFSN-0008T5-K3
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:56:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFSN-0000DB-JA
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:56:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3ZcjhKiDZl8cKU2nnMu4p0Qz+xFu/u16GX2t0A86Gp0=; b=tpcPEyyO4MmFZEqAJ6n3ofjiEA
	kIIkEiMObaE5cRn5sKDXTPsGKC5E1depkoR+OBCN0XtppHI0vJHbWlq2SL66knr0KNETnwhglJJa5
	joGEIflSIo/YkSbPvT5z9vvnoZbkoukY1Psxr+nVB0eBo1AWCKqL7IbA7cB7u5Y9KHoM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/pv-shim: fix grant table operations for 32-bit guests
Message-Id: <E1qyFSN-0000DB-JA@xenbits.xenproject.org>
Date: Wed, 01 Nov 2023 17:56:43 +0000

commit 93ec30bc545f15760039c23ee4b97b80c0b3b3b3
Author:     David Woodhouse <dwmw@amazon.co.uk>
AuthorDate: Mon Oct 23 12:34:24 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 16:10:14 2023 +0000

    x86/pv-shim: fix grant table operations for 32-bit guests
    
    When switching to call the shim functions from the normal handlers, the
    compat_grant_table_op() function was omitted, leaving it calling the
    real grant table operations in !PV_SHIM_EXCLUSIVE builds. This leaves a
    32-bit shim guest failing to set up its real grant table with the parent
    hypervisor.
    
    Fixes: e7db635f4428 ("x86/pv-shim: Don't modify the hypercall table")
    Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/compat/grant_table.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/common/compat/grant_table.c b/xen/common/compat/grant_table.c
index e00bc24a34..af98eade17 100644
--- a/xen/common/compat/grant_table.c
+++ b/xen/common/compat/grant_table.c
@@ -63,6 +63,11 @@ int compat_grant_table_op(
     unsigned int i, cmd_op;
     XEN_GUEST_HANDLE_PARAM(void) cnt_uop;
 
+#ifdef CONFIG_PV_SHIM
+    if ( unlikely(pv_shim) )
+        return pv_shim_grant_table_op(cmd, uop, count);
+#endif
+
     set_xen_guest_handle(cnt_uop, NULL);
     cmd_op = cmd & GNTTABOP_CMD_MASK;
     if ( cmd_op != GNTTABOP_cache_flush )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 01 17:56:55 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Nov 2023 17:56:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626597.976967 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qyFSZ-0003KK-1J; Wed, 01 Nov 2023 17:56:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626597.976967; Wed, 01 Nov 2023 17:56:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qyFSY-0003KB-Un; Wed, 01 Nov 2023 17:56:54 +0000
Received: by outflank-mailman (input) for mailman id 626597;
 Wed, 01 Nov 2023 17:56:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFSX-0003K1-Nr
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:56:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFSX-0008TC-N7
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:56:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyFSX-0000Db-MF
 for xen-changelog@lists.xenproject.org; Wed, 01 Nov 2023 17:56:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kV9r5mtGdsh/QqGjSEetiBly3qc8mvivU6Ap/BH1xNw=; b=jKMhQItDnqVkt80QaftG/ZOZpx
	w6WGUB0jseU2uN6IOXg0M/FpJWrpK+EKkGCzEXdPtPdR0P42SYS8Pqy/cR0OXaxtPysFBm4oDPAQ3
	1W1ymI3weRqjIPWZV8ReNOgUlynQMjqjOuZ1Mo1NafJG9MmnmBmX3k8J+tE8W5K3kc84=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/p2m: address violations of MISRA C:2012 Rules 8.2 and 8.3
Message-Id: <E1qyFSX-0000Db-MF@xenbits.xenproject.org>
Date: Wed, 01 Nov 2023 17:56:53 +0000

commit 7befef87cc9b1bb8ca15d866ce1ecd9165ccb58c
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Mon Oct 23 15:47:11 2023 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 16:10:14 2023 +0000

    x86/p2m: address violations of MISRA C:2012 Rules 8.2 and 8.3
    
    Add missing parameter name and make function declarations and
    definitions consistent. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/include/asm/p2m.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/include/asm/p2m.h b/xen/arch/x86/include/asm/p2m.h
index 40545f5fa8..f2c7d58b59 100644
--- a/xen/arch/x86/include/asm/p2m.h
+++ b/xen/arch/x86/include/asm/p2m.h
@@ -632,7 +632,7 @@ void p2m_change_type_range(struct domain *d,
                            p2m_type_t ot, p2m_type_t nt);
 
 /* Compare-exchange the type of a single p2m entry */
-int p2m_change_type_one(struct domain *d, unsigned long gfn,
+int p2m_change_type_one(struct domain *d, unsigned long gfn_l,
                         p2m_type_t ot, p2m_type_t nt);
 
 /* Synchronously change the p2m type for a range of gfns */
@@ -649,7 +649,7 @@ static inline bool p2m_is_global_logdirty(const struct domain *d)
 #endif
 }
 
-int p2m_is_logdirty_range(struct p2m_domain *, unsigned long start,
+int p2m_is_logdirty_range(struct p2m_domain *p2m, unsigned long start,
                           unsigned long end);
 
 /* Set mmio addresses in the p2m table (for pass-through) */
@@ -661,9 +661,9 @@ int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
                            p2m_access_t p2ma, unsigned int flag);
 int clear_identity_p2m_entry(struct domain *d, unsigned long gfn);
 /* HVM-only callers can use these directly: */
-int p2m_add_identity_entry(struct domain *d, unsigned long gfn,
+int p2m_add_identity_entry(struct domain *d, unsigned long gfn_l,
                            p2m_access_t p2ma, unsigned int flag);
-int p2m_remove_identity_entry(struct domain *d, unsigned long gfn);
+int p2m_remove_identity_entry(struct domain *d, unsigned long gfn_l);
 
 /* 
  * Populate-on-demand
@@ -924,7 +924,7 @@ int p2m_altp2m_propagate_change(struct domain *d, gfn_t gfn,
                                 p2m_type_t p2mt, p2m_access_t p2ma);
 
 /* Set a specific p2m view visibility */
-int p2m_set_altp2m_view_visibility(struct domain *d, unsigned int idx,
+int p2m_set_altp2m_view_visibility(struct domain *d, unsigned int altp2m_idx,
                                    uint8_t visible);
 #else /* !CONFIG_HVM */
 struct p2m_domain *p2m_get_altp2m(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 02 07:33:10 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Nov 2023 07:33:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.626737.977252 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qySCO-0007b9-6Q; Thu, 02 Nov 2023 07:33:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 626737.977252; Thu, 02 Nov 2023 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 1qySCO-0007b1-3s; Thu, 02 Nov 2023 07:33:04 +0000
Received: by outflank-mailman (input) for mailman id 626737;
 Thu, 02 Nov 2023 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 1qySCM-0007at-Os
 for xen-changelog@lists.xenproject.org; Thu, 02 Nov 2023 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 1qySCM-0005Bs-Hq
 for xen-changelog@lists.xenproject.org; Thu, 02 Nov 2023 07:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qySCM-0004cr-Go
 for xen-changelog@lists.xenproject.org; Thu, 02 Nov 2023 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=6KQG+BTxuy18EDR6+qtwbk529NxXLfFR2fcEGq1icPw=; b=CmX/KHbs1jas+h4xwDE1djHoXe
	1icVzgdQC74mBrFVE54U9NdpPHRFSfkxACcxVFvZfEhEq2dV2kLTGcpl7MonSFAm25XfOsjrjhwyB
	l1ms8+u1hDrCbapeHUxLk63tFB2HRD7wR1mXQbsqgN3B95M6h/Fr+mSc22wVzTDvK1EM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] build: silence GNU ld 2.39 warning about executable stacks
Message-Id: <E1qySCM-0004cr-Go@xenbits.xenproject.org>
Date: Thu, 02 Nov 2023 07:33:02 +0000

commit 9c20bc009c907001efcd590a796ed67068f09b92
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 2 08:25:59 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 2 08:25:59 2023 +0100

    build: silence GNU ld 2.39 warning about executable stacks
    
    While for C files the compiler is supposed to arrange for emitting
    respective information, for assembly sources we're responsible ourselves.
    
    For the new use of cc-option to work we cannot pass -S to the compiler
    anymore. We need the compiler to actually invoke the assembler, so switch
    to using -c.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 Config.mk | 6 ++++--
 minios.mk | 4 ++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Config.mk b/Config.mk
index 677e93d..bfdf885 100644
--- a/Config.mk
+++ b/Config.mk
@@ -1,4 +1,6 @@
-#
+# Convenient variables
+comma := ,
+
 # Compare $(1) and $(2) and replace $(2) with $(1) if they differ
 #
 # Typically $(1) is a newly generated file and $(2) is the target file
@@ -20,7 +22,7 @@ endef
 #
 # Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
 cc-option = $(shell if test -z "`echo 'void*p=1;' | \
-              $(1) $(2) -S -o /dev/null -x c - 2>&1 | grep -- $(2) -`"; \
+              $(1) $(2) -c -o /dev/null -x c - 2>&1 | grep -- $(2) -`"; \
               then echo "$(2)"; else echo "$(3)"; fi ;)
 
 ifneq ($(MINIOS_CONFIG),)
diff --git a/minios.mk b/minios.mk
index ef4d2f9..f718ee6 100644
--- a/minios.mk
+++ b/minios.mk
@@ -28,6 +28,10 @@ endif
 # Make the headers define our internal stuff
 DEF_CFLAGS += -D__INSIDE_MINIOS__
 
+# Arrange for assembly files to have a proper .note.GNU-stack section added,
+# to silence warnings otherwise issued by GNU ld 2.39 and newer.
+DEF_ASFLAGS += $(call cc-option,$(CC),-Wa$(comma)--noexecstack)
+
 # Build the CFLAGS and ASFLAGS for compiling and assembling.
 # DEF_... flags are the common mini-os flags,
 # ARCH_... flags may be defined in arch/$(TARGET_ARCH_FAM/rules.mk
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 03 02:55:11 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Nov 2023 02:55:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627060.977923 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qykKt-0001Kv-Bf; Fri, 03 Nov 2023 02:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627060.977923; Fri, 03 Nov 2023 02: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 1qykKt-0001Kn-8u; Fri, 03 Nov 2023 02:55:03 +0000
Received: by outflank-mailman (input) for mailman id 627060;
 Fri, 03 Nov 2023 02: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 1qykKs-0001Kh-0D
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02: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 1qykKr-0000DV-OH
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qykKr-0006ZL-MO
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:55:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=O27B3Z6ibIKRNTedG406yrlOGWHcpTLTd6zdsMhJFbw=; b=wZj4InmFrSJi44bUzj+Jd4Vgb+
	C4w6SK2MeBmSbZkMRSdbiKQI82ea/4FAwh1GfHpNSuAArN1B2fOHBsS0vCza1tojwImaxPjUudCvG
	tcy0c1WQa72set0aKecNVqSC/SDThjG1wjfrlioF35hb2LA+Y4AK5KbxCs+HozHe5Tfw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/vRTC: minor adjustment to reads from index port
Message-Id: <E1qykKr-0006ZL-MO@xenbits.xenproject.org>
Date: Fri, 03 Nov 2023 02:55:01 +0000

commit 7b1de98b66f91b468d9bdc9abafdb55e3276d989
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 2 10:42:02 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 2 10:42:02 2023 +0100

    x86/vRTC: minor adjustment to reads from index port
    
    Whether to handle this shouldn't depend on the present value of the
    index register. Since the handling is done outside of the lock anyway,
    pull it out into the sole caller and drop the no longer needed function
    parameter.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hvm/rtc.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index 206b4296e9..853ead5e80 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -646,14 +646,11 @@ static int update_in_progress(RTCState *s)
     return 0;
 }
 
-static uint32_t rtc_ioport_read(RTCState *s, uint32_t addr)
+static uint32_t rtc_ioport_read(RTCState *s)
 {
     int ret;
     struct domain *d = vrtc_domain(s);
 
-    if ( (addr & 1) == 0 )
-        return 0xff;
-
     spin_lock(&s->lock);
 
     switch ( s->hw.cmos_index )
@@ -715,9 +712,14 @@ static int cf_check handle_rtc_io(
         if ( rtc_ioport_write(vrtc, port, (uint8_t)*val) )
             return X86EMUL_OKAY;
     }
+    else if ( !(port & 1) )
+    {
+        *val = 0xff;
+        return X86EMUL_OKAY;
+    }
     else if ( vrtc->hw.cmos_index < RTC_CMOS_SIZE )
     {
-        *val = rtc_ioport_read(vrtc, port);
+        *val = rtc_ioport_read(vrtc);
         return X86EMUL_OKAY;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 03 02:55:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Nov 2023 02:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627061.977927 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qykL3-0001MT-Cs; Fri, 03 Nov 2023 02:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627061.977927; Fri, 03 Nov 2023 02: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 1qykL3-0001ML-AQ; Fri, 03 Nov 2023 02:55:13 +0000
Received: by outflank-mailman (input) for mailman id 627061;
 Fri, 03 Nov 2023 02:55:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qykL1-0001MB-Sw
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:55:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qykL1-0000De-SD
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qykL1-0006Zp-QP
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:55:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Jf05q5nZnLNSWRjrNCiWDs+idU7FmwTfA+BZlOULXsk=; b=pJ0gzon7Cc0eiPKuKmP3162DMj
	ojvYellEgYnQGRBtk5uU327iwRfen00oqKUEze5xbNKp+LK/L+qHmGklRVqkl/PDeLsTBNZ8mRW+g
	zPnezGdZmir4Kq7PPK4NjNnxY9WUE4f2EmmeRLMpIZGDpUIu5bxfms8J2JenurnB2aOs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: don't allow Dom0 access to port CF9
Message-Id: <E1qykL1-0006Zp-QP@xenbits.xenproject.org>
Date: Fri, 03 Nov 2023 02:55:11 +0000

commit ee3bcf907ac39aed099d6fca41ab3769180d03f0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 2 10:43:29 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 2 10:43:29 2023 +0100

    x86: don't allow Dom0 access to port CF9
    
    This allows to initiate machine reset, which we don't want to permit
    Dom0 to invoke that way.
    
    While there insert blank lines and convert the sibling PCI config space
    port numbers to upper case, matching style earlier in the function.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/dom0_build.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 09fb8b063a..5dc5872e38 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -491,8 +491,13 @@ int __init dom0_setup_permissions(struct domain *d)
     /* ACPI PM Timer. */
     if ( pmtmr_ioport )
         rc |= ioports_deny_access(d, pmtmr_ioport, pmtmr_ioport + 3);
-    /* PCI configuration space (NB. 0xcf8 has special treatment). */
-    rc |= ioports_deny_access(d, 0xcfc, 0xcff);
+
+    /* Reset control. */
+    rc |= ioports_deny_access(d, 0xCF9, 0xCF9);
+
+    /* PCI configuration space (NB. 0xCF8 has special treatment). */
+    rc |= ioports_deny_access(d, 0xCFC, 0xCFF);
+
 #ifdef CONFIG_HVM
     if ( is_hvm_domain(d) )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 03 02:55:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Nov 2023 02:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627062.977931 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qykLD-0001Oc-Eg; Fri, 03 Nov 2023 02:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627062.977931; Fri, 03 Nov 2023 02: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 1qykLD-0001OV-Br; Fri, 03 Nov 2023 02:55:23 +0000
Received: by outflank-mailman (input) for mailman id 627062;
 Fri, 03 Nov 2023 02: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 1qykLC-0001OL-03
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02: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 1qykLB-0000Dr-VQ
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:55:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qykLB-0006bp-US
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:55:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=X2JtvX6+QQ1G5enm/hVFLH4F0Ia2SIhPIURGgx53AJM=; b=RH0MjAYRU60gsL38rG+PDyNHA+
	UAs3KWIFdop/qoJC0/bFxCYPQtUejLeH/2U+UZnBmPM3Qb2bYkaNWlv3zqc6o1GibKxa2LP7TSTLU
	gZUTxiHwh+jpQAXaBQDG30Kt2EONqNi53oTCYmyUWbs3yK0eprfIfDEcWys5yjKVYyHc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: don't allow Dom0 access to port 92
Message-Id: <E1qykLB-0006bp-US@xenbits.xenproject.org>
Date: Fri, 03 Nov 2023 02:55:21 +0000

commit 9e2c146c38a74e6ced610599224ce216cae13874
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 2 10:44:11 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 2 10:44:11 2023 +0100

    x86: don't allow Dom0 access to port 92
    
    Somewhat like port CF9 this may have a bit controlling the CPU's INIT#
    signal, and it also may have a bit involved in the driving of A20M#.
    Neither of these - just like CF9 - we want to allow Dom0 to drive.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/dom0_build.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 5dc5872e38..c31afc734f 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -488,6 +488,10 @@ int __init dom0_setup_permissions(struct domain *d)
     rc |= ioports_deny_access(d, 0x40, 0x43);
     /* PIT Channel 2 / PC Speaker Control. */
     rc |= ioports_deny_access(d, 0x61, 0x61);
+
+    /* INIT# and alternative A20M# control. */
+    rc |= ioports_deny_access(d, 0x92, 0x92);
+
     /* ACPI PM Timer. */
     if ( pmtmr_ioport )
         rc |= ioports_deny_access(d, pmtmr_ioport, pmtmr_ioport + 3);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 03 02:55:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Nov 2023 02:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627063.977937 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qykLN-0001Rb-GT; Fri, 03 Nov 2023 02:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627063.977937; Fri, 03 Nov 2023 02: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 1qykLN-0001RS-DS; Fri, 03 Nov 2023 02:55:33 +0000
Received: by outflank-mailman (input) for mailman id 627063;
 Fri, 03 Nov 2023 02: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 1qykLM-0001RC-33
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02: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 1qykLM-0000E3-2I
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qykLM-0006cR-1J
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02: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=qukBK0TDxxCu33DxGNT8++eTyElv5K3mxg98iXmjjOs=; b=z/pYAbHJuAtgz3eJsTBOK1rktT
	NcPRP/nYbinVtQsWdfy9st22LnRTXjUiqDhr0N29ZfMs2fo2jyMPqhGVwFmu8z/k4yL64MUZSook/
	MtqfM/Mb9nbd7SqdBYNsLH5NWiU+mlhFI8pjDOGh95NujLWt03FKrpcGURQl1g+JaZeM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/PVH: deny Dom0 access to the ISA DMA controller
Message-Id: <E1qykLM-0006cR-1J@xenbits.xenproject.org>
Date: Fri, 03 Nov 2023 02:55:32 +0000

commit 306e3dc919211f1b24b6261f767e2436a98ab818
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 2 10:44:46 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 2 10:44:46 2023 +0100

    x86/PVH: deny Dom0 access to the ISA DMA controller
    
    Unlike PV, a PVH Dom0 has no sensible way of driving the address and
    page registers correctly, as it would need to translate guest physical
    addresses to host ones. Rather than allowing data corruption to occur
    from e.g. the use of a legacy floppy drive, disallow access altogether.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/dom0_build.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index c31afc734f..640e666685 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -505,6 +505,13 @@ int __init dom0_setup_permissions(struct domain *d)
 #ifdef CONFIG_HVM
     if ( is_hvm_domain(d) )
     {
+        /* ISA DMA controller, channels 0-3 (incl possible aliases). */
+        rc |= ioports_deny_access(d, 0x00, 0x1F);
+        /* ISA DMA controller, page registers (incl various reserved ones). */
+        rc |= ioports_deny_access(d, 0x80 + !!hvm_port80_allowed, 0x8F);
+        /* ISA DMA controller, channels 4-7 (incl usual aliases). */
+        rc |= ioports_deny_access(d, 0xC0, 0xDF);
+
         /* HVM debug console IO port. */
         rc |= ioports_deny_access(d, XEN_HVM_DEBUGCONS_IOPORT,
                                   XEN_HVM_DEBUGCONS_IOPORT);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 03 02:55:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Nov 2023 02:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627064.977940 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qykLX-0001UD-Hr; Fri, 03 Nov 2023 02:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627064.977940; Fri, 03 Nov 2023 02: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 1qykLX-0001U5-FA; Fri, 03 Nov 2023 02:55:43 +0000
Received: by outflank-mailman (input) for mailman id 627064;
 Fri, 03 Nov 2023 02: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 1qykLW-0001Tg-7f
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02: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 1qykLW-0000EA-67
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qykLW-0006cq-4S
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02: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=I6jDjqWzPsVs0lpKrJDo9VnUDNNGsvd96zWJBejS4mA=; b=FXdvhjz7UAog/2kNf7DfUTAtkD
	bk9iHUxW5BQqwGZRgkO1Ms9+ZORXMccH0sUfnNtUsvyOv5M9P2/cND1lf9RvwPoWJKumJdYeFvqSt
	Gp56omfetOM2oYbjTzVWGhfyHqo5mxyouovedC2VWWsfAb+OJzbi/qeu77fAo04ZDUo4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: don't allow Dom0 (direct) access to port F0
Message-Id: <E1qykLW-0006cq-4S@xenbits.xenproject.org>
Date: Fri, 03 Nov 2023 02:55:42 +0000

commit 86266162fc09d1472dc1f70ce329386cb4b2cc91
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 2 10:45:39 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 2 10:45:39 2023 +0100

    x86: don't allow Dom0 (direct) access to port F0
    
    This controls the driving of IGNNE# (if such emulation is enabled in
    hardware), and hence would need proper handling in the hypervisor to be
    safe to use by Dom0 (and fully emulating for PVH/HVM DomU-s).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/dom0_build.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 640e666685..e734622400 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -492,6 +492,9 @@ int __init dom0_setup_permissions(struct domain *d)
     /* INIT# and alternative A20M# control. */
     rc |= ioports_deny_access(d, 0x92, 0x92);
 
+    /* IGNNE# control. */
+    rc |= ioports_deny_access(d, 0xF0, 0xF0);
+
     /* ACPI PM Timer. */
     if ( pmtmr_ioport )
         rc |= ioports_deny_access(d, pmtmr_ioport, pmtmr_ioport + 3);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 03 02:55:53 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Nov 2023 02:55:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627065.977944 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qykLh-0001Ww-JF; Fri, 03 Nov 2023 02:55:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627065.977944; Fri, 03 Nov 2023 02:55:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qykLh-0001Wo-Gc; Fri, 03 Nov 2023 02:55:53 +0000
Received: by outflank-mailman (input) for mailman id 627065;
 Fri, 03 Nov 2023 02:55:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qykLg-0001Wf-AD
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:55:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qykLg-0000Eb-9Q
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qykLg-0006dF-8C
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:55:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1QCPwF11Bmr1qAf25cEABppS/7vXfjK558aZhBM5BQY=; b=trRMaRo1nVPedgUBWaCeURoEF5
	9ihEKbacP30ZZLVmbfYvX9+v6OfhLOzHjn5CoWizOja0WtT4uxD5ujmvVMnYvFSGz8X1fKMBJBRi8
	v+fXRpDKfvGW4zumuXQAGeMo1ltu7NzXlj1WFA7IgfspG+p9UMSYJuc5xZKUrrkwF4JE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: introduce function for physical offset calculation
Message-Id: <E1qykLg-0006dF-8C@xenbits.xenproject.org>
Date: Fri, 03 Nov 2023 02:55:52 +0000

commit af670c14e87a838d8274f5b619ce57379a749d93
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu Nov 2 10:47:58 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 2 10:47:58 2023 +0100

    xen/riscv: introduce function for physical offset calculation
    
    The function was introduced to calculate and save physical
    offset before MMU is enabled because access to start() is
    PC-relative and in case of linker_addr != load_addr it will
    result in incorrect value in phys_offset.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/mm.h |  2 ++
 xen/arch/riscv/mm.c             | 21 ++++++++++++++++++---
 xen/arch/riscv/riscv64/head.S   | 14 ++++++++++++++
 3 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index 5e3ac5cde3..7b94cbadd7 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -15,4 +15,6 @@ void setup_initial_pagetables(void);
 void enable_mmu(void);
 void cont_after_mmu_is_enabled(void);
 
+unsigned long calc_phys_offset(void);
+
 #endif /* _ASM_RISCV_MM_H */
diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
index 99ed5e9623..a73f135a3c 100644
--- a/xen/arch/riscv/mm.c
+++ b/xen/arch/riscv/mm.c
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
+#include <xen/cache.h>
 #include <xen/compiler.h>
 #include <xen/init.h>
 #include <xen/kernel.h>
@@ -19,9 +20,10 @@ struct mmu_desc {
     pte_t *pgtbl_base;
 };
 
-#define PHYS_OFFSET ((unsigned long)_start - XEN_VIRT_START)
-#define LOAD_TO_LINK(addr) ((addr) - PHYS_OFFSET)
-#define LINK_TO_LOAD(addr) ((addr) + PHYS_OFFSET)
+static unsigned long __ro_after_init phys_offset;
+
+#define LOAD_TO_LINK(addr) ((unsigned long)(addr) - phys_offset)
+#define LINK_TO_LOAD(addr) ((unsigned long)(addr) + phys_offset)
 
 /*
  * It is expected that Xen won't be more then 2 MB.
@@ -273,3 +275,16 @@ void __init noreturn noinline enable_mmu()
     switch_stack_and_jump((unsigned long)cpu0_boot_stack + STACK_SIZE,
                           cont_after_mmu_is_enabled);
 }
+
+/*
+ * calc_phys_offset() should be used before MMU is enabled because access to
+ * start() is PC-relative and in case when load_addr != linker_addr phys_offset
+ * will have an incorrect value
+ */
+unsigned long __init calc_phys_offset(void)
+{
+    volatile unsigned long load_start = (unsigned long)_start;
+
+    phys_offset = load_start - XEN_VIRT_START;
+    return phys_offset;
+}
diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S
index 2c0304646a..ae194bb099 100644
--- a/xen/arch/riscv/riscv64/head.S
+++ b/xen/arch/riscv/riscv64/head.S
@@ -29,6 +29,20 @@ ENTRY(start)
 
         jal     reset_stack
 
+        /*
+         * save hart_id ( bootcpu_id ) and dtb_base as a0 and a1 register can
+         * be used by C code
+         */
+        mv      s0, a0
+        mv      s1, a1
+
+        jal     calc_phys_offset
+        mv      s2, a0
+
+        /* restore hart_id ( bootcpu_id ) and dtb address */
+        mv      a0, s0
+        mv      a1, s1
+
         tail    start_xen
 
         .section .text, "ax", %progbits
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 03 02:56:03 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Nov 2023 02:56:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627066.977948 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qykLr-0001ZP-LG; Fri, 03 Nov 2023 02:56:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627066.977948; Fri, 03 Nov 2023 02:56: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 1qykLr-0001ZG-I6; Fri, 03 Nov 2023 02:56:03 +0000
Received: by outflank-mailman (input) for mailman id 627066;
 Fri, 03 Nov 2023 02:56:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qykLq-0001Z5-Df
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:56:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qykLq-0000Ex-Cb
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:56:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qykLq-0006eC-BY
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:56:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tswbWNGTcJiKmXOnbraIoxbGGuahtCN2C08OSZYSudQ=; b=i7TC/R7/kMny5Pw5ra42pY/ExB
	2JeeuiFpG0648Dp9HWKfcI8mO8UMVJkj/iRY1oOdrYg+movL0cxCUkxqQI4mqIzkral4QLYHgjGqk
	0ArMxfNPmLY+YFeS2ASkTNf4HhS3ZkFZjSIsFCvofVLG/sxOqdm5jGqGYBMACW+lGnBE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: introduce identity mapping
Message-Id: <E1qykLq-0006eC-BY@xenbits.xenproject.org>
Date: Fri, 03 Nov 2023 02:56:02 +0000

commit fe0ae3f7dd7013ccac3df3bc3222194a551852e0
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu Nov 2 10:49:37 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 2 10:49:37 2023 +0100

    xen/riscv: introduce identity mapping
    
    The way how switch to virtual address was implemented in the
    commit e66003e7be ("xen/riscv: introduce setup_initial_pages")
    isn't safe enough as:
    * enable_mmu() depends on hooking all exceptions
      and pagefault.
    * Any exception other than pagefault, or not taking a pagefault
      causes it to malfunction, which means you will fail to boot
      depending on where Xen was loaded into memory.
    
    Instead of the proposed way of switching to virtual addresses was
    decided to use identity mapping for area which constains needed code
    to switch from identity mapping and after switching to virtual addresses,
    identity mapping is removed from page-tables in the following way:
    search for top-most page table entry and remove it.
    
    Fixes: e66003e7be ("xen/riscv: introduce setup_initial_pages")
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/acpi.h   |  6 +++
 xen/arch/riscv/include/asm/config.h |  2 +
 xen/arch/riscv/include/asm/mm.h     |  5 ++-
 xen/arch/riscv/mm.c                 | 90 ++++++++++++++++++++-----------------
 xen/arch/riscv/riscv64/head.S       | 30 +++++++++++++
 xen/arch/riscv/setup.c              | 14 +-----
 xen/arch/riscv/xen.lds.S            | 11 +++++
 7 files changed, 103 insertions(+), 55 deletions(-)

diff --git a/xen/arch/riscv/include/asm/acpi.h b/xen/arch/riscv/include/asm/acpi.h
new file mode 100644
index 0000000000..3aef993d81
--- /dev/null
+++ b/xen/arch/riscv/include/asm/acpi.h
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef __ASM_RISCV_ACPI_H
+#define __ASM_RISCV_ACPI_H
+
+#endif /* __ASM_RISCV_ACPI_H */
diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/asm/config.h
index fa90ae0898..f0544c6a20 100644
--- a/xen/arch/riscv/include/asm/config.h
+++ b/xen/arch/riscv/include/asm/config.h
@@ -95,6 +95,8 @@
 #define RV_STAGE1_MODE SATP_MODE_SV32
 #endif
 
+#define IDENT_AREA_SIZE 64
+
 #endif /* __RISCV_CONFIG_H__ */
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index 7b94cbadd7..07c7a0abba 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -13,8 +13,11 @@ extern unsigned char cpu0_boot_stack[];
 void setup_initial_pagetables(void);
 
 void enable_mmu(void);
-void cont_after_mmu_is_enabled(void);
+
+void remove_identity_mapping(void);
 
 unsigned long calc_phys_offset(void);
 
+void turn_on_mmu(unsigned long ra);
+
 #endif /* _ASM_RISCV_MM_H */
diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
index a73f135a3c..053f043a3d 100644
--- a/xen/arch/riscv/mm.c
+++ b/xen/arch/riscv/mm.c
@@ -4,6 +4,7 @@
 #include <xen/compiler.h>
 #include <xen/init.h>
 #include <xen/kernel.h>
+#include <xen/macros.h>
 #include <xen/pfn.h>
 
 #include <asm/early_printk.h>
@@ -35,8 +36,11 @@ static unsigned long __ro_after_init phys_offset;
  *
  * It might be needed one more page table in case when Xen load address
  * isn't 2 MB aligned.
+ *
+ * CONFIG_PAGING_LEVELS page tables are needed for the identity mapping,
+ * except that the root page table is shared with the initial mapping
  */
-#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) + 1)
+#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) * 2 + 1)
 
 pte_t __section(".bss.page_aligned") __aligned(PAGE_SIZE)
 stage1_pgtbl_root[PAGETABLE_ENTRIES];
@@ -75,6 +79,7 @@ static void __init setup_initial_mapping(struct mmu_desc *mmu_desc,
     unsigned int index;
     pte_t *pgtbl;
     unsigned long page_addr;
+    bool is_identity_mapping = map_start == pa_start;
 
     if ( (unsigned long)_start % XEN_PT_LEVEL_SIZE(0) )
     {
@@ -108,16 +113,18 @@ static void __init setup_initial_mapping(struct mmu_desc *mmu_desc,
             {
                 unsigned long paddr = (page_addr - map_start) + pa_start;
                 unsigned int permissions = PTE_LEAF_DEFAULT;
+                unsigned long addr = is_identity_mapping
+                                     ? page_addr : LINK_TO_LOAD(page_addr);
                 pte_t pte_to_be_written;
 
                 index = pt_index(0, page_addr);
 
-                if ( is_kernel_text(LINK_TO_LOAD(page_addr)) ||
-                     is_kernel_inittext(LINK_TO_LOAD(page_addr)) )
-                    permissions =
-                        PTE_EXECUTABLE | PTE_READABLE | PTE_VALID;
+                if ( is_kernel_text(addr) ||
+                     is_kernel_inittext(addr) )
+                        permissions =
+                            PTE_EXECUTABLE | PTE_READABLE | PTE_VALID;
 
-                if ( is_kernel_rodata(LINK_TO_LOAD(page_addr)) )
+                if ( is_kernel_rodata(addr) )
                     permissions = PTE_READABLE | PTE_VALID;
 
                 pte_to_be_written = paddr_to_pte(paddr, permissions);
@@ -211,6 +218,13 @@ void __init setup_initial_pagetables(void)
     unsigned long linker_start  = LOAD_TO_LINK(load_start);
     unsigned long linker_end    = LOAD_TO_LINK(load_end);
 
+    unsigned long ident_start;
+    unsigned long ident_end;
+
+    /*
+     * If the overlapping check will be removed then remove_identity_mapping()
+     * logic should be updated.
+     */
     if ( (linker_start != load_start) &&
          (linker_start <= load_end) && (load_start <= linker_end) )
     {
@@ -232,48 +246,40 @@ void __init setup_initial_pagetables(void)
                           linker_start,
                           linker_end,
                           load_start);
+
+    if ( linker_start == load_start )
+        return;
+
+    ident_start = (unsigned long)turn_on_mmu & XEN_PT_LEVEL_MAP_MASK(0);
+    ident_end = ident_start + PAGE_SIZE;
+
+    setup_initial_mapping(&mmu_desc,
+                          ident_start,
+                          ident_end,
+                          ident_start);
 }
 
-void __init noreturn noinline enable_mmu()
+void __init remove_identity_mapping(void)
 {
-    /*
-     * Calculate a linker time address of the mmu_is_enabled
-     * label and update CSR_STVEC with it.
-     * MMU is configured in a way where linker addresses are mapped
-     * on load addresses so in a case when linker addresses are not equal
-     * to load addresses, after MMU is enabled, it will cause
-     * an exception and jump to linker time addresses.
-     * Otherwise if load addresses are equal to linker addresses the code
-     * after mmu_is_enabled label will be executed without exception.
-     */
-    csr_write(CSR_STVEC, LOAD_TO_LINK((unsigned long)&&mmu_is_enabled));
-
-    /* Ensure page table writes precede loading the SATP */
-    sfence_vma();
+    unsigned int i;
+    pte_t *pgtbl;
+    unsigned int index, xen_index;
+    unsigned long ident_start =
+        LINK_TO_LOAD(turn_on_mmu) & XEN_PT_LEVEL_MAP_MASK(0);
 
-    /* Enable the MMU and load the new pagetable for Xen */
-    csr_write(CSR_SATP,
-              PFN_DOWN((unsigned long)stage1_pgtbl_root) |
-              RV_STAGE1_MODE << SATP_MODE_SHIFT);
+    for ( pgtbl = stage1_pgtbl_root, i = CONFIG_PAGING_LEVELS; i; i-- )
+    {
+        index = pt_index(i - 1, ident_start);
+        xen_index = pt_index(i - 1, XEN_VIRT_START);
 
-    asm volatile ( ".p2align 2" );
- mmu_is_enabled:
-    /*
-     * Stack should be re-inited as:
-     * 1. Right now an address of the stack is relative to load time
-     *    addresses what will cause an issue in case of load start address
-     *    isn't equal to linker start address.
-     * 2. Addresses in stack are all load time relative which can be an
-     *    issue in case when load start address isn't equal to linker
-     *    start address.
-     *
-     * We can't return to the caller because the stack was reseted
-     * and it may have stash some variable on the stack.
-     * Jump to a brand new function as the stack was reseted
-     */
+        if ( index != xen_index )
+        {
+            pgtbl[index].pte = 0;
+            break;
+        }
 
-    switch_stack_and_jump((unsigned long)cpu0_boot_stack + STACK_SIZE,
-                          cont_after_mmu_is_enabled);
+        pgtbl = (pte_t *)LOAD_TO_LINK(pte_to_paddr(pgtbl[index]));
+    }
 }
 
 /*
diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S
index ae194bb099..b6ce2894ab 100644
--- a/xen/arch/riscv/riscv64/head.S
+++ b/xen/arch/riscv/riscv64/head.S
@@ -39,6 +39,22 @@ ENTRY(start)
         jal     calc_phys_offset
         mv      s2, a0
 
+        jal     setup_initial_pagetables
+
+        /* Calculate proper VA after jump from 1:1 mapping */
+        la      a0, .L_primary_switched
+        sub     a0, a0, s2
+
+        jal     turn_on_mmu
+
+.L_primary_switched:
+        /*
+         * cpu0_boot_stack address is 1:1 mapping related so it should be
+         * recalculated after jump from 1:1 mapping world as 1:1 mapping
+         * will be removed soon in start_xen().
+         */
+        jal     reset_stack
+
         /* restore hart_id ( bootcpu_id ) and dtb address */
         mv      a0, s0
         mv      a1, s1
@@ -54,3 +70,17 @@ ENTRY(reset_stack)
 
         ret
 
+        .section .text.ident, "ax", %progbits
+
+ENTRY(turn_on_mmu)
+        sfence.vma
+
+        li      t0, RV_STAGE1_MODE
+        slli    t0, t0, SATP_MODE_SHIFT
+
+        la      t1, stage1_pgtbl_root
+        srli    t1, t1, PAGE_SHIFT
+        or      t1, t1, t0
+        csrw    CSR_SATP, t1
+
+        jr      a0
diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index dde8fb898b..6593f601c1 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -13,20 +13,10 @@ unsigned char __initdata cpu0_boot_stack[STACK_SIZE]
 void __init noreturn start_xen(unsigned long bootcpu_id,
                                paddr_t dtb_addr)
 {
-    early_printk("Hello from C env\n");
-
-    setup_initial_pagetables();
-
-    enable_mmu();
-
-    for ( ;; )
-        asm volatile ("wfi");
+    remove_identity_mapping();
 
-    unreachable();
-}
+    early_printk("Hello from C env\n");
 
-void __init noreturn cont_after_mmu_is_enabled(void)
-{
     early_printk("All set up\n");
 
     for ( ;; )
diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S
index 9064852173..3fa7db3bf9 100644
--- a/xen/arch/riscv/xen.lds.S
+++ b/xen/arch/riscv/xen.lds.S
@@ -31,6 +31,11 @@ SECTIONS
         *(.text.*)
 #endif
 
+        . = ALIGN(IDENT_AREA_SIZE);
+        _ident_start = .;
+        *(.text.ident)
+        _ident_end = .;
+
         *(.fixup)
         *(.gnu.warning)
         . = ALIGN(POINTER_ALIGN);
@@ -173,4 +178,10 @@ ASSERT(IS_ALIGNED(__bss_end,        POINTER_ALIGN), "__bss_end is misaligned")
 ASSERT(!SIZEOF(.got),      ".got non-empty")
 ASSERT(!SIZEOF(.got.plt),  ".got.plt non-empty")
 
+/*
+ * Changing the size of Xen binary can require an update of
+ * PGTBL_INITIAL_COUNT.
+ */
 ASSERT(_end - _start <= MB(2), "Xen too large for early-boot assumptions")
+
+ASSERT(_ident_end - _ident_start <= IDENT_AREA_SIZE, "identity region is too big");
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 03 02:56:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Nov 2023 02:56:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627067.977952 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qykM1-0001cW-O8; Fri, 03 Nov 2023 02:56:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627067.977952; Fri, 03 Nov 2023 02:56: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 1qykM1-0001cO-L4; Fri, 03 Nov 2023 02:56:13 +0000
Received: by outflank-mailman (input) for mailman id 627067;
 Fri, 03 Nov 2023 02:56: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 1qykM0-0001c8-G4
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:56:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qykM0-0000F5-FT
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:56:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qykM0-0006ed-Em
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:56:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rd1mR+4bK5XLeifxB0mvaw9gNYDbYdVQuiNSotaHv7o=; b=hrRavMmAW4vDO6vXr/xm7TSbtD
	m89G3gNNZQ9crjeowTIE2ZhqjzgbVRbQJQdq1AeGiONwUiL4LtaYAu7gqIv3MoVkJqZumwDAMYRq6
	o16ZMaWqt+FpZ/yIptJiu7ztwfD16tJeysDYZSbTGbW/4DpW+25HyRZCaZcXi3dNyQ74=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/x2apic: remove usage of ACPI_FADT_APIC_CLUSTER
Message-Id: <E1qykM0-0006ed-Em@xenbits.xenproject.org>
Date: Fri, 03 Nov 2023 02:56:12 +0000

commit 26a449ce32cef33f2cb50602be19fcc0c4223ba9
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Thu Nov 2 10:50:26 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 2 10:50:26 2023 +0100

    x86/x2apic: remove usage of ACPI_FADT_APIC_CLUSTER
    
    The ACPI FADT APIC_CLUSTER flag mandates that when the interrupt delivery is
    Logical mode APIC must be configured for Cluster destination model.  However in
    apic_x2apic_probe() such flag is incorrectly used to gate whether Physical mode
    can be used.
    
    Since Xen when in x2APIC mode only uses Logical mode together with Cluster
    model completely remove checking for ACPI_FADT_APIC_CLUSTER, as Xen always
    fulfills the requirement signaled by the flag.
    
    Fixes: eb40ae41b658 ('x86/Kconfig: add option for default x2APIC destination mode')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/genapic/x2apic.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c
index ca1db27157..707deef98c 100644
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -231,8 +231,7 @@ const struct genapic *__init apic_x2apic_probe(void)
          */
         x2apic_phys = iommu_intremap != iommu_intremap_full ||
                       (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL) ||
-                      (IS_ENABLED(CONFIG_X2APIC_PHYSICAL) &&
-                       !(acpi_gbl_FADT.flags & ACPI_FADT_APIC_CLUSTER));
+                      IS_ENABLED(CONFIG_X2APIC_PHYSICAL);
     }
     else if ( !x2apic_phys )
         switch ( iommu_intremap )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 03 02:56:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Nov 2023 02:56:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627068.977955 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qykMB-0001fZ-P8; Fri, 03 Nov 2023 02:56:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627068.977955; Fri, 03 Nov 2023 02:56: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 1qykMB-0001fR-MW; Fri, 03 Nov 2023 02:56:23 +0000
Received: by outflank-mailman (input) for mailman id 627068;
 Fri, 03 Nov 2023 02:56: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 1qykMA-0001fC-JC
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:56: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 1qykMA-0000FC-IS
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:56:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qykMA-0006f4-Hg
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:56:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kXmrcSb7U3rGkXw0MD510WuH2w+QF4CzrTh1zDqjJH4=; b=Qg025xigtWbD0uFc7uD2HJKwRx
	hZqRzxKYrUVZOjVGFLCH3iZradHLw83xw/+UoADyK2euMcAKdspEA9Aj94gSOFCEbAAMNVHL4OHc5
	+5WAAJjrmTuQitVFhyA4DPwGfRVNquOJR8Zphi1XZMGnA1cQNektgrB22juQkrfuuuDc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/i8259: do not assume interrupts always target CPU0
Message-Id: <E1qykMA-0006f4-Hg@xenbits.xenproject.org>
Date: Fri, 03 Nov 2023 02:56:22 +0000

commit 87f37449d586b4d407b75235bb0a171e018e25ec
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Thu Nov 2 10:50:59 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 2 10:50:59 2023 +0100

    x86/i8259: do not assume interrupts always target CPU0
    
    Sporadically we have seen the following during AP bringup on AMD platforms
    only:
    
    microcode: CPU59 updated from revision 0x830107a to 0x830107a, date = 2023-05-17
    microcode: CPU60 updated from revision 0x830104d to 0x830107a, date = 2023-05-17
    CPU60: No irq handler for vector 27 (IRQ -2147483648)
    microcode: CPU61 updated from revision 0x830107a to 0x830107a, date = 2023-05-17
    
    This is similar to the issue raised on Linux commit 36e9e1eab777e, where they
    observed i8259 (active) vectors getting delivered to CPUs different than 0.
    
    On AMD or Hygon platforms adjust the target CPU mask of i8259 interrupt
    descriptors to contain all possible CPUs, so that APs will reserve the vector
    at startup if any legacy IRQ is still delivered through the i8259.  Note that
    if the IO-APIC takes over those interrupt descriptors the CPU mask will be
    reset.
    
    Spurious i8259 interrupt vectors however (IRQ7 and IRQ15) can be injected even
    when all i8259 pins are masked, and hence would need to be handled on all CPUs.
    
    Continue to reserve PIC vectors on CPU0 only, but do check for such spurious
    interrupts on all CPUs if the vendor is AMD or Hygon.  Note that once the
    vectors get used by devices detecting PIC spurious interrupts will no longer be
    possible, however the device driver should be able to cope with spurious
    interrupts.  Such PIC spurious interrupts occurring when the vector is in use
    by a local APIC routed source will lead to an extra EOI, which might
    unintentionally clear a different vector from ISR.  Note this is already the
    current behavior, so assume it's infrequent enough to not cause real issues.
    
    Finally, adjust the printed message to display the CPU where the spurious
    interrupt has been received, so it looks like:
    
    microcode: CPU1 updated from revision 0x830107a to 0x830107a, date = 2023-05-17
    cpu1: spurious 8259A interrupt: IRQ7
    microcode: CPU2 updated from revision 0x830104d to 0x830107a, date = 2023-05-17
    
    Amends: 3fba06ba9f8b ('x86/IRQ: re-use legacy vector ranges on APs')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/i8259.c | 21 +++++++++++++++++++--
 xen/arch/x86/irq.c   | 11 ++++++++++-
 2 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/i8259.c b/xen/arch/x86/i8259.c
index ed9f55abe5..e0fa1f96b4 100644
--- a/xen/arch/x86/i8259.c
+++ b/xen/arch/x86/i8259.c
@@ -222,7 +222,8 @@ static bool _mask_and_ack_8259A_irq(unsigned int irq)
         is_real_irq = false;
         /* Report spurious IRQ, once per IRQ line. */
         if (!(spurious_irq_mask & irqmask)) {
-            printk("spurious 8259A interrupt: IRQ%d.\n", irq);
+            printk("cpu%u: spurious 8259A interrupt: IRQ%u\n",
+                   smp_processor_id(), irq);
             spurious_irq_mask |= irqmask;
         }
         /*
@@ -349,7 +350,23 @@ void __init init_IRQ(void)
             continue;
         desc->handler = &i8259A_irq_type;
         per_cpu(vector_irq, cpu)[LEGACY_VECTOR(irq)] = irq;
-        cpumask_copy(desc->arch.cpu_mask, cpumask_of(cpu));
+
+        /*
+         * The interrupt affinity logic never targets interrupts to offline
+         * CPUs, hence it's safe to use cpumask_all here.
+         *
+         * Legacy PIC interrupts are only targeted to CPU0, but depending on
+         * the platform they can be distributed to any online CPU in hardware.
+         * Note this behavior has only been observed on AMD hardware. In order
+         * to cope install all active legacy vectors on all CPUs.
+         *
+         * IO-APIC will change the destination mask if/when taking ownership of
+         * the interrupt.
+         */
+        cpumask_copy(desc->arch.cpu_mask,
+                     (boot_cpu_data.x86_vendor &
+                      (X86_VENDOR_AMD | X86_VENDOR_HYGON) ? &cpumask_all
+                                                          : cpumask_of(cpu)));
         desc->arch.vector = LEGACY_VECTOR(irq);
     }
     
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index f42ad539dc..16d9fceba1 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1920,7 +1920,16 @@ void do_IRQ(struct cpu_user_regs *regs)
                 kind = "";
             if ( !(vector >= FIRST_LEGACY_VECTOR &&
                    vector <= LAST_LEGACY_VECTOR &&
-                   !smp_processor_id() &&
+                   (!smp_processor_id() ||
+                    /*
+                     * For AMD/Hygon do spurious PIC interrupt
+                     * detection on all CPUs, as it has been observed
+                     * that during unknown circumstances spurious PIC
+                     * interrupts have been delivered to CPUs
+                     * different than the BSP.
+                     */
+                    (boot_cpu_data.x86_vendor & (X86_VENDOR_AMD |
+                                                 X86_VENDOR_HYGON))) &&
                    bogus_8259A_irq(vector - FIRST_LEGACY_VECTOR)) )
             {
                 printk("CPU%u: No irq handler for vector %02x (IRQ %d%s)\n",
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 03 02:56:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Nov 2023 02:56:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627069.977961 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qykML-0001ho-RZ; Fri, 03 Nov 2023 02:56:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627069.977961; Fri, 03 Nov 2023 02:56: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 1qykML-0001hg-OE; Fri, 03 Nov 2023 02:56:33 +0000
Received: by outflank-mailman (input) for mailman id 627069;
 Fri, 03 Nov 2023 02:56: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 1qykMK-0001hZ-Ma
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:56: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 1qykMK-0000FO-LS
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:56:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qykMK-0006fW-KZ
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:56:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GOB3jQAXtj6qraNd734eWLDpqaZp16ZP72o3rNNXuS4=; b=4zU3c/3Uiy8OEVq0j1FYsYf3eT
	GH8NMdVGaTeB8gAHk5GDUaB69xs7eBPNC/n02QUey6lVDApa6t9G6xLqURQ8nZpP44gnWmd650azR
	XvHksAcBzZAQQSKEQPbhZvNzfJl6fHl5A8IqW6qyvWEhZc6NLNPISrEvRSp8d2Xan6/I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/ppc: Add .text.exceptions section for exception vectors
Message-Id: <E1qykMK-0006fW-KZ@xenbits.xenproject.org>
Date: Fri, 03 Nov 2023 02:56:32 +0000

commit abb8a88d592db4b38561ce7e6e6af87c06b38e5f
Author:     Shawn Anastasio <sanastasio@raptorengineering.com>
AuthorDate: Thu Nov 2 10:51:31 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 2 10:51:31 2023 +0100

    xen/ppc: Add .text.exceptions section for exception vectors
    
    On Power, the exception vectors must lie at a fixed address, depending
    on the state of the Alternate Interrupt Location (AIL) field of the
    Logical Partition Control Register (LPCR). Create a .text.exceptions
    section in the linker script at an address suitable for AIL=3 plus an
    accompanying assertion to pave the way for implementing exception
    support.
    
    Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/ppc/include/asm/config.h | 3 +++
 xen/arch/ppc/xen.lds.S            | 7 +++++++
 2 files changed, 10 insertions(+)

diff --git a/xen/arch/ppc/include/asm/config.h b/xen/arch/ppc/include/asm/config.h
index a11a09c570..e012b75beb 100644
--- a/xen/arch/ppc/include/asm/config.h
+++ b/xen/arch/ppc/include/asm/config.h
@@ -42,6 +42,9 @@
 
 #define XEN_VIRT_START _AC(0xc000000000000000, UL)
 
+/* Fixed address for start of the section containing exception vectors */
+#define EXCEPTION_VECTORS_START _AC(0xc000000000000100, UL)
+
 #define VMAP_VIRT_START (XEN_VIRT_START + GB(1))
 #define VMAP_VIRT_SIZE  GB(1)
 
diff --git a/xen/arch/ppc/xen.lds.S b/xen/arch/ppc/xen.lds.S
index 9e46035155..3697d656f4 100644
--- a/xen/arch/ppc/xen.lds.S
+++ b/xen/arch/ppc/xen.lds.S
@@ -24,6 +24,10 @@ SECTIONS
         _stext = .;            /* Text section */
         *(.text.header)
 
+        . = ALIGN(256);
+        HIDDEN(_stext_exceptions = .);
+        *(.text.exceptions)
+
         *(.text.cold)
         *(.text.unlikely .text.*_unlikely .text.unlikely.*)
 
@@ -184,3 +188,6 @@ ASSERT(IS_ALIGNED(__bss_end,        POINTER_ALIGN), "__bss_end is misaligned")
 
 ASSERT(!SIZEOF(.got),      ".got non-empty")
 ASSERT(!SIZEOF(.got.plt),  ".got.plt non-empty")
+
+ASSERT(_stext_exceptions == EXCEPTION_VECTORS_START,
+       ".text.exceptions not at expected location -- .text.header too big?");
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 03 02:56:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Nov 2023 02:56:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627070.977963 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qykMV-0001l8-SI; Fri, 03 Nov 2023 02:56:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627070.977963; Fri, 03 Nov 2023 02:56: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 1qykMV-0001l0-Pi; Fri, 03 Nov 2023 02:56:43 +0000
Received: by outflank-mailman (input) for mailman id 627070;
 Fri, 03 Nov 2023 02:56: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 1qykMU-0001kc-P0
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:56: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 1qykMU-0000FV-OH
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:56:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qykMU-0006fv-NY
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 02:56:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xWTK/3YzT1P1x0VHukF3f6nmUbHfr+gR5ZcPxDFwpz4=; b=WjhVGCONFlb52JSjSyoQErcbox
	IUBWqJnJSC96/++Jure+eNl8rRBj00qSOd7FsdpVFpX53VfMT0TF/OUyUBkOwM97K392IF2cD43UR
	wdBrl7Hll5vshgBWYGBnzGJNtd7Kzt2Di9HoSRyXROL2iVr3GQ/eZYkUdfPOCcBTGuko=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/ppc: Implement a basic exception handler
Message-Id: <E1qykMU-0006fv-NY@xenbits.xenproject.org>
Date: Fri, 03 Nov 2023 02:56:42 +0000

commit 649c190a1feafdb54440bebbcac58abc90fa335b
Author:     Shawn Anastasio <sanastasio@raptorengineering.com>
AuthorDate: Thu Nov 2 10:52:31 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 2 10:52:31 2023 +0100

    xen/ppc: Implement a basic exception handler
    
    Implement a basic exception handler that dumps the CPU state to the
    console, as well as the code required to set the correct exception
    vector table's base address in setup.c.
    
    Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/ppc/include/asm/processor.h |  31 ++++++++
 xen/arch/ppc/ppc64/Makefile          |   2 +
 xen/arch/ppc/ppc64/asm-offsets.c     |   1 +
 xen/arch/ppc/ppc64/exceptions-asm.S  | 138 +++++++++++++++++++++++++++++++++++
 xen/arch/ppc/ppc64/exceptions.c      | 102 ++++++++++++++++++++++++++
 xen/arch/ppc/setup.c                 |  11 +++
 6 files changed, 285 insertions(+)

diff --git a/xen/arch/ppc/include/asm/processor.h b/xen/arch/ppc/include/asm/processor.h
index d3dd943c20..a01b62b8a4 100644
--- a/xen/arch/ppc/include/asm/processor.h
+++ b/xen/arch/ppc/include/asm/processor.h
@@ -103,6 +103,37 @@
 #define PVR_BE        0x0070
 #define PVR_PA6T      0x0090
 
+/* Exception Definitions */
+#define EXC_SYSTEM_RESET    0x0100 /* System Reset Interrupt */
+#define EXC_MACHINE_CHECK   0x0200 /* Machine Check Interrupt */
+#define EXC_DATA_STORAGE    0x0300 /* Data Storage Interrupt */
+#define EXC_DATA_SEGMENT    0x0380 /* Data Segment Interrupt */
+#define EXC_INSN_STORAGE    0x0400 /* Instruction Storage Interrupt */
+#define EXC_INSN_SEGMENT    0x0480 /* Instruction Segment Interrupt */
+#define EXC_EXTERNAL        0x0500 /* External Interrupt */
+#define EXC_ALIGNMENT       0x0600 /* Alignment Interrupt */
+#define EXC_PROGRAM         0x0700 /* Program Interrupt */
+#define EXC_FPU_UNAVAIL     0x0800 /* Floating-Point Unavailable Interrupt */
+#define EXC_DECREMENTER     0x0900 /* Decrementer Interrupt */
+#define EXC_H_DECREMENTER   0x0980 /* Hypervisor Decrementer Interrupt */
+#define EXC_PRIV_DOORBELL   0x0A00 /* Directed Privileged Doorbell Interrupt */
+#define EXC_SYSTEM_CALL     0x0C00 /* System Call Interrupt */
+#define EXC_TRACE           0x0D00 /* Trace Interrupt */
+#define EXC_H_DATA_STORAGE  0x0E00 /* Hypervisor Data Storage Interrupt */
+#define EXC_H_INSN_STORAGE  0x0E20 /* Hypervisor Instruction Storage Interrupt */
+#define EXC_H_EMUL_ASST     0x0E40 /* Hypervisor Emulation Assistance Interrupt */
+#define EXC_H_MAINTENANCE   0x0E60 /* Hypervisor Maintenance Interrupt */
+#define EXC_H_DOORBELL      0x0E80 /* Directed Hypervisor Doorbell Interrupt */
+#define EXC_H_VIRT          0x0EA0 /* Hypervisor Virtualization Interrupt */
+#define EXC_PERF_MON        0x0F00 /* Performance Monitor Interrupt */
+#define EXC_VECTOR_UNAVAIL  0x0F20 /* Vector Unavailable Interrupt */
+#define EXC_VSX_UNAVAIL     0x0F40 /* VSX Unavailable Interrupt */
+#define EXC_FACIL_UNAVAIL   0x0F60 /* Facility Unavailable Interrupt */
+#define EXC_H_FACIL_UNAVAIL 0x0F80 /* Hypervisor Facility Unavailable Interrupt */
+
+/* Base address of interrupt vector table when LPCR[AIL]=3 */
+#define AIL_VECTOR_BASE _AC(0xc000000000004000, UL)
+
 #ifndef __ASSEMBLY__
 
 #include <xen/types.h>
diff --git a/xen/arch/ppc/ppc64/Makefile b/xen/arch/ppc/ppc64/Makefile
index 5b88355bb2..914bb21c40 100644
--- a/xen/arch/ppc/ppc64/Makefile
+++ b/xen/arch/ppc/ppc64/Makefile
@@ -1,2 +1,4 @@
+obj-y += exceptions.o
+obj-y += exceptions-asm.o
 obj-y += head.o
 obj-y += opal-calls.o
diff --git a/xen/arch/ppc/ppc64/asm-offsets.c b/xen/arch/ppc/ppc64/asm-offsets.c
index c15c1bf136..634d7260e3 100644
--- a/xen/arch/ppc/ppc64/asm-offsets.c
+++ b/xen/arch/ppc/ppc64/asm-offsets.c
@@ -46,6 +46,7 @@ void __dummy__(void)
     OFFSET(UREGS_dsisr, struct cpu_user_regs, dsisr);
     OFFSET(UREGS_cr, struct cpu_user_regs, cr);
     OFFSET(UREGS_fpscr, struct cpu_user_regs, fpscr);
+    OFFSET(UREGS_entry_vector, struct cpu_user_regs, entry_vector);
     DEFINE(UREGS_sizeof, sizeof(struct cpu_user_regs));
 
     OFFSET(OPAL_base, struct opal, base);
diff --git a/xen/arch/ppc/ppc64/exceptions-asm.S b/xen/arch/ppc/ppc64/exceptions-asm.S
new file mode 100644
index 0000000000..fa5f45add8
--- /dev/null
+++ b/xen/arch/ppc/ppc64/exceptions-asm.S
@@ -0,0 +1,138 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <asm/asm-defns.h>
+#include <asm/processor.h>
+
+    .section .text.exceptions, "ax", %progbits
+
+    /* Helper to dump CPU state to struct cpu_user_regs pointed to by r1. */
+ENTRY(exception_common)
+    /*
+     * Save GPRs 1-31. TODO: The value of %r1 has already been modified by the
+     * ISR, so the value we save isn't the exact value we had on entry.
+     */
+    SAVE_GPRS(1, 31, %r1)
+
+    /* Save LR, CTR, CR */
+    mflr    %r0
+    std     %r0, UREGS_lr(%r1)
+    mfctr   %r0
+    std     %r0, UREGS_ctr(%r1)
+    mfcr    %r0
+    stw     %r0, UREGS_cr(%r1) /* 32-bit */
+
+    /* Save Exception Registers */
+    mfsrr0  %r0
+    std     %r0, UREGS_pc(%r1)
+    mfsrr1  %r0
+    std     %r0, UREGS_msr(%r1)
+    mfdsisr %r0
+    stw     %r0, UREGS_dsisr(%r1) /* 32-bit */
+    mfdar   %r0
+    std     %r0, UREGS_dar(%r1)
+    li      %r0, -1 /* OS's SRR0/SRR1 have been clobbered */
+    std     %r0, UREGS_srr0(%r1)
+    std     %r0, UREGS_srr1(%r1)
+
+    /* Setup TOC and a stack frame then call C exception handler */
+    mr      %r3, %r1
+    bcl     20, 31, 1f
+1:  mflr    %r12
+    addis   %r2, %r12, .TOC.-1b@ha
+    addi    %r2, %r2, .TOC.-1b@l
+
+    li      %r0, 0
+    stdu    %r0, -STACK_FRAME_OVERHEAD(%r1)
+    bl      exception_handler
+
+    .size exception_common, . - exception_common
+    .type exception_common, %function
+
+    /* Same as exception_common, but for exceptions that set HSRR{0,1} */
+ENTRY(h_exception_common)
+    /*
+     * Save GPRs 1-31. TODO: The value of %r1 has already been modified by the
+     * ISR, so the value we save isn't the exact value we had on entry.
+     */
+    SAVE_GPRS(1, 31, %r1)
+
+    /* Save LR, CTR, CR */
+    mflr    %r0
+    std     %r0, UREGS_lr(%r1)
+    mfctr   %r0
+    std     %r0, UREGS_ctr(%r1)
+    mfcr    %r0
+    stw     %r0, UREGS_cr(%r1) /* 32-bit */
+
+    /* Save Exception Registers */
+    mfhsrr0 %r0
+    std     %r0, UREGS_pc(%r1)
+    mfhsrr1 %r0
+    std     %r0, UREGS_msr(%r1)
+    mfsrr0  %r0
+    std     %r0, UREGS_srr0(%r1)
+    mfsrr1  %r0
+    std     %r0, UREGS_srr1(%r1)
+    mfdsisr %r0
+    stw     %r0, UREGS_dsisr(%r1) /* 32-bit */
+    mfdar   %r0
+    std     %r0, UREGS_dar(%r1)
+
+    /* Setup TOC and a stack frame then call C exception handler */
+    mr      %r3, %r1
+    bcl     20, 31, 1f
+1:  mflr    %r12
+    addis   %r2, %r12, .TOC.-1b@ha
+    addi    %r2, %r2, .TOC.-1b@l
+
+    li      %r0, 0
+    stdu    %r0, -STACK_FRAME_OVERHEAD(%r1)
+    bl      exception_handler
+
+    .size h_exception_common, . - h_exception_common
+    .type h_exception_common, %function
+
+/*
+ * Declare an ISR for the provided exception that jumps to the specified handler
+ */
+.macro ISR name, exc, handler
+    . = (AIL_VECTOR_BASE - EXCEPTION_VECTORS_START) + \exc
+    ENTRY(\name)
+    /* TODO: switch stack */
+
+    /* Reserve space for struct cpu_user_regs */
+    subi    %r1, %r1, UREGS_sizeof
+
+    /* Save r0 immediately so we can use it as scratch space */
+    SAVE_GPR(0, %r1)
+
+    /* Save exception vector number */
+    li      %r0, \exc
+    std     %r0, UREGS_entry_vector(%r1)
+
+    /* Branch to common code */
+    b       \handler
+
+    .size \name, . - \name
+    .type \name, %function
+.endm
+
+/*
+ * Define all ISRs. Note: These must be declared in order from lowest exception
+ * vector to highest to satisfy the assembler.
+ */
+ISR exc_sysreset,   EXC_SYSTEM_RESET,   exception_common
+ISR exc_mcheck,     EXC_MACHINE_CHECK,  exception_common
+ISR exc_dstore,     EXC_DATA_STORAGE,   exception_common
+ISR exc_dsegment,   EXC_DATA_SEGMENT,   exception_common
+ISR exc_istore,     EXC_INSN_STORAGE,   exception_common
+ISR exc_isegment,   EXC_INSN_SEGMENT,   exception_common
+ISR exc_extern,     EXC_EXTERNAL,       exception_common
+ISR exc_align,      EXC_ALIGNMENT,      exception_common
+ISR exc_program,    EXC_PROGRAM,        exception_common
+ISR exc_fpu,        EXC_FPU_UNAVAIL,    exception_common
+ISR exc_dec,        EXC_DECREMENTER,    exception_common
+ISR exc_h_dec,      EXC_H_DECREMENTER,  h_exception_common
+/* EXC_PRIV_DOORBELL ... EXC_TRACE */
+ISR exc_h_dstore,   EXC_H_DATA_STORAGE, h_exception_common
+ISR exc_h_istore,   EXC_H_INSN_STORAGE, h_exception_common
diff --git a/xen/arch/ppc/ppc64/exceptions.c b/xen/arch/ppc/ppc64/exceptions.c
new file mode 100644
index 0000000000..c6a11c8639
--- /dev/null
+++ b/xen/arch/ppc/ppc64/exceptions.c
@@ -0,0 +1,102 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#include <xen/lib.h>
+
+#include <asm/processor.h>
+
+static const char *exception_name_from_vec(uint32_t vec)
+{
+    switch ( vec )
+    {
+    case EXC_SYSTEM_RESET:
+        return "System Reset";
+    case EXC_MACHINE_CHECK:
+        return "Machine Check";
+    case EXC_DATA_STORAGE:
+        return "Data Storage";
+    case EXC_DATA_SEGMENT:
+        return "Data Segment";
+    case EXC_INSN_STORAGE:
+        return "Instruction Storage";
+    case EXC_INSN_SEGMENT:
+        return "Instruction Segment";
+    case EXC_EXTERNAL:
+        return "External";
+    case EXC_ALIGNMENT:
+        return "Alignment";
+    case EXC_PROGRAM:
+        return "Program";
+    case EXC_FPU_UNAVAIL:
+        return "Floating-Point Unavailable";
+    case EXC_DECREMENTER:
+        return "Decrementer";
+    case EXC_H_DECREMENTER:
+        return "Hypervisor Decrementer";
+    case EXC_PRIV_DOORBELL:
+        return "Directed Privileged Doorbell";
+    case EXC_SYSTEM_CALL:
+        return "System Call";
+    case EXC_TRACE:
+        return "Trace";
+    case EXC_H_DATA_STORAGE:
+        return "Hypervisor Data Storage";
+    case EXC_H_INSN_STORAGE:
+        return "Hypervisor Instruction Storage";
+    case EXC_H_EMUL_ASST:
+        return "Hypervisor Emulation Assistance";
+    case EXC_H_MAINTENANCE:
+        return "Hypervisor Maintenance";
+    case EXC_H_DOORBELL:
+        return "Directed Hypervisor Doorbell";
+    case EXC_H_VIRT:
+        return "Hypervisor Virtualization";
+    case EXC_PERF_MON:
+        return "Performance Monitor";
+    case EXC_VECTOR_UNAVAIL:
+        return "Vector Unavailable";
+    case EXC_VSX_UNAVAIL:
+        return "VSX Unavailable";
+    case EXC_FACIL_UNAVAIL:
+        return "Facility Unavailable";
+    case EXC_H_FACIL_UNAVAIL:
+        return "Hypervisor Facility Unavailable";
+    default:
+        return "(unknown)";
+    }
+}
+
+void exception_handler(struct cpu_user_regs *regs)
+{
+    /* TODO: this is currently only useful for debugging */
+
+    printk("UNRECOVERABLE EXCEPTION: %s (0x%04x)\n\n"
+           "GPR 0-3   : 0x%016lx 0x%016lx 0x%016lx 0x%016lx\n"
+           "GPR 4-7   : 0x%016lx 0x%016lx 0x%016lx 0x%016lx\n"
+           "GPR 8-11  : 0x%016lx 0x%016lx 0x%016lx 0x%016lx\n"
+           "GPR 12-15 : 0x%016lx 0x%016lx 0x%016lx 0x%016lx\n"
+           "GPR 16-19 : 0x%016lx 0x%016lx 0x%016lx 0x%016lx\n"
+           "GPR 20-23 : 0x%016lx 0x%016lx 0x%016lx 0x%016lx\n"
+           "GPR 24-27 : 0x%016lx 0x%016lx 0x%016lx 0x%016lx\n"
+           "GPR 28-31 : 0x%016lx 0x%016lx 0x%016lx 0x%016lx\n\n",
+           exception_name_from_vec(regs->entry_vector), regs->entry_vector,
+           regs->gprs[0], regs->gprs[1], regs->gprs[2], regs->gprs[3],
+           regs->gprs[4], regs->gprs[5], regs->gprs[6], regs->gprs[7],
+           regs->gprs[8], regs->gprs[9], regs->gprs[10], regs->gprs[11],
+           regs->gprs[12], regs->gprs[13], regs->gprs[14], regs->gprs[15],
+           regs->gprs[16], regs->gprs[17], regs->gprs[18], regs->gprs[19],
+           regs->gprs[20], regs->gprs[21], regs->gprs[22], regs->gprs[23],
+           regs->gprs[24], regs->gprs[25], regs->gprs[26], regs->gprs[27],
+           regs->gprs[28], regs->gprs[29], regs->gprs[30], regs->gprs[31]);
+    printk("LR        : 0x%016lx\n"
+           "CTR       : 0x%016lx\n"
+           "CR        : 0x%08x\n"
+           "PC        : 0x%016lx\n"
+           "MSR       : 0x%016lx\n"
+           "SRR0      : 0x%016lx\n"
+           "SRR1      : 0x%016lx\n"
+           "DAR       : 0x%016lx\n"
+           "DSISR     : 0x%08x\n",
+           regs->lr, regs->ctr, regs->cr, regs->pc, regs->msr, regs->srr0,
+           regs->srr1, regs->dar, regs->dsisr);
+
+    die();
+}
diff --git a/xen/arch/ppc/setup.c b/xen/arch/ppc/setup.c
index 959c1454a0..101bdd8bb6 100644
--- a/xen/arch/ppc/setup.c
+++ b/xen/arch/ppc/setup.c
@@ -11,6 +11,15 @@
 /* Xen stack for bringing up the first CPU. */
 unsigned char __initdata cpu0_boot_stack[STACK_SIZE] __aligned(STACK_SIZE);
 
+void setup_exceptions(void)
+{
+    unsigned long lpcr;
+
+    /* Set appropriate interrupt location in LPCR */
+    lpcr = mfspr(SPRN_LPCR);
+    mtspr(SPRN_LPCR, lpcr | LPCR_AIL_3);
+}
+
 void __init noreturn start_xen(unsigned long r3, unsigned long r4,
                                unsigned long r5, unsigned long r6,
                                unsigned long r7)
@@ -26,6 +35,8 @@ void __init noreturn start_xen(unsigned long r3, unsigned long r4,
         boot_opal_init((void *)r3);
     }
 
+    setup_exceptions();
+
     setup_initial_pagetables();
 
     early_printk("Hello, ppc64le!\n");
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 03 06:33:07 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Nov 2023 06:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627084.977988 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qynjq-0004ul-TL; Fri, 03 Nov 2023 06:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627084.977988; Fri, 03 Nov 2023 06:33: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 1qynjq-0004ud-Q9; Fri, 03 Nov 2023 06:33:02 +0000
Received: by outflank-mailman (input) for mailman id 627084;
 Fri, 03 Nov 2023 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 1qynjq-0004uX-2g
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 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 1qynjq-0005yY-1f
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 06:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qynjq-0006sS-0I
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 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=69ASvoTYyL6YynYKm+rzPdbVBqEkO9uU5YxtE7DE5+M=; b=GVo5sE2lxvPaI9Z+lwpOSfwJXB
	l4tiSNN6WkvDnNt8ie2ZduOCbf5o2K16C/1Oovv13UcAjCtif2fFsBtV+U+qq6Ge6Tsk0PP/P/dXP
	/0/WIjKWqD9EUB1R5DskQEP4x9upg16FvrA2dbTiqMAfq34oq68sJKyJtXRk6z3gVguQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/time: Fix UBSAN failure in __update_vcpu_system_time()
Message-Id: <E1qynjq-0006sS-0I@xenbits.xenproject.org>
Date: Fri, 03 Nov 2023 06:33:02 +0000

commit 6f9285975b1c6e82889a6118503ca367e3aa78fd
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 1 20:19:52 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Nov 2 21:34:37 2023 +0000

    x86/time: Fix UBSAN failure in __update_vcpu_system_time()
    
    As reported:
    
      (XEN) ================================================================================
      (XEN) UBSAN: Undefined behaviour in arch/x86/time.c:1542:32
      (XEN) member access within null pointer of type 'union vcpu_info_t'
      (XEN) ----[ Xen-4.19-unstable  x86_64  debug=y ubsan=y  Not tainted ]----
      ...
      (XEN) Xen call trace:
      (XEN)    [<ffff82d040345036>] R common/ubsan/ubsan.c#ubsan_epilogue+0xa/0xd2
      (XEN)    [<ffff82d0403456e8>] F __ubsan_handle_type_mismatch+0x133/0x49b
      (XEN)    [<ffff82d040345b4a>] F __ubsan_handle_type_mismatch_v1+0xfa/0xfc
      (XEN)    [<ffff82d040623356>] F arch/x86/time.c#__update_vcpu_system_time+0x212/0x30f
      (XEN)    [<ffff82d040623461>] F update_vcpu_system_time+0xe/0x10
      (XEN)    [<ffff82d04062389d>] F arch/x86/time.c#local_time_calibration+0x1f7/0x523
      (XEN)    [<ffff82d0402a64b5>] F common/softirq.c#__do_softirq+0x1f4/0x31a
      (XEN)    [<ffff82d0402a67ad>] F do_softirq+0x13/0x15
      (XEN)    [<ffff82d0405a95dc>] F arch/x86/domain.c#idle_loop+0x2e0/0x367
      (XEN)
      (XEN) ================================================================================
    
    GCC 10 at least doesn't consider it valid to derive a pointer from vcpu_info()
    prior to checking that the underlying map pointer is good.
    
    Reorder actions so the map pointer is checked first.
    
    Fixes: 20279afd7323 ("x86: split populating of struct vcpu_time_info into a separate function")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
    (cherry picked from commit 801b804945bb7ccbd760d25637b720d8aac7e004)
---
 xen/arch/x86/time.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index d0b0986509..6d33edd0ad 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1539,12 +1539,14 @@ static void collect_time_info(const struct vcpu *v,
 
 static void __update_vcpu_system_time(struct vcpu *v, int force)
 {
-    struct vcpu_time_info *u = &vcpu_info(v, time), _u;
+    struct vcpu_time_info *u, _u;
     const struct domain *d = v->domain;
 
     if ( !v->vcpu_info_area.map )
         return;
 
+    u = &vcpu_info(v, time);
+
     collect_time_info(v, &_u);
 
     /* Don't bother unless timestamp record has changed or we are forced. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Nov 03 16:22:09 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Nov 2023 16:22:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627258.978182 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qywvr-0005uZ-Fg; Fri, 03 Nov 2023 16:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627258.978182; Fri, 03 Nov 2023 16: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 1qywvr-0005uR-Co; Fri, 03 Nov 2023 16:22:03 +0000
Received: by outflank-mailman (input) for mailman id 627258;
 Fri, 03 Nov 2023 16: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 1qywvq-0005uL-Ka
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 16: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 1qywvq-0003sO-7E
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 16:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qywvq-00080Y-5b
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 16: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=gCfCjf0siaPGnrh6x2tjXW0fw5XzltrYWE8EYJgNR2Q=; b=Z8fUL4gwiRgW4j84jOYDSeAata
	FchYf1b3OQromx2W6Iswss/k4NjlxztUIBziqaG6cicl6SCvKHyvzjqK/XxM5kynHAvG71gtwZ/a4
	U5Xxm0Sf8SRryj9Tmo/V0ZusM5w8KL4qeQcAQQbin3iasuyS24oKYFpeHKuFNJ1IeXiw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/time: Fix UBSAN failure in __update_vcpu_system_time()
Message-Id: <E1qywvq-00080Y-5b@xenbits.xenproject.org>
Date: Fri, 03 Nov 2023 16:22:02 +0000

commit 801b804945bb7ccbd760d25637b720d8aac7e004
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 1 20:19:52 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Nov 2 21:15:58 2023 +0000

    x86/time: Fix UBSAN failure in __update_vcpu_system_time()
    
    As reported:
    
      (XEN) ================================================================================
      (XEN) UBSAN: Undefined behaviour in arch/x86/time.c:1542:32
      (XEN) member access within null pointer of type 'union vcpu_info_t'
      (XEN) ----[ Xen-4.19-unstable  x86_64  debug=y ubsan=y  Not tainted ]----
      ...
      (XEN) Xen call trace:
      (XEN)    [<ffff82d040345036>] R common/ubsan/ubsan.c#ubsan_epilogue+0xa/0xd2
      (XEN)    [<ffff82d0403456e8>] F __ubsan_handle_type_mismatch+0x133/0x49b
      (XEN)    [<ffff82d040345b4a>] F __ubsan_handle_type_mismatch_v1+0xfa/0xfc
      (XEN)    [<ffff82d040623356>] F arch/x86/time.c#__update_vcpu_system_time+0x212/0x30f
      (XEN)    [<ffff82d040623461>] F update_vcpu_system_time+0xe/0x10
      (XEN)    [<ffff82d04062389d>] F arch/x86/time.c#local_time_calibration+0x1f7/0x523
      (XEN)    [<ffff82d0402a64b5>] F common/softirq.c#__do_softirq+0x1f4/0x31a
      (XEN)    [<ffff82d0402a67ad>] F do_softirq+0x13/0x15
      (XEN)    [<ffff82d0405a95dc>] F arch/x86/domain.c#idle_loop+0x2e0/0x367
      (XEN)
      (XEN) ================================================================================
    
    GCC 10 at least doesn't consider it valid to derive a pointer from vcpu_info()
    prior to checking that the underlying map pointer is good.
    
    Reorder actions so the map pointer is checked first.
    
    Fixes: 20279afd7323 ("x86: split populating of struct vcpu_time_info into a separate function")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
---
 xen/arch/x86/time.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index d0b0986509..6d33edd0ad 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1539,12 +1539,14 @@ static void collect_time_info(const struct vcpu *v,
 
 static void __update_vcpu_system_time(struct vcpu *v, int force)
 {
-    struct vcpu_time_info *u = &vcpu_info(v, time), _u;
+    struct vcpu_time_info *u, _u;
     const struct domain *d = v->domain;
 
     if ( !v->vcpu_info_area.map )
         return;
 
+    u = &vcpu_info(v, time);
+
     collect_time_info(v, &_u);
 
     /* Don't bother unless timestamp record has changed or we are forced. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 03 16:22:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Nov 2023 16:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627259.978186 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qyww1-0005yg-HF; Fri, 03 Nov 2023 16:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627259.978186; Fri, 03 Nov 2023 16: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 1qyww1-0005yZ-EE; Fri, 03 Nov 2023 16:22:13 +0000
Received: by outflank-mailman (input) for mailman id 627259;
 Fri, 03 Nov 2023 16: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 1qyww0-0005w4-Ch
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 16: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 1qyww0-0003sb-Bu
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 16:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qyww0-000818-9K
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 16: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=3LxL+tzp3Piy+YC4DF2NpeUZrZtgbzJkXBkxlACBBkM=; b=UBLKQq1gntA+09j1G+/bUfcyle
	WQJ6kb5qoyfMflp0xy2m+vHd8fIsXHKSrcq4UV00zfHkiyLdM05RIMXecKOUXiag4/k8u9MUNykW2
	ls2PO1fatC5pt3diKazaf4nLiMWaFim7v73aBrfPkOQoK4VLhd0tG664LZg9LzJu7394=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] MAINTAINERS: make Michal Orzel ARM Maintainer
Message-Id: <E1qyww0-000818-9K@xenbits.xenproject.org>
Date: Fri, 03 Nov 2023 16:22:12 +0000

commit 202f410721f2b7e21625c8cae91a6f95a025176e
Author:     Stefano Stabellini <sstabellini@kernel.org>
AuthorDate: Mon Oct 23 13:56:59 2023 -0700
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Thu Nov 2 14:58:56 2023 -0700

    MAINTAINERS: make Michal Orzel ARM Maintainer
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index f61b5a32a1..a5a5f2bffb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -246,6 +246,7 @@ ARM (W/ VIRTUALISATION EXTENSIONS) ARCHITECTURE
 M:	Stefano Stabellini <sstabellini@kernel.org>
 M:	Julien Grall <julien@xen.org>
 M:	Bertrand Marquis <bertrand.marquis@arm.com>
+M:	Michal Orzel <michal.orzel@amd.com>
 R:	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
 S:	Supported
 L:	xen-devel@lists.xenproject.org
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 03 16:22:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Nov 2023 16:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627260.978190 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qywwB-00062L-IY; Fri, 03 Nov 2023 16:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627260.978190; Fri, 03 Nov 2023 16: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 1qywwB-00062D-Fp; Fri, 03 Nov 2023 16:22:23 +0000
Received: by outflank-mailman (input) for mailman id 627260;
 Fri, 03 Nov 2023 16: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 1qywwA-000625-Hs
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 16: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 1qywwA-0003t0-Gl
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 16:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qywwA-00081X-Dz
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 16: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=S+YbkPGnH+77lyMWhe9OjA7FrI8EU8rvNyNYm5aO35Y=; b=TjXLB/bZ0YKicp3WDKP73Bkp77
	S87m9nKisj74Dgt1KOc1fGy148iPZC7NCS+r9KXhNkbToc9VVjjMGLzvM+i85Cx9qcaVjXUFkMpJO
	DqYlL0esYiSd/9q2NpKhtCxGVSQ3uYbHleUlGjgZe80OsdLM84NP/I66AIwd9qTeOcY0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/misra: add documentation skeleton for MISRA C:2012 Dir 4.1
Message-Id: <E1qywwA-00081X-Dz@xenbits.xenproject.org>
Date: Fri, 03 Nov 2023 16:22:22 +0000

commit 7211904e09bd9b895d798253cd2752e41da89541
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Mon Oct 2 09:34:48 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Thu Nov 2 14:58:56 2023 -0700

    docs/misra: add documentation skeleton for MISRA C:2012 Dir 4.1
    
    The aforementioned directive requires the project to supply documentation
    on the measures taken towards the minimization of run-time failures.
    
    The actual content of the documentation still needs feedback from the
    community.
    
    The 'rules.rst' file is updated accordingly to mention the newly
    added documentation.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 docs/misra/C-runtime-failures.rst | 210 ++++++++++++++++++++++++++++++++++++++
 docs/misra/rules.rst              |   7 ++
 2 files changed, 217 insertions(+)

diff --git a/docs/misra/C-runtime-failures.rst b/docs/misra/C-runtime-failures.rst
new file mode 100644
index 0000000000..77e04a2562
--- /dev/null
+++ b/docs/misra/C-runtime-failures.rst
@@ -0,0 +1,210 @@
+===================================================================
+Measures taken towards the minimization of Run-time failures in Xen
+===================================================================
+
+This document specifies which procedures and techinques are used troughout the
+Xen codebase to prevent or minimize the impact of certain classes of run-time
+errors that can occurr in the execution of a C program, due to the very minimal
+built-in checks that are present in the language.
+
+The presence of such documentation is requested by MISRA C:2012 Directive 4.1,
+whose headline states: "Run-time failures shall be minimized".
+
+
+Documentation for MISRA C:2012 Dir 4.1: overflow
+________________________________________________
+
+Pervasive use of assertions and extensive test suite.
+
+
+Documentation for MISRA C:2012 Dir 4.1: unexpected wrapping
+___________________________________________________________
+
+The only wrapping that is present in the code concerns
+unsigned integers and they are all expected.
+
+
+Documentation for MISRA C:2012 Dir 4.1: invalid shift
+_____________________________________________________
+
+Pervasive use of assertions and extensive test suite.
+
+
+Documentation for MISRA C:2012 Dir 4.1: division/remainder by zero
+__________________________________________________________________
+
+The division or remainder operations in the project code ensure that
+their second argument is never zero.
+
+
+Documentation for MISRA C:2012 Dir 4.1: unsequenced side effects
+________________________________________________________________
+
+Code executed in interrupt handlers uses spinlocks or disables interrupts
+at the right locations to avoid unsequenced side effects.
+
+
+Documentation for MISRA C:2012 Dir 4.1: read from uninitialized automatic object
+________________________________________________________________________________
+
+The amount of dynamically allocated objects is limited at runtime in
+static configurations. We make sure to initialize dynamically allocated
+objects before reading them, and we utilize static analysis tools to
+help check for that.
+
+
+Documentation for MISRA C:2012 Dir 4.1: read from uninitialized allocated object
+________________________________________________________________________________
+
+Dynamically allocated storage is used in a controlled manner, to prevent the
+access to uninitialized allocated storage.
+
+
+Documentation for MISRA C:2012 Dir 4.1: write to string literal or const object
+_______________________________________________________________________________
+
+The toolchain puts every string literal and const object into a read-only
+section of memory.  The hardware exception raised when a write is attempted
+on such a memory section is correctly handled.
+
+
+Documentation for MISRA C:2012 Dir 4.1: non-volatile access to volatile object
+______________________________________________________________________________
+
+Volatile access is limited to registers that are always accessed
+through macros or inline functions, or by limited code chunks that are only used
+to access a register.
+
+
+Documentation for MISRA C:2012 Dir 4.1: access to dead allocated object
+_______________________________________________________________________
+
+Although dynamically allocated storage is used in the project, in safety
+configurations its usage is very limited at runtime (it is "almost" only used
+at boot time). Coverity is regularly used to scan the code to detect non-freed
+allocated objects.
+
+
+Documentation for MISRA C:2012 Dir 4.1: access to dead automatic object
+_______________________________________________________________________
+
+Pointers to automatic variables are never returned, nor stored in
+wider-scoped objects.  No function does the same on any pointer
+received as a parameter.
+
+
+Documentation for MISRA C:2012 Dir 4.1: access to dead thread object
+____________________________________________________________________
+
+The program does not use per-thread variables.
+
+
+Documentation for MISRA C:2012 Dir 4.1: access using null pointer
+_________________________________________________________________
+
+All possibly null pointers are checked before access.
+
+
+Documentation for MISRA C:2012 Dir 4.1: access using invalid pointer
+____________________________________________________________________
+
+Usage of pointers is limited.  Pointers passed as parameters are
+always checked for validity.
+
+
+Documentation for MISRA C:2012 Dir 4.1: access using out-of-bounds pointer
+__________________________________________________________________________
+
+Pointers are never used to access arrays without checking for the array size
+first.
+
+
+Documentation for MISRA C:2012 Dir 4.1: access using unaligned pointer
+______________________________________________________________________
+
+Pointer conversion that may result in unaligned pointers are never used.
+
+
+Documentation for MISRA C:2012 Dir 4.1: mistyped access to object
+_________________________________________________________________
+
+Pointer conversions that may result in mistyped accesses to objects
+are never used.
+
+
+Documentation for MISRA C:2012 Dir 4.1: mistyped access to function
+___________________________________________________________________
+
+This behaviour can arise, for instance, from:
+
+- incongruent declarations;
+- functions having no prototypes;
+- casts on function pointers.
+
+The project has adopted various compiler flags and MISRA rules to lessen the
+likelihood of this event.
+
+
+Documentation for MISRA C:2012 Dir 4.1: invalid pointer arithmetic
+__________________________________________________________________
+
+Pointer arithmetic is never used without checking object boundaries.
+
+
+Documentation for MISRA C:2012 Dir 4.1: invalid pointer comparison
+__________________________________________________________________
+
+Pointers to different objects are never compared (except for pointers that are
+actually linker symbols, but those cases are deviated with a justification).
+
+
+Documentation for MISRA C:2012 Dir 4.1: overlapping copy
+________________________________________________________
+
+The code never uses memcpy() to copy overlapping objects. The instances of
+assignments involving overlapping objects are very limited and motivated.
+
+
+Documentation for MISRA C:2012 Dir 4.1: invalid arguments to function
+_____________________________________________________________________
+
+Many parameters to functions are checked for validity; there is ongoing work to
+make this true for all parameters.
+
+
+Documentation for MISRA C:2012 Dir 4.1: returned function error
+_______________________________________________________________
+
+Many functions that may produce an error, do return a suitable status code
+that is checked at each call site. There is ongoing work to make this true for
+all such functions.
+
+
+Documentation for MISRA C:2012 Dir 4.1: tainted input
+_____________________________________________________
+
+All parameters of all functions in the extenal ABI are checked before being
+used.
+
+
+Documentation for MISRA C:2012 Dir 4.1: data race
+_________________________________________________
+
+Data that can be accessed concurrently from multiple threads and code executed
+by interrupt handlers is protected using spinlocks and other forms of locking,
+as appropriate.
+
+
+Documentation for MISRA C:2012 Dir 4.1: invariant violation
+___________________________________________________________
+
+The extensive checks in the code ensure that any violation of a compile-time
+invariant will be detected prior to release builds, and violation of run-time
+invariants is extensively tested. In release builds the number of invariants
+is greatly reduced.
+
+
+Documentation for MISRA C:2012 Dir 4.1: communication error
+___________________________________________________________
+
+This project does not involve any external communication.
diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index b423580b23..6efe66195d 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -49,6 +49,13 @@ maintainers if you want to suggest a change.
      - All source files shall compile without any compilation errors
      -
 
+   * - `Dir 4.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/D_04_01.c>`_
+     - Required
+     - Run-time failures shall be minimized
+     - The strategies adopted by Xen to prevent certain classes of runtime
+       failures is documented by
+       `C-runtime-failures.rst <docs/misra/C-runtime-failures.rst>`_
+
    * - `Dir 4.7 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/D_04_07.c>`_
      - Required
      - If a function returns error information then that error
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 03 16:22:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Nov 2023 16:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627261.978194 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qywwL-00068T-K3; Fri, 03 Nov 2023 16:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627261.978194; Fri, 03 Nov 2023 16: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 1qywwL-00068L-HH; Fri, 03 Nov 2023 16:22:33 +0000
Received: by outflank-mailman (input) for mailman id 627261;
 Fri, 03 Nov 2023 16: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 1qywwK-000689-Kn
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 16: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 1qywwK-0003tE-Jz
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 16:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qywwK-000820-J3
 for xen-changelog@lists.xenproject.org; Fri, 03 Nov 2023 16: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=9xNBddEe/CAXTpB96uscaetU/XDzdMJq2WQiPSFDmfE=; b=L4xCnDXY04FXajOslBpRVk8PUh
	ZOwtakIzJomwhN2+PhH08By5yZiF2xL5EFMWIyPGzoc0hW3Uh4cKf9Z6/Wv2E3/G4GeiVU6ss080d
	Px7SbEDriBWLA1QZ15SpnuXSa8oHDhU/7os+TczXRZVlaAm8sy6Gk/XW5GBg0cnZf3Rc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/include: make enum perfcounter anonymous
Message-Id: <E1qywwK-000820-J3@xenbits.xenproject.org>
Date: Fri, 03 Nov 2023 16:22:32 +0000

commit ea083911b1dc609506dd715b82f75759f7807c31
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Wed Oct 11 15:03:49 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Thu Nov 2 14:58:56 2023 -0700

    xen/include: make enum perfcounter anonymous
    
    Using enumerators declared in a named enum, such as the one modified,
    as operands to arithmetic operators is not allowed by MISRA C:2012 Rule 10.1.
    The enumerators of an anonymous enum can be used instead.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 docs/misra/rules.rst    | 3 +++
 xen/include/xen/perfc.h | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 6efe66195d..aa65eb4dd0 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -341,6 +341,9 @@ maintainers if you want to suggest a change.
            compilers' extensions)
          - Implicit conversions to boolean for conditionals (?: if while
            for) and logical operators (! || &&)
+         - The essential type model allows the constants defined by anonymous
+           enums (e.g., enum { A, B, C }) to be used as operands to arithmetic
+           operators, as they have a signed essential type.
 
    * - `Rule 10.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_10_02.c>`_
      - Required
diff --git a/xen/include/xen/perfc.h b/xen/include/xen/perfc.h
index 7c5ce537bd..96022c0748 100644
--- a/xen/include/xen/perfc.h
+++ b/xen/include/xen/perfc.h
@@ -39,7 +39,7 @@
 #define PERFSTATUS       PERFCOUNTER
 #define PERFSTATUS_ARRAY PERFCOUNTER_ARRAY
 
-enum perfcounter {
+enum {
 #include <xen/perfc_defn.h>
 	NUM_PERFCOUNTERS
 };
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 04 13:33:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 04 Nov 2023 13:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627464.978432 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qzGlr-0003oz-FO; Sat, 04 Nov 2023 13:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627464.978432; Sat, 04 Nov 2023 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 1qzGlr-0003os-Cw; Sat, 04 Nov 2023 13:33:03 +0000
Received: by outflank-mailman (input) for mailman id 627464;
 Sat, 04 Nov 2023 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 1qzGlq-0003om-J5
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 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 1qzGlq-0000iy-BT
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 13:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qzGlq-0000UG-AS
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 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=a/BgbjhEeXW3zxhVlmGf+hoPfMtgWSdYxCX3gRDIS8U=; b=4TZM8fCsr2UknNljVHhZ2iRIIx
	E41BmfthJvHh8kZQ05GwWHu0gClK+ZpYFwfxMdjBM2sFWTUNhe9u40CoUsut6CYmtLvelaDHvpO0g
	khqXNu3Jl1P7NNWj/o4ebO4z84SBE1wP4w2hhcUAkIqNGqh1LltR2xbufdq7C/k3niXg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] build: simplify clean handling of extras directory
Message-Id: <E1qzGlq-0000UG-AS@xenbits.xenproject.org>
Date: Sat, 04 Nov 2023 13:33:02 +0000

commit 9589296e9c0ef7af352cebd8f6d59732ba2b187e
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Nov 3 11:21:28 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 3 11:21:28 2023 +0100

    build: simplify clean handling of extras directory
    
    The extras directory is used only as a download target for Mini-OS
    sources. Instead of special handling extras/mini-os* in .gitignore and
    the clean targets, just use extras for that purpose.
    
    So add "extras" to .gitignore and remove it when doing a
    "make distclean".
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
---
 .gitignore | 2 +-
 Makefile   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 287166f8fc..2cea994934 100644
--- a/.gitignore
+++ b/.gitignore
@@ -63,7 +63,7 @@ docs/man7/
 docs/man8/
 docs/pdf/
 docs/txt/
-extras/mini-os*
+extras/
 install/*
 stubdom/*-minios-config.mk
 stubdom/autom4te.cache/
diff --git a/Makefile b/Makefile
index b93b22c752..a6ca348476 100644
--- a/Makefile
+++ b/Makefile
@@ -246,6 +246,7 @@ clean-docs:
 # clean, but blow away tarballs
 .PHONY: distclean
 distclean: $(TARGS_DISTCLEAN)
+	rm -rf extras
 	$(MAKE) -C tools/include distclean
 	rm -f config/Toplevel.mk
 	rm -rf dist
@@ -265,7 +266,6 @@ distclean-stubdom:
 ifeq (x86_64,$(XEN_TARGET_ARCH))
 	XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom distclean
 endif
-	rm -rf extras/mini-os extras/mini-os-remote
 
 .PHONY: distclean-docs
 distclean-docs:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 04 13:33:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 04 Nov 2023 13:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627465.978436 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qzGm1-0003qm-Gp; Sat, 04 Nov 2023 13:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627465.978436; Sat, 04 Nov 2023 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 1qzGm1-0003qf-EP; Sat, 04 Nov 2023 13:33:13 +0000
Received: by outflank-mailman (input) for mailman id 627465;
 Sat, 04 Nov 2023 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 1qzGm0-0003qL-Fi
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 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 1qzGm0-0000j2-F2
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 13:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qzGm0-0000Up-E0
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 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=/kXAkqVHQktZqa1gUhkjneABHWDxh0xnRCBh2NSe40Y=; b=fxCIReaJMpw+NKXW+8PT1S9m9W
	1y9Co7TsRmsm5waL9tQmSNp7ae4HOzqCwRbPSrcUCOBfHVwWXJ6IpH+dv3HifGqp1xWg12OXSf75K
	kZQThhstl24i+A7ZChtjUv8poyYdimb+vdfbPX1Lzj5X+nNnlhnDJYVuhOxg7o7JIJm4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/PVH: allow Dom0 ELF parsing to be verbose
Message-Id: <E1qzGm0-0000Up-E0@xenbits.xenproject.org>
Date: Sat, 04 Nov 2023 13:33:12 +0000

commit ea3dabfb80d77b07f7aa34d88ba2d3bf3b1916c8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Nov 3 11:22:18 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 3 11:22:18 2023 +0100

    x86/PVH: allow Dom0 ELF parsing to be verbose
    
    VERBOSE had ceased to exist already before the introduction of this ELF
    parsing code.
    
    Fixes: 62ba982424cb ("x86: parse Dom0 kernel for PVHv2")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hvm/dom0_build.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index c7d47d0d4c..33b6ef89cd 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -557,9 +557,8 @@ static int __init pvh_load_kernel(struct domain *d, const module_t *image,
         printk("Unable to init ELF\n");
         return rc;
     }
-#ifdef VERBOSE
-    elf_set_verbose(&elf);
-#endif
+    if ( opt_dom0_verbose )
+        elf_set_verbose(&elf);
     elf_parse_binary(&elf);
     if ( (rc = elf_xen_parse(&elf, &parms, true)) != 0 )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 04 13:33:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 04 Nov 2023 13:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627467.978441 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qzGmB-0003tp-IO; Sat, 04 Nov 2023 13:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627467.978441; Sat, 04 Nov 2023 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 1qzGmB-0003th-Fm; Sat, 04 Nov 2023 13:33:23 +0000
Received: by outflank-mailman (input) for mailman id 627467;
 Sat, 04 Nov 2023 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 1qzGmA-0003tZ-Jm
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 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 1qzGmA-0000jZ-IG
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 13:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qzGmA-0000VK-HJ
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 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=3Bp3ykRL/OYC8Fd8PxXt3FXYsfQhdBuz5ecKJ3EWWZU=; b=hHyIJuD/5Mw7gphT9ImOrwkv5v
	q0/LvVMX9FPMMvxDSj52zp6Tidi5zXSLk5aKFZh6Wx3WSnby+qPK8H64NY6Axl7jqbHV+bgOlpuBx
	6VA1ZtHGXLXozmQrz5zqEDMqMcVN6KmTenQqlWB72vDO2j2jgmTLOjW033cSPO+0+bts=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] console: conditionalize console_input_domain()
Message-Id: <E1qzGmA-0000VK-HJ@xenbits.xenproject.org>
Date: Sat, 04 Nov 2023 13:33:22 +0000

commit 7d46710f084f8ea88b0bbb812f486d3ac019a2bf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Nov 3 11:23:18 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 3 11:23:18 2023 +0100

    console: conditionalize console_input_domain()
    
    The function was introduced for just one piece of code to use; it is
    dead code in cases where the respective Kconfig option is disabled, thus
    violating Misra C:2012 rule 2.1 there.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/drivers/char/console.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 6b679c5eac..4824d4a91d 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -475,6 +475,7 @@ static unsigned int __read_mostly console_rx = 0;
 
 #define max_console_rx (max_init_domid + 1)
 
+#ifdef CONFIG_SBSA_VUART_CONSOLE
 /* Make sure to rcu_unlock_domain after use */
 struct domain *console_input_domain(void)
 {
@@ -482,6 +483,7 @@ struct domain *console_input_domain(void)
             return NULL;
     return rcu_lock_domain_by_id(console_rx - 1);
 }
+#endif
 
 static void switch_serial_input(void)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 04 13:33:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 04 Nov 2023 13:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627471.978444 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qzGmL-000404-Jo; Sat, 04 Nov 2023 13:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627471.978444; Sat, 04 Nov 2023 13: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 1qzGmL-0003zw-HD; Sat, 04 Nov 2023 13:33:33 +0000
Received: by outflank-mailman (input) for mailman id 627471;
 Sat, 04 Nov 2023 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 1qzGmK-0003zq-ND
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 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 1qzGmK-0000ji-Lf
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 13:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qzGmK-0000WD-Kb
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 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=OVbQxDJk6dy8PtrYYk7oke//55+VAoK5+A8gF+DQf70=; b=TCU7CpOvTp/zalQ1XM0uIm/69D
	Uc0q8Yj+FJbKT4kjBKVunLNi+P005GkBY17u6pKDRMWmyhAraQeb33voYwZwEm+THd5gJypRI9SEA
	LLxJmh6RxJZiVCr/2yZ/fAdxvHc3KjxGP1cGvqA/AoKnmzQGXJfkj0HYbMv+dAN3arF4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xenoprof: move asm/ include
Message-Id: <E1qzGmK-0000WD-Kb@xenbits.xenproject.org>
Date: Sat, 04 Nov 2023 13:33:32 +0000

commit ad193a79c25ae24f1de5f37900e1da74ab48e8bd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Nov 3 11:25:03 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 3 11:25:03 2023 +0100

    xenoprof: move asm/ include
    
    There's no need for xen/xenoprof.h to include the arch header when the
    respective config option is off. The only compensation needed is for
    svm.c to explicitly include the arch header instead of the common one
    (matching what vmx.c and traps.c do).
    
    With that Arm's header can be deleted, and neither RISC-V nor PPC will
    need to introduce one.
    
    While there also adjust and move the (prior) inclusion of inttypes.h.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com> # arm
---
 xen/arch/arm/include/asm/xenoprof.h | 12 ------------
 xen/arch/ppc/include/asm/xenoprof.h |  0
 xen/arch/x86/hvm/svm/svm.c          |  2 +-
 xen/include/xen/xenoprof.h          |  6 +++---
 4 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/xen/arch/arm/include/asm/xenoprof.h b/xen/arch/arm/include/asm/xenoprof.h
deleted file mode 100644
index 3db6ce3ab2..0000000000
--- a/xen/arch/arm/include/asm/xenoprof.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef __ASM_XENOPROF_H__
-#define __ASM_XENOPROF_H__
-
-#endif /* __ASM_XENOPROF_H__ */
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/arch/ppc/include/asm/xenoprof.h b/xen/arch/ppc/include/asm/xenoprof.h
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 24c417ca71..674e54e04a 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -12,7 +12,6 @@
 #include <xen/lib.h>
 #include <xen/sched.h>
 #include <xen/trace.h>
-#include <xen/xenoprof.h>
 
 #include <asm/amd.h>
 #include <asm/apic.h>
@@ -38,6 +37,7 @@
 #include <asm/processor.h>
 #include <asm/p2m.h>
 #include <asm/x86_emulate.h>
+#include <asm/xenoprof.h>
 
 #include <public/sched.h>
 
diff --git a/xen/include/xen/xenoprof.h b/xen/include/xen/xenoprof.h
index 101514c148..c3dac447d3 100644
--- a/xen/include/xen/xenoprof.h
+++ b/xen/include/xen/xenoprof.h
@@ -10,15 +10,15 @@
 #ifndef __XEN_XENOPROF_H__
 #define __XEN_XENOPROF_H__
 
-#include <xen/inttypes.h>
-#include <asm/xenoprof.h>
-
 #define PMU_OWNER_NONE          0
 #define PMU_OWNER_XENOPROF      1
 #define PMU_OWNER_HVM           2
 
 #ifdef CONFIG_XENOPROF
 
+#include <xen/stdint.h>
+#include <asm/xenoprof.h>
+
 struct domain;
 struct vcpu;
 struct cpu_user_regs;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 04 13:33:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 04 Nov 2023 13:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627472.978448 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qzGmV-00042y-LE; Sat, 04 Nov 2023 13:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627472.978448; Sat, 04 Nov 2023 13: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 1qzGmV-00042q-Ic; Sat, 04 Nov 2023 13:33:43 +0000
Received: by outflank-mailman (input) for mailman id 627472;
 Sat, 04 Nov 2023 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 1qzGmU-00042a-QY
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 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 1qzGmU-0000jq-Pl
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 13:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qzGmU-0000X0-O5
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 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=CdpsQn/sRaxCu09QK2zwqMEZ7xAzcCC33mc9hs0m/Ns=; b=VwDKgKS+qF9zo3ge3JR/J35ogr
	re3zQS8riyatqvxicuTogaBkboNjoPFhAOfFHnC2VZza93iWrzRs9tMeJ9HEVn8QXHyg07MrB/Z2/
	GsAl7nUZbZ3aqv4ADi8gRNub7pwp7U6gEdGJdk03KEUGLi/ba2VFLROeKoAeXwblYs4w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arch: drop get_processor_id()
Message-Id: <E1qzGmU-0000X0-O5@xenbits.xenproject.org>
Date: Sat, 04 Nov 2023 13:33:42 +0000

commit 86b06295f6c79f6d9413d67426ae125bae820f52
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Nov 3 11:26:29 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 3 11:26:29 2023 +0100

    arch: drop get_processor_id()
    
    smp_processor_id() is what we commonly use; there's no need for it to
    have an alias.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com> # arm
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/arm/include/asm/current.h | 2 +-
 xen/arch/arm/include/asm/smp.h     | 2 --
 xen/arch/arm/smpboot.c             | 2 +-
 xen/arch/x86/include/asm/current.h | 2 +-
 xen/arch/x86/include/asm/smp.h     | 7 -------
 xen/arch/x86/mm/mm-locks.h         | 4 ++--
 6 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/include/asm/current.h b/xen/arch/arm/include/asm/current.h
index 6973eeb1d1..51d1c8efa8 100644
--- a/xen/arch/arm/include/asm/current.h
+++ b/xen/arch/arm/include/asm/current.h
@@ -53,7 +53,7 @@ static inline struct cpu_info *get_cpu_info(void)
 
 DECLARE_PER_CPU(unsigned int, cpu_id);
 
-#define get_processor_id()     this_cpu(cpu_id)
+#define smp_processor_id()     this_cpu(cpu_id)
 #define set_processor_id(id)                            \
 do {                                                    \
     WRITE_SYSREG(__per_cpu_offset[(id)], TPIDR_EL2);    \
diff --git a/xen/arch/arm/include/asm/smp.h b/xen/arch/arm/include/asm/smp.h
index 4fabdf5310..22e12f38db 100644
--- a/xen/arch/arm/include/asm/smp.h
+++ b/xen/arch/arm/include/asm/smp.h
@@ -11,8 +11,6 @@ DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
 
 #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
 
-#define smp_processor_id() get_processor_id()
-
 /*
  * Do we, for platform reasons, need to actually keep CPUs online when we
  * would otherwise prefer them to be off?
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index ec76de3cac..5533aed455 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -401,7 +401,7 @@ void start_secondary(void)
 /* Shut down the current CPU */
 void __cpu_disable(void)
 {
-    unsigned int cpu = get_processor_id();
+    unsigned int cpu = smp_processor_id();
 
     local_irq_disable();
     gic_disable_cpu();
diff --git a/xen/arch/x86/include/asm/current.h b/xen/arch/x86/include/asm/current.h
index da5e152a10..35cca5cbe4 100644
--- a/xen/arch/x86/include/asm/current.h
+++ b/xen/arch/x86/include/asm/current.h
@@ -99,7 +99,7 @@ static inline struct cpu_info *get_cpu_info(void)
 #define set_current(vcpu)     (get_cpu_info()->current_vcpu = (vcpu))
 #define current               (get_current())
 
-#define get_processor_id()    (get_cpu_info()->processor_id)
+#define smp_processor_id()    (get_cpu_info()->processor_id)
 #define guest_cpu_user_regs() (&get_cpu_info()->guest_cpu_user_regs)
 
 /*
diff --git a/xen/arch/x86/include/asm/smp.h b/xen/arch/x86/include/asm/smp.h
index 41a3b6a0da..c0b5d7cdd8 100644
--- a/xen/arch/x86/include/asm/smp.h
+++ b/xen/arch/x86/include/asm/smp.h
@@ -48,13 +48,6 @@ extern void cpu_exit_clear(unsigned int cpu);
 extern void cpu_uninit(unsigned int cpu);
 int cpu_add(uint32_t apic_id, uint32_t acpi_id, uint32_t pxm);
 
-/*
- * This function is needed by all SMP systems. It must _always_ be valid
- * from the initial startup. We map APIC_BASE very early in page_setup(),
- * so this is correct in the x86 case.
- */
-#define smp_processor_id() get_processor_id()
-
 void __stop_this_cpu(void);
 
 long cf_check cpu_up_helper(void *data);
diff --git a/xen/arch/x86/mm/mm-locks.h b/xen/arch/x86/mm/mm-locks.h
index 5a3f96fbaa..00b1bc402d 100644
--- a/xen/arch/x86/mm/mm-locks.h
+++ b/xen/arch/x86/mm/mm-locks.h
@@ -122,7 +122,7 @@ static inline void mm_rwlock_init(mm_rwlock_t *l)
 
 static inline int mm_write_locked_by_me(mm_rwlock_t *l)
 {
-    return (l->locker == get_processor_id());
+    return (l->locker == smp_processor_id());
 }
 
 static inline void _mm_write_lock(const struct domain *d, mm_rwlock_t *l,
@@ -132,7 +132,7 @@ static inline void _mm_write_lock(const struct domain *d, mm_rwlock_t *l,
     {
         _check_lock_level(d, level);
         percpu_write_lock(p2m_percpu_rwlock, &l->lock);
-        l->locker = get_processor_id();
+        l->locker = smp_processor_id();
         l->locker_function = func;
         l->unlock_level = _get_lock_level();
         _set_lock_level(_lock_level(d, level));
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 04 13:33:53 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 04 Nov 2023 13:33:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627473.978453 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qzGmf-00046D-Mm; Sat, 04 Nov 2023 13:33:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627473.978453; Sat, 04 Nov 2023 13:33: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 1qzGmf-000466-K7; Sat, 04 Nov 2023 13:33:53 +0000
Received: by outflank-mailman (input) for mailman id 627473;
 Sat, 04 Nov 2023 13:33: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 1qzGme-00045s-Te
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 13:33: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 1qzGme-0000jy-Sy
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 13:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qzGme-0000XX-S5
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 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=Hu4DmCV8V4FSiaHP9X/+rb3LVKMzIkIEbiTRKP8eBzs=; b=Du0rwWAKlfQQ9s8bjYfhv0kicZ
	m9Miognv6ekyLq417V0cPC74YT0AZ0i/yfkn/64EJ6y+8CWjx03kRG0VMVqA49s931VhC/jGlErFy
	c1PtZZTK/QnGzx5Gj6DoLYEH7wnEode/cWLqgP48LpTm7xeQ6Y2AHnHUzZDwaQFxjxZs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvm/dom0: fix PVH initrd and metadata placement
Message-Id: <E1qzGme-0000XX-S5@xenbits.xenproject.org>
Date: Sat, 04 Nov 2023 13:33:52 +0000

commit b6c7951f23a42215a0d1af2541d0702db1971c47
Author:     Xenia Ragiadakou <xenia.ragiadakou@amd.com>
AuthorDate: Fri Nov 3 11:27:29 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 3 11:27:29 2023 +0100

    x86/hvm/dom0: fix PVH initrd and metadata placement
    
    Zephyr image consists of multiple non-contiguous load segments
    that reside in different RAM regions. For instance:
    ELF: phdr: paddr=0x1000 memsz=0x8000
    ELF: phdr: paddr=0x100000 memsz=0x28a90
    ELF: phdr: paddr=0x128aa0 memsz=0x7560
    ELF: memory: 0x1000 -> 0x130000
    
    However, the logic that determines the best placement for dom0
    initrd and metadata, assumes that the image is fully contained
    in a single RAM region, not taking into account the cases where:
    (1) start > kernel_start && end > kernel_end
    (2) start < kernel_start && end < kernel_end
    (3) start > kernel_start && end < kernel_end
    
    In case (1), the evaluation will result in end = kernel_start,
    i.e. end < start, and will load initrd in the middle of the kernel.
    In case (2), the evaluation will result in start = kernel_end,
    i.e. end < start, and will load initrd at kernel_end, that is out
    of the memory region under evaluation.
    In case (3), the evaluation will result in either end = kernel_start
    or start = kernel_end but in both cases will be end < start, and
    will either load initrd in the middle of the image, or arbitrarily
    at kernel_end.
    
    This patch reorganizes the conditionals to include so far unconsidered
    cases as well, uniformly returning the lowest available address.
    
    Fixes: 73b47eea2104 ('x86/dom0: improve PVH initrd and metadata placement')
    Signed-off-by: Xenia Ragiadakou <xenia.ragiadakou@amd.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hvm/dom0_build.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 33b6ef89cd..70d31289b0 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -515,16 +515,23 @@ static paddr_t __init find_memory(
 
         ASSERT(IS_ALIGNED(start, PAGE_SIZE) && IS_ALIGNED(end, PAGE_SIZE));
 
+        /*
+         * NB: Even better would be to use rangesets to determine a suitable
+         * range, in particular in case a kernel requests multiple heavily
+         * discontiguous regions (which right now we fold all into one big
+         * region).
+         */
         if ( end <= kernel_start || start >= kernel_end )
-            ; /* No overlap, nothing to do. */
+        {
+            /* No overlap, just check whether the region is large enough. */
+            if ( end - start >= size )
+                return start;
+        }
         /* Deal with the kernel already being loaded in the region. */
-        else if ( kernel_start - start > end - kernel_end )
-            end = kernel_start;
-        else
-            start = kernel_end;
-
-        if ( end - start >= size )
+        else if ( kernel_start > start && kernel_start - start >= size )
             return start;
+        else if ( kernel_end < end && end - kernel_end >= size )
+            return kernel_end;
     }
 
     return INVALID_PADDR;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 04 13:34:03 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 04 Nov 2023 13:34:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.627476.978457 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1qzGmp-0004CK-OH; Sat, 04 Nov 2023 13:34:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 627476.978457; Sat, 04 Nov 2023 13:34: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 1qzGmp-0004CF-LX; Sat, 04 Nov 2023 13:34:03 +0000
Received: by outflank-mailman (input) for mailman id 627476;
 Sat, 04 Nov 2023 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 1qzGmp-0004Bv-2O
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 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 1qzGmp-0000tr-1V
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 13:34:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1qzGmo-0000YL-V3
 for xen-changelog@lists.xenproject.org; Sat, 04 Nov 2023 13:34:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=35SRvq2P8R5tPmdFh5iuKIPQAWJGjqG1LCdqWF0Gmks=; b=VE5BXpX8T8WCIcdDE0JRhkrs+i
	5+0Rl/7nk8nSmO2BjkdPfjmGi8zlfEA4iOfOjB0eNEE+HGnau69ccpIRZCTZF6a626ePim86PneNo
	RVxqiTxWIfJsZPBlB8ftMJTmrqp6ftnmBca5hJ+GrKr42lqxm9MezTC2MFT/NQvCVf8I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] AMD/IOMMU: drop tasklet handler forward declaration
Message-Id: <E1qzGmo-0000YL-V3@xenbits.xenproject.org>
Date: Sat, 04 Nov 2023 13:34:02 +0000

commit 5ae0a4ad3822e7118e33d162de87fb8c03db7ce7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Nov 3 11:28:09 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 3 11:28:09 2023 +0100

    AMD/IOMMU: drop tasklet handler forward declaration
    
    do_amd_iommu_irq()'s forward declaration uses a parameter name different
    from what the definition uses, thus vioating Misra C:2012 rule 8.3. We
    can get away without such a forward declaration if instead we forward-
    declare amd_iommu_irq_tasklet, putting its initialization past the
    handler function's definition.
    
    No functional change.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/drivers/passthrough/amd/iommu_init.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index 9c01a49435..5515cb70fd 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -26,8 +26,7 @@
 static int __initdata nr_amd_iommus;
 static bool __initdata pci_init;
 
-static void cf_check do_amd_iommu_irq(void *data);
-static DECLARE_SOFTIRQ_TASKLET(amd_iommu_irq_tasklet, do_amd_iommu_irq, NULL);
+static struct tasklet amd_iommu_irq_tasklet;
 
 unsigned int __read_mostly amd_iommu_acpi_info;
 unsigned int __read_mostly ivrs_bdf_entries;
@@ -715,6 +714,8 @@ static void cf_check do_amd_iommu_irq(void *unused)
     }
 }
 
+static DECLARE_SOFTIRQ_TASKLET(amd_iommu_irq_tasklet, do_amd_iommu_irq, NULL);
+
 static void cf_check iommu_interrupt_handler(
     int irq, void *dev_id, struct cpu_user_regs *regs)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 07 04:55:07 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Nov 2023 04:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.628570.980175 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0E7D-0000bU-Da; Tue, 07 Nov 2023 04:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 628570.980175; Tue, 07 Nov 2023 04: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 1r0E7D-0000bL-Aj; Tue, 07 Nov 2023 04:55:03 +0000
Received: by outflank-mailman (input) for mailman id 628570;
 Tue, 07 Nov 2023 04: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 1r0E7C-0000XN-99
 for xen-changelog@lists.xenproject.org; Tue, 07 Nov 2023 04: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 1r0E7B-00079H-Ui
 for xen-changelog@lists.xenproject.org; Tue, 07 Nov 2023 04:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0E7B-0005YS-Tb
 for xen-changelog@lists.xenproject.org; Tue, 07 Nov 2023 04:55:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dw0J1s1bRX4Kc+WUTniC5F6krklgOS27BgDrJ4qiogE=; b=XuCyqSHtSogSehqy2j+oY1ohBU
	gXCT7Uk/Y0zNDNyOi0ja2mvmnhSWFP7AigRyY8dMeW1B+X/hHAroSVDvBeU9smc+ASwEvMs7VOVoW
	K7mg+oFsJPSRt3E3XZP4oQBOJhrBJf7ivDUiZs+X3eTf96PQC9VbXAHZh2phEQqugZzM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] golang: Fixup binding for Arm FF-A
Message-Id: <E1r0E7B-0005YS-Tb@xenbits.xenproject.org>
Date: Tue, 07 Nov 2023 04:55:01 +0000

commit 1429f9c5486d94296ada441f14d1b7934885da06
Author:     Jason Andryuk <jandryuk@gmail.com>
AuthorDate: Fri Nov 3 15:45:50 2023 -0400
Commit:     George Dunlap <george.dunlap@cloud.com>
CommitDate: Mon Nov 6 16:13:01 2023 +0000

    golang: Fixup binding for Arm FF-A
    
    The new FF-A TEE type changed the go bindings.  Update them.
    
    Fixes: 8abdd8d52862 ("tools: add Arm FF-A mediator")
    Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: George Dunlap <george.dunlap@cloud.com>
---
 tools/golang/xenlight/types.gen.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/golang/xenlight/types.gen.go b/tools/golang/xenlight/types.gen.go
index 4f40aac28c..6a9ebb3fec 100644
--- a/tools/golang/xenlight/types.gen.go
+++ b/tools/golang/xenlight/types.gen.go
@@ -488,6 +488,7 @@ type TeeType int
 const(
 TeeTypeNone TeeType = 0
 TeeTypeOptee TeeType = 1
+TeeTypeFfa TeeType = 2
 )
 
 type SveType int
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 07 04:55:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Nov 2023 04:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.628571.980179 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0E7N-0000hO-Ej; Tue, 07 Nov 2023 04:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 628571.980179; Tue, 07 Nov 2023 04: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 1r0E7N-0000hG-CB; Tue, 07 Nov 2023 04:55:13 +0000
Received: by outflank-mailman (input) for mailman id 628571;
 Tue, 07 Nov 2023 04: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 1r0E7M-0000fn-44
 for xen-changelog@lists.xenproject.org; Tue, 07 Nov 2023 04: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 1r0E7M-00079V-2T
 for xen-changelog@lists.xenproject.org; Tue, 07 Nov 2023 04:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0E7M-0005ZG-0j
 for xen-changelog@lists.xenproject.org; Tue, 07 Nov 2023 04: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=PCK4KqXZ1LElxpIbr9n3k/K7LPzavX4LT64ETlMONMU=; b=RVeux9tedLXX9Adp9Y2UZCaAN6
	TWxLLN6ZaZQvZlNYkNEJ2QrCabd0nGJX9uBa/5iyG21ivvIeyiAQldV10c/vKDIpnVWk/vQSf27Jb
	l8DPRzIqL2G1fIgHHc3dG4wi5ZFSOojCJBKdtRA+ZOh9X4vSagmjbw1sNY7lJlHpomA4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] golang: Fix bindings after XSA-443
Message-Id: <E1r0E7M-0005ZG-0j@xenbits.xenproject.org>
Date: Tue, 07 Nov 2023 04:55:12 +0000

commit 1f849edc2f9ca7dc2f9ed7b0585c31bd6b81d7ef
Author:     Jason Andryuk <jandryuk@gmail.com>
AuthorDate: Fri Nov 3 15:45:51 2023 -0400
Commit:     George Dunlap <george.dunlap@cloud.com>
CommitDate: Mon Nov 6 16:13:23 2023 +0000

    golang: Fix bindings after XSA-443
    
    The new bootloader_restrict and bootloader_user fields in the libxl idl
    change the bindings.  Update them.
    
    Fixes: 1f762642d2ca ("libxl: add support for running bootloader in restricted mode")
    Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: George Dunlap <george.dunlap@cloud.com>
---
 tools/golang/xenlight/helpers.gen.go | 9 +++++++++
 tools/golang/xenlight/types.gen.go   | 2 ++
 2 files changed, 11 insertions(+)

diff --git a/tools/golang/xenlight/helpers.gen.go b/tools/golang/xenlight/helpers.gen.go
index 3ecffdf0ef..35e209ff1b 100644
--- a/tools/golang/xenlight/helpers.gen.go
+++ b/tools/golang/xenlight/helpers.gen.go
@@ -1112,6 +1112,10 @@ x.Bootloader = C.GoString(xc.bootloader)
 if err := x.BootloaderArgs.fromC(&xc.bootloader_args);err != nil {
 return fmt.Errorf("converting field BootloaderArgs: %v", err)
 }
+if err := x.BootloaderRestrict.fromC(&xc.bootloader_restrict);err != nil {
+return fmt.Errorf("converting field BootloaderRestrict: %v", err)
+}
+x.BootloaderUser = C.GoString(xc.bootloader_user)
 x.TimerMode = TimerMode(xc.timer_mode)
 if err := x.NestedHvm.fromC(&xc.nested_hvm);err != nil {
 return fmt.Errorf("converting field NestedHvm: %v", err)
@@ -1465,6 +1469,11 @@ xc.bootloader = C.CString(x.Bootloader)}
 if err := x.BootloaderArgs.toC(&xc.bootloader_args); err != nil {
 return fmt.Errorf("converting field BootloaderArgs: %v", err)
 }
+if err := x.BootloaderRestrict.toC(&xc.bootloader_restrict); err != nil {
+return fmt.Errorf("converting field BootloaderRestrict: %v", err)
+}
+if x.BootloaderUser != "" {
+xc.bootloader_user = C.CString(x.BootloaderUser)}
 xc.timer_mode = C.libxl_timer_mode(x.TimerMode)
 if err := x.NestedHvm.toC(&xc.nested_hvm); err != nil {
 return fmt.Errorf("converting field NestedHvm: %v", err)
diff --git a/tools/golang/xenlight/types.gen.go b/tools/golang/xenlight/types.gen.go
index 6a9ebb3fec..7907aa8999 100644
--- a/tools/golang/xenlight/types.gen.go
+++ b/tools/golang/xenlight/types.gen.go
@@ -577,6 +577,8 @@ DeviceTree string
 Acpi Defbool
 Bootloader string
 BootloaderArgs StringList
+BootloaderRestrict Defbool
+BootloaderUser string
 TimerMode TimerMode
 NestedHvm Defbool
 Apic Defbool
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 07 15:44:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Nov 2023 15:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.628901.980822 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0OFG-0002ng-TR; Tue, 07 Nov 2023 15:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 628901.980822; Tue, 07 Nov 2023 15:44:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0OFG-0002nZ-Qw; Tue, 07 Nov 2023 15:44:02 +0000
Received: by outflank-mailman (input) for mailman id 628901;
 Tue, 07 Nov 2023 15:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0OFF-0002nS-TB
 for xen-changelog@lists.xenproject.org; Tue, 07 Nov 2023 15:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0OFF-0006pc-SM
 for xen-changelog@lists.xenproject.org; Tue, 07 Nov 2023 15:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0OFF-0004DD-RK
 for xen-changelog@lists.xenproject.org; Tue, 07 Nov 2023 15: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=ibQE6tNlnhJftcCNhxm3ki9JDDRMv/IGDbseoHl2Pis=; b=g8FXYS10OqEvFX/Y7T2mXcUU2v
	iVBDLwdJPmNxwOMxj/X7MBpEie7li34pQpY7gEdUCgJvWsRXiMoJfqmJWdx1T2VPSOm92BQrj1+1l
	b1qGhkoPPFWbNZTEzHzjS0wSbe9uz1JI7MIL6+kmP9WD0Xtkdd9T31hgPCVFUuaEtjR4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] MAINTAINERS: add xen/drivers/char/imx-lpuart.c to ARM section
Message-Id: <E1r0OFF-0004DD-RK@xenbits.xenproject.org>
Date: Tue, 07 Nov 2023 15:44:01 +0000

commit de1cc5102b487e1a4bf321ac138b64c6ce1f0c0a
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Mon Nov 6 14:19:22 2023 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Nov 6 22:50:40 2023 +0000

    MAINTAINERS: add xen/drivers/char/imx-lpuart.c to ARM section
    
    Add it to the list next to other Arm serial drivers, so it does not fall
    back to THE REST.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index a5a5f2bffb..0fcf5a6f36 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -255,6 +255,7 @@ F:	xen/arch/arm/
 F:	xen/drivers/char/arm-uart.c
 F:	xen/drivers/char/cadence-uart.c
 F:	xen/drivers/char/exynos4210-uart.c
+F:	xen/drivers/char/imx-lpuart.c
 F:	xen/drivers/char/meson-uart.c
 F:	xen/drivers/char/mvebu-uart.c
 F:	xen/drivers/char/omap-uart.c
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 07 22:33:05 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Nov 2023 22:33:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.629079.981133 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0Ud4-0002Wh-QQ; Tue, 07 Nov 2023 22:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 629079.981133; Tue, 07 Nov 2023 22:33: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 1r0Ud4-0002WZ-NX; Tue, 07 Nov 2023 22:33:02 +0000
Received: by outflank-mailman (input) for mailman id 629079;
 Tue, 07 Nov 2023 22: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 1r0Ud3-0002WS-Sl
 for xen-changelog@lists.xenproject.org; Tue, 07 Nov 2023 22: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 1r0Ud3-0008GZ-It
 for xen-changelog@lists.xenproject.org; Tue, 07 Nov 2023 22:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0Ud3-0002fj-HJ
 for xen-changelog@lists.xenproject.org; Tue, 07 Nov 2023 22: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=SEJIA/x0y7VqvvMLfhRPPUhWZGl2uqaToGcJsj1tPIs=; b=gt9nAzJbqUwtqNFKXR1XrO3kln
	Vc+4KtFkZJisk1sL1kfPGuhu8PSZEHiiEXj+7hn4lvhiXieWssJqnpprbKRc34fn7NrS2VA8hG1lj
	QeaMkyPZsRjSSeJXQa1iDiJM2Od5Ec6FRG4na5BcUJv4cdoxibRgd7Tb/xHt0vcwKUSs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] golang: Fixup binding for Arm FF-A
Message-Id: <E1r0Ud3-0002fj-HJ@xenbits.xenproject.org>
Date: Tue, 07 Nov 2023 22:33:01 +0000

commit 51b8bbe580bcce770a3f6cf726cea133d46aeb6a
Author:     Jason Andryuk <jandryuk@gmail.com>
AuthorDate: Fri Nov 3 15:45:50 2023 -0400
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 7 09:59:06 2023 +0000

    golang: Fixup binding for Arm FF-A
    
    The new FF-A TEE type changed the go bindings.  Update them.
    
    Fixes: 8abdd8d52862 ("tools: add Arm FF-A mediator")
    Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: George Dunlap <george.dunlap@cloud.com>
    (cherry picked from commit 1429f9c5486d94296ada441f14d1b7934885da06)
---
 tools/golang/xenlight/types.gen.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/golang/xenlight/types.gen.go b/tools/golang/xenlight/types.gen.go
index 4f40aac28c..6a9ebb3fec 100644
--- a/tools/golang/xenlight/types.gen.go
+++ b/tools/golang/xenlight/types.gen.go
@@ -488,6 +488,7 @@ type TeeType int
 const(
 TeeTypeNone TeeType = 0
 TeeTypeOptee TeeType = 1
+TeeTypeFfa TeeType = 2
 )
 
 type SveType int
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Nov 07 22:33:12 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Nov 2023 22:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.629080.981136 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0UdE-0002Yg-RP; Tue, 07 Nov 2023 22:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 629080.981136; Tue, 07 Nov 2023 22:33:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0UdE-0002YZ-Oy; Tue, 07 Nov 2023 22:33:12 +0000
Received: by outflank-mailman (input) for mailman id 629080;
 Tue, 07 Nov 2023 22:33:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0UdD-0002YR-Nk
 for xen-changelog@lists.xenproject.org; Tue, 07 Nov 2023 22:33:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0UdD-0008Gi-MD
 for xen-changelog@lists.xenproject.org; Tue, 07 Nov 2023 22:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0UdD-0002gA-L9
 for xen-changelog@lists.xenproject.org; Tue, 07 Nov 2023 22:33:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Mpfm6M4C/V9uCN2vXgcIpOILkvh2dkm/n6RVVFogHzc=; b=nAbQkaBP3rO/BOZq2gg53Xd+8E
	Qwnsfm80rAvMfo62ZYrpaMR2YmMdvsKGQU1oDoqRn24BDXSrS3IzlDYwzBLYjJABP8EtmMNfR4cnI
	wCPRiiY9VzMob1B3nSjgtNMxZfnp6luFmySuilNhkHEv3rFFzcSHsmFbAx/LVZc7uPXM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] golang: Fix bindings after XSA-443
Message-Id: <E1r0UdD-0002gA-L9@xenbits.xenproject.org>
Date: Tue, 07 Nov 2023 22:33:11 +0000

commit 3e12149eb214fee62fc86ee964d3142d0235330e
Author:     Jason Andryuk <jandryuk@gmail.com>
AuthorDate: Fri Nov 3 15:45:51 2023 -0400
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 7 09:59:06 2023 +0000

    golang: Fix bindings after XSA-443
    
    The new bootloader_restrict and bootloader_user fields in the libxl idl
    change the bindings.  Update them.
    
    Fixes: 1f762642d2ca ("libxl: add support for running bootloader in restricted mode")
    Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: George Dunlap <george.dunlap@cloud.com>
    (cherry picked from commit 1f849edc2f9ca7dc2f9ed7b0585c31bd6b81d7ef)
---
 tools/golang/xenlight/helpers.gen.go | 9 +++++++++
 tools/golang/xenlight/types.gen.go   | 2 ++
 2 files changed, 11 insertions(+)

diff --git a/tools/golang/xenlight/helpers.gen.go b/tools/golang/xenlight/helpers.gen.go
index 3ecffdf0ef..35e209ff1b 100644
--- a/tools/golang/xenlight/helpers.gen.go
+++ b/tools/golang/xenlight/helpers.gen.go
@@ -1112,6 +1112,10 @@ x.Bootloader = C.GoString(xc.bootloader)
 if err := x.BootloaderArgs.fromC(&xc.bootloader_args);err != nil {
 return fmt.Errorf("converting field BootloaderArgs: %v", err)
 }
+if err := x.BootloaderRestrict.fromC(&xc.bootloader_restrict);err != nil {
+return fmt.Errorf("converting field BootloaderRestrict: %v", err)
+}
+x.BootloaderUser = C.GoString(xc.bootloader_user)
 x.TimerMode = TimerMode(xc.timer_mode)
 if err := x.NestedHvm.fromC(&xc.nested_hvm);err != nil {
 return fmt.Errorf("converting field NestedHvm: %v", err)
@@ -1465,6 +1469,11 @@ xc.bootloader = C.CString(x.Bootloader)}
 if err := x.BootloaderArgs.toC(&xc.bootloader_args); err != nil {
 return fmt.Errorf("converting field BootloaderArgs: %v", err)
 }
+if err := x.BootloaderRestrict.toC(&xc.bootloader_restrict); err != nil {
+return fmt.Errorf("converting field BootloaderRestrict: %v", err)
+}
+if x.BootloaderUser != "" {
+xc.bootloader_user = C.CString(x.BootloaderUser)}
 xc.timer_mode = C.libxl_timer_mode(x.TimerMode)
 if err := x.NestedHvm.toC(&xc.nested_hvm); err != nil {
 return fmt.Errorf("converting field NestedHvm: %v", err)
diff --git a/tools/golang/xenlight/types.gen.go b/tools/golang/xenlight/types.gen.go
index 6a9ebb3fec..7907aa8999 100644
--- a/tools/golang/xenlight/types.gen.go
+++ b/tools/golang/xenlight/types.gen.go
@@ -577,6 +577,8 @@ DeviceTree string
 Acpi Defbool
 Bootloader string
 BootloaderArgs StringList
+BootloaderRestrict Defbool
+BootloaderUser string
 TimerMode TimerMode
 NestedHvm Defbool
 Apic Defbool
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Wed Nov 08 04:11:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Nov 2023 04:11:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.629175.981190 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0ZuB-0002Du-QB; Wed, 08 Nov 2023 04:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 629175.981190; Wed, 08 Nov 2023 04: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 1r0ZuB-0002Dm-Nb; Wed, 08 Nov 2023 04:11:03 +0000
Received: by outflank-mailman (input) for mailman id 629175;
 Wed, 08 Nov 2023 04: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 1r0ZuA-0002Dg-D8
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 04: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 1r0ZuA-0007ZH-BZ
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 04:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0ZuA-0000l3-9R
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 04: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=oRbPJhQNVIAdcfg63bheS9UimEFR3AMav1n+KK0pGT4=; b=gBBhQ399uJpAQ3RiAmdRXxbDIK
	RKhZMXAalUkuiZ5Q29JmgigNhbcM+eIVn19dmTdEXK0RNgM2O9Db+aTSV1yoo86OjAwZ+2npYUkfC
	9VGhBhDeVpinkc9QIeS5fVTahGde/niHH5CfjKlgqCbI6vn1sq3ECY0j9S0qgm71Fvts=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/x2apic: introduce a mixed physical/cluster mode
Message-Id: <E1r0ZuA-0000l3-9R@xenbits.xenproject.org>
Date: Wed, 08 Nov 2023 04:11:02 +0000

commit e3c409d59ac87ccdf97b8c7708c81efa8069cb31
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Nov 6 15:27:39 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 7 09:59:48 2023 +0000

    x86/x2apic: introduce a mixed physical/cluster mode
    
    The current implementation of x2APIC requires to either use Cluster Logical or
    Physical mode for all interrupts.  However the selection of Physical vs Logical
    is not done at APIC setup, an APIC can be addressed both in Physical or Logical
    destination modes concurrently.
    
    Introduce a new x2APIC mode called Mixed, which uses Logical Cluster mode for
    IPIs, and Physical mode for external interrupts, thus attempting to use the
    best method for each interrupt type.
    
    Using Physical mode for external interrupts allows more vectors to be used, and
    interrupt balancing to be more accurate.
    
    Using Logical Cluster mode for IPIs allows fewer accesses to the ICR register
    when sending those, as multiple CPUs can be targeted with a single ICR register
    write.
    
    A simple test calling flush_tlb_all() 10000 times on a tight loop on AMD EPYC
    9754 with 512 CPUs gives the following figures in nano seconds:
    
    x mixed
    + phys
    * cluster
        N           Min           Max        Median           Avg        Stddev
    x  25 3.5131328e+08 3.5716441e+08 3.5410987e+08 3.5432659e+08     1566737.4
    +  12  1.231082e+09  1.238824e+09 1.2370528e+09 1.2357981e+09     2853892.9
    Difference at 95.0% confidence
            8.81472e+08 +/- 1.46849e+06
            248.774% +/- 0.96566%
            (Student's t, pooled s = 2.05985e+06)
    *  11 3.5099276e+08 3.5561459e+08 3.5461234e+08 3.5415668e+08     1415071.9
    No difference proven at 95.0% confidence
    
    So Mixed has no difference when compared to Cluster mode, and Physical mode is
    248% slower when compared to either Mixed or Cluster modes with a 95%
    confidence.
    
    Note that Xen uses Cluster mode by default, and hence is already using the
    fastest way for IPI delivery at the cost of reducing the amount of vectors
    available system-wide.
    
    Make the newly introduced mode the default one.
    
    Note the printing of the APIC addressing mode done in connect_bsp_APIC() has
    been removed, as with the newly introduced mixed mode this would require more
    fine grained printing, or else would be incorrect.  The addressing mode can
    already be derived from the APIC driver in use, which is printed by different
    helpers.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Henry Wang <Henry.Wang@arm.com>
---
 CHANGELOG.md                      |  3 ++
 docs/misc/xen-command-line.pandoc | 12 +++++
 xen/arch/x86/Kconfig              | 35 ++++++++++++--
 xen/arch/x86/apic.c               |  6 +--
 xen/arch/x86/genapic/x2apic.c     | 98 +++++++++++++++++++++++++++++----------
 5 files changed, 119 insertions(+), 35 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index b184dde8b1..c341c9d0bf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 ### Changed
 
 ### Added
+ - On x86:
+   - Introduce a new x2APIC driver that uses Cluster Logical addressing mode
+     for IPIs and Physical addressing mode for external interrupts.
 
 ### Removed
 
diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 9a19a04157..8e65f8bd18 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2804,6 +2804,15 @@ the watchdog.
 
 Permit use of x2apic setup for SMP environments.
 
+### x2apic-mode (x86)
+> `= physical | cluster | mixed`
+
+> Default: `physical` if **FADT** mandates physical mode, otherwise set at
+>          build time by CONFIG_X2APIC_{PHYSICAL,LOGICAL,MIXED}.
+
+In the case that x2apic is in use, this option switches between modes to
+address APICs in the system as interrupt destinations.
+
 ### x2apic_phys (x86)
 > `= <boolean>`
 
@@ -2814,6 +2823,9 @@ In the case that x2apic is in use, this option switches between physical and
 clustered mode.  The default, given no hint from the **FADT**, is cluster
 mode.
 
+**WARNING: `x2apic_phys` is deprecated and superseded by `x2apic-mode`.
+The latter takes precedence if both are set.**
+
 ### xenheap_megabytes (arm32)
 > `= <size>`
 
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index eac77573bd..1acdffc51c 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -228,11 +228,18 @@ config XEN_ALIGN_2M
 
 endchoice
 
-config X2APIC_PHYSICAL
-	bool "x2APIC Physical Destination mode"
+choice
+	prompt "x2APIC Driver default"
+	default X2APIC_MIXED
 	help
-	  Use x2APIC Physical Destination mode by default when available.
+	  Select APIC addressing when x2APIC is enabled.
+
+	  The default mode is mixed which should provide the best aspects
+	  of both physical and cluster modes.
 
+config X2APIC_PHYSICAL
+	bool "Physical Destination mode"
+	help
 	  When using this mode APICs are addressed using the Physical
 	  Destination mode, which allows using all dynamic vectors on each
 	  CPU independently.
@@ -242,9 +249,27 @@ config X2APIC_PHYSICAL
 	  destination inter processor interrupts (IPIs) slightly slower than
 	  Logical Destination mode.
 
-	  The mode when this option is not selected is Logical Destination.
+config X2APIC_CLUSTER
+	bool "Cluster Destination mode"
+	help
+	  When using this mode APICs are addressed using the Cluster Logical
+	  Destination mode.
+
+	  Cluster Destination has the benefit of sending IPIs faster since
+	  multiple APICs can be targeted as destinations of a single IPI.
+	  However the vector space is shared between all CPUs on the cluster,
+	  and hence using this mode reduces the number of available vectors
+	  when compared to Physical mode.
 
-	  If unsure, say N.
+config X2APIC_MIXED
+	bool "Mixed Destination mode"
+	help
+	  When using this mode APICs are addressed using the Cluster Logical
+	  Destination mode for IPIs and Physical mode for external interrupts.
+
+	  Should provide the best of both modes.
+
+endchoice
 
 config GUEST
 	bool
diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index f1264ce7ed..6acdd0ec14 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -229,11 +229,7 @@ void __init connect_bsp_APIC(void)
         outb(0x01, 0x23);
     }
 
-    printk("Enabling APIC mode:  %s.  Using %d I/O APICs\n",
-           !INT_DEST_MODE ? "Physical"
-                          : init_apic_ldr == init_apic_ldr_flat ? "Flat"
-                                                                : "Clustered",
-           nr_ioapics);
+    printk("Enabling APIC mode.  Using %d I/O APICs\n", nr_ioapics);
     enable_apic_mode();
 }
 
diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c
index 707deef98c..b88c7a96fe 100644
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -180,6 +180,36 @@ static const struct genapic __initconstrel apic_x2apic_cluster = {
     .send_IPI_self = send_IPI_self_x2apic
 };
 
+/*
+ * Mixed x2APIC mode: use physical for external (device) interrupts, and
+ * cluster for inter processor interrupts.  Such mode has the benefits of not
+ * sharing the vector space with all CPUs on the cluster, while still allowing
+ * IPIs to be more efficiently delivered by not having to perform an ICR write
+ * for each target CPU.
+ */
+static const struct genapic __initconstrel apic_x2apic_mixed = {
+    APIC_INIT("x2apic_mixed", NULL),
+
+    /*
+     * The following fields are exclusively used by external interrupts and
+     * hence are set to use Physical destination mode handlers.
+     */
+    .int_delivery_mode = dest_Fixed,
+    .int_dest_mode = 0 /* physical delivery */,
+    .vector_allocation_cpumask = vector_allocation_cpumask_phys,
+    .cpu_mask_to_apicid = cpu_mask_to_apicid_phys,
+
+    /*
+     * The following fields are exclusively used by IPIs and hence are set to
+     * use Cluster Logical destination mode handlers.  Note that init_apic_ldr
+     * is not used by IPIs, but the per-CPU fields it initializes are only used
+     * by the IPI hooks.
+     */
+    .init_apic_ldr = init_apic_ldr_x2apic_cluster,
+    .send_IPI_mask = send_IPI_mask_x2apic_cluster,
+    .send_IPI_self = send_IPI_self_x2apic,
+};
+
 static int cf_check update_clusterinfo(
     struct notifier_block *nfb, unsigned long action, void *hcpu)
 {
@@ -220,38 +250,56 @@ static struct notifier_block x2apic_cpu_nfb = {
 static int8_t __initdata x2apic_phys = -1;
 boolean_param("x2apic_phys", x2apic_phys);
 
+enum {
+   unset, physical, cluster, mixed
+} static __initdata x2apic_mode = unset;
+
+static int __init cf_check parse_x2apic_mode(const char *s)
+{
+    if ( !cmdline_strcmp(s, "physical") )
+        x2apic_mode = physical;
+    else if ( !cmdline_strcmp(s, "cluster") )
+        x2apic_mode = cluster;
+    else if ( !cmdline_strcmp(s, "mixed") )
+        x2apic_mode = mixed;
+    else
+        return -EINVAL;
+
+    return 0;
+}
+custom_param("x2apic-mode", parse_x2apic_mode);
+
 const struct genapic *__init apic_x2apic_probe(void)
 {
-    if ( x2apic_phys < 0 )
+    /* Honour the legacy cmdline setting if it's the only one provided. */
+    if ( x2apic_mode == unset && x2apic_phys >= 0 )
+        x2apic_mode = x2apic_phys ? physical : cluster;
+
+    if ( x2apic_mode == unset )
     {
-        /*
-         * Force physical mode if there's no (full) interrupt remapping support:
-         * The ID in clustered mode requires a 32 bit destination field due to
-         * the usage of the high 16 bits to hold the cluster ID.
-         */
-        x2apic_phys = iommu_intremap != iommu_intremap_full ||
-                      (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL) ||
-                      IS_ENABLED(CONFIG_X2APIC_PHYSICAL);
-    }
-    else if ( !x2apic_phys )
-        switch ( iommu_intremap )
+        if ( acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL )
         {
-        case iommu_intremap_off:
-        case iommu_intremap_restricted:
-            printk("WARNING: x2APIC cluster mode is not supported %s interrupt remapping -"
-                   " forcing phys mode\n",
-                   iommu_intremap == iommu_intremap_off ? "without"
-                                                        : "with restricted");
-            x2apic_phys = true;
-            break;
-
-        case iommu_intremap_full:
-            break;
+            printk(XENLOG_INFO "ACPI FADT forcing x2APIC physical mode\n");
+            x2apic_mode = physical;
         }
+        else
+            x2apic_mode = IS_ENABLED(CONFIG_X2APIC_MIXED) ? mixed
+                          : (IS_ENABLED(CONFIG_X2APIC_PHYSICAL) ? physical
+                                                                : cluster);
+    }
 
-    if ( x2apic_phys )
+    if ( x2apic_mode == physical )
         return &apic_x2apic_phys;
 
+    if ( x2apic_mode == cluster && iommu_intremap != iommu_intremap_full )
+    {
+        printk("WARNING: x2APIC cluster mode is not supported %s interrupt remapping -"
+               " forcing mixed mode\n",
+               iommu_intremap == iommu_intremap_off ? "without"
+                                                    : "with restricted");
+        x2apic_mode = mixed;
+    }
+
     if ( !this_cpu(cluster_cpus) )
     {
         update_clusterinfo(NULL, CPU_UP_PREPARE,
@@ -260,7 +308,7 @@ const struct genapic *__init apic_x2apic_probe(void)
         register_cpu_notifier(&x2apic_cpu_nfb);
     }
 
-    return &apic_x2apic_cluster;
+    return x2apic_mode == cluster ? &apic_x2apic_cluster : &apic_x2apic_mixed;
 }
 
 void __init check_x2apic_preenabled(void)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 08 04:11:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Nov 2023 04:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.629176.981195 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0ZuL-0002Fs-Ru; Wed, 08 Nov 2023 04:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 629176.981195; Wed, 08 Nov 2023 04: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 1r0ZuL-0002Fi-P8; Wed, 08 Nov 2023 04:11:13 +0000
Received: by outflank-mailman (input) for mailman id 629176;
 Wed, 08 Nov 2023 04: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 1r0ZuK-0002Fa-Fd
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 04: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 1r0ZuK-0007ZP-En
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 04:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0ZuK-0000ls-Di
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 04: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=HJkKB68cvJfqqRttiKOl6BAp1WU0y9L7UP9PNiMBaKU=; b=YIO6F9I7avG5g+GYLjivdmRlAO
	UtCXJTvFp0Fvm1dJeDp2KWPuyxD2DEhZJIqa2OgNv8P9SDL/qiJxQunIeS3YmmR4HXA5XxNfUB+FL
	/xAkVvXcIvQc0MXI+QPkrtpWYam3NNphdBJKpHCA5V2yf236A0v92GVFPan6wj5RF6ME=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] ubsan: Fix pointer overflow error message
Message-Id: <E1r0ZuK-0000ls-Di@xenbits.xenproject.org>
Date: Wed, 08 Nov 2023 04:11:12 +0000

commit fab51099a1cdb6bfe5127b14a5d41c246ea1a2c7
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Nov 7 10:14:17 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 7 10:00:11 2023 +0000

    ubsan: Fix pointer overflow error message
    
    In __ubsan_handle_pointer_overflow(), fix the condition for determining
    whether a pointer operation overflowed or underflowed. Currently, the
    function reports "underflowed" when it should be reporting "overflowed"
    and vice versa.
    
    Example of incorrect error reporting:
    void *foo = (void *)__UINTPTR_MAX__;
    foo += 1;
    
    UBSAN:
    pointer operation underflowed ffffffff to 00000000
    
    Fixes: 4e3fb2fb47d6 ("ubsan: add clang 5.0 support")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/ubsan/ubsan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/ubsan/ubsan.c b/xen/common/ubsan/ubsan.c
index 0fddacabda..a3a80fa99e 100644
--- a/xen/common/ubsan/ubsan.c
+++ b/xen/common/ubsan/ubsan.c
@@ -513,7 +513,7 @@ void __ubsan_handle_pointer_overflow(struct pointer_overflow_data *data,
 	ubsan_prologue(&data->location, &flags);
 
 	pr_err("pointer operation %s %p to %p\n",
-	       base > result ? "underflowed" : "overflowed",
+	       base > result ? "overflowed" : "underflowed",
 	       _p(base), _p(result));
 
 	ubsan_epilogue(&flags);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 08 18:11:07 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Nov 2023 18:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.629385.981579 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0n15-0005em-CW; Wed, 08 Nov 2023 18:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 629385.981579; Wed, 08 Nov 2023 18: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 1r0n15-0005ee-9t; Wed, 08 Nov 2023 18:11:03 +0000
Received: by outflank-mailman (input) for mailman id 629385;
 Wed, 08 Nov 2023 18: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 1r0n14-0005eY-Hb
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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 1r0n14-0003U4-E4
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0n14-0001wd-Ci
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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=wLZfvhYhahd4ZoRox3W5spAskTvt1NfCthwYqLbH0Vg=; b=IVpY2tO8IbroIz2Tg7FDir8TdW
	ZKCcDWSz080p/YttiqV86HUTPZlSxxwTBK2uVB4WL5YinR37+trqXjAzsLP9/y2fJHVpvMDlmHhRq
	KvK0VbdqipRRHsvU4Xh3CkOcQjoCNIR+KiZjQ5dd9jEGrpFUskD08MRPf306P4YHc1ec=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/spec-ctrl: Add SRSO whitepaper URL
Message-Id: <E1r0n14-0001wd-Ci@xenbits.xenproject.org>
Date: Wed, 08 Nov 2023 18:11:02 +0000

commit 78a86b26868c12ae1cc3dd2a8bb9aa5eebaa41fd
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Aug 9 16:07:03 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 7 17:47:34 2023 +0000

    x86/spec-ctrl: Add SRSO whitepaper URL
    
    ... now that it exists in public.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/spec_ctrl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
index 6fd7d44ce4..a8d8af22f6 100644
--- a/xen/arch/x86/spec_ctrl.c
+++ b/xen/arch/x86/spec_ctrl.c
@@ -903,6 +903,9 @@ static bool __init should_use_eager_fpu(void)
     }
 }
 
+/*
+ * https://www.amd.com/content/dam/amd/en/documents/corporate/cr/speculative-return-stack-overflow-whitepaper.pdf
+ */
 static void __init srso_calculations(bool hw_smt_enabled)
 {
     if ( !(boot_cpu_data.x86_vendor &
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 08 18:11:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Nov 2023 18:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.629386.981584 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0n1P-0005hZ-Eu; Wed, 08 Nov 2023 18:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 629386.981584; Wed, 08 Nov 2023 18: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 1r0n1P-0005hN-Bl; Wed, 08 Nov 2023 18:11:23 +0000
Received: by outflank-mailman (input) for mailman id 629386;
 Wed, 08 Nov 2023 18: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 1r0n1O-0005hC-LZ
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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 1r0n1O-0003UQ-Kp
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0n1O-0001xU-Jx
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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=u5//K3Ptvd1Z8ig9imReZf+XanFUrSmVKNPXbwyiSaM=; b=Sljpd6UWU8zrjTvAcIBySY307z
	/drkHWKYZ25VWbYfjATWouV8xBruKwEvSabftebqWzEduTMNIZskOuW2icOJpMpXE+XRA/etR2LwK
	Jxn+tuoebGC6XpaVyeXuDNbAqbaHKzoABmL0XvEPTlSDrYqUeWXigthyOlUVWB+/OSA0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/smpboot: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r0n1O-0001xU-Jx@xenbits.xenproject.org>
Date: Wed, 08 Nov 2023 18:11:22 +0000

commit 49604292b0abe24e750dfd71f7b45d286df878e1
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Fri Oct 13 17:24:33 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Nov 7 12:38:50 2023 -0800

    arm/smpboot: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter name, no functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/arm64/smpboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c
index 9637f42469..bf81d018b3 100644
--- a/xen/arch/arm/arm64/smpboot.c
+++ b/xen/arch/arm/arm64/smpboot.c
@@ -10,7 +10,7 @@
 #include <asm/acpi.h>
 
 struct smp_enable_ops {
-        int             (*prepare_cpu)(int);
+        int             (*prepare_cpu)(int cpu);
 };
 
 static paddr_t cpu_release_addr[NR_CPUS];
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 08 18:11:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Nov 2023 18:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.629387.981586 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0n1Z-0005jy-Fd; Wed, 08 Nov 2023 18:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 629387.981586; Wed, 08 Nov 2023 18: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 1r0n1Z-0005jr-DC; Wed, 08 Nov 2023 18:11:33 +0000
Received: by outflank-mailman (input) for mailman id 629387;
 Wed, 08 Nov 2023 18: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 1r0n1Y-0005jl-PA
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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 1r0n1Y-0003Uu-Nx
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0n1Y-0001xw-Mz
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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=VJ86IDwHGiDJt3MgmJTPTtH3R8dNRHyf0Y6MrhWgiEo=; b=ywsfI7Jilty4Ze+7ESbg96Ptjj
	CFUZaO1wV67WaqUo4kRzPpCMtm0V/Quwe6rMWDVknVoAR4CS/ijK6Pm6gtN9Tdp3RYe6mkKoopIvx
	HVsYaPHJj8N2YJmtnbnL+ZMU8nWhXzIEn/ggYl70r0W2KnaVWEziD7QiDrQvaHyVsx4o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/setup: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r0n1Y-0001xw-Mz@xenbits.xenproject.org>
Date: Wed, 08 Nov 2023 18:11:32 +0000

commit 5d38f3eab0ce8f5f601f5a61ccc33115ba5f9720
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Fri Oct 13 17:24:34 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Nov 7 12:38:50 2023 -0800

    arm/setup: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names, no functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/include/asm/setup.h | 5 +++--
 xen/arch/arm/setup.c             | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index b8866c20f4..98af6f55f5 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -141,7 +141,8 @@ void alloc_static_evtchn(void);
 
 void discard_initial_modules(void);
 void fw_unreserved_regions(paddr_t s, paddr_t e,
-                           void (*cb)(paddr_t, paddr_t), unsigned int first);
+                           void (*cb)(paddr_t ps, paddr_t pe),
+                           unsigned int first);
 
 size_t boot_fdt_info(const void *fdt, paddr_t paddr);
 const char *boot_fdt_cmdline(const void *fdt);
@@ -189,7 +190,7 @@ extern lpae_t boot_second_id[XEN_PT_LPAE_ENTRIES];
 extern lpae_t boot_third_id[XEN_PT_LPAE_ENTRIES];
 
 /* Find where Xen will be residing at runtime and return a PT entry */
-lpae_t pte_of_xenaddr(vaddr_t);
+lpae_t pte_of_xenaddr(vaddr_t va);
 
 extern const char __ro_after_init_start[], __ro_after_init_end[];
 
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index db748839d3..3f3a45719c 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -207,7 +207,7 @@ static void __init processor_id(void)
 }
 
 static void __init dt_unreserved_regions(paddr_t s, paddr_t e,
-                                         void (*cb)(paddr_t, paddr_t),
+                                         void (*cb)(paddr_t ps, paddr_t pe),
                                          unsigned int first)
 {
     unsigned int i, nr;
@@ -324,7 +324,7 @@ static bool __init bootmodules_overlap_check(struct bootmodules *bootmodules,
 }
 
 void __init fw_unreserved_regions(paddr_t s, paddr_t e,
-                                  void (*cb)(paddr_t, paddr_t),
+                                  void (*cb)(paddr_t ps, paddr_t pe),
                                   unsigned int first)
 {
     if ( acpi_disabled )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 08 18:11:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Nov 2023 18:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.629388.981590 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0n1j-0005mV-HC; Wed, 08 Nov 2023 18:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 629388.981590; Wed, 08 Nov 2023 18: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 1r0n1j-0005mN-Eg; Wed, 08 Nov 2023 18:11:43 +0000
Received: by outflank-mailman (input) for mailman id 629388;
 Wed, 08 Nov 2023 18: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 1r0n1i-0005mH-SC
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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 1r0n1i-0003V6-RS
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0n1i-0001yO-QA
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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=+Seygf+1G1sEKpO4GTlBK4smiPX3ncE3YYzYizZ0PZA=; b=UjpSS7qSiYQE2T6kCljNZTcAJh
	j0hKflyuHGfRm4hbt4mhu+9KQAAFmIf4hD7c7yNbR/9buRTWcuQq0SVSq7q8GA8NBcG4ZCwI5J2OA
	94vGNWOoC7ZIBEfRnosEkXGIb/WlF1DMm/zPCrKtiimqDjP82CWY4zGoxFo8jIh1XVt8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/p2m: address a violation of MISRA C:2012 Rule 8.2
Message-Id: <E1r0n1i-0001yO-QA@xenbits.xenproject.org>
Date: Wed, 08 Nov 2023 18:11:42 +0000

commit c07e81f64658aa7d8a0a3dad278120c32d5239ef
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Fri Oct 13 17:24:35 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Nov 7 12:38:50 2023 -0800

    arm/p2m: address a violation of MISRA C:2012 Rule 8.2
    
    Add missing parameter name, no functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/include/asm/p2m.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/include/asm/p2m.h b/xen/arch/arm/include/asm/p2m.h
index 940495d42b..9ad312bfb5 100644
--- a/xen/arch/arm/include/asm/p2m.h
+++ b/xen/arch/arm/include/asm/p2m.h
@@ -21,7 +21,7 @@ extern unsigned int p2m_root_level;
 
 struct domain;
 
-extern void memory_type_changed(struct domain *);
+extern void memory_type_changed(struct domain *d);
 
 /* Per-p2m-table state */
 struct p2m_domain {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 08 18:11:53 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Nov 2023 18:11:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.629389.981594 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0n1t-0005or-Ie; Wed, 08 Nov 2023 18:11:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 629389.981594; Wed, 08 Nov 2023 18: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 1r0n1t-0005ok-G8; Wed, 08 Nov 2023 18:11:53 +0000
Received: by outflank-mailman (input) for mailman id 629389;
 Wed, 08 Nov 2023 18: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 1r0n1s-0005oc-VW
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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 1r0n1s-0003VH-UY
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0n1s-0001yo-Tf
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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=U0i27BZ/Wh8+d0ho6hAY++feknhEp++NUDD6ugsa8sU=; b=rg52cn2LE/kesKal+ceMJNkPA3
	qCtd4i5tVLh54aMczpiCUcNUFWWfasmESeaFvdJzRwPKIrSq2ugt8O4GyE+fhQYF2pknLeCOtc8t/
	BA0Hc7fEYNE60UnzuYaRWYjE6/z7Ei5FE+d3u25VFaEfH79g9WRfNAEHKXHZOAwEI54Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/cmpxchg: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r0n1s-0001yo-Tf@xenbits.xenproject.org>
Date: Wed, 08 Nov 2023 18:11:52 +0000

commit a17a2b2073225d44444a2635dda53469147d666a
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Fri Oct 13 17:24:36 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Nov 7 12:38:50 2023 -0800

    arm/cmpxchg: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names, no functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/include/asm/arm32/cmpxchg.h | 2 +-
 xen/arch/arm/include/asm/arm64/cmpxchg.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/include/asm/arm32/cmpxchg.h b/xen/arch/arm/include/asm/arm32/cmpxchg.h
index b0bd1d8b68..37b2d64eb6 100644
--- a/xen/arch/arm/include/asm/arm32/cmpxchg.h
+++ b/xen/arch/arm/include/asm/arm32/cmpxchg.h
@@ -3,7 +3,7 @@
 
 #include <xen/prefetch.h>
 
-extern void __bad_xchg(volatile void *, int);
+extern void __bad_xchg(volatile void *ptr, int size);
 
 static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
 {
diff --git a/xen/arch/arm/include/asm/arm64/cmpxchg.h b/xen/arch/arm/include/asm/arm64/cmpxchg.h
index 10e4edc022..dbfaf91567 100644
--- a/xen/arch/arm/include/asm/arm64/cmpxchg.h
+++ b/xen/arch/arm/include/asm/arm64/cmpxchg.h
@@ -1,7 +1,7 @@
 #ifndef __ASM_ARM64_CMPXCHG_H
 #define __ASM_ARM64_CMPXCHG_H
 
-extern void __bad_xchg(volatile void *, int);
+extern void __bad_xchg(volatile void *ptr, int size);
 
 static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 08 18:12:04 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Nov 2023 18:12:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.629390.981598 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0n24-0005rA-K2; Wed, 08 Nov 2023 18:12:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 629390.981598; Wed, 08 Nov 2023 18: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 1r0n24-0005r3-Hc; Wed, 08 Nov 2023 18:12:04 +0000
Received: by outflank-mailman (input) for mailman id 629390;
 Wed, 08 Nov 2023 18: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 1r0n23-0005qt-28
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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 1r0n23-0003XC-1I
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18:12:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0n23-0001zO-0U
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18:12: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=RyAlLyTZRhaeaEa8JB7qudoBmyxG6GgdGJiivqSwy0U=; b=sECruu9cOQjzS1c0wuB2ig+9ic
	3b0zDI8KV3VKsTrX5XPaIcIYmjrpT1hcyKbZlHaiN/E6btCH482dKwKaypfu2dyr80R2OUBc2onfT
	j4Xfsb0GZ5VcGh22gcKwgPSziNDAi9l5duJi+/L8rRwieYWBmE1+CVmAYFX4/Hi/WTro=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/vgic-v3: address a violation of MISRA C:2012 Rule 8.2
Message-Id: <E1r0n23-0001zO-0U@xenbits.xenproject.org>
Date: Wed, 08 Nov 2023 18:12:03 +0000

commit be7f7149c421706750a1b922611a51827178f2fd
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Fri Oct 13 17:24:38 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Nov 7 12:38:50 2023 -0800

    arm/vgic-v3: address a violation of MISRA C:2012 Rule 8.2
    
    Add missing parameter name, no functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 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 05a009409a..cc38327701 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -360,7 +360,7 @@ read_unknown:
 
 static uint64_t vgic_sanitise_field(uint64_t reg, uint64_t field_mask,
                                     int field_shift,
-                                    uint64_t (*sanitise_fn)(uint64_t))
+                                    uint64_t (*sanitise_fn)(uint64_t field))
 {
     uint64_t field = (reg & field_mask) >> field_shift;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 08 18:12:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Nov 2023 18:12:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.629394.981614 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0n2E-00069w-3s; Wed, 08 Nov 2023 18:12:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 629394.981614; Wed, 08 Nov 2023 18: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 1r0n2E-00069j-0J; Wed, 08 Nov 2023 18:12:14 +0000
Received: by outflank-mailman (input) for mailman id 629394;
 Wed, 08 Nov 2023 18: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 1r0n2D-000699-53
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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 1r0n2D-0003XR-4K
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0n2D-0001zu-3c
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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=C7k5a/vQOrCNMC/fvsUjNF+5QTcUVyG7tUdsaNgb56Q=; b=itWbf6iEYaSTQ9caaMcq1kKlUu
	GJsUNFS+48leXel6LdQ5xEKsTygouNSbXa7Bjc8RWbF31I2AYN0evfAWoU3dyOIB/35KzRQHLQHUe
	G4xrELnu0i5QG7/uiWHKiT/GTK78hJg14cYuYiljwVf3Lf3L3VCHuaFep4rQOJ9SESvU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/domain: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r0n2D-0001zu-3c@xenbits.xenproject.org>
Date: Wed, 08 Nov 2023 18:12:13 +0000

commit ffe54cd8713045496c852587b5be806960968848
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Fri Oct 13 17:24:39 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Nov 7 12:38:50 2023 -0800

    arm/domain: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names, no funtional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/include/asm/domain.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
index 99e798ffff..5fb8cd79c0 100644
--- a/xen/arch/arm/include/asm/domain.h
+++ b/xen/arch/arm/include/asm/domain.h
@@ -243,8 +243,8 @@ struct arch_vcpu
 
 }  __cacheline_aligned;
 
-void vcpu_show_registers(const struct vcpu *);
-void vcpu_switch_to_aarch64_mode(struct vcpu *);
+void vcpu_show_registers(const struct vcpu *v);
+void vcpu_switch_to_aarch64_mode(struct vcpu *v);
 
 /*
  * Due to the restriction of GICv3, the number of vCPUs in AFF0 is
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 08 18:12:24 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Nov 2023 18:12:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.629395.981617 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0n2O-0006H9-4f; Wed, 08 Nov 2023 18:12:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 629395.981617; Wed, 08 Nov 2023 18: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 1r0n2O-0006H1-23; Wed, 08 Nov 2023 18:12:24 +0000
Received: by outflank-mailman (input) for mailman id 629395;
 Wed, 08 Nov 2023 18: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 1r0n2N-0006GL-8t
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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 1r0n2N-0003Xn-7S
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18:12:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0n2N-00020M-6b
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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=Gvr808EIV98+1GWG0M8iEnX+g8+2vzfU5LRD3GaaI6I=; b=W4NQCx8TtQMkSzctAAg2+oLT/H
	8oD6FHoNyZzzLUWqwl2kxGFfV+pPtCkAcK8Dm+PKTeBPvNRokcbqWF7/Hkdf0qQ/7rAH/G35DVBy0
	UraHViurVy0Ql8KslaxrE0u9slO1hYOXmrgnS4RKjh9ks88YCDpDt0JNlfE3sA92pGjk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/smmu: address violation of MISRA C:2012 Rule 8.2
Message-Id: <E1r0n2N-00020M-6b@xenbits.xenproject.org>
Date: Wed, 08 Nov 2023 18:12:23 +0000

commit 25dc15db92d47b2e3b8c9db366d33cf80a132b14
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Fri Oct 13 17:24:40 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Nov 7 12:38:50 2023 -0800

    arm/smmu: address violation of MISRA C:2012 Rule 8.2
    
    Add missing parameter names, no functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/drivers/passthrough/arm/smmu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index 71799064f8..11fc1d22ef 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -277,8 +277,8 @@ static void iommu_group_put(struct iommu_group *group)
 }
 
 static void iommu_group_set_iommudata(struct iommu_group *group,
-				      struct arm_smmu_master_cfg *cfg,
-				      void (*releasefn)(void *))
+                                      struct arm_smmu_master_cfg *cfg,
+                                      void (*releasefn)(void *data))
 {
 	/* TODO: Store the releasefn for the PCI */
 	ASSERT(releasefn == NULL);
@@ -2082,7 +2082,7 @@ static int arm_smmu_add_device(struct device *dev)
 	struct arm_smmu_device *smmu;
 	struct arm_smmu_master_cfg *cfg;
 	struct iommu_group *group;
-	void (*releasefn)(void *) = NULL;
+	void (*releasefn)(void *data) = NULL;
 	int ret;
 
 	smmu = find_smmu_for_device(dev);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 08 18:12:34 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Nov 2023 18:12:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.629397.981621 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0n2Y-0006QP-7P; Wed, 08 Nov 2023 18:12:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 629397.981621; Wed, 08 Nov 2023 18: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 1r0n2Y-0006QH-3k; Wed, 08 Nov 2023 18:12:34 +0000
Received: by outflank-mailman (input) for mailman id 629397;
 Wed, 08 Nov 2023 18: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 1r0n2X-0006Pw-BN
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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 1r0n2X-0003YG-Aa
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18:12:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0n2X-00020r-9g
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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=6N4N1s85au9chpFfEgHG0HJcEuslASwJwXWsm4QkoHc=; b=f8s57O1ejq+7JjleHD1vKWA/ty
	WoVMJVG/RDdwKUCqQO5bDRayxb2SPlYoxB5HP+EIirdb4oHAUr9qb9r7A2mgY7riKCLYeoQ6UaJAJ
	rfpcDMfVZdzPMuXat+cCJJFGt+XvPpXUsVnFgDhdi5uesrDI55bA/XQLAhagjZW0qCVs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] bitmap: fix nbits signess
Message-Id: <E1r0n2X-00020r-9g@xenbits.xenproject.org>
Date: Wed, 08 Nov 2023 18:12:33 +0000

commit 5704923f9477afa17c29d23a01d28f20fac346fb
Author:     Stefano Stabellini <stefano.stabellini@amd.com>
AuthorDate: Tue Oct 17 14:04:36 2023 -0700
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Nov 7 12:38:50 2023 -0800

    bitmap: fix nbits signess
    
    To avoid potentially dangerous sign conversions in bitmap_switch, all
    the callers of the bitmap_switch macro (which are all within bitmap.h)
    should pass an unsigned int as first parameter.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/bitmap.h | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/xen/include/xen/bitmap.h b/xen/include/xen/bitmap.h
index 3caf92c76d..657390e32e 100644
--- a/xen/include/xen/bitmap.h
+++ b/xen/include/xen/bitmap.h
@@ -110,7 +110,7 @@ extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order);
 		large;							  \
 	}
 
-static inline void bitmap_zero(unsigned long *dst, int nbits)
+static inline void bitmap_zero(unsigned long *dst, unsigned int nbits)
 {
 	bitmap_switch(nbits,,
 		*dst = 0UL,
@@ -134,7 +134,7 @@ static inline void bitmap_fill(unsigned long *dst, int nbits)
 }
 
 static inline void bitmap_copy(unsigned long *dst, const unsigned long *src,
-			int nbits)
+			unsigned int nbits)
 {
 	bitmap_switch(nbits,,
 		*dst = *src,
@@ -142,7 +142,7 @@ static inline void bitmap_copy(unsigned long *dst, const unsigned long *src,
 }
 
 static inline void bitmap_and(unsigned long *dst, const unsigned long *src1,
-			const unsigned long *src2, int nbits)
+			const unsigned long *src2, unsigned int nbits)
 {
 	bitmap_switch(nbits,,
 		*dst = *src1 & *src2,
@@ -150,7 +150,7 @@ static inline void bitmap_and(unsigned long *dst, const unsigned long *src1,
 }
 
 static inline void bitmap_or(unsigned long *dst, const unsigned long *src1,
-			const unsigned long *src2, int nbits)
+			const unsigned long *src2, unsigned int nbits)
 {
 	bitmap_switch(nbits,,
 		*dst = *src1 | *src2,
@@ -158,7 +158,7 @@ static inline void bitmap_or(unsigned long *dst, const unsigned long *src1,
 }
 
 static inline void bitmap_xor(unsigned long *dst, const unsigned long *src1,
-			const unsigned long *src2, int nbits)
+			const unsigned long *src2, unsigned int nbits)
 {
 	bitmap_switch(nbits,,
 		*dst = *src1 ^ *src2,
@@ -166,7 +166,7 @@ static inline void bitmap_xor(unsigned long *dst, const unsigned long *src1,
 }
 
 static inline void bitmap_andnot(unsigned long *dst, const unsigned long *src1,
-			const unsigned long *src2, int nbits)
+			const unsigned long *src2, unsigned int nbits)
 {
 	bitmap_switch(nbits,,
 		*dst = *src1 & ~*src2,
@@ -174,7 +174,7 @@ static inline void bitmap_andnot(unsigned long *dst, const unsigned long *src1,
 }
 
 static inline void bitmap_complement(unsigned long *dst, const unsigned long *src,
-			int nbits)
+			unsigned int nbits)
 {
 	bitmap_switch(nbits,,
 		*dst = ~*src & BITMAP_LAST_WORD_MASK(nbits),
@@ -182,7 +182,7 @@ static inline void bitmap_complement(unsigned long *dst, const unsigned long *sr
 }
 
 static inline int bitmap_equal(const unsigned long *src1,
-			const unsigned long *src2, int nbits)
+			const unsigned long *src2, unsigned int nbits)
 {
 	bitmap_switch(nbits,
 		return -1,
@@ -191,7 +191,7 @@ static inline int bitmap_equal(const unsigned long *src1,
 }
 
 static inline int bitmap_intersects(const unsigned long *src1,
-			const unsigned long *src2, int nbits)
+			const unsigned long *src2, unsigned int nbits)
 {
 	bitmap_switch(nbits,
 		return -1,
@@ -200,7 +200,7 @@ static inline int bitmap_intersects(const unsigned long *src1,
 }
 
 static inline int bitmap_subset(const unsigned long *src1,
-			const unsigned long *src2, int nbits)
+			const unsigned long *src2, unsigned int nbits)
 {
 	bitmap_switch(nbits,
 		return -1,
@@ -208,7 +208,7 @@ static inline int bitmap_subset(const unsigned long *src1,
 		return __bitmap_subset(src1, src2, nbits));
 }
 
-static inline int bitmap_empty(const unsigned long *src, int nbits)
+static inline int bitmap_empty(const unsigned long *src, unsigned int nbits)
 {
 	bitmap_switch(nbits,
 		return -1,
@@ -216,7 +216,7 @@ static inline int bitmap_empty(const unsigned long *src, int nbits)
 		return __bitmap_empty(src, nbits));
 }
 
-static inline int bitmap_full(const unsigned long *src, int nbits)
+static inline int bitmap_full(const unsigned long *src, unsigned int nbits)
 {
 	bitmap_switch(nbits,
 		return -1,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 08 18:12:44 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Nov 2023 18:12:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.629399.981625 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0n2i-0006Yj-9y; Wed, 08 Nov 2023 18:12:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 629399.981625; Wed, 08 Nov 2023 18: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 1r0n2i-0006Yb-7D; Wed, 08 Nov 2023 18:12:44 +0000
Received: by outflank-mailman (input) for mailman id 629399;
 Wed, 08 Nov 2023 18: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 1r0n2h-0006YO-Et
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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 1r0n2h-0003YQ-ED
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18:12:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0n2h-00021O-Ch
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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=X3aAEIRu1/9pRT/GXq/sKYO2GdB1TnRLmAUVv8CBOaQ=; b=eOxqBaVkc77rQbk0sFsvdvhc/5
	vR+393PaGVpYntlNxdr5u5r0yWk2Kpk2zXGouLJtUXj+unYuVuJDFGQXGA+zewwsfLGp18YfpUcUp
	eIrIANMwMuG2hJMOTjvw5AKdYrR5p79hGwUVeU2yY7SPjgY/IsQMw2E79AMRJ4jmp/R8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/cpufeature: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r0n2h-00021O-Ch@xenbits.xenproject.org>
Date: Wed, 08 Nov 2023 18:12:43 +0000

commit ca1279f87936542be6d7e1adfed3d028f88a026a
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Oct 18 14:50:46 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Nov 7 12:38:50 2023 -0800

    arm/cpufeature: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/include/asm/cpufeature.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/include/asm/cpufeature.h b/xen/arch/arm/include/asm/cpufeature.h
index 8011076b8c..c95582044a 100644
--- a/xen/arch/arm/include/asm/cpufeature.h
+++ b/xen/arch/arm/include/asm/cpufeature.h
@@ -127,8 +127,8 @@ static inline void cpus_set_cap(unsigned int num)
 struct arm_cpu_capabilities {
     const char *desc;
     u16 capability;
-    bool (*matches)(const struct arm_cpu_capabilities *);
-    int (*enable)(void *); /* Called on every active CPUs */
+    bool (*matches)(const struct arm_cpu_capabilities *entry);
+    int (*enable)(void *data); /* Called on every active CPUs */
     union {
         struct {    /* To be used for eratum handling only */
             u32 midr_model;
@@ -448,10 +448,10 @@ struct cpuinfo_arm {
 
 extern struct cpuinfo_arm system_cpuinfo;
 
-extern void identify_cpu(struct cpuinfo_arm *);
+extern void identify_cpu(struct cpuinfo_arm *c);
 
 #ifdef CONFIG_ARM_64
-extern void update_system_features(const struct cpuinfo_arm *);
+extern void update_system_features(const struct cpuinfo_arm *new);
 #else
 static inline void update_system_features(const struct cpuinfo_arm *cpuinfo)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 08 18:12:54 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Nov 2023 18:12:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.629400.981629 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0n2s-0006e4-BF; Wed, 08 Nov 2023 18:12:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 629400.981629; Wed, 08 Nov 2023 18:12:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0n2s-0006dw-8d; Wed, 08 Nov 2023 18:12:54 +0000
Received: by outflank-mailman (input) for mailman id 629400;
 Wed, 08 Nov 2023 18: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 1r0n2r-0006dm-Hu
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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 1r0n2r-0003YZ-H5
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18:12:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0n2r-00021y-GL
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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=/VItjWeJVPYxpnzEVQ62Dmxl/Jf4HV/y0WBN91HZCTw=; b=TbGX4s37HCOKZbkVT6Gar/wSUL
	xkHrCakU5pZBKiJefVEEw6HQ+ovjnrFaCwr1wCNlrW2LpRIUYDIIuQdIZKn8UOHSe58ny3/lOB/K1
	uNLZQ/0cUEzrfcU5HdtFZd18EDW4jbS0M9wIxrohjQ2Z1n9Np4cE2pv4hOeqot+cMC3Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm64: domctl: Avoid unreachable code in subarch_do_domctl()
Message-Id: <E1r0n2r-00021y-GL@xenbits.xenproject.org>
Date: Wed, 08 Nov 2023 18:12:53 +0000

commit f5ff26da329d46f39bd32aa5b6b8fdf94b1a7606
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Mon Oct 23 18:52:20 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Nov 7 12:38:50 2023 -0800

    xen/arm64: domctl: Avoid unreachable code in subarch_do_domctl()
    
    The 'break' the XEN_DOMCTL_set_address_size is unreachable and tools
    like Eclair will report as a violation of Misra Rule 2.1.
    
    Furthermore, the nested switch is not very easy to read. So move
    out the nested switch in a separate function to improve the
    readability and hopefully address the MISRA violation.
    
    Reported-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Henry Wang <Henry.Wang@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/arm64/domctl.c | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/arm64/domctl.c b/xen/arch/arm/arm64/domctl.c
index 14fc622e99..8720d126c9 100644
--- a/xen/arch/arm/arm64/domctl.c
+++ b/xen/arch/arm/arm64/domctl.c
@@ -33,27 +33,31 @@ static long switch_mode(struct domain *d, enum domain_type type)
     return 0;
 }
 
+static long set_address_size(struct domain *d, uint32_t address_size)
+{
+    switch ( address_size )
+    {
+    case 32:
+        if ( !cpu_has_el1_32 )
+            return -EINVAL;
+        /* SVE is not supported for 32 bit domain */
+        if ( is_sve_domain(d) )
+            return -EINVAL;
+        return switch_mode(d, DOMAIN_32BIT);
+    case 64:
+        return switch_mode(d, DOMAIN_64BIT);
+    default:
+        return -EINVAL;
+    }
+}
+
 long subarch_do_domctl(struct xen_domctl *domctl, struct domain *d,
                        XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     switch ( domctl->cmd )
     {
     case XEN_DOMCTL_set_address_size:
-        switch ( domctl->u.address_size.size )
-        {
-        case 32:
-            if ( !cpu_has_el1_32 )
-                return -EINVAL;
-            /* SVE is not supported for 32 bit domain */
-            if ( is_sve_domain(d) )
-                return -EINVAL;
-            return switch_mode(d, DOMAIN_32BIT);
-        case 64:
-            return switch_mode(d, DOMAIN_64BIT);
-        default:
-            return -EINVAL;
-        }
-        break;
+        return set_address_size(d, domctl->u.address_size.size);
 
     default:
         return -ENOSYS;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 08 18:13:05 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Nov 2023 18:13:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.629401.981633 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0n33-0006iG-Cg; Wed, 08 Nov 2023 18:13:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 629401.981633; Wed, 08 Nov 2023 18:13: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 1r0n33-0006i8-A7; Wed, 08 Nov 2023 18:13:05 +0000
Received: by outflank-mailman (input) for mailman id 629401;
 Wed, 08 Nov 2023 18: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 1r0n31-0006hw-Kn
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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 1r0n31-0003Yv-Jx
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18:13:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0n31-00022g-JB
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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=5a+01t8PkgkPIcRsvCB5v1AMD0ZdO668SgdgU/0xwRM=; b=vnGJWwiHrvlQeC5CDh39na6hNc
	lUy4Vxek6uk/pJSKw74uRCCzUllZGHmRMFelo7K/5PriJoQcuq+G4tSDoJ3KTjZQryk4rWlxPpY4a
	wIEA3aU3QETwLtX8IXeM0myouu08sQAahoBROgXLdECCQf76fTxplAnm9CiZq6xhu3mE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] build: Allow setting KBUILD_DEFCONFIG in the environment
Message-Id: <E1r0n31-00022g-JB@xenbits.xenproject.org>
Date: Wed, 08 Nov 2023 18:13:03 +0000

commit adac94da8bbd8affe04dcaefac8d0872025f9e5f
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Oct 25 10:28:34 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Nov 7 12:38:50 2023 -0800

    build: Allow setting KBUILD_DEFCONFIG in the environment
    
    At the moment, in order to use a different defconfig target than default,
    one needs to specify KBUILD_DEFCONFIG=<target> on the command line.
    Switch to weak assignment, so that it can be also obtained from
    environment similar to other KCONFIG/KBUILD variables.
    
    This change will activate the use of KBUILD_DEFCONFIG variable in CI
    build jobs that so far would have had no effect if they didn't match the
    default anyway.
    
    Note, that we will deviate from Linux in this regard.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    [stefano: adjust commit message]
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index b923235c53..7b869f4b30 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -256,7 +256,8 @@ export YACC = $(if $(BISON),$(BISON),bison)
 export LEX = $(if $(FLEX),$(FLEX),flex)
 
 # Default file for 'make defconfig'.
-export KBUILD_DEFCONFIG := $(ARCH)_defconfig
+# May be overruled on the command line or set in the environment.
+export KBUILD_DEFCONFIG ?= $(ARCH)_defconfig
 
 # Copy CFLAGS generated by "Config.mk" so they can be reused later without
 # reparsing Config.mk by e.g. arch/x86/boot/.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 08 18:13:15 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Nov 2023 18:13:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.629402.981637 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0n3D-0006lj-Dz; Wed, 08 Nov 2023 18:13:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 629402.981637; Wed, 08 Nov 2023 18:13: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 1r0n3D-0006lb-BV; Wed, 08 Nov 2023 18:13:15 +0000
Received: by outflank-mailman (input) for mailman id 629402;
 Wed, 08 Nov 2023 18: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 1r0n3B-0006lK-Nd
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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 1r0n3B-0003Z6-Mw
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18:13:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0n3B-000235-M6
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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=cfAKF0zf15VSXKewAyCXaCzpXgNcbOlveDKlqvgc2PI=; b=sPAubSO6cZj2DBwaohV80cOfwa
	WHL5qyICg/cYad0eBcE9rkUGmwuIqlQkJOtJ8LaOwGnWU/w1sOP3TvTX6HZXI8tqjldCwF0BnrRSo
	+r4bgF/7dH25zKoY/DiH+HZTKRu3iJXwi1yQEIuT82Yx/CufX7aXyaw7gpGbiqu4dEbw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/domain_page: address violations of MISRA C:2012 Rule 8.3
Message-Id: <E1r0n3B-000235-M6@xenbits.xenproject.org>
Date: Wed, 08 Nov 2023 18:13:13 +0000

commit dc79336075af596a323c70969287a4a22b440526
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Tue Oct 31 10:25:41 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Nov 7 12:38:50 2023 -0800

    xen/domain_page: address violations of MISRA C:2012 Rule 8.3
    
    Make function definitions and declarations consistent. Use "ptr" as
    const void* parameter to match the definitions on x86.
    
    No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    [stefano: drop blank, improve commit message]
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/domain_page.c    | 10 +++++-----
 xen/include/xen/domain_page.h | 12 ++++++------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/domain_page.c b/xen/arch/arm/domain_page.c
index b7c02c9190..3a43601623 100644
--- a/xen/arch/arm/domain_page.c
+++ b/xen/arch/arm/domain_page.c
@@ -74,9 +74,9 @@ void *map_domain_page_global(mfn_t mfn)
     return vmap(&mfn, 1);
 }
 
-void unmap_domain_page_global(const void *va)
+void unmap_domain_page_global(const void *ptr)
 {
-    vunmap(va);
+    vunmap(ptr);
 }
 
 /* Map a page of domheap memory */
@@ -149,13 +149,13 @@ void *map_domain_page(mfn_t mfn)
 }
 
 /* Release a mapping taken with map_domain_page() */
-void unmap_domain_page(const void *va)
+void unmap_domain_page(const void *ptr)
 {
     unsigned long flags;
     lpae_t *map = this_cpu(xen_dommap);
-    int slot = ((unsigned long) va - DOMHEAP_VIRT_START) >> SECOND_SHIFT;
+    int slot = ((unsigned long)ptr - DOMHEAP_VIRT_START) >> SECOND_SHIFT;
 
-    if ( !va )
+    if ( !ptr )
         return;
 
     local_irq_save(flags);
diff --git a/xen/include/xen/domain_page.h b/xen/include/xen/domain_page.h
index 0ff5cdd294..c89b149e54 100644
--- a/xen/include/xen/domain_page.h
+++ b/xen/include/xen/domain_page.h
@@ -29,12 +29,12 @@ void *map_domain_page(mfn_t mfn);
  * Pass a VA within a page previously mapped in the context of the
  * currently-executing VCPU via a call to map_domain_page().
  */
-void unmap_domain_page(const void *va);
+void unmap_domain_page(const void *ptr);
 
-/* 
+/*
  * Given a VA from map_domain_page(), return its underlying MFN.
  */
-mfn_t domain_page_map_to_mfn(const void *va);
+mfn_t domain_page_map_to_mfn(const void *ptr);
 
 /*
  * Similar to the above calls, except the mapping is accessible in all
@@ -42,7 +42,7 @@ mfn_t domain_page_map_to_mfn(const void *va);
  * mappings can also be unmapped from any context.
  */
 void *map_domain_page_global(mfn_t mfn);
-void unmap_domain_page_global(const void *va);
+void unmap_domain_page_global(const void *ptr);
 
 #define __map_domain_page(pg)        map_domain_page(page_to_mfn(pg))
 
@@ -55,8 +55,8 @@ static inline void *__map_domain_page_global(const struct page_info *pg)
 
 #define map_domain_page(mfn)                __mfn_to_virt(mfn_x(mfn))
 #define __map_domain_page(pg)               page_to_virt(pg)
-#define unmap_domain_page(va)               ((void)(va))
-#define domain_page_map_to_mfn(va)          _mfn(__virt_to_mfn((unsigned long)(va)))
+#define unmap_domain_page(ptr)              ((void)(ptr))
+#define domain_page_map_to_mfn(ptr)         _mfn(__virt_to_mfn((unsigned long)(ptr)))
 
 static inline void *map_domain_page_global(mfn_t mfn)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 08 18:13:25 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Nov 2023 18:13:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.629403.981642 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0n3N-0006pX-Gd; Wed, 08 Nov 2023 18:13:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 629403.981642; Wed, 08 Nov 2023 18:13: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 1r0n3N-0006pQ-Cy; Wed, 08 Nov 2023 18:13:25 +0000
Received: by outflank-mailman (input) for mailman id 629403;
 Wed, 08 Nov 2023 18: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 1r0n3L-0006p4-Qk
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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 1r0n3L-0003ZT-Q5
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18:13:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0n3L-00023U-PJ
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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=zxkT19nmVI//ja1WlcOdeABPGBiZVDppF0MSv+wVb6I=; b=AUBPCZEfbDpfwUIajkGW1QmgPi
	ue0ACV8gLqIWywGSmCmohfzETq3c/oAuuk28SI17evvRG8ZEcdlX0eB2J/iVzgJ7Jj0Up1FkeleJE
	5QM3DQgmrfWpxPbKgHuNwblzFtBstwVxcTEn//lg/ev5V6+iGBqbdZ2DnTQzpXGw0Vtc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/gic: add missing parameter names and uniform function declarations
Message-Id: <E1r0n3L-00023U-PJ@xenbits.xenproject.org>
Date: Wed, 08 Nov 2023 18:13:23 +0000

commit f3795523dc17e2d5df8f09b35d9725202b62ddb0
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Oct 18 15:14:39 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Nov 7 12:42:30 2023 -0800

    arm/gic: add missing parameter names and uniform function declarations
    
    Add missing parameter names and remove inconsistencies between GICv3
    and GICv2. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/gic-v3.c          | 22 +++++++++++-----------
 xen/arch/arm/include/asm/gic.h | 12 ++++++------
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 95e4f020fe..172ff8c005 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -1086,29 +1086,29 @@ static void gicv3_read_lr(int lr, struct gic_lr *lr_reg)
     }
 }
 
-static void gicv3_write_lr(int lr_reg, const struct gic_lr *lr)
+static void gicv3_write_lr(int lr, const struct gic_lr *lr_reg)
 {
     uint64_t lrv = 0;
     const enum gic_version vgic_version = current->domain->arch.vgic.version;
 
 
-    lrv = ( ((u64)(lr->virq & ICH_LR_VIRTUAL_MASK)  << ICH_LR_VIRTUAL_SHIFT) |
-        ((u64)(lr->priority & ICH_LR_PRIORITY_MASK) << ICH_LR_PRIORITY_SHIFT) );
+    lrv = ( ((u64)(lr_reg->virq & ICH_LR_VIRTUAL_MASK)  << ICH_LR_VIRTUAL_SHIFT) |
+        ((u64)(lr_reg->priority & ICH_LR_PRIORITY_MASK) << ICH_LR_PRIORITY_SHIFT) );
 
-    if ( lr->active )
+    if ( lr_reg->active )
         lrv |= ICH_LR_STATE_ACTIVE;
 
-    if ( lr->pending )
+    if ( lr_reg->pending )
         lrv |= ICH_LR_STATE_PENDING;
 
-    if ( lr->hw_status )
+    if ( lr_reg->hw_status )
     {
         lrv |= ICH_LR_HW;
-        lrv |= (uint64_t)lr->hw.pirq << ICH_LR_PHYSICAL_SHIFT;
+        lrv |= (uint64_t)lr_reg->hw.pirq << ICH_LR_PHYSICAL_SHIFT;
     }
     else
     {
-        if ( lr->virt.eoi )
+        if ( lr_reg->virt.eoi )
             lrv |= ICH_LR_MAINTENANCE_IRQ;
         /* Source is only set in GICv2 compatible mode */
         if ( vgic_version == GIC_V2 )
@@ -1117,8 +1117,8 @@ static void gicv3_write_lr(int lr_reg, const struct gic_lr *lr)
              * Source is only valid for SGIs, the caller should make
              * sure the field virt.source is always 0 for non-SGI.
              */
-            ASSERT(!lr->virt.source || lr->virq < NR_GIC_SGI);
-            lrv |= (uint64_t)lr->virt.source << ICH_LR_CPUID_SHIFT;
+            ASSERT(!lr_reg->virt.source || lr_reg->virq < NR_GIC_SGI);
+            lrv |= (uint64_t)lr_reg->virt.source << ICH_LR_CPUID_SHIFT;
         }
     }
 
@@ -1129,7 +1129,7 @@ static void gicv3_write_lr(int lr_reg, const struct gic_lr *lr)
     if ( vgic_version == GIC_V3 )
         lrv |= ICH_LR_GRP1;
 
-    gicv3_ich_write_lr(lr_reg, lrv);
+    gicv3_ich_write_lr(lr, lrv);
 }
 
 static void gicv3_hcr_status(uint32_t flag, bool status)
diff --git a/xen/arch/arm/include/asm/gic.h b/xen/arch/arm/include/asm/gic.h
index f1ef347edc..03f209529b 100644
--- a/xen/arch/arm/include/asm/gic.h
+++ b/xen/arch/arm/include/asm/gic.h
@@ -246,7 +246,7 @@ void gic_set_irq_type(struct irq_desc *desc, unsigned int type);
 
 /* Program the GIC to route an interrupt */
 extern void gic_route_irq_to_xen(struct irq_desc *desc, unsigned int priority);
-extern int gic_route_irq_to_guest(struct domain *, unsigned int virq,
+extern int gic_route_irq_to_guest(struct domain *d, unsigned int virq,
                                   struct irq_desc *desc,
                                   unsigned int priority);
 
@@ -330,11 +330,11 @@ struct gic_hw_operations {
     /* Initialize the GIC and the boot CPU */
     int (*init)(void);
     /* Save GIC registers */
-    void (*save_state)(struct vcpu *);
+    void (*save_state)(struct vcpu *v);
     /* Restore GIC registers */
-    void (*restore_state)(const struct vcpu *);
+    void (*restore_state)(const struct vcpu *v);
     /* Dump GIC LR register information */
-    void (*dump_state)(const struct vcpu *);
+    void (*dump_state)(const struct vcpu *v);
 
     /* hw_irq_controller to enable/disable/eoi host irq */
     hw_irq_controller *gic_host_irq_type;
@@ -369,9 +369,9 @@ struct gic_hw_operations {
     /* Clear LR register */
     void (*clear_lr)(int lr);
     /* Read LR register and populate gic_lr structure */
-    void (*read_lr)(int lr, struct gic_lr *);
+    void (*read_lr)(int lr, struct gic_lr *lr_reg);
     /* Write LR register from gic_lr structure */
-    void (*write_lr)(int lr, const struct gic_lr *);
+    void (*write_lr)(int lr, const struct gic_lr *lr_reg);
     /* Read VMCR priority */
     unsigned int (*read_vmcr_priority)(void);
     /* Read APRn register */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 08 18:13:35 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Nov 2023 18:13:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.629405.981645 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0n3X-0006x1-Hg; Wed, 08 Nov 2023 18:13:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 629405.981645; Wed, 08 Nov 2023 18:13: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 1r0n3X-0006wt-Ep; Wed, 08 Nov 2023 18:13:35 +0000
Received: by outflank-mailman (input) for mailman id 629405;
 Wed, 08 Nov 2023 18: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 1r0n3V-0006uk-TS
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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 1r0n3V-0003Zq-Sj
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18:13:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0n3V-00023u-SA
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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=aNF4Yme6iutj7idsZVXalyAIelbvYEdYep5vhMr9QMU=; b=JmsQnH+DmVvLiNi0GgKnt/U1iL
	gPBO97j0HDZtaSr3fo+Y4qSwItpJALZMziOH+A23PxHHCHlgeQvVNmR+YI8Eb1g0ikwi+ieZVeTIu
	/ppyGZ3WkXm9eM1HcbLNASaVu83/TRyVWwKpQKmNDmvrIBMtveOEYtcWKnPvIPUGJcFI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] cppcheck: rework exclusion_file_list.py code
Message-Id: <E1r0n3V-00023u-SA@xenbits.xenproject.org>
Date: Wed, 08 Nov 2023 18:13:33 +0000

commit d82a8217d5345109df0783b99b5e753bb29ab668
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Thu Oct 26 11:32:42 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Nov 7 12:43:51 2023 -0800

    cppcheck: rework exclusion_file_list.py code
    
    Rework the exclusion_file_list.py code to have the function
    load_exclusion_file_list() detached from the xen-analysis.py tool,
    in a way so that other modules can use the function.
    The xen-analysis tool and in particular its module cppcheck_analysis.py
    will use a new function cppcheck_exclusion_file_list().
    
    No functional changes are intended.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/scripts/xen_analysis/cppcheck_analysis.py   |  6 ++---
 xen/scripts/xen_analysis/exclusion_file_list.py | 31 +++++++++++++------------
 2 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/xen/scripts/xen_analysis/cppcheck_analysis.py b/xen/scripts/xen_analysis/cppcheck_analysis.py
index 8dc45e653b..e54848aa53 100644
--- a/xen/scripts/xen_analysis/cppcheck_analysis.py
+++ b/xen/scripts/xen_analysis/cppcheck_analysis.py
@@ -2,7 +2,8 @@
 
 import os, re, shutil
 from . import settings, utils, cppcheck_report_utils, exclusion_file_list
-from .exclusion_file_list import ExclusionFileListError
+from .exclusion_file_list import (ExclusionFileListError,
+                                  cppcheck_exclusion_file_list)
 
 class GetMakeVarsPhaseError(Exception):
     pass
@@ -54,8 +55,7 @@ def __generate_suppression_list(out_file):
             try:
                 exclusion_file = \
                     "{}/docs/misra/exclude-list.json".format(settings.repo_dir)
-                exclusion_list = \
-                    exclusion_file_list.load_exclusion_file_list(exclusion_file)
+                exclusion_list = cppcheck_exclusion_file_list(exclusion_file)
             except ExclusionFileListError as e:
                 raise CppcheckDepsPhaseError(
                     "Issue with reading file {}: {}".format(exclusion_file, e)
diff --git a/xen/scripts/xen_analysis/exclusion_file_list.py b/xen/scripts/xen_analysis/exclusion_file_list.py
index 871e480586..79ebd34f55 100644
--- a/xen/scripts/xen_analysis/exclusion_file_list.py
+++ b/xen/scripts/xen_analysis/exclusion_file_list.py
@@ -7,16 +7,24 @@ class ExclusionFileListError(Exception):
     pass
 
 
-def __cppcheck_path_exclude_syntax(path):
-    # Prepending * to the relative path to match every path where the Xen
-    # codebase could be
-    path = "*" + path
+def cppcheck_exclusion_file_list(input_file):
+    ret = []
+    excl_list = load_exclusion_file_list(input_file)
+
+    for entry in excl_list:
+        # Prepending * to the relative path to match every path where the Xen
+        # codebase could be
+        ret.append("*" + entry[0])
 
-    return path
+    return ret
 
 
-# Reads the exclusion file list and returns a list of relative path to be
-# excluded.
+# Reads the exclusion file list and returns an array containing a set where the
+# first entry is what was listed in the exclusion list file, and the second
+# entry is the absolute path of the first entry.
+# If the first entry contained a wildcard '*', the second entry will have an
+# array of the solved absolute path for that entry.
+# Returns [('path',[path,path,...]), ('path',[path,path,...]), ...]
 def load_exclusion_file_list(input_file):
     ret = []
     try:
@@ -58,13 +66,6 @@ def load_exclusion_file_list(input_file):
                     .format(path, filepath_object)
                 )
 
-        if settings.analysis_tool == "cppcheck":
-            path = __cppcheck_path_exclude_syntax(path)
-        else:
-            raise ExclusionFileListError(
-                "Unimplemented for {}!".format(settings.analysis_tool)
-            )
-
-        ret.append(path)
+        ret.append((path, check_path))
 
     return ret
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 08 18:13:45 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Nov 2023 18:13:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.629406.981649 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r0n3h-000708-L3; Wed, 08 Nov 2023 18:13:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 629406.981649; Wed, 08 Nov 2023 18:13: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 1r0n3h-000700-I0; Wed, 08 Nov 2023 18:13:45 +0000
Received: by outflank-mailman (input) for mailman id 629406;
 Wed, 08 Nov 2023 18: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 1r0n3g-0006zp-0Y
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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 1r0n3f-0003a1-W5
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18:13:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r0n3f-00024N-Uv
 for xen-changelog@lists.xenproject.org; Wed, 08 Nov 2023 18: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=9kCe9OtGfzbSkQVwKWgdKXv5v/uwnWOTQ0Z7n87BTRI=; b=mm7YbIz7Fl+RGuqvYH5PP08XCU
	zKGUQ1ZzR3tlVgA2Qd7zpj2gYtasL7hkkoHNqthz7vIDegLtBqLNfI/fCIlYtv05yre4xeeHQgZGg
	Y2wTdn29BM8CbK6q2N7tvBQZZb8jtHXV1Yr1xSBUVIFcC1+PqvPVXp0boTp69bTKn+WY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] exclude-list: generalise exclude-list
Message-Id: <E1r0n3f-00024N-Uv@xenbits.xenproject.org>
Date: Wed, 08 Nov 2023 18:13:43 +0000

commit bede1c7e3b790b63f1ff3ea3ee4e476b012fdf2c
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Thu Oct 26 11:32:43 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Nov 7 12:43:52 2023 -0800

    exclude-list: generalise exclude-list
    
    Currently exclude-list.json is used by the xen-analysis tool to
    remove from the report (cppcheck for now) violations from the
    files listed in it, however that list can be used by different
    users that might want to exclude some of the files from their
    computation for many reasons.
    
    So add a new field that can be part of each entry to link
    the tool supposed to consider that exclusion.
    
    Update exclusion_file_list.py to implement the logic and update
    the documentation to reflect this change.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 docs/misra/exclude-list.rst                     | 31 +++++++++++++++----------
 xen/scripts/xen_analysis/exclusion_file_list.py | 16 +++++++++++--
 2 files changed, 33 insertions(+), 14 deletions(-)

diff --git a/docs/misra/exclude-list.rst b/docs/misra/exclude-list.rst
index c97431a861..42dbceb825 100644
--- a/docs/misra/exclude-list.rst
+++ b/docs/misra/exclude-list.rst
@@ -1,17 +1,16 @@
 .. SPDX-License-Identifier: CC-BY-4.0
 
-Exclude file list for xen-analysis script
-=========================================
+Exclude file list for xen scripts
+=================================
 
-The code analysis is performed on the Xen codebase for both MISRA
-checkers and static analysis checkers, there are some files however that
-needs to be removed from the findings report for various reasons (e.g.
-they are imported from external sources, they generate too many false
-positive results, etc.).
+Different Xen scripts can perform operations on the codebase to check its
+compliance for a set of rules, however Xen contains some files that are taken
+from other projects (e.g. linux) and they can't be updated to ease backporting
+fixes from their source, for this reason the file docs/misra/exclude-list.json
+is kept as a source of all these files that are external to the Xen project.
 
-For this reason the file docs/misra/exclude-list.json is used to exclude every
-entry listed in that file from the final report.
-Currently only the cppcheck analysis will use this file.
+Every entry of the file can be linked to different checkers, so that this list
+can be used by multiple scripts selecting only the required entries.
 
 Here is an example of the exclude-list.json file::
 
@@ -20,11 +19,13 @@ Here is an example of the exclude-list.json file::
 |    "content": [
 |        {
 |            "rel_path": "relative/path/from/xen/file",
-|            "comment": "This file is originated from ..."
+|            "comment": "This file is originated from ...",
+|            "checkers": "xen-analysis"
 |        },
 |        {
 |            "rel_path": "relative/path/from/xen/folder/*",
-|            "comment": "This folder is a library"
+|            "comment": "This folder is a library",
+|            "checkers": "xen-analysis some-checker"
 |        },
 |        {
 |            "rel_path": "relative/path/from/xen/mem*.c",
@@ -39,6 +40,12 @@ Here is an explanation of the fields inside an object of the "content" array:
    match more than one file/folder at the time. This field is mandatory.
  - comment: an optional comment to explain why the file is removed from the
    analysis.
+ - checkers: an optional list of checkers that will exclude this entries from
+   their results. This field is optional and when not specified, it means every
+   checker will use that entry.
+   Current implemented values for this field are:
+    - xen-analysis: the xen-analysis.py script exclude this entry for both MISRA
+      and static analysis scan. (Implemented only for Cppcheck tool)
 
 To ease the review and the modifications of the entries, they shall be listed in
 alphabetical order referring to the rel_path field.
diff --git a/xen/scripts/xen_analysis/exclusion_file_list.py b/xen/scripts/xen_analysis/exclusion_file_list.py
index 79ebd34f55..8b10665a19 100644
--- a/xen/scripts/xen_analysis/exclusion_file_list.py
+++ b/xen/scripts/xen_analysis/exclusion_file_list.py
@@ -9,7 +9,7 @@ class ExclusionFileListError(Exception):
 
 def cppcheck_exclusion_file_list(input_file):
     ret = []
-    excl_list = load_exclusion_file_list(input_file)
+    excl_list = load_exclusion_file_list(input_file, "xen-analysis")
 
     for entry in excl_list:
         # Prepending * to the relative path to match every path where the Xen
@@ -25,7 +25,7 @@ def cppcheck_exclusion_file_list(input_file):
 # If the first entry contained a wildcard '*', the second entry will have an
 # array of the solved absolute path for that entry.
 # Returns [('path',[path,path,...]), ('path',[path,path,...]), ...]
-def load_exclusion_file_list(input_file):
+def load_exclusion_file_list(input_file, checker=""):
     ret = []
     try:
         with open(input_file, "rt") as handle:
@@ -51,6 +51,18 @@ def load_exclusion_file_list(input_file):
             raise ExclusionFileListError(
                 "Malformed JSON entry: rel_path field not found!"
             )
+        # Check the checker field
+        try:
+            entry_checkers = entry['checkers']
+        except KeyError:
+            # If the field doesn't exists, assume that this entry is for every
+            # checker
+            entry_checkers = checker
+
+        # Check if this entry is for the selected checker
+        if checker not in entry_checkers:
+            continue
+
         abs_path = settings.xen_dir + "/" + path
         check_path = [abs_path]
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Nov 13 23:00:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Nov 2023 23:00:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.632060.985992 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2fuU-0003ky-G4; Mon, 13 Nov 2023 23:00:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 632060.985992; Mon, 13 Nov 2023 23:00: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 1r2fuU-0003kY-DC; Mon, 13 Nov 2023 23:00:02 +0000
Received: by outflank-mailman (input) for mailman id 632060;
 Mon, 13 Nov 2023 23:00: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 1r2fuT-0003aO-Hk
 for xen-changelog@lists.xenproject.org; Mon, 13 Nov 2023 23:00: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 1r2fuT-000413-Fl
 for xen-changelog@lists.xenproject.org; Mon, 13 Nov 2023 23:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2fuT-00053c-Em
 for xen-changelog@lists.xenproject.org; Mon, 13 Nov 2023 23: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=A2NPztYN646e0mVf//ttBY2vrK0HEaRenH+hUvV36us=; b=Cke5nCRxUp2PO8q+D3P7HQjvLw
	oQ36AoGgukfWie3/Ddptrr7s3+J47EkhLs5JuLvDeVWbd+LX93wSAiW92a+nwBTWkdxaJShLLIzg+
	dmKND+p+Weo5X9TYbyo9Ui/hxzDCPPacYcsaQplpHeSOrAyKw0KEfXtXWK5r9YrLt0bU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] docs/misra: Add missing SPDX tag
Message-Id: <E1r2fuT-00053c-Em@xenbits.xenproject.org>
Date: Mon, 13 Nov 2023 23:00:01 +0000

commit 5ac921002af98841a03758753b291ccf792885c7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 8 13:51:37 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Nov 13 15:01:05 2023 +0000

    docs/misra: Add missing SPDX tag
    
    One file is missing an SDPX tag, but is covered by the blanketing license
    statement in docs/README.sources saying that RST files are CC-BY-4.0
    
    Fixes: 3c911be55f1c ("docs/misra: document the C dialect and translation toolchain assumptions.")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
    (cherry picked from commit 8ee1a332b4083523c5ca715d13a0ea4c52417940)
---
 docs/misra/C-language-toolchain.rst | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/docs/misra/C-language-toolchain.rst b/docs/misra/C-language-toolchain.rst
index 4c4942a113..2866cb191b 100644
--- a/docs/misra/C-language-toolchain.rst
+++ b/docs/misra/C-language-toolchain.rst
@@ -1,3 +1,5 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
 =============================================
 C Dialect and Translation Assumptions for Xen
 =============================================
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Mon Nov 13 23:00:12 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Nov 2023 23:00:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.632061.985996 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2fue-0004NP-Hk; Mon, 13 Nov 2023 23:00:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 632061.985996; Mon, 13 Nov 2023 23:00:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2fue-0004NI-Ei; Mon, 13 Nov 2023 23:00:12 +0000
Received: by outflank-mailman (input) for mailman id 632061;
 Mon, 13 Nov 2023 23:00:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2fud-0004NC-Kh
 for xen-changelog@lists.xenproject.org; Mon, 13 Nov 2023 23:00:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2fud-00043V-Jm
 for xen-changelog@lists.xenproject.org; Mon, 13 Nov 2023 23:00:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2fud-000551-Hy
 for xen-changelog@lists.xenproject.org; Mon, 13 Nov 2023 23:00:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KeMC2hLLi6xMFkcrHTfFuY2T6w+j98RkPM1oINX3Whk=; b=FLKss81aC5+OjNhULszwg8rSf7
	iurPakbgwdaIvV4yk3PCla842ra49eqF2kBQ+cKWo798Uljt080ngcSXmVQrekwFqXF3gyuxLiJPX
	a7o8XgVwb/f19n8XwVHheYWDzmmITCBaKgbaD8q4udaBkY9HyBUniqWmpy2Ph9nXhEHA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] docs: Delete kconfig docs to fix licensing violation
Message-Id: <E1r2fud-000551-Hy@xenbits.xenproject.org>
Date: Mon, 13 Nov 2023 23:00:11 +0000

commit c1cb9370ebea4e7fa907cbbe8ad2bc85565902a7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 8 14:23:46 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Nov 13 15:01:05 2023 +0000

    docs: Delete kconfig docs to fix licensing violation
    
    These 3 Kconfig docs were imported from Linux erroneously.  They are
    GPL-2.0-only in Linux, but have no SPDX tag and were placed in such a way to
    be included by the blanket statement saying that all RST files are CC-BY-4.0.
    
    We should not be carrying a shadow copy of these docs.  They aren't even wired
    into our Sphinx docs, and anyone wanting to refer to Kconfig docs is going to
    look at the Linux docs anyway.  These, and more docs can be found at:
    
      https://www.kernel.org/doc/html/latest/kbuild/
    
    which also have corrections vs the snapshot we took.
    
    Fixes: f80fe2b34f08 ("xen: Update Kconfig to Linux v5.4")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
    (cherry picked from commit 044503f61c9571f3be06e105d59253f3c5632442)
---
 docs/misc/kconfig-language.rst       | 701 -----------------------------------
 docs/misc/kconfig-macro-language.rst | 247 ------------
 docs/misc/kconfig.rst                | 304 ---------------
 xen/tools/kconfig/README.source      |   6 +-
 4 files changed, 4 insertions(+), 1254 deletions(-)

diff --git a/docs/misc/kconfig-language.rst b/docs/misc/kconfig-language.rst
deleted file mode 100644
index 74bef19f69..0000000000
--- a/docs/misc/kconfig-language.rst
+++ /dev/null
@@ -1,701 +0,0 @@
-================
-Kconfig Language
-================
-
-Introduction
-------------
-
-The configuration database is a collection of configuration options
-organized in a tree structure::
-
-	+- Code maturity level options
-	|  +- Prompt for development and/or incomplete code/drivers
-	+- General setup
-	|  +- Networking support
-	|  +- System V IPC
-	|  +- BSD Process Accounting
-	|  +- Sysctl support
-	+- Loadable module support
-	|  +- Enable loadable module support
-	|     +- Set version information on all module symbols
-	|     +- Kernel module loader
-	+- ...
-
-Every entry has its own dependencies. These dependencies are used
-to determine the visibility of an entry. Any child entry is only
-visible if its parent entry is also visible.
-
-Menu entries
-------------
-
-Most entries define a config option; all other entries help to organize
-them. A single configuration option is defined like this::
-
-  config MODVERSIONS
-	bool "Set version information on all module symbols"
-	depends on MODULES
-	help
-	  Usually, modules have to be recompiled whenever you switch to a new
-	  kernel.  ...
-
-Every line starts with a key word and can be followed by multiple
-arguments.  "config" starts a new config entry. The following lines
-define attributes for this config option. Attributes can be the type of
-the config option, input prompt, dependencies, help text and default
-values. A config option can be defined multiple times with the same
-name, but every definition can have only a single input prompt and the
-type must not conflict.
-
-Menu attributes
----------------
-
-A menu entry can have a number of attributes. Not all of them are
-applicable everywhere (see syntax).
-
-- type definition: "bool"/"tristate"/"string"/"hex"/"int"
-
-  Every config option must have a type. There are only two basic types:
-  tristate and string; the other types are based on these two. The type
-  definition optionally accepts an input prompt, so these two examples
-  are equivalent::
-
-	bool "Networking support"
-
-  and::
-
-	bool
-	prompt "Networking support"
-
-- input prompt: "prompt" <prompt> ["if" <expr>]
-
-  Every menu entry can have at most one prompt, which is used to display
-  to the user. Optionally dependencies only for this prompt can be added
-  with "if".
-
-- default value: "default" <expr> ["if" <expr>]
-
-  A config option can have any number of default values. If multiple
-  default values are visible, only the first defined one is active.
-  Default values are not limited to the menu entry where they are
-  defined. This means the default can be defined somewhere else or be
-  overridden by an earlier definition.
-  The default value is only assigned to the config symbol if no other
-  value was set by the user (via the input prompt above). If an input
-  prompt is visible the default value is presented to the user and can
-  be overridden by him.
-  Optionally, dependencies only for this default value can be added with
-  "if".
-
- The default value deliberately defaults to 'n' in order to avoid bloating the
- build. With few exceptions, new config options should not change this. The
- intent is for "make oldconfig" to add as little as possible to the config from
- release to release.
-
- Note:
-	Things that merit "default y/m" include:
-
-	a) A new Kconfig option for something that used to always be built
-	   should be "default y".
-
-	b) A new gatekeeping Kconfig option that hides/shows other Kconfig
-	   options (but does not generate any code of its own), should be
-	   "default y" so people will see those other options.
-
-	c) Sub-driver behavior or similar options for a driver that is
-	   "default n". This allows you to provide sane defaults.
-
-	d) Hardware or infrastructure that everybody expects, such as CONFIG_NET
-	   or CONFIG_BLOCK. These are rare exceptions.
-
-- type definition + default value::
-
-	"def_bool"/"def_tristate" <expr> ["if" <expr>]
-
-  This is a shorthand notation for a type definition plus a value.
-  Optionally dependencies for this default value can be added with "if".
-
-- dependencies: "depends on" <expr>
-
-  This defines a dependency for this menu entry. If multiple
-  dependencies are defined, they are connected with '&&'. Dependencies
-  are applied to all other options within this menu entry (which also
-  accept an "if" expression), so these two examples are equivalent::
-
-	bool "foo" if BAR
-	default y if BAR
-
-  and::
-
-	depends on BAR
-	bool "foo"
-	default y
-
-- reverse dependencies: "select" <symbol> ["if" <expr>]
-
-  While normal dependencies reduce the upper limit of a symbol (see
-  below), reverse dependencies can be used to force a lower limit of
-  another symbol. The value of the current menu symbol is used as the
-  minimal value <symbol> can be set to. If <symbol> is selected multiple
-  times, the limit is set to the largest selection.
-  Reverse dependencies can only be used with boolean or tristate
-  symbols.
-
-  Note:
-	select should be used with care. select will force
-	a symbol to a value without visiting the dependencies.
-	By abusing select you are able to select a symbol FOO even
-	if FOO depends on BAR that is not set.
-	In general use select only for non-visible symbols
-	(no prompts anywhere) and for symbols with no dependencies.
-	That will limit the usefulness but on the other hand avoid
-	the illegal configurations all over.
-
-- weak reverse dependencies: "imply" <symbol> ["if" <expr>]
-
-  This is similar to "select" as it enforces a lower limit on another
-  symbol except that the "implied" symbol's value may still be set to n
-  from a direct dependency or with a visible prompt.
-
-  Given the following example::
-
-    config FOO
-	tristate
-	imply BAZ
-
-    config BAZ
-	tristate
-	depends on BAR
-
-  The following values are possible:
-
-	===		===		=============	==============
-	FOO		BAR		BAZ's default	choice for BAZ
-	===		===		=============	==============
-	n		y		n		N/m/y
-	m		y		m		M/y/n
-	y		y		y		Y/n
-	y		n		*		N
-	===		===		=============	==============
-
-  This is useful e.g. with multiple drivers that want to indicate their
-  ability to hook into a secondary subsystem while allowing the user to
-  configure that subsystem out without also having to unset these drivers.
-
-- limiting menu display: "visible if" <expr>
-
-  This attribute is only applicable to menu blocks, if the condition is
-  false, the menu block is not displayed to the user (the symbols
-  contained there can still be selected by other symbols, though). It is
-  similar to a conditional "prompt" attribute for individual menu
-  entries. Default value of "visible" is true.
-
-- numerical ranges: "range" <symbol> <symbol> ["if" <expr>]
-
-  This allows to limit the range of possible input values for int
-  and hex symbols. The user can only input a value which is larger than
-  or equal to the first symbol and smaller than or equal to the second
-  symbol.
-
-- help text: "help" or "---help---"
-
-  This defines a help text. The end of the help text is determined by
-  the indentation level, this means it ends at the first line which has
-  a smaller indentation than the first line of the help text.
-  "---help---" and "help" do not differ in behaviour, "---help---" is
-  used to help visually separate configuration logic from help within
-  the file as an aid to developers.
-
-- misc options: "option" <symbol>[=<value>]
-
-  Various less common options can be defined via this option syntax,
-  which can modify the behaviour of the menu entry and its config
-  symbol. These options are currently possible:
-
-  - "defconfig_list"
-    This declares a list of default entries which can be used when
-    looking for the default configuration (which is used when the main
-    .config doesn't exists yet.)
-
-  - "modules"
-    This declares the symbol to be used as the MODULES symbol, which
-    enables the third modular state for all config symbols.
-    At most one symbol may have the "modules" option set.
-
-  - "allnoconfig_y"
-    This declares the symbol as one that should have the value y when
-    using "allnoconfig". Used for symbols that hide other symbols.
-
-Menu dependencies
------------------
-
-Dependencies define the visibility of a menu entry and can also reduce
-the input range of tristate symbols. The tristate logic used in the
-expressions uses one more state than normal boolean logic to express the
-module state. Dependency expressions have the following syntax::
-
-  <expr> ::= <symbol>                           (1)
-           <symbol> '=' <symbol>                (2)
-           <symbol> '!=' <symbol>               (3)
-           <symbol1> '<' <symbol2>              (4)
-           <symbol1> '>' <symbol2>              (4)
-           <symbol1> '<=' <symbol2>             (4)
-           <symbol1> '>=' <symbol2>             (4)
-           '(' <expr> ')'                       (5)
-           '!' <expr>                           (6)
-           <expr> '&&' <expr>                   (7)
-           <expr> '||' <expr>                   (8)
-
-Expressions are listed in decreasing order of precedence.
-
-(1) Convert the symbol into an expression. Boolean and tristate symbols
-    are simply converted into the respective expression values. All
-    other symbol types result in 'n'.
-(2) If the values of both symbols are equal, it returns 'y',
-    otherwise 'n'.
-(3) If the values of both symbols are equal, it returns 'n',
-    otherwise 'y'.
-(4) If value of <symbol1> is respectively lower, greater, lower-or-equal,
-    or greater-or-equal than value of <symbol2>, it returns 'y',
-    otherwise 'n'.
-(5) Returns the value of the expression. Used to override precedence.
-(6) Returns the result of (2-/expr/).
-(7) Returns the result of min(/expr/, /expr/).
-(8) Returns the result of max(/expr/, /expr/).
-
-An expression can have a value of 'n', 'm' or 'y' (or 0, 1, 2
-respectively for calculations). A menu entry becomes visible when its
-expression evaluates to 'm' or 'y'.
-
-There are two types of symbols: constant and non-constant symbols.
-Non-constant symbols are the most common ones and are defined with the
-'config' statement. Non-constant symbols consist entirely of alphanumeric
-characters or underscores.
-Constant symbols are only part of expressions. Constant symbols are
-always surrounded by single or double quotes. Within the quote, any
-other character is allowed and the quotes can be escaped using '\'.
-
-Menu structure
---------------
-
-The position of a menu entry in the tree is determined in two ways. First
-it can be specified explicitly::
-
-  menu "Network device support"
-	depends on NET
-
-  config NETDEVICES
-	...
-
-  endmenu
-
-All entries within the "menu" ... "endmenu" block become a submenu of
-"Network device support". All subentries inherit the dependencies from
-the menu entry, e.g. this means the dependency "NET" is added to the
-dependency list of the config option NETDEVICES.
-
-The other way to generate the menu structure is done by analyzing the
-dependencies. If a menu entry somehow depends on the previous entry, it
-can be made a submenu of it. First, the previous (parent) symbol must
-be part of the dependency list and then one of these two conditions
-must be true:
-
-- the child entry must become invisible, if the parent is set to 'n'
-- the child entry must only be visible, if the parent is visible::
-
-    config MODULES
-	bool "Enable loadable module support"
-
-    config MODVERSIONS
-	bool "Set version information on all module symbols"
-	depends on MODULES
-
-    comment "module support disabled"
-	depends on !MODULES
-
-MODVERSIONS directly depends on MODULES, this means it's only visible if
-MODULES is different from 'n'. The comment on the other hand is only
-visible when MODULES is set to 'n'.
-
-
-Kconfig syntax
---------------
-
-The configuration file describes a series of menu entries, where every
-line starts with a keyword (except help texts). The following keywords
-end a menu entry:
-
-- config
-- menuconfig
-- choice/endchoice
-- comment
-- menu/endmenu
-- if/endif
-- source
-
-The first five also start the definition of a menu entry.
-
-config::
-
-	"config" <symbol>
-	<config options>
-
-This defines a config symbol <symbol> and accepts any of above
-attributes as options.
-
-menuconfig::
-
-	"menuconfig" <symbol>
-	<config options>
-
-This is similar to the simple config entry above, but it also gives a
-hint to front ends, that all suboptions should be displayed as a
-separate list of options. To make sure all the suboptions will really
-show up under the menuconfig entry and not outside of it, every item
-from the <config options> list must depend on the menuconfig symbol.
-In practice, this is achieved by using one of the next two constructs::
-
-  (1):
-  menuconfig M
-  if M
-      config C1
-      config C2
-  endif
-
-  (2):
-  menuconfig M
-  config C1
-      depends on M
-  config C2
-      depends on M
-
-In the following examples (3) and (4), C1 and C2 still have the M
-dependency, but will not appear under menuconfig M anymore, because
-of C0, which doesn't depend on M::
-
-  (3):
-  menuconfig M
-      config C0
-  if M
-      config C1
-      config C2
-  endif
-
-  (4):
-  menuconfig M
-  config C0
-  config C1
-      depends on M
-  config C2
-      depends on M
-
-choices::
-
-	"choice" [symbol]
-	<choice options>
-	<choice block>
-	"endchoice"
-
-This defines a choice group and accepts any of the above attributes as
-options. A choice can only be of type bool or tristate.  If no type is
-specified for a choice, its type will be determined by the type of
-the first choice element in the group or remain unknown if none of the
-choice elements have a type specified, as well.
-
-While a boolean choice only allows a single config entry to be
-selected, a tristate choice also allows any number of config entries
-to be set to 'm'. This can be used if multiple drivers for a single
-hardware exists and only a single driver can be compiled/loaded into
-the kernel, but all drivers can be compiled as modules.
-
-A choice accepts another option "optional", which allows to set the
-choice to 'n' and no entry needs to be selected.
-If no [symbol] is associated with a choice, then you can not have multiple
-definitions of that choice. If a [symbol] is associated to the choice,
-then you may define the same choice (i.e. with the same entries) in another
-place.
-
-comment::
-
-	"comment" <prompt>
-	<comment options>
-
-This defines a comment which is displayed to the user during the
-configuration process and is also echoed to the output files. The only
-possible options are dependencies.
-
-menu::
-
-	"menu" <prompt>
-	<menu options>
-	<menu block>
-	"endmenu"
-
-This defines a menu block, see "Menu structure" above for more
-information. The only possible options are dependencies and "visible"
-attributes.
-
-if::
-
-	"if" <expr>
-	<if block>
-	"endif"
-
-This defines an if block. The dependency expression <expr> is appended
-to all enclosed menu entries.
-
-source::
-
-	"source" <prompt>
-
-This reads the specified configuration file. This file is always parsed.
-
-mainmenu::
-
-	"mainmenu" <prompt>
-
-This sets the config program's title bar if the config program chooses
-to use it. It should be placed at the top of the configuration, before any
-other statement.
-
-'#' Kconfig source file comment:
-
-An unquoted '#' character anywhere in a source file line indicates
-the beginning of a source file comment.  The remainder of that line
-is a comment.
-
-
-Kconfig hints
--------------
-This is a collection of Kconfig tips, most of which aren't obvious at
-first glance and most of which have become idioms in several Kconfig
-files.
-
-Adding common features and make the usage configurable
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-It is a common idiom to implement a feature/functionality that are
-relevant for some architectures but not all.
-The recommended way to do so is to use a config variable named HAVE_*
-that is defined in a common Kconfig file and selected by the relevant
-architectures.
-An example is the generic IOMAP functionality.
-
-We would in lib/Kconfig see::
-
-  # Generic IOMAP is used to ...
-  config HAVE_GENERIC_IOMAP
-
-  config GENERIC_IOMAP
-	depends on HAVE_GENERIC_IOMAP && FOO
-
-And in lib/Makefile we would see::
-
-	obj-$(CONFIG_GENERIC_IOMAP) += iomap.o
-
-For each architecture using the generic IOMAP functionality we would see::
-
-  config X86
-	select ...
-	select HAVE_GENERIC_IOMAP
-	select ...
-
-Note: we use the existing config option and avoid creating a new
-config variable to select HAVE_GENERIC_IOMAP.
-
-Note: the use of the internal config variable HAVE_GENERIC_IOMAP, it is
-introduced to overcome the limitation of select which will force a
-config option to 'y' no matter the dependencies.
-The dependencies are moved to the symbol GENERIC_IOMAP and we avoid the
-situation where select forces a symbol equals to 'y'.
-
-Adding features that need compiler support
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-There are several features that need compiler support. The recommended way
-to describe the dependency on the compiler feature is to use "depends on"
-followed by a test macro::
-
-  config STACKPROTECTOR
-	bool "Stack Protector buffer overflow detection"
-	depends on $(cc-option,-fstack-protector)
-	...
-
-If you need to expose a compiler capability to makefiles and/or C source files,
-`CC_HAS_` is the recommended prefix for the config option::
-
-  config CC_HAS_STACKPROTECTOR_NONE
-	def_bool $(cc-option,-fno-stack-protector)
-
-Build as module only
-~~~~~~~~~~~~~~~~~~~~
-To restrict a component build to module-only, qualify its config symbol
-with "depends on m".  E.g.::
-
-  config FOO
-	depends on BAR && m
-
-limits FOO to module (=m) or disabled (=n).
-
-Kconfig recursive dependency limitations
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-If you've hit the Kconfig error: "recursive dependency detected" you've run
-into a recursive dependency issue with Kconfig, a recursive dependency can be
-summarized as a circular dependency. The kconfig tools need to ensure that
-Kconfig files comply with specified configuration requirements. In order to do
-that kconfig must determine the values that are possible for all Kconfig
-symbols, this is currently not possible if there is a circular relation
-between two or more Kconfig symbols. For more details refer to the "Simple
-Kconfig recursive issue" subsection below. Kconfig does not do recursive
-dependency resolution; this has a few implications for Kconfig file writers.
-We'll first explain why this issues exists and then provide an example
-technical limitation which this brings upon Kconfig developers. Eager
-developers wishing to try to address this limitation should read the next
-subsections.
-
-Simple Kconfig recursive issue
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Read: Documentation/kbuild/Kconfig.recursion-issue-01
-
-Test with::
-
-  make KBUILD_KCONFIG=Documentation/kbuild/Kconfig.recursion-issue-01 allnoconfig
-
-Cumulative Kconfig recursive issue
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Read: Documentation/kbuild/Kconfig.recursion-issue-02
-
-Test with::
-
-  make KBUILD_KCONFIG=Documentation/kbuild/Kconfig.recursion-issue-02 allnoconfig
-
-Practical solutions to kconfig recursive issue
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Developers who run into the recursive Kconfig issue have two options
-at their disposal. We document them below and also provide a list of
-historical issues resolved through these different solutions.
-
-  a) Remove any superfluous "select FOO" or "depends on FOO"
-  b) Match dependency semantics:
-
-	b1) Swap all "select FOO" to "depends on FOO" or,
-
-	b2) Swap all "depends on FOO" to "select FOO"
-
-The resolution to a) can be tested with the sample Kconfig file
-Documentation/kbuild/Kconfig.recursion-issue-01 through the removal
-of the "select CORE" from CORE_BELL_A_ADVANCED as that is implicit already
-since CORE_BELL_A depends on CORE. At times it may not be possible to remove
-some dependency criteria, for such cases you can work with solution b).
-
-The two different resolutions for b) can be tested in the sample Kconfig file
-Documentation/kbuild/Kconfig.recursion-issue-02.
-
-Below is a list of examples of prior fixes for these types of recursive issues;
-all errors appear to involve one or more select's and one or more "depends on".
-
-============    ===================================
-commit          fix
-============    ===================================
-06b718c01208    select A -> depends on A
-c22eacfe82f9    depends on A -> depends on B
-6a91e854442c    select A -> depends on A
-118c565a8f2e    select A -> select B
-f004e5594705    select A -> depends on A
-c7861f37b4c6    depends on A -> (null)
-80c69915e5fb    select A -> (null)              (1)
-c2218e26c0d0    select A -> depends on A        (1)
-d6ae99d04e1c    select A -> depends on A
-95ca19cf8cbf    select A -> depends on A
-8f057d7bca54    depends on A -> (null)
-8f057d7bca54    depends on A -> select A
-a0701f04846e    select A -> depends on A
-0c8b92f7f259    depends on A -> (null)
-e4e9e0540928    select A -> depends on A        (2)
-7453ea886e87    depends on A > (null)           (1)
-7b1fff7e4fdf    select A -> depends on A
-86c747d2a4f0    select A -> depends on A
-d9f9ab51e55e    select A -> depends on A
-0c51a4d8abd6    depends on A -> select A        (3)
-e98062ed6dc4    select A -> depends on A        (3)
-91e5d284a7f1    select A -> (null)
-============    ===================================
-
-(1) Partial (or no) quote of error.
-(2) That seems to be the gist of that fix.
-(3) Same error.
-
-Future kconfig work
-~~~~~~~~~~~~~~~~~~~
-
-Work on kconfig is welcomed on both areas of clarifying semantics and on
-evaluating the use of a full SAT solver for it. A full SAT solver can be
-desirable to enable more complex dependency mappings and / or queries,
-for instance on possible use case for a SAT solver could be that of handling
-the current known recursive dependency issues. It is not known if this would
-address such issues but such evaluation is desirable. If support for a full SAT
-solver proves too complex or that it cannot address recursive dependency issues
-Kconfig should have at least clear and well defined semantics which also
-addresses and documents limitations or requirements such as the ones dealing
-with recursive dependencies.
-
-Further work on both of these areas is welcomed on Kconfig. We elaborate
-on both of these in the next two subsections.
-
-Semantics of Kconfig
-~~~~~~~~~~~~~~~~~~~~
-
-The use of Kconfig is broad, Linux is now only one of Kconfig's users:
-one study has completed a broad analysis of Kconfig use in 12 projects [0]_.
-Despite its widespread use, and although this document does a reasonable job
-in documenting basic Kconfig syntax a more precise definition of Kconfig
-semantics is welcomed. One project deduced Kconfig semantics through
-the use of the xconfig configurator [1]_. Work should be done to confirm if
-the deduced semantics matches our intended Kconfig design goals.
-
-Having well defined semantics can be useful for tools for practical
-evaluation of depenencies, for instance one such use known case was work to
-express in boolean abstraction of the inferred semantics of Kconfig to
-translate Kconfig logic into boolean formulas and run a SAT solver on this to
-find dead code / features (always inactive), 114 dead features were found in
-Linux using this methodology [1]_ (Section 8: Threats to validity).
-
-Confirming this could prove useful as Kconfig stands as one of the the leading
-industrial variability modeling languages [1]_ [2]_. Its study would help
-evaluate practical uses of such languages, their use was only theoretical
-and real world requirements were not well understood. As it stands though
-only reverse engineering techniques have been used to deduce semantics from
-variability modeling languages such as Kconfig [3]_.
-
-.. [0] http://www.eng.uwaterloo.ca/~shshe/kconfig_semantics.pdf
-.. [1] http://gsd.uwaterloo.ca/sites/default/files/vm-2013-berger.pdf
-.. [2] http://gsd.uwaterloo.ca/sites/default/files/ase241-berger_0.pdf
-.. [3] http://gsd.uwaterloo.ca/sites/default/files/icse2011.pdf
-
-Full SAT solver for Kconfig
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Although SAT solvers [4]_ haven't yet been used by Kconfig directly, as noted
-in the previous subsection, work has been done however to express in boolean
-abstraction the inferred semantics of Kconfig to translate Kconfig logic into
-boolean formulas and run a SAT solver on it [5]_. Another known related project
-is CADOS [6]_ (former VAMOS [7]_) and the tools, mainly undertaker [8]_, which
-has been introduced first with [9]_.  The basic concept of undertaker is to
-exract variability models from Kconfig, and put them together with a
-propositional formula extracted from CPP #ifdefs and build-rules into a SAT
-solver in order to find dead code, dead files, and dead symbols. If using a SAT
-solver is desirable on Kconfig one approach would be to evaluate repurposing
-such efforts somehow on Kconfig. There is enough interest from mentors of
-existing projects to not only help advise how to integrate this work upstream
-but also help maintain it long term. Interested developers should visit:
-
-http://kernelnewbies.org/KernelProjects/kconfig-sat
-
-.. [4] http://www.cs.cornell.edu/~sabhar/chapters/SATSolvers-KR-Handbook.pdf
-.. [5] http://gsd.uwaterloo.ca/sites/default/files/vm-2013-berger.pdf
-.. [6] https://cados.cs.fau.de
-.. [7] https://vamos.cs.fau.de
-.. [8] https://undertaker.cs.fau.de
-.. [9] https://www4.cs.fau.de/Publications/2011/tartler_11_eurosys.pdf
diff --git a/docs/misc/kconfig-macro-language.rst b/docs/misc/kconfig-macro-language.rst
deleted file mode 100644
index 35b3263b7e..0000000000
--- a/docs/misc/kconfig-macro-language.rst
+++ /dev/null
@@ -1,247 +0,0 @@
-======================
-Kconfig macro language
-======================
-
-Concept
--------
-
-The basic idea was inspired by Make. When we look at Make, we notice sort of
-two languages in one. One language describes dependency graphs consisting of
-targets and prerequisites. The other is a macro language for performing textual
-substitution.
-
-There is clear distinction between the two language stages. For example, you
-can write a makefile like follows::
-
-    APP := foo
-    SRC := foo.c
-    CC := gcc
-
-    $(APP): $(SRC)
-            $(CC) -o $(APP) $(SRC)
-
-The macro language replaces the variable references with their expanded form,
-and handles as if the source file were input like follows::
-
-    foo: foo.c
-            gcc -o foo foo.c
-
-Then, Make analyzes the dependency graph and determines the targets to be
-updated.
-
-The idea is quite similar in Kconfig - it is possible to describe a Kconfig
-file like this::
-
-    CC := gcc
-
-    config CC_HAS_FOO
-            def_bool $(shell, $(srctree)/scripts/gcc-check-foo.sh $(CC))
-
-The macro language in Kconfig processes the source file into the following
-intermediate::
-
-    config CC_HAS_FOO
-            def_bool y
-
-Then, Kconfig moves onto the evaluation stage to resolve inter-symbol
-dependency as explained in kconfig-language.txt.
-
-
-Variables
----------
-
-Like in Make, a variable in Kconfig works as a macro variable.  A macro
-variable is expanded "in place" to yield a text string that may then be
-expanded further. To get the value of a variable, enclose the variable name in
-$( ). The parentheses are required even for single-letter variable names; $X is
-a syntax error. The curly brace form as in ${CC} is not supported either.
-
-There are two types of variables: simply expanded variables and recursively
-expanded variables.
-
-A simply expanded variable is defined using the := assignment operator. Its
-righthand side is expanded immediately upon reading the line from the Kconfig
-file.
-
-A recursively expanded variable is defined using the = assignment operator.
-Its righthand side is simply stored as the value of the variable without
-expanding it in any way. Instead, the expansion is performed when the variable
-is used.
-
-There is another type of assignment operator; += is used to append text to a
-variable. The righthand side of += is expanded immediately if the lefthand
-side was originally defined as a simple variable. Otherwise, its evaluation is
-deferred.
-
-The variable reference can take parameters, in the following form::
-
-  $(name,arg1,arg2,arg3)
-
-You can consider the parameterized reference as a function. (more precisely,
-"user-defined function" in contrast to "built-in function" listed below).
-
-Useful functions must be expanded when they are used since the same function is
-expanded differently if different parameters are passed. Hence, a user-defined
-function is defined using the = assignment operator. The parameters are
-referenced within the body definition with $(1), $(2), etc.
-
-In fact, recursively expanded variables and user-defined functions are the same
-internally. (In other words, "variable" is "function with zero argument".)
-When we say "variable" in a broad sense, it includes "user-defined function".
-
-
-Built-in functions
-------------------
-
-Like Make, Kconfig provides several built-in functions. Every function takes a
-particular number of arguments.
-
-In Make, every built-in function takes at least one argument. Kconfig allows
-zero argument for built-in functions, such as $(fileno), $(lineno). You could
-consider those as "built-in variable", but it is just a matter of how we call
-it after all. Let's say "built-in function" here to refer to natively supported
-functionality.
-
-Kconfig currently supports the following built-in functions.
-
- - $(shell,command)
-
-  The "shell" function accepts a single argument that is expanded and passed
-  to a subshell for execution. The standard output of the command is then read
-  and returned as the value of the function. Every newline in the output is
-  replaced with a space. Any trailing newlines are deleted. The standard error
-  is not returned, nor is any program exit status.
-
- - $(info,text)
-
-  The "info" function takes a single argument and prints it to stdout.
-  It evaluates to an empty string.
-
- - $(warning-if,condition,text)
-
-  The "warning-if" function takes two arguments. If the condition part is "y",
-  the text part is sent to stderr. The text is prefixed with the name of the
-  current Kconfig file and the current line number.
-
- - $(error-if,condition,text)
-
-  The "error-if" function is similar to "warning-if", but it terminates the
-  parsing immediately if the condition part is "y".
-
- - $(filename)
-
-  The 'filename' takes no argument, and $(filename) is expanded to the file
-  name being parsed.
-
- - $(lineno)
-
-  The 'lineno' takes no argument, and $(lineno) is expanded to the line number
-  being parsed.
-
-
-Make vs Kconfig
----------------
-
-Kconfig adopts Make-like macro language, but the function call syntax is
-slightly different.
-
-A function call in Make looks like this::
-
-  $(func-name arg1,arg2,arg3)
-
-The function name and the first argument are separated by at least one
-whitespace. Then, leading whitespaces are trimmed from the first argument,
-while whitespaces in the other arguments are kept. You need to use a kind of
-trick to start the first parameter with spaces. For example, if you want
-to make "info" function print "  hello", you can write like follows::
-
-  empty :=
-  space := $(empty) $(empty)
-  $(info $(space)$(space)hello)
-
-Kconfig uses only commas for delimiters, and keeps all whitespaces in the
-function call. Some people prefer putting a space after each comma delimiter::
-
-  $(func-name, arg1, arg2, arg3)
-
-In this case, "func-name" will receive " arg1", " arg2", " arg3". The presence
-of leading spaces may matter depending on the function. The same applies to
-Make - for example, $(subst .c, .o, $(sources)) is a typical mistake; it
-replaces ".c" with " .o".
-
-In Make, a user-defined function is referenced by using a built-in function,
-'call', like this::
-
-    $(call my-func,arg1,arg2,arg3)
-
-Kconfig invokes user-defined functions and built-in functions in the same way.
-The omission of 'call' makes the syntax shorter.
-
-In Make, some functions treat commas verbatim instead of argument separators.
-For example, $(shell echo hello, world) runs the command "echo hello, world".
-Likewise, $(info hello, world) prints "hello, world" to stdout. You could say
-this is _useful_ inconsistency.
-
-In Kconfig, for simpler implementation and grammatical consistency, commas that
-appear in the $( ) context are always delimiters. It means::
-
-  $(shell, echo hello, world)
-
-is an error because it is passing two parameters where the 'shell' function
-accepts only one. To pass commas in arguments, you can use the following trick::
-
-  comma := ,
-  $(shell, echo hello$(comma) world)
-
-
-Caveats
--------
-
-A variable (or function) cannot be expanded across tokens. So, you cannot use
-a variable as a shorthand for an expression that consists of multiple tokens.
-The following works::
-
-    RANGE_MIN := 1
-    RANGE_MAX := 3
-
-    config FOO
-            int "foo"
-            range $(RANGE_MIN) $(RANGE_MAX)
-
-But, the following does not work::
-
-    RANGES := 1 3
-
-    config FOO
-            int "foo"
-            range $(RANGES)
-
-A variable cannot be expanded to any keyword in Kconfig.  The following does
-not work::
-
-    MY_TYPE := tristate
-
-    config FOO
-            $(MY_TYPE) "foo"
-            default y
-
-Obviously from the design, $(shell command) is expanded in the textual
-substitution phase. You cannot pass symbols to the 'shell' function.
-
-The following does not work as expected::
-
-    config ENDIAN_FLAG
-            string
-            default "-mbig-endian" if CPU_BIG_ENDIAN
-            default "-mlittle-endian" if CPU_LITTLE_ENDIAN
-
-    config CC_HAS_ENDIAN_FLAG
-            def_bool $(shell $(srctree)/scripts/gcc-check-flag ENDIAN_FLAG)
-
-Instead, you can do like follows so that any function call is statically
-expanded::
-
-    config CC_HAS_ENDIAN_FLAG
-            bool
-            default $(shell $(srctree)/scripts/gcc-check-flag -mbig-endian) if CPU_BIG_ENDIAN
-            default $(shell $(srctree)/scripts/gcc-check-flag -mlittle-endian) if CPU_LITTLE_ENDIAN
diff --git a/docs/misc/kconfig.rst b/docs/misc/kconfig.rst
deleted file mode 100644
index a9a855f894..0000000000
--- a/docs/misc/kconfig.rst
+++ /dev/null
@@ -1,304 +0,0 @@
-===================
-Kconfig make config
-===================
-
-This file contains some assistance for using `make *config`.
-
-Use "make help" to list all of the possible configuration targets.
-
-The xconfig ('qconf'), menuconfig ('mconf'), and nconfig ('nconf')
-programs also have embedded help text.  Be sure to check that for
-navigation, search, and other general help text.
-
-General
--------
-
-New kernel releases often introduce new config symbols.  Often more
-important, new kernel releases may rename config symbols.  When
-this happens, using a previously working .config file and running
-"make oldconfig" won't necessarily produce a working new kernel
-for you, so you may find that you need to see what NEW kernel
-symbols have been introduced.
-
-To see a list of new config symbols, use::
-
-	cp user/some/old.config .config
-	make listnewconfig
-
-and the config program will list any new symbols, one per line.
-
-Alternatively, you can use the brute force method::
-
-	make oldconfig
-	scripts/diffconfig .config.old .config | less
-
-----------------------------------------------------------------------
-
-Environment variables for `*config`
-
-KCONFIG_CONFIG
---------------
-This environment variable can be used to specify a default kernel config
-file name to override the default name of ".config".
-
-KCONFIG_OVERWRITECONFIG
------------------------
-If you set KCONFIG_OVERWRITECONFIG in the environment, Kconfig will not
-break symlinks when .config is a symlink to somewhere else.
-
-`CONFIG_`
----------
-If you set `CONFIG_` in the environment, Kconfig will prefix all symbols
-with its value when saving the configuration, instead of using the default,
-`CONFIG_`.
-
-----------------------------------------------------------------------
-
-Environment variables for '{allyes/allmod/allno/rand}config'
-
-KCONFIG_ALLCONFIG
------------------
-(partially based on lkml email from/by Rob Landley, re: miniconfig)
-
---------------------------------------------------
-
-The allyesconfig/allmodconfig/allnoconfig/randconfig variants can also
-use the environment variable KCONFIG_ALLCONFIG as a flag or a filename
-that contains config symbols that the user requires to be set to a
-specific value.  If KCONFIG_ALLCONFIG is used without a filename where
-KCONFIG_ALLCONFIG == "" or KCONFIG_ALLCONFIG == "1", `make *config`
-checks for a file named "all{yes/mod/no/def/random}.config"
-(corresponding to the `*config` command that was used) for symbol values
-that are to be forced.  If this file is not found, it checks for a
-file named "all.config" to contain forced values.
-
-This enables you to create "miniature" config (miniconfig) or custom
-config files containing just the config symbols that you are interested
-in.  Then the kernel config system generates the full .config file,
-including symbols of your miniconfig file.
-
-This 'KCONFIG_ALLCONFIG' file is a config file which contains
-(usually a subset of all) preset config symbols.  These variable
-settings are still subject to normal dependency checks.
-
-Examples::
-
-	KCONFIG_ALLCONFIG=custom-notebook.config make allnoconfig
-
-or::
-
-	KCONFIG_ALLCONFIG=mini.config make allnoconfig
-
-or::
-
-	make KCONFIG_ALLCONFIG=mini.config allnoconfig
-
-These examples will disable most options (allnoconfig) but enable or
-disable the options that are explicitly listed in the specified
-mini-config files.
-
-----------------------------------------------------------------------
-
-Environment variables for 'randconfig'
-
-KCONFIG_SEED
-------------
-You can set this to the integer value used to seed the RNG, if you want
-to somehow debug the behaviour of the kconfig parser/frontends.
-If not set, the current time will be used.
-
-KCONFIG_PROBABILITY
--------------------
-This variable can be used to skew the probabilities. This variable can
-be unset or empty, or set to three different formats:
-
-    =======================     ==================  =====================
-	KCONFIG_PROBABILITY     y:n split           y:m:n split
-    =======================     ==================  =====================
-	unset or empty          50  : 50            33  : 33  : 34
-	N                        N  : 100-N         N/2 : N/2 : 100-N
-    [1] N:M                     N+M : 100-(N+M)      N  :  M  : 100-(N+M)
-    [2] N:M:L                    N  : 100-N          M  :  L  : 100-(M+L)
-    =======================     ==================  =====================
-
-where N, M and L are integers (in base 10) in the range [0,100], and so
-that:
-
-    [1] N+M is in the range [0,100]
-
-    [2] M+L is in the range [0,100]
-
-Examples::
-
-	KCONFIG_PROBABILITY=10
-		10% of booleans will be set to 'y', 90% to 'n'
-		5% of tristates will be set to 'y', 5% to 'm', 90% to 'n'
-	KCONFIG_PROBABILITY=15:25
-		40% of booleans will be set to 'y', 60% to 'n'
-		15% of tristates will be set to 'y', 25% to 'm', 60% to 'n'
-	KCONFIG_PROBABILITY=10:15:15
-		10% of booleans will be set to 'y', 90% to 'n'
-		15% of tristates will be set to 'y', 15% to 'm', 70% to 'n'
-
-----------------------------------------------------------------------
-
-Environment variables for 'syncconfig'
-
-KCONFIG_NOSILENTUPDATE
-----------------------
-If this variable has a non-blank value, it prevents silent kernel
-config updates (requires explicit updates).
-
-KCONFIG_AUTOCONFIG
-------------------
-This environment variable can be set to specify the path & name of the
-"auto.conf" file.  Its default value is "include/config/auto.conf".
-
-KCONFIG_TRISTATE
-----------------
-This environment variable can be set to specify the path & name of the
-"tristate.conf" file.  Its default value is "include/config/tristate.conf".
-
-KCONFIG_AUTOHEADER
-------------------
-This environment variable can be set to specify the path & name of the
-"autoconf.h" (header) file.
-Its default value is "include/generated/autoconf.h".
-
-
-----------------------------------------------------------------------
-
-menuconfig
-----------
-
-SEARCHING for CONFIG symbols
-
-Searching in menuconfig:
-
-	The Search function searches for kernel configuration symbol
-	names, so you have to know something close to what you are
-	looking for.
-
-	Example::
-
-		/hotplug
-		This lists all config symbols that contain "hotplug",
-		e.g., HOTPLUG_CPU, MEMORY_HOTPLUG.
-
-	For search help, enter / followed by TAB-TAB (to highlight
-	<Help>) and Enter.  This will tell you that you can also use
-	regular expressions (regexes) in the search string, so if you
-	are not interested in MEMORY_HOTPLUG, you could try::
-
-		/^hotplug
-
-	When searching, symbols are sorted thus:
-
-	  - first, exact matches, sorted alphabetically (an exact match
-	    is when the search matches the complete symbol name);
-	  - then, other matches, sorted alphabetically.
-
-	For example: ^ATH.K matches:
-
-	    ATH5K ATH9K ATH5K_AHB ATH5K_DEBUG [...] ATH6KL ATH6KL_DEBUG
-	    [...] ATH9K_AHB ATH9K_BTCOEX_SUPPORT ATH9K_COMMON [...]
-
-	of which only ATH5K and ATH9K match exactly and so are sorted
-	first (and in alphabetical order), then come all other symbols,
-	sorted in alphabetical order.
-
-----------------------------------------------------------------------
-
-User interface options for 'menuconfig'
-
-MENUCONFIG_COLOR
-----------------
-It is possible to select different color themes using the variable
-MENUCONFIG_COLOR.  To select a theme use::
-
-	make MENUCONFIG_COLOR=<theme> menuconfig
-
-Available themes are::
-
-  - mono       => selects colors suitable for monochrome displays
-  - blackbg    => selects a color scheme with black background
-  - classic    => theme with blue background. The classic look
-  - bluetitle  => a LCD friendly version of classic. (default)
-
-MENUCONFIG_MODE
----------------
-This mode shows all sub-menus in one large tree.
-
-Example::
-
-	make MENUCONFIG_MODE=single_menu menuconfig
-
-----------------------------------------------------------------------
-
-nconfig
--------
-
-nconfig is an alternate text-based configurator.  It lists function
-keys across the bottom of the terminal (window) that execute commands.
-You can also just use the corresponding numeric key to execute the
-commands unless you are in a data entry window.  E.g., instead of F6
-for Save, you can just press 6.
-
-Use F1 for Global help or F3 for the Short help menu.
-
-Searching in nconfig:
-
-	You can search either in the menu entry "prompt" strings
-	or in the configuration symbols.
-
-	Use / to begin a search through the menu entries.  This does
-	not support regular expressions.  Use <Down> or <Up> for
-	Next hit and Previous hit, respectively.  Use <Esc> to
-	terminate the search mode.
-
-	F8 (SymSearch) searches the configuration symbols for the
-	given string or regular expression (regex).
-
-NCONFIG_MODE
-------------
-This mode shows all sub-menus in one large tree.
-
-Example::
-
-	make NCONFIG_MODE=single_menu nconfig
-
-----------------------------------------------------------------------
-
-xconfig
--------
-
-Searching in xconfig:
-
-	The Search function searches for kernel configuration symbol
-	names, so you have to know something close to what you are
-	looking for.
-
-	Example::
-
-		Ctrl-F hotplug
-
-	or::
-
-		Menu: File, Search, hotplug
-
-	lists all config symbol entries that contain "hotplug" in
-	the symbol name.  In this Search dialog, you may change the
-	config setting for any of the entries that are not grayed out.
-	You can also enter a different search string without having
-	to return to the main menu.
-
-
-----------------------------------------------------------------------
-
-gconfig
--------
-
-Searching in gconfig:
-
-	There is no search command in gconfig.  However, gconfig does
-	have several different viewing choices, modes, and options.
diff --git a/xen/tools/kconfig/README.source b/xen/tools/kconfig/README.source
index 44631f68e8..ac394106b9 100644
--- a/xen/tools/kconfig/README.source
+++ b/xen/tools/kconfig/README.source
@@ -5,5 +5,7 @@ in this part of the Xen source tree.
 
 xen/tools/kconfig
 -----------------
-The kconfig directory was originally imported from the linux kernel
-git tree at kernel/git/torvalds/linux.git, path: scripts/kconfig
+The kconfig directory was originally imported from the Linux kernel
+git tree at kernel/git/torvalds/linux.git, path: scripts/kconfig of
+roughly v5.4.  Linux's documentation can be found at:
+https://www.kernel.org/doc/html/latest/kbuild/
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Mon Nov 13 23:00:22 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Nov 2023 23:00:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.632062.986000 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2fuo-0004Pz-Ks; Mon, 13 Nov 2023 23:00:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 632062.986000; Mon, 13 Nov 2023 23:00:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2fuo-0004Pp-II; Mon, 13 Nov 2023 23:00:22 +0000
Received: by outflank-mailman (input) for mailman id 632062;
 Mon, 13 Nov 2023 23:00:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2fun-0004Pd-OF
 for xen-changelog@lists.xenproject.org; Mon, 13 Nov 2023 23:00:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2fun-00043e-Mo
 for xen-changelog@lists.xenproject.org; Mon, 13 Nov 2023 23:00:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2fun-00055Y-Lw
 for xen-changelog@lists.xenproject.org; Mon, 13 Nov 2023 23:00:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uUJH0Iy4yyOuVVfOu8D/SHJ3s2trHpnYRzmm0U5kE3c=; b=365/H7a0lDLDZI8pILEi3UVdLa
	aqtgM+Q+NZUjTOJYFepJWY0gqvRdOqSZshMRKnfbrv0MminfEpfI9f1CYL+cwsHuk8vek8NWyWHDS
	cco1YSCp7bLvn+nKPU9mRtdLoUgTNE48YiWLHAoCEQwB7K3I0FmlvKvgINHo2bQTOz7M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] docs/sphinx: Fix syntax issues in hyperlaunch.rst
Message-Id: <E1r2fun-00055Y-Lw@xenbits.xenproject.org>
Date: Mon, 13 Nov 2023 23:00:21 +0000

commit 455451b5f8a4d2f3a5db9066ae09443606baf9ce
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 8 14:38:33 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Nov 13 15:01:05 2023 +0000

    docs/sphinx: Fix syntax issues in hyperlaunch.rst
    
    sphinx-build reports:
    
      docs/designs/launch/hyperlaunch.rst:111: WARNING: Title underline too short.
      docs/designs/launch/hyperlaunch.rst:203: WARNING: Unexpected indentation.
      docs/designs/launch/hyperlaunch.rst:216: WARNING: Unexpected indentation.
    
    Nested lists require newlines as delimiters.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
    (cherry picked from commit 93ad5dd9743f54cbd1f98658de9cd3ddc7a98fb6)
---
 docs/designs/launch/hyperlaunch.rst | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/docs/designs/launch/hyperlaunch.rst b/docs/designs/launch/hyperlaunch.rst
index 4c138da884..3bed36f976 100644
--- a/docs/designs/launch/hyperlaunch.rst
+++ b/docs/designs/launch/hyperlaunch.rst
@@ -108,7 +108,7 @@ both modes of configuration from the same binary and when paired with its XSM
 flask, provides strong controls that enable fine grained system partitioning.
 
 Hypervisor Launch Landscape
----------
+---------------------------
 
 This comparison table presents the distinctive capabilities of Hyperlaunch with
 reference to existing launch configurations currently available in Xen and
@@ -200,11 +200,13 @@ The benefits of this structure include:
   domains.
 * Commonality: Reuses the same logic for initial basic domain building across
   diverse Xen deployments.
-	* It aligns the x86 initial domain construction with the existing Arm
-	  dom0less feature for construction of multiple domains at boot.
-	* The boot domain implementation may vary significantly with different
-	  deployment use cases, whereas the hypervisor implementation is
-	  common.
+
+  * It aligns the x86 initial domain construction with the existing Arm
+    dom0less feature for construction of multiple domains at boot.
+
+  * The boot domain implementation may vary significantly with different
+    deployment use cases, whereas the hypervisor implementation is common.
+
 * Correctness: Increases confidence in the implementation of domain
   construction, since it is performed by the hypervisor in well maintained and
   centrally tested logic.
@@ -213,8 +215,9 @@ The benefits of this structure include:
 * Capability: Supports launch of advanced configurations where a sequenced
   start of multiple domains is required, or multiple domains are involved in
   startup of the running system configuration
-	* eg. for PCI passthrough on systems where the toolstack runs in a
-	  separate domain to the hardware management.
+
+  * eg. for PCI passthrough on systems where the toolstack runs in a separate
+    domain to the hardware management.
 
 Please, see the ‘Hyperlaunch Device Tree’ design document, which describes the
 configuration module that is provided to the hypervisor by the bootloader.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Mon Nov 13 23:00:32 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Nov 2023 23:00:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.632063.986005 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2fuy-0004T4-Mv; Mon, 13 Nov 2023 23:00:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 632063.986005; Mon, 13 Nov 2023 23:00:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2fuy-0004Sw-Jh; Mon, 13 Nov 2023 23:00:32 +0000
Received: by outflank-mailman (input) for mailman id 632063;
 Mon, 13 Nov 2023 23:00:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2fux-0004So-Qm
 for xen-changelog@lists.xenproject.org; Mon, 13 Nov 2023 23:00:31 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2fux-00043l-Q0
 for xen-changelog@lists.xenproject.org; Mon, 13 Nov 2023 23:00:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2fux-00056C-P0
 for xen-changelog@lists.xenproject.org; Mon, 13 Nov 2023 23:00:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=K1oY2RtTbXdf1hX8wcgauFAeXnO0YB8d3KNGzzLl3tc=; b=dHssFCp6GYH4zatjvBuqxfAL0e
	ebtbQEYUc0DLCOLhh5/SU/fzvuLL/OZC2WE7MvuzuLO8kyvRkJW0hBH1AKtXots9vhQGl5ndpcFDe
	AlSTJXiWGPv1vapWG1XD02kpde/7zz98JdiwJSWt4sLBpSIZOdpRJU7YVeq+3sN1w/H8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] docs/sphinx: Fix syntax issues in exclude-list.rst
Message-Id: <E1r2fux-00056C-P0@xenbits.xenproject.org>
Date: Mon, 13 Nov 2023 23:00:31 +0000

commit 2a0feddbd39f97e86a04448abd0ca6fc52be70cf
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 8 14:47:10 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Nov 13 15:01:05 2023 +0000

    docs/sphinx: Fix syntax issues in exclude-list.rst
    
    sphinx-build reports:
    
      docs/misra/exclude-list.rst:50: WARNING: Inline emphasis start-string without end-string.
    
    '*' either needs escaping, or put in a literal block.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
    (cherry picked from commit ab03b284b4f2fbf405fcd821105c85e1a38d314d)
---
 docs/misra/exclude-list.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/misra/exclude-list.rst b/docs/misra/exclude-list.rst
index c97431a861..0266c8b2fe 100644
--- a/docs/misra/exclude-list.rst
+++ b/docs/misra/exclude-list.rst
@@ -42,5 +42,5 @@ Here is an explanation of the fields inside an object of the "content" array:
 
 To ease the review and the modifications of the entries, they shall be listed in
 alphabetical order referring to the rel_path field.
-Excluded folder paths shall end with '/*' in order to match everything on that
+Excluded folder paths shall end with ``/*`` in order to match everything on that
 folder.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Mon Nov 13 23:00:42 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Nov 2023 23:00:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.632064.986008 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2fv8-0004WD-No; Mon, 13 Nov 2023 23:00:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 632064.986008; Mon, 13 Nov 2023 23:00:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2fv8-0004W5-L9; Mon, 13 Nov 2023 23:00:42 +0000
Received: by outflank-mailman (input) for mailman id 632064;
 Mon, 13 Nov 2023 23:00:41 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2fv7-0004Vv-U0
 for xen-changelog@lists.xenproject.org; Mon, 13 Nov 2023 23:00:41 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2fv7-00043t-TE
 for xen-changelog@lists.xenproject.org; Mon, 13 Nov 2023 23:00:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2fv7-00056h-SJ
 for xen-changelog@lists.xenproject.org; Mon, 13 Nov 2023 23:00:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qPuVma7TfCeSbev42cuky8H0AmMs1lks0jqlkE8MAq0=; b=SFYNAbY1Pa1tXQ0TIvRFKVYirl
	1HEW5HltsMT7o8kig9K7avC45kpcZlItSmpqRrPtbZyq8yqwDjBTlsSzZvTd47Vt4dIiRPBll54MX
	OV1/mIirBt1i53i8F3lbLlEOcQjixv1hwZ4/M2SOYkO1nWDk9WmDzvI9RXWpWOQX1CrM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] docs/sphinx: Fix indexing
Message-Id: <E1r2fv7-00056h-SJ@xenbits.xenproject.org>
Date: Mon, 13 Nov 2023 23:00:41 +0000

commit 509f737d3e80c75f948eb896a08c324287b00adc
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 8 14:53:23 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Nov 13 15:01:05 2023 +0000

    docs/sphinx: Fix indexing
    
    sphinx-build reports:
    
      docs/designs/launch/hyperlaunch.rst: WARNING: document isn't included in any toctree
      docs/designs/launch/hyperlaunch-devicetree.rst: WARNING: document isn't included in any toctree
      docs/misc/xen-makefiles/makefiles.rst: WARNING: document isn't included in any toctree
      docs/misra/C-language-toolchain.rst: WARNING: document isn't included in any toctree
      docs/misra/C-runtime-failures.rst: WARNING: document isn't included in any toctree
      docs/misra/documenting-violations.rst: WARNING: document isn't included in any toctree
      docs/misra/exclude-list.rst: WARNING: document isn't included in any toctree
      docs/misra/xen-static-analysis.rst: WARNING: document isn't included in any toctree
    
    Create an up-to-date index.rst in misra/ create an "unsorted docs" section at
    the top level to contain everything else.  They can be re-filed at a later
    date.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
    (cherry picked from commit fb41228ececea948c7953c8c16fe28fd65c6536b)
---
 docs/index.rst       | 13 +++++++------
 docs/misra/index.rst | 17 +++++++++++++++++
 2 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/docs/index.rst b/docs/index.rst
index f3f779f89c..22fdde8059 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -53,17 +53,18 @@ kind of development environment.
    hypervisor-guide/index
 
 
-MISRA C coding guidelines
--------------------------
+Unsorted documents
+------------------
 
-MISRA C rules and directive to be used as coding guidelines when writing
-Xen hypervisor code.
+Documents in need of some rearranging.
 
 .. toctree::
    :maxdepth: 2
 
-   misra/rules
-   misra/deviations
+   designs/launch/hyperlaunch
+   designs/launch/hyperlaunch-devicetree
+   misc/xen-makefiles/makefiles
+   misra/index
 
 
 Miscellanea
diff --git a/docs/misra/index.rst b/docs/misra/index.rst
new file mode 100644
index 0000000000..280d36450b
--- /dev/null
+++ b/docs/misra/index.rst
@@ -0,0 +1,17 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+MISRA C coding guidelines
+=========================
+
+MISRA C rules and directive to be used as coding guidelines when writing
+Xen hypervisor code and related documents.
+
+.. toctree::
+   :maxdepth: 2
+
+   rules
+   deviations
+   C-language-toolchain
+   documenting-violations
+   exclude-list
+   xen-static-analysis
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Nov 14 03:44:12 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Nov 2023 03:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.632103.986082 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2kLL-0002MF-Qc; Tue, 14 Nov 2023 03:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 632103.986082; Tue, 14 Nov 2023 03: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 1r2kLL-0002M7-Nz; Tue, 14 Nov 2023 03:44:03 +0000
Received: by outflank-mailman (input) for mailman id 632103;
 Tue, 14 Nov 2023 03: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 1r2kLK-0002M1-6E
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03: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 1r2kLK-0001Or-24
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kLK-0007bU-0y
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03: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=QHzdEh5rimxqY1bkEQ25kAwW18fHtUPPwvxA5FLZK4Y=; b=RGrVHG8dJ3/RvdqRmylELuiT2/
	VtLJHLVotBrsURMz943tKGG+yDzuB6Eyxi7S0WuE0gkfYALBfVSartKrcq8tJuUuM4nl5YGeR4whP
	6+wr5rUMgFls4L7NB7oTD9NYhlI39f6kK4OdKDElx/SvaNrJaUt5JI6DMU69G08Uk/Jo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: don't allow Dom0 access to ELCR ports
Message-Id: <E1r2kLK-0007bU-0y@xenbits.xenproject.org>
Date: Tue, 14 Nov 2023 03:44:02 +0000

commit d0ea916fcd64f03a031ce11c5f51f1ad28a59f53
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 13 14:58:29 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 13 14:58:29 2023 +0100

    x86: don't allow Dom0 access to ELCR ports
    
    Much like the other PIC ports, Dom0 has no business touching these. Even
    our own uses are somewhat questionable, as the corresponding IO-APIC
    code in Linux is enclosed in a CONFIG_EISA conditional; I don't think
    there are any x86-64 EISA systems.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/dom0_build.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index e734622400..0276924ba2 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -484,6 +484,10 @@ int __init dom0_setup_permissions(struct domain *d)
     rc |= ioports_deny_access(d, 0x20, 0x21);
     /* Slave Interrupt Controller (PIC). */
     rc |= ioports_deny_access(d, 0xA0, 0xA1);
+
+    /* ELCR of both PICs. */
+    rc |= ioports_deny_access(d, 0x4D0, 0x4D1);
+
     /* Interval Timer (PIT). */
     rc |= ioports_deny_access(d, 0x40, 0x43);
     /* PIT Channel 2 / PC Speaker Control. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 14 03:44:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Nov 2023 03:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.632104.986087 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2kLV-0002Nj-SN; Tue, 14 Nov 2023 03:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 632104.986087; Tue, 14 Nov 2023 03: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 1r2kLV-0002Nb-PJ; Tue, 14 Nov 2023 03:44:13 +0000
Received: by outflank-mailman (input) for mailman id 632104;
 Tue, 14 Nov 2023 03: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 1r2kLU-0002NR-7L
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03: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 1r2kLU-0001Ox-6S
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kLU-0007bv-4S
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03: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=63z9KlKvYfV5c7EP0Jczk7/LBigdph0iP1gNtu7w3Ko=; b=qrKHhVxTsJZvGWithCdcrpU84H
	9KYHmZweNGwPcW1rnDhS0+hHmoPayYwAUpnIp51LoX4xpmzi5X/jIlWVxQHMLA40opkcSGdxQxE9t
	74eOSJz5k7PTEmVHPqdKzBWXRXvQyv4vGSUQz9/TltvoT9m6L64Rr1a9UsG6OeT7sl+U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: avoid generation of stub <asm/pci.h> header
Message-Id: <E1r2kLU-0007bv-4S@xenbits.xenproject.org>
Date: Tue, 14 Nov 2023 03:44:12 +0000

commit dec9e02f3190409bf8ba0d5d0bc20b06e22fc7ec
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Nov 13 15:00:06 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 13 15:00:06 2023 +0100

    xen: avoid generation of stub <asm/pci.h> header
    
    Platforms which doesn't have HAS_PCI enabled it is needed to
    have <asm/pci.h>, which contains only an empty definition of
    struct arch_pci_dev (except Arm, it introduces several Arm-specific
    functions ).
    
    Also, for architectures (such as PPC or RISC-V) on initial
    stages of adding support, it is needed to generate <asm/pci.h>
    for only define the mentioned above arch_pci_dev structure.
    
    For the Arm-only stubs (mentioned in <asm/pci.h> for disabled
    HAS_PCI and Arm-specific) will be needed
    to add <asm/pci.h> directly alongside <xen/pci.h>. Only to
    <arm/domain.c> <asm/pci.h> was added.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/domain_build.c    |  1 +
 xen/arch/arm/include/asm/pci.h |  7 -------
 xen/arch/ppc/include/asm/pci.h |  7 -------
 xen/include/xen/pci.h          | 11 +++++++++++
 4 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 49792dd590..2dd2926b41 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -23,6 +23,7 @@
 #include <asm/kernel.h>
 #include <asm/setup.h>
 #include <asm/tee/tee.h>
+#include <asm/pci.h>
 #include <asm/platform.h>
 #include <asm/psci.h>
 #include <asm/setup.h>
diff --git a/xen/arch/arm/include/asm/pci.h b/xen/arch/arm/include/asm/pci.h
index 8cb46f6b71..7f77226c9b 100644
--- a/xen/arch/arm/include/asm/pci.h
+++ b/xen/arch/arm/include/asm/pci.h
@@ -130,13 +130,6 @@ bool pci_check_bar(const struct pci_dev *pdev, mfn_t start, mfn_t end);
 
 #else   /*!CONFIG_HAS_PCI*/
 
-struct arch_pci_dev { };
-
-static always_inline bool is_pci_passthrough_enabled(void)
-{
-    return false;
-}
-
 struct pci_dev;
 
 static inline void arch_pci_init_pdev(struct pci_dev *pdev) {}
diff --git a/xen/arch/ppc/include/asm/pci.h b/xen/arch/ppc/include/asm/pci.h
deleted file mode 100644
index e76c8e5475..0000000000
--- a/xen/arch/ppc/include/asm/pci.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __ASM_PPC_PCI_H__
-#define __ASM_PPC_PCI_H__
-
-struct arch_pci_dev {
-};
-
-#endif /* __ASM_PPC_PCI_H__ */
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 251b8761a8..50d7dfb2a2 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -68,7 +68,18 @@ typedef union {
     };
 } pci_sbdf_t;
 
+#ifdef CONFIG_HAS_PCI
 #include <asm/pci.h>
+#else
+
+struct arch_pci_dev { };
+
+static inline bool is_pci_passthrough_enabled(void)
+{
+    return false;
+}
+
+#endif
 
 struct pci_dev_info {
     /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 14 03:44:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Nov 2023 03:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.632105.986089 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2kLf-0002QB-TH; Tue, 14 Nov 2023 03:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 632105.986089; Tue, 14 Nov 2023 03: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 1r2kLf-0002Q3-Qk; Tue, 14 Nov 2023 03:44:23 +0000
Received: by outflank-mailman (input) for mailman id 632105;
 Tue, 14 Nov 2023 03: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 1r2kLe-0002Pt-AC
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03: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 1r2kLe-0001P9-9R
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kLe-0007cP-8Z
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03: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=VPAh1u/Jl0ObMGct3dnlhBkAbgCkkQv0vQlKM20lRzE=; b=mY+Q8kDnDd+JgUfAADeNkzUnCO
	WFyEpvnwjM8qRrmRxvq7a3jTuzMRA8ZGp4Dk1Szl8XcPvcMyrgloq0Fg+lJlmZsPY2usL40OygN8l
	aNYfl0IZKvorf/gBZ1kPsG3ClJ9JsHe6UbB9tCzGN5jGPlZca5vRniXqn2yz7HdlWw4o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/intel: fix indentation
Message-Id: <E1r2kLe-0007cP-8Z@xenbits.xenproject.org>
Date: Tue, 14 Nov 2023 03:44:22 +0000

commit 06719e449f1899281bf54b35fd46af27ea58f888
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Nov 13 15:01:26 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 13 15:01:26 2023 +0100

    x86/intel: fix indentation
    
    Adjust line to use a hard tab and align using spaces afterwards, instead of
    using all spaces.
    
    Fixes: fc3090a47b21 ('x86/boot: Clear XD_DISABLE from the early boot path')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/intel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index a8ba3191e6..dfee64689f 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -307,7 +307,7 @@ static void cf_check early_init_intel(struct cpuinfo_x86 *c)
 		c->x86_cache_alignment = 128;
 
 	if (c == &boot_cpu_data &&
-            bootsym(trampoline_misc_enable_off) & MSR_IA32_MISC_ENABLE_XD_DISABLE)
+	    bootsym(trampoline_misc_enable_off) & MSR_IA32_MISC_ENABLE_XD_DISABLE)
 		printk(KERN_INFO "re-enabled NX (Execute Disable) protection\n");
 
 	/* Unmask CPUID levels and NX if masked: */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 14 03:44:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Nov 2023 03:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.632106.986095 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2kLp-0002T8-VO; Tue, 14 Nov 2023 03:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 632106.986095; Tue, 14 Nov 2023 03: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 1r2kLp-0002T0-SC; Tue, 14 Nov 2023 03:44:33 +0000
Received: by outflank-mailman (input) for mailman id 632106;
 Tue, 14 Nov 2023 03: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 1r2kLo-0002Sf-DA
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03: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 1r2kLo-0001PG-CV
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kLo-0007ct-Bc
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03: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=tAVHWVkj8jTzfHK8e+epxWKdCuQZE8tR2STxxeDBMbc=; b=M0e1+CMBsnYpO+CC+92/AFcl7q
	B0fbiB2AowfkzQQ2KF+jAJDSziuFk4VUlasn/NvSSYJTDVEEmsnyqIh4R64/lEgrFYYw7wUiyOEFa
	53mNJL1gf3kDL1ZrqZMJPXTomqRl7uqRmfZJNtUFeLGPh0dPCVL8Mpf9xTtS0Tx9LP2U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/msi: address violations of MISRA C:2012 Rules 8.2 and 8.3
Message-Id: <E1r2kLo-0007ct-Bc@xenbits.xenproject.org>
Date: Tue, 14 Nov 2023 03:44:32 +0000

commit ecbe5635009b549d9cfc91ae416f640019e2a984
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Mon Nov 13 15:01:54 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 13 15:01:54 2023 +0100

    x86/msi: address violations of MISRA C:2012 Rules 8.2 and 8.3
    
    Add missing parameter names and make function declarations and
    definitions consistent.
    No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/msi.h | 22 +++++++++++-----------
 xen/arch/x86/msi.c             |  2 +-
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/include/asm/msi.h b/xen/arch/x86/include/asm/msi.h
index a53ade95c9..63582fdea4 100644
--- a/xen/arch/x86/include/asm/msi.h
+++ b/xen/arch/x86/include/asm/msi.h
@@ -82,12 +82,12 @@ struct hw_interrupt_type;
 struct msi_desc;
 /* Helper functions */
 extern int pci_enable_msi(struct msi_info *msi, struct msi_desc **desc);
-extern void pci_disable_msi(struct msi_desc *desc);
+extern void pci_disable_msi(struct msi_desc *msi_desc);
 extern int pci_prepare_msix(u16 seg, u8 bus, u8 devfn, bool off);
 extern void pci_cleanup_msi(struct pci_dev *pdev);
-extern int setup_msi_irq(struct irq_desc *, struct msi_desc *);
-extern int __setup_msi_irq(struct irq_desc *, struct msi_desc *,
-                           const struct hw_interrupt_type *);
+extern int setup_msi_irq(struct irq_desc *desc, struct msi_desc *msidesc);
+extern int __setup_msi_irq(struct irq_desc *desc, struct msi_desc *msidesc,
+                           hw_irq_controller *handler);
 extern void teardown_msi_irq(int irq);
 extern int msi_free_vector(struct msi_desc *entry);
 extern int pci_restore_msi_state(struct pci_dev *pdev);
@@ -133,7 +133,7 @@ struct msi_desc {
 #define MSI_TYPE_HPET    1
 #define MSI_TYPE_IOMMU   2
 
-int msi_maskable_irq(const struct msi_desc *);
+int msi_maskable_irq(const struct msi_desc *entry);
 int msi_free_irq(struct msi_desc *entry);
 
 /*
@@ -220,13 +220,13 @@ struct arch_msix {
 };
 
 void early_msi_init(void);
-void msi_compose_msg(unsigned vector, const cpumask_t *mask,
+void msi_compose_msg(unsigned vector, const cpumask_t *cpu_mask,
                      struct msi_msg *msg);
 void __msi_set_enable(u16 seg, u8 bus, u8 slot, u8 func, int pos, int enable);
-void cf_check mask_msi_irq(struct irq_desc *);
-void cf_check unmask_msi_irq(struct irq_desc *);
-void guest_mask_msi_irq(struct irq_desc *, bool mask);
-void cf_check ack_nonmaskable_msi_irq(struct irq_desc *);
-void cf_check set_msi_affinity(struct irq_desc *, const cpumask_t *);
+void cf_check mask_msi_irq(struct irq_desc *desc);
+void cf_check unmask_msi_irq(struct irq_desc *desc);
+void guest_mask_msi_irq(struct irq_desc *desc, bool mask);
+void cf_check ack_nonmaskable_msi_irq(struct irq_desc *desc);
+void cf_check set_msi_affinity(struct irq_desc *desc, const cpumask_t *mask);
 
 #endif /* __ASM_MSI_H */
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index a78367d7cf..7f8e794254 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -37,7 +37,7 @@
 static s8 __read_mostly use_msi = -1;
 boolean_param("msi", use_msi);
 
-static void __pci_disable_msix(struct msi_desc *);
+static void __pci_disable_msix(struct msi_desc *entry);
 
 /* bitmap indicate which fixed map is free */
 static DEFINE_SPINLOCK(msix_fixmap_lock);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 14 03:44:44 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Nov 2023 03:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.632107.986097 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2kM0-0002WH-1u; Tue, 14 Nov 2023 03:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 632107.986097; Tue, 14 Nov 2023 03: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 1r2kLz-0002W9-VZ; Tue, 14 Nov 2023 03:44:43 +0000
Received: by outflank-mailman (input) for mailman id 632107;
 Tue, 14 Nov 2023 03:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kLy-0002Vy-Gd
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03: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 1r2kLy-0001PO-Fl
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kLy-0007dI-Ef
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03: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=/V50oFYqaum+xg/Qc/X/Axn7WCRToRlZjD1Vsp/QJgQ=; b=coGSNPW/Te+tNrpVpSKQuBx+Cw
	3Hb/iX6jywBBK7f2NYBk9+g/QBb27t+ZvVbLUxHifPTdhUqtO8aXe1vBofLadNVpjgPHT3jLzKuDv
	KfYdTjSMUBPu7u2WmUNAwt8aJXDVDvv2kLk86JEo6zknsLKIHvjPQ+98c3iVrEScm+MM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/sched: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r2kLy-0007dI-Ef@xenbits.xenproject.org>
Date: Tue, 14 Nov 2023 03:44:42 +0000

commit 0e4720655f74ea1af7c3d93bbd352c132ae40995
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Mon Nov 13 15:05:03 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 13 15:05:03 2023 +0100

    xen/sched: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: George Dunlap <george.dunlap@cloud.com>
---
 xen/common/sched/private.h | 99 +++++++++++++++++++++++++---------------------
 1 file changed, 53 insertions(+), 46 deletions(-)

diff --git a/xen/common/sched/private.h b/xen/common/sched/private.h
index c516976c37..79e3f56c5a 100644
--- a/xen/common/sched/private.h
+++ b/xen/common/sched/private.h
@@ -37,10 +37,11 @@ enum sched_gran {
  * locks.  The generic schedule init code will point each schedule lock
  * pointer to the schedule lock; if the scheduler wants to remap them,
  * it can simply modify the schedule locks.
- * 
+ *
  * For cache betterness, keep the actual lock in the same cache area
  * as the rest of the struct.  Just have the scheduler point to the
- * one it wants (This may be the one right in front of it).*/
+ * one it wants (This may be the one right in front of it).
+ */
 struct sched_resource {
     struct scheduler   *scheduler;
     struct cpupool     *cpupool;
@@ -280,59 +281,65 @@ struct scheduler {
 
     int          (*global_init)    (void);
 
-    int          (*init)           (struct scheduler *);
-    void         (*deinit)         (struct scheduler *);
+    int          (*init)           (struct scheduler *ops);
+    void         (*deinit)         (struct scheduler *ops);
+
+    void         (*free_udata)     (const struct scheduler *ops, void *priv);
+    void *       (*alloc_udata)    (const struct scheduler *ops,
+                                    struct sched_unit *unit, void *dd);
 
-    void         (*free_udata)     (const struct scheduler *, void *);
-    void *       (*alloc_udata)    (const struct scheduler *,
-                                    struct sched_unit *, void *);
-    void         (*free_pdata)     (const struct scheduler *, void *, int);
-    void *       (*alloc_pdata)    (const struct scheduler *, int);
-    void         (*deinit_pdata)   (const struct scheduler *, void *, int);
+    void         (*free_pdata)     (const struct scheduler *ops,
+                                    void *pcpu, int cpu);
+    void *       (*alloc_pdata)    (const struct scheduler *ops, int cpu);
+    void         (*deinit_pdata)   (const struct scheduler *ops,
+                                    void *pcpu, int cpu);
 
     /* Returns ERR_PTR(-err) for error, NULL for 'nothing needed'. */
-    void *       (*alloc_domdata)  (const struct scheduler *, struct domain *);
+    void *       (*alloc_domdata)  (const struct scheduler *ops,
+                                    struct domain *dom);
     /* Idempotent. */
-    void         (*free_domdata)   (const struct scheduler *, void *);
+    void         (*free_domdata)   (const struct scheduler *ops, void *data);
 
-    spinlock_t * (*switch_sched)   (struct scheduler *, unsigned int,
-                                    void *, void *);
+    spinlock_t * (*switch_sched)   (struct scheduler *new_ops, unsigned int cpu,
+                                    void *pdata, void *vdata);
 
     /* Activate / deactivate units in a cpu pool */
-    void         (*insert_unit)    (const struct scheduler *,
-                                    struct sched_unit *);
-    void         (*remove_unit)    (const struct scheduler *,
-                                    struct sched_unit *);
-
-    void         (*sleep)          (const struct scheduler *,
-                                    struct sched_unit *);
-    void         (*wake)           (const struct scheduler *,
-                                    struct sched_unit *);
-    void         (*yield)          (const struct scheduler *,
-                                    struct sched_unit *);
-    void         (*context_saved)  (const struct scheduler *,
-                                    struct sched_unit *);
-
-    void         (*do_schedule)    (const struct scheduler *,
-                                    struct sched_unit *, s_time_t,
+    void         (*insert_unit)    (const struct scheduler *ops,
+                                    struct sched_unit *unit);
+    void         (*remove_unit)    (const struct scheduler *ops,
+                                    struct sched_unit *unit);
+
+    void         (*sleep)          (const struct scheduler *ops,
+                                    struct sched_unit *unit);
+    void         (*wake)           (const struct scheduler *ops,
+                                    struct sched_unit *unit);
+    void         (*yield)          (const struct scheduler *ops,
+                                    struct sched_unit *unit);
+    void         (*context_saved)  (const struct scheduler *ops,
+                                    struct sched_unit *unit);
+
+    void         (*do_schedule)    (const struct scheduler *ops,
+                                    struct sched_unit *currunit, s_time_t now,
                                     bool tasklet_work_scheduled);
 
-    struct sched_resource *(*pick_resource)(const struct scheduler *,
-                                            const struct sched_unit *);
-    void         (*migrate)        (const struct scheduler *,
-                                    struct sched_unit *, unsigned int);
-    int          (*adjust)         (const struct scheduler *, struct domain *,
-                                    struct xen_domctl_scheduler_op *);
-    void         (*adjust_affinity)(const struct scheduler *,
-                                    struct sched_unit *,
-                                    const struct cpumask *,
-                                    const struct cpumask *);
-    int          (*adjust_global)  (const struct scheduler *,
-                                    struct xen_sysctl_scheduler_op *);
-    void         (*dump_settings)  (const struct scheduler *);
-    void         (*dump_cpu_state) (const struct scheduler *, int);
-    void         (*move_timers)    (const struct scheduler *,
-                                    struct sched_resource *);
+    struct sched_resource *(*pick_resource)(const struct scheduler *ops,
+                                            const struct sched_unit *unit);
+    void         (*migrate)        (const struct scheduler *ops,
+                                    struct sched_unit *unit,
+                                    unsigned int new_cpu);
+    int          (*adjust)         (const struct scheduler *ops,
+                                    struct domain *d,
+                                    struct xen_domctl_scheduler_op *op);
+    void         (*adjust_affinity)(const struct scheduler *ops,
+                                    struct sched_unit *unit,
+                                    const struct cpumask *hard,
+                                    const struct cpumask *soft);
+    int          (*adjust_global)  (const struct scheduler *ops,
+                                    struct xen_sysctl_scheduler_op *sc);
+    void         (*dump_settings)  (const struct scheduler *ops);
+    void         (*dump_cpu_state) (const struct scheduler *ops, int cpu);
+    void         (*move_timers)    (const struct scheduler *ops,
+                                    struct sched_resource *sr);
 };
 
 static inline int sched_init(struct scheduler *s)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 14 03:44:54 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Nov 2023 03:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.632108.986102 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2kMA-0002ZE-3O; Tue, 14 Nov 2023 03:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 632108.986102; Tue, 14 Nov 2023 03: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 1r2kMA-0002Z6-0q; Tue, 14 Nov 2023 03:44:54 +0000
Received: by outflank-mailman (input) for mailman id 632108;
 Tue, 14 Nov 2023 03:44:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kM8-0002Yh-Ji
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:44:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kM8-0001PV-It
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kM8-0007dj-Hy
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:44:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HNqvI70PAsnhvvQfaglFZ38PDhq089YIlKPWcv1xhPo=; b=lXcgbT029iiyWAWCXBYN06W2S3
	aTfJ8JmEzEqJKhw2hyFJrMDJGRiZxXMyVphFdR8oMtZhyDZnP7Bh7sPj6PFg+WjldTwayuNJZ76sV
	6RoHKzun2l3yhhU+7jJuEGbhCXcIA1E29fK4G3QXr3suKnGuGKqGr6CrDPI8TeYr02k4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/set_{c,p}x_pminfo: address violations od MISRA C:2012 Rule 8.3
Message-Id: <E1r2kM8-0007dj-Hy@xenbits.xenproject.org>
Date: Tue, 14 Nov 2023 03:44:52 +0000

commit 162a1589e362ec47671b69a05464048360df5002
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Mon Nov 13 15:05:35 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 13 15:05:35 2023 +0100

    xen/set_{c,p}x_pminfo: address violations od MISRA C:2012 Rule 8.3
    
    Make function definitions and declarations consistent.
    No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/x86_64/cpu_idle.c |  5 ++--
 xen/arch/x86/x86_64/cpufreq.c  |  6 ++---
 xen/drivers/cpufreq/cpufreq.c  | 55 +++++++++++++++++++-----------------------
 xen/include/xen/pmstat.h       |  4 +--
 4 files changed, 33 insertions(+), 37 deletions(-)

diff --git a/xen/arch/x86/x86_64/cpu_idle.c b/xen/arch/x86/x86_64/cpu_idle.c
index e2195d57be..fcd6fc0fc2 100644
--- a/xen/arch/x86/x86_64/cpu_idle.c
+++ b/xen/arch/x86/x86_64/cpu_idle.c
@@ -62,7 +62,8 @@ static int copy_from_compat_state(xen_processor_cx_t *xen_state,
     return 0;
 }
 
-long compat_set_cx_pminfo(uint32_t cpu, struct compat_processor_power *power)
+long compat_set_cx_pminfo(uint32_t acpi_id,
+                          struct compat_processor_power *power)
 {
     struct xen_processor_power *xen_power;
     unsigned long xlat_page_current;
@@ -106,5 +107,5 @@ long compat_set_cx_pminfo(uint32_t cpu, struct compat_processor_power *power)
     XLAT_processor_power(xen_power, power);
 #undef XLAT_processor_power_HNDL_states
 
-    return set_cx_pminfo(cpu, xen_power);
+    return set_cx_pminfo(acpi_id, xen_power);
 }
diff --git a/xen/arch/x86/x86_64/cpufreq.c b/xen/arch/x86/x86_64/cpufreq.c
index 9e1e2050da..e4f3d5b436 100644
--- a/xen/arch/x86/x86_64/cpufreq.c
+++ b/xen/arch/x86/x86_64/cpufreq.c
@@ -30,8 +30,8 @@ CHECK_processor_px;
 
 DEFINE_XEN_GUEST_HANDLE(compat_processor_px_t);
 
-int 
-compat_set_px_pminfo(uint32_t cpu, struct compat_processor_performance *perf)
+int compat_set_px_pminfo(uint32_t acpi_id,
+                         struct compat_processor_performance *perf)
 {
     struct xen_processor_performance *xen_perf;
     unsigned long xlat_page_current;
@@ -52,5 +52,5 @@ compat_set_px_pminfo(uint32_t cpu, struct compat_processor_performance *perf)
     XLAT_processor_performance(xen_perf, perf);
 #undef XLAT_processor_performance_HNDL_states
 
-    return set_px_pminfo(cpu, xen_perf);
+    return set_px_pminfo(acpi_id, xen_perf);
 }
diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
index 6e5c400849..8d1e789eab 100644
--- a/xen/drivers/cpufreq/cpufreq.c
+++ b/xen/drivers/cpufreq/cpufreq.c
@@ -457,14 +457,14 @@ static void print_PPC(unsigned int platform_limit)
     printk("\t_PPC: %d\n", platform_limit);
 }
 
-int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *dom0_px_info)
+int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *perf)
 {
     int ret=0, cpuid;
     struct processor_pminfo *pmpt;
     struct processor_performance *pxpt;
 
     cpuid = get_cpu_id(acpi_id);
-    if ( cpuid < 0 || !dom0_px_info)
+    if ( cpuid < 0 || !perf )
     {
         ret = -EINVAL;
         goto out;
@@ -488,22 +488,20 @@ int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *dom0_px_in
     pmpt->acpi_id = acpi_id;
     pmpt->id = cpuid;
 
-    if ( dom0_px_info->flags & XEN_PX_PCT )
+    if ( perf->flags & XEN_PX_PCT )
     {
         /* space_id check */
-        if (dom0_px_info->control_register.space_id != 
-            dom0_px_info->status_register.space_id)
+        if ( perf->control_register.space_id !=
+             perf->status_register.space_id )
         {
             ret = -EINVAL;
             goto out;
         }
 
-        memcpy ((void *)&pxpt->control_register,
-                (void *)&dom0_px_info->control_register,
-                sizeof(struct xen_pct_register));
-        memcpy ((void *)&pxpt->status_register,
-                (void *)&dom0_px_info->status_register,
-                sizeof(struct xen_pct_register));
+        memcpy(&pxpt->control_register, &perf->control_register,
+               sizeof(struct xen_pct_register));
+        memcpy(&pxpt->status_register, &perf->status_register,
+               sizeof(struct xen_pct_register));
 
         if ( cpufreq_verbose )
         {
@@ -512,69 +510,66 @@ int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *dom0_px_in
         }
     }
 
-    if ( dom0_px_info->flags & XEN_PX_PSS ) 
+    if ( perf->flags & XEN_PX_PSS )
     {
         /* capability check */
-        if (dom0_px_info->state_count <= 1)
+        if ( perf->state_count <= 1 )
         {
             ret = -EINVAL;
             goto out;
         }
 
         if ( !(pxpt->states = xmalloc_array(struct xen_processor_px,
-                        dom0_px_info->state_count)) )
+                                            perf->state_count)) )
         {
             ret = -ENOMEM;
             goto out;
         }
-        if ( copy_from_guest(pxpt->states, dom0_px_info->states,
-                             dom0_px_info->state_count) )
+        if ( copy_from_guest(pxpt->states, perf->states, perf->state_count) )
         {
             ret = -EFAULT;
             goto out;
         }
-        pxpt->state_count = dom0_px_info->state_count;
+        pxpt->state_count = perf->state_count;
 
         if ( cpufreq_verbose )
             print_PSS(pxpt->states,pxpt->state_count);
     }
 
-    if ( dom0_px_info->flags & XEN_PX_PSD )
+    if ( perf->flags & XEN_PX_PSD )
     {
         /* check domain coordination */
-        if (dom0_px_info->shared_type != CPUFREQ_SHARED_TYPE_ALL &&
-            dom0_px_info->shared_type != CPUFREQ_SHARED_TYPE_ANY &&
-            dom0_px_info->shared_type != CPUFREQ_SHARED_TYPE_HW)
+        if ( perf->shared_type != CPUFREQ_SHARED_TYPE_ALL &&
+             perf->shared_type != CPUFREQ_SHARED_TYPE_ANY &&
+             perf->shared_type != CPUFREQ_SHARED_TYPE_HW )
         {
             ret = -EINVAL;
             goto out;
         }
 
-        pxpt->shared_type = dom0_px_info->shared_type;
-        memcpy ((void *)&pxpt->domain_info,
-                (void *)&dom0_px_info->domain_info,
-                sizeof(struct xen_psd_package));
+        pxpt->shared_type = perf->shared_type;
+        memcpy(&pxpt->domain_info, &perf->domain_info,
+               sizeof(struct xen_psd_package));
 
         if ( cpufreq_verbose )
             print_PSD(&pxpt->domain_info);
     }
 
-    if ( dom0_px_info->flags & XEN_PX_PPC )
+    if ( perf->flags & XEN_PX_PPC )
     {
-        pxpt->platform_limit = dom0_px_info->platform_limit;
+        pxpt->platform_limit = perf->platform_limit;
 
         if ( cpufreq_verbose )
             print_PPC(pxpt->platform_limit);
 
         if ( pxpt->init == XEN_PX_INIT )
         {
-            ret = cpufreq_limit_change(cpuid); 
+            ret = cpufreq_limit_change(cpuid);
             goto out;
         }
     }
 
-    if ( dom0_px_info->flags == ( XEN_PX_PCT | XEN_PX_PSS |
-                XEN_PX_PSD | XEN_PX_PPC ) )
+    if ( perf->flags == ( XEN_PX_PCT | XEN_PX_PSS | XEN_PX_PSD | XEN_PX_PPC ) )
     {
         pxpt->init = XEN_PX_INIT;
 
diff --git a/xen/include/xen/pmstat.h b/xen/include/xen/pmstat.h
index 266bc16d86..43b826ad4d 100644
--- a/xen/include/xen/pmstat.h
+++ b/xen/include/xen/pmstat.h
@@ -5,8 +5,8 @@
 #include <public/platform.h> /* for struct xen_processor_power */
 #include <public/sysctl.h>   /* for struct pm_cx_stat */
 
-int set_px_pminfo(uint32_t cpu, struct xen_processor_performance *perf);
-long set_cx_pminfo(uint32_t cpu, struct xen_processor_power *power);
+int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *perf);
+long set_cx_pminfo(uint32_t acpi_id, struct xen_processor_power *power);
 uint32_t pmstat_get_cx_nr(uint32_t cpuid);
 int pmstat_get_cx_stat(uint32_t cpuid, struct pm_cx_stat *stat);
 int pmstat_reset_cx_stat(uint32_t cpuid);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 14 03:45:04 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Nov 2023 03:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.632109.986106 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2kMK-0002bi-5Z; Tue, 14 Nov 2023 03:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 632109.986106; Tue, 14 Nov 2023 03:45:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2kMK-0002bb-2D; Tue, 14 Nov 2023 03:45:04 +0000
Received: by outflank-mailman (input) for mailman id 632109;
 Tue, 14 Nov 2023 03:45:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kMI-0002bO-Mf
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:45:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kMI-0001QL-Lp
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kMI-0007eT-L4
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:45:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7KM4buTZXtU82CS+p1jTXKl6k0xjlAqhLUZyLKeee1M=; b=v2Ba6EwlreG6U4RHrU8NhHbZRE
	YAApo3I1/xHBLE0anXqto+XsIbDLDeh+cKXuib0Pqts969hb2kXyuSxWFWY3oPw7BeW9aqsD8ISC9
	M8akpSUpnDclybpnCqa+DdAFGcEesB4FtxHHajfGdNNExMbu5g/00omYh5eBZ1DIbsNU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/misra: Add missing SPDX tags
Message-Id: <E1r2kMI-0007eT-L4@xenbits.xenproject.org>
Date: Tue, 14 Nov 2023 03:45:02 +0000

commit 8ee1a332b4083523c5ca715d13a0ea4c52417940
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 8 13:51:37 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Nov 13 14:53:48 2023 +0000

    docs/misra: Add missing SPDX tags
    
    Two files are missing SDPX tags, but are covered by the blanketing license
    statement in docs/README.sources saying that RST files are CC-BY-4.0
    
    Fixes: 3c911be55f1c ("docs/misra: document the C dialect and translation toolchain assumptions.")
    Fixes: 7211904e09bd ("docs/misra: add documentation skeleton for MISRA C:2012 Dir 4.1")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
---
 docs/misra/C-language-toolchain.rst | 2 ++
 docs/misra/C-runtime-failures.rst   | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/docs/misra/C-language-toolchain.rst b/docs/misra/C-language-toolchain.rst
index 4c4942a113..2866cb191b 100644
--- a/docs/misra/C-language-toolchain.rst
+++ b/docs/misra/C-language-toolchain.rst
@@ -1,3 +1,5 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
 =============================================
 C Dialect and Translation Assumptions for Xen
 =============================================
diff --git a/docs/misra/C-runtime-failures.rst b/docs/misra/C-runtime-failures.rst
index 77e04a2562..1052b2afca 100644
--- a/docs/misra/C-runtime-failures.rst
+++ b/docs/misra/C-runtime-failures.rst
@@ -1,3 +1,5 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
 ===================================================================
 Measures taken towards the minimization of Run-time failures in Xen
 ===================================================================
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 14 03:45:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Nov 2023 03:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.632110.986110 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2kMU-0002dr-7D; Tue, 14 Nov 2023 03:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 632110.986110; Tue, 14 Nov 2023 03:45:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2kMU-0002dj-3v; Tue, 14 Nov 2023 03:45:14 +0000
Received: by outflank-mailman (input) for mailman id 632110;
 Tue, 14 Nov 2023 03:45:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kMS-0002dZ-Pz
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:45:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kMS-0001QV-P9
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:45:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kMS-0007ez-OE
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:45:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6rq0odrLm9KGQ0B6RLsuX9cY2X2lV4ds98O9Y81leHo=; b=ttmWjeuDto4er6HkfoPUR0gWpv
	caKQkfIR1AYnvRC9AWAVE8RleOfOR7aJPStq7md4ZYhHC6zn/wMNJJxhRQes79hKkKdwGfRYkf65S
	jnO2Sj/Rv2GylmPumYGIogWBxDQ7Jkek20q2ThsQsZ682c6aOci1NUAMKyKe2/QpTxZ0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs: Delete kconfig docs to fix licensing violation
Message-Id: <E1r2kMS-0007ez-OE@xenbits.xenproject.org>
Date: Tue, 14 Nov 2023 03:45:12 +0000

commit 044503f61c9571f3be06e105d59253f3c5632442
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 8 14:23:46 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Nov 13 14:53:48 2023 +0000

    docs: Delete kconfig docs to fix licensing violation
    
    These 3 Kconfig docs were imported from Linux erroneously.  They are
    GPL-2.0-only in Linux, but have no SPDX tag and were placed in such a way to
    be included by the blanket statement saying that all RST files are CC-BY-4.0.
    
    We should not be carrying a shadow copy of these docs.  They aren't even wired
    into our Sphinx docs, and anyone wanting to refer to Kconfig docs is going to
    look at the Linux docs anyway.  These, and more docs can be found at:
    
      https://www.kernel.org/doc/html/latest/kbuild/
    
    which also have corrections vs the snapshot we took.
    
    Fixes: f80fe2b34f08 ("xen: Update Kconfig to Linux v5.4")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
---
 docs/misc/kconfig-language.rst       | 701 -----------------------------------
 docs/misc/kconfig-macro-language.rst | 247 ------------
 docs/misc/kconfig.rst                | 304 ---------------
 xen/tools/kconfig/README.source      |   6 +-
 4 files changed, 4 insertions(+), 1254 deletions(-)

diff --git a/docs/misc/kconfig-language.rst b/docs/misc/kconfig-language.rst
deleted file mode 100644
index 74bef19f69..0000000000
--- a/docs/misc/kconfig-language.rst
+++ /dev/null
@@ -1,701 +0,0 @@
-================
-Kconfig Language
-================
-
-Introduction
-------------
-
-The configuration database is a collection of configuration options
-organized in a tree structure::
-
-	+- Code maturity level options
-	|  +- Prompt for development and/or incomplete code/drivers
-	+- General setup
-	|  +- Networking support
-	|  +- System V IPC
-	|  +- BSD Process Accounting
-	|  +- Sysctl support
-	+- Loadable module support
-	|  +- Enable loadable module support
-	|     +- Set version information on all module symbols
-	|     +- Kernel module loader
-	+- ...
-
-Every entry has its own dependencies. These dependencies are used
-to determine the visibility of an entry. Any child entry is only
-visible if its parent entry is also visible.
-
-Menu entries
-------------
-
-Most entries define a config option; all other entries help to organize
-them. A single configuration option is defined like this::
-
-  config MODVERSIONS
-	bool "Set version information on all module symbols"
-	depends on MODULES
-	help
-	  Usually, modules have to be recompiled whenever you switch to a new
-	  kernel.  ...
-
-Every line starts with a key word and can be followed by multiple
-arguments.  "config" starts a new config entry. The following lines
-define attributes for this config option. Attributes can be the type of
-the config option, input prompt, dependencies, help text and default
-values. A config option can be defined multiple times with the same
-name, but every definition can have only a single input prompt and the
-type must not conflict.
-
-Menu attributes
----------------
-
-A menu entry can have a number of attributes. Not all of them are
-applicable everywhere (see syntax).
-
-- type definition: "bool"/"tristate"/"string"/"hex"/"int"
-
-  Every config option must have a type. There are only two basic types:
-  tristate and string; the other types are based on these two. The type
-  definition optionally accepts an input prompt, so these two examples
-  are equivalent::
-
-	bool "Networking support"
-
-  and::
-
-	bool
-	prompt "Networking support"
-
-- input prompt: "prompt" <prompt> ["if" <expr>]
-
-  Every menu entry can have at most one prompt, which is used to display
-  to the user. Optionally dependencies only for this prompt can be added
-  with "if".
-
-- default value: "default" <expr> ["if" <expr>]
-
-  A config option can have any number of default values. If multiple
-  default values are visible, only the first defined one is active.
-  Default values are not limited to the menu entry where they are
-  defined. This means the default can be defined somewhere else or be
-  overridden by an earlier definition.
-  The default value is only assigned to the config symbol if no other
-  value was set by the user (via the input prompt above). If an input
-  prompt is visible the default value is presented to the user and can
-  be overridden by him.
-  Optionally, dependencies only for this default value can be added with
-  "if".
-
- The default value deliberately defaults to 'n' in order to avoid bloating the
- build. With few exceptions, new config options should not change this. The
- intent is for "make oldconfig" to add as little as possible to the config from
- release to release.
-
- Note:
-	Things that merit "default y/m" include:
-
-	a) A new Kconfig option for something that used to always be built
-	   should be "default y".
-
-	b) A new gatekeeping Kconfig option that hides/shows other Kconfig
-	   options (but does not generate any code of its own), should be
-	   "default y" so people will see those other options.
-
-	c) Sub-driver behavior or similar options for a driver that is
-	   "default n". This allows you to provide sane defaults.
-
-	d) Hardware or infrastructure that everybody expects, such as CONFIG_NET
-	   or CONFIG_BLOCK. These are rare exceptions.
-
-- type definition + default value::
-
-	"def_bool"/"def_tristate" <expr> ["if" <expr>]
-
-  This is a shorthand notation for a type definition plus a value.
-  Optionally dependencies for this default value can be added with "if".
-
-- dependencies: "depends on" <expr>
-
-  This defines a dependency for this menu entry. If multiple
-  dependencies are defined, they are connected with '&&'. Dependencies
-  are applied to all other options within this menu entry (which also
-  accept an "if" expression), so these two examples are equivalent::
-
-	bool "foo" if BAR
-	default y if BAR
-
-  and::
-
-	depends on BAR
-	bool "foo"
-	default y
-
-- reverse dependencies: "select" <symbol> ["if" <expr>]
-
-  While normal dependencies reduce the upper limit of a symbol (see
-  below), reverse dependencies can be used to force a lower limit of
-  another symbol. The value of the current menu symbol is used as the
-  minimal value <symbol> can be set to. If <symbol> is selected multiple
-  times, the limit is set to the largest selection.
-  Reverse dependencies can only be used with boolean or tristate
-  symbols.
-
-  Note:
-	select should be used with care. select will force
-	a symbol to a value without visiting the dependencies.
-	By abusing select you are able to select a symbol FOO even
-	if FOO depends on BAR that is not set.
-	In general use select only for non-visible symbols
-	(no prompts anywhere) and for symbols with no dependencies.
-	That will limit the usefulness but on the other hand avoid
-	the illegal configurations all over.
-
-- weak reverse dependencies: "imply" <symbol> ["if" <expr>]
-
-  This is similar to "select" as it enforces a lower limit on another
-  symbol except that the "implied" symbol's value may still be set to n
-  from a direct dependency or with a visible prompt.
-
-  Given the following example::
-
-    config FOO
-	tristate
-	imply BAZ
-
-    config BAZ
-	tristate
-	depends on BAR
-
-  The following values are possible:
-
-	===		===		=============	==============
-	FOO		BAR		BAZ's default	choice for BAZ
-	===		===		=============	==============
-	n		y		n		N/m/y
-	m		y		m		M/y/n
-	y		y		y		Y/n
-	y		n		*		N
-	===		===		=============	==============
-
-  This is useful e.g. with multiple drivers that want to indicate their
-  ability to hook into a secondary subsystem while allowing the user to
-  configure that subsystem out without also having to unset these drivers.
-
-- limiting menu display: "visible if" <expr>
-
-  This attribute is only applicable to menu blocks, if the condition is
-  false, the menu block is not displayed to the user (the symbols
-  contained there can still be selected by other symbols, though). It is
-  similar to a conditional "prompt" attribute for individual menu
-  entries. Default value of "visible" is true.
-
-- numerical ranges: "range" <symbol> <symbol> ["if" <expr>]
-
-  This allows to limit the range of possible input values for int
-  and hex symbols. The user can only input a value which is larger than
-  or equal to the first symbol and smaller than or equal to the second
-  symbol.
-
-- help text: "help" or "---help---"
-
-  This defines a help text. The end of the help text is determined by
-  the indentation level, this means it ends at the first line which has
-  a smaller indentation than the first line of the help text.
-  "---help---" and "help" do not differ in behaviour, "---help---" is
-  used to help visually separate configuration logic from help within
-  the file as an aid to developers.
-
-- misc options: "option" <symbol>[=<value>]
-
-  Various less common options can be defined via this option syntax,
-  which can modify the behaviour of the menu entry and its config
-  symbol. These options are currently possible:
-
-  - "defconfig_list"
-    This declares a list of default entries which can be used when
-    looking for the default configuration (which is used when the main
-    .config doesn't exists yet.)
-
-  - "modules"
-    This declares the symbol to be used as the MODULES symbol, which
-    enables the third modular state for all config symbols.
-    At most one symbol may have the "modules" option set.
-
-  - "allnoconfig_y"
-    This declares the symbol as one that should have the value y when
-    using "allnoconfig". Used for symbols that hide other symbols.
-
-Menu dependencies
------------------
-
-Dependencies define the visibility of a menu entry and can also reduce
-the input range of tristate symbols. The tristate logic used in the
-expressions uses one more state than normal boolean logic to express the
-module state. Dependency expressions have the following syntax::
-
-  <expr> ::= <symbol>                           (1)
-           <symbol> '=' <symbol>                (2)
-           <symbol> '!=' <symbol>               (3)
-           <symbol1> '<' <symbol2>              (4)
-           <symbol1> '>' <symbol2>              (4)
-           <symbol1> '<=' <symbol2>             (4)
-           <symbol1> '>=' <symbol2>             (4)
-           '(' <expr> ')'                       (5)
-           '!' <expr>                           (6)
-           <expr> '&&' <expr>                   (7)
-           <expr> '||' <expr>                   (8)
-
-Expressions are listed in decreasing order of precedence.
-
-(1) Convert the symbol into an expression. Boolean and tristate symbols
-    are simply converted into the respective expression values. All
-    other symbol types result in 'n'.
-(2) If the values of both symbols are equal, it returns 'y',
-    otherwise 'n'.
-(3) If the values of both symbols are equal, it returns 'n',
-    otherwise 'y'.
-(4) If value of <symbol1> is respectively lower, greater, lower-or-equal,
-    or greater-or-equal than value of <symbol2>, it returns 'y',
-    otherwise 'n'.
-(5) Returns the value of the expression. Used to override precedence.
-(6) Returns the result of (2-/expr/).
-(7) Returns the result of min(/expr/, /expr/).
-(8) Returns the result of max(/expr/, /expr/).
-
-An expression can have a value of 'n', 'm' or 'y' (or 0, 1, 2
-respectively for calculations). A menu entry becomes visible when its
-expression evaluates to 'm' or 'y'.
-
-There are two types of symbols: constant and non-constant symbols.
-Non-constant symbols are the most common ones and are defined with the
-'config' statement. Non-constant symbols consist entirely of alphanumeric
-characters or underscores.
-Constant symbols are only part of expressions. Constant symbols are
-always surrounded by single or double quotes. Within the quote, any
-other character is allowed and the quotes can be escaped using '\'.
-
-Menu structure
---------------
-
-The position of a menu entry in the tree is determined in two ways. First
-it can be specified explicitly::
-
-  menu "Network device support"
-	depends on NET
-
-  config NETDEVICES
-	...
-
-  endmenu
-
-All entries within the "menu" ... "endmenu" block become a submenu of
-"Network device support". All subentries inherit the dependencies from
-the menu entry, e.g. this means the dependency "NET" is added to the
-dependency list of the config option NETDEVICES.
-
-The other way to generate the menu structure is done by analyzing the
-dependencies. If a menu entry somehow depends on the previous entry, it
-can be made a submenu of it. First, the previous (parent) symbol must
-be part of the dependency list and then one of these two conditions
-must be true:
-
-- the child entry must become invisible, if the parent is set to 'n'
-- the child entry must only be visible, if the parent is visible::
-
-    config MODULES
-	bool "Enable loadable module support"
-
-    config MODVERSIONS
-	bool "Set version information on all module symbols"
-	depends on MODULES
-
-    comment "module support disabled"
-	depends on !MODULES
-
-MODVERSIONS directly depends on MODULES, this means it's only visible if
-MODULES is different from 'n'. The comment on the other hand is only
-visible when MODULES is set to 'n'.
-
-
-Kconfig syntax
---------------
-
-The configuration file describes a series of menu entries, where every
-line starts with a keyword (except help texts). The following keywords
-end a menu entry:
-
-- config
-- menuconfig
-- choice/endchoice
-- comment
-- menu/endmenu
-- if/endif
-- source
-
-The first five also start the definition of a menu entry.
-
-config::
-
-	"config" <symbol>
-	<config options>
-
-This defines a config symbol <symbol> and accepts any of above
-attributes as options.
-
-menuconfig::
-
-	"menuconfig" <symbol>
-	<config options>
-
-This is similar to the simple config entry above, but it also gives a
-hint to front ends, that all suboptions should be displayed as a
-separate list of options. To make sure all the suboptions will really
-show up under the menuconfig entry and not outside of it, every item
-from the <config options> list must depend on the menuconfig symbol.
-In practice, this is achieved by using one of the next two constructs::
-
-  (1):
-  menuconfig M
-  if M
-      config C1
-      config C2
-  endif
-
-  (2):
-  menuconfig M
-  config C1
-      depends on M
-  config C2
-      depends on M
-
-In the following examples (3) and (4), C1 and C2 still have the M
-dependency, but will not appear under menuconfig M anymore, because
-of C0, which doesn't depend on M::
-
-  (3):
-  menuconfig M
-      config C0
-  if M
-      config C1
-      config C2
-  endif
-
-  (4):
-  menuconfig M
-  config C0
-  config C1
-      depends on M
-  config C2
-      depends on M
-
-choices::
-
-	"choice" [symbol]
-	<choice options>
-	<choice block>
-	"endchoice"
-
-This defines a choice group and accepts any of the above attributes as
-options. A choice can only be of type bool or tristate.  If no type is
-specified for a choice, its type will be determined by the type of
-the first choice element in the group or remain unknown if none of the
-choice elements have a type specified, as well.
-
-While a boolean choice only allows a single config entry to be
-selected, a tristate choice also allows any number of config entries
-to be set to 'm'. This can be used if multiple drivers for a single
-hardware exists and only a single driver can be compiled/loaded into
-the kernel, but all drivers can be compiled as modules.
-
-A choice accepts another option "optional", which allows to set the
-choice to 'n' and no entry needs to be selected.
-If no [symbol] is associated with a choice, then you can not have multiple
-definitions of that choice. If a [symbol] is associated to the choice,
-then you may define the same choice (i.e. with the same entries) in another
-place.
-
-comment::
-
-	"comment" <prompt>
-	<comment options>
-
-This defines a comment which is displayed to the user during the
-configuration process and is also echoed to the output files. The only
-possible options are dependencies.
-
-menu::
-
-	"menu" <prompt>
-	<menu options>
-	<menu block>
-	"endmenu"
-
-This defines a menu block, see "Menu structure" above for more
-information. The only possible options are dependencies and "visible"
-attributes.
-
-if::
-
-	"if" <expr>
-	<if block>
-	"endif"
-
-This defines an if block. The dependency expression <expr> is appended
-to all enclosed menu entries.
-
-source::
-
-	"source" <prompt>
-
-This reads the specified configuration file. This file is always parsed.
-
-mainmenu::
-
-	"mainmenu" <prompt>
-
-This sets the config program's title bar if the config program chooses
-to use it. It should be placed at the top of the configuration, before any
-other statement.
-
-'#' Kconfig source file comment:
-
-An unquoted '#' character anywhere in a source file line indicates
-the beginning of a source file comment.  The remainder of that line
-is a comment.
-
-
-Kconfig hints
--------------
-This is a collection of Kconfig tips, most of which aren't obvious at
-first glance and most of which have become idioms in several Kconfig
-files.
-
-Adding common features and make the usage configurable
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-It is a common idiom to implement a feature/functionality that are
-relevant for some architectures but not all.
-The recommended way to do so is to use a config variable named HAVE_*
-that is defined in a common Kconfig file and selected by the relevant
-architectures.
-An example is the generic IOMAP functionality.
-
-We would in lib/Kconfig see::
-
-  # Generic IOMAP is used to ...
-  config HAVE_GENERIC_IOMAP
-
-  config GENERIC_IOMAP
-	depends on HAVE_GENERIC_IOMAP && FOO
-
-And in lib/Makefile we would see::
-
-	obj-$(CONFIG_GENERIC_IOMAP) += iomap.o
-
-For each architecture using the generic IOMAP functionality we would see::
-
-  config X86
-	select ...
-	select HAVE_GENERIC_IOMAP
-	select ...
-
-Note: we use the existing config option and avoid creating a new
-config variable to select HAVE_GENERIC_IOMAP.
-
-Note: the use of the internal config variable HAVE_GENERIC_IOMAP, it is
-introduced to overcome the limitation of select which will force a
-config option to 'y' no matter the dependencies.
-The dependencies are moved to the symbol GENERIC_IOMAP and we avoid the
-situation where select forces a symbol equals to 'y'.
-
-Adding features that need compiler support
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-There are several features that need compiler support. The recommended way
-to describe the dependency on the compiler feature is to use "depends on"
-followed by a test macro::
-
-  config STACKPROTECTOR
-	bool "Stack Protector buffer overflow detection"
-	depends on $(cc-option,-fstack-protector)
-	...
-
-If you need to expose a compiler capability to makefiles and/or C source files,
-`CC_HAS_` is the recommended prefix for the config option::
-
-  config CC_HAS_STACKPROTECTOR_NONE
-	def_bool $(cc-option,-fno-stack-protector)
-
-Build as module only
-~~~~~~~~~~~~~~~~~~~~
-To restrict a component build to module-only, qualify its config symbol
-with "depends on m".  E.g.::
-
-  config FOO
-	depends on BAR && m
-
-limits FOO to module (=m) or disabled (=n).
-
-Kconfig recursive dependency limitations
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-If you've hit the Kconfig error: "recursive dependency detected" you've run
-into a recursive dependency issue with Kconfig, a recursive dependency can be
-summarized as a circular dependency. The kconfig tools need to ensure that
-Kconfig files comply with specified configuration requirements. In order to do
-that kconfig must determine the values that are possible for all Kconfig
-symbols, this is currently not possible if there is a circular relation
-between two or more Kconfig symbols. For more details refer to the "Simple
-Kconfig recursive issue" subsection below. Kconfig does not do recursive
-dependency resolution; this has a few implications for Kconfig file writers.
-We'll first explain why this issues exists and then provide an example
-technical limitation which this brings upon Kconfig developers. Eager
-developers wishing to try to address this limitation should read the next
-subsections.
-
-Simple Kconfig recursive issue
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Read: Documentation/kbuild/Kconfig.recursion-issue-01
-
-Test with::
-
-  make KBUILD_KCONFIG=Documentation/kbuild/Kconfig.recursion-issue-01 allnoconfig
-
-Cumulative Kconfig recursive issue
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Read: Documentation/kbuild/Kconfig.recursion-issue-02
-
-Test with::
-
-  make KBUILD_KCONFIG=Documentation/kbuild/Kconfig.recursion-issue-02 allnoconfig
-
-Practical solutions to kconfig recursive issue
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Developers who run into the recursive Kconfig issue have two options
-at their disposal. We document them below and also provide a list of
-historical issues resolved through these different solutions.
-
-  a) Remove any superfluous "select FOO" or "depends on FOO"
-  b) Match dependency semantics:
-
-	b1) Swap all "select FOO" to "depends on FOO" or,
-
-	b2) Swap all "depends on FOO" to "select FOO"
-
-The resolution to a) can be tested with the sample Kconfig file
-Documentation/kbuild/Kconfig.recursion-issue-01 through the removal
-of the "select CORE" from CORE_BELL_A_ADVANCED as that is implicit already
-since CORE_BELL_A depends on CORE. At times it may not be possible to remove
-some dependency criteria, for such cases you can work with solution b).
-
-The two different resolutions for b) can be tested in the sample Kconfig file
-Documentation/kbuild/Kconfig.recursion-issue-02.
-
-Below is a list of examples of prior fixes for these types of recursive issues;
-all errors appear to involve one or more select's and one or more "depends on".
-
-============    ===================================
-commit          fix
-============    ===================================
-06b718c01208    select A -> depends on A
-c22eacfe82f9    depends on A -> depends on B
-6a91e854442c    select A -> depends on A
-118c565a8f2e    select A -> select B
-f004e5594705    select A -> depends on A
-c7861f37b4c6    depends on A -> (null)
-80c69915e5fb    select A -> (null)              (1)
-c2218e26c0d0    select A -> depends on A        (1)
-d6ae99d04e1c    select A -> depends on A
-95ca19cf8cbf    select A -> depends on A
-8f057d7bca54    depends on A -> (null)
-8f057d7bca54    depends on A -> select A
-a0701f04846e    select A -> depends on A
-0c8b92f7f259    depends on A -> (null)
-e4e9e0540928    select A -> depends on A        (2)
-7453ea886e87    depends on A > (null)           (1)
-7b1fff7e4fdf    select A -> depends on A
-86c747d2a4f0    select A -> depends on A
-d9f9ab51e55e    select A -> depends on A
-0c51a4d8abd6    depends on A -> select A        (3)
-e98062ed6dc4    select A -> depends on A        (3)
-91e5d284a7f1    select A -> (null)
-============    ===================================
-
-(1) Partial (or no) quote of error.
-(2) That seems to be the gist of that fix.
-(3) Same error.
-
-Future kconfig work
-~~~~~~~~~~~~~~~~~~~
-
-Work on kconfig is welcomed on both areas of clarifying semantics and on
-evaluating the use of a full SAT solver for it. A full SAT solver can be
-desirable to enable more complex dependency mappings and / or queries,
-for instance on possible use case for a SAT solver could be that of handling
-the current known recursive dependency issues. It is not known if this would
-address such issues but such evaluation is desirable. If support for a full SAT
-solver proves too complex or that it cannot address recursive dependency issues
-Kconfig should have at least clear and well defined semantics which also
-addresses and documents limitations or requirements such as the ones dealing
-with recursive dependencies.
-
-Further work on both of these areas is welcomed on Kconfig. We elaborate
-on both of these in the next two subsections.
-
-Semantics of Kconfig
-~~~~~~~~~~~~~~~~~~~~
-
-The use of Kconfig is broad, Linux is now only one of Kconfig's users:
-one study has completed a broad analysis of Kconfig use in 12 projects [0]_.
-Despite its widespread use, and although this document does a reasonable job
-in documenting basic Kconfig syntax a more precise definition of Kconfig
-semantics is welcomed. One project deduced Kconfig semantics through
-the use of the xconfig configurator [1]_. Work should be done to confirm if
-the deduced semantics matches our intended Kconfig design goals.
-
-Having well defined semantics can be useful for tools for practical
-evaluation of depenencies, for instance one such use known case was work to
-express in boolean abstraction of the inferred semantics of Kconfig to
-translate Kconfig logic into boolean formulas and run a SAT solver on this to
-find dead code / features (always inactive), 114 dead features were found in
-Linux using this methodology [1]_ (Section 8: Threats to validity).
-
-Confirming this could prove useful as Kconfig stands as one of the the leading
-industrial variability modeling languages [1]_ [2]_. Its study would help
-evaluate practical uses of such languages, their use was only theoretical
-and real world requirements were not well understood. As it stands though
-only reverse engineering techniques have been used to deduce semantics from
-variability modeling languages such as Kconfig [3]_.
-
-.. [0] http://www.eng.uwaterloo.ca/~shshe/kconfig_semantics.pdf
-.. [1] http://gsd.uwaterloo.ca/sites/default/files/vm-2013-berger.pdf
-.. [2] http://gsd.uwaterloo.ca/sites/default/files/ase241-berger_0.pdf
-.. [3] http://gsd.uwaterloo.ca/sites/default/files/icse2011.pdf
-
-Full SAT solver for Kconfig
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Although SAT solvers [4]_ haven't yet been used by Kconfig directly, as noted
-in the previous subsection, work has been done however to express in boolean
-abstraction the inferred semantics of Kconfig to translate Kconfig logic into
-boolean formulas and run a SAT solver on it [5]_. Another known related project
-is CADOS [6]_ (former VAMOS [7]_) and the tools, mainly undertaker [8]_, which
-has been introduced first with [9]_.  The basic concept of undertaker is to
-exract variability models from Kconfig, and put them together with a
-propositional formula extracted from CPP #ifdefs and build-rules into a SAT
-solver in order to find dead code, dead files, and dead symbols. If using a SAT
-solver is desirable on Kconfig one approach would be to evaluate repurposing
-such efforts somehow on Kconfig. There is enough interest from mentors of
-existing projects to not only help advise how to integrate this work upstream
-but also help maintain it long term. Interested developers should visit:
-
-http://kernelnewbies.org/KernelProjects/kconfig-sat
-
-.. [4] http://www.cs.cornell.edu/~sabhar/chapters/SATSolvers-KR-Handbook.pdf
-.. [5] http://gsd.uwaterloo.ca/sites/default/files/vm-2013-berger.pdf
-.. [6] https://cados.cs.fau.de
-.. [7] https://vamos.cs.fau.de
-.. [8] https://undertaker.cs.fau.de
-.. [9] https://www4.cs.fau.de/Publications/2011/tartler_11_eurosys.pdf
diff --git a/docs/misc/kconfig-macro-language.rst b/docs/misc/kconfig-macro-language.rst
deleted file mode 100644
index 35b3263b7e..0000000000
--- a/docs/misc/kconfig-macro-language.rst
+++ /dev/null
@@ -1,247 +0,0 @@
-======================
-Kconfig macro language
-======================
-
-Concept
--------
-
-The basic idea was inspired by Make. When we look at Make, we notice sort of
-two languages in one. One language describes dependency graphs consisting of
-targets and prerequisites. The other is a macro language for performing textual
-substitution.
-
-There is clear distinction between the two language stages. For example, you
-can write a makefile like follows::
-
-    APP := foo
-    SRC := foo.c
-    CC := gcc
-
-    $(APP): $(SRC)
-            $(CC) -o $(APP) $(SRC)
-
-The macro language replaces the variable references with their expanded form,
-and handles as if the source file were input like follows::
-
-    foo: foo.c
-            gcc -o foo foo.c
-
-Then, Make analyzes the dependency graph and determines the targets to be
-updated.
-
-The idea is quite similar in Kconfig - it is possible to describe a Kconfig
-file like this::
-
-    CC := gcc
-
-    config CC_HAS_FOO
-            def_bool $(shell, $(srctree)/scripts/gcc-check-foo.sh $(CC))
-
-The macro language in Kconfig processes the source file into the following
-intermediate::
-
-    config CC_HAS_FOO
-            def_bool y
-
-Then, Kconfig moves onto the evaluation stage to resolve inter-symbol
-dependency as explained in kconfig-language.txt.
-
-
-Variables
----------
-
-Like in Make, a variable in Kconfig works as a macro variable.  A macro
-variable is expanded "in place" to yield a text string that may then be
-expanded further. To get the value of a variable, enclose the variable name in
-$( ). The parentheses are required even for single-letter variable names; $X is
-a syntax error. The curly brace form as in ${CC} is not supported either.
-
-There are two types of variables: simply expanded variables and recursively
-expanded variables.
-
-A simply expanded variable is defined using the := assignment operator. Its
-righthand side is expanded immediately upon reading the line from the Kconfig
-file.
-
-A recursively expanded variable is defined using the = assignment operator.
-Its righthand side is simply stored as the value of the variable without
-expanding it in any way. Instead, the expansion is performed when the variable
-is used.
-
-There is another type of assignment operator; += is used to append text to a
-variable. The righthand side of += is expanded immediately if the lefthand
-side was originally defined as a simple variable. Otherwise, its evaluation is
-deferred.
-
-The variable reference can take parameters, in the following form::
-
-  $(name,arg1,arg2,arg3)
-
-You can consider the parameterized reference as a function. (more precisely,
-"user-defined function" in contrast to "built-in function" listed below).
-
-Useful functions must be expanded when they are used since the same function is
-expanded differently if different parameters are passed. Hence, a user-defined
-function is defined using the = assignment operator. The parameters are
-referenced within the body definition with $(1), $(2), etc.
-
-In fact, recursively expanded variables and user-defined functions are the same
-internally. (In other words, "variable" is "function with zero argument".)
-When we say "variable" in a broad sense, it includes "user-defined function".
-
-
-Built-in functions
-------------------
-
-Like Make, Kconfig provides several built-in functions. Every function takes a
-particular number of arguments.
-
-In Make, every built-in function takes at least one argument. Kconfig allows
-zero argument for built-in functions, such as $(fileno), $(lineno). You could
-consider those as "built-in variable", but it is just a matter of how we call
-it after all. Let's say "built-in function" here to refer to natively supported
-functionality.
-
-Kconfig currently supports the following built-in functions.
-
- - $(shell,command)
-
-  The "shell" function accepts a single argument that is expanded and passed
-  to a subshell for execution. The standard output of the command is then read
-  and returned as the value of the function. Every newline in the output is
-  replaced with a space. Any trailing newlines are deleted. The standard error
-  is not returned, nor is any program exit status.
-
- - $(info,text)
-
-  The "info" function takes a single argument and prints it to stdout.
-  It evaluates to an empty string.
-
- - $(warning-if,condition,text)
-
-  The "warning-if" function takes two arguments. If the condition part is "y",
-  the text part is sent to stderr. The text is prefixed with the name of the
-  current Kconfig file and the current line number.
-
- - $(error-if,condition,text)
-
-  The "error-if" function is similar to "warning-if", but it terminates the
-  parsing immediately if the condition part is "y".
-
- - $(filename)
-
-  The 'filename' takes no argument, and $(filename) is expanded to the file
-  name being parsed.
-
- - $(lineno)
-
-  The 'lineno' takes no argument, and $(lineno) is expanded to the line number
-  being parsed.
-
-
-Make vs Kconfig
----------------
-
-Kconfig adopts Make-like macro language, but the function call syntax is
-slightly different.
-
-A function call in Make looks like this::
-
-  $(func-name arg1,arg2,arg3)
-
-The function name and the first argument are separated by at least one
-whitespace. Then, leading whitespaces are trimmed from the first argument,
-while whitespaces in the other arguments are kept. You need to use a kind of
-trick to start the first parameter with spaces. For example, if you want
-to make "info" function print "  hello", you can write like follows::
-
-  empty :=
-  space := $(empty) $(empty)
-  $(info $(space)$(space)hello)
-
-Kconfig uses only commas for delimiters, and keeps all whitespaces in the
-function call. Some people prefer putting a space after each comma delimiter::
-
-  $(func-name, arg1, arg2, arg3)
-
-In this case, "func-name" will receive " arg1", " arg2", " arg3". The presence
-of leading spaces may matter depending on the function. The same applies to
-Make - for example, $(subst .c, .o, $(sources)) is a typical mistake; it
-replaces ".c" with " .o".
-
-In Make, a user-defined function is referenced by using a built-in function,
-'call', like this::
-
-    $(call my-func,arg1,arg2,arg3)
-
-Kconfig invokes user-defined functions and built-in functions in the same way.
-The omission of 'call' makes the syntax shorter.
-
-In Make, some functions treat commas verbatim instead of argument separators.
-For example, $(shell echo hello, world) runs the command "echo hello, world".
-Likewise, $(info hello, world) prints "hello, world" to stdout. You could say
-this is _useful_ inconsistency.
-
-In Kconfig, for simpler implementation and grammatical consistency, commas that
-appear in the $( ) context are always delimiters. It means::
-
-  $(shell, echo hello, world)
-
-is an error because it is passing two parameters where the 'shell' function
-accepts only one. To pass commas in arguments, you can use the following trick::
-
-  comma := ,
-  $(shell, echo hello$(comma) world)
-
-
-Caveats
--------
-
-A variable (or function) cannot be expanded across tokens. So, you cannot use
-a variable as a shorthand for an expression that consists of multiple tokens.
-The following works::
-
-    RANGE_MIN := 1
-    RANGE_MAX := 3
-
-    config FOO
-            int "foo"
-            range $(RANGE_MIN) $(RANGE_MAX)
-
-But, the following does not work::
-
-    RANGES := 1 3
-
-    config FOO
-            int "foo"
-            range $(RANGES)
-
-A variable cannot be expanded to any keyword in Kconfig.  The following does
-not work::
-
-    MY_TYPE := tristate
-
-    config FOO
-            $(MY_TYPE) "foo"
-            default y
-
-Obviously from the design, $(shell command) is expanded in the textual
-substitution phase. You cannot pass symbols to the 'shell' function.
-
-The following does not work as expected::
-
-    config ENDIAN_FLAG
-            string
-            default "-mbig-endian" if CPU_BIG_ENDIAN
-            default "-mlittle-endian" if CPU_LITTLE_ENDIAN
-
-    config CC_HAS_ENDIAN_FLAG
-            def_bool $(shell $(srctree)/scripts/gcc-check-flag ENDIAN_FLAG)
-
-Instead, you can do like follows so that any function call is statically
-expanded::
-
-    config CC_HAS_ENDIAN_FLAG
-            bool
-            default $(shell $(srctree)/scripts/gcc-check-flag -mbig-endian) if CPU_BIG_ENDIAN
-            default $(shell $(srctree)/scripts/gcc-check-flag -mlittle-endian) if CPU_LITTLE_ENDIAN
diff --git a/docs/misc/kconfig.rst b/docs/misc/kconfig.rst
deleted file mode 100644
index a9a855f894..0000000000
--- a/docs/misc/kconfig.rst
+++ /dev/null
@@ -1,304 +0,0 @@
-===================
-Kconfig make config
-===================
-
-This file contains some assistance for using `make *config`.
-
-Use "make help" to list all of the possible configuration targets.
-
-The xconfig ('qconf'), menuconfig ('mconf'), and nconfig ('nconf')
-programs also have embedded help text.  Be sure to check that for
-navigation, search, and other general help text.
-
-General
--------
-
-New kernel releases often introduce new config symbols.  Often more
-important, new kernel releases may rename config symbols.  When
-this happens, using a previously working .config file and running
-"make oldconfig" won't necessarily produce a working new kernel
-for you, so you may find that you need to see what NEW kernel
-symbols have been introduced.
-
-To see a list of new config symbols, use::
-
-	cp user/some/old.config .config
-	make listnewconfig
-
-and the config program will list any new symbols, one per line.
-
-Alternatively, you can use the brute force method::
-
-	make oldconfig
-	scripts/diffconfig .config.old .config | less
-
-----------------------------------------------------------------------
-
-Environment variables for `*config`
-
-KCONFIG_CONFIG
---------------
-This environment variable can be used to specify a default kernel config
-file name to override the default name of ".config".
-
-KCONFIG_OVERWRITECONFIG
------------------------
-If you set KCONFIG_OVERWRITECONFIG in the environment, Kconfig will not
-break symlinks when .config is a symlink to somewhere else.
-
-`CONFIG_`
----------
-If you set `CONFIG_` in the environment, Kconfig will prefix all symbols
-with its value when saving the configuration, instead of using the default,
-`CONFIG_`.
-
-----------------------------------------------------------------------
-
-Environment variables for '{allyes/allmod/allno/rand}config'
-
-KCONFIG_ALLCONFIG
------------------
-(partially based on lkml email from/by Rob Landley, re: miniconfig)
-
---------------------------------------------------
-
-The allyesconfig/allmodconfig/allnoconfig/randconfig variants can also
-use the environment variable KCONFIG_ALLCONFIG as a flag or a filename
-that contains config symbols that the user requires to be set to a
-specific value.  If KCONFIG_ALLCONFIG is used without a filename where
-KCONFIG_ALLCONFIG == "" or KCONFIG_ALLCONFIG == "1", `make *config`
-checks for a file named "all{yes/mod/no/def/random}.config"
-(corresponding to the `*config` command that was used) for symbol values
-that are to be forced.  If this file is not found, it checks for a
-file named "all.config" to contain forced values.
-
-This enables you to create "miniature" config (miniconfig) or custom
-config files containing just the config symbols that you are interested
-in.  Then the kernel config system generates the full .config file,
-including symbols of your miniconfig file.
-
-This 'KCONFIG_ALLCONFIG' file is a config file which contains
-(usually a subset of all) preset config symbols.  These variable
-settings are still subject to normal dependency checks.
-
-Examples::
-
-	KCONFIG_ALLCONFIG=custom-notebook.config make allnoconfig
-
-or::
-
-	KCONFIG_ALLCONFIG=mini.config make allnoconfig
-
-or::
-
-	make KCONFIG_ALLCONFIG=mini.config allnoconfig
-
-These examples will disable most options (allnoconfig) but enable or
-disable the options that are explicitly listed in the specified
-mini-config files.
-
-----------------------------------------------------------------------
-
-Environment variables for 'randconfig'
-
-KCONFIG_SEED
-------------
-You can set this to the integer value used to seed the RNG, if you want
-to somehow debug the behaviour of the kconfig parser/frontends.
-If not set, the current time will be used.
-
-KCONFIG_PROBABILITY
--------------------
-This variable can be used to skew the probabilities. This variable can
-be unset or empty, or set to three different formats:
-
-    =======================     ==================  =====================
-	KCONFIG_PROBABILITY     y:n split           y:m:n split
-    =======================     ==================  =====================
-	unset or empty          50  : 50            33  : 33  : 34
-	N                        N  : 100-N         N/2 : N/2 : 100-N
-    [1] N:M                     N+M : 100-(N+M)      N  :  M  : 100-(N+M)
-    [2] N:M:L                    N  : 100-N          M  :  L  : 100-(M+L)
-    =======================     ==================  =====================
-
-where N, M and L are integers (in base 10) in the range [0,100], and so
-that:
-
-    [1] N+M is in the range [0,100]
-
-    [2] M+L is in the range [0,100]
-
-Examples::
-
-	KCONFIG_PROBABILITY=10
-		10% of booleans will be set to 'y', 90% to 'n'
-		5% of tristates will be set to 'y', 5% to 'm', 90% to 'n'
-	KCONFIG_PROBABILITY=15:25
-		40% of booleans will be set to 'y', 60% to 'n'
-		15% of tristates will be set to 'y', 25% to 'm', 60% to 'n'
-	KCONFIG_PROBABILITY=10:15:15
-		10% of booleans will be set to 'y', 90% to 'n'
-		15% of tristates will be set to 'y', 15% to 'm', 70% to 'n'
-
-----------------------------------------------------------------------
-
-Environment variables for 'syncconfig'
-
-KCONFIG_NOSILENTUPDATE
-----------------------
-If this variable has a non-blank value, it prevents silent kernel
-config updates (requires explicit updates).
-
-KCONFIG_AUTOCONFIG
-------------------
-This environment variable can be set to specify the path & name of the
-"auto.conf" file.  Its default value is "include/config/auto.conf".
-
-KCONFIG_TRISTATE
-----------------
-This environment variable can be set to specify the path & name of the
-"tristate.conf" file.  Its default value is "include/config/tristate.conf".
-
-KCONFIG_AUTOHEADER
-------------------
-This environment variable can be set to specify the path & name of the
-"autoconf.h" (header) file.
-Its default value is "include/generated/autoconf.h".
-
-
-----------------------------------------------------------------------
-
-menuconfig
-----------
-
-SEARCHING for CONFIG symbols
-
-Searching in menuconfig:
-
-	The Search function searches for kernel configuration symbol
-	names, so you have to know something close to what you are
-	looking for.
-
-	Example::
-
-		/hotplug
-		This lists all config symbols that contain "hotplug",
-		e.g., HOTPLUG_CPU, MEMORY_HOTPLUG.
-
-	For search help, enter / followed by TAB-TAB (to highlight
-	<Help>) and Enter.  This will tell you that you can also use
-	regular expressions (regexes) in the search string, so if you
-	are not interested in MEMORY_HOTPLUG, you could try::
-
-		/^hotplug
-
-	When searching, symbols are sorted thus:
-
-	  - first, exact matches, sorted alphabetically (an exact match
-	    is when the search matches the complete symbol name);
-	  - then, other matches, sorted alphabetically.
-
-	For example: ^ATH.K matches:
-
-	    ATH5K ATH9K ATH5K_AHB ATH5K_DEBUG [...] ATH6KL ATH6KL_DEBUG
-	    [...] ATH9K_AHB ATH9K_BTCOEX_SUPPORT ATH9K_COMMON [...]
-
-	of which only ATH5K and ATH9K match exactly and so are sorted
-	first (and in alphabetical order), then come all other symbols,
-	sorted in alphabetical order.
-
-----------------------------------------------------------------------
-
-User interface options for 'menuconfig'
-
-MENUCONFIG_COLOR
-----------------
-It is possible to select different color themes using the variable
-MENUCONFIG_COLOR.  To select a theme use::
-
-	make MENUCONFIG_COLOR=<theme> menuconfig
-
-Available themes are::
-
-  - mono       => selects colors suitable for monochrome displays
-  - blackbg    => selects a color scheme with black background
-  - classic    => theme with blue background. The classic look
-  - bluetitle  => a LCD friendly version of classic. (default)
-
-MENUCONFIG_MODE
----------------
-This mode shows all sub-menus in one large tree.
-
-Example::
-
-	make MENUCONFIG_MODE=single_menu menuconfig
-
-----------------------------------------------------------------------
-
-nconfig
--------
-
-nconfig is an alternate text-based configurator.  It lists function
-keys across the bottom of the terminal (window) that execute commands.
-You can also just use the corresponding numeric key to execute the
-commands unless you are in a data entry window.  E.g., instead of F6
-for Save, you can just press 6.
-
-Use F1 for Global help or F3 for the Short help menu.
-
-Searching in nconfig:
-
-	You can search either in the menu entry "prompt" strings
-	or in the configuration symbols.
-
-	Use / to begin a search through the menu entries.  This does
-	not support regular expressions.  Use <Down> or <Up> for
-	Next hit and Previous hit, respectively.  Use <Esc> to
-	terminate the search mode.
-
-	F8 (SymSearch) searches the configuration symbols for the
-	given string or regular expression (regex).
-
-NCONFIG_MODE
-------------
-This mode shows all sub-menus in one large tree.
-
-Example::
-
-	make NCONFIG_MODE=single_menu nconfig
-
-----------------------------------------------------------------------
-
-xconfig
--------
-
-Searching in xconfig:
-
-	The Search function searches for kernel configuration symbol
-	names, so you have to know something close to what you are
-	looking for.
-
-	Example::
-
-		Ctrl-F hotplug
-
-	or::
-
-		Menu: File, Search, hotplug
-
-	lists all config symbol entries that contain "hotplug" in
-	the symbol name.  In this Search dialog, you may change the
-	config setting for any of the entries that are not grayed out.
-	You can also enter a different search string without having
-	to return to the main menu.
-
-
-----------------------------------------------------------------------
-
-gconfig
--------
-
-Searching in gconfig:
-
-	There is no search command in gconfig.  However, gconfig does
-	have several different viewing choices, modes, and options.
diff --git a/xen/tools/kconfig/README.source b/xen/tools/kconfig/README.source
index 44631f68e8..ac394106b9 100644
--- a/xen/tools/kconfig/README.source
+++ b/xen/tools/kconfig/README.source
@@ -5,5 +5,7 @@ in this part of the Xen source tree.
 
 xen/tools/kconfig
 -----------------
-The kconfig directory was originally imported from the linux kernel
-git tree at kernel/git/torvalds/linux.git, path: scripts/kconfig
+The kconfig directory was originally imported from the Linux kernel
+git tree at kernel/git/torvalds/linux.git, path: scripts/kconfig of
+roughly v5.4.  Linux's documentation can be found at:
+https://www.kernel.org/doc/html/latest/kbuild/
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 14 03:45:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Nov 2023 03:45:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.632111.986114 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2kMd-0002gH-Ad; Tue, 14 Nov 2023 03:45:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 632111.986114; Tue, 14 Nov 2023 03:45:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2kMd-0002g7-81; Tue, 14 Nov 2023 03:45:23 +0000
Received: by outflank-mailman (input) for mailman id 632111;
 Tue, 14 Nov 2023 03:45:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kMc-0002g1-T8
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:45:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kMc-0001Qc-SO
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:45:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kMc-0007fR-RW
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:45:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jopVMjEC99JW2HFLFz/+OF8a5022qHLkhRjffJsZC10=; b=jwUPYXwHLlXWjpg1Gn/XHcbpaV
	dGNudOLA5pRAj5ESBSEuwso5kE4XNuLY54hLDb1YjgDY0XO+Ilw5r+7Ch2T45PLZZCGPm6+aGRxOl
	1mqRq20NB9vGt3SPfHqzNBz4sSwnPkdRXatusF+HOUJDWufY2XiJMukfODL4R9j18jKs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/sphinx: Fix syntax issues in hyperlaunch.rst
Message-Id: <E1r2kMc-0007fR-RW@xenbits.xenproject.org>
Date: Tue, 14 Nov 2023 03:45:22 +0000

commit 93ad5dd9743f54cbd1f98658de9cd3ddc7a98fb6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 8 14:38:33 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Nov 13 14:53:48 2023 +0000

    docs/sphinx: Fix syntax issues in hyperlaunch.rst
    
    sphinx-build reports:
    
      docs/designs/launch/hyperlaunch.rst:111: WARNING: Title underline too short.
      docs/designs/launch/hyperlaunch.rst:203: WARNING: Unexpected indentation.
      docs/designs/launch/hyperlaunch.rst:216: WARNING: Unexpected indentation.
    
    Nested lists require newlines as delimiters.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
---
 docs/designs/launch/hyperlaunch.rst | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/docs/designs/launch/hyperlaunch.rst b/docs/designs/launch/hyperlaunch.rst
index 4c138da884..3bed36f976 100644
--- a/docs/designs/launch/hyperlaunch.rst
+++ b/docs/designs/launch/hyperlaunch.rst
@@ -108,7 +108,7 @@ both modes of configuration from the same binary and when paired with its XSM
 flask, provides strong controls that enable fine grained system partitioning.
 
 Hypervisor Launch Landscape
----------
+---------------------------
 
 This comparison table presents the distinctive capabilities of Hyperlaunch with
 reference to existing launch configurations currently available in Xen and
@@ -200,11 +200,13 @@ The benefits of this structure include:
   domains.
 * Commonality: Reuses the same logic for initial basic domain building across
   diverse Xen deployments.
-	* It aligns the x86 initial domain construction with the existing Arm
-	  dom0less feature for construction of multiple domains at boot.
-	* The boot domain implementation may vary significantly with different
-	  deployment use cases, whereas the hypervisor implementation is
-	  common.
+
+  * It aligns the x86 initial domain construction with the existing Arm
+    dom0less feature for construction of multiple domains at boot.
+
+  * The boot domain implementation may vary significantly with different
+    deployment use cases, whereas the hypervisor implementation is common.
+
 * Correctness: Increases confidence in the implementation of domain
   construction, since it is performed by the hypervisor in well maintained and
   centrally tested logic.
@@ -213,8 +215,9 @@ The benefits of this structure include:
 * Capability: Supports launch of advanced configurations where a sequenced
   start of multiple domains is required, or multiple domains are involved in
   startup of the running system configuration
-	* eg. for PCI passthrough on systems where the toolstack runs in a
-	  separate domain to the hardware management.
+
+  * eg. for PCI passthrough on systems where the toolstack runs in a separate
+    domain to the hardware management.
 
 Please, see the ‘Hyperlaunch Device Tree’ design document, which describes the
 configuration module that is provided to the hypervisor by the bootloader.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 14 03:45:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Nov 2023 03:45:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.632112.986117 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2kMn-0002jI-Bw; Tue, 14 Nov 2023 03:45:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 632112.986117; Tue, 14 Nov 2023 03:45: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 1r2kMn-0002jB-9S; Tue, 14 Nov 2023 03:45:33 +0000
Received: by outflank-mailman (input) for mailman id 632112;
 Tue, 14 Nov 2023 03: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 1r2kMm-0002j2-W7
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:45: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 1r2kMm-0001Qj-VI
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:45:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kMm-0007fs-UY
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:45:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=h8EtMx1DJi/0LcLOyJbYE0RYvpu8NdtXULwPEh1drQA=; b=GeZ0xlgZkbDVdqJALdrQjW49JW
	aCI5SLJRwa+vVy6TS8bS2XJW3uA2tOfRfCO4jOwa52+d0mQVLexRbSWyMuh8aMW1sA4JsniecItAM
	pkUgGEcd3f6y+1il5HCh7HrAryiFH41g569lAyNQ4rpkXT7O1nHqcjTIgxEx1CaHSnJI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/sphinx: Fix syntax issues in exclude-list.rst
Message-Id: <E1r2kMm-0007fs-UY@xenbits.xenproject.org>
Date: Tue, 14 Nov 2023 03:45:32 +0000

commit ab03b284b4f2fbf405fcd821105c85e1a38d314d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 8 14:47:10 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Nov 13 14:53:48 2023 +0000

    docs/sphinx: Fix syntax issues in exclude-list.rst
    
    sphinx-build reports:
    
      docs/misra/exclude-list.rst:47: WARNING: Unexpected indentation.
      docs/misra/exclude-list.rst:50: WARNING: Inline emphasis start-string without end-string.
    
    Nested lists require newlines as delimiters, and * either needs escaping, or
    put in a literal block.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
---
 docs/misra/exclude-list.rst | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/docs/misra/exclude-list.rst b/docs/misra/exclude-list.rst
index 42dbceb825..a63b128c3d 100644
--- a/docs/misra/exclude-list.rst
+++ b/docs/misra/exclude-list.rst
@@ -44,10 +44,11 @@ Here is an explanation of the fields inside an object of the "content" array:
    their results. This field is optional and when not specified, it means every
    checker will use that entry.
    Current implemented values for this field are:
+
     - xen-analysis: the xen-analysis.py script exclude this entry for both MISRA
       and static analysis scan. (Implemented only for Cppcheck tool)
 
 To ease the review and the modifications of the entries, they shall be listed in
 alphabetical order referring to the rel_path field.
-Excluded folder paths shall end with '/*' in order to match everything on that
+Excluded folder paths shall end with ``/*`` in order to match everything on that
 folder.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 14 03:45:44 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Nov 2023 03:45:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.632113.986123 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2kMy-0002mT-Ei; Tue, 14 Nov 2023 03:45:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 632113.986123; Tue, 14 Nov 2023 03:45:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r2kMy-0002mL-Az; Tue, 14 Nov 2023 03:45:44 +0000
Received: by outflank-mailman (input) for mailman id 632113;
 Tue, 14 Nov 2023 03:45:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kMx-0002m5-2m
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:45:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kMx-0001Qr-22
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:45:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r2kMx-0007gI-1B
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 03:45:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5eUGlDTlQWRrFwTnomRuDR3KuGOl582e3ffLXWXU8ac=; b=sdLx77/z9kmOuc/4O5XMFteCmb
	OTTSURfoLaXKRIDFkrtL/ukm2MR0mI7yGml+rjSVWkJXTv7EzcQH2ZTFuThDS8rv6hXmfsg4cI65c
	H1fxp1sX3S7zBbekB+Usk57jHkslIzb+FaBwDcgLfwCOui38CQoxZZG1RaeVVAKi4PTM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/sphinx: Fix indexing
Message-Id: <E1r2kMx-0007gI-1B@xenbits.xenproject.org>
Date: Tue, 14 Nov 2023 03:45:43 +0000

commit fb41228ececea948c7953c8c16fe28fd65c6536b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 8 14:53:23 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Nov 13 14:53:48 2023 +0000

    docs/sphinx: Fix indexing
    
    sphinx-build reports:
    
      docs/designs/launch/hyperlaunch.rst: WARNING: document isn't included in any toctree
      docs/designs/launch/hyperlaunch-devicetree.rst: WARNING: document isn't included in any toctree
      docs/misc/xen-makefiles/makefiles.rst: WARNING: document isn't included in any toctree
      docs/misra/C-language-toolchain.rst: WARNING: document isn't included in any toctree
      docs/misra/C-runtime-failures.rst: WARNING: document isn't included in any toctree
      docs/misra/documenting-violations.rst: WARNING: document isn't included in any toctree
      docs/misra/exclude-list.rst: WARNING: document isn't included in any toctree
      docs/misra/xen-static-analysis.rst: WARNING: document isn't included in any toctree
    
    Create an up-to-date index.rst in misra/ create an "unsorted docs" section at
    the top level to contain everything else.  They can be re-filed at a later
    date.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
---
 docs/index.rst       | 13 +++++++------
 docs/misra/index.rst | 18 ++++++++++++++++++
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/docs/index.rst b/docs/index.rst
index f3f779f89c..22fdde8059 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -53,17 +53,18 @@ kind of development environment.
    hypervisor-guide/index
 
 
-MISRA C coding guidelines
--------------------------
+Unsorted documents
+------------------
 
-MISRA C rules and directive to be used as coding guidelines when writing
-Xen hypervisor code.
+Documents in need of some rearranging.
 
 .. toctree::
    :maxdepth: 2
 
-   misra/rules
-   misra/deviations
+   designs/launch/hyperlaunch
+   designs/launch/hyperlaunch-devicetree
+   misc/xen-makefiles/makefiles
+   misra/index
 
 
 Miscellanea
diff --git a/docs/misra/index.rst b/docs/misra/index.rst
new file mode 100644
index 0000000000..5068ee5aef
--- /dev/null
+++ b/docs/misra/index.rst
@@ -0,0 +1,18 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+MISRA C coding guidelines
+=========================
+
+MISRA C rules and directive to be used as coding guidelines when writing
+Xen hypervisor code and related documents.
+
+.. toctree::
+   :maxdepth: 2
+
+   rules
+   deviations
+   C-language-toolchain
+   C-runtime-failures
+   documenting-violations
+   exclude-list
+   xen-static-analysis
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 14 22:22:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Nov 2023 22:22:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633349.988061 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r31nG-000422-Md; Tue, 14 Nov 2023 22:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633349.988061; Tue, 14 Nov 2023 22: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 1r31nG-00041u-K5; Tue, 14 Nov 2023 22:22:02 +0000
Received: by outflank-mailman (input) for mailman id 633349;
 Tue, 14 Nov 2023 22: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 1r31nG-00041o-BU
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 22: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 1r31nG-0000aQ-Ag
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 22:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r31nG-00088s-9f
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 22: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=tUGbdD+NnRbcaaBgh2JyaIugwXRjxcnYvGtfBUHs/Kc=; b=gBZlULdQ9ML0isZ7hZvt/Dk/Cc
	Bd4WfO7RjI0NFouw7gm25DcCWXwWrE4KD8w/G6/UfYUfLlIrtSZNSrKkZSk7PeHyXBkFxMOMIqD9I
	d++aW2nK+OMvcNE7zI04sGt3IJKjc7lFwpSrDlqxwKcnJ9I9rtusT7toT2IMSKbrwywQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] iommu/amd-vi: use correct level for quarantine domain page tables
Message-Id: <E1r31nG-00088s-9f@xenbits.xenproject.org>
Date: Tue, 14 Nov 2023 22:22:02 +0000

commit 1f5f515da0f694d97939f346c628a3b7b612d165
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Oct 11 13:14:21 2023 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 17:35:21 2023 +0000

    iommu/amd-vi: use correct level for quarantine domain page tables
    
    The current setup of the quarantine page tables assumes that the quarantine
    domain (dom_io) has been initialized with an address width of
    DEFAULT_DOMAIN_ADDRESS_WIDTH (48).
    
    However dom_io being a PV domain gets the AMD-Vi IOMMU page tables levels based
    on the maximum (hot pluggable) RAM address, and hence on systems with no RAM
    above the 512GB mark only 3 page-table levels are configured in the IOMMU.
    
    On systems without RAM above the 512GB boundary amd_iommu_quarantine_init()
    will setup page tables for the scratch page with 4 levels, while the IOMMU will
    be configured to use 3 levels only.  The page destined to be used as level 1,
    and to contain a directory of PTEs ends up being the address in a PTE itself,
    and thus level 1 page becomes the leaf page.  Without the level mismatch it's
    level 0 page that should be the leaf page instead.
    
    The level 1 page won't be used as such, and hence it's not possible to use it
    to gain access to other memory on the system.  However that page is not cleared
    in amd_iommu_quarantine_init() as part of re-initialization of the device
    quarantine page tables, and hence data on the level 1 page can be leaked
    between device usages.
    
    Fix this by making sure the paging levels setup by amd_iommu_quarantine_init()
    match the number configured on the IOMMUs.
    
    Note that IVMD regions are not affected by this issue, as those areas are
    mapped taking the configured paging levels into account.
    
    This is XSA-445 / CVE-2023-46835
    
    Fixes: ea38867831da ('x86 / iommu: set up a scratch page in the quarantine domain')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit fe1e4668b373ec4c1e5602e75905a9fa8cc2be3f)
---
 xen/drivers/passthrough/amd/iommu_map.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index b4c1824491..3473db4c1e 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -584,9 +584,7 @@ static int fill_qpt(union amd_iommu_pte *this, unsigned int level,
 int amd_iommu_quarantine_init(struct pci_dev *pdev)
 {
     struct domain_iommu *hd = dom_iommu(dom_io);
-    unsigned long end_gfn =
-        1ul << (DEFAULT_DOMAIN_ADDRESS_WIDTH - PAGE_SHIFT);
-    unsigned int level = amd_iommu_get_paging_mode(end_gfn);
+    unsigned int level = hd->arch.amd.paging_mode;
     unsigned int req_id = get_dma_requestor_id(pdev->seg, pdev->sbdf.bdf);
     const struct ivrs_mappings *ivrs_mappings = get_ivrs_mappings(pdev->seg);
     int rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Tue Nov 14 22:22:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Nov 2023 22:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633350.988065 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r31nR-0004HM-OM; Tue, 14 Nov 2023 22:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633350.988065; Tue, 14 Nov 2023 22: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 1r31nR-0004HF-LY; Tue, 14 Nov 2023 22:22:13 +0000
Received: by outflank-mailman (input) for mailman id 633350;
 Tue, 14 Nov 2023 22: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 1r31nQ-0004Gy-H8
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 22: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 1r31nQ-0000au-Ej
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 22:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r31nQ-00089J-Cw
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 22: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=iL2cODXQtu+4TW3RZZIRxAJtEADiG8rGuQ8hYgFZ0DI=; b=1my61tOPdmqhZiRHmcV2MPw7Xe
	ZemCV8PBn6tfbEv8EqZA1flnL29fnaKisr6SE0MX8sCses+LUVXFyxvY/sBxqBCAdYDZVIM1qMmfz
	43W7QD1/WlYgBxCr2qr7yKqSmyYdSTAS1ip/R9OTH0Avy7rAhJMr9cxie/EaqcrrHEmk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] x86/spec-ctrl: Remove conditional IRQs-on-ness for INT $0x80/0x82 paths
Message-Id: <E1r31nQ-00089J-Cw@xenbits.xenproject.org>
Date: Tue, 14 Nov 2023 22:22:12 +0000

commit b918c4cdc7ab2c1c9e9a9b54fa9d9c595913e028
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 26 14:37:38 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 17:48:39 2023 +0000

    x86/spec-ctrl: Remove conditional IRQs-on-ness for INT $0x80/0x82 paths
    
    Before speculation defences, some paths in Xen could genuinely get away with
    being IRQs-on at entry.  But XPTI invalidated this property on most paths, and
    attempting to maintain it on the remaining paths was a mistake.
    
    Fast forward, and DO_SPEC_CTRL_COND_IBPB (protection for AMD BTC/SRSO) is not
    IRQ-safe, running with IRQs enabled in some cases.  The other actions taken on
    these paths happen to be IRQ-safe.
    
    Make entry_int82() and int80_direct_trap() unconditionally Interrupt Gates
    rather than Trap Gates.  Remove the conditional re-adjustment of
    int80_direct_trap() in smp_prepare_cpus(), and have entry_int82() explicitly
    enable interrupts when safe to do so.
    
    In smp_prepare_cpus(), with the conditional re-adjustment removed, the
    clearing of pv_cr3 is the only remaining action gated on XPTI, and it is out
    of place anyway, repeating work already done by smp_prepare_boot_cpu().  Drop
    the entire if() condition to avoid leaving an incorrect vestigial remnant.
    
    Also drop comments which make incorrect statements about when its safe to
    enable interrupts.
    
    This is XSA-446 / CVE-2023-46836
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit a48bb129f1b9ff55c22cf6d2b589247c8ba3b10e)
---
 xen/arch/x86/pv/traps.c            |  4 ++--
 xen/arch/x86/smpboot.c             | 14 --------------
 xen/arch/x86/x86_64/compat/entry.S |  2 ++
 xen/arch/x86/x86_64/entry.S        |  1 -
 4 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/pv/traps.c b/xen/arch/x86/pv/traps.c
index 7439b76df8..79cb8264e0 100644
--- a/xen/arch/x86/pv/traps.c
+++ b/xen/arch/x86/pv/traps.c
@@ -160,11 +160,11 @@ void __init pv_trap_init(void)
 #ifdef CONFIG_PV32
     /* The 32-on-64 hypercall vector is only accessible from ring 1. */
     _set_gate(idt_table + HYPERCALL_VECTOR,
-              SYS_DESC_trap_gate, 1, entry_int82);
+              SYS_DESC_irq_gate, 1, entry_int82);
 #endif
 
     /* Fast trap for int80 (faster than taking the #GP-fixup path). */
-    _set_gate(idt_table + LEGACY_SYSCALL_VECTOR, SYS_DESC_trap_gate, 3,
+    _set_gate(idt_table + LEGACY_SYSCALL_VECTOR, SYS_DESC_irq_gate, 3,
               &int80_direct_trap);
 
     open_softirq(NMI_SOFTIRQ, nmi_softirq);
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 7bb54c2207..97ed165d0d 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -1151,20 +1151,6 @@ void __init smp_prepare_cpus(void)
 
     stack_base[0] = (void *)((unsigned long)stack_start & ~(STACK_SIZE - 1));
 
-    if ( opt_xpti_hwdom || opt_xpti_domu )
-    {
-        get_cpu_info()->pv_cr3 = 0;
-
-#ifdef CONFIG_PV
-        /*
-         * All entry points which may need to switch page tables have to start
-         * with interrupts off. Re-write what pv_trap_init() has put there.
-         */
-        _set_gate(idt_table + LEGACY_SYSCALL_VECTOR, SYS_DESC_irq_gate, 3,
-                  &int80_direct_trap);
-#endif
-    }
-
     set_nr_sockets();
 
     socket_cpumask = xzalloc_array(cpumask_t *, nr_sockets);
diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index 09a86768ac..cde7702b4c 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -23,6 +23,8 @@ ENTRY(entry_int82)
         SPEC_CTRL_ENTRY_FROM_PV /* Req: %rsp=regs/cpuinfo, %rdx=0, Clob: acd */
         /* WARNING! `ret`, `call *`, `jmp *` not safe before this point. */
 
+        sti
+
         CR4_PV32_RESTORE
 
         GET_CURRENT(bx)
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index ff3b2d366c..a086349841 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -287,7 +287,6 @@ ENTRY(sysenter_entry)
 #ifdef CONFIG_XEN_SHSTK
         ALTERNATIVE "", "setssbsy", X86_FEATURE_XEN_SHSTK
 #endif
-        /* sti could live here when we don't switch page tables below. */
         pushq $FLAT_USER_SS
         pushq $0
         pushfq
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Tue Nov 14 23:55:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Nov 2023 23:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633398.988169 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r33FH-0001GO-RP; Tue, 14 Nov 2023 23:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633398.988169; Tue, 14 Nov 2023 23: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 1r33FH-0001GF-OT; Tue, 14 Nov 2023 23:55:03 +0000
Received: by outflank-mailman (input) for mailman id 633398;
 Tue, 14 Nov 2023 23: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 1r33FG-0001G4-C4
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 23: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 1r33FG-0002DN-4k
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 23:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r33FG-0003IP-3i
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 23: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=U9vcdHdFEZ1rgFPwAJnCRBbq8Mt2lBYKtcOt66IspcM=; b=ILeuxMcBnNYQvuE+74rY6ix4kx
	1AejhROgCtZJ+lQ+6dUADnSCasFEMBftaRdZH72mckyGNjh/cPMD8xBt9mvaCc4W8o1paRfrWhxsq
	1LD0i/Y3VOdLZuhJhCg/PFOjPp3Iyp6KOI6P6JKOqzAL4cRdaa8hBppCBcD6ImiAMMCo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.16] iommu/amd-vi: use correct level for quarantine domain page tables
Message-Id: <E1r33FG-0003IP-3i@xenbits.xenproject.org>
Date: Tue, 14 Nov 2023 23:55:02 +0000

commit 6fea3835d91aaa048f66036c34c25532e2dd2b67
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Oct 11 13:14:21 2023 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 17:23:44 2023 +0000

    iommu/amd-vi: use correct level for quarantine domain page tables
    
    The current setup of the quarantine page tables assumes that the quarantine
    domain (dom_io) has been initialized with an address width of
    DEFAULT_DOMAIN_ADDRESS_WIDTH (48).
    
    However dom_io being a PV domain gets the AMD-Vi IOMMU page tables levels based
    on the maximum (hot pluggable) RAM address, and hence on systems with no RAM
    above the 512GB mark only 3 page-table levels are configured in the IOMMU.
    
    On systems without RAM above the 512GB boundary amd_iommu_quarantine_init()
    will setup page tables for the scratch page with 4 levels, while the IOMMU will
    be configured to use 3 levels only.  The page destined to be used as level 1,
    and to contain a directory of PTEs ends up being the address in a PTE itself,
    and thus level 1 page becomes the leaf page.  Without the level mismatch it's
    level 0 page that should be the leaf page instead.
    
    The level 1 page won't be used as such, and hence it's not possible to use it
    to gain access to other memory on the system.  However that page is not cleared
    in amd_iommu_quarantine_init() as part of re-initialization of the device
    quarantine page tables, and hence data on the level 1 page can be leaked
    between device usages.
    
    Fix this by making sure the paging levels setup by amd_iommu_quarantine_init()
    match the number configured on the IOMMUs.
    
    Note that IVMD regions are not affected by this issue, as those areas are
    mapped taking the configured paging levels into account.
    
    This is XSA-445 / CVE-2023-46835
    
    Fixes: ea38867831da ('x86 / iommu: set up a scratch page in the quarantine domain')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit fe1e4668b373ec4c1e5602e75905a9fa8cc2be3f)
---
 xen/drivers/passthrough/amd/iommu_map.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index cf6f01b633..1b414a413b 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -654,9 +654,7 @@ static int fill_qpt(union amd_iommu_pte *this, unsigned int level,
 int amd_iommu_quarantine_init(struct pci_dev *pdev, bool scratch_page)
 {
     struct domain_iommu *hd = dom_iommu(dom_io);
-    unsigned long end_gfn =
-        1ul << (DEFAULT_DOMAIN_ADDRESS_WIDTH - PAGE_SHIFT);
-    unsigned int level = amd_iommu_get_paging_mode(end_gfn);
+    unsigned int level = hd->arch.amd.paging_mode;
     unsigned int req_id = get_dma_requestor_id(pdev->seg, pdev->sbdf.bdf);
     const struct ivrs_mappings *ivrs_mappings = get_ivrs_mappings(pdev->seg);
     int rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.16


From xen-changelog-bounces@lists.xenproject.org Tue Nov 14 23:55:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Nov 2023 23:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633399.988172 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r33FR-0001IO-Sa; Tue, 14 Nov 2023 23:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633399.988172; Tue, 14 Nov 2023 23: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 1r33FR-0001IG-Pz; Tue, 14 Nov 2023 23:55:13 +0000
Received: by outflank-mailman (input) for mailman id 633399;
 Tue, 14 Nov 2023 23: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 1r33FQ-0001I3-9i
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 23: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 1r33FQ-0002Dr-8q
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 23:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r33FQ-0003Is-6z
 for xen-changelog@lists.xenproject.org; Tue, 14 Nov 2023 23: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=j+Wv2g+6XQpzg/D/lCaP78iR2dv4IFefA0h9mdZ072U=; b=ymim5lFerRsoa2buU8DUdVRQjO
	A+jITdn6ORffoHWG/0vMSBPpDeEjnmCBKvTfUHnVCVH/AMesloxXiXL59sLjraTWmfeT62n9YiBeF
	yVA8vtF1PUXEw64WH+sQPxXUgao7+VSzdshw65D3O8hqR+4SvbwKqXq1kATMMsedssXg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.16] x86/spec-ctrl: Remove conditional IRQs-on-ness for INT $0x80/0x82 paths
Message-Id: <E1r33FQ-0003Is-6z@xenbits.xenproject.org>
Date: Tue, 14 Nov 2023 23:55:12 +0000

commit 4dfe95177b948d1f3ed27a801f603ed7f1bc36e8
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 26 14:37:38 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 17:48:35 2023 +0000

    x86/spec-ctrl: Remove conditional IRQs-on-ness for INT $0x80/0x82 paths
    
    Before speculation defences, some paths in Xen could genuinely get away with
    being IRQs-on at entry.  But XPTI invalidated this property on most paths, and
    attempting to maintain it on the remaining paths was a mistake.
    
    Fast forward, and DO_SPEC_CTRL_COND_IBPB (protection for AMD BTC/SRSO) is not
    IRQ-safe, running with IRQs enabled in some cases.  The other actions taken on
    these paths happen to be IRQ-safe.
    
    Make entry_int82() and int80_direct_trap() unconditionally Interrupt Gates
    rather than Trap Gates.  Remove the conditional re-adjustment of
    int80_direct_trap() in smp_prepare_cpus(), and have entry_int82() explicitly
    enable interrupts when safe to do so.
    
    In smp_prepare_cpus(), with the conditional re-adjustment removed, the
    clearing of pv_cr3 is the only remaining action gated on XPTI, and it is out
    of place anyway, repeating work already done by smp_prepare_boot_cpu().  Drop
    the entire if() condition to avoid leaving an incorrect vestigial remnant.
    
    Also drop comments which make incorrect statements about when its safe to
    enable interrupts.
    
    This is XSA-446 / CVE-2023-46836
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit a48bb129f1b9ff55c22cf6d2b589247c8ba3b10e)
---
 xen/arch/x86/pv/traps.c            |  4 ++--
 xen/arch/x86/smpboot.c             | 14 --------------
 xen/arch/x86/x86_64/compat/entry.S |  2 ++
 xen/arch/x86/x86_64/entry.S        |  1 -
 4 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/pv/traps.c b/xen/arch/x86/pv/traps.c
index 1e05a9f1cd..2fc24136c9 100644
--- a/xen/arch/x86/pv/traps.c
+++ b/xen/arch/x86/pv/traps.c
@@ -149,11 +149,11 @@ void __init pv_trap_init(void)
 #ifdef CONFIG_PV32
     /* The 32-on-64 hypercall vector is only accessible from ring 1. */
     _set_gate(idt_table + HYPERCALL_VECTOR,
-              SYS_DESC_trap_gate, 1, entry_int82);
+              SYS_DESC_irq_gate, 1, entry_int82);
 #endif
 
     /* Fast trap for int80 (faster than taking the #GP-fixup path). */
-    _set_gate(idt_table + LEGACY_SYSCALL_VECTOR, SYS_DESC_trap_gate, 3,
+    _set_gate(idt_table + LEGACY_SYSCALL_VECTOR, SYS_DESC_irq_gate, 3,
               &int80_direct_trap);
 
     open_softirq(NMI_SOFTIRQ, nmi_softirq);
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 0694173173..4a10a1869a 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -1167,20 +1167,6 @@ void __init smp_prepare_cpus(void)
 
     stack_base[0] = (void *)((unsigned long)stack_start & ~(STACK_SIZE - 1));
 
-    if ( opt_xpti_hwdom || opt_xpti_domu )
-    {
-        get_cpu_info()->pv_cr3 = 0;
-
-#ifdef CONFIG_PV
-        /*
-         * All entry points which may need to switch page tables have to start
-         * with interrupts off. Re-write what pv_trap_init() has put there.
-         */
-        _set_gate(idt_table + LEGACY_SYSCALL_VECTOR, SYS_DESC_irq_gate, 3,
-                  &int80_direct_trap);
-#endif
-    }
-
     set_nr_sockets();
 
     socket_cpumask = xzalloc_array(cpumask_t *, nr_sockets);
diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index b86d38d1c5..253bb1688c 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -21,6 +21,8 @@ ENTRY(entry_int82)
         SPEC_CTRL_ENTRY_FROM_PV /* Req: %rsp=regs/cpuinfo, %rdx=0, Clob: acd */
         /* WARNING! `ret`, `call *`, `jmp *` not safe before this point. */
 
+        sti
+
         CR4_PV32_RESTORE
 
         GET_CURRENT(bx)
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 88ff5c150f..837a31b405 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -327,7 +327,6 @@ ENTRY(sysenter_entry)
 #ifdef CONFIG_XEN_SHSTK
         ALTERNATIVE "", "setssbsy", X86_FEATURE_XEN_SHSTK
 #endif
-        /* sti could live here when we don't switch page tables below. */
         pushq $FLAT_USER_SS
         pushq $0
         pushfq
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.16


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 04:44:09 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 04:44:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633462.988206 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37kw-0006TJ-Ee; Wed, 15 Nov 2023 04:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633462.988206; Wed, 15 Nov 2023 04:44:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37kw-0006TB-C4; Wed, 15 Nov 2023 04:44:02 +0000
Received: by outflank-mailman (input) for mailman id 633462;
 Wed, 15 Nov 2023 04:44:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37kv-0006T5-P6
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37kv-0006vW-O6
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37kv-0006uu-N4
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04: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=FwSjMWMnyeLVUE/8sHck75NW1/CDm7OaaqJijui0mx8=; b=b5HvvHuAYMjYvxsOr4W9Ht7Zse
	I3rf+nqHYKlXjU0jJl0PYql7mE0HGfryHhCGX/uIatLNh+KZhhTS5nlrYYNUAbQmeKgMuQr0cYcPl
	c6IEeQBwX/ywayVB9hSAkUtUVpK+rgX2Wrpxe7Sr1CxBZE67Ku6hVpI6leY9lUYOx3Z4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] iommu/amd-vi: use correct level for quarantine domain page tables
Message-Id: <E1r37kv-0006uu-N4@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 04:44:01 +0000

commit b7a1e1053977c986dc7b5ca6fe435ca94bc45f6c
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Oct 11 13:14:21 2023 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 17:22:41 2023 +0000

    iommu/amd-vi: use correct level for quarantine domain page tables
    
    The current setup of the quarantine page tables assumes that the quarantine
    domain (dom_io) has been initialized with an address width of
    DEFAULT_DOMAIN_ADDRESS_WIDTH (48).
    
    However dom_io being a PV domain gets the AMD-Vi IOMMU page tables levels based
    on the maximum (hot pluggable) RAM address, and hence on systems with no RAM
    above the 512GB mark only 3 page-table levels are configured in the IOMMU.
    
    On systems without RAM above the 512GB boundary amd_iommu_quarantine_init()
    will setup page tables for the scratch page with 4 levels, while the IOMMU will
    be configured to use 3 levels only.  The page destined to be used as level 1,
    and to contain a directory of PTEs ends up being the address in a PTE itself,
    and thus level 1 page becomes the leaf page.  Without the level mismatch it's
    level 0 page that should be the leaf page instead.
    
    The level 1 page won't be used as such, and hence it's not possible to use it
    to gain access to other memory on the system.  However that page is not cleared
    in amd_iommu_quarantine_init() as part of re-initialization of the device
    quarantine page tables, and hence data on the level 1 page can be leaked
    between device usages.
    
    Fix this by making sure the paging levels setup by amd_iommu_quarantine_init()
    match the number configured on the IOMMUs.
    
    Note that IVMD regions are not affected by this issue, as those areas are
    mapped taking the configured paging levels into account.
    
    This is XSA-445 / CVE-2023-46835
    
    Fixes: ea38867831da ('x86 / iommu: set up a scratch page in the quarantine domain')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit fe1e4668b373ec4c1e5602e75905a9fa8cc2be3f)
---
 xen/drivers/passthrough/amd/iommu_map.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 993bac6f88..e0f4fe736a 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -837,9 +837,7 @@ static int fill_qpt(union amd_iommu_pte *this, unsigned int level,
 int cf_check amd_iommu_quarantine_init(struct pci_dev *pdev, bool scratch_page)
 {
     struct domain_iommu *hd = dom_iommu(dom_io);
-    unsigned long end_gfn =
-        1ul << (DEFAULT_DOMAIN_ADDRESS_WIDTH - PAGE_SHIFT);
-    unsigned int level = amd_iommu_get_paging_mode(end_gfn);
+    unsigned int level = hd->arch.amd.paging_mode;
     unsigned int req_id = get_dma_requestor_id(pdev->seg, pdev->sbdf.bdf);
     const struct ivrs_mappings *ivrs_mappings = get_ivrs_mappings(pdev->seg);
     int rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 04:44:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 04:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633463.988211 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37l7-0006VH-GQ; Wed, 15 Nov 2023 04:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633463.988211; Wed, 15 Nov 2023 04: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 1r37l7-0006V9-DU; Wed, 15 Nov 2023 04:44:13 +0000
Received: by outflank-mailman (input) for mailman id 633463;
 Wed, 15 Nov 2023 04:44:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37l5-0006Ut-TR
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:44:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37l5-0006vw-S8
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37l5-0006vP-QF
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:44:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HPHnn/cl8XAB6n00eQjf0wC/WsECtJD8JiOVtuMT77o=; b=UGb9TrJed1YogXx98IyVv+m1hR
	tWThugXEam1YLq6yT2Dqa8dfj33oz34DJUJP3SVJoWmauqO4FgLp6EyEkWIcGqnaO3vCgDhdcMBOH
	malmIcTIxPIqK9R7BOTPbNasrcxhwoIyELZtjF0sAPhjSoDyqkPlL8M0mkVwYHSd+wr0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/spec-ctrl: Remove conditional IRQs-on-ness for INT $0x80/0x82 paths
Message-Id: <E1r37l5-0006vP-QF@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 04:44:11 +0000

commit 0311ff4a2ca505c5edba6b9b36df0ded910f3388
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 26 14:37:38 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 31 17:48:31 2023 +0000

    x86/spec-ctrl: Remove conditional IRQs-on-ness for INT $0x80/0x82 paths
    
    Before speculation defences, some paths in Xen could genuinely get away with
    being IRQs-on at entry.  But XPTI invalidated this property on most paths, and
    attempting to maintain it on the remaining paths was a mistake.
    
    Fast forward, and DO_SPEC_CTRL_COND_IBPB (protection for AMD BTC/SRSO) is not
    IRQ-safe, running with IRQs enabled in some cases.  The other actions taken on
    these paths happen to be IRQ-safe.
    
    Make entry_int82() and int80_direct_trap() unconditionally Interrupt Gates
    rather than Trap Gates.  Remove the conditional re-adjustment of
    int80_direct_trap() in smp_prepare_cpus(), and have entry_int82() explicitly
    enable interrupts when safe to do so.
    
    In smp_prepare_cpus(), with the conditional re-adjustment removed, the
    clearing of pv_cr3 is the only remaining action gated on XPTI, and it is out
    of place anyway, repeating work already done by smp_prepare_boot_cpu().  Drop
    the entire if() condition to avoid leaving an incorrect vestigial remnant.
    
    Also drop comments which make incorrect statements about when its safe to
    enable interrupts.
    
    This is XSA-446 / CVE-2023-46836
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit a48bb129f1b9ff55c22cf6d2b589247c8ba3b10e)
---
 xen/arch/x86/pv/traps.c            |  4 ++--
 xen/arch/x86/smpboot.c             | 14 --------------
 xen/arch/x86/x86_64/compat/entry.S |  2 ++
 xen/arch/x86/x86_64/entry.S        |  1 -
 4 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/pv/traps.c b/xen/arch/x86/pv/traps.c
index 97fe54b5ee..9c4dca0d36 100644
--- a/xen/arch/x86/pv/traps.c
+++ b/xen/arch/x86/pv/traps.c
@@ -149,11 +149,11 @@ void __init pv_trap_init(void)
 #ifdef CONFIG_PV32
     /* The 32-on-64 hypercall vector is only accessible from ring 1. */
     _set_gate(idt_table + HYPERCALL_VECTOR,
-              SYS_DESC_trap_gate, 1, entry_int82);
+              SYS_DESC_irq_gate, 1, entry_int82);
 #endif
 
     /* Fast trap for int80 (faster than taking the #GP-fixup path). */
-    _set_gate(idt_table + LEGACY_SYSCALL_VECTOR, SYS_DESC_trap_gate, 3,
+    _set_gate(idt_table + LEGACY_SYSCALL_VECTOR, SYS_DESC_irq_gate, 3,
               &int80_direct_trap);
 
     open_softirq(NMI_SOFTIRQ, nmi_softirq);
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 41ec3211ac..7aa899dac3 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -1166,20 +1166,6 @@ void __init smp_prepare_cpus(void)
 
     stack_base[0] = (void *)((unsigned long)stack_start & ~(STACK_SIZE - 1));
 
-    if ( opt_xpti_hwdom || opt_xpti_domu )
-    {
-        get_cpu_info()->pv_cr3 = 0;
-
-#ifdef CONFIG_PV
-        /*
-         * All entry points which may need to switch page tables have to start
-         * with interrupts off. Re-write what pv_trap_init() has put there.
-         */
-        _set_gate(idt_table + LEGACY_SYSCALL_VECTOR, SYS_DESC_irq_gate, 3,
-                  &int80_direct_trap);
-#endif
-    }
-
     set_nr_sockets();
 
     socket_cpumask = xzalloc_array(cpumask_t *, nr_sockets);
diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index b86d38d1c5..253bb1688c 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -21,6 +21,8 @@ ENTRY(entry_int82)
         SPEC_CTRL_ENTRY_FROM_PV /* Req: %rsp=regs/cpuinfo, %rdx=0, Clob: acd */
         /* WARNING! `ret`, `call *`, `jmp *` not safe before this point. */
 
+        sti
+
         CR4_PV32_RESTORE
 
         GET_CURRENT(bx)
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index c12e011b4d..585b0c9551 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -327,7 +327,6 @@ ENTRY(sysenter_entry)
 #ifdef CONFIG_XEN_SHSTK
         ALTERNATIVE "", "setssbsy", X86_FEATURE_XEN_SHSTK
 #endif
-        /* sti could live here when we don't switch page tables below. */
         pushq $FLAT_USER_SS
         pushq $0
         pushfq
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 04:44:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 04:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633464.988215 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37lH-0006Y5-Ii; Wed, 15 Nov 2023 04:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633464.988215; Wed, 15 Nov 2023 04: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 1r37lH-0006Xx-GG; Wed, 15 Nov 2023 04:44:23 +0000
Received: by outflank-mailman (input) for mailman id 633464;
 Wed, 15 Nov 2023 04: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 1r37lG-0006Xp-1I
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04: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 1r37lF-0006wH-Vw
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:44:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37lF-0006vw-U8
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:44:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=La5Z4kH65FHXTJL8lvNpPQR6JXwxMLMGJktk5U1ecqc=; b=l73MxWuJzw6nfcrInhtUATJrSI
	5rkQ0VcH8EIaOl7jA5aQJCEXMC8KXYxNH4id8KX5lMNHSm0+RctXpy+6h2IzlyYvl/bwTMvGzt0DP
	YYBy/HUaik/0U2tEn+DO0Z6UOz2IKkSEeBUPD/2a/4SN6s6bsIl+sH5kVJjzRFhBjxq8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/amd: do not expose HWCR.TscFreqSel to guests
Message-Id: <E1r37lF-0006vw-U8@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 04:44:21 +0000

commit 4f43614a89f4e1093f91954d8b2b33ab93736a50
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Nov 14 13:50:35 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 14 13:50:35 2023 +0100

    x86/amd: do not expose HWCR.TscFreqSel to guests
    
    OpenBSD 7.3 will unconditionally access HWCR if the TSC is reported as
    Invariant, and it will then attempt to also unconditionally access PSTATE0 if
    HWCR.TscFreqSel is set (currently the case on Xen).
    
    The motivation for exposing HWCR.TscFreqSel was to avoid warning messages from
    Linux.  It has been agreed that Linux should be changed instead to not
    complaint about missing HWCR.TscFreqSel when running virtualized.
    
    The relation between HWCR.TscFreqSel and PSTATE0 is not clearly written down in
    the PPR, but it's natural for OSes to attempt to fetch the P0 frequency if the
    TSC is stated to increment at the P0 frequency.
    
    Exposing PSTATEn (PSTATE0 at least) with all zeroes is not a suitable solution
    because the PstateEn bit is read-write, and OSes could legitimately attempt to
    set PstateEn=1 which Xen couldn't handle.
    
    Furthermore, the TscFreqSel bit is model specific and was never safe to expose
    like this in the first place.  At a minimum it should have had a toolstack
    adjustment to know not to migrate such a VM.
    
    Therefore, simply remove the bit.  Note the HWCR itself is an architectural
    register, and does need to be accessible by the guest.  Since HWCR contains
    both architectural and non-architectural bits, going forward care must be taken
    to assert the exposed value is correct on newer CPU families.
    
    Reported-by: Solène Rapenne <solene@openbsd.org>
    Link: https://github.com/QubesOS/qubes-issues/issues/8502
    Fixes: 14b95b3b8546 ('x86/AMD: expose HWCR.TscFreqSel to guests')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: e4ca4e261da3fdddd541c3a9842b1e9e2ad00525
    master date: 2023-09-18 15:07:49 +0200
---
 xen/arch/x86/msr.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index 65fecdf785..f7192c1ddf 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -247,8 +247,7 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
     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;
+        *val = 0;
         break;
 
     case MSR_VIRT_SPEC_CTRL:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 04:44:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 04:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633465.988218 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37lR-0006ad-K1; Wed, 15 Nov 2023 04:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633465.988218; Wed, 15 Nov 2023 04: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 1r37lR-0006aW-He; Wed, 15 Nov 2023 04:44:33 +0000
Received: by outflank-mailman (input) for mailman id 633465;
 Wed, 15 Nov 2023 04: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 1r37lQ-0006aN-3e
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04: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 1r37lQ-0006wO-2s
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37lQ-0006wR-1n
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04: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=NjpFlEXwIWB+zu4g64O4pgYi/kRlpQp1OBPAyOCxcGE=; b=SNqqZoiws9Fxpi2Eal13wSufHh
	ofQRv+gtA8lZbx3NQRtMXWsEuGTe3fklsAqHzI9lp5WMMUAxcrzrg6SSRP4k6lcdXsDMTDOeK3AtM
	/Aa+AQV54FgEQlTDKY2QtaDYyugOSExPBLqufCliLTxdhwTQb9UwjasUTZ+8ghUzzgxI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] docs/sphinx: Switch hypercall-abi.rst to named footnotes
Message-Id: <E1r37lQ-0006wR-1n@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 04:44:32 +0000

commit 2e87f3a03a01003cf020f03f019a6e9905512874
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 14 13:51:41 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 14 13:51:41 2023 +0100

    docs/sphinx: Switch hypercall-abi.rst to named footnotes
    
    This will simplify inserting a new one in the middle.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 1357f1fa588f1523423861ea5eca2a894e0d6617
    master date: 2023-10-10 10:03:49 +0100
---
 docs/guest-guide/x86/hypercall-abi.rst | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/docs/guest-guide/x86/hypercall-abi.rst b/docs/guest-guide/x86/hypercall-abi.rst
index 14c48929d7..42a820386b 100644
--- a/docs/guest-guide/x86/hypercall-abi.rst
+++ b/docs/guest-guide/x86/hypercall-abi.rst
@@ -6,7 +6,7 @@ Hypercall ABI
 Hypercalls are system calls to Xen.  Two modes of guest operation are
 supported, and up to 6 individual parameters are supported.
 
-Hypercalls may only be issued by kernel-level software [1]_.
+Hypercalls may only be issued by kernel-level software [#kern]_.
 
 Registers
 ---------
@@ -33,7 +33,7 @@ The registers used for hypercalls depends on the operating mode of the guest.
 
 32 and 64bit PV guests have an ABI fixed by their guest type.  The ABI for an
 HVM guest depends on whether the vCPU is operating in a 64bit segment or not
-[2]_.
+[#mode]_.
 
 
 Parameters
@@ -87,7 +87,7 @@ written by Xen, is mapped with executable permissions so it may be used.
 Multiple hypercall pages may be created by the guest, if it wishes.
 
 The stubs are arranged by hypercall index, and start on 32-byte boundaries.
-To invoke a specific hypercall, ``call`` the relevant stub [3]_:
+To invoke a specific hypercall, ``call`` the relevant stub [#iret]_:
 
 .. code-block:: none
 
@@ -116,14 +116,14 @@ means.
 
 .. rubric:: Footnotes
 
-.. [1] For HVM guests, ``HVMOP_guest_request_vm_event`` may be configured to
-       be usable from userspace, but this behaviour is not default.
+.. [#kern] For HVM guests, ``HVMOP_guest_request_vm_event`` may be configured
+   to be usable from userspace, but this behaviour is not default.
 
-.. [2] While it is possible to use compatibility mode segments in a 64bit
-       kernel, hypercalls issues from such a mode will be interpreted with the
-       32bit ABI.  Such a setup is not expected in production scenarios.
+.. [#mode] While it is possible to use compatibility mode segments in a 64bit
+   kernel, hypercalls issues from such a mode will be interpreted with the
+   32bit ABI.  Such a setup is not expected in production scenarios.
 
-.. [3] ``HYPERCALL_iret`` is special.  It is only implemented for PV guests
-       and takes all its parameters on the stack.  This stub should be
-       ``jmp``'d to, rather than ``call``'d.  HVM guests have this stub
-       implemented as ``ud2a`` to prevent accidental use.
+.. [#iret] ``HYPERCALL_iret`` is special.  It is only implemented for PV
+   guests and takes all its parameters on the stack.  This stub should be
+   ``jmp``'d to, rather than ``call``'d.  HVM guests have this stub
+   implemented as ``ud2a`` to prevent accidental use.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 04:44:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 04:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633466.988223 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37lb-0006dU-Lj; Wed, 15 Nov 2023 04:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633466.988223; Wed, 15 Nov 2023 04: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 1r37lb-0006dM-J5; Wed, 15 Nov 2023 04:44:43 +0000
Received: by outflank-mailman (input) for mailman id 633466;
 Wed, 15 Nov 2023 04:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37la-0006d7-7W
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04: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 1r37la-0006wY-5z
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37la-0006wq-51
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04: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=eObX2Qs3qUQlyTHQ+ad1KheJYqV+aFt3ONdsNJxY/T0=; b=qzxcNlGM15GI4xU2wWTvgj2nOY
	ciN6We4N+0osC91wEvYwxodfjpJq33edFLpkrDzCtT02F/wQMJUBNmbDSoOKhG3L8ZbHGqQ7FSdpG
	Kd+3QPi0M/dVe62L+pQX96xar6E0VIqElRJBhSqjX0rwsMF8ZpwTlBSuh1apgurI2kKw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86: Clarify that only 5 hypercall parameters are supported
Message-Id: <E1r37la-0006wq-51@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 04:44:42 +0000

commit 6384cdf0c3405a989aa722d0d80847114d35cf8d
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Nov 14 13:52:01 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 14 13:52:01 2023 +0100

    x86: Clarify that only 5 hypercall parameters are supported
    
    The x86 hypercall ABI really used to have 6-argument hypercalls.  V4V, the
    downstream predecessor to Argo did take 6th args.
    
    However, the 6th arg being %ebp in the 32bit ABI makes it unusable in
    practice, because that's the frame pointer in builds with frame pointers
    enabled.  Therefore Argo was altered to being a 5-arg hypercall when it was
    upstreamed.
    
    c/s 2f531c122e95 ("x86: limit number of hypercall parameters to 5") removed
    the ability for hypercalls to take 6 arguments.
    
    Update the documentation to match reality.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
    master commit: c035151902689aa5a3765aeb16fa52755917b9ca
    master date: 2023-10-10 10:03:49 +0100
---
 docs/guest-guide/x86/hypercall-abi.rst   | 15 +++++++++++----
 xen/include/public/arch-x86/xen-x86_32.h |  2 +-
 xen/include/public/arch-x86/xen-x86_64.h |  2 +-
 3 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/docs/guest-guide/x86/hypercall-abi.rst b/docs/guest-guide/x86/hypercall-abi.rst
index 42a820386b..83890e1cb6 100644
--- a/docs/guest-guide/x86/hypercall-abi.rst
+++ b/docs/guest-guide/x86/hypercall-abi.rst
@@ -4,7 +4,7 @@ Hypercall ABI
 =============
 
 Hypercalls are system calls to Xen.  Two modes of guest operation are
-supported, and up to 6 individual parameters are supported.
+supported, and up to 5 individual parameters are supported.
 
 Hypercalls may only be issued by kernel-level software [#kern]_.
 
@@ -18,17 +18,17 @@ The registers used for hypercalls depends on the operating mode of the guest.
 
    * - ABI
      - Hypercall Index
-     - Parameters (1 - 6)
+     - Parameters (1 - 5) [#params]_
      - Result
 
    * - 64bit
      - RAX
-     - RDI RSI RDX R10 R8 R9
+     - RDI RSI RDX R10 R8
      - RAX
 
    * - 32bit
      - EAX
-     - EBX ECX EDX ESI EDI EBP
+     - EBX ECX EDX ESI EDI
      - EAX
 
 32 and 64bit PV guests have an ABI fixed by their guest type.  The ABI for an
@@ -119,6 +119,13 @@ means.
 .. [#kern] For HVM guests, ``HVMOP_guest_request_vm_event`` may be configured
    to be usable from userspace, but this behaviour is not default.
 
+.. [#params] Xen's ABI used to declare support for 6 hypercall arguments,
+   using ``r9`` and ``ebp``.  However, such an ABI clobbers the frame pointer
+   in the 32bit code and does not interact nicely with guest-side debugging.
+   ``V4V``, the predecessor to ``HYPERCALL_argo_op`` was a 6-argument
+   hypercall, but the ABI was intentionally altered when Argo was upstreamed
+   (Xen 4.13) to be the 5-argument hypercall it now is.
+
 .. [#mode] While it is possible to use compatibility mode segments in a 64bit
    kernel, hypercalls issues from such a mode will be interpreted with the
    32bit ABI.  Such a setup is not expected in production scenarios.
diff --git a/xen/include/public/arch-x86/xen-x86_32.h b/xen/include/public/arch-x86/xen-x86_32.h
index 139438e835..9e3bf06b12 100644
--- a/xen/include/public/arch-x86/xen-x86_32.h
+++ b/xen/include/public/arch-x86/xen-x86_32.h
@@ -12,7 +12,7 @@
 
 /*
  * Hypercall interface:
- *  Input:  %ebx, %ecx, %edx, %esi, %edi, %ebp (arguments 1-6)
+ *  Input:  %ebx, %ecx, %edx, %esi, %edi (arguments 1-5)
  *  Output: %eax
  * Access is via hypercall page (set up by guest loader or via a Xen MSR):
  *  call hypercall_page + hypercall-number * 32
diff --git a/xen/include/public/arch-x86/xen-x86_64.h b/xen/include/public/arch-x86/xen-x86_64.h
index 5d9035ed22..43f6e3d220 100644
--- a/xen/include/public/arch-x86/xen-x86_64.h
+++ b/xen/include/public/arch-x86/xen-x86_64.h
@@ -12,7 +12,7 @@
 
 /*
  * Hypercall interface:
- *  Input:  %rdi, %rsi, %rdx, %r10, %r8, %r9 (arguments 1-6)
+ *  Input:  %rdi, %rsi, %rdx, %r10, %r8 (arguments 1-5)
  *  Output: %rax
  * Access is via hypercall page (set up by guest loader or via a Xen MSR):
  *  call hypercall_page + hypercall-number * 32
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 04:44:53 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 04:44:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633467.988227 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37ll-0006gT-ND; Wed, 15 Nov 2023 04:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633467.988227; Wed, 15 Nov 2023 04: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 1r37ll-0006gL-KW; Wed, 15 Nov 2023 04:44:53 +0000
Received: by outflank-mailman (input) for mailman id 633467;
 Wed, 15 Nov 2023 04:44:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37lk-0006g4-A8
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:44:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37lk-0006wg-9L
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37lk-0006xL-83
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:44:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Eb3A5S3vb1WiF8YYJwjpU/WxBHYMmoe7FKr71bCXz9k=; b=3bAlSNh4wj9tuPFnJmB+fpkGAo
	rEHsC53ue2KPZiN0wdnJ/HiL/iOb1ATtvRwF0++f9zLzRPWKta+MH4OSnq6up9oYfbxKsO8aKu4Eu
	ONQnCq3omuYjEpjkQbytgAsCor2jOV5pFZOt59Xiis/OMplC6SQf8oOz6/2AWDRKbwmQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] cxenstored: wait until after reset to notify dom0less domains
Message-Id: <E1r37lk-0006xL-83@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 04:44:52 +0000

commit 65e1f3d289d7b35ee8eceaca1d5c4346d5562e04
Author:     George Dunlap <george.dunlap@cloud.com>
AuthorDate: Tue Nov 14 13:52:27 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 14 13:52:27 2023 +0100

    cxenstored: wait until after reset to notify dom0less domains
    
    Commit fc2b57c9a ("xenstored: send an evtchn notification on
    introduce_domain") introduced the sending of an event channel to the
    guest when first introduced, so that dom0less domains waiting for the
    connection would know that xenstore was ready to use.
    
    Unfortunately, it was introduced in introduce_domain(), which 1) is
    called by other functions, where such functionality is unneeded, and
    2) after the main XS_INTRODUCE call, calls domain_conn_reset().  This
    introduces a race condition, whereby if xenstored is delayed, a domain
    can wake up, send messages to the buffer, only to have them deleted by
    xenstore before finishing its processing of the XS_INTRODUCE message.
    
    Move the connect-and-notfy call into do_introduce() instead, after the
    domain_conn_rest(); predicated on the state being in the
    XENSTORE_RECONNECT state.
    
    (We don't need to check for "restoring", since that value is always
    passed as "false" from do_domain_introduce()).
    
    Also take the opportunity to add a missing wmb barrier after resetting
    the indexes of the ring in domain_conn_reset.
    
    This change will also remove an extra event channel notification for
    dom0 (because the notification is now done by do_introduce which is not
    called for dom0.) The extra dom0 event channel notification was only
    introduced by fc2b57c9a and was never present before. It is not needed
    because dom0 is the one to tell xenstored the connection parameters, so
    dom0 has to know that the ring page is setup correctly by the time
    xenstored starts looking at it. It is dom0 that performs the ring page
    init.
    
    Signed-off-by: George Dunlap <george.dunlap@cloud.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    master commit: e58bd71c097d04f001e0c6c2868a0aec03d25c63
    master date: 2023-10-17 13:56:55 -0700
---
 tools/xenstore/xenstored_domain.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index 6074df210c..ec91334c83 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -558,6 +558,7 @@ static void domain_conn_reset(struct domain *domain)
 
 	domain->interface->req_cons = domain->interface->req_prod = 0;
 	domain->interface->rsp_cons = domain->interface->rsp_prod = 0;
+	xen_wmb();
 }
 
 /*
@@ -623,12 +624,6 @@ static struct domain *introduce_domain(const void *ctx,
 		/* Now domain belongs to its connection. */
 		talloc_steal(domain->conn, domain);
 
-		if (!restore) {
-			/* Notify the domain that xenstore is available */
-			interface->connection = XENSTORE_CONNECTED;
-			xenevtchn_notify(xce_handle, domain->port);
-		}
-
 		if (!is_master_domain && !restore)
 			fire_watches(NULL, ctx, "@introduceDomain", NULL,
 				     true, NULL);
@@ -669,6 +664,13 @@ int do_introduce(const void *ctx, struct connection *conn,
 
 	domain_conn_reset(domain);
 
+	if (domain->interface != NULL &&
+	    domain->interface->connection == XENSTORE_RECONNECT) {
+		/* Notify the domain that xenstore is available */
+		domain->interface->connection = XENSTORE_CONNECTED;
+		xenevtchn_notify(xce_handle, domain->port);
+	}
+
 	send_ack(conn, XS_INTRODUCE);
 
 	return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 04:45:03 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 04:45:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633468.988231 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37lv-0006ik-Ou; Wed, 15 Nov 2023 04:45:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633468.988231; Wed, 15 Nov 2023 04: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 1r37lv-0006ic-M2; Wed, 15 Nov 2023 04:45:03 +0000
Received: by outflank-mailman (input) for mailman id 633468;
 Wed, 15 Nov 2023 04:45:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37lu-0006iT-E5
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:45:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37lu-0006xD-DH
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37lu-00076V-BV
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:45:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rGKg3mLLy1O9Pl+WxZgfjMLesIiRjga+BlXN/2eKVR0=; b=Q2sFonA6bQs3tzld6l4hrUFssy
	ySF3hx6yiw4XR47viYYDHr+Oy7JwKA4tujNBhLQV3hUXPa9esofFX9KDEjwzEGe+ZqtG7yz0akqB6
	QVVM/BovEfaH9h7Nz+8xwTdkZnw3Hq9puv0zZTALjLlg+OI3oUGJxYB0OrsRSBbXO82g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] tools/pygrub: Fix pygrub's --entry flag for python3
Message-Id: <E1r37lu-00076V-BV@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 04:45:02 +0000

commit 7eb2a4eba1ecb5e3fb0b29ce88a4d521a71a9440
Author:     Alejandro Vallejo <alejandro.vallejo@cloud.com>
AuthorDate: Tue Nov 14 13:53:01 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 14 13:53:01 2023 +0100

    tools/pygrub: Fix pygrub's --entry flag for python3
    
    string.atoi() has been deprecated since Python 2.0, has a big scary warning
    in the python2.7 docs and is absent from python3 altogether. int() does the
    same thing and is compatible with both.
    
    See https://docs.python.org/2/library/string.html#string.atoi:
    
    Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 40387f62061c4b9c780cda78b4ac0e29d478f648
    master date: 2023-10-18 15:44:31 +0100
---
 tools/pygrub/src/pygrub | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index 7cea496ade..49e627467b 100755
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -731,7 +731,7 @@ class Grub:
 def get_entry_idx(cf, entry):
     # first, see if the given entry is numeric
     try:
-        idx = string.atoi(entry)
+        idx = int(entry)
         return idx
     except ValueError:
         pass
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 04:45:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 04:45:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633469.988234 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37m5-0006lV-QJ; Wed, 15 Nov 2023 04:45:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633469.988234; Wed, 15 Nov 2023 04: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 1r37m5-0006lN-NP; Wed, 15 Nov 2023 04:45:13 +0000
Received: by outflank-mailman (input) for mailman id 633469;
 Wed, 15 Nov 2023 04:45:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37m4-0006lF-HO
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:45:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37m4-0006xi-GZ
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:45:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37m4-000770-FY
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:45:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nBjTquIElzcGO8JrpaxkjJHjkGS7thEf5eHaElAb3uM=; b=RLL5Ibpb38Om8wh9jjFEd7TYUg
	svfV97XYwN5m0lvF/fcJhd5xmTH0587KfU1MPAtkgvbNawkPLMo3In5YvqLmY2uT74VRwrSxmxKlJ
	Fw2J6vEo33JS0hc7XGTxQ4MrR/MmTg8F+J9s+mkbjLINIf9HSvMStPs1DJT6ts8YXyxc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86: Add bit definitions for Automatic IBRS
Message-Id: <E1r37m4-000770-FY@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 04:45:12 +0000

commit 1a94fc132a4bb8815f6a8f1e29f15a7e779e9ea0
Author:     Alejandro Vallejo <alejandro.vallejo@cloud.com>
AuthorDate: Tue Nov 14 13:53:39 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 14 13:53:39 2023 +0100

    x86: Add bit definitions for Automatic IBRS
    
    This is an AMD feature to reduce the IBRS handling overhead. Once enabled,
    processes running at CPL=0 are automatically IBRS-protected even if
    SPEC_CTRL.IBRS is not set. Furthermore, the RAS/RSB is cleared on VMEXIT.
    
    The feature is exposed in CPUID and toggled in EFER.
    
    Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8347d6bb29bfd0c3b5acdc078574a8643c5a5637
    master date: 2023-05-30 18:24:07 +0100
---
 tools/misc/xen-cpuid.c                      | 1 +
 xen/arch/x86/include/asm/cpufeature.h       | 1 +
 xen/arch/x86/include/asm/msr-index.h        | 1 +
 xen/include/public/arch-x86/cpufeatureset.h | 1 +
 4 files changed, 4 insertions(+)

diff --git a/tools/misc/xen-cpuid.c b/tools/misc/xen-cpuid.c
index d2912c096b..aefc140d66 100644
--- a/tools/misc/xen-cpuid.c
+++ b/tools/misc/xen-cpuid.c
@@ -195,6 +195,7 @@ static const char *const str_e21a[32] =
 {
     [ 2] = "lfence+",
     [ 6] = "nscb",
+    [ 8] = "auto-ibrs",
 
     /* 26 */                [27] = "sbpb",
     [28] = "ibpb-brtype",   [29] = "srso-no",
diff --git a/xen/arch/x86/include/asm/cpufeature.h b/xen/arch/x86/include/asm/cpufeature.h
index 458806cc8c..b818ef75c0 100644
--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -129,6 +129,7 @@
 #define cpu_has_amd_ssbd        boot_cpu_has(X86_FEATURE_AMD_SSBD)
 #define cpu_has_virt_ssbd       boot_cpu_has(X86_FEATURE_VIRT_SSBD)
 #define cpu_has_ssb_no          boot_cpu_has(X86_FEATURE_SSB_NO)
+#define cpu_has_auto_ibrs       boot_cpu_has(X86_FEATURE_AUTO_IBRS)
 
 /* CPUID level 0x00000007:0.edx */
 #define cpu_has_avx512_4vnniw   boot_cpu_has(X86_FEATURE_AVX512_4VNNIW)
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index 2e0f9caee0..ea09166ce8 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -177,6 +177,7 @@
 #define  EFER_NXE                           (_AC(1, ULL) << 11) /* No Execute Enable */
 #define  EFER_SVME                          (_AC(1, ULL) << 12) /* Secure Virtual Machine Enable */
 #define  EFER_FFXSE                         (_AC(1, ULL) << 14) /* Fast FXSAVE/FXRSTOR */
+#define  EFER_AIBRSE                        (_AC(1, ULL) << 21) /* Automatic IBRS Enable */
 
 #define EFER_KNOWN_MASK \
     (EFER_SCE | EFER_LME | EFER_LMA | EFER_NXE | EFER_SVME | EFER_FFXSE)
diff --git a/xen/include/public/arch-x86/cpufeatureset.h b/xen/include/public/arch-x86/cpufeatureset.h
index d6ce4af6f5..94d211df2f 100644
--- a/xen/include/public/arch-x86/cpufeatureset.h
+++ b/xen/include/public/arch-x86/cpufeatureset.h
@@ -284,6 +284,7 @@ XEN_CPUFEATURE(FSRCS,        10*32+12) /*A  Fast Short REP CMPSB/SCASB */
 /* AMD-defined CPU features, CPUID level 0x80000021.eax, word 11 */
 XEN_CPUFEATURE(LFENCE_DISPATCH,    11*32+ 2) /*A  LFENCE always serializing */
 XEN_CPUFEATURE(NSCB,               11*32+ 6) /*A  Null Selector Clears Base (and limit too) */
+XEN_CPUFEATURE(AUTO_IBRS,          11*32+ 8) /*   Automatic IBRS */
 XEN_CPUFEATURE(SBPB,               11*32+27) /*A  Selective Branch Predictor Barrier */
 XEN_CPUFEATURE(IBPB_BRTYPE,        11*32+28) /*A  IBPB flushes Branch Type predictions too */
 XEN_CPUFEATURE(SRSO_NO,            11*32+29) /*A  Hardware not vulenrable to Speculative Return Stack Overflow */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 04:45:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 04:45:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633470.988238 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37mF-0006oP-TR; Wed, 15 Nov 2023 04:45:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633470.988238; Wed, 15 Nov 2023 04:45:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37mF-0006oH-Qs; Wed, 15 Nov 2023 04:45:23 +0000
Received: by outflank-mailman (input) for mailman id 633470;
 Wed, 15 Nov 2023 04:45:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37mE-0006o5-LX
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:45:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37mE-0006xp-Jr
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:45:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37mE-00077e-Ir
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:45:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=iy/RCbPrGNREV4sBaLMCJksAwK+2+yHNMezXue5cJ1M=; b=no64477dj1bMUP50F4QqUChVQT
	gwufvIzI1L77CAydHZUi7qKnwmPJUfVWEvBb1OjYpPlSf4FJj36bPsvaJmW9FuMUrd8YJTJ4GFR2z
	EkltzB41cXKmehonpp7cNr87kSi+ksMCidwlxd3TXGCRbRU0PGBxvvRZKF0l3x8AQoFI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/amd: Address AMD erratum #1485
Message-Id: <E1r37mE-00077e-Ir@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 04:45:22 +0000

commit e1275e58c7d4c26bcfa85139e9ae68a8f217a298
Author:     Alejandro Vallejo <alejandro.vallejo@cloud.com>
AuthorDate: Tue Nov 14 13:54:40 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 14 13:54:40 2023 +0100

    x86/amd: Address AMD erratum #1485
    
    This erratum has been observed to cause #UD exceptions.
    
    Fix adapted off Linux's mailing list:
      https://lore.kernel.org/lkml/D99589F4-BC5D-430B-87B2-72C20370CF57@exactcode.com/T/#u
    
    Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 26ea12d940b47689f0eab315afd84f8c6eb5bd81
    master date: 2023-10-18 15:44:31 +0100
---
 xen/arch/x86/cpu/amd.c               | 22 ++++++++++++++++++++++
 xen/arch/x86/include/asm/amd.h       |  5 +++++
 xen/arch/x86/include/asm/msr-index.h |  1 +
 3 files changed, 28 insertions(+)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index e94ba5a0e0..29ae97e7c0 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -977,6 +977,27 @@ static void cf_check zen2_disable_c6(void *arg)
 	wrmsrl(MSR_AMD_CSTATE_CFG, val & mask);
 }
 
+static void amd_check_erratum_1485(void)
+{
+	uint64_t val, chickenbit = (1 << 5);
+
+	if (cpu_has_hypervisor || boot_cpu_data.x86 != 0x19 || !is_zen4_uarch())
+		return;
+
+	rdmsrl(MSR_AMD64_BP_CFG, val);
+
+	if (val & chickenbit)
+		return;
+
+	/*
+	 * BP_CFG is a core-scoped MSR. There's a benign race on this write
+	 * on the case where 2 threads perform the previous check at the
+	 * same time before the chickenbit is set. It's benign because the
+	 * value being written is the same on both.
+	 */
+	wrmsrl(MSR_AMD64_BP_CFG, val | chickenbit);
+}
+
 static void cf_check init_amd(struct cpuinfo_x86 *c)
 {
 	u32 l, h;
@@ -1250,6 +1271,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 		disable_c1_ramping();
 
 	amd_check_zenbleed();
+	amd_check_erratum_1485();
 
 	if (zen2_c6_disabled)
 		zen2_disable_c6(NULL);
diff --git a/xen/arch/x86/include/asm/amd.h b/xen/arch/x86/include/asm/amd.h
index 82324110ab..6235ab247b 100644
--- a/xen/arch/x86/include/asm/amd.h
+++ b/xen/arch/x86/include/asm/amd.h
@@ -145,11 +145,16 @@
  * Hygon (Fam18h) but without simple model number rules.  Instead, use STIBP
  * as a heuristic that distinguishes the two.
  *
+ * For Zen3 and Zen4 (Fam19h) the heuristic is the presence of AutoIBRS, as
+ * it's Zen4-specific.
+ *
  * The caller is required to perform the appropriate vendor/family checks
  * first.
  */
 #define is_zen1_uarch() (!boot_cpu_has(X86_FEATURE_AMD_STIBP))
 #define is_zen2_uarch()   boot_cpu_has(X86_FEATURE_AMD_STIBP)
+#define is_zen3_uarch() (!boot_cpu_has(X86_FEATURE_AUTO_IBRS))
+#define is_zen4_uarch()   boot_cpu_has(X86_FEATURE_AUTO_IBRS)
 
 struct cpuinfo_x86;
 int cpu_has_amd_erratum(const struct cpuinfo_x86 *, int, ...);
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index ea09166ce8..6abf7bc34a 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -386,6 +386,7 @@
 #define MSR_AMD64_DE_CFG		0xc0011029
 #define AMD64_DE_CFG_LFENCE_SERIALISE	(_AC(1, ULL) << 1)
 #define MSR_AMD64_EX_CFG		0xc001102c
+#define MSR_AMD64_BP_CFG		0xc001102e
 #define MSR_AMD64_DE_CFG2		0xc00110e3
 
 #define MSR_AMD64_DR0_ADDRESS_MASK	0xc0011027
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 04:45:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 04:45:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633471.988243 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37mP-0006rN-V9; Wed, 15 Nov 2023 04:45:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633471.988243; Wed, 15 Nov 2023 04:45: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 1r37mP-0006rF-SH; Wed, 15 Nov 2023 04:45:33 +0000
Received: by outflank-mailman (input) for mailman id 633471;
 Wed, 15 Nov 2023 04:45: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 1r37mO-0006r1-Nw
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:45: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 1r37mO-0006xy-NA
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:45:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37mO-00078X-MF
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:45:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=p8/CKdZrU2aopozHO2ZR+2uiAZkkjq+OGL0Cc0dcUOk=; b=eB0CUtSufp5EowN9p97jwNBhzo
	rEQAdZDkR4fp6Ak1My4cj35YCBRL6XbuWKR4+QoC4sXyRyktrXm/tQIaQpc6R0YXz4l/PrYMUts4+
	pN9Uf8aiZaE4nGYZDYwFMTXaaFd81aQUy+M+yVfGPLltJa7O72EI//qwOLdK5Jg7OGr8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/pvh: fix identity mapping of low 1MB
Message-Id: <E1r37mO-00078X-MF@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 04:45:32 +0000

commit f6996645d2d66505b6f57cf17bcad726431043a0
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Nov 14 13:55:23 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 14 13:55:23 2023 +0100

    x86/pvh: fix identity mapping of low 1MB
    
    The mapping of memory regions below the 1MB mark was all done by the PVH dom0
    builder code, causing the region to be avoided by the arch specific IOMMU
    hardware domain initialization code.  That lead to the IOMMU being enabled
    without reserved regions in the low 1MB identity mapped in the p2m for PVH
    hardware domains.  Firmware which happens to be missing RMRR/IVMD ranges
    describing E820 reserved regions in the low 1MB would transiently trigger IOMMU
    faults until the p2m is populated by the PVH dom0 builder:
    
    AMD-Vi: IO_PAGE_FAULT: 0000:00:13.1 d0 addr 00000000000eb380 flags 0x20 RW
    AMD-Vi: IO_PAGE_FAULT: 0000:00:13.1 d0 addr 00000000000eb340 flags 0
    AMD-Vi: IO_PAGE_FAULT: 0000:00:13.2 d0 addr 00000000000ea1c0 flags 0
    AMD-Vi: IO_PAGE_FAULT: 0000:00:14.5 d0 addr 00000000000eb480 flags 0x20 RW
    AMD-Vi: IO_PAGE_FAULT: 0000:00:12.0 d0 addr 00000000000eb080 flags 0x20 RW
    AMD-Vi: IO_PAGE_FAULT: 0000:00:14.5 d0 addr 00000000000eb400 flags 0
    AMD-Vi: IO_PAGE_FAULT: 0000:00:12.0 d0 addr 00000000000eb040 flags 0
    
    Those errors have been observed on the osstest pinot{0,1} boxes (AMD Fam15h
    Opteron(tm) Processor 3350 HE).
    
    Rely on the IOMMU arch init code to create any identity mappings for reserved
    regions in the low 1MB range (like it already does for reserved regions
    elsewhere), and leave the mapping of any holes to be performed by the dom0
    builder code.
    
    Fixes: 6b4f6a31ace1 ('x86/PVH: de-duplicate mappings for first Mb of Dom0 memory')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 4bb882fe6e4430782101fe06379649df1bbd458a
    master date: 2023-10-19 09:52:43 +0200
---
 xen/arch/x86/hvm/dom0_build.c       | 7 ++++---
 xen/drivers/passthrough/x86/iommu.c | 8 +-------
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 3ac6b7b423..c539a8d2c1 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -460,7 +460,7 @@ static int __init pvh_populate_p2m(struct domain *d)
         }
     }
 
-    /* Non-RAM regions of space below 1MB get identity mapped. */
+    /* Identity map everything below 1MB that's not already mapped. */
     for ( i = rc = 0; i < MB1_PAGES; ++i )
     {
         p2m_type_t p2mt;
@@ -470,8 +470,9 @@ static int __init pvh_populate_p2m(struct domain *d)
             rc = set_mmio_p2m_entry(d, _gfn(i), _mfn(i), PAGE_ORDER_4K);
         else
             /*
-             * If the p2m entry is already set it must belong to a RMRR and
-             * already be identity mapped, or be a RAM region.
+             * If the p2m entry is already set it must belong to a reserved
+             * region (e.g. RMRR/IVMD) and be identity mapped, or else be a
+             * RAM region.
              */
             ASSERT(p2mt == p2m_ram_rw || mfn_eq(mfn, _mfn(i)));
         put_gfn(d, i);
diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c
index 8bd0ccb2e9..22d67b4fd2 100644
--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -384,13 +384,7 @@ void __hwdom_init arch_iommu_hwdom_init(struct domain *d)
     max_pfn = (GB(4) >> PAGE_SHIFT) - 1;
     top = max(max_pdx, pfn_to_pdx(max_pfn) + 1);
 
-    /*
-     * First Mb will get mapped in one go by pvh_populate_p2m(). Avoid
-     * setting up potentially conflicting mappings here.
-     */
-    start = paging_mode_translate(d) ? PFN_DOWN(MB(1)) : 0;
-
-    for ( i = start, count = 0; i < top; )
+    for ( i = 0, start = 0, count = 0; i < top; )
     {
         unsigned long pfn = pdx_to_pfn(i);
         unsigned int perms = hwdom_iommu_map(d, pfn, max_pfn);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 04:45:44 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 04:45:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633472.988246 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37mZ-0006uM-WD; Wed, 15 Nov 2023 04:45:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633472.988246; Wed, 15 Nov 2023 04:45: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 1r37mZ-0006uF-Th; Wed, 15 Nov 2023 04:45:43 +0000
Received: by outflank-mailman (input) for mailman id 633472;
 Wed, 15 Nov 2023 04:45: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 1r37mY-0006tz-Qz
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:45: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 1r37mY-0006y7-QH
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:45:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37mY-000798-PM
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:45: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=kE3n9ptShtm5mlPbGeCsXjj5D+hEBrDuLyw+juSKsnY=; b=xg8K98RQvkWOQJ3q56f5l/U8dZ
	b1nRv8ik4u8LRRT6GAUwfz9tNffStNeOrAc+jUZX3ODn9QWbmgrkElKyKfYI6lik1kB1j9BK93CtI
	R1p6D5Tc3HTFpG5qFjqwtDaxn6jEwqwPQ6F5t/9uoIUDebe8/xEjHVdKwN8Ce2ecsepE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] iommu: fix quarantine mode command line documentation
Message-Id: <E1r37mY-000798-PM@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 04:45:42 +0000

commit ee4ce011986e5a6e8283d3ca2631a7ceafa9206f
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Nov 14 13:56:13 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 14 13:56:13 2023 +0100

    iommu: fix quarantine mode command line documentation
    
    With the addition of per-device quarantine page tables the sink page is now
    exclusive for each device, and thus writable.  Update the documentation to
    reflect the current implementation.
    
    Fixes: 14dd241aad8a ('IOMMU/x86: use per-device page tables for quarantining')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 94a5127ebeb4a005f128150909ca78bfea50206a
    master date: 2023-10-19 21:52:52 +0100
---
 docs/misc/xen-command-line.pandoc | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index b92c8f969c..c4afd51a81 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1484,15 +1484,14 @@ boolean (e.g. `iommu=no`) can override this and leave the IOMMUs disabled.
     should be enabled.  Quarantining can be done in two ways: In its basic
     form, all in-flight DMA will simply be forced to encounter IOMMU
     faults.  Since there are systems where doing so can cause host lockup,
-    an alternative form is available where writes to memory will be made
-    fault, but reads will be directed to a scratch page.  The implication
-    here is that such reads will go unnoticed, i.e. an admin may not
-    become aware of the underlying problem.
+    an alternative form is available where accesses to memory will be directed
+    to a scratch page. The implication here is that such accesses will go
+    unnoticed, i.e. an admin may not become aware of the underlying problem.
 
     Therefore, if this option is set to true (the default), Xen always
     quarantines such devices; they must be explicitly assigned back to Dom0
     before they can be used there again.  If set to "scratch-page", still
-    active DMA reads will additionally be directed to a "scratch" page.  If
+    active DMA operations will additionally be directed to a "scratch" page.  If
     set to false, Xen will only quarantine devices the toolstack has arranged
     for getting quarantined, and only in the "basic" form.
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 04:45:54 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 04:45:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633473.988251 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37mk-0007FF-1a; Wed, 15 Nov 2023 04:45:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633473.988251; Wed, 15 Nov 2023 04:45:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37mj-0007F7-V8; Wed, 15 Nov 2023 04:45:53 +0000
Received: by outflank-mailman (input) for mailman id 633473;
 Wed, 15 Nov 2023 04:45: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 1r37mi-0007Ez-U1
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:45: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 1r37mi-0006yG-T9
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:45:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37mi-00079Z-SQ
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:45: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=NHZwveq2Rh4ggYyx5rYod28kiwT7IqTwiaDzRVf6CnA=; b=sEHQonCqrshUSXSRFeRty/6F2d
	rfdx1XTb5vs/wQXhk0g6zs2fOlI68rjpei912SAPGqcgUJoWOMHR6r7UYVwxJBunRIiZM2tdsdcx2
	UWWNOvOHBua6q+gMZqdouQ/kOkvYJVYECk6RDCjiTkl0L2PMYpv0+Oj05khp9kjndgo8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] iommu/vt-d: fix SAGAW capability parsing
Message-Id: <E1r37mi-00079Z-SQ@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 04:45:52 +0000

commit 40685f9283bcbd672a8d36e8ec617d4246ba9c4c
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Nov 14 13:56:39 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 14 13:56:39 2023 +0100

    iommu/vt-d: fix SAGAW capability parsing
    
    SAGAW is a bitmap field, with bits 1, 2 and 3 signaling support for 3, 4 and 5
    level page tables respectively.  According to the Intel VT-d specification, an
    IOMMU can report multiple SAGAW bits being set.
    
    Commit 859d11b27912 claims to replace the open-coded find_first_set_bit(), but
    it's actually replacing an open coded implementation to find the last set bit.
    The change forces the used AGAW to the lowest supported by the IOMMU instead of
    the highest one between 1 and 2.
    
    Restore the previous SAGAW parsing by using fls() instead of
    find_first_set_bit(), in order to get the highest (supported) AGAW to be used.
    
    However there's a caveat related to the value the AW context entry field must
    be set to when using passthrough mode:
    
    "When the Translation-type (TT) field indicates pass-through processing (10b),
    this field must be programmed to indicate the largest AGAW value supported by
    hardware." [0]
    
    Newer Intel IOMMU implementations support 5 level page tables for the IOMMU,
    and signal such support in SAGAW bit 3.
    
    Enabling 5 level paging support (AGAW 3) is too risky at this point in the Xen
    4.18 release, so instead put a bodge to unconditionally disable passthough
    mode if SAGAW has any bits greater than 2 set.  Ignore bit 0; it's reserved in
    current specifications, but had a meaning in the past and is unlikely to be
    reused in the future.
    
    Note the message about unhandled SAGAW bits being set is printed
    unconditionally, regardless of whether passthrough mode is enabled.  This is
    done in order to easily notice IOMMU implementations with not yet supported
    SAGAW values.
    
    [0] Intel VT Directed Spec Rev 4.1
    
    Fixes: 859d11b27912 ('VT-d: prune SAGAW recognition')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 474fc7d3c6525e209bd2fe1e6ef0bbb34de86bb4
    master date: 2023-10-19 21:52:52 +0100
---
 xen/drivers/passthrough/vtd/iommu.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index cde67b9574..b4c11a6b48 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1330,15 +1330,25 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
 
     /* Calculate number of pagetable levels: 3 or 4. */
     sagaw = cap_sagaw(iommu->cap);
-    if ( sagaw & 6 )
-        agaw = find_first_set_bit(sagaw & 6);
-    if ( !agaw )
+    agaw = fls(sagaw & 6) - 1;
+    if ( agaw <= 0 )
     {
         printk(XENLOG_ERR VTDPREFIX "IOMMU: unsupported sagaw %x\n", sagaw);
         print_iommu_regs(drhd);
         rc = -ENODEV;
         goto free;
     }
+
+    if ( sagaw >> 3 )
+    {
+        printk_once(XENLOG_WARNING VTDPREFIX
+                    " Unhandled bits in SAGAW %#x%s\n",
+                    sagaw,
+                    iommu_hwdom_passthrough ? ", disabling passthrough" : "");
+
+        iommu_hwdom_passthrough = false;
+    }
+
     iommu->nr_pt_levels = agaw_to_level(agaw);
     if ( min_pt_levels > iommu->nr_pt_levels )
         min_pt_levels = iommu->nr_pt_levels;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 04:46:04 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 04:46:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633474.988255 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37mu-0007Tb-3I; Wed, 15 Nov 2023 04:46:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633474.988255; Wed, 15 Nov 2023 04:46:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37mu-0007TT-0L; Wed, 15 Nov 2023 04:46:04 +0000
Received: by outflank-mailman (input) for mailman id 633474;
 Wed, 15 Nov 2023 04:46:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37mt-0007RY-0h
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:46:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37ms-0006yh-WD
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:46:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37ms-0007AM-VV
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:46: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=XYfMvaetJY4p5aROuobtAYZAwWlWK4io+XTj+DRFVwg=; b=aOuggzh0Y/xvhludQNLDdleW8/
	QVQY3AkhC2Q+q0B3zNA0NRjGIs2szk/J+icLanFqvz7KN7d8OgpqzJaRrXyMR2wc8z022mGYlOo6I
	YrEZJ48UO4oXNtXe5QRJR+7CH205zmkNxIUhx2j9fpSfy/BrlLTNv0qM8DrvwUhfsSIg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86: support data operand independent timing mode
Message-Id: <E1r37ms-0007AM-VV@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 04:46:02 +0000

commit bb13e631432a6fbcc0391431fc27ac85dc438248
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 14 13:58:18 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 14 13:58:18 2023 +0100

    x86: support data operand independent timing mode
    
    [1] specifies a long list of instructions which are intended to exhibit
    timing behavior independent of the data they operate on. On certain
    hardware this independence is optional, controlled by a bit in a new
    MSR. Provide a command line option to control the mode Xen and its
    guests are to operate in, with a build time control over the default.
    Longer term we may want to allow guests to control this.
    
    Since Arm64 supposedly also has such a control, put command line option
    and Kconfig control in common files.
    
    [1] https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/best-practices/data-operand-independent-timing-isa-guidance.html
    
    Requested-by: Demi Marie Obenour <demi@invisiblethingslab.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: bad1ac345b1910b820b8a703ad1b9f66412ea844
    master date: 2023-10-20 15:50:05 +0200
---
 CHANGELOG.md                          |  4 ++++
 docs/misc/xen-command-line.pandoc     | 11 +++++++++++
 xen/arch/x86/Kconfig                  |  1 +
 xen/arch/x86/cpu/common.c             | 24 ++++++++++++++++++++++++
 xen/arch/x86/include/asm/cpufeature.h |  1 +
 xen/common/Kconfig                    | 18 ++++++++++++++++++
 xen/common/kernel.c                   |  5 +++++
 xen/include/xen/param.h               |  2 ++
 8 files changed, 66 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index bb0eceb69a..3da238d5b9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  - Ignore VCPUOP_set_singleshot_timer's VCPU_SSHOTTMR_future flag. The only
    known user doesn't use it properly, leading to in-guest breakage.
 
+### Added
+ - On x86, support for enforcing system-wide operation in Data Operand
+   Independent Timing Mode.
+
 ## [4.17.0](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.17.0) - 2022-12-12
 
 ### Changed
diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index c4afd51a81..5ad24a70a9 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -770,6 +770,17 @@ Specify the size of the console debug trace buffer. By specifying `cpu:`
 additionally a trace buffer of the specified size is allocated per cpu.
 The debug trace feature is only enabled in debugging builds of Xen.
 
+### dit (x86/Intel)
+> `= <boolean>`
+
+> Default: `CONFIG_DIT_DEFAULT`
+
+Specify whether Xen and guests should operate in Data Independent Timing
+mode (Intel calls this DOITM, Data Operand Independent Timing Mode). Note
+that enabling this option cannot guarantee anything beyond what underlying
+hardware guarantees (with, where available and known to Xen, respective
+tweaks applied).
+
 ### dma_bits
 > `= <integer>`
 
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 2a5c3304e2..ab47cc23ac 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -14,6 +14,7 @@ config X86
 	select HAS_ALTERNATIVE
 	select HAS_COMPAT
 	select HAS_CPUFREQ
+	select HAS_DIT
 	select HAS_EHCI
 	select HAS_EX_TABLE
 	select HAS_FAST_MULTIPLY
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index ffa6099307..54ea7fa831 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -211,6 +211,28 @@ void ctxt_switch_levelling(const struct vcpu *next)
 		alternative_vcall(ctxt_switch_masking, next);
 }
 
+static void setup_doitm(void)
+{
+    uint64_t msr;
+
+    if ( !cpu_has_doitm )
+        return;
+
+    /*
+     * We don't currently enumerate DOITM to guests.  As a conseqeuence, guest
+     * kernels will believe they're safe even when they are not.
+     *
+     * For now, set it unilaterally.  This prevents otherwise-correct crypto
+     * code from becoming vulnerable to timing sidechannels.
+     */
+
+    rdmsrl(MSR_UARCH_MISC_CTRL, msr);
+    msr |= UARCH_CTRL_DOITM;
+    if ( !opt_dit )
+        msr &= ~UARCH_CTRL_DOITM;
+    wrmsrl(MSR_UARCH_MISC_CTRL, msr);
+}
+
 bool_t opt_cpu_info;
 boolean_param("cpuinfo", opt_cpu_info);
 
@@ -596,6 +618,8 @@ void identify_cpu(struct cpuinfo_x86 *c)
 
 		mtrr_bp_init();
 	}
+
+	setup_doitm();
 }
 
 /* leaf 0xb SMT level */
diff --git a/xen/arch/x86/include/asm/cpufeature.h b/xen/arch/x86/include/asm/cpufeature.h
index b818ef75c0..9ef7756593 100644
--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -155,6 +155,7 @@
 #define cpu_has_if_pschange_mc_no boot_cpu_has(X86_FEATURE_IF_PSCHANGE_MC_NO)
 #define cpu_has_tsx_ctrl        boot_cpu_has(X86_FEATURE_TSX_CTRL)
 #define cpu_has_taa_no          boot_cpu_has(X86_FEATURE_TAA_NO)
+#define cpu_has_doitm           boot_cpu_has(X86_FEATURE_DOITM)
 #define cpu_has_fb_clear        boot_cpu_has(X86_FEATURE_FB_CLEAR)
 #define cpu_has_rrsba           boot_cpu_has(X86_FEATURE_RRSBA)
 #define cpu_has_gds_ctrl        boot_cpu_has(X86_FEATURE_GDS_CTRL)
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 855c843113..e7794cb7f6 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -38,6 +38,9 @@ config HAS_COMPAT
 config HAS_DEVICE_TREE
 	bool
 
+config HAS_DIT # Data Independent Timing
+	bool
+
 config HAS_EX_TABLE
 	bool
 
@@ -172,6 +175,21 @@ config SPECULATIVE_HARDEN_GUEST_ACCESS
 
 endmenu
 
+config DIT_DEFAULT
+	bool "Data Independent Timing default"
+	depends on HAS_DIT
+	help
+	  Hardware often surfaces instructions the timing of which is dependent
+	  on the data they process.  Some of these instructions may be used in
+	  timing sensitive environments, e.g. cryptography.  When such
+	  instructions exist, hardware may further surface a control allowing
+	  to make the behavior of such instructions independent of the data
+	  they act upon.  Note the build time value can be overridden at runtime
+	  using the "dit" command line option.
+
+	  NB: Intel calls the feature DOITM (Data Operand Independent Timing
+	      Mode).
+
 config HYPFS
 	bool "Hypervisor file system support"
 	default y
diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index 0e8abe0cf8..f64f7dab37 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -22,6 +22,11 @@
 
 enum system_state system_state = SYS_STATE_early_boot;
 
+#ifdef CONFIG_HAS_DIT
+bool __ro_after_init opt_dit = IS_ENABLED(CONFIG_DIT_DEFAULT);
+boolean_param("dit", opt_dit);
+#endif
+
 xen_commandline_t saved_cmdline;
 static const char __initconst opt_builtin_cmdline[] = CONFIG_CMDLINE;
 
diff --git a/xen/include/xen/param.h b/xen/include/xen/param.h
index 1b2c7db954..93c3fe7cb7 100644
--- a/xen/include/xen/param.h
+++ b/xen/include/xen/param.h
@@ -184,6 +184,8 @@ extern struct param_hypfs __paramhypfs_start[], __paramhypfs_end[];
     string_param(_name, _var); \
     string_runtime_only_param(_name, _var)
 
+extern bool opt_dit;
+
 static inline void no_config_param(const char *cfg, const char *param,
                                    const char *s, const char *e)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 04:46:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 04:46:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633475.988259 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37n4-0007YH-6x; Wed, 15 Nov 2023 04:46:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633475.988259; Wed, 15 Nov 2023 04:46: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 1r37n4-0007Y9-4N; Wed, 15 Nov 2023 04:46:14 +0000
Received: by outflank-mailman (input) for mailman id 633475;
 Wed, 15 Nov 2023 04:46:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37n3-0007Y0-3d
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:46:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37n3-0006z6-2z
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:46:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37n3-0007Av-24
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:46:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Gp1XSO8iJ+8H0o40qJZi7jhZfFmpXU5GoG+P4gTWwhM=; b=sWokZLFYRPBqZYW7XWhMbDruZ+
	Lmj04AIox7teqYhbup5rTDG+EOEkTg0l7stKbuF23myxW5rdJIMlIm3EhzZKf0I5XqmmgVkYILYbA
	yTNs2mDMikFBkD/ZhjUaU0dVI4jmEzSK6F+5BBVfsqK0sj7viRrVxFJyV2yih+OLzcXs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] docs: Fix IOMMU command line docs some more
Message-Id: <E1r37n3-0007Av-24@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 04:46:13 +0000

commit 011d20a69cf453c968d9f7d9b326bc4ae0870e9d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 14 13:59:40 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 14 13:59:40 2023 +0100

    docs: Fix IOMMU command line docs some more
    
    Make the command line docs match the actual implementation, and state that the
    default behaviour is selected at compile time.
    
    Fixes: 980d6acf1517 ("IOMMU: make DMA containment of quarantined devices optional")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 850382254b78e07e7ccbf80010c3b43897a158f9
    master date: 2023-10-31 15:48:07 +0000
---
 docs/misc/xen-command-line.pandoc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 5ad24a70a9..038ac7398c 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1444,7 +1444,8 @@ detection of systems known to misbehave upon accesses to that port.
 > Default: `new` unless directed-EOI is supported
 
 ### iommu
-    = List of [ <bool>, verbose, debug, force, required, quarantine[=scratch-page],
+    = List of [ <bool>, verbose, debug, force, required,
+                quarantine=<bool>|scratch-page,
                 sharept, superpages, intremap, intpost, crash-disable,
                 snoop, qinval, igfx, amd-iommu-perdev-intremap,
                 dom0-{passthrough,strict} ]
@@ -1483,7 +1484,8 @@ boolean (e.g. `iommu=no`) can override this and leave the IOMMUs disabled.
     successfully.
 
 *   The `quarantine` option can be used to control Xen's behavior when
-    de-assigning devices from guests.
+    de-assigning devices from guests.  The default behaviour is chosen at
+    compile time, and is one of `CONFIG_IOMMU_QUARANTINE_{NONE,BASIC,SCRATCH_PAGE}`.
 
     When a PCI device is assigned to an untrusted domain, it is possible
     for that domain to program the device to DMA to an arbitrary address.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 04:46:24 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 04:46:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633476.988262 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37nE-0007aS-8J; Wed, 15 Nov 2023 04:46:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633476.988262; Wed, 15 Nov 2023 04:46: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 1r37nE-0007aK-5n; Wed, 15 Nov 2023 04:46:24 +0000
Received: by outflank-mailman (input) for mailman id 633476;
 Wed, 15 Nov 2023 04:46:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37nD-0007a8-6f
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:46:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37nD-0006zE-5r
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:46:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37nD-0007BP-5A
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:46:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hy0PrGFpFFIMUXVDEHpKZyZfdtAO92+8CnMishVqLBY=; b=ewIkR5qPX0/jmPLad/VjX7Lh7E
	9V21u2hGNbswp+NCBFt3PuRizoz3TiBEuTMFeA4KBDqi9rrH38GPZs0UqJJFnil6gr+F7/wV9lLwN
	LKjYgfbbpy4Bm3Z/ODI/iFUVxIFi0qYKm8eoscvBOs4eyUb1tS7ccWLFo5uxeWZy7Akg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/mem_sharing: add missing m2p entry when mapping shared_info page
Message-Id: <E1r37nD-0007BP-5A@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 04:46:23 +0000

commit 4bd2c8c8b9dc1ce823a93d48e431deeb38fa1c50
Author:     Tamas K Lengyel <tamas@tklengyel.com>
AuthorDate: Tue Nov 14 14:00:20 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 14 14:00:20 2023 +0100

    x86/mem_sharing: add missing m2p entry when mapping shared_info page
    
    When mapping in the shared_info page to a fork the m2p entry wasn't set
    resulting in the shared_info being reset even when the fork reset was called
    with only reset_state and not reset_memory. This results in an extra
    unnecessary TLB flush.
    
    Fixes: 1a0000ac775 ("mem_sharing: map shared_info page to same gfn during fork")
    Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 23eb39acf011ef9bbe02ed4619c55f208fbcd39b
    master date: 2023-10-31 16:10:14 +0000
---
 xen/arch/x86/mm/mem_sharing.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 5b3449db7a..90ffb10401 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1860,6 +1860,8 @@ static int copy_special_pages(struct domain *cd, struct domain *d)
                                 p2m_ram_rw, p2m->default_access, -1);
             if ( rc )
                 return rc;
+
+            set_gpfn_from_mfn(mfn_x(new_mfn), gfn_x(old_gfn));
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 04:46:35 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 04:46:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633477.988267 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37nP-0007cs-A2; Wed, 15 Nov 2023 04:46:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633477.988267; Wed, 15 Nov 2023 04:46:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37nP-0007ck-7L; Wed, 15 Nov 2023 04:46:35 +0000
Received: by outflank-mailman (input) for mailman id 633477;
 Wed, 15 Nov 2023 04:46:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37nN-0007cY-9h
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:46:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37nN-00070p-8t
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:46:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37nN-0007C4-7t
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:46:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QK4BxMe/bYnRD8+M/kX9kftC8Nivp9mMMxJ7bml0Bu4=; b=p14jF6LYbPHQucYJJVf9kRqf5n
	Z/jdQHF/SvwZFp9sArYjgFVACyTAeTa1j1QonwWHadvusi9uAd4FH2SDzP1X4B9y5dx1IwfFRNkzv
	xEvRxOFym3/6UlzX/5QZWDNf11cQ0zjc5/xXctZxja+T4R7AUGduKeXTYaUIRalvrJC8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/pv-shim: fix grant table operations for 32-bit guests
Message-Id: <E1r37nN-0007C4-7t@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 04:46:33 +0000

commit 267ac3c5921e8c34b4ad401ff9c351c7b533f7af
Author:     David Woodhouse <dwmw@amazon.co.uk>
AuthorDate: Tue Nov 14 14:00:37 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 14 14:00:37 2023 +0100

    x86/pv-shim: fix grant table operations for 32-bit guests
    
    When switching to call the shim functions from the normal handlers, the
    compat_grant_table_op() function was omitted, leaving it calling the
    real grant table operations in !PV_SHIM_EXCLUSIVE builds. This leaves a
    32-bit shim guest failing to set up its real grant table with the parent
    hypervisor.
    
    Fixes: e7db635f4428 ("x86/pv-shim: Don't modify the hypercall table")
    Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 93ec30bc545f15760039c23ee4b97b80c0b3b3b3
    master date: 2023-10-31 16:10:14 +0000
---
 xen/common/compat/grant_table.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/common/compat/grant_table.c b/xen/common/compat/grant_table.c
index 4705ee5f76..2e159d6666 100644
--- a/xen/common/compat/grant_table.c
+++ b/xen/common/compat/grant_table.c
@@ -63,6 +63,11 @@ int compat_grant_table_op(
     unsigned int i, cmd_op;
     XEN_GUEST_HANDLE_PARAM(void) cnt_uop;
 
+#ifdef CONFIG_PV_SHIM
+    if ( unlikely(pv_shim) )
+        return pv_shim_grant_table_op(cmd, uop, count);
+#endif
+
     set_xen_guest_handle(cnt_uop, NULL);
     cmd_op = cmd & GNTTABOP_CMD_MASK;
     if ( cmd_op != GNTTABOP_cache_flush )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 04:46:45 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 04:46:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633478.988270 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37nZ-0007h4-BN; Wed, 15 Nov 2023 04:46:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633478.988270; Wed, 15 Nov 2023 04:46:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37nZ-0007gw-8o; Wed, 15 Nov 2023 04:46:45 +0000
Received: by outflank-mailman (input) for mailman id 633478;
 Wed, 15 Nov 2023 04:46:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37nX-0007gl-Ca
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:46:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37nX-00070w-Bt
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:46:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37nX-0007Cb-Ax
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:46:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HleDDxuzuQ2HGQ9LWsPCcA70uj+3uMabaQcIVNKGenQ=; b=LJULxcgjFBjn6Dae11HKrT3Wky
	lvYgpSKgb11zbbzwOHQmWwaFukUkScaH82NLMmfp5WZ8BtliT4bDsPHxEYurmoa6RN6Z3QyFKxG/M
	ifw2YvWv5pPS3oD6/UPC0c9z4KTLqON+CUnth+nZk0Rl+NtIR1Ofmk2kkRmiyoRKTmlA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/x2apic: remove usage of ACPI_FADT_APIC_CLUSTER
Message-Id: <E1r37nX-0007Cb-Ax@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 04:46:43 +0000

commit d10db37b785ae61e2e2c0326b12823e66afb40fc
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Nov 14 14:01:07 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 14 14:01:07 2023 +0100

    x86/x2apic: remove usage of ACPI_FADT_APIC_CLUSTER
    
    The ACPI FADT APIC_CLUSTER flag mandates that when the interrupt delivery is
    Logical mode APIC must be configured for Cluster destination model.  However in
    apic_x2apic_probe() such flag is incorrectly used to gate whether Physical mode
    can be used.
    
    Since Xen when in x2APIC mode only uses Logical mode together with Cluster
    model completely remove checking for ACPI_FADT_APIC_CLUSTER, as Xen always
    fulfills the requirement signaled by the flag.
    
    Fixes: eb40ae41b658 ('x86/Kconfig: add option for default x2APIC destination mode')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 26a449ce32cef33f2cb50602be19fcc0c4223ba9
    master date: 2023-11-02 10:50:26 +0100
---
 xen/arch/x86/genapic/x2apic.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c
index d512c50fc5..15a62f874b 100644
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -242,8 +242,7 @@ const struct genapic *__init apic_x2apic_probe(void)
          */
         x2apic_phys = iommu_intremap != iommu_intremap_full ||
                       (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL) ||
-                      (IS_ENABLED(CONFIG_X2APIC_PHYSICAL) &&
-                       !(acpi_gbl_FADT.flags & ACPI_FADT_APIC_CLUSTER));
+                      IS_ENABLED(CONFIG_X2APIC_PHYSICAL);
     }
     else if ( !x2apic_phys )
         switch ( iommu_intremap )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 04:46:55 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 04:46:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633479.988275 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37nj-0007k5-Cv; Wed, 15 Nov 2023 04:46:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633479.988275; Wed, 15 Nov 2023 04:46: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 1r37nj-0007jx-AE; Wed, 15 Nov 2023 04:46:55 +0000
Received: by outflank-mailman (input) for mailman id 633479;
 Wed, 15 Nov 2023 04:46:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37nh-0007jk-Ff
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:46:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37nh-000716-Et
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:46:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37nh-0007D3-E0
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:46:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FOc6IOQSdsqaK1+pYBOprdBtBxAImOpZrrWZqHC/9Z8=; b=MHGr9RFhgpMm+5UYdYLeLCn/18
	ooKCvZwxr+ClaCHsOLI+/bVNJfxKQo34UxdCCyfLuzJA4b3rMJkqvnT8Rjk4pUFIjG+k/irY5Rqck
	y07+YzbjEN3SN32QbzdA7FOZpLWSzSizhSyZlifSQASBtfgGUz0eQ+1+Dx41yHeMFGhY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/i8259: do not assume interrupts always target CPU0
Message-Id: <E1r37nh-0007D3-E0@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 04:46:53 +0000

commit c635c17fdec6e1c00b24feb2742220e9f8438da7
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Nov 14 14:01:33 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 14 14:01:33 2023 +0100

    x86/i8259: do not assume interrupts always target CPU0
    
    Sporadically we have seen the following during AP bringup on AMD platforms
    only:
    
    microcode: CPU59 updated from revision 0x830107a to 0x830107a, date = 2023-05-17
    microcode: CPU60 updated from revision 0x830104d to 0x830107a, date = 2023-05-17
    CPU60: No irq handler for vector 27 (IRQ -2147483648)
    microcode: CPU61 updated from revision 0x830107a to 0x830107a, date = 2023-05-17
    
    This is similar to the issue raised on Linux commit 36e9e1eab777e, where they
    observed i8259 (active) vectors getting delivered to CPUs different than 0.
    
    On AMD or Hygon platforms adjust the target CPU mask of i8259 interrupt
    descriptors to contain all possible CPUs, so that APs will reserve the vector
    at startup if any legacy IRQ is still delivered through the i8259.  Note that
    if the IO-APIC takes over those interrupt descriptors the CPU mask will be
    reset.
    
    Spurious i8259 interrupt vectors however (IRQ7 and IRQ15) can be injected even
    when all i8259 pins are masked, and hence would need to be handled on all CPUs.
    
    Continue to reserve PIC vectors on CPU0 only, but do check for such spurious
    interrupts on all CPUs if the vendor is AMD or Hygon.  Note that once the
    vectors get used by devices detecting PIC spurious interrupts will no longer be
    possible, however the device driver should be able to cope with spurious
    interrupts.  Such PIC spurious interrupts occurring when the vector is in use
    by a local APIC routed source will lead to an extra EOI, which might
    unintentionally clear a different vector from ISR.  Note this is already the
    current behavior, so assume it's infrequent enough to not cause real issues.
    
    Finally, adjust the printed message to display the CPU where the spurious
    interrupt has been received, so it looks like:
    
    microcode: CPU1 updated from revision 0x830107a to 0x830107a, date = 2023-05-17
    cpu1: spurious 8259A interrupt: IRQ7
    microcode: CPU2 updated from revision 0x830104d to 0x830107a, date = 2023-05-17
    
    Amends: 3fba06ba9f8b ('x86/IRQ: re-use legacy vector ranges on APs')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 87f37449d586b4d407b75235bb0a171e018e25ec
    master date: 2023-11-02 10:50:59 +0100
---
 xen/arch/x86/i8259.c | 21 +++++++++++++++++++--
 xen/arch/x86/irq.c   | 11 ++++++++++-
 2 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/i8259.c b/xen/arch/x86/i8259.c
index ed9f55abe5..e0fa1f96b4 100644
--- a/xen/arch/x86/i8259.c
+++ b/xen/arch/x86/i8259.c
@@ -222,7 +222,8 @@ static bool _mask_and_ack_8259A_irq(unsigned int irq)
         is_real_irq = false;
         /* Report spurious IRQ, once per IRQ line. */
         if (!(spurious_irq_mask & irqmask)) {
-            printk("spurious 8259A interrupt: IRQ%d.\n", irq);
+            printk("cpu%u: spurious 8259A interrupt: IRQ%u\n",
+                   smp_processor_id(), irq);
             spurious_irq_mask |= irqmask;
         }
         /*
@@ -349,7 +350,23 @@ void __init init_IRQ(void)
             continue;
         desc->handler = &i8259A_irq_type;
         per_cpu(vector_irq, cpu)[LEGACY_VECTOR(irq)] = irq;
-        cpumask_copy(desc->arch.cpu_mask, cpumask_of(cpu));
+
+        /*
+         * The interrupt affinity logic never targets interrupts to offline
+         * CPUs, hence it's safe to use cpumask_all here.
+         *
+         * Legacy PIC interrupts are only targeted to CPU0, but depending on
+         * the platform they can be distributed to any online CPU in hardware.
+         * Note this behavior has only been observed on AMD hardware. In order
+         * to cope install all active legacy vectors on all CPUs.
+         *
+         * IO-APIC will change the destination mask if/when taking ownership of
+         * the interrupt.
+         */
+        cpumask_copy(desc->arch.cpu_mask,
+                     (boot_cpu_data.x86_vendor &
+                      (X86_VENDOR_AMD | X86_VENDOR_HYGON) ? &cpumask_all
+                                                          : cpumask_of(cpu)));
         desc->arch.vector = LEGACY_VECTOR(irq);
     }
     
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 20150b1c7f..51b4837cd3 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1920,7 +1920,16 @@ void do_IRQ(struct cpu_user_regs *regs)
                 kind = "";
             if ( !(vector >= FIRST_LEGACY_VECTOR &&
                    vector <= LAST_LEGACY_VECTOR &&
-                   !smp_processor_id() &&
+                   (!smp_processor_id() ||
+                    /*
+                     * For AMD/Hygon do spurious PIC interrupt
+                     * detection on all CPUs, as it has been observed
+                     * that during unknown circumstances spurious PIC
+                     * interrupts have been delivered to CPUs
+                     * different than the BSP.
+                     */
+                    (boot_cpu_data.x86_vendor & (X86_VENDOR_AMD |
+                                                 X86_VENDOR_HYGON))) &&
                    bogus_8259A_irq(vector - FIRST_LEGACY_VECTOR)) )
             {
                 printk("CPU%u: No irq handler for vector %02x (IRQ %d%s)\n",
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 04:47:05 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 04:47:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633480.988280 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r37nt-0007mQ-F8; Wed, 15 Nov 2023 04:47:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633480.988280; Wed, 15 Nov 2023 04:47: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 1r37nt-0007mI-Bi; Wed, 15 Nov 2023 04:47:05 +0000
Received: by outflank-mailman (input) for mailman id 633480;
 Wed, 15 Nov 2023 04:47: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 1r37nr-0007m5-IW
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:47: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 1r37nr-00071T-Hi
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:47:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r37nr-0007Df-H1
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 04:47:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=O0V9/oD8XqhkUt8xZVblBcS6YtWbNStt1esQ5+UxBFo=; b=6HOKgqTDoMpagv7IvC02KrlgZ+
	61tcuHmLvU+ebu3yAK0kF74hUBMzgeVcDLsNm74keX9OTw6crfyRaKxt0sbwkB37tS/S57u422WW/
	Rrg7AbsyYKX9kVyE1E4/WeP2aEgsJhlo+s4neb6dJH8tf8/NWTdoYoLCcuzbP6yIp4uc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/spec-ctrl: Add SRSO whitepaper URL
Message-Id: <E1r37nr-0007Df-H1@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 04:47:03 +0000

commit 0527bab0901b800e3f1be2e7836c5346b6e08809
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 14 14:01:59 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 14 14:01:59 2023 +0100

    x86/spec-ctrl: Add SRSO whitepaper URL
    
    ... now that it exists in public.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 78a86b26868c12ae1cc3dd2a8bb9aa5eebaa41fd
    master date: 2023-11-07 17:47:34 +0000
---
 xen/arch/x86/spec_ctrl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
index 0ff3c895ac..56e07d7536 100644
--- a/xen/arch/x86/spec_ctrl.c
+++ b/xen/arch/x86/spec_ctrl.c
@@ -915,6 +915,9 @@ static bool __init should_use_eager_fpu(void)
     }
 }
 
+/*
+ * https://www.amd.com/content/dam/amd/en/documents/corporate/cr/speculative-return-stack-overflow-whitepaper.pdf
+ */
 static void __init srso_calculations(bool hw_smt_enabled)
 {
     if ( !(boot_cpu_data.x86_vendor &
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 09:22:07 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 09:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633530.988392 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3C5z-0001Wg-JI; Wed, 15 Nov 2023 09:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633530.988392; Wed, 15 Nov 2023 09: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 1r3C5z-0001WY-FX; Wed, 15 Nov 2023 09:22:03 +0000
Received: by outflank-mailman (input) for mailman id 633530;
 Wed, 15 Nov 2023 09: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 1r3C5x-0001WS-H0
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 09: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 1r3C5x-00053g-GF
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 09:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3C5x-0002yl-F5
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 09: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=BFiudIs2UGrShNBrXhyWTqz2MkXPyv+44O6Q+K1aT+0=; b=jJAlQR7m8UKri6AAHvZAxQMKrQ
	B83NOjAUPH1r6bOiOEnsorxTd1biOXY87W36IllrmuYs7mX5d/Wr+Qj3EuC1QeJQzQuq44tsOESzu
	HN6expFvYFU2O1tITBYrqlGQonfeje5CrELAc30ENBoaRRDAGlliUWZmhXVUfZfpoLyE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] iommu/amd-vi: use correct level for quarantine domain page tables
Message-Id: <E1r3C5x-0002yl-F5@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 09:22:01 +0000

commit 2d977ef880d709e868f36b9088d556d503b6e461
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Oct 11 13:14:21 2023 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 14 12:29:59 2023 +0000

    iommu/amd-vi: use correct level for quarantine domain page tables
    
    The current setup of the quarantine page tables assumes that the quarantine
    domain (dom_io) has been initialized with an address width of
    DEFAULT_DOMAIN_ADDRESS_WIDTH (48).
    
    However dom_io being a PV domain gets the AMD-Vi IOMMU page tables levels based
    on the maximum (hot pluggable) RAM address, and hence on systems with no RAM
    above the 512GB mark only 3 page-table levels are configured in the IOMMU.
    
    On systems without RAM above the 512GB boundary amd_iommu_quarantine_init()
    will setup page tables for the scratch page with 4 levels, while the IOMMU will
    be configured to use 3 levels only.  The page destined to be used as level 1,
    and to contain a directory of PTEs ends up being the address in a PTE itself,
    and thus level 1 page becomes the leaf page.  Without the level mismatch it's
    level 0 page that should be the leaf page instead.
    
    The level 1 page won't be used as such, and hence it's not possible to use it
    to gain access to other memory on the system.  However that page is not cleared
    in amd_iommu_quarantine_init() as part of re-initialization of the device
    quarantine page tables, and hence data on the level 1 page can be leaked
    between device usages.
    
    Fix this by making sure the paging levels setup by amd_iommu_quarantine_init()
    match the number configured on the IOMMUs.
    
    Note that IVMD regions are not affected by this issue, as those areas are
    mapped taking the configured paging levels into account.
    
    This is XSA-445 / CVE-2023-46835
    
    Fixes: ea38867831da ('x86 / iommu: set up a scratch page in the quarantine domain')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit fe1e4668b373ec4c1e5602e75905a9fa8cc2be3f)
---
 xen/drivers/passthrough/amd/iommu_map.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index daa24a4858..e0f4fe736a 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -837,9 +837,7 @@ static int fill_qpt(union amd_iommu_pte *this, unsigned int level,
 int cf_check amd_iommu_quarantine_init(struct pci_dev *pdev, bool scratch_page)
 {
     struct domain_iommu *hd = dom_iommu(dom_io);
-    unsigned long end_gfn =
-        1UL << (DEFAULT_DOMAIN_ADDRESS_WIDTH - PAGE_SHIFT);
-    unsigned int level = amd_iommu_get_paging_mode(end_gfn);
+    unsigned int level = hd->arch.amd.paging_mode;
     unsigned int req_id = get_dma_requestor_id(pdev->seg, pdev->sbdf.bdf);
     const struct ivrs_mappings *ivrs_mappings = get_ivrs_mappings(pdev->seg);
     int rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 09:22:12 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 09:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633531.988397 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3C68-0001ZQ-Mz; Wed, 15 Nov 2023 09:22:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633531.988397; Wed, 15 Nov 2023 09:22:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3C68-0001ZJ-KN; Wed, 15 Nov 2023 09:22:12 +0000
Received: by outflank-mailman (input) for mailman id 633531;
 Wed, 15 Nov 2023 09:22:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3C67-0001Yr-LD
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 09:22:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3C67-00053u-JY
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 09:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3C67-0002zA-IT
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 09:22:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mzZ+kmJeiEJxH5j3tEuA8m6oHZDYdPwg90On58iY0hY=; b=d63rZEtTC0cj8E60NsbVVT4V3V
	YelB7s8FCZqCjszD/5x4LEi7aCZLwuec4ECkcL175jx6XDaiupX6hr4A1a2mnWu4O9Jcvrau6Tv74
	hyVFY0sib6KnxkEeaGdificAhg2XpgDrEmCbOD3/Ztee34UqKmk7+EZ/oENTo5BUk8ZE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/spec-ctrl: Remove conditional IRQs-on-ness for INT $0x80/0x82 paths
Message-Id: <E1r3C67-0002zA-IT@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 09:22:11 +0000

commit 2185851bbf72123ea76c9ce26e0c3a4d1a0ab8b0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 26 14:37:38 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 14 12:29:59 2023 +0000

    x86/spec-ctrl: Remove conditional IRQs-on-ness for INT $0x80/0x82 paths
    
    Before speculation defences, some paths in Xen could genuinely get away with
    being IRQs-on at entry.  But XPTI invalidated this property on most paths, and
    attempting to maintain it on the remaining paths was a mistake.
    
    Fast forward, and DO_SPEC_CTRL_COND_IBPB (protection for AMD BTC/SRSO) is not
    IRQ-safe, running with IRQs enabled in some cases.  The other actions taken on
    these paths happen to be IRQ-safe.
    
    Make entry_int82() and int80_direct_trap() unconditionally Interrupt Gates
    rather than Trap Gates.  Remove the conditional re-adjustment of
    int80_direct_trap() in smp_prepare_cpus(), and have entry_int82() explicitly
    enable interrupts when safe to do so.
    
    In smp_prepare_cpus(), with the conditional re-adjustment removed, the
    clearing of pv_cr3 is the only remaining action gated on XPTI, and it is out
    of place anyway, repeating work already done by smp_prepare_boot_cpu().  Drop
    the entire if() condition to avoid leaving an incorrect vestigial remnant.
    
    Also drop comments which make incorrect statements about when its safe to
    enable interrupts.
    
    This is XSA-446 / CVE-2023-46836
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit a48bb129f1b9ff55c22cf6d2b589247c8ba3b10e)
---
 xen/arch/x86/pv/traps.c            |  4 ++--
 xen/arch/x86/smpboot.c             | 14 --------------
 xen/arch/x86/x86_64/compat/entry.S |  2 ++
 xen/arch/x86/x86_64/entry.S        |  1 -
 4 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/pv/traps.c b/xen/arch/x86/pv/traps.c
index 74f333da7e..240d1a2db7 100644
--- a/xen/arch/x86/pv/traps.c
+++ b/xen/arch/x86/pv/traps.c
@@ -139,11 +139,11 @@ void __init pv_trap_init(void)
 #ifdef CONFIG_PV32
     /* The 32-on-64 hypercall vector is only accessible from ring 1. */
     _set_gate(idt_table + HYPERCALL_VECTOR,
-              SYS_DESC_trap_gate, 1, entry_int82);
+              SYS_DESC_irq_gate, 1, entry_int82);
 #endif
 
     /* Fast trap for int80 (faster than taking the #GP-fixup path). */
-    _set_gate(idt_table + LEGACY_SYSCALL_VECTOR, SYS_DESC_trap_gate, 3,
+    _set_gate(idt_table + LEGACY_SYSCALL_VECTOR, SYS_DESC_irq_gate, 3,
               &int80_direct_trap);
 
     open_softirq(NMI_SOFTIRQ, nmi_softirq);
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 3a1a659082..4c54ecbc91 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -1158,20 +1158,6 @@ void __init smp_prepare_cpus(void)
 
     stack_base[0] = (void *)((unsigned long)stack_start & ~(STACK_SIZE - 1));
 
-    if ( opt_xpti_hwdom || opt_xpti_domu )
-    {
-        get_cpu_info()->pv_cr3 = 0;
-
-#ifdef CONFIG_PV
-        /*
-         * All entry points which may need to switch page tables have to start
-         * with interrupts off. Re-write what pv_trap_init() has put there.
-         */
-        _set_gate(idt_table + LEGACY_SYSCALL_VECTOR, SYS_DESC_irq_gate, 3,
-                  &int80_direct_trap);
-#endif
-    }
-
     set_nr_sockets();
 
     socket_cpumask = xzalloc_array(cpumask_t *, nr_sockets);
diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index bd5abd8040..fcc3a721f1 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -21,6 +21,8 @@ ENTRY(entry_int82)
         SPEC_CTRL_ENTRY_FROM_PV /* Req: %rsp=regs/cpuinfo, %rdx=0, Clob: acd */
         /* WARNING! `ret`, `call *`, `jmp *` not safe before this point. */
 
+        sti
+
         CR4_PV32_RESTORE
 
         GET_CURRENT(bx)
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 5ca74f5f62..9a7b129aa7 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -327,7 +327,6 @@ ENTRY(sysenter_entry)
 #ifdef CONFIG_XEN_SHSTK
         ALTERNATIVE "", "setssbsy", X86_FEATURE_XEN_SHSTK
 #endif
-        /* sti could live here when we don't switch page tables below. */
         pushq $FLAT_USER_SS
         pushq $0
         pushfq
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 13:44:06 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 13:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633676.988716 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3GBY-0003VA-DK; Wed, 15 Nov 2023 13:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633676.988716; Wed, 15 Nov 2023 13: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 1r3GBY-0003V1-AN; Wed, 15 Nov 2023 13:44:04 +0000
Received: by outflank-mailman (input) for mailman id 633676;
 Wed, 15 Nov 2023 13: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 1r3GBW-0003Uv-8u
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 13: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 1r3GBW-0001Xm-5F
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 13:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3GBW-0006a6-2m
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 13: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=q2V3TMp/hhVSmYbHTNRp9k0pJIVoEQKw13Hq0C0PgYE=; b=6bL6BBgUKj0OLKeFxuQ1sZ4DY4
	NjdCRpdQ+ESojHOTdavVWawvE5d8hlcQ/v2/QP51WczwM2xrg9ebuVs1S8ktAcv43CUd7UjTZe4iV
	1/269w6vSY1ktkMbjvwCQT3oT3XmhXcwsxf1xEER9SEZfQ4m3MvMAHImayHQkpsdkIR0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] iommu/amd-vi: use correct level for quarantine domain page tables
Message-Id: <E1r3GBW-0006a6-2m@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 13:44:02 +0000

commit fe1e4668b373ec4c1e5602e75905a9fa8cc2be3f
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Oct 11 13:14:21 2023 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 14 12:30:00 2023 +0000

    iommu/amd-vi: use correct level for quarantine domain page tables
    
    The current setup of the quarantine page tables assumes that the quarantine
    domain (dom_io) has been initialized with an address width of
    DEFAULT_DOMAIN_ADDRESS_WIDTH (48).
    
    However dom_io being a PV domain gets the AMD-Vi IOMMU page tables levels based
    on the maximum (hot pluggable) RAM address, and hence on systems with no RAM
    above the 512GB mark only 3 page-table levels are configured in the IOMMU.
    
    On systems without RAM above the 512GB boundary amd_iommu_quarantine_init()
    will setup page tables for the scratch page with 4 levels, while the IOMMU will
    be configured to use 3 levels only.  The page destined to be used as level 1,
    and to contain a directory of PTEs ends up being the address in a PTE itself,
    and thus level 1 page becomes the leaf page.  Without the level mismatch it's
    level 0 page that should be the leaf page instead.
    
    The level 1 page won't be used as such, and hence it's not possible to use it
    to gain access to other memory on the system.  However that page is not cleared
    in amd_iommu_quarantine_init() as part of re-initialization of the device
    quarantine page tables, and hence data on the level 1 page can be leaked
    between device usages.
    
    Fix this by making sure the paging levels setup by amd_iommu_quarantine_init()
    match the number configured on the IOMMUs.
    
    Note that IVMD regions are not affected by this issue, as those areas are
    mapped taking the configured paging levels into account.
    
    This is XSA-445 / CVE-2023-46835
    
    Fixes: ea38867831da ('x86 / iommu: set up a scratch page in the quarantine domain')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/amd/iommu_map.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index daa24a4858..e0f4fe736a 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -837,9 +837,7 @@ static int fill_qpt(union amd_iommu_pte *this, unsigned int level,
 int cf_check amd_iommu_quarantine_init(struct pci_dev *pdev, bool scratch_page)
 {
     struct domain_iommu *hd = dom_iommu(dom_io);
-    unsigned long end_gfn =
-        1UL << (DEFAULT_DOMAIN_ADDRESS_WIDTH - PAGE_SHIFT);
-    unsigned int level = amd_iommu_get_paging_mode(end_gfn);
+    unsigned int level = hd->arch.amd.paging_mode;
     unsigned int req_id = get_dma_requestor_id(pdev->seg, pdev->sbdf.bdf);
     const struct ivrs_mappings *ivrs_mappings = get_ivrs_mappings(pdev->seg);
     int rc;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 13:44:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 13:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633677.988720 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3GBi-0003dr-EO; Wed, 15 Nov 2023 13:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633677.988720; Wed, 15 Nov 2023 13: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 1r3GBi-0003dk-Bl; Wed, 15 Nov 2023 13:44:14 +0000
Received: by outflank-mailman (input) for mailman id 633677;
 Wed, 15 Nov 2023 13: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 1r3GBg-0003dU-Az
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 13: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 1r3GBg-0001Xu-8O
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 13:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3GBg-0006bC-7R
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 13: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=TrqsqV5J7oSEh7K1xrlwgntZUSQl0SpWeyseS6OGysg=; b=GkKJj9VxWPZ9RnxXLYPvQmeHQp
	mWNEv6B/RLi8V5O0WV4AP7GS/3ktsGNJMEwO+HtjXPv7SLFCg2/J8TkqjJy8TUndIL2upAMRGnAr5
	ieFfG8kYlF/zi/uwzneZXNX9pmh6G/XB7xkBrQ8u5ckCzk1fVzwDJqV8bJrLKuLPN4sA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/spec-ctrl: Remove conditional IRQs-on-ness for INT $0x80/0x82 paths
Message-Id: <E1r3GBg-0006bC-7R@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 13:44:12 +0000

commit a48bb129f1b9ff55c22cf6d2b589247c8ba3b10e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 26 14:37:38 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 14 12:30:00 2023 +0000

    x86/spec-ctrl: Remove conditional IRQs-on-ness for INT $0x80/0x82 paths
    
    Before speculation defences, some paths in Xen could genuinely get away with
    being IRQs-on at entry.  But XPTI invalidated this property on most paths, and
    attempting to maintain it on the remaining paths was a mistake.
    
    Fast forward, and DO_SPEC_CTRL_COND_IBPB (protection for AMD BTC/SRSO) is not
    IRQ-safe, running with IRQs enabled in some cases.  The other actions taken on
    these paths happen to be IRQ-safe.
    
    Make entry_int82() and int80_direct_trap() unconditionally Interrupt Gates
    rather than Trap Gates.  Remove the conditional re-adjustment of
    int80_direct_trap() in smp_prepare_cpus(), and have entry_int82() explicitly
    enable interrupts when safe to do so.
    
    In smp_prepare_cpus(), with the conditional re-adjustment removed, the
    clearing of pv_cr3 is the only remaining action gated on XPTI, and it is out
    of place anyway, repeating work already done by smp_prepare_boot_cpu().  Drop
    the entire if() condition to avoid leaving an incorrect vestigial remnant.
    
    Also drop comments which make incorrect statements about when its safe to
    enable interrupts.
    
    This is XSA-446 / CVE-2023-46836
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/pv/traps.c            |  4 ++--
 xen/arch/x86/smpboot.c             | 14 --------------
 xen/arch/x86/x86_64/compat/entry.S |  2 ++
 xen/arch/x86/x86_64/entry.S        |  1 -
 4 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/pv/traps.c b/xen/arch/x86/pv/traps.c
index 74f333da7e..240d1a2db7 100644
--- a/xen/arch/x86/pv/traps.c
+++ b/xen/arch/x86/pv/traps.c
@@ -139,11 +139,11 @@ void __init pv_trap_init(void)
 #ifdef CONFIG_PV32
     /* The 32-on-64 hypercall vector is only accessible from ring 1. */
     _set_gate(idt_table + HYPERCALL_VECTOR,
-              SYS_DESC_trap_gate, 1, entry_int82);
+              SYS_DESC_irq_gate, 1, entry_int82);
 #endif
 
     /* Fast trap for int80 (faster than taking the #GP-fixup path). */
-    _set_gate(idt_table + LEGACY_SYSCALL_VECTOR, SYS_DESC_trap_gate, 3,
+    _set_gate(idt_table + LEGACY_SYSCALL_VECTOR, SYS_DESC_irq_gate, 3,
               &int80_direct_trap);
 
     open_softirq(NMI_SOFTIRQ, nmi_softirq);
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 3a1a659082..4c54ecbc91 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -1158,20 +1158,6 @@ void __init smp_prepare_cpus(void)
 
     stack_base[0] = (void *)((unsigned long)stack_start & ~(STACK_SIZE - 1));
 
-    if ( opt_xpti_hwdom || opt_xpti_domu )
-    {
-        get_cpu_info()->pv_cr3 = 0;
-
-#ifdef CONFIG_PV
-        /*
-         * All entry points which may need to switch page tables have to start
-         * with interrupts off. Re-write what pv_trap_init() has put there.
-         */
-        _set_gate(idt_table + LEGACY_SYSCALL_VECTOR, SYS_DESC_irq_gate, 3,
-                  &int80_direct_trap);
-#endif
-    }
-
     set_nr_sockets();
 
     socket_cpumask = xzalloc_array(cpumask_t *, nr_sockets);
diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index bd5abd8040..fcc3a721f1 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -21,6 +21,8 @@ ENTRY(entry_int82)
         SPEC_CTRL_ENTRY_FROM_PV /* Req: %rsp=regs/cpuinfo, %rdx=0, Clob: acd */
         /* WARNING! `ret`, `call *`, `jmp *` not safe before this point. */
 
+        sti
+
         CR4_PV32_RESTORE
 
         GET_CURRENT(bx)
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 5ca74f5f62..9a7b129aa7 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -327,7 +327,6 @@ ENTRY(sysenter_entry)
 #ifdef CONFIG_XEN_SHSTK
         ALTERNATIVE "", "setssbsy", X86_FEATURE_XEN_SHSTK
 #endif
-        /* sti could live here when we don't switch page tables below. */
         pushq $FLAT_USER_SS
         pushq $0
         pushfq
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 15 20:33:07 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Nov 2023 20:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633856.988984 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3MZL-0005SL-4t; Wed, 15 Nov 2023 20:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633856.988984; Wed, 15 Nov 2023 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 1r3MZL-0005SD-2B; Wed, 15 Nov 2023 20:33:03 +0000
Received: by outflank-mailman (input) for mailman id 633856;
 Wed, 15 Nov 2023 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 1r3MZJ-0005S7-WA
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 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 1r3MZJ-0001rO-UN
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 20:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3MZJ-0004a6-TK
 for xen-changelog@lists.xenproject.org; Wed, 15 Nov 2023 20: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=Rs+PlTrldr52Dz82fgmva3v8cAyNxHP/q9KJXHP7BiQ=; b=MK/OB3ZgRePAj3Mue4YqkcjQsT
	oQTrEvZAa/9Phz7PD9L7xlJ5EjZslAvfXiLZlQiWVK18rhLgi7z7RMF/Z/CDKZ/6q1EDmugAsfPbV
	JxlxKp/jepXuH5fgXv2UMupEPIJYfDFPOL/c18VkNOSGnc9JK2wH5e4KluTf/3i46i94=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] xen/grant: Fix build in PV_SHIM
Message-Id: <E1r3MZJ-0004a6-TK@xenbits.xenproject.org>
Date: Wed, 15 Nov 2023 20:33:01 +0000

commit 28f44b603fd86c233726bdc2a11b6325f102471a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 14 17:20:41 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 14 17:21:51 2023 +0000

    xen/grant: Fix build in PV_SHIM
    
    There was a variable name changed which wasn't accounted for in the backport.
    
    Fixes: 267ac3c5921e ("x86/pv-shim: fix grant table operations for 32-bit guests")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/compat/grant_table.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/compat/grant_table.c b/xen/common/compat/grant_table.c
index 2e159d6666..76b0671fa0 100644
--- a/xen/common/compat/grant_table.c
+++ b/xen/common/compat/grant_table.c
@@ -65,7 +65,7 @@ int compat_grant_table_op(
 
 #ifdef CONFIG_PV_SHIM
     if ( unlikely(pv_shim) )
-        return pv_shim_grant_table_op(cmd, uop, count);
+        return pv_shim_grant_table_op(cmd, cmp_uop, count);
 #endif
 
     set_xen_guest_handle(cnt_uop, NULL);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Thu Nov 16 01:55:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Nov 2023 01:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633962.989104 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3Rax-0008In-2y; Thu, 16 Nov 2023 01:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633962.989104; Thu, 16 Nov 2023 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 1r3Rax-0008If-0P; Thu, 16 Nov 2023 01:55:03 +0000
Received: by outflank-mailman (input) for mailman id 633962;
 Thu, 16 Nov 2023 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 1r3Raw-0008IZ-FP
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 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 1r3Raw-0006ll-Ap
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 01:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3Raw-00014s-8w
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 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=nqmyhPOwEAtNEGMNQflQX8YiWNMfBixtp0rbSSKWbYQ=; b=IBpv+nMrOd0EhP26KzkYkBO16j
	vOGJduVSleP24FE6sz0/J2vQIT4tVjU01wu5RFYxW2PiCieoX58O/ZDUL6tbqjA+FtFnxDyVhAcGW
	laOwmVsQgMw6vP5QYiKLYEGUeXiwVXmH2il1s+eWbpFIVXnlQ8CCk7nOKuMd93FlSD2M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] Config.mk: Bump tags to 4.18.0 final
Message-Id: <E1r3Raw-00014s-8w@xenbits.xenproject.org>
Date: Thu, 16 Nov 2023 01:55:02 +0000

commit cd918e26fc54e65398cc4dbe8fcbe1843f9a65c6
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Wed Nov 15 12:09:51 2023 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Nov 15 12:09:51 2023 +0000

    Config.mk: Bump tags to 4.18.0 final
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
---
 Config.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 5f12c91da0..efa8ee4a0d 100644
--- a/Config.mk
+++ b/Config.mk
@@ -223,10 +223,10 @@ OVMF_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/ovmf.git
 OVMF_UPSTREAM_REVISION ?= ba91d0292e593df8528b66f99c1b0b14fadc8e16
 
 QEMU_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/qemu-xen.git
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.18.0-rc5
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.18.0
 
 MINIOS_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/mini-os.git
-MINIOS_UPSTREAM_REVISION ?= xen-4.18.0-rc5
+MINIOS_UPSTREAM_REVISION ?= xen-4.18.0
 
 SEABIOS_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/seabios.git
 SEABIOS_UPSTREAM_REVISION ?= rel-1.16.2
@@ -235,7 +235,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
 QEMU_TRADITIONAL_URL ?= https://xenbits.xen.org/git-http/qemu-xen-traditional.git
-QEMU_TRADITIONAL_REVISION ?= xen-4.18.0-rc5
+QEMU_TRADITIONAL_REVISION ?= xen-4.18.0
 # Wed Jul 15 10:01:40 2020 +0100
 # qemu-trad: remove Xen path dependencies
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Thu Nov 16 01:55:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Nov 2023 01:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633963.989108 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3Rb7-0008Ka-4S; Thu, 16 Nov 2023 01:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633963.989108; Thu, 16 Nov 2023 01: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 1r3Rb7-0008KS-1p; Thu, 16 Nov 2023 01:55:13 +0000
Received: by outflank-mailman (input) for mailman id 633963;
 Thu, 16 Nov 2023 01: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 1r3Rb6-0008KM-HI
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 01: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 1r3Rb6-0006ly-GU
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 01:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3Rb6-00015J-D0
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 01: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=G4wvCpxQS4CfArqI9ilhiG/I+YUkuOeXpH0UY209Sqw=; b=gAFIaZI/8TR0i4j88r96/l2b8Q
	hsaFdR1VOEAMGJj+HxOwXyPpCDQSVZ/pcq+//kemAk4WFB1uN+cH2l3X00wt1Qm3Lj2eJVcH3rgPL
	rW/7gaIWXtMHofAwV5xXsEmExooFcjZfa08wSsQcc/9Q2b2QOOHw/txZkKK65ndNgcH8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] README: make heading say 4.18
Message-Id: <E1r3Rb6-00015J-D0@xenbits.xenproject.org>
Date: Thu, 16 Nov 2023 01:55:12 +0000

commit a4092dca80828c56d3ca34561ed81471ebb6d120
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Wed Nov 15 12:11:27 2023 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Nov 15 12:11:27 2023 +0000

    README: make heading say 4.18
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
---
 README | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/README b/README
index 855db01d36..1a4de51844 100644
--- a/README
+++ b/README
@@ -1,11 +1,11 @@
-#################################################
+##################################
 __  __            _  _    _  ___
-\ \/ /___ _ __   | || |  / |( _ )       _ __ ___
- \  // _ \ '_ \  | || |_ | |/ _ \ _____| '__/ __|
- /  \  __/ | | | |__   _|| | (_) |_____| | | (__
-/_/\_\___|_| |_|    |_|(_)_|\___/      |_|  \___|
+\ \/ /___ _ __   | || |  / |( _ )
+ \  // _ \ '_ \  | || |_ | |/ _ \
+ /  \  __/ | | | |__   _|| | (_) |
+/_/\_\___|_| |_|    |_|(_)_|\___/
 
-#################################################
+##################################
 
 https://www.xen.org/
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Thu Nov 16 01:55:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Nov 2023 01:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633964.989112 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3RbH-0008My-5v; Thu, 16 Nov 2023 01:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633964.989112; Thu, 16 Nov 2023 01: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 1r3RbH-0008Mr-3G; Thu, 16 Nov 2023 01:55:23 +0000
Received: by outflank-mailman (input) for mailman id 633964;
 Thu, 16 Nov 2023 01: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 1r3RbG-0008Mh-KX
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 01: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 1r3RbG-0006mC-Ji
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 01:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3RbG-00015v-IY
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 01: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=ouDZgIQW724zW28HG25gRbcaWqDVPc7X9/F8ggCl7Qs=; b=4FDGHyjjOcxg2A4ii0UU9PcQCi
	WvnhEQHpZ/DvoOc4/poeQT5uzqrQv71FPARar2ftgB9f+1KHqpqGvi7QrMdj9exKxFJRgp7pkvWuY
	j5nDFKMOTh9/1SJnoLx1fBZEaSSS+a2AXjzTxtiO7O3CKDHUwZTQv7kg01U6X+qgDRK0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] Set 4.18 version
Message-Id: <E1r3RbG-00015v-IY@xenbits.xenproject.org>
Date: Thu, 16 Nov 2023 01:55:22 +0000

commit 4f89d77a241d43ccd0b5a513b7ddce611a231437
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Wed Nov 15 12:12:02 2023 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Nov 15 12:12:02 2023 +0000

    Set 4.18 version
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index fd0e63d29e..b8de14dce1 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -6,7 +6,7 @@ this-makefile := $(call lastword,$(MAKEFILE_LIST))
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 18
-export XEN_EXTRAVERSION ?= -rc$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .0$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Thu Nov 16 01:55:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Nov 2023 01:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.633965.989115 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3RbR-0008Pt-78; Thu, 16 Nov 2023 01:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 633965.989115; Thu, 16 Nov 2023 01: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 1r3RbR-0008Pl-4h; Thu, 16 Nov 2023 01:55:33 +0000
Received: by outflank-mailman (input) for mailman id 633965;
 Thu, 16 Nov 2023 01: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 1r3RbQ-0008Pf-Ns
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 01: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 1r3RbQ-0006mm-N6
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 01:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3RbQ-00016h-Ly
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 01: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=TwtjJ2mEL4hjVCfnlJrruMkmDF6pJJyM2XNVLJFL/n0=; b=w9gX0U9EmryzwKz3l6FoIhxM/N
	PswDvGK5tBW9kP6uT4TQfKXE/Wkh2r0mqjxrmcyFDxCquue1NUIEPKR/jxBTCiSQ2bjjIpQVbMF+X
	osUdOSxnWX6VpjIOAv9NVH0GYxCbIHPyht7zLuHzx5OUWIathWnUx30NgI7TLP/yLW8Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] Config.mk: Fix tag for mini-os
Message-Id: <E1r3RbQ-00016h-Ly@xenbits.xenproject.org>
Date: Thu, 16 Nov 2023 01:55:32 +0000

commit 1924da16239703edc7be6de0f5a549a30aa84b82
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Wed Nov 15 12:23:13 2023 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Nov 15 12:23:13 2023 +0000

    Config.mk: Fix tag for mini-os
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
---
 Config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Config.mk b/Config.mk
index efa8ee4a0d..5cf610c2fd 100644
--- a/Config.mk
+++ b/Config.mk
@@ -226,7 +226,7 @@ QEMU_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/qemu-xen.git
 QEMU_UPSTREAM_REVISION ?= qemu-xen-4.18.0
 
 MINIOS_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/mini-os.git
-MINIOS_UPSTREAM_REVISION ?= xen-4.18.0
+MINIOS_UPSTREAM_REVISION ?= xen-RELEASE-4.18.0
 
 SEABIOS_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/seabios.git
 SEABIOS_UPSTREAM_REVISION ?= rel-1.16.2
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Thu Nov 16 07:33:07 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Nov 2023 07:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.634001.989170 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3Ws3-0003QD-Cy; Thu, 16 Nov 2023 07:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 634001.989170; Thu, 16 Nov 2023 07: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 1r3Ws3-0003Q5-9e; Thu, 16 Nov 2023 07:33:03 +0000
Received: by outflank-mailman (input) for mailman id 634001;
 Thu, 16 Nov 2023 07: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 1r3Ws1-0003Pv-MI
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 07: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 1r3Ws1-0006so-Di
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 07:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3Ws1-00008k-CZ
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 07: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=lflaCFL07/aatV840EISj3ThlDcsI1aSfoWpB/wNFwY=; b=j5O8ekiA4/MrZborKwL4NicF2o
	1OEWSubV703yCA7eQR2XM9DOr3OnnXHON8kKCxl2KvnBkbOcWZ6Jp2WzTgoFNr/+sHyH58e5m9YSf
	7o2X9E2AbPgeyfBYprYmqOmlFNcUt+bBohwvQRlv2qgGTYPLoA3s4YbY54AtF1w7YdJg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/uaccess: address violations of MISRA C:2012 Rule 8.3
Message-Id: <E1r3Ws1-00008k-CZ@xenbits.xenproject.org>
Date: Thu, 16 Nov 2023 07:33:01 +0000

commit 76fa22343890f4183d948b02ae31d3782398223d
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Nov 15 11:40:13 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 15 11:40:13 2023 +0100

    x86/uaccess: address violations of MISRA C:2012 Rule 8.3
    
    Make function declarations and definitions consistent.
    No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/uaccess.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/uaccess.h b/xen/arch/x86/include/asm/uaccess.h
index 684fccd95c..7443519d5b 100644
--- a/xen/arch/x86/include/asm/uaccess.h
+++ b/xen/arch/x86/include/asm/uaccess.h
@@ -10,10 +10,10 @@
 #include <asm/x86_64/uaccess.h>
 
 unsigned int copy_to_guest_pv(void __user *to, const void *from,
-                              unsigned int len);
-unsigned int clear_guest_pv(void __user *to, unsigned int len);
+                              unsigned int n);
+unsigned int clear_guest_pv(void __user *to, unsigned int n);
 unsigned int copy_from_guest_pv(void *to, const void __user *from,
-                                unsigned int len);
+                                unsigned int n);
 
 /* Handles exceptions in both to and from, but doesn't do access_ok */
 unsigned int copy_to_guest_ll(void __user*to, const void *from, unsigned int n);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 16 07:33:12 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Nov 2023 07:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.634002.989173 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3WsC-0003SX-FC; Thu, 16 Nov 2023 07:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 634002.989173; Thu, 16 Nov 2023 07:33:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3WsC-0003SQ-CV; Thu, 16 Nov 2023 07:33:12 +0000
Received: by outflank-mailman (input) for mailman id 634002;
 Thu, 16 Nov 2023 07:33:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3WsB-0003SK-HV
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 07:33:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3WsB-0006sw-Gl
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 07:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3WsB-00009G-Fo
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 07:33:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4RcZy7USDqgKD/VdROf4uWsgWB72ILeMwlMb3G5OChY=; b=O9N6mcxE0+l3uXa8sKl+sfR6hs
	mELpcw5wB4292r+Y0X09mwe9Wi4IQG135vZSJcbP4qows+n4hrzX7GfGmKZgycBhgrxhkblJQkRHy
	iiTfh3Ng6XXuFbjuuX9q7U4Biwhkbhu9Oq/TknwpofNhwFUScbpVqGljphEQTQaqknVI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/xstate: address a violation of MISRA C:2012 Rule 8.3
Message-Id: <E1r3WsB-00009G-Fo@xenbits.xenproject.org>
Date: Thu, 16 Nov 2023 07:33:11 +0000

commit fde774154cf2c4e648043524f4c40b5ee2b97338
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Nov 15 11:40:58 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 15 11:40:58 2023 +0100

    x86/xstate: address a violation of MISRA C:2012 Rule 8.3
    
    Make function declaration and definition consistent.
    No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/xstate.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index f442610fc5..cf94761d05 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -54,16 +54,16 @@ static inline bool xsetbv(u32 index, u64 xfeatures)
     return lo != 0;
 }
 
-bool set_xcr0(u64 val)
+bool set_xcr0(u64 xfeatures)
 {
     uint64_t *this_xcr0 = &this_cpu(xcr0);
 
-    if ( *this_xcr0 != val )
+    if ( *this_xcr0 != xfeatures )
     {
-        if ( !xsetbv(XCR_XFEATURE_ENABLED_MASK, val) )
+        if ( !xsetbv(XCR_XFEATURE_ENABLED_MASK, xfeatures) )
             return false;
 
-        *this_xcr0 = val;
+        *this_xcr0 = xfeatures;
     }
 
     return true;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 16 07:33:22 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Nov 2023 07:33:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.634003.989177 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3WsM-0003VD-H8; Thu, 16 Nov 2023 07:33:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 634003.989177; Thu, 16 Nov 2023 07:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3WsM-0003V6-EE; Thu, 16 Nov 2023 07:33:22 +0000
Received: by outflank-mailman (input) for mailman id 634003;
 Thu, 16 Nov 2023 07:33:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3WsL-0003Ux-Kv
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 07:33:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3WsL-0006t7-Jl
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 07:33:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3WsL-00009i-Ik
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 07:33:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dkjTSr6w3SbQrKXGEPx61f8CNAcURvRGiewKuiUIU08=; b=VlZdEChQjP71BSpcSD83X6STgG
	mbELoKmM5BsWHLDc2cPdUW2xKqOW7dBi8thmy2Z8NsHyrqMlac5Gt8b/9Ye0vecqzwEsONWSg0wvJ
	z/thJQR21L4jG5dyxbMz13RyZZqGvcTLycNVbWeWvOiqEpGh49zfbXPdwck7Ldpo/42s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/psr: address a violation of MISRA C:2012 Rule 8.3
Message-Id: <E1r3WsL-00009i-Ik@xenbits.xenproject.org>
Date: Thu, 16 Nov 2023 07:33:21 +0000

commit 22b773d5c9a7add47f1523d2422beba772ea9843
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Nov 15 11:41:23 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 15 11:41:23 2023 +0100

    x86/psr: address a violation of MISRA C:2012 Rule 8.3
    
    Make function declaration and definition consistent.
    No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/psr.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/psr.h b/xen/arch/x86/include/asm/psr.h
index c2257da7fc..8ecb7a0eea 100644
--- a/xen/arch/x86/include/asm/psr.h
+++ b/xen/arch/x86/include/asm/psr.h
@@ -81,7 +81,7 @@ int psr_get_info(unsigned int socket, enum psr_type type,
 int psr_get_val(struct domain *d, unsigned int socket,
                 uint32_t *val, enum psr_type type);
 int psr_set_val(struct domain *d, unsigned int socket,
-                uint64_t val, enum psr_type type);
+                uint64_t new_val, enum psr_type type);
 
 void psr_domain_init(struct domain *d);
 void psr_domain_free(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 16 07:33:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Nov 2023 07:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.634004.989182 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3WsX-0003Yf-Ip; Thu, 16 Nov 2023 07:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 634004.989182; Thu, 16 Nov 2023 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 1r3WsX-0003YX-Fz; Thu, 16 Nov 2023 07:33:33 +0000
Received: by outflank-mailman (input) for mailman id 634004;
 Thu, 16 Nov 2023 07:33:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3WsV-0003YC-Ox
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 07:33:31 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3WsV-0006tY-O8
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 07:33:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3WsV-0000C4-MS
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 07:33:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3CGAjuTCVePPpKgX5+NVOhMG3H8K3W80FvIRj2TSiP0=; b=aBeQ0g35kaR6UCBun8aXBJCHkB
	YFacqeM5xjXxXVJE5okDXqe3UxhP+GnwgM2GP1mkvz/0zZTJLLXetbHUSE8SF7WdOKPoSWcGG2JXD
	/Ouw8a7Jfmz0Dwbsv/INltRCMZ55o5tb6wObvVguTUukqvCc1elAh3z+3LSmThe9Aqcw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools: Remove all DECLARE_* op macros in xc
Message-Id: <E1r3WsV-0000C4-MS@xenbits.xenproject.org>
Date: Thu, 16 Nov 2023 07:33:31 +0000

commit b24a0f3c5eaadab7c675964dff03d1e4723ee1fe
Author:     Alejandro Vallejo <alejandro.vallejo@cloud.com>
AuthorDate: Wed Nov 15 11:41:50 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 15 11:41:50 2023 +0100

    tools: Remove all DECLARE_* op macros in xc
    
    These macros were hiding that the ops are not zero-initialized by the
    toolstack. This is needlessly opaque for something so simple, so this patch
    removes them and replaces them with explicit zero-initialising versions.
    
    The patch also removes PHYSDEV_OP from there, as that seems to be an old
    dead macro.
    
    Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/ctrl/xc_arinc653.c           |   4 +-
 tools/libs/ctrl/xc_cpu_hotplug.c        |   8 +--
 tools/libs/ctrl/xc_cpupool.c            |  14 ++---
 tools/libs/ctrl/xc_csched.c             |   8 +--
 tools/libs/ctrl/xc_csched2.c            |   8 +--
 tools/libs/ctrl/xc_domain.c             | 108 ++++++++++++++++----------------
 tools/libs/ctrl/xc_flask.c              |  34 +++++-----
 tools/libs/ctrl/xc_memshr.c             |   2 +-
 tools/libs/ctrl/xc_misc.c               |  40 ++++++------
 tools/libs/ctrl/xc_monitor.c            |  30 ++++-----
 tools/libs/ctrl/xc_pm.c                 |  32 +++++-----
 tools/libs/ctrl/xc_private.c            |   4 +-
 tools/libs/ctrl/xc_private.h            |   6 --
 tools/libs/ctrl/xc_psr.c                |  22 +++----
 tools/libs/ctrl/xc_resource.c           |   2 +-
 tools/libs/ctrl/xc_rt.c                 |   8 +--
 tools/libs/ctrl/xc_tbuf.c               |  12 ++--
 tools/libs/ctrl/xc_vm_event.c           |   4 +-
 tools/libs/guest/xg_cpuid_x86.c         |   8 +--
 tools/libs/guest/xg_dom_arm.c           |   2 +-
 tools/libs/guest/xg_dom_boot.c          |   2 +-
 tools/libs/guest/xg_dom_x86.c           |   2 +-
 tools/libs/guest/xg_offline_page.c      |   6 +-
 tools/libs/guest/xg_resume.c            |   6 +-
 tools/libs/guest/xg_sr_restore_x86_pv.c |   6 +-
 25 files changed, 186 insertions(+), 192 deletions(-)

diff --git a/tools/libs/ctrl/xc_arinc653.c b/tools/libs/ctrl/xc_arinc653.c
index 5d61c1ac11..7f1bb723ba 100644
--- a/tools/libs/ctrl/xc_arinc653.c
+++ b/tools/libs/ctrl/xc_arinc653.c
@@ -33,7 +33,7 @@ xc_sched_arinc653_schedule_set(
     struct xen_sysctl_arinc653_schedule *schedule)
 {
     int rc;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_HYPERCALL_BOUNCE(
         schedule,
         sizeof(*schedule),
@@ -63,7 +63,7 @@ xc_sched_arinc653_schedule_get(
     struct xen_sysctl_arinc653_schedule *schedule)
 {
     int rc;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_HYPERCALL_BOUNCE(
         schedule,
         sizeof(*schedule),
diff --git a/tools/libs/ctrl/xc_cpu_hotplug.c b/tools/libs/ctrl/xc_cpu_hotplug.c
index 2ea9825779..136aad2a39 100644
--- a/tools/libs/ctrl/xc_cpu_hotplug.c
+++ b/tools/libs/ctrl/xc_cpu_hotplug.c
@@ -22,7 +22,7 @@
 
 int xc_cpu_online(xc_interface *xch, int cpu)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     int ret;
 
     sysctl.cmd = XEN_SYSCTL_cpu_hotplug;
@@ -35,7 +35,7 @@ int xc_cpu_online(xc_interface *xch, int cpu)
 
 int xc_cpu_offline(xc_interface *xch, int cpu)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     int ret;
 
     sysctl.cmd = XEN_SYSCTL_cpu_hotplug;
@@ -48,7 +48,7 @@ int xc_cpu_offline(xc_interface *xch, int cpu)
 
 int xc_smt_enable(xc_interface *xch)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     int ret;
 
     sysctl.cmd = XEN_SYSCTL_cpu_hotplug;
@@ -61,7 +61,7 @@ int xc_smt_enable(xc_interface *xch)
 
 int xc_smt_disable(xc_interface *xch)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     int ret;
 
     sysctl.cmd = XEN_SYSCTL_cpu_hotplug;
diff --git a/tools/libs/ctrl/xc_cpupool.c b/tools/libs/ctrl/xc_cpupool.c
index fbd8cc9d03..f0ff332e83 100644
--- a/tools/libs/ctrl/xc_cpupool.c
+++ b/tools/libs/ctrl/xc_cpupool.c
@@ -39,7 +39,7 @@ int xc_cpupool_create(xc_interface *xch,
                       uint32_t sched_id)
 {
     int err;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_cpupool_op;
     sysctl.u.cpupool_op.op = XEN_SYSCTL_CPUPOOL_OP_CREATE;
@@ -56,7 +56,7 @@ int xc_cpupool_create(xc_interface *xch,
 int xc_cpupool_destroy(xc_interface *xch,
                        uint32_t poolid)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_cpupool_op;
     sysctl.u.cpupool_op.op = XEN_SYSCTL_CPUPOOL_OP_DESTROY;
@@ -70,7 +70,7 @@ xc_cpupoolinfo_t *xc_cpupool_getinfo(xc_interface *xch,
     int err = 0;
     xc_cpupoolinfo_t *info = NULL;
     int local_size;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_HYPERCALL_BUFFER(uint8_t, local);
 
     local_size = xc_get_cpumap_size(xch);
@@ -129,7 +129,7 @@ int xc_cpupool_addcpu(xc_interface *xch,
                       uint32_t poolid,
                       int cpu)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_cpupool_op;
     sysctl.u.cpupool_op.op = XEN_SYSCTL_CPUPOOL_OP_ADDCPU;
@@ -152,7 +152,7 @@ int xc_cpupool_removecpu(xc_interface *xch,
 {
     unsigned retries;
     int err = 0;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_cpupool_op;
     sysctl.u.cpupool_op.op = XEN_SYSCTL_CPUPOOL_OP_RMCPU;
@@ -170,7 +170,7 @@ int xc_cpupool_movedomain(xc_interface *xch,
                           uint32_t poolid,
                           uint32_t domid)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_cpupool_op;
     sysctl.u.cpupool_op.op = XEN_SYSCTL_CPUPOOL_OP_MOVEDOMAIN;
@@ -184,7 +184,7 @@ xc_cpumap_t xc_cpupool_freeinfo(xc_interface *xch)
     int err = -1;
     xc_cpumap_t cpumap = NULL;
     int mapsize;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_HYPERCALL_BUFFER(uint8_t, local);
 
     mapsize = xc_get_cpumap_size(xch);
diff --git a/tools/libs/ctrl/xc_csched.c b/tools/libs/ctrl/xc_csched.c
index 8e8c67220a..d59b50d4d4 100644
--- a/tools/libs/ctrl/xc_csched.c
+++ b/tools/libs/ctrl/xc_csched.c
@@ -29,7 +29,7 @@ xc_sched_credit_domain_set(
     uint32_t domid,
     struct xen_domctl_sched_credit *sdom)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_scheduler_op;
     domctl.domain = domid;
@@ -49,7 +49,7 @@ xc_sched_credit_domain_get(
     uint32_t domid,
     struct xen_domctl_sched_credit *sdom)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_scheduler_op;
     domctl.domain = domid;
@@ -70,7 +70,7 @@ xc_sched_credit_params_set(
     uint32_t cpupool_id,
     struct xen_sysctl_credit_schedule *schedule)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_scheduler_op;
     sysctl.u.scheduler_op.cpupool_id = cpupool_id;
@@ -93,7 +93,7 @@ xc_sched_credit_params_get(
     uint32_t cpupool_id,
     struct xen_sysctl_credit_schedule *schedule)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_scheduler_op;
     sysctl.u.scheduler_op.cpupool_id = cpupool_id;
diff --git a/tools/libs/ctrl/xc_csched2.c b/tools/libs/ctrl/xc_csched2.c
index 5eb753ad99..c032e3603e 100644
--- a/tools/libs/ctrl/xc_csched2.c
+++ b/tools/libs/ctrl/xc_csched2.c
@@ -29,7 +29,7 @@ xc_sched_credit2_domain_set(
     uint32_t domid,
     struct xen_domctl_sched_credit2 *sdom)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_scheduler_op;
     domctl.domain = domid;
@@ -49,7 +49,7 @@ xc_sched_credit2_domain_get(
     uint32_t domid,
     struct xen_domctl_sched_credit2 *sdom)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_scheduler_op;
     domctl.domain = domid;
@@ -70,7 +70,7 @@ xc_sched_credit2_params_set(
     uint32_t cpupool_id,
     struct xen_sysctl_credit2_schedule *schedule)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_scheduler_op;
     sysctl.u.scheduler_op.cpupool_id = cpupool_id;
@@ -93,7 +93,7 @@ xc_sched_credit2_params_get(
     uint32_t cpupool_id,
     struct xen_sysctl_credit2_schedule *schedule)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_scheduler_op;
     sysctl.u.scheduler_op.cpupool_id = cpupool_id;
diff --git a/tools/libs/ctrl/xc_domain.c b/tools/libs/ctrl/xc_domain.c
index 724fa6f753..f2d9d14b4d 100644
--- a/tools/libs/ctrl/xc_domain.c
+++ b/tools/libs/ctrl/xc_domain.c
@@ -27,7 +27,7 @@ int xc_domain_create(xc_interface *xch, uint32_t *pdomid,
                      struct xen_domctl_createdomain *config)
 {
     int err;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_createdomain;
     domctl.domain = *pdomid;
@@ -54,7 +54,7 @@ int xc_domain_cacheflush(xc_interface *xch, uint32_t domid,
      */
     return 0;
 #else
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     domctl.cmd = XEN_DOMCTL_cacheflush;
     domctl.domain = domid;
     domctl.u.cacheflush.start_pfn = start_pfn;
@@ -66,7 +66,7 @@ int xc_domain_cacheflush(xc_interface *xch, uint32_t domid,
 int xc_domain_pause(xc_interface *xch,
                     uint32_t domid)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     domctl.cmd = XEN_DOMCTL_pausedomain;
     domctl.domain = domid;
     return do_domctl(xch, &domctl);
@@ -76,7 +76,7 @@ int xc_domain_pause(xc_interface *xch,
 int xc_domain_unpause(xc_interface *xch,
                       uint32_t domid)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     domctl.cmd = XEN_DOMCTL_unpausedomain;
     domctl.domain = domid;
     return do_domctl(xch, &domctl);
@@ -86,7 +86,7 @@ int xc_domain_unpause(xc_interface *xch,
 int xc_domain_destroy(xc_interface *xch,
                       uint32_t domid)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     domctl.cmd = XEN_DOMCTL_destroydomain;
     domctl.domain = domid;
     return do_domctl(xch, &domctl);
@@ -123,7 +123,7 @@ int xc_domain_node_setaffinity(xc_interface *xch,
                                uint32_t domid,
                                xc_nodemap_t nodemap)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BUFFER(uint8_t, local);
     int ret = -1;
     int nodesize;
@@ -161,7 +161,7 @@ int xc_domain_node_getaffinity(xc_interface *xch,
                                uint32_t domid,
                                xc_nodemap_t nodemap)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BUFFER(uint8_t, local);
     int ret = -1;
     int nodesize;
@@ -203,7 +203,7 @@ int xc_vcpu_setaffinity(xc_interface *xch,
                         xc_cpumap_t cpumap_soft_inout,
                         uint32_t flags)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BOUNCE(cpumap_hard_inout, 0,
                              XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
     DECLARE_HYPERCALL_BOUNCE(cpumap_soft_inout, 0,
@@ -257,7 +257,7 @@ int xc_vcpu_getaffinity(xc_interface *xch,
                         xc_cpumap_t cpumap_soft,
                         uint32_t flags)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BOUNCE(cpumap_hard, 0, XC_HYPERCALL_BUFFER_BOUNCE_OUT);
     DECLARE_HYPERCALL_BOUNCE(cpumap_soft, 0, XC_HYPERCALL_BUFFER_BOUNCE_OUT);
     int ret = -1;
@@ -304,7 +304,7 @@ int xc_vcpu_getaffinity(xc_interface *xch,
 int xc_domain_get_guest_width(xc_interface *xch, uint32_t domid,
                               unsigned int *guest_width)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     memset(&domctl, 0, sizeof(domctl));
     domctl.domain = domid;
@@ -325,7 +325,7 @@ int xc_dom_vuart_init(xc_interface *xch,
                       xen_pfn_t gfn,
                       evtchn_port_t *evtchn)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     int rc = 0;
 
     memset(&domctl, 0, sizeof(domctl));
@@ -369,7 +369,7 @@ int xc_domain_getinfolist(xc_interface *xch,
                           xc_domaininfo_t *info)
 {
     int ret = 0;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_HYPERCALL_BOUNCE(info, max_domains*sizeof(*info), XC_HYPERCALL_BUFFER_BOUNCE_OUT);
 
     if ( xc_hypercall_bounce_pre(xch, info) )
@@ -396,7 +396,7 @@ int xc_set_broken_page_p2m(xc_interface *xch,
                            unsigned long pfn)
 {
     int ret;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
     domctl.domain = domid;
@@ -413,7 +413,7 @@ int xc_domain_hvm_getcontext(xc_interface *xch,
                              uint32_t size)
 {
     int ret;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BOUNCE(ctxt_buf, size, XC_HYPERCALL_BUFFER_BOUNCE_OUT);
 
     if ( xc_hypercall_bounce_pre(xch, ctxt_buf) )
@@ -441,7 +441,7 @@ int xc_domain_hvm_getcontext_partial(xc_interface *xch,
                                      uint32_t size)
 {
     int ret;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BOUNCE(ctxt_buf, size, XC_HYPERCALL_BUFFER_BOUNCE_OUT);
 
     if ( !ctxt_buf || xc_hypercall_bounce_pre(xch, ctxt_buf) )
@@ -468,7 +468,7 @@ int xc_domain_hvm_setcontext(xc_interface *xch,
                              uint32_t size)
 {
     int ret;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BOUNCE(ctxt_buf, size, XC_HYPERCALL_BUFFER_BOUNCE_IN);
 
     if ( xc_hypercall_bounce_pre(xch, ctxt_buf) )
@@ -492,7 +492,7 @@ int xc_vcpu_getcontext(xc_interface *xch,
                        vcpu_guest_context_any_t *ctxt)
 {
     int rc;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BOUNCE(ctxt, sizeof(vcpu_guest_context_any_t), XC_HYPERCALL_BUFFER_BOUNCE_OUT);
 
     if ( xc_hypercall_bounce_pre(xch, ctxt) )
@@ -517,7 +517,7 @@ int xc_vcpu_get_extstate(xc_interface *xch,
 {
     int rc = -ENODEV;
 #if defined (__i386__) || defined(__x86_64__)
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BUFFER(void, buffer);
     bool get_state;
 
@@ -606,7 +606,7 @@ int xc_shadow_control(xc_interface *xch,
                       unsigned int mode)
 {
     int rc;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     memset(&domctl, 0, sizeof(domctl));
 
@@ -690,7 +690,7 @@ int xc_domain_setmaxmem(xc_interface *xch,
                         uint32_t domid,
                         uint64_t max_memkb)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     domctl.cmd = XEN_DOMCTL_max_mem;
     domctl.domain = domid;
     domctl.u.max_mem.max_memkb = max_memkb;
@@ -808,7 +808,7 @@ int xc_domain_set_time_offset(xc_interface *xch,
                               uint32_t domid,
                               int32_t time_offset_seconds)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     domctl.cmd = XEN_DOMCTL_settimeoffset;
     domctl.domain = domid;
     domctl.u.settimeoffset.time_offset_seconds = time_offset_seconds;
@@ -822,7 +822,7 @@ int xc_domain_set_tsc_info(xc_interface *xch,
                            uint32_t gtsc_khz,
                            uint32_t incarnation)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     domctl.cmd = XEN_DOMCTL_settscinfo;
     domctl.domain = domid;
     domctl.u.tsc_info.tsc_mode = tsc_mode;
@@ -840,7 +840,7 @@ int xc_domain_get_tsc_info(xc_interface *xch,
                            uint32_t *incarnation)
 {
     int rc;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_gettscinfo;
     domctl.domain = domid;
@@ -1280,7 +1280,7 @@ int xc_domain_get_pod_target(xc_interface *xch,
 
 int xc_domain_max_vcpus(xc_interface *xch, uint32_t domid, unsigned int max)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     domctl.cmd = XEN_DOMCTL_max_vcpus;
     domctl.domain = domid;
     domctl.u.max_vcpus.max    = max;
@@ -1290,7 +1290,7 @@ int xc_domain_max_vcpus(xc_interface *xch, uint32_t domid, unsigned int max)
 int xc_domain_sethandle(xc_interface *xch, uint32_t domid,
                         xen_domain_handle_t handle)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     domctl.cmd = XEN_DOMCTL_setdomainhandle;
     domctl.domain = domid;
     memcpy(domctl.u.setdomainhandle.handle, handle,
@@ -1304,7 +1304,7 @@ int xc_vcpu_getinfo(xc_interface *xch,
                     xc_vcpuinfo_t *info)
 {
     int rc;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_getvcpuinfo;
     domctl.domain = domid;
@@ -1323,7 +1323,7 @@ int xc_domain_ioport_permission(xc_interface *xch,
                                 uint32_t nr_ports,
                                 uint32_t allow_access)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_ioport_permission;
     domctl.domain = domid;
@@ -1340,7 +1340,7 @@ int xc_availheap(xc_interface *xch,
                  int node,
                  uint64_t *bytes)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     int rc;
 
     sysctl.cmd = XEN_SYSCTL_availheap;
@@ -1360,7 +1360,7 @@ int xc_vcpu_setcontext(xc_interface *xch,
                        uint32_t vcpu,
                        vcpu_guest_context_any_t *ctxt)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BOUNCE(ctxt, sizeof(vcpu_guest_context_any_t), XC_HYPERCALL_BUFFER_BOUNCE_IN);
     int rc;
 
@@ -1384,7 +1384,7 @@ int xc_domain_irq_permission(xc_interface *xch,
                              uint32_t pirq,
                              bool allow_access)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_irq_permission;
     domctl.domain = domid;
@@ -1400,7 +1400,7 @@ int xc_domain_iomem_permission(xc_interface *xch,
                                unsigned long nr_mfns,
                                uint8_t allow_access)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_iomem_permission;
     domctl.domain = domid;
@@ -1416,7 +1416,7 @@ int xc_domain_send_trigger(xc_interface *xch,
                            uint32_t trigger,
                            uint32_t vcpu)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_sendtrigger;
     domctl.domain = domid;
@@ -1485,7 +1485,7 @@ int xc_domain_setdebugging(xc_interface *xch,
                            uint32_t domid,
                            unsigned int enable)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_setdebugging;
     domctl.domain = domid;
@@ -1499,7 +1499,7 @@ int xc_assign_device(
     uint32_t machine_sbdf,
     uint32_t flags)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_assign_device;
     domctl.domain = domid;
@@ -1519,7 +1519,7 @@ int xc_get_device_group(
     uint32_t *sdev_array)
 {
     int rc;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BOUNCE(sdev_array, max_sdevs * sizeof(*sdev_array),
                              XC_HYPERCALL_BUFFER_BOUNCE_OUT);
 
@@ -1551,7 +1551,7 @@ int xc_test_assign_device(
     uint32_t domid,
     uint32_t machine_sbdf)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_test_assign_device;
     domctl.domain = domid;
@@ -1567,7 +1567,7 @@ int xc_deassign_device(
     uint32_t domid,
     uint32_t machine_sbdf)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_deassign_device;
     domctl.domain = domid;
@@ -1585,7 +1585,7 @@ int xc_assign_dt_device(
 {
     int rc;
     size_t size = strlen(path);
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BOUNCE(path, size, XC_HYPERCALL_BUFFER_BOUNCE_IN);
 
     if ( xc_hypercall_bounce_pre(xch, path) )
@@ -1617,7 +1617,7 @@ int xc_test_assign_dt_device(
 {
     int rc;
     size_t size = strlen(path);
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BOUNCE(path, size, XC_HYPERCALL_BUFFER_BOUNCE_IN);
 
     if ( xc_hypercall_bounce_pre(xch, path) )
@@ -1645,7 +1645,7 @@ int xc_deassign_dt_device(
 {
     int rc;
     size_t size = strlen(path);
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BOUNCE(path, size, XC_HYPERCALL_BUFFER_BOUNCE_IN);
 
     if ( xc_hypercall_bounce_pre(xch, path) )
@@ -1679,7 +1679,7 @@ int xc_domain_update_msi_irq(
 {
     int rc;
     struct xen_domctl_bind_pt_irq *bind;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_bind_pt_irq;
     domctl.domain = domid;
@@ -1704,7 +1704,7 @@ int xc_domain_unbind_msi_irq(
 {
     int rc;
     struct xen_domctl_bind_pt_irq *bind;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_unbind_pt_irq;
     domctl.domain = domid;
@@ -1733,7 +1733,7 @@ static int xc_domain_bind_pt_irq_int(
 {
     int rc;
     struct xen_domctl_bind_pt_irq *bind;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_bind_pt_irq;
     domctl.domain = domid;
@@ -1791,7 +1791,7 @@ static int xc_domain_unbind_pt_irq_int(
 {
     int rc;
     struct xen_domctl_bind_pt_irq *bind;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_unbind_pt_irq;
     domctl.domain = domid;
@@ -1886,7 +1886,7 @@ int xc_domain_memory_mapping(
     unsigned long nr_mfns,
     uint32_t add_mapping)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     xc_domaininfo_t info;
     int ret = 0, rc;
     unsigned long done = 0, nr, max_batch_sz;
@@ -1958,7 +1958,7 @@ int xc_domain_ioport_mapping(
     uint32_t nr_ports,
     uint32_t add_mapping)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_ioport_mapping;
     domctl.domain = domid;
@@ -1975,7 +1975,7 @@ int xc_domain_set_target(
     uint32_t domid,
     uint32_t target)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_set_target;
     domctl.domain = domid;
@@ -1987,7 +1987,7 @@ int xc_domain_set_target(
 int xc_domain_subscribe_for_suspend(
     xc_interface *xch, uint32_t dom, evtchn_port_t port)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_subscribe;
     domctl.domain = dom;
@@ -1998,7 +1998,7 @@ int xc_domain_subscribe_for_suspend(
 
 int xc_domain_debug_control(xc_interface *xc, uint32_t domid, uint32_t sop, uint32_t vcpu)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     memset(&domctl, 0, sizeof(domctl));
     domctl.domain = domid;
@@ -2015,7 +2015,7 @@ int xc_domain_p2m_audit(xc_interface *xch,
                         uint64_t *m2p_bad,   
                         uint64_t *p2m_bad)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     int rc;
 
     domctl.cmd = XEN_DOMCTL_audit_p2m;
@@ -2033,7 +2033,7 @@ int xc_domain_set_access_required(xc_interface *xch,
                                   uint32_t domid,
                                   unsigned int required)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_set_access_required;
     domctl.domain = domid;
@@ -2043,7 +2043,7 @@ int xc_domain_set_access_required(xc_interface *xch,
 
 int xc_domain_set_virq_handler(xc_interface *xch, uint32_t domid, int virq)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_set_virq_handler;
     domctl.domain = domid;
@@ -2063,7 +2063,7 @@ int xc_domain_setvnuma(xc_interface *xch,
                        unsigned int *vnode_to_pnode)
 {
     int rc;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BOUNCE(vmemrange, sizeof(*vmemrange) * nr_vmemranges,
                              XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
     DECLARE_HYPERCALL_BOUNCE(vdistance, sizeof(*vdistance) *
@@ -2175,7 +2175,7 @@ int xc_domain_getvnuma(xc_interface *xch,
 int xc_domain_soft_reset(xc_interface *xch,
                          uint32_t domid)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     domctl.cmd = XEN_DOMCTL_soft_reset;
     domctl.domain = domid;
     return do_domctl(xch, &domctl);
diff --git a/tools/libs/ctrl/xc_flask.c b/tools/libs/ctrl/xc_flask.c
index c1652ba48d..21ba697ad6 100644
--- a/tools/libs/ctrl/xc_flask.c
+++ b/tools/libs/ctrl/xc_flask.c
@@ -64,7 +64,7 @@ int xc_flask_op(xc_interface *xch, xen_flask_op_t *op)
 int xc_flask_load(xc_interface *xch, char *buf, uint32_t size)
 {
     int err;
-    DECLARE_FLASK_OP;
+    struct xen_flask_op op = {};
     DECLARE_HYPERCALL_BOUNCE(buf, size, XC_HYPERCALL_BUFFER_BOUNCE_IN);
     if ( xc_hypercall_bounce_pre(xch, buf) )
     {
@@ -86,7 +86,7 @@ int xc_flask_load(xc_interface *xch, char *buf, uint32_t size)
 int xc_flask_context_to_sid(xc_interface *xch, char *buf, uint32_t size, uint32_t *sid)
 {
     int err;
-    DECLARE_FLASK_OP;
+    struct xen_flask_op op = {};
     DECLARE_HYPERCALL_BOUNCE(buf, size, XC_HYPERCALL_BUFFER_BOUNCE_IN);
 
     if ( xc_hypercall_bounce_pre(xch, buf) )
@@ -112,7 +112,7 @@ int xc_flask_context_to_sid(xc_interface *xch, char *buf, uint32_t size, uint32_
 int xc_flask_sid_to_context(xc_interface *xch, int sid, char *buf, uint32_t size)
 {
     int err;
-    DECLARE_FLASK_OP;
+    struct xen_flask_op op = {};
     DECLARE_HYPERCALL_BOUNCE(buf, size, XC_HYPERCALL_BUFFER_BOUNCE_OUT);
 
     if ( xc_hypercall_bounce_pre(xch, buf) )
@@ -135,7 +135,7 @@ int xc_flask_sid_to_context(xc_interface *xch, int sid, char *buf, uint32_t size
 
 int xc_flask_getenforce(xc_interface *xch)
 {
-    DECLARE_FLASK_OP;
+    struct xen_flask_op op = {};
     op.cmd = FLASK_GETENFORCE;
     
     return xc_flask_op(xch, &op);
@@ -143,7 +143,7 @@ int xc_flask_getenforce(xc_interface *xch)
 
 int xc_flask_setenforce(xc_interface *xch, int mode)
 {
-    DECLARE_FLASK_OP;
+    struct xen_flask_op op = {};
     op.cmd = FLASK_SETENFORCE;
     op.u.enforce.enforcing = mode;
    
@@ -153,7 +153,7 @@ int xc_flask_setenforce(xc_interface *xch, int mode)
 int xc_flask_getbool_byid(xc_interface *xch, int id, char *name, uint32_t size, int *curr, int *pend)
 {
     int rv;
-    DECLARE_FLASK_OP;
+    struct xen_flask_op op = {};
     DECLARE_HYPERCALL_BOUNCE(name, size, XC_HYPERCALL_BUFFER_BOUNCE_OUT);
 
     if ( xc_hypercall_bounce_pre(xch, name) )
@@ -185,7 +185,7 @@ int xc_flask_getbool_byid(xc_interface *xch, int id, char *name, uint32_t size,
 int xc_flask_getbool_byname(xc_interface *xch, char *name, int *curr, int *pend)
 {
     int rv;
-    DECLARE_FLASK_OP;
+    struct xen_flask_op op = {};
     DECLARE_HYPERCALL_BOUNCE(name, strlen(name), XC_HYPERCALL_BUFFER_BOUNCE_IN);
 
     if ( xc_hypercall_bounce_pre(xch, name) )
@@ -217,7 +217,7 @@ int xc_flask_getbool_byname(xc_interface *xch, char *name, int *curr, int *pend)
 int xc_flask_setbool(xc_interface *xch, char *name, int value, int commit)
 {
     int rv;
-    DECLARE_FLASK_OP;
+    struct xen_flask_op op = {};
     DECLARE_HYPERCALL_BOUNCE(name, strlen(name), XC_HYPERCALL_BUFFER_BOUNCE_IN);
 
     if ( xc_hypercall_bounce_pre(xch, name) )
@@ -245,7 +245,7 @@ static int xc_flask_add(xc_interface *xch, uint32_t ocon, uint64_t low, uint64_t
 {
     uint32_t sid;
     int err;
-    DECLARE_FLASK_OP;
+    struct xen_flask_op op = {};
 
     err = xc_flask_context_to_sid(xch, scontext, strlen(scontext), &sid);
     if ( err )
@@ -284,7 +284,7 @@ int xc_flask_add_device(xc_interface *xch, unsigned long device, char *scontext)
 
 static int xc_flask_del(xc_interface *xch, uint32_t ocon, uint64_t low, uint64_t high)
 {
-    DECLARE_FLASK_OP;
+    struct xen_flask_op op = {};
 
     op.cmd = FLASK_DEL_OCONTEXT;
     op.u.ocontext.ocon = ocon;
@@ -320,7 +320,7 @@ int xc_flask_access(xc_interface *xch, const char *scon, const char *tcon,
                 uint32_t *auditallow, uint32_t *auditdeny,
                 uint32_t *seqno)
 {
-    DECLARE_FLASK_OP;
+    struct xen_flask_op op = {};
     int err;
 
     err = xc_flask_context_to_sid(xch, (char*)scon, strlen(scon), &op.u.access.ssid);
@@ -359,7 +359,7 @@ int xc_flask_access(xc_interface *xch, const char *scon, const char *tcon,
 int xc_flask_avc_hashstats(xc_interface *xch, char *buf, int size)
 {
     int err;
-    DECLARE_FLASK_OP;
+    struct xen_flask_op op = {};
   
     op.cmd = FLASK_AVC_HASHSTATS;
   
@@ -377,7 +377,7 @@ int xc_flask_avc_cachestats(xc_interface *xch, char *buf, int size)
 {
     int err, n;
     int i = 0;
-    DECLARE_FLASK_OP;
+    struct xen_flask_op op = {};
 
     n = snprintf(buf, size, "lookups hits misses allocations reclaims frees\n");
     buf += n;
@@ -406,7 +406,7 @@ int xc_flask_avc_cachestats(xc_interface *xch, char *buf, int size)
 
 int xc_flask_policyvers(xc_interface *xch)
 {
-    DECLARE_FLASK_OP;
+    struct xen_flask_op op = {};
     op.cmd = FLASK_POLICYVERS;
 
     return xc_flask_op(xch, &op);
@@ -414,7 +414,7 @@ int xc_flask_policyvers(xc_interface *xch)
 
 int xc_flask_getavc_threshold(xc_interface *xch)
 {
-    DECLARE_FLASK_OP;
+    struct xen_flask_op op = {};
     op.cmd = FLASK_GETAVC_THRESHOLD;
     
     return xc_flask_op(xch, &op);
@@ -422,7 +422,7 @@ int xc_flask_getavc_threshold(xc_interface *xch)
 
 int xc_flask_setavc_threshold(xc_interface *xch, int threshold)
 {
-    DECLARE_FLASK_OP;
+    struct xen_flask_op op = {};
     op.cmd = FLASK_SETAVC_THRESHOLD;
     op.u.setavc_threshold.threshold = threshold;
 
@@ -431,7 +431,7 @@ int xc_flask_setavc_threshold(xc_interface *xch, int threshold)
 
 int xc_flask_relabel_domain(xc_interface *xch, uint32_t domid, uint32_t sid)
 {
-    DECLARE_FLASK_OP;
+    struct xen_flask_op op = {};
     op.cmd = FLASK_RELABEL_DOMAIN;
     op.u.relabel.domid = domid;
     op.u.relabel.sid = sid;
diff --git a/tools/libs/ctrl/xc_memshr.c b/tools/libs/ctrl/xc_memshr.c
index 2f65b3b22e..6f5e005c99 100644
--- a/tools/libs/ctrl/xc_memshr.c
+++ b/tools/libs/ctrl/xc_memshr.c
@@ -28,7 +28,7 @@ int xc_memshr_control(xc_interface *xch,
                       uint32_t domid,
                       int enable)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     struct xen_domctl_mem_sharing_op *op;
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
diff --git a/tools/libs/ctrl/xc_misc.c b/tools/libs/ctrl/xc_misc.c
index 4159294b2e..5ecdfa2c79 100644
--- a/tools/libs/ctrl/xc_misc.c
+++ b/tools/libs/ctrl/xc_misc.c
@@ -138,7 +138,7 @@ int xc_readconsolering(xc_interface *xch,
 {
     int ret;
     unsigned int nr_chars = *pnr_chars;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_HYPERCALL_BOUNCE(buffer, nr_chars, XC_HYPERCALL_BUFFER_BOUNCE_OUT);
 
     if ( xc_hypercall_bounce_pre(xch, buffer) )
@@ -170,7 +170,7 @@ int xc_readconsolering(xc_interface *xch,
 int xc_send_debug_keys(xc_interface *xch, const char *keys)
 {
     int ret, len = strlen(keys);
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_HYPERCALL_BOUNCE_IN(keys, len);
 
     if ( xc_hypercall_bounce_pre(xch, keys) )
@@ -191,7 +191,7 @@ int xc_physinfo(xc_interface *xch,
                 xc_physinfo_t *put_info)
 {
     int ret;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_physinfo;
 
@@ -206,7 +206,7 @@ int xc_physinfo(xc_interface *xch,
 int xc_microcode_update(xc_interface *xch, const void *buf, size_t len)
 {
     int ret;
-    DECLARE_PLATFORM_OP;
+    struct xen_platform_op platform_op = {};
     DECLARE_HYPERCALL_BUFFER(struct xenpf_microcode_update, uc);
 
     uc = xc_hypercall_buffer_alloc(xch, uc, len);
@@ -265,7 +265,7 @@ int xc_cputopoinfo(xc_interface *xch, unsigned *max_cpus,
                    xc_cputopo_t *cputopo)
 {
     int ret;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_HYPERCALL_BOUNCE(cputopo, *max_cpus * sizeof(*cputopo),
                              XC_HYPERCALL_BUFFER_BOUNCE_OUT);
 
@@ -292,7 +292,7 @@ int xc_numainfo(xc_interface *xch, unsigned *max_nodes,
                 xc_meminfo_t *meminfo, uint32_t *distance)
 {
     int ret;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_HYPERCALL_BOUNCE(meminfo, *max_nodes * sizeof(*meminfo),
                              XC_HYPERCALL_BUFFER_BOUNCE_OUT);
     DECLARE_HYPERCALL_BOUNCE(distance,
@@ -328,7 +328,7 @@ int xc_pcitopoinfo(xc_interface *xch, unsigned num_devs,
 {
     int ret = 0;
     unsigned processed = 0;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_HYPERCALL_BOUNCE(devs, num_devs * sizeof(*devs),
                              XC_HYPERCALL_BUFFER_BOUNCE_IN);
     DECLARE_HYPERCALL_BOUNCE(nodes, num_devs* sizeof(*nodes),
@@ -366,7 +366,7 @@ int xc_sched_id(xc_interface *xch,
                 int *sched_id)
 {
     int ret;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_sched_id;
 
@@ -451,7 +451,7 @@ out:
 
 int xc_perfc_reset(xc_interface *xch)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_perfc_op;
     sysctl.u.perfc_op.cmd = XEN_SYSCTL_PERFCOP_reset;
@@ -466,7 +466,7 @@ int xc_perfc_query_number(xc_interface *xch,
                           int *nbr_val)
 {
     int rc;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_perfc_op;
     sysctl.u.perfc_op.cmd = XEN_SYSCTL_PERFCOP_query;
@@ -487,7 +487,7 @@ int xc_perfc_query(xc_interface *xch,
                    struct xc_hypercall_buffer *desc,
                    struct xc_hypercall_buffer *val)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_HYPERCALL_BUFFER_ARGUMENT(desc);
     DECLARE_HYPERCALL_BUFFER_ARGUMENT(val);
 
@@ -501,7 +501,7 @@ int xc_perfc_query(xc_interface *xch,
 
 int xc_lockprof_reset(xc_interface *xch)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_lockprof_op;
     sysctl.u.lockprof_op.cmd = XEN_SYSCTL_LOCKPROF_reset;
@@ -514,7 +514,7 @@ int xc_lockprof_query_number(xc_interface *xch,
                              uint32_t *n_elems)
 {
     int rc;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_lockprof_op;
     sysctl.u.lockprof_op.max_elem = 0;
@@ -534,7 +534,7 @@ int xc_lockprof_query(xc_interface *xch,
                       struct xc_hypercall_buffer *data)
 {
     int rc;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_HYPERCALL_BUFFER_ARGUMENT(data);
 
     sysctl.cmd = XEN_SYSCTL_lockprof_op;
@@ -553,7 +553,7 @@ int xc_getcpuinfo(xc_interface *xch, int max_cpus,
                   xc_cpuinfo_t *info, int *nr_cpus)
 {
     int rc;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_HYPERCALL_BOUNCE(info, max_cpus*sizeof(*info), XC_HYPERCALL_BUFFER_BOUNCE_OUT);
 
     if ( xc_hypercall_bounce_pre(xch, info) )
@@ -579,7 +579,7 @@ int xc_livepatch_upload(xc_interface *xch,
                         uint32_t size)
 {
     int rc;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_HYPERCALL_BUFFER(char, local);
     DECLARE_HYPERCALL_BOUNCE(name, 0 /* later */, XC_HYPERCALL_BUFFER_BOUNCE_IN);
     struct xen_livepatch_name def_name = { };
@@ -632,7 +632,7 @@ int xc_livepatch_get(xc_interface *xch,
                      struct xen_livepatch_status *status)
 {
     int rc;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_HYPERCALL_BOUNCE(name, 0 /*adjust later */, XC_HYPERCALL_BUFFER_BOUNCE_IN);
     struct xen_livepatch_name def_name = { };
 
@@ -689,7 +689,7 @@ int xc_livepatch_list_get_sizes(xc_interface *xch, unsigned int *nr,
                                 uint32_t *name_total_size,
                                 uint32_t *metadata_total_size)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     int rc;
 
     if ( !nr || !name_total_size || !metadata_total_size )
@@ -770,7 +770,7 @@ int xc_livepatch_list(xc_interface *xch, const unsigned int max,
                       unsigned int *done, unsigned int *left)
 {
     int rc;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     /* The sizes are adjusted later - hence zero. */
     DECLARE_HYPERCALL_BOUNCE(info, 0, XC_HYPERCALL_BUFFER_BOUNCE_OUT);
     DECLARE_HYPERCALL_BOUNCE(name, 0, XC_HYPERCALL_BUFFER_BOUNCE_OUT);
@@ -965,7 +965,7 @@ static int _xc_livepatch_action(xc_interface *xch,
                                 uint32_t flags)
 {
     int rc;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     /* The size is figured out when we strlen(name) */
     DECLARE_HYPERCALL_BOUNCE(name, 0, XC_HYPERCALL_BUFFER_BOUNCE_IN);
     struct xen_livepatch_name def_name = { };
diff --git a/tools/libs/ctrl/xc_monitor.c b/tools/libs/ctrl/xc_monitor.c
index 3cb96f444f..5e3a01c333 100644
--- a/tools/libs/ctrl/xc_monitor.c
+++ b/tools/libs/ctrl/xc_monitor.c
@@ -48,7 +48,7 @@ int xc_monitor_get_capabilities(xc_interface *xch, uint32_t domain_id,
                                 uint32_t *capabilities)
 {
     int rc;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     if ( !capabilities )
     {
@@ -72,7 +72,7 @@ int xc_monitor_write_ctrlreg(xc_interface *xch, uint32_t domain_id,
                              uint16_t index, bool enable, bool sync,
                              uint64_t bitmask, bool onchangeonly)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_monitor_op;
     domctl.domain = domain_id;
@@ -92,7 +92,7 @@ int xc_monitor_write_ctrlreg(xc_interface *xch, uint32_t domain_id,
 int xc_monitor_mov_to_msr(xc_interface *xch, uint32_t domain_id, uint32_t msr,
                           bool enable, bool onchangeonly)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_monitor_op;
     domctl.domain = domain_id;
@@ -108,7 +108,7 @@ int xc_monitor_mov_to_msr(xc_interface *xch, uint32_t domain_id, uint32_t msr,
 int xc_monitor_software_breakpoint(xc_interface *xch, uint32_t domain_id,
                                    bool enable)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_monitor_op;
     domctl.domain = domain_id;
@@ -122,7 +122,7 @@ int xc_monitor_software_breakpoint(xc_interface *xch, uint32_t domain_id,
 int xc_monitor_singlestep(xc_interface *xch, uint32_t domain_id,
                           bool enable)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_monitor_op;
     domctl.domain = domain_id;
@@ -136,7 +136,7 @@ int xc_monitor_singlestep(xc_interface *xch, uint32_t domain_id,
 int xc_monitor_descriptor_access(xc_interface *xch, uint32_t domain_id,
                                  bool enable)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_monitor_op;
     domctl.domain = domain_id;
@@ -150,7 +150,7 @@ int xc_monitor_descriptor_access(xc_interface *xch, uint32_t domain_id,
 int xc_monitor_guest_request(xc_interface *xch, uint32_t domain_id, bool enable,
                              bool sync, bool allow_userspace)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_monitor_op;
     domctl.domain = domain_id;
@@ -166,7 +166,7 @@ int xc_monitor_guest_request(xc_interface *xch, uint32_t domain_id, bool enable,
 int xc_monitor_inguest_pagefault(xc_interface *xch, uint32_t domain_id,
                                 bool disable)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_monitor_op;
     domctl.domain = domain_id;
@@ -180,7 +180,7 @@ int xc_monitor_inguest_pagefault(xc_interface *xch, uint32_t domain_id,
 int xc_monitor_emulate_each_rep(xc_interface *xch, uint32_t domain_id,
                                 bool enable)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_monitor_op;
     domctl.domain = domain_id;
@@ -193,7 +193,7 @@ int xc_monitor_emulate_each_rep(xc_interface *xch, uint32_t domain_id,
 int xc_monitor_debug_exceptions(xc_interface *xch, uint32_t domain_id,
                                 bool enable, bool sync)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_monitor_op;
     domctl.domain = domain_id;
@@ -207,7 +207,7 @@ int xc_monitor_debug_exceptions(xc_interface *xch, uint32_t domain_id,
 
 int xc_monitor_cpuid(xc_interface *xch, uint32_t domain_id, bool enable)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_monitor_op;
     domctl.domain = domain_id;
@@ -221,7 +221,7 @@ int xc_monitor_cpuid(xc_interface *xch, uint32_t domain_id, bool enable)
 int xc_monitor_privileged_call(xc_interface *xch, uint32_t domain_id,
                                bool enable)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_monitor_op;
     domctl.domain = domain_id;
@@ -235,7 +235,7 @@ int xc_monitor_privileged_call(xc_interface *xch, uint32_t domain_id,
 int xc_monitor_emul_unimplemented(xc_interface *xch, uint32_t domain_id,
                                   bool enable)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_monitor_op;
     domctl.domain = domain_id;
@@ -249,7 +249,7 @@ int xc_monitor_emul_unimplemented(xc_interface *xch, uint32_t domain_id,
 int xc_monitor_vmexit(xc_interface *xch, uint32_t domain_id, bool enable,
                       bool sync)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_monitor_op;
     domctl.domain = domain_id;
@@ -263,7 +263,7 @@ int xc_monitor_vmexit(xc_interface *xch, uint32_t domain_id, bool enable,
 
 int xc_monitor_io(xc_interface *xch, uint32_t domain_id, bool enable)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_monitor_op;
     domctl.domain = domain_id;
diff --git a/tools/libs/ctrl/xc_pm.c b/tools/libs/ctrl/xc_pm.c
index b20b675280..b27b45c3dc 100644
--- a/tools/libs/ctrl/xc_pm.c
+++ b/tools/libs/ctrl/xc_pm.c
@@ -28,7 +28,7 @@
  */
 int xc_pm_get_max_px(xc_interface *xch, int cpuid, int *max_px)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     int ret;
 
     sysctl.cmd = XEN_SYSCTL_get_pmstat;
@@ -44,7 +44,7 @@ int xc_pm_get_max_px(xc_interface *xch, int cpuid, int *max_px)
 
 int xc_pm_get_pxstat(xc_interface *xch, int cpuid, struct xc_px_stat *pxpt)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     /* Sizes unknown until xc_pm_get_max_px */
     DECLARE_NAMED_HYPERCALL_BOUNCE(trans, pxpt->trans_pt, 0, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
     DECLARE_NAMED_HYPERCALL_BOUNCE(pt, pxpt->pt, 0, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
@@ -99,7 +99,7 @@ int xc_pm_get_pxstat(xc_interface *xch, int cpuid, struct xc_px_stat *pxpt)
 
 int xc_pm_reset_pxstat(xc_interface *xch, int cpuid)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_get_pmstat;
     sysctl.u.get_pmstat.type = PMSTAT_reset_pxstat;
@@ -110,7 +110,7 @@ int xc_pm_reset_pxstat(xc_interface *xch, int cpuid)
 
 int xc_pm_get_max_cx(xc_interface *xch, int cpuid, int *max_cx)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     int ret = 0;
 
     sysctl.cmd = XEN_SYSCTL_get_pmstat;
@@ -125,7 +125,7 @@ int xc_pm_get_max_cx(xc_interface *xch, int cpuid, int *max_cx)
 
 int xc_pm_get_cxstat(xc_interface *xch, int cpuid, struct xc_cx_stat *cxpt)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_NAMED_HYPERCALL_BOUNCE(triggers, cxpt->triggers,
                                    cxpt->nr * sizeof(*cxpt->triggers),
                                    XC_HYPERCALL_BUFFER_BOUNCE_OUT);
@@ -183,7 +183,7 @@ unlock_0:
 
 int xc_pm_reset_cxstat(xc_interface *xch, int cpuid)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_get_pmstat;
     sysctl.u.get_pmstat.type = PMSTAT_reset_cxstat;
@@ -200,7 +200,7 @@ int xc_pm_reset_cxstat(xc_interface *xch, int cpuid)
 int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
                         struct xc_get_cpufreq_para *user_para)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     int ret = 0;
     struct xen_get_cpufreq_para *sys_para = &sysctl.u.pm_op.u.get_para;
     DECLARE_NAMED_HYPERCALL_BOUNCE(affected_cpus,
@@ -310,7 +310,7 @@ unlock_1:
 
 int xc_set_cpufreq_gov(xc_interface *xch, int cpuid, char *govname)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     char *scaling_governor = sysctl.u.pm_op.u.set_gov.scaling_governor;
 
     if ( !xch || !govname )
@@ -330,7 +330,7 @@ int xc_set_cpufreq_gov(xc_interface *xch, int cpuid, char *govname)
 int xc_set_cpufreq_para(xc_interface *xch, int cpuid, 
                         int ctrl_type, int ctrl_value)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     if ( !xch )
     {
@@ -349,7 +349,7 @@ int xc_set_cpufreq_para(xc_interface *xch, int cpuid,
 int xc_set_cpufreq_cppc(xc_interface *xch, int cpuid,
                         xc_set_cppc_para_t *set_cppc)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     int ret;
 
     if ( !xch )
@@ -372,7 +372,7 @@ int xc_set_cpufreq_cppc(xc_interface *xch, int cpuid,
 int xc_get_cpufreq_avgfreq(xc_interface *xch, int cpuid, int *avg_freq)
 {
     int ret = 0;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     if ( !xch || !avg_freq )
     {
@@ -395,7 +395,7 @@ int xc_get_cpufreq_avgfreq(xc_interface *xch, int cpuid, int *avg_freq)
 int xc_set_sched_opt_smt(xc_interface *xch, uint32_t value)
 {
    int rc;
-   DECLARE_SYSCTL;
+   struct xen_sysctl sysctl = {};
 
    sysctl.cmd = XEN_SYSCTL_pm_op;
    sysctl.u.pm_op.cmd = XEN_SYSCTL_pm_op_set_sched_opt_smt;
@@ -409,7 +409,7 @@ int xc_set_sched_opt_smt(xc_interface *xch, uint32_t value)
 static int get_max_cstate(xc_interface *xch, uint32_t *value, uint32_t type)
 {
     int rc;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     if ( !xch || !value )
     {
@@ -438,7 +438,7 @@ int xc_get_cpuidle_max_csubstate(xc_interface *xch, uint32_t *value)
 
 static int set_max_cstate(xc_interface *xch, uint32_t value, uint32_t type)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     if ( !xch )
     {
@@ -465,7 +465,7 @@ int xc_set_cpuidle_max_csubstate(xc_interface *xch, uint32_t value)
 
 int xc_enable_turbo(xc_interface *xch, int cpuid)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     if ( !xch )
     {
@@ -480,7 +480,7 @@ int xc_enable_turbo(xc_interface *xch, int cpuid)
 
 int xc_disable_turbo(xc_interface *xch, int cpuid)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     if ( !xch )
     {
diff --git a/tools/libs/ctrl/xc_private.c b/tools/libs/ctrl/xc_private.c
index 6293a45531..abd0b0d849 100644
--- a/tools/libs/ctrl/xc_private.c
+++ b/tools/libs/ctrl/xc_private.c
@@ -229,7 +229,7 @@ int xc_get_pfn_type_batch(xc_interface *xch, uint32_t dom,
                           unsigned int num, xen_pfn_t *arr)
 {
     int rc;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BOUNCE(arr, sizeof(*arr) * num, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
     if ( xc_hypercall_bounce_pre(xch, arr) )
         return -1;
@@ -398,7 +398,7 @@ int xc_maximum_ram_page(xc_interface *xch, unsigned long *max_mfn)
 
 long long xc_domain_get_cpu_usage(xc_interface *xch, uint32_t domid, int vcpu)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_getvcpuinfo;
     domctl.domain = domid;
diff --git a/tools/libs/ctrl/xc_private.h b/tools/libs/ctrl/xc_private.h
index 8faabaea67..d8b7da2805 100644
--- a/tools/libs/ctrl/xc_private.h
+++ b/tools/libs/ctrl/xc_private.h
@@ -62,12 +62,6 @@ struct iovec {
 #include <sys/uio.h>
 #endif
 
-#define DECLARE_DOMCTL struct xen_domctl domctl
-#define DECLARE_SYSCTL struct xen_sysctl sysctl
-#define DECLARE_PHYSDEV_OP struct physdev_op physdev_op
-#define DECLARE_FLASK_OP struct xen_flask_op op
-#define DECLARE_PLATFORM_OP struct xen_platform_op platform_op
-
 #undef PAGE_SHIFT
 #undef PAGE_SIZE
 #undef PAGE_MASK
diff --git a/tools/libs/ctrl/xc_psr.c b/tools/libs/ctrl/xc_psr.c
index 1a0ab636f0..477009ec12 100644
--- a/tools/libs/ctrl/xc_psr.c
+++ b/tools/libs/ctrl/xc_psr.c
@@ -29,7 +29,7 @@
 
 int xc_psr_cmt_attach(xc_interface *xch, uint32_t domid)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_psr_cmt_op;
     domctl.domain = domid;
@@ -40,7 +40,7 @@ int xc_psr_cmt_attach(xc_interface *xch, uint32_t domid)
 
 int xc_psr_cmt_detach(xc_interface *xch, uint32_t domid)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_psr_cmt_op;
     domctl.domain = domid;
@@ -53,7 +53,7 @@ int xc_psr_cmt_get_domain_rmid(xc_interface *xch, uint32_t domid,
                                uint32_t *rmid)
 {
     int rc;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_psr_cmt_op;
     domctl.domain = domid;
@@ -71,7 +71,7 @@ int xc_psr_cmt_get_total_rmid(xc_interface *xch, uint32_t *total_rmid)
 {
     static int val = 0;
     int rc;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     if ( val )
     {
@@ -95,7 +95,7 @@ int xc_psr_cmt_get_l3_upscaling_factor(xc_interface *xch,
 {
     static int val = 0;
     int rc;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     if ( val )
     {
@@ -118,7 +118,7 @@ int xc_psr_cmt_get_l3_upscaling_factor(xc_interface *xch,
 int xc_psr_cmt_get_l3_event_mask(xc_interface *xch, uint32_t *event_mask)
 {
     int rc;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_psr_cmt_op;
     sysctl.u.psr_cmt_op.cmd =
@@ -137,7 +137,7 @@ int xc_psr_cmt_get_l3_cache_size(xc_interface *xch, uint32_t cpu,
 {
     static int val = 0;
     int rc;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     if ( val )
     {
@@ -230,7 +230,7 @@ int xc_psr_cmt_enabled(xc_interface *xch)
 {
     static int val = -1;
     int rc;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     if ( val >= 0 )
         return val;
@@ -252,7 +252,7 @@ int xc_psr_set_domain_data(xc_interface *xch, uint32_t domid,
                            xc_psr_type type, uint32_t target,
                            uint64_t data)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     uint32_t cmd;
 
     switch ( type )
@@ -291,7 +291,7 @@ int xc_psr_get_domain_data(xc_interface *xch, uint32_t domid,
                            uint64_t *data)
 {
     int rc;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     uint32_t cmd;
 
     switch ( type )
@@ -333,7 +333,7 @@ int xc_psr_get_hw_info(xc_interface *xch, uint32_t socket,
                        xc_psr_feat_type type, xc_psr_hw_info *hw_info)
 {
     int rc = -1;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     if ( !hw_info )
     {
diff --git a/tools/libs/ctrl/xc_resource.c b/tools/libs/ctrl/xc_resource.c
index 3394cc1833..cb6a97202b 100644
--- a/tools/libs/ctrl/xc_resource.c
+++ b/tools/libs/ctrl/xc_resource.c
@@ -22,7 +22,7 @@
 static int xc_resource_op_one(xc_interface *xch, xc_resource_op_t *op)
 {
     int rc;
-    DECLARE_PLATFORM_OP;
+    struct xen_platform_op platform_op = {};
     DECLARE_NAMED_HYPERCALL_BOUNCE(entries, op->entries,
                                 op->nr_entries * sizeof(*op->entries),
                                 XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
diff --git a/tools/libs/ctrl/xc_rt.c b/tools/libs/ctrl/xc_rt.c
index ad257c6e52..3cb3fbb923 100644
--- a/tools/libs/ctrl/xc_rt.c
+++ b/tools/libs/ctrl/xc_rt.c
@@ -29,7 +29,7 @@ int xc_sched_rtds_domain_set(xc_interface *xch,
                            struct xen_domctl_sched_rtds *sdom)
 {
     int rc;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_scheduler_op;
     domctl.domain = domid;
@@ -48,7 +48,7 @@ int xc_sched_rtds_domain_get(xc_interface *xch,
                            struct xen_domctl_sched_rtds *sdom)
 {
     int rc;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_scheduler_op;
     domctl.domain = domid;
@@ -70,7 +70,7 @@ int xc_sched_rtds_vcpu_set(xc_interface *xch,
 {
     int rc = 0;
     unsigned processed = 0;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BOUNCE(vcpus, sizeof(*vcpus) * num_vcpus,
                              XC_HYPERCALL_BUFFER_BOUNCE_IN);
 
@@ -104,7 +104,7 @@ int xc_sched_rtds_vcpu_get(xc_interface *xch,
 {
     int rc = 0;
     unsigned processed = 0;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BOUNCE(vcpus, sizeof(*vcpus) * num_vcpus,
                              XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
 
diff --git a/tools/libs/ctrl/xc_tbuf.c b/tools/libs/ctrl/xc_tbuf.c
index 283fbd1c8f..73b0d1e323 100644
--- a/tools/libs/ctrl/xc_tbuf.c
+++ b/tools/libs/ctrl/xc_tbuf.c
@@ -27,7 +27,7 @@
 
 static int tbuf_enable(xc_interface *xch, int enable)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_tbuf_op;
     sysctl.interface_version = XEN_SYSCTL_INTERFACE_VERSION;
@@ -41,7 +41,7 @@ static int tbuf_enable(xc_interface *xch, int enable)
 
 int xc_tbuf_set_size(xc_interface *xch, unsigned long size)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_tbuf_op;
     sysctl.interface_version = XEN_SYSCTL_INTERFACE_VERSION;
@@ -55,7 +55,7 @@ int xc_tbuf_get_size(xc_interface *xch, unsigned long *size)
 {
     struct t_info *t_info;
     int rc;
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_tbuf_op;
     sysctl.interface_version = XEN_SYSCTL_INTERFACE_VERSION;
@@ -82,7 +82,7 @@ int xc_tbuf_get_size(xc_interface *xch, unsigned long *size)
 int xc_tbuf_enable(xc_interface *xch, unsigned long pages, unsigned long *mfn,
                    unsigned long *size)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     int rc;
 
     /*
@@ -116,7 +116,7 @@ int xc_tbuf_disable(xc_interface *xch)
 
 int xc_tbuf_set_cpu_mask(xc_interface *xch, xc_cpumap_t mask)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_HYPERCALL_BOUNCE(mask, 0, XC_HYPERCALL_BUFFER_BOUNCE_IN);
     int ret = -1;
     int bits, cpusize;
@@ -160,7 +160,7 @@ int xc_tbuf_set_cpu_mask(xc_interface *xch, xc_cpumap_t mask)
 
 int xc_tbuf_set_evt_mask(xc_interface *xch, uint32_t mask)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
 
     sysctl.cmd = XEN_SYSCTL_tbuf_op;
     sysctl.interface_version = XEN_SYSCTL_INTERFACE_VERSION;
diff --git a/tools/libs/ctrl/xc_vm_event.c b/tools/libs/ctrl/xc_vm_event.c
index a97c615b18..2f03315648 100644
--- a/tools/libs/ctrl/xc_vm_event.c
+++ b/tools/libs/ctrl/xc_vm_event.c
@@ -25,7 +25,7 @@
 int xc_vm_event_control(xc_interface *xch, uint32_t domain_id, unsigned int op,
                         unsigned int mode, uint32_t *port)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     int rc;
 
     domctl.cmd = XEN_DOMCTL_vm_event_op;
@@ -158,7 +158,7 @@ void *xc_vm_event_enable(xc_interface *xch, uint32_t domain_id, int param,
 
 int xc_vm_event_get_version(xc_interface *xch)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     int rc;
 
     domctl.cmd = XEN_DOMCTL_vm_event_op;
diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x86.c
index f2b1e80901..4497087daa 100644
--- a/tools/libs/guest/xg_cpuid_x86.c
+++ b/tools/libs/guest/xg_cpuid_x86.c
@@ -38,7 +38,7 @@ enum {
 
 int xc_get_cpu_levelling_caps(xc_interface *xch, uint32_t *caps)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     int ret;
 
     sysctl.cmd = XEN_SYSCTL_get_cpu_levelling_caps;
@@ -53,7 +53,7 @@ int xc_get_cpu_levelling_caps(xc_interface *xch, uint32_t *caps)
 int xc_get_cpu_featureset(xc_interface *xch, uint32_t index,
                           uint32_t *nr_features, uint32_t *featureset)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_HYPERCALL_BOUNCE(featureset,
                              *nr_features * sizeof(*featureset),
                              XC_HYPERCALL_BUFFER_BOUNCE_OUT);
@@ -167,7 +167,7 @@ static int get_domain_cpu_policy(xc_interface *xch, uint32_t domid,
                                  uint32_t *nr_leaves, xen_cpuid_leaf_t *leaves,
                                  uint32_t *nr_msrs, xen_msr_entry_t *msrs)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BOUNCE(leaves,
                              *nr_leaves * sizeof(*leaves),
                              XC_HYPERCALL_BUFFER_BOUNCE_OUT);
@@ -207,7 +207,7 @@ int xc_set_domain_cpu_policy(xc_interface *xch, uint32_t domid,
                              uint32_t *err_leaf_p, uint32_t *err_subleaf_p,
                              uint32_t *err_msr_p)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BOUNCE(leaves,
                              nr_leaves * sizeof(*leaves),
                              XC_HYPERCALL_BUFFER_BOUNCE_IN);
diff --git a/tools/libs/guest/xg_dom_arm.c b/tools/libs/guest/xg_dom_arm.c
index d616dccbd6..2fd8ee7ad4 100644
--- a/tools/libs/guest/xg_dom_arm.c
+++ b/tools/libs/guest/xg_dom_arm.c
@@ -204,7 +204,7 @@ static int set_mode(xc_interface *xch, uint32_t domid, const char *guest_type)
         { "xen-3.0-aarch64", 64 },
         { "xen-3.0-armv7l",  32 },
     };
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     int i,rc;
 
     domctl.domain = domid;
diff --git a/tools/libs/guest/xg_dom_boot.c b/tools/libs/guest/xg_dom_boot.c
index 6e0847e718..5c7e12221d 100644
--- a/tools/libs/guest/xg_dom_boot.c
+++ b/tools/libs/guest/xg_dom_boot.c
@@ -39,7 +39,7 @@
 
 static int setup_hypercall_page(struct xc_dom_image *dom)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     xen_pfn_t pfn;
     int rc;
 
diff --git a/tools/libs/guest/xg_dom_x86.c b/tools/libs/guest/xg_dom_x86.c
index 811d176488..cba01384ae 100644
--- a/tools/libs/guest/xg_dom_x86.c
+++ b/tools/libs/guest/xg_dom_x86.c
@@ -1158,7 +1158,7 @@ static int x86_compat(xc_interface *xch, uint32_t domid,
         { "xen-3.0-x86_32p", 32 },
         { "xen-3.0-x86_64",  64 },
     };
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     int i,rc;
 
     memset(&domctl, 0, sizeof(domctl));
diff --git a/tools/libs/guest/xg_offline_page.c b/tools/libs/guest/xg_offline_page.c
index 5f61d49456..ffd0e6975e 100644
--- a/tools/libs/guest/xg_offline_page.c
+++ b/tools/libs/guest/xg_offline_page.c
@@ -51,7 +51,7 @@ static struct domain_info_context *dinfo = &_dinfo;
 int xc_mark_page_online(xc_interface *xch, unsigned long start,
                         unsigned long end, uint32_t *status)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_HYPERCALL_BOUNCE(status, sizeof(uint32_t)*(end - start + 1), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
     int ret = -1;
 
@@ -81,7 +81,7 @@ int xc_mark_page_online(xc_interface *xch, unsigned long start,
 int xc_mark_page_offline(xc_interface *xch, unsigned long start,
                           unsigned long end, uint32_t *status)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_HYPERCALL_BOUNCE(status, sizeof(uint32_t)*(end - start + 1), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
     int ret = -1;
 
@@ -111,7 +111,7 @@ int xc_mark_page_offline(xc_interface *xch, unsigned long start,
 int xc_query_page_offline_status(xc_interface *xch, unsigned long start,
                                  unsigned long end, uint32_t *status)
 {
-    DECLARE_SYSCTL;
+    struct xen_sysctl sysctl = {};
     DECLARE_HYPERCALL_BOUNCE(status, sizeof(uint32_t)*(end - start + 1), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
     int ret = -1;
 
diff --git a/tools/libs/guest/xg_resume.c b/tools/libs/guest/xg_resume.c
index c85d09a7f5..31c49d320e 100644
--- a/tools/libs/guest/xg_resume.c
+++ b/tools/libs/guest/xg_resume.c
@@ -93,7 +93,7 @@ static int modify_returncode(xc_interface *xch, uint32_t domid)
 
 static int xc_domain_resume_cooperative(xc_interface *xch, uint32_t domid)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     int rc;
 
     /*
@@ -111,7 +111,7 @@ static int xc_domain_resume_cooperative(xc_interface *xch, uint32_t domid)
 #if defined(__i386__) || defined(__x86_64__)
 static int xc_domain_resume_hvm(xc_interface *xch, uint32_t domid)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     /*
      * The domctl XEN_DOMCTL_resumedomain unpause each vcpu. After
@@ -132,7 +132,7 @@ static int xc_domain_resume_hvm(xc_interface *xch, uint32_t domid)
 
 static int xc_domain_resume_any(xc_interface *xch, uint32_t domid)
 {
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     xc_domaininfo_t info;
     int i, rc = -1;
 #if defined(__i386__) || defined(__x86_64__)
diff --git a/tools/libs/guest/xg_sr_restore_x86_pv.c b/tools/libs/guest/xg_sr_restore_x86_pv.c
index eaeb97f4a0..9cd6a88022 100644
--- a/tools/libs/guest/xg_sr_restore_x86_pv.c
+++ b/tools/libs/guest/xg_sr_restore_x86_pv.c
@@ -376,7 +376,7 @@ static int process_vcpu_extended(struct xc_sr_context *ctx,
     xc_interface *xch = ctx->xch;
     struct xc_sr_x86_pv_restore_vcpu *vcpu =
         &ctx->x86.pv.restore.vcpus[vcpuid];
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
 
     domctl.cmd = XEN_DOMCTL_set_ext_vcpucontext;
     domctl.domain = ctx->domid;
@@ -401,7 +401,7 @@ static int process_vcpu_xsave(struct xc_sr_context *ctx,
     struct xc_sr_x86_pv_restore_vcpu *vcpu =
         &ctx->x86.pv.restore.vcpus[vcpuid];
     int rc;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BUFFER(void, buffer);
 
     buffer = xc_hypercall_buffer_alloc(xch, buffer, vcpu->xsave.size);
@@ -439,7 +439,7 @@ static int process_vcpu_msrs(struct xc_sr_context *ctx,
     struct xc_sr_x86_pv_restore_vcpu *vcpu =
         &ctx->x86.pv.restore.vcpus[vcpuid];
     int rc;
-    DECLARE_DOMCTL;
+    struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BUFFER(void, buffer);
 
     buffer = xc_hypercall_buffer_alloc(xch, buffer, vcpu->msr.size);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 16 07:33:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Nov 2023 07:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.634005.989186 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3Wsh-0003bZ-MC; Thu, 16 Nov 2023 07:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 634005.989186; Thu, 16 Nov 2023 07: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 1r3Wsh-0003bQ-JQ; Thu, 16 Nov 2023 07:33:43 +0000
Received: by outflank-mailman (input) for mailman id 634005;
 Thu, 16 Nov 2023 07:33:41 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3Wsf-0003bD-Rf
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 07:33:41 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3Wsf-0006th-Qy
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 07:33:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3Wsf-0000Cg-QE
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 07:33:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JnbE2YHh619G906yk+BLrChiuU21nByrVdMwo2FUojY=; b=FARmFMPcC3J6r24dMHVFl8paME
	hKNndaDpI4YOiREQXZezTgsFk+iSbsz6N95Vk97HJTmlZ4yxVFMMS7rujtkO5M48eE26zGzzdET5A
	KecQ48XIbUK5rozSARtKEhCbAXOL39hbhC3MMqDdaJXlm9pBr9gDoT1ouj8hVRAmNuTg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/boot: tidy #include-s
Message-Id: <E1r3Wsf-0000Cg-QE@xenbits.xenproject.org>
Date: Thu, 16 Nov 2023 07:33:41 +0000

commit 7ad0c774e474f6d95dfda868d876af507d399657
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Nov 15 11:42:28 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 15 11:42:28 2023 +0100

    x86/boot: tidy #include-s
    
    As of d58a509e01c4 ("build,x86: remove the need for build32.mk") we
    don't need to use non-standard #include forms anymore in the sources for
    the boot code helper blobs. The only place where this kind of #include
    needs to remain (for the time being) is mkelf32.c.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/boot/defs.h  | 2 +-
 xen/arch/x86/boot/reloc.c | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/boot/defs.h b/xen/arch/x86/boot/defs.h
index f9840044ec..239b9f8716 100644
--- a/xen/arch/x86/boot/defs.h
+++ b/xen/arch/x86/boot/defs.h
@@ -20,7 +20,7 @@
 #ifndef __BOOT_DEFS_H__
 #define __BOOT_DEFS_H__
 
-#include "../../../include/xen/stdbool.h"
+#include <xen/stdbool.h>
 
 #define __maybe_unused	__attribute__((__unused__))
 #define __packed	__attribute__((__packed__))
diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c
index 609b02cb73..e093b7389c 100644
--- a/xen/arch/x86/boot/reloc.c
+++ b/xen/arch/x86/boot/reloc.c
@@ -27,10 +27,11 @@ asm (
     );
 
 #include "defs.h"
-#include "../../../include/xen/multiboot.h"
-#include "../../../include/xen/multiboot2.h"
 
-#include "../../../include/xen/kconfig.h"
+#include <xen/kconfig.h>
+#include <xen/multiboot.h>
+#include <xen/multiboot2.h>
+
 #include <public/arch-x86/hvm/start_info.h>
 
 #ifdef CONFIG_VIDEO
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 16 15:44:06 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Nov 2023 15:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.634488.989966 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3eXD-0001kK-10; Thu, 16 Nov 2023 15:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 634488.989966; Thu, 16 Nov 2023 15:44:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3eXC-0001kC-TL; Thu, 16 Nov 2023 15:44:02 +0000
Received: by outflank-mailman (input) for mailman id 634488;
 Thu, 16 Nov 2023 15:44:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3eXB-0001k6-S0
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 15:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3eXB-0000Dl-Qx
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 15:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3eXB-0005y8-P9
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 15: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=iGw1VHr8g/zB1W+v3vZ1/1MgS8ISTJlHOdSiTNu2oQY=; b=4H1QsFxzzbG/NKMZgTkB4Sc9MH
	ykafcI9/n8Dm0tBoq85Ee8qoYR2CJThhilpSkEvMrlLdBoHErocQT+KgHxGiCX4y7Qv+IGC6D1NYM
	era4wiBS0jZzZlt0r7UtfGt7B/g8lIKwG4iHopz8/O++Z+FMta0yznMlEDi0LG6IFPCs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/misra: add R11.1 R11.2 R11.3 R11.6
Message-Id: <E1r3eXB-0005y8-P9@xenbits.xenproject.org>
Date: Thu, 16 Nov 2023 15:44:01 +0000

commit 06e484767b1b025f0aeaf26b82149ab29100153b
Author:     Stefano Stabellini <stefano.stabellini@amd.com>
AuthorDate: Wed Nov 15 16:01:55 2023 -0800
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Nov 15 16:01:55 2023 -0800

    docs/misra: add R11.1 R11.2 R11.3 R11.6
    
    Add MISRA C Rules 11.1, 11.2, 11.3, 11.6 as discussed.
    
    Explicitly add in the notes that conversions to integer types are
    permitted if the destination type has enough bits to hold the entire
    value. GCC gives enough guarantees in terms of preserving the bit
    content in such situations.
    
    Also allow for bool conversions (e.g. to check if a function point is
    valid).
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 docs/misra/rules.rst | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index aa65eb4dd0..da343ab3ac 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -383,6 +383,36 @@ maintainers if you want to suggest a change.
 
        CFLAGS="-Warith-conversion -Wno-error=arith-conversion" make -C xen
 
+   * - `Rule 11.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_11_01.c>`_
+     - Required
+     - Conversions shall not be performed between a pointer to a
+       function and any other type
+     - All conversions to integer types are permitted if the destination
+       type has enough bits to hold the entire value. Conversions to
+       bool and void* are permitted.
+
+   * - `Rule 11.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_11_02.c>`_
+     - Required
+     - Conversions shall not be performed between a pointer to an
+       incomplete type and any other type
+     - All conversions to integer types are permitted if the destination
+       type has enough bits to hold the entire value. Conversions to
+       bool and void* are permitted.
+
+   * - `Rule 11.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_11_03.c>`_
+     - Required
+     - A cast shall not be performed between a pointer to object type
+       and a pointer to a different object type
+     -
+
+   * - `Rule 11.6 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_11_06.c>`_
+     - Required
+     - A cast shall not be performed between pointer to void and an
+       arithmetic type
+     - All conversions to integer types are permitted if the destination
+       type has enough bits to hold the entire value. Conversions to
+       bool are permitted.
+
    * - `Rule 11.7 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_11_07.c>`_
      - Required
      - A cast shall not be performed between pointer to object and a noninteger arithmetic type
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 16 15:44:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Nov 2023 15:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.634489.989969 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3eXN-0001mJ-1C; Thu, 16 Nov 2023 15:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 634489.989969; Thu, 16 Nov 2023 15:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3eXM-0001mB-Un; Thu, 16 Nov 2023 15:44:12 +0000
Received: by outflank-mailman (input) for mailman id 634489;
 Thu, 16 Nov 2023 15:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3eXL-0001m3-Vs
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 15:44:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3eXL-0000Ds-Uv
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 15:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3eXL-0005yh-T3
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 15:44:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Txfm9Oq7um/OCr+W9ZJJg1M37LBdOgr9lHx5x1QK/Ek=; b=W6mLbguBUTCAJpfhAS84ukK4BJ
	5FYP/oOG1Vf8oT+XdmbiCQpNM4PZBY+xfbBNYOwc1fzwzZPjg2eCXXRuKSt9eRCOdZHdQSIIbfijp
	4bbxrR610mhxxPS8UlN4dqWDosP0luP3uzZvkXpp5I2dsDB9FqJngWcZS/8UtR7gvSpw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] misra: add R21.1 R21.2
Message-Id: <E1r3eXL-0005yh-T3@xenbits.xenproject.org>
Date: Thu, 16 Nov 2023 15:44:11 +0000

commit fb62aa714d72349722d63b32a5a6d20a677f39e0
Author:     Stefano Stabellini <sstabellini@kernel.org>
AuthorDate: Tue Nov 14 14:59:06 2023 -0800
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Nov 15 16:03:00 2023 -0800

    misra: add R21.1 R21.2
    
    Add 21.1 and 21.2, with a longer comment to explain how strategy with
    leading underscores and why we think we are safe today.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 docs/misra/rules.rst | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index da343ab3ac..53dab0070c 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -519,6 +519,28 @@ maintainers if you want to suggest a change.
        they are related
      -
 
+   * - `Rule 21.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_21_01.c>`_
+     - Required
+     - #define and #undef shall not be used on a reserved identifier or
+       reserved macro name
+     - Identifiers starting with an underscore followed by another underscore
+       or an upper-case letter are reserved. Today Xen uses many, such as
+       header guards and bitwise manipulation functions. Upon analysis it turns
+       out Xen identifiers do not clash with the identifiers used by modern
+       GCC, but that is not a guarantee that there won't be a naming clash in
+       the future or with another compiler.  For these reasons we discourage
+       the introduction of new reserved identifiers in Xen, and we see it as
+       positive the reduction of reserved identifiers. At the same time,
+       certain identifiers starting with wo underscores are also commonly used
+       in Linux (e.g. __set_bit) and we don't think it would be an improvement
+       to rename them.
+
+   * - `Rule 21.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_21_02.c>`_
+     - Required
+     - A reserved identifier or reserved macro name shall not be
+       declared
+     - See comment for Rule 21.1
+
    * - `Rule 21.13 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_21_13.c>`_
      - Mandatory
      - Any value passed to a function in <ctype.h> shall be representable as an
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 16 22:44:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Nov 2023 22:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.634661.990148 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3l5f-00039e-KA; Thu, 16 Nov 2023 22:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 634661.990148; Thu, 16 Nov 2023 22:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3l5f-00039X-He; Thu, 16 Nov 2023 22:44:03 +0000
Received: by outflank-mailman (input) for mailman id 634661;
 Thu, 16 Nov 2023 22:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3l5e-00039N-3L
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 22:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3l5e-000059-1k
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 22:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3l5e-0004dX-04
 for xen-changelog@lists.xenproject.org; Thu, 16 Nov 2023 22:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YIUny7obo+wd9JHTxp42lCfl62KEjsbnb7ETn089lMM=; b=xJYtTtHQ6BM4rp7QTHFAeTRXDu
	mRid/HhaeFfDmqsDZGYRI/w+WSa+m8fzyd9O7zopvrRemTfyX8EB69qulUdwJXqJ3qeRxzw8JlL98
	700y3NxYMoJIkSVCX7VMvOn9P85atEBXuUx/axHETFq4llQpny9BJUG4zC3G9+172jpQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] SUPPORT.md: Define support lifetime
Message-Id: <E1r3l5e-0004dX-04@xenbits.xenproject.org>
Date: Thu, 16 Nov 2023 22:44:02 +0000

commit 3ddbddf143fbd164c55e46c5a276f6606e5cc843
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Wed Nov 15 12:16:32 2023 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Nov 16 12:07:20 2023 +0000

    SUPPORT.md: Define support lifetime
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 SUPPORT.md | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index fff4b4c5ba..75917e7a58 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -9,10 +9,10 @@ for the definitions of the support status levels etc.
 
 # Release Support
 
-    Xen-Version: 4.18-rc
-    Initial-Release: n/a
-    Supported-Until: TBD
-    Security-Support-Until: Unreleased - not yet security-supported
+    Xen-Version: 4.18
+    Initial-Release: 2023-11-16
+    Supported-Until: 2025-05-16
+    Security-Support-Until: 2026-11-16
 
 Release Notes
 : <a href="https://wiki.xenproject.org/wiki/Xen_Project_X.YY_Release_Notes">RN</a>
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Nov 17 08:55:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Nov 2023 08:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.634916.990532 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3ucx-0003ab-0O; Fri, 17 Nov 2023 08:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 634916.990532; Fri, 17 Nov 2023 08:55: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 1r3ucw-0003aU-UA; Fri, 17 Nov 2023 08:55:02 +0000
Received: by outflank-mailman (input) for mailman id 634916;
 Fri, 17 Nov 2023 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 1r3ucv-0003aO-WB
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 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 1r3ucv-0003Gg-VR
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 08:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3ucv-0004ko-UK
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 08:55:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=H2CYV7kObtpZR+8q4bvrTkk3AbZMIAKI4AjWzL+XoIk=; b=1xaK++RfgzlM1R7gvnwqFHsXOE
	YCubVSd6kKlY+voy5/Nfg9d4wu8B7crHtzavd2UYNHJclIK9/s6ubg6Q0kF+C+kfiSlRLX0vX6qOQ
	7+AcJszBEXby/sPHPRnvRa+qj6mMEFR/cpSNfZaHBO4oSXY+AGs93Qjb0NLKijLbWFFA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mctelem: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r3ucv-0004ko-UK@xenbits.xenproject.org>
Date: Fri, 17 Nov 2023 08:55:01 +0000

commit 6f3f60b0901fa76e0e1955988aef710104192060
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Thu Nov 16 09:09:38 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 16 09:09:38 2023 +0100

    x86/mctelem: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/mcheck/mctelem.c |  2 +-
 xen/arch/x86/cpu/mcheck/mctelem.h | 25 +++++++++++++------------
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mctelem.c b/xen/arch/x86/cpu/mcheck/mctelem.c
index 77a4d1d5ff..b8d0368a7d 100644
--- a/xen/arch/x86/cpu/mcheck/mctelem.c
+++ b/xen/arch/x86/cpu/mcheck/mctelem.c
@@ -208,7 +208,7 @@ void mctelem_defer(mctelem_cookie_t cookie, bool lmce)
  *  @lmce: indicate which pending list on @cpu is handled
  */
 void mctelem_process_deferred(unsigned int cpu,
-			      int (*fn)(mctelem_cookie_t),
+			      int (*fn)(mctelem_cookie_t mctc),
 			      bool lmce)
 {
 	struct mctelem_ent *tep;
diff --git a/xen/arch/x86/cpu/mcheck/mctelem.h b/xen/arch/x86/cpu/mcheck/mctelem.h
index 21b251847b..f4c5ff848d 100644
--- a/xen/arch/x86/cpu/mcheck/mctelem.h
+++ b/xen/arch/x86/cpu/mcheck/mctelem.h
@@ -60,18 +60,19 @@ typedef enum mctelem_class {
     MC_NCLASSES
 } mctelem_class_t;
 
-extern void mctelem_init(unsigned int);
-extern mctelem_cookie_t mctelem_reserve(mctelem_class_t);
-extern void *mctelem_dataptr(mctelem_cookie_t);
-extern void mctelem_commit(mctelem_cookie_t);
-extern void mctelem_dismiss(mctelem_cookie_t);
-extern mctelem_cookie_t mctelem_consume_oldest_begin(mctelem_class_t);
-extern void mctelem_consume_oldest_end(mctelem_cookie_t);
-extern void mctelem_ack(mctelem_class_t, mctelem_cookie_t);
-extern void mctelem_defer(mctelem_cookie_t, bool lmce);
-extern void mctelem_process_deferred(unsigned int,
-                                     int (*)(mctelem_cookie_t), bool lmce);
-bool mctelem_has_deferred(unsigned int);
+extern void mctelem_init(unsigned int datasz);
+extern mctelem_cookie_t mctelem_reserve(mctelem_class_t which);
+extern void *mctelem_dataptr(mctelem_cookie_t cookie);
+extern void mctelem_commit(mctelem_cookie_t cookie);
+extern void mctelem_dismiss(mctelem_cookie_t cookie);
+extern mctelem_cookie_t mctelem_consume_oldest_begin(mctelem_class_t which);
+extern void mctelem_consume_oldest_end(mctelem_cookie_t cookie);
+extern void mctelem_ack(mctelem_class_t which, mctelem_cookie_t cookie);
+extern void mctelem_defer(mctelem_cookie_t cookie, bool lmce);
+extern void mctelem_process_deferred(unsigned int cpu,
+                                     int (*fn)(mctelem_cookie_t mctc),
+                                     bool lmce);
+bool mctelem_has_deferred(unsigned int cpu);
 bool mctelem_has_deferred_lmce(unsigned int cpu);
 
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 17 08:55:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Nov 2023 08:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.634917.990536 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3ud7-0003cT-1k; Fri, 17 Nov 2023 08:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 634917.990536; Fri, 17 Nov 2023 08: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 1r3ud6-0003cM-VZ; Fri, 17 Nov 2023 08:55:12 +0000
Received: by outflank-mailman (input) for mailman id 634917;
 Fri, 17 Nov 2023 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 1r3ud6-0003cF-3A
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 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 1r3ud6-0003Gt-2S
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 08:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3ud6-0004lh-1D
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 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=WdEXqK6mFdGw//2SzOUlHnWTg6ZZS6UT63DX/BxsyCI=; b=Hqec7E07rUUKiVpJ+jot8cm6Oy
	W4KTqPi7WB1CpD20r6DtSAKBYW83krJZX0pcgNlfKQtzbZCPSTjQXlfUpn+zzqyyyfDTOVVRDMXKL
	uXFmFh/M2W+xqtnYA44R1SLoMburV+KiXhJ0wd1LL1za/s3UeLmCv6iR+XWvM3E6IEdM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mtrr: address violation of MISRA C:2012 Rule 8.2
Message-Id: <E1r3ud6-0004lh-1D@xenbits.xenproject.org>
Date: Fri, 17 Nov 2023 08:55:12 +0000

commit 21f6d31ed68ea9336a3c4fe038d373114ea3c6df
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Thu Nov 16 09:10:14 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 16 09:10:14 2023 +0100

    x86/mtrr: address violation of MISRA C:2012 Rule 8.2
    
    Add missing parameter names. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/mtrr.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/include/asm/mtrr.h b/xen/arch/x86/include/asm/mtrr.h
index 14246e3387..1d2744eceb 100644
--- a/xen/arch/x86/include/asm/mtrr.h
+++ b/xen/arch/x86/include/asm/mtrr.h
@@ -48,7 +48,7 @@ struct mtrr_state {
 };
 extern struct mtrr_state mtrr_state;
 
-extern void cf_check mtrr_save_fixed_ranges(void *);
+extern void cf_check mtrr_save_fixed_ranges(void *info);
 extern void mtrr_save_state(void);
 extern int mtrr_add(unsigned long base, unsigned long size,
                     unsigned int type, char increment);
@@ -68,14 +68,14 @@ extern void mtrr_aps_sync_begin(void);
 extern void mtrr_aps_sync_end(void);
 extern void mtrr_bp_restore(void);
 
-extern bool_t mtrr_var_range_msr_set(struct domain *, struct mtrr_state *,
+extern bool_t mtrr_var_range_msr_set(struct domain *d, struct mtrr_state *m,
                                      uint32_t msr, uint64_t msr_content);
-extern bool_t mtrr_fix_range_msr_set(struct domain *, struct mtrr_state *,
+extern bool_t mtrr_fix_range_msr_set(struct domain *d, struct mtrr_state *m,
                                      uint32_t row, uint64_t msr_content);
-extern bool_t mtrr_def_type_msr_set(struct domain *, struct mtrr_state *,
+extern bool_t mtrr_def_type_msr_set(struct domain *d, struct mtrr_state *m,
                                     uint64_t msr_content);
 #ifdef CONFIG_HVM
-extern void memory_type_changed(struct domain *);
+extern void memory_type_changed(struct domain *d);
 #else
 static inline void memory_type_changed(struct domain *d) {}
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 17 08:55:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Nov 2023 08:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.634918.990541 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3udH-0003fE-3F; Fri, 17 Nov 2023 08:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 634918.990541; Fri, 17 Nov 2023 08: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 1r3udH-0003f6-0j; Fri, 17 Nov 2023 08:55:23 +0000
Received: by outflank-mailman (input) for mailman id 634918;
 Fri, 17 Nov 2023 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 1r3udG-0003eq-73
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 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 1r3udG-0003Gx-5W
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 08:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3udG-0004mH-4Y
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 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=78qjnbE0Qv2IeSbsnisLd3xghQICHGjLXHCQQiN+WM8=; b=Dz3VOn3D8RlfkDdapM33blLjBL
	5x6m87+aVrUqCOB0aSvsWfVjYcDF6sZenPm+Pb9zzEU6/Vb7/qy4JE9lGU/L6+qyuEVGKp3M6caro
	9YddyHJAVmMXTElGr8T0Ww6Fm/oAoeyWrNStmGWee4Y5ev8dab1cPb8Ih47nf8lrN+fQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/domain: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r3udG-0004mH-4Y@xenbits.xenproject.org>
Date: Fri, 17 Nov 2023 08:55:22 +0000

commit 614417165c469b2af8272d7f3b6508c7bf010f79
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Thu Nov 16 09:10:54 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 16 09:10:54 2023 +0100

    x86/domain: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/domain.h | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h
index 619e667938..d033224d2b 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -74,20 +74,20 @@ struct mapcache_domain {
     unsigned long *garbage;
 };
 
-int mapcache_domain_init(struct domain *);
-int mapcache_vcpu_init(struct vcpu *);
-void mapcache_override_current(struct vcpu *);
+int mapcache_domain_init(struct domain *d);
+int mapcache_vcpu_init(struct vcpu *v);
+void mapcache_override_current(struct vcpu *v);
 
 /* x86/64: toggle guest between kernel and user modes. */
-void toggle_guest_mode(struct vcpu *);
+void toggle_guest_mode(struct vcpu *v);
 /* x86/64: toggle guest page tables between kernel and user modes. */
-void toggle_guest_pt(struct vcpu *);
+void toggle_guest_pt(struct vcpu *v);
 
 /*
  * Initialise a hypercall-transfer page. The given pointer must be mapped
  * in Xen virtual address space (accesses are not validated or checked).
  */
-void init_hypercall_page(struct domain *d, void *);
+void init_hypercall_page(struct domain *d, void *ptr);
 
 /************************************************/
 /*          shadow paging extension             */
@@ -342,8 +342,8 @@ struct arch_domain
     struct page_list_head relmem_list;
 
     const struct arch_csw {
-        void (*from)(struct vcpu *);
-        void (*to)(struct vcpu *);
+        void (*from)(struct vcpu *v);
+        void (*to)(struct vcpu *v);
         void noreturn (*tail)(void);
     } *ctxt_switch;
 
@@ -690,12 +690,12 @@ void update_guest_memory_policy(struct vcpu *v,
 
 void domain_cpu_policy_changed(struct domain *d);
 
-bool update_secondary_system_time(struct vcpu *,
-                                  struct vcpu_time_info *);
-void force_update_secondary_system_time(struct vcpu *,
-                                        struct vcpu_time_info *);
+bool update_secondary_system_time(struct vcpu *v,
+                                  struct vcpu_time_info *u);
+void force_update_secondary_system_time(struct vcpu *v,
+                                        struct vcpu_time_info *map);
 
-void vcpu_show_registers(const struct vcpu *);
+void vcpu_show_registers(const struct vcpu *v);
 
 static inline struct vcpu_guest_context *alloc_vcpu_guest_context(void)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 17 08:55:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Nov 2023 08:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.634919.990544 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3udR-0003ie-4q; Fri, 17 Nov 2023 08:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 634919.990544; Fri, 17 Nov 2023 08: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 1r3udR-0003iX-27; Fri, 17 Nov 2023 08:55:33 +0000
Received: by outflank-mailman (input) for mailman id 634919;
 Fri, 17 Nov 2023 08: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 1r3udQ-0003iQ-9V
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 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 1r3udQ-0003H4-8k
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 08:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3udQ-0004mk-7g
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 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=S6J/AH3ASBB0JseVQzda4bo/yQbMxjFyrCz6hjQoROo=; b=kexvIr3JemNrLBbfDmPnO9MDE5
	nJpNyxCKQ/kSdc95slxYJs4FquRWwRqbc7ITcpOjqVonQa4vTJeKDZ8aOlyEW24Bb2zA0ijzG/acq
	7pKVDSzzWRRbBWPkvTTp22hU67TuBkNCkJEEdDVSFOGBJVHozqgA8iRo8ZPD6C8ETnJE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpuidle: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r3udQ-0004mk-7g@xenbits.xenproject.org>
Date: Fri, 17 Nov 2023 08:55:32 +0000

commit 5310230b61fd6586376285dc41d9a5771015ac78
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Thu Nov 16 09:11:30 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 16 09:11:30 2023 +0100

    x86/cpuidle: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/cpuidle.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/include/asm/cpuidle.h b/xen/arch/x86/include/asm/cpuidle.h
index 3edd7a75d2..707b3e948d 100644
--- a/xen/arch/x86/include/asm/cpuidle.h
+++ b/xen/arch/x86/include/asm/cpuidle.h
@@ -15,16 +15,17 @@ extern void (*lapic_timer_on)(void);
 
 extern uint64_t (*cpuidle_get_tick)(void);
 
-int mwait_idle_init(struct notifier_block *);
+int mwait_idle_init(struct notifier_block *nfb);
 int cpuidle_init_cpu(unsigned int cpu);
 void cf_check default_dead_idle(void);
 void cf_check acpi_dead_idle(void);
 void play_dead(void);
 void trace_exit_reason(u32 *irq_traced);
-void update_idle_stats(struct acpi_processor_power *,
-                       struct acpi_processor_cx *, uint64_t, uint64_t);
-void update_last_cx_stat(struct acpi_processor_power *,
-                         struct acpi_processor_cx *, uint64_t);
+void update_idle_stats(struct acpi_processor_power *power,
+                       struct acpi_processor_cx *cx,
+                       uint64_t before, uint64_t after);
+void update_last_cx_stat(struct acpi_processor_power *power,
+                         struct acpi_processor_cx *cx, uint64_t ticks);
 
 bool errata_c6_workaround(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 17 08:55:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Nov 2023 08:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.634920.990548 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3udb-0003mI-7a; Fri, 17 Nov 2023 08:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 634920.990548; Fri, 17 Nov 2023 08: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 1r3udb-0003mD-4p; Fri, 17 Nov 2023 08:55:43 +0000
Received: by outflank-mailman (input) for mailman id 634920;
 Fri, 17 Nov 2023 08: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 1r3uda-0003m1-Ci
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 08: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 1r3uda-0003HA-Bw
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 08:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3uda-0004nD-Ar
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 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=87Gu/5UfKbznepxLyb+ZGCqZ2FoXTrSMTC1A3S/ay6M=; b=EojagQe7MpxE9KnTfal4E6C3WM
	BewGXd5EGc/Kplc7kMm30O14Z51wl99yp/QOt0da/SYkXGEVQze6c+k3p2Y3wM4adHi2xEGbK6CP2
	lh55bitJqOlHOYnhZVkpwbgezrqnSTqGMBTKumdxPe82cLf5com+fwP8Z5QVc49j6BvU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mcaction: address a violation of MISRA C:2012 Rule 8.2
Message-Id: <E1r3uda-0004nD-Ar@xenbits.xenproject.org>
Date: Fri, 17 Nov 2023 08:55:42 +0000

commit dc64ba0c41125015847112f602a314cff6eb629b
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Thu Nov 16 09:11:55 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 16 09:11:55 2023 +0100

    x86/mcaction: address a violation of MISRA C:2012 Rule 8.2
    
    Add missing parameter name. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/mcheck/mcaction.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/mcheck/mcaction.h b/xen/arch/x86/cpu/mcheck/mcaction.h
index 5cbe558fb0..9cb2ad6c9f 100644
--- a/xen/arch/x86/cpu/mcheck/mcaction.h
+++ b/xen/arch/x86/cpu/mcheck/mcaction.h
@@ -13,7 +13,7 @@ mc_memerr_dhandler(struct mca_binfo *binfo,
 #define MC_ADDR_VIRTUAL   1
 
 typedef bool (*mce_check_addr_t)(uint64_t status, uint64_t misc, int addr_type);
-extern void mce_register_addrcheck(mce_check_addr_t);
+extern void mce_register_addrcheck(mce_check_addr_t cbfunc);
 
 extern mce_check_addr_t mc_check_addr;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 17 08:55:53 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Nov 2023 08:55:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.634921.990554 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3udl-0003tO-9x; Fri, 17 Nov 2023 08:55:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 634921.990554; Fri, 17 Nov 2023 08:55:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3udl-0003tG-6J; Fri, 17 Nov 2023 08:55:53 +0000
Received: by outflank-mailman (input) for mailman id 634921;
 Fri, 17 Nov 2023 08:55:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3udk-0003t3-Fb
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 08:55:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3udk-0003HZ-Eo
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 08:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3udk-0004ne-Dv
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 08:55:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ee3c8TSqgnRiLksWCcigXmUgICLynQ4mz8tV3VWZ2uA=; b=7GueNaRobFtnphufN5OkfXFR8n
	thgybdSI61WRoz1SYb40BaLLq/m1bQxgPNlLh5yf1TYFO+PTooGEWmvs6NgEAKPnM2xgAjWCyA6Kn
	n3+NJPUxEyOP6zFAc/uOqdMr11pvCNceh3pYVU2Szp4m4dkexieQcIsWoIcT4akM4tlg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/vmce: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r3udk-0004ne-Dv@xenbits.xenproject.org>
Date: Fri, 17 Nov 2023 08:55:52 +0000

commit 9c27a730b85e69abca5eaf24111b1340a79a6dd7
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Thu Nov 16 09:12:19 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 16 09:12:19 2023 +0100

    x86/vmce: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/mcheck/vmce.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/vmce.h b/xen/arch/x86/cpu/mcheck/vmce.h
index 2e9b32a9bd..a9a325f776 100644
--- a/xen/arch/x86/cpu/mcheck/vmce.h
+++ b/xen/arch/x86/cpu/mcheck/vmce.h
@@ -11,10 +11,10 @@ int vmce_init(struct cpuinfo_x86 *c);
 
 int unmmap_broken_page(struct domain *d, mfn_t mfn, unsigned long gfn);
 
-int vmce_intel_rdmsr(const struct vcpu *, uint32_t msr, uint64_t *val);
-int vmce_intel_wrmsr(struct vcpu *, uint32_t msr, uint64_t val);
-int vmce_amd_rdmsr(const struct vcpu *, uint32_t msr, uint64_t *val);
-int vmce_amd_wrmsr(struct vcpu *, uint32_t msr, uint64_t val);
+int vmce_intel_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val);
+int vmce_intel_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val);
+int vmce_amd_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val);
+int vmce_amd_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val);
 
 int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
                    uint64_t gstatus, int vmce_vcpuid);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 17 08:56:03 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Nov 2023 08:56:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.634922.990557 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3udv-00042V-BY; Fri, 17 Nov 2023 08:56:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 634922.990557; Fri, 17 Nov 2023 08:56: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 1r3udv-00042N-7n; Fri, 17 Nov 2023 08:56:03 +0000
Received: by outflank-mailman (input) for mailman id 634922;
 Fri, 17 Nov 2023 08:56:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3udu-00042D-Id
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 08:56:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3udu-0003Hv-Hs
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 08:56:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3udu-0004oY-Gx
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 08:56:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=L8ghZO/i5RQkx8Xuh3M3+c1X69uaWTjYyVfu8gAS510=; b=xHSQAbk3i+/vbrxI9IL8t4NRB5
	pYxwVAJMOT+N27h8QQQ6ybEOqNk9E0Ztx97e2kg9XgANyazI++Mjma2hHJFs6bGRifKvpnMn5K+P9
	ppGxfncxcW/5doaCuo4Zihd4Gsqb/cTlI0I15c2aHt4z7AYob855geQE0/MpJ9TosN9s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hpet: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r3udu-0004oY-Gx@xenbits.xenproject.org>
Date: Fri, 17 Nov 2023 08:56:02 +0000

commit ef8eba3535609048d98c6500ac760fbaeee7e6a7
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Thu Nov 16 09:12:43 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 16 09:12:43 2023 +0100

    x86/hpet: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names. While there also switch a type name. No
    functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hpet.c             | 4 ++--
 xen/arch/x86/include/asm/hpet.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 79c07f6a9e..7be26c6a9b 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -37,7 +37,7 @@ struct hpet_event_channel
     s_time_t      next_event;
     cpumask_var_t cpumask;
     spinlock_t    lock;
-    void          (*event_handler)(struct hpet_event_channel *);
+    void          (*event_handler)(struct hpet_event_channel *ch);
 
     unsigned int idx;   /* physical channel idx */
     unsigned int cpu;   /* msi target */
@@ -906,7 +906,7 @@ u64 __init hpet_setup(void)
     return hpet_rate;
 }
 
-void hpet_resume(u32 *boot_cfg)
+void hpet_resume(uint32_t *boot_cfg)
 {
     static u32 system_reset_latch;
     u32 hpet_id, cfg;
diff --git a/xen/arch/x86/include/asm/hpet.h b/xen/arch/x86/include/asm/hpet.h
index 9919f74730..36a848e607 100644
--- a/xen/arch/x86/include/asm/hpet.h
+++ b/xen/arch/x86/include/asm/hpet.h
@@ -60,7 +60,7 @@ extern int8_t opt_hpet_legacy_replacement;
  * Return value is zero if HPET is unavailable.
  */
 u64 hpet_setup(void);
-void hpet_resume(u32 *);
+void hpet_resume(uint32_t *boot_cfg);
 
 /*
  * Disable HPET hardware: restore it to boot time state.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 17 08:56:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Nov 2023 08:56:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.634923.990561 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3ue5-00048K-C2; Fri, 17 Nov 2023 08:56:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 634923.990561; Fri, 17 Nov 2023 08:56: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 1r3ue5-00048A-9G; Fri, 17 Nov 2023 08:56:13 +0000
Received: by outflank-mailman (input) for mailman id 634923;
 Fri, 17 Nov 2023 08:56: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 1r3ue4-00047Z-Lc
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 08:56:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3ue4-0003I0-Ks
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 08:56:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3ue4-0004p3-K4
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 08:56:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0ENZkezZyuq6xndADJZKcaJdcWqtWsmpvWwFTwpvuXU=; b=cmPi7PIp2tu4MObPYArvD87K6b
	OxEAZLvIhap4ptIY2NwlFLSf/KS4G5xI3IPPUuPBng933pLuAi9EfB5WB/siTm8gnU3WJYkdqSIQj
	PnlMbmwnLneZdqRxXurUd6tbRaef9C2+LirRsqiYWxp3YIbsANXMVdEPEkiu9opme6/Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/include: add macro ISOLATE_LSB
Message-Id: <E1r3ue4-0004p3-K4@xenbits.xenproject.org>
Date: Fri, 17 Nov 2023 08:56:12 +0000

commit b739e2067b1a06328e7f0042630b543413689eac
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Thu Nov 16 09:18:23 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 16 09:18:23 2023 +0100

    xen/include: add macro ISOLATE_LSB
    
    The purpose of this macro is to encapsulate the well-known expression
    'x & -x' that in 2's complement architectures on unsigned integers will
    give a mask where only the least significant nonzero bit of 'x' is set,
    or 0 if none are set.
    
    A deviation for ECLAIR is also introduced.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl |  7 +++++++
 docs/misra/deviations.rst                        |  8 ++++++++
 xen/include/xen/macros.h                         | 10 ++++++++--
 3 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index d8170106b4..82ae567da4 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -274,6 +274,13 @@ still non-negative."
 -config=MC3R1.R10.1,etypes+={safe, "stmt(operator(logical)||node(conditional_operator||binary_conditional_operator))", "dst_type(ebool||boolean)"}
 -doc_end
 
+-doc_begin="The macro ISOLATE_LSB encapsulates a well-known pattern to obtain
+a mask where only the lowest bit set in the argument is set, if any, for unsigned
+integers arguments on two's complement architectures
+(all the architectures supported by Xen satisfy this requirement)."
+-config=MC3R1.R10.1,reports+={safe, "any_area(any_loc(any_exp(macro(^ISOLATE_LSB$))))"}
+-doc_end
+
 ### Set 3 ###
 
 #
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 8511a18925..5b03c093ad 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -192,6 +192,14 @@ Deviations related to MISRA C:2012 Rules:
        See automation/eclair_analysis/deviations.ecl for the full explanation.
      - Tagged as `safe` for ECLAIR.
 
+   * - R10.1
+     - The macro ISOLATE_LSB encapsulates the well-known pattern (x & -x)
+       applied to unsigned integer values on 2's complement architectures
+       (i.e., all architectures supported by Xen), used to obtain a mask where
+       just the least significant nonzero bit of x is set.
+       If no bits are set, 0 is returned.
+     - Tagged as `safe` for ECLAIR.
+
    * - R13.5
      - All developers and reviewers can be safely assumed to be well aware of
        the short-circuit evaluation strategy for logical operators.
diff --git a/xen/include/xen/macros.h b/xen/include/xen/macros.h
index d0caae7db2..f943319ab2 100644
--- a/xen/include/xen/macros.h
+++ b/xen/include/xen/macros.h
@@ -8,8 +8,14 @@
 #define DIV_ROUND(n, d) (((n) + (d) / 2) / (d))
 #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
 
-#define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m)))
-#define MASK_INSR(v, m) (((v) * ((m) & -(m))) & (m))
+/*
+ * Given an unsigned integer argument, expands to a mask where just the least
+ * significant nonzero bit of the argument is set, or 0 if no bits are set.
+ */
+#define ISOLATE_LSB(x) ((x) & -(x))
+
+#define MASK_EXTR(v, m) (((v) & (m)) / ISOLATE_LSB(m))
+#define MASK_INSR(v, m) (((v) * ISOLATE_LSB(m)) & (m))
 
 #define count_args_(dot, a1, a2, a3, a4, a5, a6, a7, a8, x, ...) x
 #define count_args(args...) \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 17 12:44:07 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Nov 2023 12:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.635171.991025 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r3yCZ-0007dY-C9; Fri, 17 Nov 2023 12:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 635171.991025; Fri, 17 Nov 2023 12: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 1r3yCZ-0007dQ-9V; Fri, 17 Nov 2023 12:44:03 +0000
Received: by outflank-mailman (input) for mailman id 635171;
 Fri, 17 Nov 2023 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 1r3yCX-0007dK-V9
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 12:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3yCX-0007TT-UQ
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 12:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r3yCX-00076U-TI
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 12: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=FE2NX7OkGFEzCRehlP5Tbqh4UorzulYqiaAaQHZV3wY=; b=cr7ajPT6lA2ADKSyRwPhmNrcFm
	Knmidc2WGuTlc/J5Psl4MvvhmZza6YNaIAUMcm5b5xCPQB3m6O1cLS9x9i2W75PkNeroVR3WlawZY
	vvS8HPrZheLMt+JjW1Hi3qj1I/JUkgWtbR4P4n+a6glBcWN0PVByxAG88UqXp3erNcac=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] SUPPORT.md: Update release notes URL
Message-Id: <E1r3yCX-00076U-TI@xenbits.xenproject.org>
Date: Fri, 17 Nov 2023 12:44:01 +0000

commit d75f1e9b74314cea91ce435730d4e3539ecca77d
Author:     Julien Grall <julien@xen.org>
AuthorDate: Thu Nov 16 21:44:21 2023 +0000
Commit:     Julien Grall <julien@xen.org>
CommitDate: Thu Nov 16 21:44:21 2023 +0000

    SUPPORT.md: Update release notes URL
    
    Signed-off-by: Julien Grall <julien@xen.org>
---
 SUPPORT.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index 75917e7a58..30ca5b15ed 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -15,7 +15,7 @@ for the definitions of the support status levels etc.
     Security-Support-Until: 2026-11-16
 
 Release Notes
-: <a href="https://wiki.xenproject.org/wiki/Xen_Project_X.YY_Release_Notes">RN</a>
+: <a href="https://wiki.xenproject.org/wiki/Xen_Project_4.18_Release_Notes">RN</a>
 
 # Feature Support
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Nov 17 23:44:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Nov 2023 23:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.635453.991329 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r48VG-00017P-Mt; Fri, 17 Nov 2023 23:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 635453.991329; Fri, 17 Nov 2023 23:44:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r48VG-00017H-KF; Fri, 17 Nov 2023 23:44:02 +0000
Received: by outflank-mailman (input) for mailman id 635453;
 Fri, 17 Nov 2023 23:44:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r48VF-00017B-JC
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 23:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r48VF-00042t-H8
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 23:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r48VF-0006Se-G1
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 23: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=wBwfPOEdpNpCD2Q90SdMpOl5mbnAHuXv0KpT6i33lg4=; b=zvUde9QHLS4+fmgjrIQ1fwE5rd
	Q3AaU/4MJ82U5e7HlL8qbp3XRPQqQHx/MpPnSC/bELJJ1UvS/hkzpVNIqzSX+Xdl98gaPgcuST5Hv
	cdyhIKT+Onm5ISdAWiPctlbpb8OifOh5mxAW9HZFx8i7bKRkXGOYnwimqVIraZDASIMA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Skip memory nodes if not enabled
Message-Id: <E1r48VF-0006Se-G1@xenbits.xenproject.org>
Date: Fri, 17 Nov 2023 23:44:01 +0000

commit c419d2dd351c170ab7b44459b7f121599b23293d
Author:     Leo Yan <leo.yan@linaro.org>
AuthorDate: Fri Oct 13 20:04:42 2023 +0800
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Nov 16 13:58:35 2023 +0000

    xen/arm: Skip memory nodes if not enabled
    
    Currently, Xen doesn't check the status property of memory/reserved
    memory nodes, which may lead to the following issues:
    
    - If a memory node has a status "disabled" it implies that it should
      not be used. Xen does not handle the status property for the memory
      node and ends up using it.
    
    - If a reserved memory node has a status "disabled", it means that this
      region is no longer reserved and can be used, but the "disabled"
      status is not handled by Xen.
    
      Xen passes the intact device tree binding of the reserved memory nodes
      to Dom0 and creates a memory node to cover reserved regions. Disabled
      reserved memory nodes are ignored by the Dom0 Linux kernel, thus the
      Dom0 Linux kernel will continue to allocate pages from such a region.
    
      On the other hand, since the disabled status is not handled by Xen,
      the disabled reserved memory regions are excluded from the page
      management in Xen which results in Xen being unable to obtain the
      corresponding MFN, in the end, Xen reports error like:
    
      (XEN) arch/arm/p2m.c:2202: d0v0: Failing to acquire the MFN 0x1a02dc
    
    This patch introduces a function device_tree_node_is_available(). If it
    detects a memory node is not enabled, Xen will not add the memory region
    into the memory lists. In the end, this avoids to generate the memory
    node for the disabled memory regions sent to the kernel and the kernel
    cannot use the disabled memory nodes any longer.
    
    Since this patch adds checking device node's status in the
    device_tree_get_meminfo() function, except it checks for memory nodes
    and reserved memory nodes, it also supports status for static memory
    and static heap.
    
    Suggested-by: Michal Orzel <michal.orzel@amd.com>
    Signed-off-by: Leo Yan <leo.yan@linaro.org>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/bootfdt.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
index 2673ad17a1..d73f8e4971 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/arch/arm/bootfdt.c
@@ -16,6 +16,24 @@
 #include <xsm/xsm.h>
 #include <asm/setup.h>
 
+static bool __init device_tree_node_is_available(const void *fdt, int node)
+{
+    const char *status;
+    int len;
+
+    status = fdt_getprop(fdt, node, "status", &len);
+    if ( !status )
+        return true;
+
+    if ( len > 0 )
+    {
+        if ( !strcmp(status, "ok") || !strcmp(status, "okay") )
+            return true;
+    }
+
+    return false;
+}
+
 static bool __init device_tree_node_matches(const void *fdt, int node,
                                             const char *match)
 {
@@ -97,6 +115,9 @@ static int __init device_tree_get_meminfo(const void *fdt, int node,
     paddr_t start, size;
     struct meminfo *mem = data;
 
+    if ( !device_tree_node_is_available(fdt, node) )
+        return 0;
+
     if ( address_cells < 1 || size_cells < 1 )
     {
         printk("fdt: property `%s': invalid #address-cells or #size-cells",
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 17 23:44:12 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Nov 2023 23:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.635454.991332 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r48VQ-00018x-OI; Fri, 17 Nov 2023 23:44:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 635454.991332; Fri, 17 Nov 2023 23:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r48VQ-00018q-Ll; Fri, 17 Nov 2023 23:44:12 +0000
Received: by outflank-mailman (input) for mailman id 635454;
 Fri, 17 Nov 2023 23:44:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r48VP-00018k-MI
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 23:44:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r48VP-00043E-KG
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 23:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r48VP-0006T5-JF
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 23:44:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Q7g95ecGde5lWw+wN6E3xsZ+ReVx61BPzkQUlWtEiAw=; b=2gxm2AhLJgvoYcwtDM3jM+467u
	j8I5ERuyUvvEyTt/xhwNCnQBu4bMv8FHf1iss6WJyUvUf7LJCKPEGw2+mVjIvOGJdtZKJ7zO/3AfC
	kjUmRFMAJzAZT7ZGB4eEKv96EM0W/ZA3xOaYbarO2xMLYErEDy2d5Am4RQIY9o75ZtHA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm64: head: only use the macro load_paddr() in the MMU code
Message-Id: <E1r48VP-0006T5-JF@xenbits.xenproject.org>
Date: Fri, 17 Nov 2023 23:44:11 +0000

commit 046f13a2b3b4f66a10cc395d45bcf8dc6793f537
Author:     Julien Grall <julien@xen.org>
AuthorDate: Tue Oct 17 13:52:19 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Nov 16 14:03:19 2023 +0000

    xen/arm64: head: only use the macro load_paddr() in the MMU code
    
    The macro load_paddr() requires to know the offset between the
    physical location of Xen and the virtual location.
    
    When using the MPU, x20 will always be 0. Rather than wasting
    a register for a compile-time constant value, it would be best if
    we can avoid using load_paddr() altogether in the common head.S code.
    
    The current use of load_paddr() are equivalent to adr_l() because
    the MMU is off.
    
    All the use of load_paddr() in arm64/head.S are now replaced with
    adr_l(). With that, load_paddr() can now be moved in arm64/mmu/head.S.
    
    For now, x20 is still unconditionally set. But this could change
    in the future if needed.
    
    Signed-off-by: Julien Grall <julien@xen.org>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/arm64/head.S               | 4 ++--
 xen/arch/arm/arm64/mmu/head.S           | 6 ++++++
 xen/arch/arm/include/asm/arm64/macros.h | 6 ------
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index 4ad85dcf58..8dbd3300d8 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -259,7 +259,7 @@ real_start_efi:
 
         /* Using the DTB in the .dtb section? */
 .ifnes CONFIG_DTB_FILE,""
-        load_paddr x21, _sdtb
+        adr_l x21, _sdtb
 .endif
 
         /* Initialize the UART if earlyprintk has been enabled. */
@@ -301,7 +301,7 @@ GLOBAL(init_secondary)
         bic   x24, x0, x13           /* Mask out flags to get CPU ID */
 
         /* Wait here until __cpu_up is ready to handle the CPU */
-        load_paddr x0, smp_up_cpu
+        adr_l x0, smp_up_cpu
         dsb   sy
 2:      ldr   x1, [x0]
         cmp   x1, x24
diff --git a/xen/arch/arm/arm64/mmu/head.S b/xen/arch/arm/arm64/mmu/head.S
index 88075ef083..412b28e649 100644
--- a/xen/arch/arm/arm64/mmu/head.S
+++ b/xen/arch/arm/arm64/mmu/head.S
@@ -19,6 +19,12 @@
 #define XEN_FIRST_SLOT      first_table_offset(XEN_VIRT_START)
 #define XEN_SECOND_SLOT     second_table_offset(XEN_VIRT_START)
 
+/* Load the physical address of a symbol into xb */
+.macro load_paddr xb, sym
+        ldr \xb, =\sym
+        add \xb, \xb, x20
+.endm
+
 /*
  * Flush local TLBs
  *
diff --git a/xen/arch/arm/include/asm/arm64/macros.h b/xen/arch/arm/include/asm/arm64/macros.h
index 99c401fcaf..fb9a060249 100644
--- a/xen/arch/arm/include/asm/arm64/macros.h
+++ b/xen/arch/arm/include/asm/arm64/macros.h
@@ -62,12 +62,6 @@
         add  \dst, \dst, :lo12:\sym
 .endm
 
-/* Load the physical address of a symbol into xb */
-.macro load_paddr xb, sym
-        ldr \xb, =\sym
-        add \xb, \xb, x20
-.endm
-
 /*
  * Register aliases.
  */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 17 23:44:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Nov 2023 23:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.635455.991337 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r48Vb-0001BQ-Pt; Fri, 17 Nov 2023 23:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 635455.991337; Fri, 17 Nov 2023 23: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 1r48Vb-0001BI-NE; Fri, 17 Nov 2023 23:44:23 +0000
Received: by outflank-mailman (input) for mailman id 635455;
 Fri, 17 Nov 2023 23:44:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r48VZ-0001B7-PW
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 23:44:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r48VZ-00043L-O2
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 23:44:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r48VZ-0006Tc-MG
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 23:44:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CCGUTzQgXrq2hbPwjcdL8OBcD0F0wYC6fQ3BN9nCfVA=; b=14Dw199cYyG4E3PwLORYVqhYoL
	6aFyatBCSqHd9LzQkl3pxYIbr/dZ928GMG/ei7krY977YHBC+b4E052sGfNGUWL814SkBfs9ZNCrM
	saXJObA9zsZjrwSBXR17C4n0x7C9Z7jgd6qbvN7U6QHkibHhhiNLZL2zYq6MLhF+QkqA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm32: head: Replace load_paddr with adr_l when they are equivalent
Message-Id: <E1r48VZ-0006Tc-MG@xenbits.xenproject.org>
Date: Fri, 17 Nov 2023 23:44:21 +0000

commit 9b807e23e7c5337f21f502ba26cf3262876dd431
Author:     Ayan Kumar Halder <ayan.kumar.halder@amd.com>
AuthorDate: Fri Oct 27 19:07:15 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Nov 16 14:06:38 2023 +0000

    xen/arm32: head: Replace load_paddr with adr_l when they are equivalent
    
    Before the MMU is turned on, PC uses physical address. Thus, one can use adr_l
    instead of load_paddr to obtain the physical address of a symbol.
    
    The only exception (for this replacement) is create_table_entry() which is
    called before and after MMU is turned on.
    
    Also, in lookup_processor_type() "r10" is no longer used. The reason being
    __lookup_processor_type uses adr_l (thus r10 is no longer used to obtain the
    physical address offset). Consequently, there is no need to save/restore r10.
    
    Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    [jgrall: Reword comment on top of __lookup_processor_type]
    Signed-off-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/arm32/head.S | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index 33b038e7e0..1fcc6f745e 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -171,7 +171,7 @@ past_zImage:
 
         /* Using the DTB in the .dtb section? */
 .ifnes CONFIG_DTB_FILE,""
-        load_paddr r8, _sdtb
+        adr_l r8, _sdtb
 .endif
 
         /* Initialize the UART if earlyprintk has been enabled. */
@@ -213,7 +213,7 @@ GLOBAL(init_secondary)
         mrc   CP32(r1, MPIDR)
         bic   r7, r1, #(~MPIDR_HWID_MASK) /* Mask out flags to get CPU ID */
 
-        load_paddr r0, smp_up_cpu
+        adr_l r0, smp_up_cpu
         dsb
 2:      ldr   r1, [r0]
         cmp   r1, r7
@@ -479,7 +479,7 @@ create_page_tables:
          * create_table_entry_paddr() will clobber the register storing
          * the physical address of the table to point to.
          */
-        load_paddr r5, boot_third
+        adr_l r5, boot_third
         mov_w r4, XEN_VIRT_START
 .rept XEN_NR_ENTRIES(2)
         mov   r0, r5                        /* r0 := paddr(l3 table) */
@@ -578,7 +578,7 @@ enable_mmu:
         flush_xen_tlb_local r0
 
         /* Write Xen's PT's paddr into the HTTBR */
-        load_paddr r0, boot_pgtable
+        adr_l r0, boot_pgtable
         mov   r1, #0                 /* r0:r1 is paddr (boot_pagetable) */
         mcrr  CP64(r0, r1, HTTBR)
         isb
@@ -876,11 +876,10 @@ putn:   mov   pc, lr
 
 /* This provides a C-API version of __lookup_processor_type */
 ENTRY(lookup_processor_type)
-        stmfd sp!, {r4, r10, lr}
-        mov   r10, #0                   /* r10 := offset between virt&phys */
+        stmfd sp!, {r4, lr}
         bl    __lookup_processor_type
         mov r0, r1
-        ldmfd sp!, {r4, r10, pc}
+        ldmfd sp!, {r4, pc}
 
 /*
  *  Read processor ID register (CP#15, CR0), and Look up in the linker-built
@@ -888,8 +887,6 @@ ENTRY(lookup_processor_type)
  * the __proc_info lists since we aren't running with the MMU on (and therefore,
  * we are not in correct address space). We have to calculate the offset.
  *
- * r10: offset between virt&phys
- *
  * Returns:
  * r0: CPUID
  * r1: proc_info pointer
@@ -897,8 +894,8 @@ ENTRY(lookup_processor_type)
  */
 __lookup_processor_type:
         mrc   CP32(r0, MIDR)                /* r0 := our cpu id */
-        load_paddr r1, __proc_info_start
-        load_paddr r2, __proc_info_end
+        adr_l r1, __proc_info_start
+        adr_l r2, __proc_info_end
 1:      ldr   r3, [r1, #PROCINFO_cpu_mask]
         and   r4, r0, r3                    /* r4 := our cpu id with mask */
         ldr   r3, [r1, #PROCINFO_cpu_val]   /* r3 := cpu val in current proc info */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 17 23:44:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Nov 2023 23:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.635456.991341 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r48Vl-0001EN-R6; Fri, 17 Nov 2023 23:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 635456.991341; Fri, 17 Nov 2023 23: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 1r48Vl-0001EF-OY; Fri, 17 Nov 2023 23:44:33 +0000
Received: by outflank-mailman (input) for mailman id 635456;
 Fri, 17 Nov 2023 23:44:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r48Vj-0001Di-SJ
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 23:44:31 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r48Vj-00043S-R6
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 23:44:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r48Vj-0006U5-Q1
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 23:44:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=x++TZBpbWx5H0F7JqfxAjdXwBWTE+hQRSrYgN67/A7s=; b=4UgusG2ZzfphwhUvWOxRaBUfRW
	mWTKAY8guOj2fkZfwknsrAuKPMA07Oc0VdFyxgz6kL3aj9Cn7SVp9xGJlvm7Y2/5tJoryPgStcQMg
	6ijiRiWNoVCeDm5S5LA6o2+Zs0Ny9OE8TSIY+d6DSI2DNC+jZ5F2ZRwnFNHragDcjUoQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm32: head: Add missing hunk from previous commit
Message-Id: <E1r48Vj-0006U5-Q1@xenbits.xenproject.org>
Date: Fri, 17 Nov 2023 23:44:31 +0000

commit 9dfcef827c115e1c4f92035d43523f3af612dbe7
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Thu Nov 16 14:15:33 2023 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Nov 16 14:15:34 2023 +0000

    arm32: head: Add missing hunk from previous commit
    
    The documentation change was meant to be part of 9b807e23e7c5
    ("xen/arm32: head: Replace load_paddr with adr_l when they are
    equivalent") but was missed when preparing to commit.
    
    So add it separately.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/arm32/head.S | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index 1fcc6f745e..bbbdf7daf8 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -882,10 +882,8 @@ ENTRY(lookup_processor_type)
         ldmfd sp!, {r4, pc}
 
 /*
- *  Read processor ID register (CP#15, CR0), and Look up in the linker-built
- * supported processor list. Note that we can't use the absolute addresses for
- * the __proc_info lists since we aren't running with the MMU on (and therefore,
- * we are not in correct address space). We have to calculate the offset.
+ * Read processor ID register (CP#15, CR0), and Look up in the linker-built
+ * supported processor list.
  *
  * Returns:
  * r0: CPUID
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 17 23:44:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Nov 2023 23:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.635457.991345 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r48Vv-0001HD-Sc; Fri, 17 Nov 2023 23:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 635457.991345; Fri, 17 Nov 2023 23: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 1r48Vv-0001H5-Pw; Fri, 17 Nov 2023 23:44:43 +0000
Received: by outflank-mailman (input) for mailman id 635457;
 Fri, 17 Nov 2023 23:44:41 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r48Vt-0001Gx-Uf
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 23:44:41 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r48Vt-00043c-Ts
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 23:44:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r48Vt-0006Uh-T4
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 23:44:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3TY/fM9eL6BtEU+dsi6JnTCBvJ2i4oWppVmqSERxTr8=; b=B83xD3mxANzC2D4jlUeOYtMVDU
	fUI/6YUSWsb+7DV76/hx2o6OgAZj+Vmc1B9eprAnRhvpjE+EGBQHhELJldcCz+tXFCU19bqhz+shZ
	GnH/gxNDBQ5FLJ9CDOqh4zjbLceZv/S5WjL+Wbuj3/+47837SQhvdZHFRfh/GxdA6474=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Add macro XEN_VM_MAPPING
Message-Id: <E1r48Vt-0006Uh-T4@xenbits.xenproject.org>
Date: Fri, 17 Nov 2023 23:44:41 +0000

commit 02df8ada5a3f9b38aa8c28367b0ce35491ca55b0
Author:     Leo Yan <leo.yan@linaro.org>
AuthorDate: Fri Oct 13 20:26:57 2023 +0800
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Nov 16 14:17:22 2023 +0000

    xen/arm: Add macro XEN_VM_MAPPING
    
    Xen maps the virtual memory space starting from L0 slot 4, so it's open
    coded for macros with the offset '4'.
    
    For more readable, add a new macro XEN_VM_MAPPING which defines the
    start slot for Xen virtual memory mapping, and all virtual memory
    regions are defined based on it.
    
    Acked-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 xen/arch/arm/include/asm/mmu/layout.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/include/asm/mmu/layout.h b/xen/arch/arm/include/asm/mmu/layout.h
index da6be276ac..2cb2382fbf 100644
--- a/xen/arch/arm/include/asm/mmu/layout.h
+++ b/xen/arch/arm/include/asm/mmu/layout.h
@@ -49,11 +49,14 @@
 #define XEN_VIRT_START          _AT(vaddr_t, MB(2))
 #else
 
+#define IDENTITY_MAPPING_AREA_NR_L0     4
+#define XEN_VM_MAPPING                  SLOT0(IDENTITY_MAPPING_AREA_NR_L0)
+
 #define SLOT0_ENTRY_BITS  39
 #define SLOT0(slot) (_AT(vaddr_t,slot) << SLOT0_ENTRY_BITS)
 #define SLOT0_ENTRY_SIZE  SLOT0(1)
 
-#define XEN_VIRT_START          (SLOT0(4) + _AT(vaddr_t, MB(2)))
+#define XEN_VIRT_START          (XEN_VM_MAPPING + _AT(vaddr_t, MB(2)))
 #endif
 
 /*
@@ -116,12 +119,10 @@
 
 #else /* ARM_64 */
 
-#define IDENTITY_MAPPING_AREA_NR_L0  4
-
-#define VMAP_VIRT_START  (SLOT0(4) + GB(1))
+#define VMAP_VIRT_START  (XEN_VM_MAPPING + GB(1))
 #define VMAP_VIRT_SIZE   GB(1)
 
-#define FRAMETABLE_VIRT_START  (SLOT0(4) + GB(32))
+#define FRAMETABLE_VIRT_START  (XEN_VM_MAPPING + GB(32))
 #define FRAMETABLE_SIZE        GB(32)
 #define FRAMETABLE_NR          (FRAMETABLE_SIZE / sizeof(*frame_table))
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 17 23:44:53 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Nov 2023 23:44:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.635458.991348 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r48W5-0001K1-Tz; Fri, 17 Nov 2023 23:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 635458.991348; Fri, 17 Nov 2023 23: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 1r48W5-0001Ju-RO; Fri, 17 Nov 2023 23:44:53 +0000
Received: by outflank-mailman (input) for mailman id 635458;
 Fri, 17 Nov 2023 23:44:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r48W4-0001JQ-1t
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 23:44:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r48W4-00043j-0Q
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 23:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r48W3-0006VS-Vq
 for xen-changelog@lists.xenproject.org; Fri, 17 Nov 2023 23:44:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hLH6KfPC8ej/x934LXIO2TsoM34jM7XhJ4c5dOgX1eI=; b=qApjL4iXk/EFfkgy+9N1JpwwYV
	fbYa3iFd/ReNh2CKqjJ68FPN42TVSyrvQuqDTSk4k8F++4xPvqxJF/pzUfVqZRz636oqlsCPu53gf
	y0axnXhgarnV5J14yn/1LPa0eh7Tqk8VlYufa0BW7nQmV5YZxw8Xs9M0ykLhbuF88Svk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Enlarge identity map space to 10TB
Message-Id: <E1r48W3-0006VS-Vq@xenbits.xenproject.org>
Date: Fri, 17 Nov 2023 23:44:51 +0000

commit 6cd046c501bce48cdc42f597fc7a023aa08853e7
Author:     Leo Yan <leo.yan@linaro.org>
AuthorDate: Fri Oct 13 20:26:58 2023 +0800
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Nov 16 14:17:22 2023 +0000

    xen/arm: Enlarge identity map space to 10TB
    
    On ADLink AVA platform (Ampere Altra SoC with 32 Arm Neoverse N1 cores),
    the physical memory regions are:
    
      DRAM memory regions:
        Node[0] Region[0]: 0x000080000000 - 0x0000ffffffff
        Node[0] Region[1]: 0x080000000000 - 0x08007fffffff
        Node[0] Region[2]: 0x080100000000 - 0x0807ffffffff
    
    The UEFI loads Xen hypervisor and DTB into the high memory, the kernel
    and ramdisk images are loaded into the low memory space:
    
      (XEN) MODULE[0]: 00000807f6df0000 - 00000807f6f3e000 Xen
      (XEN) MODULE[1]: 00000807f8054000 - 00000807f8056000 Device Tree
      (XEN) MODULE[2]: 00000000fa834000 - 00000000fc5de1d5 Ramdisk
      (XEN) MODULE[3]: 00000000fc5df000 - 00000000ffb3f810 Kernel
    
    In this case, the Xen binary is loaded above 8TB, which exceeds the
    maximum supported identity map space of 2TB in Xen. Consequently, the
    system fails to boot.
    
    This patch enlarges identity map space to 10TB, allowing module loading
    within the range of [0x0 .. 0x000009ff_ffff_ffff].
    
    Fixes: 1c78d76b67 ("xen/arm64: mm: Introduce helpers to prepare/enable/disable")
    Reported-by: Alexey Klimov <alexey.klimov@linaro.org>
    Signed-off-by: Leo Yan <leo.yan@linaro.org>
    Tested-by: Henry Wang <Henry.Wang@arm.com>
    Release-acked-by: Henry Wang <Henry.Wang@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/arm64/mm.c               | 6 ++++--
 xen/arch/arm/include/asm/mmu/layout.h | 8 ++++----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/arm64/mm.c b/xen/arch/arm/arm64/mm.c
index 78b7c7eb00..cb69df0661 100644
--- a/xen/arch/arm/arm64/mm.c
+++ b/xen/arch/arm/arm64/mm.c
@@ -41,7 +41,8 @@ static void __init prepare_boot_identity_mapping(void)
     clear_page(boot_third_id);
 
     if ( id_offsets[0] >= IDENTITY_MAPPING_AREA_NR_L0 )
-        panic("Cannot handle ID mapping above 2TB\n");
+        panic("Cannot handle ID mapping above %uTB\n",
+              IDENTITY_MAPPING_AREA_NR_L0 >> 1);
 
     /* Link first ID table */
     pte = mfn_to_xen_entry(virt_to_mfn(boot_first_id), MT_NORMAL);
@@ -74,7 +75,8 @@ static void __init prepare_runtime_identity_mapping(void)
     DECLARE_OFFSETS(id_offsets, id_addr);
 
     if ( id_offsets[0] >= IDENTITY_MAPPING_AREA_NR_L0 )
-        panic("Cannot handle ID mapping above 2TB\n");
+        panic("Cannot handle ID mapping above %uTB\n",
+              IDENTITY_MAPPING_AREA_NR_L0 >> 1);
 
     /* Link first ID table */
     pte = pte_of_xenaddr((vaddr_t)xen_first_id);
diff --git a/xen/arch/arm/include/asm/mmu/layout.h b/xen/arch/arm/include/asm/mmu/layout.h
index 2cb2382fbf..eac7eef885 100644
--- a/xen/arch/arm/include/asm/mmu/layout.h
+++ b/xen/arch/arm/include/asm/mmu/layout.h
@@ -19,11 +19,11 @@
  *   2G -   4G   Domheap: on-demand-mapped
  *
  * ARM64 layout:
- * 0x0000000000000000 - 0x000001ffffffffff (2TB, L0 slots [0..3])
+ * 0x0000000000000000 - 0x000009ffffffffff (10TB, L0 slots [0..19])
  *
  *  Reserved to identity map Xen
  *
- * 0x0000020000000000 - 0x0000027fffffffff (512GB, L0 slot [4])
+ * 0x00000a0000000000 - 0x00000a7fffffffff (512GB, L0 slot [20])
  *  (Relative offsets)
  *   0  -   2M   Unmapped
  *   2M -  10M   Xen text, data, bss
@@ -35,7 +35,7 @@
  *
  *  32G -  64G   Frametable: 56 bytes per page for 2TB of RAM
  *
- * 0x0000028000000000 - 0x00007fffffffffff (125TB, L0 slots [5..255])
+ * 0x00000a8000000000 - 0x00007fffffffffff (512GB+117TB, L0 slots [21..255])
  *  Unused
  *
  * 0x0000800000000000 - 0x000084ffffffffff (5TB, L0 slots [256..265])
@@ -49,7 +49,7 @@
 #define XEN_VIRT_START          _AT(vaddr_t, MB(2))
 #else
 
-#define IDENTITY_MAPPING_AREA_NR_L0     4
+#define IDENTITY_MAPPING_AREA_NR_L0     20
 #define XEN_VM_MAPPING                  SLOT0(IDENTITY_MAPPING_AREA_NR_L0)
 
 #define SLOT0_ENTRY_BITS  39
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 18 09:33:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Nov 2023 09:33:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.635666.991583 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r4HhG-0005Ov-Ug; Sat, 18 Nov 2023 09:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 635666.991583; Sat, 18 Nov 2023 09:33: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 1r4HhG-0005On-Ry; Sat, 18 Nov 2023 09:33:02 +0000
Received: by outflank-mailman (input) for mailman id 635666;
 Sat, 18 Nov 2023 09: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 1r4HhG-0005Oh-2B
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 09: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 1r4HhF-0006sc-UC
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 09:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r4HhF-0005dp-Sm
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 09: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=tEqGZySRp7NJ2MhGKhZo3BM4qOPwGLoXTJcLgS/xEYw=; b=ktAyTERWUm5Z1zFbC+atQ17MsO
	gzWeGbcHK/B8q9W++587gOPycnzlGDgMOoLRRL4yjM/qbTy3uOpxrKpzKdGXmT5cbUMfq+k+m6t5T
	7j4sJ4pxXZA7wWp//A6lxUle+zXNBhhV+hheY0TP2gK3PX7YvPWflsaaLBNMbK4g3kVo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xenstored: print domain id in traces
Message-Id: <E1r4HhF-0005dp-Sm@xenbits.xenproject.org>
Date: Sat, 18 Nov 2023 09:33:01 +0000

commit 97f8555acbf3da013ed713ca0bbe739d41c48da9
Author:     Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
AuthorDate: Thu Nov 16 20:56:45 2023 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Nov 17 18:34:19 2023 +0000

    xenstored: print domain id in traces
    
    It is very helpful to see domain id why analyzing xenstored
    traces. Especially when you are trying to understand which exactly
    domain performs an action.
    
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    [jgrall: Use %u rather than %d]
    Signed-off-by: Julien Grall <jgrall@amazon.com>
---
 tools/xenstored/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index edd07711db..311764eb0c 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -135,8 +135,8 @@ static void trace_io(const struct connection *conn,
 	now = time(NULL);
 	tm = localtime(&now);
 
-	trace("io: %s %p %04d%02d%02d %02d:%02d:%02d %s (",
-	      out ? "OUT" : "IN", conn,
+	trace("io: %s %p (d%d) %04d%02d%02d %02d:%02d:%02d %s (",
+	      out ? "OUT" : "IN", conn, conn->id,
 	      tm->tm_year + 1900, tm->tm_mon + 1,
 	      tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec,
 	      sockmsg_string(data->hdr.msg.type));
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 18 19:00:10 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Nov 2023 19:00:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.635808.991607 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r4QXz-0000Fo-B1; Sat, 18 Nov 2023 19:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 635808.991607; Sat, 18 Nov 2023 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 1r4QXz-0000FK-89; Sat, 18 Nov 2023 19:00:03 +0000
Received: by outflank-mailman (input) for mailman id 635808;
 Sat, 18 Nov 2023 19:00: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 1r4QXx-0008Qh-S5
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:00: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 1r4QXx-0001Ja-PU
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r4QXx-0000nQ-OS
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19: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=0sdhAK7Q+stAHzcqHKl9shBnnsmX7KgxCGBwm06xiMc=; b=oIjQByY/WZs8VUuIQ14aOfhDdQ
	Qd0OIsR024zP9gELGliMTmco4+lA15Q5oM8vP4O0NajWo5CfhZjqTJZHoL8uh3RCGEV/KoAVFisf0
	IX0XUybktg7gsq765D0czU4RKqwXG+HFDG3ak2JCvFQTDAPjE7acxtKNDao1Tl60tePg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/vmx: address violations of MISRA C:2012 Rule 7.2
Message-Id: <E1r4QXx-0000nQ-OS@xenbits.xenproject.org>
Date: Sat, 18 Nov 2023 19:00:01 +0000

commit ee7bab79123c244ee6de64e7643298c7ed348f9e
Author:     Gianluca Luparini <gianluca.luparini@bugseng.com>
AuthorDate: Thu Oct 19 15:11:50 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Nov 17 17:58:52 2023 -0800

    x86/vmx: address violations of MISRA C:2012 Rule 7.2
    
    The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
    headline states:
    "A 'u' or 'U' suffix shall be applied to all integer constants
    that are represented in an unsigned type".
    
    Add the 'U' suffix to integers literals with unsigned type.
    
    For the sake of uniformity, the following changes are made:
    - add the 'U' suffix to macros near
      'CPU_BASED_ACTIVATE_SECONDARY_CONTROLS' and
      'SECONDARY_EXEC_NOTIFY_VM_EXITING' macros in 'vmcs.h'
    - add the 'U' suffix to macros near 'INTR_INFO_VALID_MASK'
      macro in 'vmx.h'
    
    Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
    Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/vpmu_intel.c           |  2 +-
 xen/arch/x86/hvm/vmx/vmcs.c             |  6 +--
 xen/arch/x86/hvm/vmx/vvmx.c             |  8 ++--
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h | 84 ++++++++++++++++-----------------
 xen/arch/x86/include/asm/hvm/vmx/vmx.h  | 16 +++----
 5 files changed, 58 insertions(+), 58 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index fa5b40c65c..6330c89b47 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -945,7 +945,7 @@ const struct arch_vpmu_ops *__init core2_vpmu_init(void)
     fixed_counters_mask = ~((1ull << core2_get_bitwidth_fix_count()) - 1);
     global_ctrl_mask = ~((((1ULL << fixed_pmc_cnt) - 1) << 32) |
                          ((1ULL << arch_pmc_cnt) - 1));
-    global_ovf_ctrl_mask = ~(0xC000000000000000 |
+    global_ovf_ctrl_mask = ~(0xC000000000000000ULL |
                              (((1ULL << fixed_pmc_cnt) - 1) << 32) |
                              ((1ULL << arch_pmc_cnt) - 1));
     if ( version > 2 )
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 13719cc923..6cefb88aec 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -911,7 +911,7 @@ void vmx_clear_msr_intercept(struct vcpu *v, unsigned int msr,
         if ( type & VMX_MSR_W )
             clear_bit(msr, msr_bitmap->write_low);
     }
-    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
+    else if ( (msr >= 0xc0000000U) && (msr <= 0xc0001fffU) )
     {
         msr &= 0x1fff;
         if ( type & VMX_MSR_R )
@@ -939,7 +939,7 @@ void vmx_set_msr_intercept(struct vcpu *v, unsigned int msr,
         if ( type & VMX_MSR_W )
             set_bit(msr, msr_bitmap->write_low);
     }
-    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
+    else if ( (msr >= 0xc0000000U) && (msr <= 0xc0001fffU) )
     {
         msr &= 0x1fff;
         if ( type & VMX_MSR_R )
@@ -957,7 +957,7 @@ bool vmx_msr_is_intercepted(struct vmx_msr_bitmap *msr_bitmap,
     if ( msr <= 0x1fff )
         return test_bit(msr, is_write ? msr_bitmap->write_low
                                       : msr_bitmap->read_low);
-    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
+    else if ( (msr >= 0xc0000000U) && (msr <= 0xc0001fffU) )
         return test_bit(msr & 0x1fff, is_write ? msr_bitmap->write_high
                                                : msr_bitmap->read_high);
     else
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 16b0ef82b6..b7be424afb 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -263,7 +263,7 @@ uint64_t get_vvmcs_virtual(void *vvmcs, uint32_t vmcs_encoding)
             res >>= 32;
         break;
     case VVMCS_WIDTH_32:
-        res &= 0xffffffff;
+        res = (uint32_t)res;
         break;
     case VVMCS_WIDTH_NATURAL:
     default:
@@ -315,14 +315,14 @@ void set_vvmcs_virtual(void *vvmcs, uint32_t vmcs_encoding, uint64_t val)
     case VVMCS_WIDTH_64:
         if ( enc.access_type )
         {
-            res &= 0xffffffff;
+            res = (uint32_t)res;
             res |= val << 32;
         }
         else
             res = val;
         break;
     case VVMCS_WIDTH_32:
-        res = val & 0xffffffff;
+        res = (uint32_t)val;
         break;
     case VVMCS_WIDTH_NATURAL:
     default:
@@ -2306,7 +2306,7 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         break;
     case MSR_IA32_VMX_CR0_FIXED1:
         /* allow 0-settings for all bits */
-        data = 0xffffffff;
+        data = 0xffffffffU;
         break;
     case MSR_IA32_VMX_CR4_FIXED0:
         /* VMXE bit must be 1 in VMX operation */
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
index d07fcb2bc9..e056643993 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
@@ -187,27 +187,27 @@ bool_t __must_check vmx_vmcs_try_enter(struct vcpu *v);
 void vmx_vmcs_exit(struct vcpu *v);
 void vmx_vmcs_reload(struct vcpu *v);
 
-#define CPU_BASED_VIRTUAL_INTR_PENDING        0x00000004
-#define CPU_BASED_USE_TSC_OFFSETING           0x00000008
-#define CPU_BASED_HLT_EXITING                 0x00000080
-#define CPU_BASED_INVLPG_EXITING              0x00000200
-#define CPU_BASED_MWAIT_EXITING               0x00000400
-#define CPU_BASED_RDPMC_EXITING               0x00000800
-#define CPU_BASED_RDTSC_EXITING               0x00001000
-#define CPU_BASED_CR3_LOAD_EXITING            0x00008000
-#define CPU_BASED_CR3_STORE_EXITING           0x00010000
-#define CPU_BASED_CR8_LOAD_EXITING            0x00080000
-#define CPU_BASED_CR8_STORE_EXITING           0x00100000
-#define CPU_BASED_TPR_SHADOW                  0x00200000
-#define CPU_BASED_VIRTUAL_NMI_PENDING         0x00400000
-#define CPU_BASED_MOV_DR_EXITING              0x00800000
-#define CPU_BASED_UNCOND_IO_EXITING           0x01000000
-#define CPU_BASED_ACTIVATE_IO_BITMAP          0x02000000
-#define CPU_BASED_MONITOR_TRAP_FLAG           0x08000000
-#define CPU_BASED_ACTIVATE_MSR_BITMAP         0x10000000
-#define CPU_BASED_MONITOR_EXITING             0x20000000
-#define CPU_BASED_PAUSE_EXITING               0x40000000
-#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000
+#define CPU_BASED_VIRTUAL_INTR_PENDING        0x00000004U
+#define CPU_BASED_USE_TSC_OFFSETING           0x00000008U
+#define CPU_BASED_HLT_EXITING                 0x00000080U
+#define CPU_BASED_INVLPG_EXITING              0x00000200U
+#define CPU_BASED_MWAIT_EXITING               0x00000400U
+#define CPU_BASED_RDPMC_EXITING               0x00000800U
+#define CPU_BASED_RDTSC_EXITING               0x00001000U
+#define CPU_BASED_CR3_LOAD_EXITING            0x00008000U
+#define CPU_BASED_CR3_STORE_EXITING           0x00010000U
+#define CPU_BASED_CR8_LOAD_EXITING            0x00080000U
+#define CPU_BASED_CR8_STORE_EXITING           0x00100000U
+#define CPU_BASED_TPR_SHADOW                  0x00200000U
+#define CPU_BASED_VIRTUAL_NMI_PENDING         0x00400000U
+#define CPU_BASED_MOV_DR_EXITING              0x00800000U
+#define CPU_BASED_UNCOND_IO_EXITING           0x01000000U
+#define CPU_BASED_ACTIVATE_IO_BITMAP          0x02000000U
+#define CPU_BASED_MONITOR_TRAP_FLAG           0x08000000U
+#define CPU_BASED_ACTIVATE_MSR_BITMAP         0x10000000U
+#define CPU_BASED_MONITOR_EXITING             0x20000000U
+#define CPU_BASED_PAUSE_EXITING               0x40000000U
+#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000U
 extern u32 vmx_cpu_based_exec_control;
 
 #define PIN_BASED_EXT_INTR_MASK         0x00000001
@@ -238,26 +238,26 @@ extern u32 vmx_vmexit_control;
 #define VM_ENTRY_LOAD_BNDCFGS           0x00010000
 extern u32 vmx_vmentry_control;
 
-#define SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES 0x00000001
-#define SECONDARY_EXEC_ENABLE_EPT               0x00000002
-#define SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING 0x00000004
-#define SECONDARY_EXEC_ENABLE_RDTSCP            0x00000008
-#define SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE   0x00000010
-#define SECONDARY_EXEC_ENABLE_VPID              0x00000020
-#define SECONDARY_EXEC_WBINVD_EXITING           0x00000040
-#define SECONDARY_EXEC_UNRESTRICTED_GUEST       0x00000080
-#define SECONDARY_EXEC_APIC_REGISTER_VIRT       0x00000100
-#define SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY    0x00000200
-#define SECONDARY_EXEC_PAUSE_LOOP_EXITING       0x00000400
-#define SECONDARY_EXEC_ENABLE_INVPCID           0x00001000
-#define SECONDARY_EXEC_ENABLE_VM_FUNCTIONS      0x00002000
-#define SECONDARY_EXEC_ENABLE_VMCS_SHADOWING    0x00004000
-#define SECONDARY_EXEC_ENABLE_PML               0x00020000
-#define SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS   0x00040000
-#define SECONDARY_EXEC_XSAVES                   0x00100000
-#define SECONDARY_EXEC_TSC_SCALING              0x02000000
-#define SECONDARY_EXEC_BUS_LOCK_DETECTION       0x40000000
-#define SECONDARY_EXEC_NOTIFY_VM_EXITING        0x80000000
+#define SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES 0x00000001U
+#define SECONDARY_EXEC_ENABLE_EPT               0x00000002U
+#define SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING 0x00000004U
+#define SECONDARY_EXEC_ENABLE_RDTSCP            0x00000008U
+#define SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE   0x00000010U
+#define SECONDARY_EXEC_ENABLE_VPID              0x00000020U
+#define SECONDARY_EXEC_WBINVD_EXITING           0x00000040U
+#define SECONDARY_EXEC_UNRESTRICTED_GUEST       0x00000080U
+#define SECONDARY_EXEC_APIC_REGISTER_VIRT       0x00000100U
+#define SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY    0x00000200U
+#define SECONDARY_EXEC_PAUSE_LOOP_EXITING       0x00000400U
+#define SECONDARY_EXEC_ENABLE_INVPCID           0x00001000U
+#define SECONDARY_EXEC_ENABLE_VM_FUNCTIONS      0x00002000U
+#define SECONDARY_EXEC_ENABLE_VMCS_SHADOWING    0x00004000U
+#define SECONDARY_EXEC_ENABLE_PML               0x00020000U
+#define SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS   0x00040000U
+#define SECONDARY_EXEC_XSAVES                   0x00100000U
+#define SECONDARY_EXEC_TSC_SCALING              0x02000000U
+#define SECONDARY_EXEC_BUS_LOCK_DETECTION       0x40000000U
+#define SECONDARY_EXEC_NOTIFY_VM_EXITING        0x80000000U
 extern u32 vmx_secondary_exec_control;
 
 #define VMX_EPT_EXEC_ONLY_SUPPORTED                         0x00000001
@@ -346,7 +346,7 @@ extern u64 vmx_ept_vpid_cap;
 #define cpu_has_vmx_notify_vm_exiting \
     (vmx_secondary_exec_control & SECONDARY_EXEC_NOTIFY_VM_EXITING)
 
-#define VMCS_RID_TYPE_MASK              0x80000000
+#define VMCS_RID_TYPE_MASK              0x80000000U
 
 /* GUEST_INTERRUPTIBILITY_INFO flags. */
 #define VMX_INTR_SHADOW_STI             0x00000001
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
index c84acc221d..d4b335a2bc 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
@@ -137,7 +137,7 @@ static inline void pi_clear_sn(struct pi_desc *pi_desc)
 /*
  * Exit Reasons
  */
-#define VMX_EXIT_REASONS_FAILED_VMENTRY 0x80000000
+#define VMX_EXIT_REASONS_FAILED_VMENTRY (1u << 31)
 #define VMX_EXIT_REASONS_BUS_LOCK       (1u << 26)
 
 #define EXIT_REASON_EXCEPTION_NMI       0
@@ -209,12 +209,12 @@ static inline void pi_clear_sn(struct pi_desc *pi_desc)
  * Note INTR_INFO_NMI_UNBLOCKED_BY_IRET is also used with Exit Qualification
  * field for EPT violations, PML full and SPP-related event vmexits.
  */
-#define INTR_INFO_VECTOR_MASK           0xff            /* 7:0 */
-#define INTR_INFO_INTR_TYPE_MASK        0x700           /* 10:8 */
-#define INTR_INFO_DELIVER_CODE_MASK     0x800           /* 11 */
-#define INTR_INFO_NMI_UNBLOCKED_BY_IRET 0x1000          /* 12 */
-#define INTR_INFO_VALID_MASK            0x80000000      /* 31 */
-#define INTR_INFO_RESVD_BITS_MASK       0x7ffff000
+#define INTR_INFO_VECTOR_MASK           0x000000ffU     /* 7:0 */
+#define INTR_INFO_INTR_TYPE_MASK        0x00000700U     /* 10:8 */
+#define INTR_INFO_DELIVER_CODE_MASK     0x00000800U     /* 11 */
+#define INTR_INFO_NMI_UNBLOCKED_BY_IRET 0x00001000U     /* 12 */
+#define INTR_INFO_VALID_MASK            0x80000000U     /* 31 */
+#define INTR_INFO_RESVD_BITS_MASK       0x7ffff000U
 
 /*
  * Exit Qualifications for NOTIFY VM EXIT
@@ -607,7 +607,7 @@ static inline void vmx_pi_hooks_assign(struct domain *d) {}
 static inline void vmx_pi_hooks_deassign(struct domain *d) {}
 #endif
 
-#define APIC_INVALID_DEST           0xffffffff
+#define APIC_INVALID_DEST           0xffffffffU
 
 /* EPT violation qualifications definitions */
 typedef union ept_qual {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 18 19:00:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Nov 2023 19:00:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.635809.991611 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r4QY9-0000jT-Cx; Sat, 18 Nov 2023 19:00:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 635809.991611; Sat, 18 Nov 2023 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 1r4QY9-0000jK-9h; Sat, 18 Nov 2023 19:00:13 +0000
Received: by outflank-mailman (input) for mailman id 635809;
 Sat, 18 Nov 2023 19:00:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r4QY7-0000jE-UD
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:00:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r4QY7-0001K1-TM
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:00:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r4QY7-0000on-S1
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:00:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Po+wpoP9Wghow7k3AUzWyiAFp2WOj8Knqk5D8XoUDAo=; b=00DorV30UeDQBaMJJOFD57j5So
	ZXy/eo+L+Xju/Dcj85JnGCP49cUKSW7kYCZEEzMnP+oZpcIxVXqx5DhNu1Bf3sQ2J+ZqX/EqBX9A6
	ijvXLIMU3AfZjAisxtIjZjcGsfN6TCi+1w2LjqeYu+GCLT6xdajOjPY8LzNB47BTO5YU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvm: address violations of MISRA C:2012 Rule 7.2
Message-Id: <E1r4QY7-0000on-S1@xenbits.xenproject.org>
Date: Sat, 18 Nov 2023 19:00:11 +0000

commit 652683e1aeaa0e5d901a72e5d5f1a73f5b57af64
Author:     Simone Ballarin <simone.ballarin@bugseng.com>
AuthorDate: Thu Oct 19 15:11:51 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Nov 17 17:59:13 2023 -0800

    x86/hvm: address violations of MISRA C:2012 Rule 7.2
    
    The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
    headline states:
    "A 'u' or 'U' suffix shall be applied to all integer constants
    that are represented in an unsigned type".
    
    Add the 'U' suffix to integers literals with unsigned type.
    
    For the sake of uniformity, the following change is made:
    - add 'U' suffixes to 'mask16' in 'stdvga.c'
    
    Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
    Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hypercall.c           |   2 +-
 xen/arch/x86/hvm/pmtimer.c             |   4 +-
 xen/arch/x86/hvm/stdvga.c              |  32 +++---
 xen/arch/x86/hvm/vlapic.c              |   6 +-
 xen/arch/x86/include/asm/apicdef.h     |   2 +-
 xen/arch/x86/include/asm/config.h      |   2 +-
 xen/arch/x86/include/asm/hpet.h        |   2 +-
 xen/arch/x86/include/asm/hvm/trace.h   |   4 +-
 xen/arch/x86/include/asm/hvm/vioapic.h |   2 +-
 xen/arch/x86/include/asm/msi.h         |   2 +-
 xen/arch/x86/include/asm/msr-index.h   | 184 ++++++++++++++++-----------------
 xen/arch/x86/include/asm/pci.h         |   8 +-
 xen/arch/x86/include/asm/x86-defns.h   |  22 ++--
 13 files changed, 136 insertions(+), 136 deletions(-)

diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index 20d266ffd5..eeb73e1aa5 100644
--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen/arch/x86/hvm/hypercall.c
@@ -129,7 +129,7 @@ int hvm_hypercall(struct cpu_user_regs *regs)
         break;
     }
 
-    if ( (eax & 0x80000000) && is_viridian_domain(currd) )
+    if ( (eax & 0x80000000U) && is_viridian_domain(currd) )
     {
         int ret;
 
diff --git a/xen/arch/x86/hvm/pmtimer.c b/xen/arch/x86/hvm/pmtimer.c
index 2145c531b6..eb4a455763 100644
--- a/xen/arch/x86/hvm/pmtimer.c
+++ b/xen/arch/x86/hvm/pmtimer.c
@@ -40,8 +40,8 @@
 #define SCI_IRQ 9
 
 /* We provide a 32-bit counter (must match the TMR_VAL_EXT bit in the FADT) */
-#define TMR_VAL_MASK  (0xffffffff)
-#define TMR_VAL_MSB   (0x80000000)
+#define TMR_VAL_MASK  (0xffffffffU)
+#define TMR_VAL_MSB   (0x80000000U)
 
 /* Dispatch SCIs based on the PM1a_STS and PM1a_EN registers */
 static void pmt_update_sci(PMTState *s)
diff --git a/xen/arch/x86/hvm/stdvga.c b/xen/arch/x86/hvm/stdvga.c
index 2586891863..8da07ff8a2 100644
--- a/xen/arch/x86/hvm/stdvga.c
+++ b/xen/arch/x86/hvm/stdvga.c
@@ -39,22 +39,22 @@
 
 #define PAT(x) (x)
 static const uint32_t mask16[16] = {
-    PAT(0x00000000),
-    PAT(0x000000ff),
-    PAT(0x0000ff00),
-    PAT(0x0000ffff),
-    PAT(0x00ff0000),
-    PAT(0x00ff00ff),
-    PAT(0x00ffff00),
-    PAT(0x00ffffff),
-    PAT(0xff000000),
-    PAT(0xff0000ff),
-    PAT(0xff00ff00),
-    PAT(0xff00ffff),
-    PAT(0xffff0000),
-    PAT(0xffff00ff),
-    PAT(0xffffff00),
-    PAT(0xffffffff),
+    PAT(0x00000000U),
+    PAT(0x000000ffU),
+    PAT(0x0000ff00U),
+    PAT(0x0000ffffU),
+    PAT(0x00ff0000U),
+    PAT(0x00ff00ffU),
+    PAT(0x00ffff00U),
+    PAT(0x00ffffffU),
+    PAT(0xff000000U),
+    PAT(0xff0000ffU),
+    PAT(0xff00ff00U),
+    PAT(0xff00ffffU),
+    PAT(0xffff0000U),
+    PAT(0xffff00ffU),
+    PAT(0xffffff00U),
+    PAT(0xffffffffU),
 };
 
 /* force some bits to zero */
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index c7ce82d064..a8e87c4446 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -237,7 +237,7 @@ bool_t vlapic_match_dest(
     case APIC_DEST_NOSHORT:
         if ( dest_mode )
             return vlapic_match_logical_addr(target, dest);
-        return (dest == _VLAPIC_ID(target, 0xffffffff)) ||
+        return (dest == _VLAPIC_ID(target, 0xffffffffU)) ||
                (dest == VLAPIC_ID(target));
 
     case APIC_DEST_SELF:
@@ -467,7 +467,7 @@ static bool_t is_multicast_dest(struct vlapic *vlapic, unsigned int short_hand,
         return short_hand != APIC_DEST_SELF;
 
     if ( vlapic_x2apic_mode(vlapic) )
-        return dest_mode ? hweight16(dest) > 1 : dest == 0xffffffff;
+        return dest_mode ? hweight16(dest) > 1 : dest == 0xffffffffU;
 
     if ( dest_mode )
         return hweight8(dest &
@@ -831,7 +831,7 @@ void vlapic_reg_write(struct vcpu *v, unsigned int reg, uint32_t val)
         break;
 
     case APIC_ICR2:
-        vlapic_set_reg(vlapic, APIC_ICR2, val & 0xff000000);
+        vlapic_set_reg(vlapic, APIC_ICR2, val & 0xff000000U);
         break;
 
     case APIC_LVTT:         /* LVT Timer Reg */
diff --git a/xen/arch/x86/include/asm/apicdef.h b/xen/arch/x86/include/asm/apicdef.h
index a261436993..8d1b0087d4 100644
--- a/xen/arch/x86/include/asm/apicdef.h
+++ b/xen/arch/x86/include/asm/apicdef.h
@@ -8,7 +8,7 @@
  * Ingo Molnar <mingo@redhat.com>, 1999, 2000
  */
 
-#define		APIC_DEFAULT_PHYS_BASE	0xfee00000
+#define		APIC_DEFAULT_PHYS_BASE	0xfee00000U
  
 #define		APIC_ID		0x20
 #define			APIC_ID_MASK		(0xFFu<<24)
diff --git a/xen/arch/x86/include/asm/config.h b/xen/arch/x86/include/asm/config.h
index fbc4bb3416..bbced338be 100644
--- a/xen/arch/x86/include/asm/config.h
+++ b/xen/arch/x86/include/asm/config.h
@@ -257,7 +257,7 @@ extern unsigned char boot_edid_info[128];
 #endif /* CONFIG_PV32 */
 
 #define MACH2PHYS_COMPAT_VIRT_START    HYPERVISOR_COMPAT_VIRT_START
-#define MACH2PHYS_COMPAT_VIRT_END      0xFFE00000
+#define MACH2PHYS_COMPAT_VIRT_END      0xFFE00000U
 #define MACH2PHYS_COMPAT_NR_ENTRIES(d) \
     ((MACH2PHYS_COMPAT_VIRT_END-MACH2PHYS_COMPAT_VIRT_START(d))>>2)
 
diff --git a/xen/arch/x86/include/asm/hpet.h b/xen/arch/x86/include/asm/hpet.h
index 36a848e607..c095b833d4 100644
--- a/xen/arch/x86/include/asm/hpet.h
+++ b/xen/arch/x86/include/asm/hpet.h
@@ -41,7 +41,7 @@
 #define HPET_TN_ROUTE		0x3e00
 #define HPET_TN_FSB		0x4000
 #define HPET_TN_FSB_CAP		0x8000
-#define HPET_TN_RESERVED	0xffff0081
+#define HPET_TN_RESERVED	0xffff0081U
 #define HPET_TN_INT_ROUTE_CAP	(0xffffffffULL << 32)
 
 
diff --git a/xen/arch/x86/include/asm/hvm/trace.h b/xen/arch/x86/include/asm/hvm/trace.h
index 696e42eb94..22eadbdd47 100644
--- a/xen/arch/x86/include/asm/hvm/trace.h
+++ b/xen/arch/x86/include/asm/hvm/trace.h
@@ -58,7 +58,7 @@
 #define DO_TRC_HVM_VLAPIC           DEFAULT_HVM_MISC
 
 
-#define TRC_PAR_LONG(par) ((par)&0xFFFFFFFF),((par)>>32)
+#define TRC_PAR_LONG(par) ((uint32_t)(par)), ((par) >> 32)
 
 #define TRACE_2_LONG_2D(_e, d1, d2, ...) \
     TRACE_4D(_e, d1, d2)
@@ -93,7 +93,7 @@
     HVMTRACE_ND(evt, 0, 0)
 
 #define HVMTRACE_LONG_1D(evt, d1)                  \
-                   HVMTRACE_2D(evt ## 64, (d1) & 0xFFFFFFFF, (d1) >> 32)
+                   HVMTRACE_2D(evt ## 64, (uint32_t)(d1), (d1) >> 32)
 #define HVMTRACE_LONG_2D(evt, d1, d2, ...)              \
                    HVMTRACE_3D(evt ## 64, d1, d2)
 #define HVMTRACE_LONG_3D(evt, d1, d2, d3, ...)      \
diff --git a/xen/arch/x86/include/asm/hvm/vioapic.h b/xen/arch/x86/include/asm/hvm/vioapic.h
index 2944ec20dd..68af6dce79 100644
--- a/xen/arch/x86/include/asm/hvm/vioapic.h
+++ b/xen/arch/x86/include/asm/hvm/vioapic.h
@@ -32,7 +32,7 @@
 #define VIOAPIC_EDGE_TRIG  0
 #define VIOAPIC_LEVEL_TRIG 1
 
-#define VIOAPIC_DEFAULT_BASE_ADDRESS  0xfec00000
+#define VIOAPIC_DEFAULT_BASE_ADDRESS  0xfec00000U
 #define VIOAPIC_MEM_LENGTH            0x100
 
 /* Direct registers. */
diff --git a/xen/arch/x86/include/asm/msi.h b/xen/arch/x86/include/asm/msi.h
index 63582fdea4..c1ece2786e 100644
--- a/xen/arch/x86/include/asm/msi.h
+++ b/xen/arch/x86/include/asm/msi.h
@@ -37,7 +37,7 @@
  */
 
 #define MSI_ADDR_BASE_HI            0
-#define MSI_ADDR_BASE_LO            0xfee00000
+#define MSI_ADDR_BASE_LO            0xfee00000U
 #define MSI_ADDR_BASE_MASK          (~0xfffff)
 #define MSI_ADDR_HEADER             MSI_ADDR_BASE_LO
 
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index 82a81bd0a2..492699c1b4 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -22,7 +22,7 @@
 #define  APIC_BASE_BSP                      (_AC(1, ULL) <<  8)
 #define  APIC_BASE_EXTD                     (_AC(1, ULL) << 10)
 #define  APIC_BASE_ENABLE                   (_AC(1, ULL) << 11)
-#define  APIC_BASE_ADDR_MASK                0x000ffffffffff000ULL
+#define  APIC_BASE_ADDR_MASK                _AC(0x000ffffffffff000, ULL)
 
 #define MSR_TEST_CTRL                       0x00000033
 #define  TEST_CTRL_SPLITLOCK_DETECT         (_AC(1, ULL) << 29)
@@ -30,7 +30,7 @@
 
 #define MSR_INTEL_CORE_THREAD_COUNT         0x00000035
 #define  MSR_CTC_THREAD_MASK                0x0000ffff
-#define  MSR_CTC_CORE_MASK                  0xffff0000
+#define  MSR_CTC_CORE_MASK                  _AC(0xffff0000, U)
 
 #define MSR_SPEC_CTRL                       0x00000048
 #define  SPEC_CTRL_IBRS                     (_AC(1, ULL) <<  0)
@@ -191,7 +191,7 @@
 #define MSR_UARCH_MISC_CTRL                 0x00001b01
 #define  UARCH_CTRL_DOITM                   (_AC(1, ULL) <<  0)
 
-#define MSR_EFER                            0xc0000080 /* Extended Feature Enable Register */
+#define MSR_EFER                            _AC(0xc0000080, U) /* Extended Feature Enable Register */
 #define  EFER_SCE                           (_AC(1, ULL) <<  0) /* SYSCALL Enable */
 #define  EFER_LME                           (_AC(1, ULL) <<  8) /* Long Mode Enable */
 #define  EFER_LMA                           (_AC(1, ULL) << 10) /* Long Mode Active */
@@ -204,35 +204,35 @@
     (EFER_SCE | EFER_LME | EFER_LMA | EFER_NXE | EFER_SVME | EFER_FFXSE | \
      EFER_AIBRSE)
 
-#define MSR_STAR                            0xc0000081 /* legacy mode SYSCALL target */
-#define MSR_LSTAR                           0xc0000082 /* long mode SYSCALL target */
-#define MSR_CSTAR                           0xc0000083 /* compat mode SYSCALL target */
-#define MSR_SYSCALL_MASK                    0xc0000084 /* EFLAGS mask for syscall */
-#define MSR_FS_BASE                         0xc0000100 /* 64bit FS base */
-#define MSR_GS_BASE                         0xc0000101 /* 64bit GS base */
-#define MSR_SHADOW_GS_BASE                  0xc0000102 /* SwapGS GS shadow */
-#define MSR_TSC_AUX                         0xc0000103 /* Auxiliary TSC */
+#define MSR_STAR                            _AC(0xc0000081, U) /* legacy mode SYSCALL target */
+#define MSR_LSTAR                           _AC(0xc0000082, U) /* long mode SYSCALL target */
+#define MSR_CSTAR                           _AC(0xc0000083, U) /* compat mode SYSCALL target */
+#define MSR_SYSCALL_MASK                    _AC(0xc0000084, U) /* EFLAGS mask for syscall */
+#define MSR_FS_BASE                         _AC(0xc0000100, U) /* 64bit FS base */
+#define MSR_GS_BASE                         _AC(0xc0000101, U) /* 64bit GS base */
+#define MSR_SHADOW_GS_BASE                  _AC(0xc0000102, U) /* SwapGS GS shadow */
+#define MSR_TSC_AUX                         _AC(0xc0000103, U) /* Auxiliary TSC */
 
-#define MSR_K8_SYSCFG                       0xc0010010
+#define MSR_K8_SYSCFG                       _AC(0xc0010010, U)
 #define  SYSCFG_MTRR_FIX_DRAM_EN            (_AC(1, ULL) << 18)
 #define  SYSCFG_MTRR_FIX_DRAM_MOD_EN        (_AC(1, ULL) << 19)
 #define  SYSCFG_MTRR_VAR_DRAM_EN            (_AC(1, ULL) << 20)
 #define  SYSCFG_MTRR_TOM2_EN                (_AC(1, ULL) << 21)
 #define  SYSCFG_TOM2_FORCE_WB               (_AC(1, ULL) << 22)
 
-#define MSR_K8_IORR_BASE0                   0xc0010016
-#define MSR_K8_IORR_MASK0                   0xc0010017
-#define MSR_K8_IORR_BASE1                   0xc0010018
-#define MSR_K8_IORR_MASK1                   0xc0010019
+#define MSR_K8_IORR_BASE0                   _AC(0xc0010016, U)
+#define MSR_K8_IORR_MASK0                   _AC(0xc0010017, U)
+#define MSR_K8_IORR_BASE1                   _AC(0xc0010018, U)
+#define MSR_K8_IORR_MASK1                   _AC(0xc0010019, U)
 
-#define MSR_K8_TSEG_BASE                    0xc0010112 /* AMD doc: SMMAddr */
-#define MSR_K8_TSEG_MASK                    0xc0010113 /* AMD doc: SMMMask */
+#define MSR_K8_TSEG_BASE                    _AC(0xc0010112, U) /* AMD doc: SMMAddr */
+#define MSR_K8_TSEG_MASK                    _AC(0xc0010113, U) /* AMD doc: SMMMask */
 
-#define MSR_K8_VM_CR                        0xc0010114
+#define MSR_K8_VM_CR                        _AC(0xc0010114, U)
 #define  VM_CR_INIT_REDIRECTION             (_AC(1, ULL) <<  1)
 #define  VM_CR_SVM_DISABLE                  (_AC(1, ULL) <<  4)
 
-#define MSR_VIRT_SPEC_CTRL                  0xc001011f /* Layout matches MSR_SPEC_CTRL */
+#define MSR_VIRT_SPEC_CTRL                  _AC(0xc001011f, U) /* Layout matches MSR_SPEC_CTRL */
 
 #define MSR_AMD_CSTATE_CFG                  0xc0010296
 
@@ -318,7 +318,7 @@
 #define CMCI_EN 			(1UL<<30)
 #define CMCI_THRESHOLD_MASK		0x7FFF
 
-#define MSR_AMD64_MC0_MASK		0xc0010044
+#define MSR_AMD64_MC0_MASK		0xc0010044U
 
 #define MSR_IA32_MCx_CTL(x)		(MSR_IA32_MC0_CTL + 4*(x))
 #define MSR_IA32_MCx_STATUS(x)		(MSR_IA32_MC0_STATUS + 4*(x))
@@ -350,83 +350,83 @@
 
 /* K7/K8 MSRs. Not complete. See the architecture manual for a more
    complete list. */
-#define MSR_K7_EVNTSEL0			0xc0010000
-#define MSR_K7_PERFCTR0			0xc0010004
-#define MSR_K7_EVNTSEL1			0xc0010001
-#define MSR_K7_PERFCTR1			0xc0010005
-#define MSR_K7_EVNTSEL2			0xc0010002
-#define MSR_K7_PERFCTR2			0xc0010006
-#define MSR_K7_EVNTSEL3			0xc0010003
-#define MSR_K7_PERFCTR3			0xc0010007
-#define MSR_K8_TOP_MEM1			0xc001001a
-#define MSR_K8_TOP_MEM2			0xc001001d
-
-#define MSR_K8_HWCR			0xc0010015
+#define MSR_K7_EVNTSEL0			0xc0010000U
+#define MSR_K7_PERFCTR0			0xc0010004U
+#define MSR_K7_EVNTSEL1			0xc0010001U
+#define MSR_K7_PERFCTR1			0xc0010005U
+#define MSR_K7_EVNTSEL2			0xc0010002U
+#define MSR_K7_PERFCTR2			0xc0010006U
+#define MSR_K7_EVNTSEL3			0xc0010003U
+#define MSR_K7_PERFCTR3			0xc0010007U
+#define MSR_K8_TOP_MEM1			0xc001001aU
+#define MSR_K8_TOP_MEM2			0xc001001dU
+
+#define MSR_K8_HWCR			0xc0010015U
 #define K8_HWCR_TSC_FREQ_SEL		(1ULL << 24)
 #define K8_HWCR_CPUID_USER_DIS		(1ULL << 35)
 
-#define MSR_K7_FID_VID_CTL		0xc0010041
-#define MSR_K7_FID_VID_STATUS		0xc0010042
-#define MSR_K8_PSTATE_LIMIT		0xc0010061
-#define MSR_K8_PSTATE_CTRL		0xc0010062
-#define MSR_K8_PSTATE_STATUS		0xc0010063
-#define MSR_K8_PSTATE0			0xc0010064
-#define MSR_K8_PSTATE1			0xc0010065
-#define MSR_K8_PSTATE2			0xc0010066
-#define MSR_K8_PSTATE3			0xc0010067
-#define MSR_K8_PSTATE4			0xc0010068
-#define MSR_K8_PSTATE5			0xc0010069
-#define MSR_K8_PSTATE6			0xc001006A
-#define MSR_K8_PSTATE7			0xc001006B
-#define MSR_K8_ENABLE_C1E		0xc0010055
-#define MSR_K8_VM_HSAVE_PA		0xc0010117
-
-#define MSR_AMD_FAM15H_EVNTSEL0		0xc0010200
-#define MSR_AMD_FAM15H_PERFCTR0		0xc0010201
-#define MSR_AMD_FAM15H_EVNTSEL1		0xc0010202
-#define MSR_AMD_FAM15H_PERFCTR1		0xc0010203
-#define MSR_AMD_FAM15H_EVNTSEL2		0xc0010204
-#define MSR_AMD_FAM15H_PERFCTR2		0xc0010205
-#define MSR_AMD_FAM15H_EVNTSEL3		0xc0010206
-#define MSR_AMD_FAM15H_PERFCTR3		0xc0010207
-#define MSR_AMD_FAM15H_EVNTSEL4		0xc0010208
-#define MSR_AMD_FAM15H_PERFCTR4		0xc0010209
-#define MSR_AMD_FAM15H_EVNTSEL5		0xc001020a
-#define MSR_AMD_FAM15H_PERFCTR5		0xc001020b
-
-#define MSR_AMD_L7S0_FEATURE_MASK	0xc0011002
-#define MSR_AMD_THRM_FEATURE_MASK	0xc0011003
-#define MSR_K8_FEATURE_MASK		0xc0011004
-#define MSR_K8_EXT_FEATURE_MASK		0xc0011005
+#define MSR_K7_FID_VID_CTL		0xc0010041U
+#define MSR_K7_FID_VID_STATUS		0xc0010042U
+#define MSR_K8_PSTATE_LIMIT		0xc0010061U
+#define MSR_K8_PSTATE_CTRL		0xc0010062U
+#define MSR_K8_PSTATE_STATUS		0xc0010063U
+#define MSR_K8_PSTATE0			0xc0010064U
+#define MSR_K8_PSTATE1			0xc0010065U
+#define MSR_K8_PSTATE2			0xc0010066U
+#define MSR_K8_PSTATE3			0xc0010067U
+#define MSR_K8_PSTATE4			0xc0010068U
+#define MSR_K8_PSTATE5			0xc0010069U
+#define MSR_K8_PSTATE6			0xc001006AU
+#define MSR_K8_PSTATE7			0xc001006BU
+#define MSR_K8_ENABLE_C1E		0xc0010055U
+#define MSR_K8_VM_HSAVE_PA		0xc0010117U
+
+#define MSR_AMD_FAM15H_EVNTSEL0		0xc0010200U
+#define MSR_AMD_FAM15H_PERFCTR0		0xc0010201U
+#define MSR_AMD_FAM15H_EVNTSEL1		0xc0010202U
+#define MSR_AMD_FAM15H_PERFCTR1		0xc0010203U
+#define MSR_AMD_FAM15H_EVNTSEL2		0xc0010204U
+#define MSR_AMD_FAM15H_PERFCTR2		0xc0010205U
+#define MSR_AMD_FAM15H_EVNTSEL3		0xc0010206U
+#define MSR_AMD_FAM15H_PERFCTR3		0xc0010207U
+#define MSR_AMD_FAM15H_EVNTSEL4		0xc0010208U
+#define MSR_AMD_FAM15H_PERFCTR4		0xc0010209U
+#define MSR_AMD_FAM15H_EVNTSEL5		0xc001020aU
+#define MSR_AMD_FAM15H_PERFCTR5		0xc001020bU
+
+#define MSR_AMD_L7S0_FEATURE_MASK	0xc0011002U
+#define MSR_AMD_THRM_FEATURE_MASK	0xc0011003U
+#define MSR_K8_FEATURE_MASK			0xc0011004U
+#define MSR_K8_EXT_FEATURE_MASK		0xc0011005U
 
 /* AMD64 MSRs */
-#define MSR_AMD64_NB_CFG		0xc001001f
+#define MSR_AMD64_NB_CFG		0xc001001fU
 #define AMD64_NB_CFG_CF8_EXT_ENABLE_BIT	46
-#define MSR_AMD64_LS_CFG		0xc0011020
-#define MSR_AMD64_IC_CFG		0xc0011021
-#define MSR_AMD64_DC_CFG		0xc0011022
-#define MSR_AMD64_DE_CFG		0xc0011029
+#define MSR_AMD64_LS_CFG		0xc0011020U
+#define MSR_AMD64_IC_CFG		0xc0011021U
+#define MSR_AMD64_DC_CFG		0xc0011022U
+#define MSR_AMD64_DE_CFG		0xc0011029U
 #define AMD64_DE_CFG_LFENCE_SERIALISE	(_AC(1, ULL) << 1)
-#define MSR_AMD64_EX_CFG		0xc001102c
-#define MSR_AMD64_BP_CFG		0xc001102e
-#define MSR_AMD64_DE_CFG2		0xc00110e3
+#define MSR_AMD64_EX_CFG		0xc001102cU
+#define MSR_AMD64_BP_CFG		0xc001102eU
+#define MSR_AMD64_DE_CFG2		0xc00110e3U
 
-#define MSR_AMD64_DR0_ADDRESS_MASK	0xc0011027
-#define MSR_AMD64_DR1_ADDRESS_MASK	0xc0011019
-#define MSR_AMD64_DR2_ADDRESS_MASK	0xc001101a
-#define MSR_AMD64_DR3_ADDRESS_MASK	0xc001101b
+#define MSR_AMD64_DR0_ADDRESS_MASK	0xc0011027U
+#define MSR_AMD64_DR1_ADDRESS_MASK	0xc0011019U
+#define MSR_AMD64_DR2_ADDRESS_MASK	0xc001101aU
+#define MSR_AMD64_DR3_ADDRESS_MASK	0xc001101bU
 
 /* AMD Family10h machine check MSRs */
-#define MSR_F10_MC4_MISC1		0xc0000408
-#define MSR_F10_MC4_MISC2		0xc0000409
-#define MSR_F10_MC4_MISC3		0xc000040A
+#define MSR_F10_MC4_MISC1		0xc0000408U
+#define MSR_F10_MC4_MISC2		0xc0000409U
+#define MSR_F10_MC4_MISC3		0xc000040AU
 
 /* AMD Family10h Bus Unit MSRs */
-#define MSR_F10_BU_CFG 		0xc0011023
-#define MSR_F10_BU_CFG2		0xc001102a
+#define MSR_F10_BU_CFG 		0xc0011023U
+#define MSR_F10_BU_CFG2		0xc001102aU
 
 /* Other AMD Fam10h MSRs */
-#define MSR_FAM10H_MMIO_CONF_BASE	0xc0010058
+#define MSR_FAM10H_MMIO_CONF_BASE	0xc0010058U
 #define FAM10H_MMIO_CONF_ENABLE         (1<<0)
 #define FAM10H_MMIO_CONF_BUSRANGE_MASK	0xf
 #define FAM10H_MMIO_CONF_BUSRANGE_SHIFT 2
@@ -435,22 +435,22 @@
 
 /* AMD Microcode MSRs */
 #define MSR_AMD_PATCHLEVEL		0x0000008b
-#define MSR_AMD_PATCHLOADER		0xc0010020
+#define MSR_AMD_PATCHLOADER		0xc0010020U
 
 /* AMD TSC RATE MSR */
-#define MSR_AMD64_TSC_RATIO		0xc0000104
+#define MSR_AMD64_TSC_RATIO		0xc0000104U
 
 /* AMD Lightweight Profiling MSRs */
-#define MSR_AMD64_LWP_CFG		0xc0000105
-#define MSR_AMD64_LWP_CBADDR		0xc0000106
+#define MSR_AMD64_LWP_CFG		0xc0000105U
+#define MSR_AMD64_LWP_CBADDR		0xc0000106U
 
 /* AMD OS Visible Workaround MSRs */
-#define MSR_AMD_OSVW_ID_LENGTH          0xc0010140
-#define MSR_AMD_OSVW_STATUS             0xc0010141
+#define MSR_AMD_OSVW_ID_LENGTH          0xc0010140U
+#define MSR_AMD_OSVW_STATUS             0xc0010141U
 
 /* AMD Protected Processor Inventory Number */
-#define MSR_AMD_PPIN_CTL                0xc00102f0
-#define MSR_AMD_PPIN                    0xc00102f1
+#define MSR_AMD_PPIN_CTL                0xc00102f0U
+#define MSR_AMD_PPIN                    0xc00102f1U
 
 /* VIA Cyrix defined MSRs*/
 #define MSR_VIA_FCR			0x00001107
diff --git a/xen/arch/x86/include/asm/pci.h b/xen/arch/x86/include/asm/pci.h
index f4a58c8acf..e1dd12eb19 100644
--- a/xen/arch/x86/include/asm/pci.h
+++ b/xen/arch/x86/include/asm/pci.h
@@ -3,10 +3,10 @@
 
 #include <xen/mm.h>
 
-#define CF8_BDF(cf8)     (  ((cf8) & 0x00ffff00) >> 8)
-#define CF8_ADDR_LO(cf8) (   (cf8) & 0x000000fc)
-#define CF8_ADDR_HI(cf8) (  ((cf8) & 0x0f000000) >> 16)
-#define CF8_ENABLED(cf8) (!!((cf8) & 0x80000000))
+#define CF8_BDF(cf8)     (  ((cf8) & 0x00ffff00U) >> 8)
+#define CF8_ADDR_LO(cf8) (   (cf8) & 0x000000fcU)
+#define CF8_ADDR_HI(cf8) (  ((cf8) & 0x0f000000U) >> 16)
+#define CF8_ENABLED(cf8) (!!((cf8) & 0x80000000U))
 
 #define IS_SNB_GFX(id) (id == 0x01068086 || id == 0x01168086 \
                         || id == 0x01268086 || id == 0x01028086 \
diff --git a/xen/arch/x86/include/asm/x86-defns.h b/xen/arch/x86/include/asm/x86-defns.h
index 5838631ef6..48d7a3b7af 100644
--- a/xen/arch/x86/include/asm/x86-defns.h
+++ b/xen/arch/x86/include/asm/x86-defns.h
@@ -30,17 +30,17 @@
 /*
  * Intel CPU flags in CR0
  */
-#define X86_CR0_PE              0x00000001 /* Enable Protected Mode    (RW) */
-#define X86_CR0_MP              0x00000002 /* Monitor Coprocessor      (RW) */
-#define X86_CR0_EM              0x00000004 /* Require FPU Emulation    (RO) */
-#define X86_CR0_TS              0x00000008 /* Task Switched            (RW) */
-#define X86_CR0_ET              0x00000010 /* Extension type           (RO) */
-#define X86_CR0_NE              0x00000020 /* Numeric Error Reporting  (RW) */
-#define X86_CR0_WP              0x00010000 /* Supervisor Write Protect (RW) */
-#define X86_CR0_AM              0x00040000 /* Alignment Checking       (RW) */
-#define X86_CR0_NW              0x20000000 /* Not Write-Through        (RW) */
-#define X86_CR0_CD              0x40000000 /* Cache Disable            (RW) */
-#define X86_CR0_PG              0x80000000 /* Paging                   (RW) */
+#define X86_CR0_PE              _AC(0x00000001, UL) /* Enable Protected Mode    (RW) */
+#define X86_CR0_MP              _AC(0x00000002, UL) /* Monitor Coprocessor      (RW) */
+#define X86_CR0_EM              _AC(0x00000004, UL) /* Require FPU Emulation    (RO) */
+#define X86_CR0_TS              _AC(0x00000008, UL) /* Task Switched            (RW) */
+#define X86_CR0_ET              _AC(0x00000010, UL) /* Extension type           (RO) */
+#define X86_CR0_NE              _AC(0x00000020, UL) /* Numeric Error Reporting  (RW) */
+#define X86_CR0_WP              _AC(0x00010000, UL) /* Supervisor Write Protect (RW) */
+#define X86_CR0_AM              _AC(0x00040000, UL) /* Alignment Checking       (RW) */
+#define X86_CR0_NW              _AC(0x20000000, UL) /* Not Write-Through        (RW) */
+#define X86_CR0_CD              _AC(0x40000000, UL) /* Cache Disable            (RW) */
+#define X86_CR0_PG              _AC(0x80000000, UL) /* Paging                   (RW) */
 
 /*
  * Intel CPU flags in CR3
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 18 19:00:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Nov 2023 19:00:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.635810.991615 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r4QYJ-0000lr-Fg; Sat, 18 Nov 2023 19:00:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 635810.991615; Sat, 18 Nov 2023 19: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 1r4QYJ-0000lj-D3; Sat, 18 Nov 2023 19:00:23 +0000
Received: by outflank-mailman (input) for mailman id 635810;
 Sat, 18 Nov 2023 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 1r4QYI-0000lW-1S
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 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 1r4QYI-0001KD-0e
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:00:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r4QYH-0000pR-Vs
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:00:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+s8R3O5aGoLCNl7K6K0yh+nxdJlUmTTDdxsRdcDD6Gk=; b=aF823G8KUC+0yhZ+2B5NOvgSCo
	YNmfqaq43Q7Ud7I43bggb/dd4WGGLyz1LDztgR4+VrHFI34XeUjAHZfYsgACqKrl+hBBR69N20ifC
	KHeBvngJL4QCul2VODUuWNdASYq+/+zRFC9DkyVJlvolGt24ku6pWw3p4P/4BBH8s+zI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/x86: address violations of MISRA C:2012 Rule 7.2
Message-Id: <E1r4QYH-0000pR-Vs@xenbits.xenproject.org>
Date: Sat, 18 Nov 2023 19:00:21 +0000

commit 1003608606818792af3d7ddb32eb6148b3b8e062
Author:     Simone Ballarin <simone.ballarin@bugseng.com>
AuthorDate: Thu Oct 19 15:11:52 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Nov 17 17:59:31 2023 -0800

    xen/x86: address violations of MISRA C:2012 Rule 7.2
    
    The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
    headline states:
    "A 'u' or 'U' suffix shall be applied to all integer constants
    that are represented in an unsigned type".
    
    Add the 'U' suffix to integers literals with unsigned type.
    
    For the sake of uniformity, the following change is made:
    - add the 'U' suffix to switch cases in 'cpuid.c'
    
    Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
    Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/apic.c       |  2 +-
 xen/arch/x86/cpu-policy.c | 18 +++++++++---------
 xen/arch/x86/cpuid.c      |  8 ++++----
 xen/arch/x86/extable.c    |  2 +-
 xen/arch/x86/percpu.c     |  2 +-
 xen/arch/x86/psr.c        |  2 +-
 xen/arch/x86/spec_ctrl.c  | 12 ++++++------
 7 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 6acdd0ec14..d00ff0943f 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1187,7 +1187,7 @@ static void __init calibrate_APIC_clock(void)
      * Setup the APIC counter to maximum. There is no way the lapic
      * can underflow in the 100ms detection time frame.
      */
-    __setup_APIC_LVTT(0xffffffff);
+    __setup_APIC_LVTT(0xffffffffU);
 
     bus_freq = calibrate_apic_timer();
     if ( !bus_freq )
diff --git a/xen/arch/x86/cpu-policy.c b/xen/arch/x86/cpu-policy.c
index 81e574390f..423932bc13 100644
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -321,7 +321,7 @@ static void recalculate_misc(struct cpu_policy *p)
         p->extd.vendor_edx = p->basic.vendor_edx;
 
         p->extd.raw_fms = p->basic.raw_fms;
-        p->extd.raw[0x1].b &= 0xff00ffff;
+        p->extd.raw[0x1].b &= 0xff00ffffU;
         p->extd.e1d |= p->basic._1d & CPUID_COMMON_1D_FEATURES;
 
         p->extd.raw[0x8].a &= 0x0000ffff; /* GuestMaxPhysAddr hidden. */
@@ -378,10 +378,10 @@ static void __init calculate_host_policy(void)
      * this information.
      */
     if ( cpu_has_lfence_dispatch )
-        max_extd_leaf = max(max_extd_leaf, 0x80000021);
+        max_extd_leaf = max(max_extd_leaf, 0x80000021U);
 
-    p->extd.max_leaf = 0x80000000 | min_t(uint32_t, max_extd_leaf & 0xffff,
-                                          ARRAY_SIZE(p->extd.raw) - 1);
+    p->extd.max_leaf = 0x80000000U | min_t(uint32_t, max_extd_leaf & 0xffff,
+                                           ARRAY_SIZE(p->extd.raw) - 1);
 
     x86_cpu_featureset_to_policy(boot_cpu_data.x86_capability, p);
     recalculate_xstate(p);
@@ -793,11 +793,11 @@ void recalculate_cpuid_policy(struct domain *d)
 
     p->basic.max_leaf   = min(p->basic.max_leaf,   max->basic.max_leaf);
     p->feat.max_subleaf = min(p->feat.max_subleaf, max->feat.max_subleaf);
-    p->extd.max_leaf    = 0x80000000 | min(p->extd.max_leaf & 0xffff,
-                                           ((p->x86_vendor & (X86_VENDOR_AMD |
-                                                              X86_VENDOR_HYGON))
-                                            ? CPUID_GUEST_NR_EXTD_AMD
-                                            : CPUID_GUEST_NR_EXTD_INTEL) - 1);
+    p->extd.max_leaf    = 0x80000000U | min(p->extd.max_leaf & 0xffff,
+                                            ((p->x86_vendor & (X86_VENDOR_AMD |
+                                                               X86_VENDOR_HYGON))
+                                             ? CPUID_GUEST_NR_EXTD_AMD
+                                             : CPUID_GUEST_NR_EXTD_INTEL) - 1);
 
     x86_cpu_policy_to_featureset(p, fs);
     x86_cpu_policy_to_featureset(max, max_fs);
diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c
index 455a09b2dd..7290a979c6 100644
--- a/xen/arch/x86/cpuid.c
+++ b/xen/arch/x86/cpuid.c
@@ -93,7 +93,7 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
         }
         break;
 
-    case 0x40000000 ... 0x400000ff:
+    case 0x40000000U ... 0x400000ffU:
         if ( is_viridian_domain(d) )
             return cpuid_viridian_leaves(v, leaf, subleaf, res);
 
@@ -103,10 +103,10 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
          * Intel reserve up until 0x4fffffff for hypervisor use.  AMD reserve
          * only until 0x400000ff, but we already use double that.
          */
-    case 0x40000100 ... 0x400001ff:
+    case 0x40000100U ... 0x400001ffU:
         return cpuid_hypervisor_leaves(v, leaf, subleaf, res);
 
-    case 0x80000000 ... 0x80000000 + CPUID_GUEST_NR_EXTD - 1:
+    case 0x80000000U ... 0x80000000U + CPUID_GUEST_NR_EXTD - 1:
         ASSERT((p->extd.max_leaf & 0xffff) < ARRAY_SIZE(p->extd.raw));
         if ( (leaf & 0xffff) > min_t(uint32_t, p->extd.max_leaf & 0xffff,
                                      ARRAY_SIZE(p->extd.raw) - 1) )
@@ -352,7 +352,7 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
         }
         break;
 
-    case 0x80000001:
+    case 0x80000001U:
         /* SYSCALL is hidden outside of long mode on Intel. */
         if ( p->x86_vendor == X86_VENDOR_INTEL &&
              is_hvm_domain(d) && !hvm_long_mode_active(v) )
diff --git a/xen/arch/x86/extable.c b/xen/arch/x86/extable.c
index 74b14246e9..652010f413 100644
--- a/xen/arch/x86/extable.c
+++ b/xen/arch/x86/extable.c
@@ -141,7 +141,7 @@ static int __init cf_check stub_selftest(void)
           .rax = 0x0123456789abcdef,
           .res.fields.trapnr = X86_EXC_GP },
         { .opc = { endbr64, 0x02, 0x04, 0x04, 0xc3 }, /* add (%rsp,%rax),%al */
-          .rax = 0xfedcba9876543210,
+          .rax = 0xfedcba9876543210UL,
           .res.fields.trapnr = X86_EXC_SS },
         { .opc = { endbr64, 0xcc, 0xc3, 0xc3, 0xc3 }, /* int3 */
           .res.fields.trapnr = X86_EXC_BP },
diff --git a/xen/arch/x86/percpu.c b/xen/arch/x86/percpu.c
index 288050cdba..3205eacea6 100644
--- a/xen/arch/x86/percpu.c
+++ b/xen/arch/x86/percpu.c
@@ -12,7 +12,7 @@ unsigned long __per_cpu_offset[NR_CPUS];
  * possible #PF at (NULL + a little) which has security implications in the
  * context of PV guests.
  */
-#define INVALID_PERCPU_AREA (0x8000000000000000L - (long)__per_cpu_start)
+#define INVALID_PERCPU_AREA (0x8000000000000000UL - (unsigned long)__per_cpu_start)
 #define PERCPU_ORDER get_order_from_bytes(__per_cpu_data_end - __per_cpu_start)
 
 void __init percpu_init_areas(void)
diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index 4c01813c4b..0b9631ac44 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -191,7 +191,7 @@ static struct feat_node *feat_l2_cat;
 static struct feat_node *feat_mba;
 
 /* Common functions */
-#define cat_default_val(len) (0xffffffff >> (32 - (len)))
+#define cat_default_val(len) (0xffffffffU >> (32 - (len)))
 
 /*
  * get_cdp_data - get DATA COS register value from input COS ID.
diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
index a8d8af22f6..421fe3f640 100644
--- a/xen/arch/x86/spec_ctrl.c
+++ b/xen/arch/x86/spec_ctrl.c
@@ -406,10 +406,10 @@ static void __init print_details(enum ind_thunk thunk)
         cpuid_count(7, 0, &max, &tmp, &tmp, &_7d0);
     if ( max >= 2 )
         cpuid_count(7, 2, &tmp, &tmp, &tmp, &_7d2);
-    if ( boot_cpu_data.extended_cpuid_level >= 0x80000008 )
-        cpuid(0x80000008, &tmp, &e8b, &tmp, &tmp);
-    if ( boot_cpu_data.extended_cpuid_level >= 0x80000021 )
-        cpuid(0x80000021, &e21a, &tmp, &tmp, &tmp);
+    if ( boot_cpu_data.extended_cpuid_level >= 0x80000008U )
+        cpuid(0x80000008U, &tmp, &e8b, &tmp, &tmp);
+    if ( boot_cpu_data.extended_cpuid_level >= 0x80000021U )
+        cpuid(0x80000021U, &e21a, &tmp, &tmp, &tmp);
     if ( cpu_has_arch_caps )
         rdmsrl(MSR_ARCH_CAPABILITIES, caps);
 
@@ -1615,8 +1615,8 @@ void __init init_speculation_mitigations(void)
          * TODO: Adjust cpu_has_svm_spec_ctrl to be usable earlier on boot.
          */
         if ( opt_msr_sc_hvm &&
-             (boot_cpu_data.extended_cpuid_level >= 0x8000000a) &&
-             (cpuid_edx(0x8000000a) & (1u << SVM_FEATURE_SPEC_CTRL)) )
+             (boot_cpu_data.extended_cpuid_level >= 0x8000000aU) &&
+             (cpuid_edx(0x8000000aU) & (1u << SVM_FEATURE_SPEC_CTRL)) )
             setup_force_cpu_cap(X86_FEATURE_SC_MSR_HVM);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 18 19:00:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Nov 2023 19:00:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.635811.991619 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r4QYT-0000oS-HB; Sat, 18 Nov 2023 19:00:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 635811.991619; Sat, 18 Nov 2023 19: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 1r4QYT-0000oJ-EX; Sat, 18 Nov 2023 19:00:33 +0000
Received: by outflank-mailman (input) for mailman id 635811;
 Sat, 18 Nov 2023 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 1r4QYS-0000o7-5T
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 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 1r4QYS-0001KK-4f
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:00:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r4QYS-0000pu-2p
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 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=qzIVa1m5D58CykupXyOl5Su44AMUI+xxRy6RP83fIK0=; b=ItI2CDfgzhctxGFbRKfiY/bVMG
	goFL+xSkeiR4YmLGAKA+a9csHj0bx0H9SXtluk3TUOE6O51wRJoLbP8UIvrp5X2WYF3QTfmwKrJNv
	ycACb7AIvJrsRGg9pB7/wz5Xhlg3GwAZDPngPmg9zcUbeS50w1HMryIoVejl/MXCnZDw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Add deviations for MISRA C:2012 Rule 7.1
Message-Id: <E1r4QYS-0000pu-2p@xenbits.xenproject.org>
Date: Sat, 18 Nov 2023 19:00:32 +0000

commit 4bee3b9c2c4cecb7f4733f4a0eadd7b255306ebc
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Fri Nov 3 15:50:36 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Nov 17 18:01:00 2023 -0800

    xen: Add deviations for MISRA C:2012 Rule 7.1
    
    As specified in rules.rst, these constants can be used
    in the code.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl |  7 ++---
 docs/misra/deviations.rst                        |  6 ++++
 xen/arch/x86/hvm/svm/emulate.c                   |  6 ++--
 xen/arch/x86/hvm/svm/svm.h                       | 38 ++++++++++++------------
 xen/common/inflate.c                             |  4 +--
 5 files changed, 33 insertions(+), 28 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 82ae567da4..27fc32c488 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -132,10 +132,9 @@ safe."
 # Series 7.
 #
 
--doc_begin="Usage of the following constants is safe, since they are given as-is
-in the inflate algorithm specification and there is therefore no risk of them
-being interpreted as decimal constants."
--config=MC3R1.R7.1,literals={safe, "^0(007|37|070|213|236|300|321|330|331|332|333|334|335|337|371)$"}
+-doc_begin="It is safe to use certain octal constants the way they are defined
+in specifications, manuals, and algorithm descriptions."
+-config=MC3R1.R7.1,reports+={safe, "any_area(any_loc(any_exp(text(^.*octal-ok.*$))))"}
 -doc_end
 
 -doc_begin="Violations in files that maintainers have asked to not modify in the
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 5b03c093ad..949840b966 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -90,6 +90,12 @@ Deviations related to MISRA C:2012 Rules:
          - __emulate_2op and __emulate_2op_nobyte
          - read_debugreg and write_debugreg
 
+   * - R7.1
+     - It is safe to use certain octal constants the way they are defined
+       in specifications, manuals, and algorithm descriptions. Such places
+       are marked safe with a /\* octal-ok \*/ in-code comment.
+     - Tagged as `safe` for ECLAIR.
+
    * - R7.2
      - Violations caused by __HYPERVISOR_VIRT_START are related to the
        particular use of it done in xen_mk_ulong.
diff --git a/xen/arch/x86/hvm/svm/emulate.c b/xen/arch/x86/hvm/svm/emulate.c
index aa2c61c433..93ac1d3435 100644
--- a/xen/arch/x86/hvm/svm/emulate.c
+++ b/xen/arch/x86/hvm/svm/emulate.c
@@ -90,9 +90,9 @@ unsigned int svm_get_insn_len(struct vcpu *v, unsigned int instr_enc)
         if ( !instr_modrm )
             return emul_len;
 
-        if ( modrm_mod       == MASK_EXTR(instr_modrm, 0300) &&
-             (modrm_reg & 7) == MASK_EXTR(instr_modrm, 0070) &&
-             (modrm_rm  & 7) == MASK_EXTR(instr_modrm, 0007) )
+        if ( modrm_mod       == MASK_EXTR(instr_modrm, 0300) && /* octal-ok */
+             (modrm_reg & 7) == MASK_EXTR(instr_modrm, 0070) && /* octal-ok */
+             (modrm_rm  & 7) == MASK_EXTR(instr_modrm, 0007) )  /* octal-ok */
             return emul_len;
     }
 
diff --git a/xen/arch/x86/hvm/svm/svm.h b/xen/arch/x86/hvm/svm/svm.h
index d2a781fc3f..8dbf37ff49 100644
--- a/xen/arch/x86/hvm/svm/svm.h
+++ b/xen/arch/x86/hvm/svm/svm.h
@@ -53,25 +53,25 @@ static inline void svm_invlpga(unsigned long linear, uint32_t asid)
  */
 #define INSTR_ENC(opc, modrm) (((opc) << 8) | (modrm))
 
-#define INSTR_PAUSE       INSTR_ENC(X86EMUL_OPC_F3(0, 0x90), 0)
-#define INSTR_INT3        INSTR_ENC(X86EMUL_OPC(   0, 0xcc), 0)
-#define INSTR_ICEBP       INSTR_ENC(X86EMUL_OPC(   0, 0xf1), 0)
-#define INSTR_HLT         INSTR_ENC(X86EMUL_OPC(   0, 0xf4), 0)
-#define INSTR_XSETBV      INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0321)
-#define INSTR_VMRUN       INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0330)
-#define INSTR_VMCALL      INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0331)
-#define INSTR_VMLOAD      INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0332)
-#define INSTR_VMSAVE      INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0333)
-#define INSTR_STGI        INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0334)
-#define INSTR_CLGI        INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0335)
-#define INSTR_INVLPGA     INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0337)
-#define INSTR_RDTSCP      INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0371)
-#define INSTR_INVD        INSTR_ENC(X86EMUL_OPC(0x0f, 0x08), 0)
-#define INSTR_WBINVD      INSTR_ENC(X86EMUL_OPC(0x0f, 0x09), 0)
-#define INSTR_WRMSR       INSTR_ENC(X86EMUL_OPC(0x0f, 0x30), 0)
-#define INSTR_RDTSC       INSTR_ENC(X86EMUL_OPC(0x0f, 0x31), 0)
-#define INSTR_RDMSR       INSTR_ENC(X86EMUL_OPC(0x0f, 0x32), 0)
-#define INSTR_CPUID       INSTR_ENC(X86EMUL_OPC(0x0f, 0xa2), 0)
+#define INSTR_PAUSE      INSTR_ENC(X86EMUL_OPC_F3(0, 0x90), 0)
+#define INSTR_INT3       INSTR_ENC(X86EMUL_OPC(   0, 0xcc), 0)
+#define INSTR_ICEBP      INSTR_ENC(X86EMUL_OPC(   0, 0xf1), 0)
+#define INSTR_HLT        INSTR_ENC(X86EMUL_OPC(   0, 0xf4), 0)
+#define INSTR_XSETBV     INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0321) /* octal-ok */
+#define INSTR_VMRUN      INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0330) /* octal-ok */
+#define INSTR_VMCALL     INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0331) /* octal-ok */
+#define INSTR_VMLOAD     INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0332) /* octal-ok */
+#define INSTR_VMSAVE     INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0333) /* octal-ok */
+#define INSTR_STGI       INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0334) /* octal-ok */
+#define INSTR_CLGI       INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0335) /* octal-ok */
+#define INSTR_INVLPGA    INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0337) /* octal-ok */
+#define INSTR_RDTSCP     INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0371) /* octal-ok */
+#define INSTR_INVD       INSTR_ENC(X86EMUL_OPC(0x0f, 0x08), 0)
+#define INSTR_WBINVD     INSTR_ENC(X86EMUL_OPC(0x0f, 0x09), 0)
+#define INSTR_WRMSR      INSTR_ENC(X86EMUL_OPC(0x0f, 0x30), 0)
+#define INSTR_RDTSC      INSTR_ENC(X86EMUL_OPC(0x0f, 0x31), 0)
+#define INSTR_RDMSR      INSTR_ENC(X86EMUL_OPC(0x0f, 0x32), 0)
+#define INSTR_CPUID      INSTR_ENC(X86EMUL_OPC(0x0f, 0xa2), 0)
 
 unsigned int svm_get_insn_len(struct vcpu *v, unsigned int instr_enc);
 unsigned int svm_get_task_switch_insn_len(void);
diff --git a/xen/common/inflate.c b/xen/common/inflate.c
index 8fa4b96d12..58f263d9e8 100644
--- a/xen/common/inflate.c
+++ b/xen/common/inflate.c
@@ -1201,8 +1201,8 @@ static int __init gunzip(void)
     magic[1] = NEXTBYTE();
     method   = NEXTBYTE();
 
-    if (magic[0] != 037 ||
-        ((magic[1] != 0213) && (magic[1] != 0236))) {
+    if (magic[0] != 037 ||                            /* octal-ok */
+        ((magic[1] != 0213) && (magic[1] != 0236))) { /* octal-ok */
         error("bad gzip magic numbers");
         return -1;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 18 19:00:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Nov 2023 19:00:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.635812.991622 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r4QYd-0000rZ-IO; Sat, 18 Nov 2023 19:00:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 635812.991622; Sat, 18 Nov 2023 19:00:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r4QYd-0000rS-Fy; Sat, 18 Nov 2023 19:00:43 +0000
Received: by outflank-mailman (input) for mailman id 635812;
 Sat, 18 Nov 2023 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 1r4QYc-0000rB-9R
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 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 1r4QYc-0001KS-8d
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:00:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r4QYc-0000qL-6o
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 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=QouVook2NfV1FCviGpG/ni0dl6xEbILrvums2m7yAjg=; b=xw+B1QafvUwHKxK7G6UwDlyPNp
	3sPQsbW0oxAO+kTRSaTmGO+oyR5mtbG2y7WNN+M9fkj9nsuXSeCLJn16dBM1K35VZpE3TXNB3s+BP
	si6OFqYOTipofMgKbLBRTMGmXfnkP1Ic5VkP45dgfdYgzhAWM7UXu2FHLIo08XYBqZXo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/io_apic: address violation of MISRA C:2012 Rule 10.1
Message-Id: <E1r4QYc-0000qL-6o@xenbits.xenproject.org>
Date: Sat, 18 Nov 2023 19:00:42 +0000

commit 5b2a570f84ed5eeaff64c61f2e9bd3c86b2be0a6
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Fri Oct 27 15:34:12 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Nov 17 18:03:52 2023 -0800

    x86/io_apic: address violation of MISRA C:2012 Rule 10.1
    
    The definition of IO_APIC_BASE contains a sum of an essentially enum
    value (FIX_IO_APIC_BASE_0) that is positive with an index that, in all
    instances, is unsigned, therefore the former is cast to unsigned, so that
    the operands are of the same essential type.
    
    No functional change.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/io_apic.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/io_apic.h b/xen/arch/x86/include/asm/io_apic.h
index a7e4c9e146..206bb961c0 100644
--- a/xen/arch/x86/include/asm/io_apic.h
+++ b/xen/arch/x86/include/asm/io_apic.h
@@ -14,9 +14,10 @@
  * Copyright (C) 1997, 1998, 1999, 2000 Ingo Molnar
  */
 
-#define IO_APIC_BASE(idx)                                               \
-    ((volatile uint32_t *)(__fix_to_virt(FIX_IO_APIC_BASE_0 + (idx))    \
-                           + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK)))
+#define IO_APIC_BASE(idx)                                         \
+    ((volatile uint32_t *)                                        \
+     (__fix_to_virt((unsigned int)FIX_IO_APIC_BASE_0 + (idx)) +   \
+                    (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK)))
 
 #define IO_APIC_ID(idx) (mp_ioapics[idx].mpc_apicid)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 18 19:00:53 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Nov 2023 19:00:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.635813.991627 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r4QYn-0000u0-KJ; Sat, 18 Nov 2023 19:00:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 635813.991627; Sat, 18 Nov 2023 19:00: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 1r4QYn-0000ts-HP; Sat, 18 Nov 2023 19:00:53 +0000
Received: by outflank-mailman (input) for mailman id 635813;
 Sat, 18 Nov 2023 19:00: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 1r4QYm-0000tk-Di
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:00: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 1r4QYm-0001Ke-C5
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:00:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r4QYm-0000qk-Aw
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 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=sylowBdcUL5ABKFzZto5cjn/jJ4lEXsPyup61TRiWC8=; b=fXVOOpf7vt4F4M4zU8nkTLiPMh
	XL1RFaWnYvhHqC5OIDoMofPvofRM3hKUPzwAixFZ1WOGAxjtrar5t4k+bF0KT8eyUDOHQImv9MiHn
	LfI73RA19BMdCrVF9v+N0AeSjHsA/FSad7YiF/5fDRzjRyUIx3zhnLUKFqIxH6peYDbw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/types: address Rule 10.1 for DECLARE_BITMAP use
Message-Id: <E1r4QYm-0000qk-Aw@xenbits.xenproject.org>
Date: Sat, 18 Nov 2023 19:00:52 +0000

commit ee409f36b69bec6b6922168f6d51fef5733fe477
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Fri Oct 27 15:34:14 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Nov 17 18:04:40 2023 -0800

    xen/types: address Rule 10.1 for DECLARE_BITMAP use
    
    Given its use in the declaration
    'DECLARE_BITMAP(features, IOMMU_FEAT_count)' the argument
    'bits' has essential type 'enum iommu_feature', which is not
    allowed by the Rule as an operand to the addition operator
    in macro 'BITS_TO_LONGS'.
    
    This construct is deviated with a deviation comment.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 docs/misra/safe.json    | 8 ++++++++
 xen/include/xen/iommu.h | 1 +
 xen/include/xen/types.h | 5 +++++
 3 files changed, 14 insertions(+)

diff --git a/docs/misra/safe.json b/docs/misra/safe.json
index 39c5c056c7..952324f85c 100644
--- a/docs/misra/safe.json
+++ b/docs/misra/safe.json
@@ -20,6 +20,14 @@
         },
         {
             "id": "SAF-2-safe",
+            "analyser": {
+                "eclair": "MC3R1.R10.1"
+            },
+            "name": "MC3R1.R10.1: use of an enumeration constant in an arithmetic operation",
+            "text": "This violation can be fixed with a cast to (int) of the enumeration constant, but a deviation was chosen due to code readability (see also the comment in BITS_TO_LONGS)."
+        },
+        {
+            "id": "SAF-3-safe",
             "analyser": {},
             "name": "Sentinel",
             "text": "Next ID to be used"
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 0e747b0bbc..d5c2577091 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -360,6 +360,7 @@ struct domain_iommu {
 #endif
 
     /* Features supported by the IOMMU */
+    /* SAF-2-safe enum constant in arithmetic operation */
     DECLARE_BITMAP(features, IOMMU_FEAT_count);
 
     /* Does the guest share HAP mapping with the IOMMU? */
diff --git a/xen/include/xen/types.h b/xen/include/xen/types.h
index aea259db1e..64e75674da 100644
--- a/xen/include/xen/types.h
+++ b/xen/include/xen/types.h
@@ -22,6 +22,11 @@ typedef signed long ssize_t;
 
 typedef __PTRDIFF_TYPE__ ptrdiff_t;
 
+/*
+ * Users of this macro are expected to pass a positive value.
+ *
+ * XXX: should become an unsigned quantity
+ */
 #define BITS_TO_LONGS(bits) \
     (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG)
 #define DECLARE_BITMAP(name,bits) \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 18 19:01:03 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Nov 2023 19:01:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.635814.991630 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r4QYx-0000wu-Li; Sat, 18 Nov 2023 19:01:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 635814.991630; Sat, 18 Nov 2023 19:01: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 1r4QYx-0000wm-Iw; Sat, 18 Nov 2023 19:01:03 +0000
Received: by outflank-mailman (input) for mailman id 635814;
 Sat, 18 Nov 2023 19:01: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 1r4QYw-0000wQ-G0
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:01: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 1r4QYw-0001L3-FB
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:01:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r4QYw-0000rZ-EC
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:01:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wDbhCDOwr7pjzgHZxbtw+euq8+iy68KkoL6HNLMWBuY=; b=BbLI2dvojNKJrBEYPyYlLNyBYX
	FNRI9QsiE6pKpGop1mF7N0mgjAPOqbxdhtCtzTSDdshMngQEB/KIAStMW2YtPNvg2kG/6SJor/gIM
	vEi72MRkZYB9zb+DgvwtxvCILoX+Nyx1cLOfuu4FTZe3rfNKl8597WP0ES4XwYhzA6UM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/compat: use BUILD_BUG_ON in CHECK_SIZE macros
Message-Id: <E1r4QYw-0000rZ-EC@xenbits.xenproject.org>
Date: Sat, 18 Nov 2023 19:01:02 +0000

commit ab9558ef5eea50339f2aaeb946f5e3e3aadd68ab
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Fri Oct 27 15:34:15 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Nov 17 18:04:52 2023 -0800

    xen/compat: use BUILD_BUG_ON in CHECK_SIZE macros
    
    BUILD_BUG_ON is the preferred way to induce a build error
    upon statically determined incorrect conditions.
    
    This also fixes a MISRA C:2012 Rule 10.1 violation in the
    previous formulation.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/compat.h | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/include/xen/compat.h b/xen/include/xen/compat.h
index f2ce5bb358..41a5d61eef 100644
--- a/xen/include/xen/compat.h
+++ b/xen/include/xen/compat.h
@@ -151,12 +151,18 @@ CHECK_NAME_(k, n, T)(k xen_ ## n *x, \
     return x == c; \
 }
 
-#define CHECK_SIZE(name) \
-    typedef int CHECK_NAME(name, S)[1 - (sizeof(xen_ ## name ## _t) != \
-                                         sizeof(compat_ ## name ## _t)) * 2]
+#define CHECK_SIZE(name)                                  \
+static inline void __maybe_unused CHECK_SIZE_##name(void) \
+{                                                         \
+    BUILD_BUG_ON(sizeof(xen_ ## name ## _t) !=            \
+                 sizeof(compat_ ## name ## _t));          \
+}
 #define CHECK_SIZE_(k, n) \
-    typedef int CHECK_NAME_(k, n, S)[1 - (sizeof(k xen_ ## n) != \
-                                          sizeof(k compat_ ## n)) * 2]
+static inline void __maybe_unused CHECK_SIZE_##k_##n(void) \
+{                                                          \
+    BUILD_BUG_ON(sizeof(k xen_ ## n) !=                    \
+                 sizeof(k compat_ ## n));                  \
+}
 
 #define CHECK_FIELD_COMMON(name, t, f) \
 static inline int __maybe_unused name(xen_ ## t ## _t *x, compat_ ## t ## _t *c) \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 18 19:01:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Nov 2023 19:01:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.635815.991636 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r4QZ7-00010I-Pt; Sat, 18 Nov 2023 19:01:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 635815.991636; Sat, 18 Nov 2023 19:01: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 1r4QZ7-00010B-MG; Sat, 18 Nov 2023 19:01:13 +0000
Received: by outflank-mailman (input) for mailman id 635815;
 Sat, 18 Nov 2023 19:01: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 1r4QZ6-000103-Jk
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:01: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 1r4QZ6-0001LQ-J1
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:01:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r4QZ6-0000ry-HM
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:01:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8SY7+SgysqDv5ItBERDP3s9D9AocQsjV0CmM1n47sjE=; b=L+ULHWFxOHwJCfn3S5oTm2dhs3
	djdVHUgsS/7zz8gjymEzBzHAN+7GMzoL/o1HKGBaVM2iu8TmMurMP46TJjlXPmzeveh536tGF6ozh
	8Zc1/EkGtbZWLhpaEvF3zR6fPgfb4tr10IwbQ7Fd5gY1/yMuP0/ol4qneBA0ch4MyD60=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/string: address violations of MISRA C:2012 Rules 8.2 and 8.3
Message-Id: <E1r4QZ6-0000ry-HM@xenbits.xenproject.org>
Date: Sat, 18 Nov 2023 19:01:12 +0000

commit a2e8d64c803371b84b2bbb18a7b1c0a8b9d8142b
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Fri Nov 10 09:50:13 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Nov 17 18:07:26 2023 -0800

    xen/string: address violations of MISRA C:2012 Rules 8.2 and 8.3
    
    Add missing parameter names to address violations of
    MISRA C:2012 Rule 8.2.
    
    Resolve mismatches between parameter name "count" used in
    "xen/lib/mem{cpy,move,set}.c" and parameter name "n" used in
    "xen/arch/x86/string.c" to address violations of MISRA C:2012 Rule 8.3.
    
    No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/include/xen/string.h | 42 +++++++++++++++++++++---------------------
 xen/lib/memcpy.c         |  6 +++---
 xen/lib/memmove.c        | 12 ++++++------
 xen/lib/memset.c         |  6 +++---
 4 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/xen/include/xen/string.h b/xen/include/xen/string.h
index b4d2217a96..bd4a8f48e9 100644
--- a/xen/include/xen/string.h
+++ b/xen/include/xen/string.h
@@ -12,27 +12,27 @@
 #define strncpy __xen_has_no_strncpy__
 #define strncat __xen_has_no_strncat__
 
-size_t strlcpy(char *, const char *, size_t);
-size_t strlcat(char *, const char *, size_t);
-int strcmp(const char *, const char *);
-int strncmp(const char *, const char *, size_t);
-int strcasecmp(const char *, const char *);
-int strncasecmp(const char *, const char *, size_t);
-char *strchr(const char *, int);
-char *strrchr(const char *, int);
-char *strstr(const char *, const char *);
-size_t strlen(const char *);
-size_t strnlen(const char *, size_t);
-char *strpbrk(const char *, const char *);
-char *strsep(char **, const char *);
-size_t strspn(const char *, const char *);
-
-void *memset(void *, int, size_t);
-void *memcpy(void *, const void *, size_t);
-void *memmove(void *, const void *, size_t);
-int memcmp(const void *, const void *, size_t);
-void *memchr(const void *, int, size_t);
-void *memchr_inv(const void *, int, size_t);
+size_t strlcpy(char *dest, const char *src, size_t size);
+size_t strlcat(char *dest, const char *src, size_t size);
+int strcmp(const char *cs, const char *ct);
+int strncmp(const char *cs, const char *ct, size_t count);
+int strcasecmp(const char *s1, const char *s2);
+int strncasecmp(const char *s1, const char *s2, size_t len);
+char *strchr(const char *s, int c);
+char *strrchr(const char *s, int c);
+char *strstr(const char *s1, const char *s2);
+size_t strlen(const char *s);
+size_t strnlen(const char *s, size_t count);
+char *strpbrk(const char *cs,const char *ct);
+char *strsep(char **s, const char *ct);
+size_t strspn(const char *s, const char *accept);
+
+void *memset(void *s, int c, size_t n);
+void *memcpy(void *dest, const void *src, size_t n);
+void *memmove(void *dest, const void *src, size_t n);
+int memcmp(const void *cs, const void *ct, size_t count);
+void *memchr(const void *s, int c, size_t n);
+void *memchr_inv(const void *s, int c, size_t n);
 
 #include <asm/string.h>
 
diff --git a/xen/lib/memcpy.c b/xen/lib/memcpy.c
index afb322797d..5476121c0d 100644
--- a/xen/lib/memcpy.c
+++ b/xen/lib/memcpy.c
@@ -8,16 +8,16 @@
  * memcpy - Copy one area of memory to another
  * @dest: Where to copy to
  * @src: Where to copy from
- * @count: The size of the area.
+ * @n: The size of the area.
  *
  * You should not use this function to access IO space, use memcpy_toio()
  * or memcpy_fromio() instead.
  */
-void *(memcpy)(void *dest, const void *src, size_t count)
+void *(memcpy)(void *dest, const void *src, size_t n)
 {
 	char *tmp = (char *) dest, *s = (char *) src;
 
-	while (count--)
+	while (n--)
 		*tmp++ = *s++;
 
 	return dest;
diff --git a/xen/lib/memmove.c b/xen/lib/memmove.c
index 1ab79dfb28..99804352e6 100644
--- a/xen/lib/memmove.c
+++ b/xen/lib/memmove.c
@@ -8,23 +8,23 @@
  * memmove - Copy one area of memory to another
  * @dest: Where to copy to
  * @src: Where to copy from
- * @count: The size of the area.
+ * @n: The size of the area.
  *
  * Unlike memcpy(), memmove() copes with overlapping areas.
  */
-void *(memmove)(void *dest, const void *src, size_t count)
+void *(memmove)(void *dest, const void *src, size_t n)
 {
 	char *tmp, *s;
 
 	if (dest <= src) {
 		tmp = (char *) dest;
 		s = (char *) src;
-		while (count--)
+		while (n--)
 			*tmp++ = *s++;
 	} else {
-		tmp = (char *) dest + count;
-		s = (char *) src + count;
-		while (count--)
+		tmp = (char *) dest + n;
+		s = (char *) src + n;
+		while (n--)
 			*--tmp = *--s;
 	}
 
diff --git a/xen/lib/memset.c b/xen/lib/memset.c
index e86afafd02..48a072cb51 100644
--- a/xen/lib/memset.c
+++ b/xen/lib/memset.c
@@ -8,15 +8,15 @@
  * memset - Fill a region of memory with the given value
  * @s: Pointer to the start of the area.
  * @c: The byte to fill the area with
- * @count: The size of the area.
+ * @n: The size of the area.
  *
  * Do not use memset() to access IO space, use memset_io() instead.
  */
-void *(memset)(void *s, int c, size_t count)
+void *(memset)(void *s, int c, size_t n)
 {
 	char *xs = (char *) s;
 
-	while (count--)
+	while (n--)
 		*xs++ = c;
 
 	return s;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 18 19:01:24 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Nov 2023 19:01:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.635816.991638 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r4QZI-00013p-QW; Sat, 18 Nov 2023 19:01:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 635816.991638; Sat, 18 Nov 2023 19:01: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 1r4QZI-00013h-Np; Sat, 18 Nov 2023 19:01:24 +0000
Received: by outflank-mailman (input) for mailman id 635816;
 Sat, 18 Nov 2023 19:01: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 1r4QZG-00013A-Ml
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:01: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 1r4QZG-0001LX-Lt
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:01:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r4QZG-0000sP-L5
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:01:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6WwTNPAI8skSNFcPsIM/34z/Up/XoCSS9EiW5gX6Mcc=; b=6kukKBXwGi2QO3lldqsloRHjoU
	/adO2JYohbXxttOK94M5vsMk+g9xHEcLnagoaITXcG36SpEa2DFEH1ZdOz7PrlTWMSm8nqQZFpxa4
	JgaSzDfNxIhXdKeTtMzJiDVHnbkcZAH76F+xB+VKY7prfH49xiMY4d1EKEdOFGoaFvxQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation/eclair: update deviations and accepted guidelines
Message-Id: <E1r4QZG-0000sP-L5@xenbits.xenproject.org>
Date: Sat, 18 Nov 2023 19:01:22 +0000

commit 71576f88528ee7d9104124e01842c138389695a8
Author:     Simone Ballarin <simone.ballarin@bugseng.com>
AuthorDate: Fri Oct 13 12:14:52 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Nov 17 18:09:14 2023 -0800

    automation/eclair: update deviations and accepted guidelines
    
    Remove deviations for ERROR_EXIT, ERROR_EXIT_DOM and PIN_FAIL:
    the aforementioned macros have been removed.
    Add deviation for Rule 2.1 for pure declarations.
    Remove legacy text-based deviations: these are now implemented
    with SAF comments.
    Add deviations for Rules 8.4, 10.1, 13.5, 14.2, 14.3.
    Remove deviations for guidelines not yet accepted or rejected.
    
    Add MC3R1.R11.7, MC3R1.R11.8, MC3R1.R11.9, MC3R1.R15.3 and MC3R1.R14.2
    to the accepted guidelines selector.
    
    Update clean guidelines selector.
    
    Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 134 +++++++++++------------
 automation/eclair_analysis/ECLAIR/tagging.ecl    |   4 +-
 2 files changed, 64 insertions(+), 74 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 27fc32c488..279b282109 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -15,14 +15,19 @@ Constant expressions and unreachable branches of if and switch statements are ex
 -doc_end
 
 -doc_begin="Unreachability caused by calls to the following functions or macros is deliberate and there is no risk of code being unexpectedly left out."
--config=MC3R1.R2.1,statements+={deliberate,"macro(name(BUG||assert_failed||ERROR_EXIT||ERROR_EXIT_DOM||PIN_FAIL))"}
+-config=MC3R1.R2.1,statements+={deliberate,"macro(name(BUG||assert_failed))"}
 -config=MC3R1.R2.1,statements+={deliberate, "call(decl(name(__builtin_unreachable||panic||do_unexpected_trap||machine_halt||machine_restart||maybe_reboot)))"}
 -doc_end
 
--doc_begin="Unreachability of an ASSERT_UNREACHABLE() and analogous macro calls is deliberate and safe."
+-doc_begin="Unreachability inside an ASSERT_UNREACHABLE() and analogous macro calls is deliberate and safe."
 -config=MC3R1.R2.1,reports+={deliberate, "any_area(any_loc(any_exp(macro(name(ASSERT_UNREACHABLE||PARSE_ERR_RET||PARSE_ERR||FAIL_MSR||FAIL_CPUID)))))"}
 -doc_end
 
+-doc_begin="Pure declarations (i.e., declarations without initialization) are
+not executable, and therefore it is safe for them to be unreachable."
+-config=MC3R1.R2.1,ignored_stmts+={"any()", "pure_decl()"}
+-doc_end
+
 -doc_begin="Proving compliance with respect to Rule 2.2 is generally impossible:
 see https://arxiv.org/abs/2212.13933 for details. Moreover, peer review gives us
 confidence that no evidence of errors in the program's logic has been missed due
@@ -49,35 +54,6 @@ they are not instances of commented-out code."
 -config=MC3R1.D4.3,reports+={disapplied,"!(any_area(any_loc(file(^xen/arch/arm/arm64/.*$))))"}
 -doc_end
 
--doc_begin="Depending on the compiler, rewriting the following function-like
-macros as inline functions is not guaranteed to have the same effect."
--config=MC3R1.D4.9,macros+={deliberate,"name(likely)"}
--config=MC3R1.D4.9,macros+={deliberate,"name(unlikely)"}
--config=MC3R1.D4.9,macros+={deliberate,"name(unreachable)"}
--doc_end
-
--doc_begin="These macros can be used on both pointers and unsigned long type values."
--config=MC3R1.D4.9,macros+={safe,"name(virt_to_maddr)"}
--config=MC3R1.D4.9,macros+={safe,"name(virt_to_mfn)"}
--doc_end
-
--doc_begin="Rewriting variadic macros as variadic functions might have a negative impact on safety."
--config=MC3R1.D4.9,macros+={deliberate,"variadic()"}
--doc_end
-
--doc_begin="Rewriting macros with arguments that are, in turn, arguments of
-__builtin_constant_p() can change the behavior depending on the optimization
-level."
--config=MC3R1.D4.9,macro_argument_context+="skip_to(class(type||expr||decl,any),
-                                            call(name(__builtin_constant_p)))"
--doc_end
-
--doc_begin="Function-like macros defined in public headers are meant to be
-usable in C89 mode without any extensions. Hence they cannot be replaced by
-inline functions."
--config=MC3R1.D4.9,macros+={deliberate, "loc(file(api:public))"}
--doc_end
-
 -doc_begin="This header file is autogenerated or empty, therefore it poses no
 risk if included more than once."
 -file_tag+={empty_header, "^xen/arch/arm/efi/runtime\\.h$"}
@@ -105,29 +81,6 @@ conform to the directive."
 -config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^read_debugreg$))&&any_exp(macro(^write_debugreg$))))"}
 -doc_end
 
--doc_begin="Function-like macros cannot be confused with identifiers that are
-neither functions nor pointers to functions."
--config=MC3R1.R5.5,reports={safe,"all_area(decl(node(enum_decl||record_decl||field_decl||param_decl||var_decl)&&!type(canonical(address((node(function||function_no_proto))))))||macro(function_like()))"}
--doc_end
-
--doc_begin="The use of these identifiers for both macro names and other entities
-is deliberate and does not generate developer confusion."
--config=MC3R1.R5.5,reports+={safe, "any_area(text(^\\s*/\\*\\s+SAF-[0-9]+-safe\\s+MC3R1\\.R5\\.5.*$, begin-1))"}
--doc_end
-
--doc_begin="The definition of macros and functions ending in '_bit' that use the
-same identifier in 'bitops.h' is deliberate and safe."
--file_tag+={bitops_h, "^xen/arch/x86/include/asm/bitops\\.h$"}
--config=MC3R1.R5.5,reports+={safe, "all_area((decl(^.*_bit\\(.*$)||macro(^.*_bit$))&&all_loc(file(bitops_h)))"}
--doc_end
-
--doc_begin="The definition of macros and functions beginning in 'str' or 'mem'
-that use the same identifier in 'xen/include/xen/string.h' is deliberate and
-safe."
--file_tag+={string_h, "^xen/include/xen/string\\.h$"}
--config=MC3R1.R5.5,reports+={safe, "any_area((decl(^(mem|str).*$)||macro(^(mem|str).*$))&&all_loc(file(string_h)))"}
--doc_end
-
 #
 # Series 7.
 #
@@ -155,11 +108,6 @@ particular use of it done in xen_mk_ulong."
 -config=MC3R1.R7.2,reports+={deliberate,"any_area(any_loc(macro(name(BUILD_BUG_ON))))"}
 -doc_end
 
--doc_begin="The following string literals are assigned to pointers to non
-const-qualified char."
--config=MC3R1.R7.4,reports+={safe, "any_area(text(^\\s*/\\*\\s+SAF-[0-9]+-safe\\s+MC3R1\\.R7\\.4.*$, begin-1))"}
--doc_end
-
 -doc_begin="Allow pointers of non-character type as long as the pointee is
 const-qualified."
 -config=MC3R1.R7.4,same_pointee=false
@@ -203,6 +151,17 @@ const-qualified."
 -config=MC3R1.R8.3,reports+={deliberate,"any_area(any_loc(file(adopted_mpparse_r8_3)))&&any_area(any_loc(file(^xen/arch/x86/include/asm/mpspec\\.h$)))"}
 -doc_end
 
+-doc_begin="The definitions present in this file are meant to generate definitions for asm modules, and are not called by C code. Therefore the absence of prior declarations is safe."
+-file_tag+={asm_offsets, "^xen/arch/(arm|x86)/(arm32|arm64|x86_64)/asm-offsets\\.c$"}
+-config=MC3R1.R8.4,reports+={safe, "first_area(any_loc(file(asm_offsets)))"}
+-doc_end
+
+-doc_begin="The functions defined in this file are meant to be called from gcc-generated code in a non-release build configuration.
+Therefore the absence of prior declarations is safe."
+-file_tag+={gcov, "^xen/common/coverage/gcov_base\\.c$"}
+-config=MC3R1.R8.4,reports+={safe, "first_area(any_loc(file(gcov)))"}
+-doc_end
+
 -doc_begin="The following variables are compiled in multiple translation units
 belonging to different executables and therefore are safe."
 -config=MC3R1.R8.6,declarations+={safe, "name(current_stack_pointer||bsearch||sort)"}
@@ -221,12 +180,6 @@ definition is compiled-out or optimized-out by the compiler)"
 # Series 9.
 #
 
--doc_begin="The following variables are written before being set, therefore no
-access to uninitialized memory locations happens, as explained in the deviation
-comment."
--config=MC3R1.R9.1,reports+={safe, "any_area(text(^\\s*/\\*\\s+SAF-[0-9]+-safe\\s+MC3R1\\.R9\\.1.*$, begin-1))"}
--doc_end
-
 -doc_begin="Violations in files that maintainers have asked to not modify in the
 context of R9.1."
 -file_tag+={adopted_r9_1,"^xen/arch/arm/arm64/lib/find_next_bit\\.c$"}
@@ -281,21 +234,47 @@ integers arguments on two's complement architectures
 -doc_end
 
 ### Set 3 ###
+-doc_begin="XEN only supports architectures where signed integers are
+representend using two's complement and all the XEN developers are aware of
+this."
+-config=MC3R1.R10.1,etypes+={safe,
+  "stmt(operator(and||or||xor||not||and_assign||or_assign||xor_assign))",
+  "any()"}
+-doc_end
+
+-doc_begin="See Section \"4.5 Integers\" of \"GCC_MANUAL\", where it says that
+\"Signed `>>' acts on negative numbers by sign extension. As an extension to the
+C language, GCC does not use the latitude given in C99 and C11 only to treat
+certain aspects of signed `<<' as undefined. However, -fsanitize=shift (and
+-fsanitize=undefined) will diagnose such cases. They are also diagnosed where
+constant expressions are required.\""
+-config=MC3R1.R10.1,etypes+={safe,
+  "stmt(operator(shl||shr||shl_assign||shr_assign))",
+  "any()"}
+-doc_end
 
 #
-# Series 18.
+# Series 13
 #
 
--doc_begin="FIXME: explain why pointer differences involving this macro are safe."
--config=MC3R1.R18.2,reports+={safe,"all_area(all_loc(any_exp(macro(^ACPI_PTR_DIFF$))))"}
+-doc_begin="All developers and reviewers can be safely assumed to be well aware
+of the short-circuit evaluation strategy of such logical operators."
+-config=MC3R1.R13.5,reports+={disapplied,"any()"}
 -doc_end
 
--doc_begin="FIXME: explain why pointer differences involving this macro are safe."
--config=MC3R1.R18.2,reports+={safe,"all_area(all_loc(any_exp(macro(^page_to_mfn$))))"}
+#
+# Series 14
+#
+
+-doc_begin="The severe restrictions imposed by this rule on the use of for
+statements are not balanced by the presumed facilitation of the peer review
+activity."
+-config=MC3R1.R14.2,reports+={disapplied,"any()"}
 -doc_end
 
--doc_begin="FIXME: explain why pointer differences involving this macro are safe."
--config=MC3R1.R18.2,reports+={safe,"all_area(all_loc(any_exp(macro(^page_to_pdx$))))"}
+-doc_begin="The XEN team relies on the fact that invariant conditions of 'if'
+statements are deliberate"
+-config=MC3R1.R14.3,statements={deliberate , "wrapped(any(),node(if_stmt))" }
 -doc_end
 
 #
@@ -312,6 +291,17 @@ in assignments."
 {safe, "left_right(^[(,\\[]$,^[),\\]]$)"}
 -doc_end
 
+#
+# General
+#
+
+-doc_begin="do-while-0 is a well recognized loop idiom by the xen community."
+-loop_idioms={do_stmt, "literal(0)"}
+-doc_end
+-doc_begin="while-[01] is a well recognized loop idiom by the xen community."
+-loop_idioms+={while_stmt, "literal(0)||literal(1)"}
+-doc_end
+
 #
 # Developer confusion
 #
diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/eclair_analysis/ECLAIR/tagging.ecl
index 78a0bc948b..e82277fea3 100644
--- a/automation/eclair_analysis/ECLAIR/tagging.ecl
+++ b/automation/eclair_analysis/ECLAIR/tagging.ecl
@@ -19,7 +19,7 @@
 
 -doc="Accepted guidelines as reported in XEN/docs/misra/rules.rst"
 -service_selector={accepted_guidelines,
-    "MC3R1.D1.1||MC3R1.D2.1||MC3R1.D4.1||MC3R1.D4.3||MC3R1.D4.7||MC3R1.D4.10||MC3R1.D4.11||MC3R1.D4.14||MC3R1.R1.1||MC3R1.R1.3||MC3R1.R1.4||MC3R1.R2.1||MC3R1.R2.2||MC3R1.R2.6||MC3R1.R2.2||MC3R1.R3.1||MC3R1.R3.2||MC3R1.R4.1||MC3R1.R4.2||MC3R1.R5.1||MC3R1.R5.2||MC3R1.R5.3||MC3R1.R5.4||MC3R1.R5.6||MC3R1.R6.1||MC3R1.R6.2||MC3R1.R7.1||MC3R1.R7.2||MC3R1.R7.3||MC3R1.R7.4||MC3R1.R8.1||MC3R1.R8.2||MC3R1.R8.3||MC3R1.R8.4||MC3R1.R8.5||MC3R1.R8.6||MC3R1.R8.8||MC3R1.R8.10||MC3R1.R8.12||MC3R1.R8.14||MC3R1.R9.1||MC3R1.R9.2||MC3R1.R9.3||MC3R1.R9.4||MC3R1.R9.5||MC3R1.R10.1||MC3R1.R10.2||MC3R1.R10.3||MC3R1.R10.4||MC3R1.R12.5||MC3R1.R13.6||MC3R1.R13.1||MC3R1.R14.1||MC3R1.R14.3||MC3R1.R16.7||MC3R1.R17.3||MC3R1.R17.4||MC3R1.R17.6||MC3R1.R18.3||MC3R1.R19.1||MC3R1.R20.7||MC3R1.R20.13||MC3R1.R20.14||MC3R1.R21.13||MC3R1.R21.17||MC3R1.R21.18||MC3R1.R21.19||MC3R1.R21.20||MC3R1.R21.21||MC3R1.R22.2||MC3R1.R22.4||MC3R1.R22.5||MC3R1.R22.6"
+    "MC3R1.D1.1||MC3R1.D2.1||MC3R1.D4.1||MC3R1.D4.3||MC3R1.D4.7||MC3R1.D4.10||MC3R1.D4.11||MC3R1.D4.14||MC3R1.R1.1||MC3R1.R1.3||MC3R1.R1.4||MC3R1.R2.1||MC3R1.R2.2||MC3R1.R2.6||MC3R1.R3.1||MC3R1.R3.2||MC3R1.R4.1||MC3R1.R4.2||MC3R1.R5.1||MC3R1.R5.2||MC3R1.R5.3||MC3R1.R5.4||MC3R1.R5.6||MC3R1.R6.1||MC3R1.R6.2||MC3R1.R7.1||MC3R1.R7.2||MC3R1.R7.3||MC3R1.R7.4||MC3R1.R8.1||MC3R1.R8.2||MC3R1.R8.3||MC3R1.R8.4||MC3R1.R8.5||MC3R1.R8.6||MC3R1.R8.8||MC3R1.R8.10||MC3R1.R8.12||MC3R1.R8.14||MC3R1.R9.1||MC3R1.R9.2||MC3R1.R9.3||MC3R1.R9.4||MC3R1.R9.5||MC3R1.R10.1||MC3R1.R10.2||MC3R1.R10.3||MC3R1.R10.4||MC3R1.R11.7||MC3R1.R11.8||MC3R1.R11.9||MC3R1.R12.5||MC3R1.R13.1||MC3R1.R13.5||MC3R1.R13.6||MC3R1.R14.1||MC3R1.R14.2||MC3R1.R14.3||MC3R1.R16.7||MC3R1.R17.3||MC3R1.R17.4||MC3R1.R17.6||MC3R1.R18.3||MC3R1.R19.1||MC3R1.R20.7||MC3R1.R20.13||MC3R1.R20.14||MC3R1.R21.13||MC3R1.R21.17||MC3R1.R21.18||MC3R1.R21.19||MC3R1.R21.20||MC3R1.R21.21||MC3R1.R22.2||MC3R1.R22.4||MC3R1.R22.5||MC3R1.R22.6"
 }
 -doc="All reports of accepted guidelines are tagged as accepted."
 -reports+={status:accepted,"service(accepted_guidelines)"}
@@ -30,7 +30,7 @@
 
 -doc_begin="Clean guidelines: new violations for these guidelines are not accepted."
 
--service_selector={clean_guidelines_common,"MC3R1.D1.1||MC3R1.D2.1||MC3R1.D4.11||MC3R1.D4.14||MC3R1.R1.1||MC3R1.R1.3||MC3R1.R1.4||MC3R1.R2.2||MC3R1.R3.1||MC3R1.R3.2||MC3R1.R4.1||MC3R1.R5.1||MC3R1.R5.2||MC3R1.R5.4||MC3R1.R6.1||MC3R1.R6.2||MC3R1.R7.1||MC3R1.R8.1||MC3R1.R8.5||MC3R1.R8.8||MC3R1.R8.10||MC3R1.R8.12||MC3R1.R8.14||MC3R1.R9.2||MC3R1.R9.4||MC3R1.R9.5||MC3R1.R12.5||MC3R1.R17.3||MC3R1.R17.4||MC3R1.R17.6||MC3R1.R21.13||MC3R1.R21.19||MC3R1.R21.21||MC3R1.R22.2||MC3R1.R22.4||MC3R1.R22.5||MC3R1.R22.6"
+-service_selector={clean_guidelines_common,"MC3R1.D1.1||MC3R1.D2.1||MC3R1.D4.11||MC3R1.D4.14||MC3R1.R1.1||MC3R1.R1.3||MC3R1.R1.4||MC3R1.R2.2||MC3R1.R3.1||MC3R1.R3.2||MC3R1.R4.1||MC3R1.R4.2||MC3R1.R5.1||MC3R1.R5.2||MC3R1.R5.4||MC3R1.R6.1||MC3R1.R6.2||MC3R1.R7.1||MC3R1.R8.1||MC3R1.R8.5||MC3R1.R8.8||MC3R1.R8.10||MC3R1.R8.12||MC3R1.R8.14||MC3R1.R9.2||MC3R1.R9.4||MC3R1.R9.5||MC3R1.R12.5||MC3R1.R17.3||MC3R1.R17.4||MC3R1.R17.6||MC3R1.R20.13||MC3R1.R20.14||MC3R1.R21.13||MC3R1.R21.19||MC3R1.R21.21||MC3R1.R22.2||MC3R1.R22.4||MC3R1.R22.5||MC3R1.R22.6"
 }
 
 -setq=target,getenv("XEN_TARGET_ARCH")
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 18 19:01:34 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Nov 2023 19:01:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.635817.991643 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r4QZS-00016K-SN; Sat, 18 Nov 2023 19:01:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 635817.991643; Sat, 18 Nov 2023 19:01: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 1r4QZS-00016C-PS; Sat, 18 Nov 2023 19:01:34 +0000
Received: by outflank-mailman (input) for mailman id 635817;
 Sat, 18 Nov 2023 19:01: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 1r4QZQ-00015u-Pj
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:01: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 1r4QZQ-0001NC-On
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:01:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r4QZQ-0000sr-O3
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:01:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PdpQ3fcqmFO6ddh6ye/gjcCVgSymHrytk4TukurIiv8=; b=hoJ0EPmhaXmy4xXXWyLOGdgLaC
	qsH/OLDlYsXe22Nqgkr+im8/dHepuX7/7ZS7sCW8pJCVNuss+hP4VQzshEZqC9/hQvm04RsL3bZJk
	/7jnidtQ0SBtbu4GJjFOHA/uBhkDRvO2l3KlkUTKhIDunna0u5GYcvNqARJVh+sLWKoM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: address violations of Rule 11.9
Message-Id: <E1r4QZQ-0000sr-O3@xenbits.xenproject.org>
Date: Sat, 18 Nov 2023 19:01:32 +0000

commit 26cdd09801e5cd7c4bed25de2eac012ba67535a0
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Fri Nov 17 18:11:11 2023 -0800
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Nov 17 18:11:11 2023 -0800

    xen: address violations of Rule 11.9
    
    The constant 0 is used instead of NULL in '__ACCESS_ONCE' as a
    compile-time check to detect non-scalar types; its usage for this
    purpose is deviated.
    
    Furthermore, the 'typeof_field' macro is introduced as a general way
    to access the type of a struct member without declaring a variable
    of struct type. Both this macro and 'sizeof_field' are moved to
    'xen/macros.h'.
    
    No functional change intended.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl |  9 +++++++++
 docs/misra/deviations.rst                        |  6 ++++++
 xen/include/xen/compiler.h                       |  8 --------
 xen/include/xen/kernel.h                         |  2 +-
 xen/include/xen/macros.h                         | 16 ++++++++++++++++
 5 files changed, 32 insertions(+), 9 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 279b282109..b7c6d85fbf 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -253,6 +253,15 @@ constant expressions are required.\""
   "any()"}
 -doc_end
 
+#
+# Series 11
+#
+
+-doc_begin="This construct is used to check if the type is scalar, and for this purpose the use of 0 as a null pointer constant is deliberate."
+-config=MC3R1.R11.9,reports+={deliberate, "any_area(any_loc(any_exp(macro(^__ACCESS_ONCE$))))"
+}
+-doc_end
+
 #
 # Series 13
 #
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 949840b966..b5a46f7f87 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -206,6 +206,12 @@ Deviations related to MISRA C:2012 Rules:
        If no bits are set, 0 is returned.
      - Tagged as `safe` for ECLAIR.
 
+   * - R11.9
+     - __ACCESS_ONCE uses an integer, which happens to be zero, as a
+       compile time check. The typecheck uses a cast. The usage of zero or other
+       integers for this purpose is allowed.
+     - Tagged as `deliberate` for ECLAIR.
+
    * - R13.5
      - All developers and reviewers can be safely assumed to be well aware of
        the short-circuit evaluation strategy for logical operators.
diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h
index dd99e57308..a8be1f19cf 100644
--- a/xen/include/xen/compiler.h
+++ b/xen/include/xen/compiler.h
@@ -109,14 +109,6 @@
 
 #define offsetof(a,b) __builtin_offsetof(a,b)
 
-/**
- * sizeof_field(TYPE, MEMBER)
- *
- * @TYPE: The structure containing the field of interest
- * @MEMBER: The field to return the size of
- */
-#define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER))
-
 #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L
 #define alignof __alignof__
 #endif
diff --git a/xen/include/xen/kernel.h b/xen/include/xen/kernel.h
index 46b3c9c026..2c5ed7736c 100644
--- a/xen/include/xen/kernel.h
+++ b/xen/include/xen/kernel.h
@@ -51,7 +51,7 @@
  *
  */
 #define container_of(ptr, type, member) ({                      \
-        typeof( ((type *)0)->member ) *__mptr = (ptr);          \
+        typeof_field(type, member) *__mptr = (ptr);             \
         (type *)( (char *)__mptr - offsetof(type,member) );})
 
 /*
diff --git a/xen/include/xen/macros.h b/xen/include/xen/macros.h
index f943319ab2..18842cd8a5 100644
--- a/xen/include/xen/macros.h
+++ b/xen/include/xen/macros.h
@@ -60,6 +60,22 @@
 
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]) + __must_be_array(x))
 
+/**
+ * typeof_field(type, member)
+ *
+ * @type: The structure containing the field of interest
+ * @member: The field whose type is returned
+ */
+#define typeof_field(type, member) typeof(((type *)NULL)->member)
+
+/**
+ * sizeof_field(type, member)
+ *
+ * @type: The structure containing the field of interest
+ * @member: The field to return the size of
+ */
+#define sizeof_field(type, member) sizeof(((type *)NULL)->member)
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __MACROS_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 18 19:01:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Nov 2023 19:01:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.635818.991647 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r4QZb-0001B2-Ux; Sat, 18 Nov 2023 19:01:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 635818.991647; Sat, 18 Nov 2023 19:01: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 1r4QZb-0001Au-SP; Sat, 18 Nov 2023 19:01:43 +0000
Received: by outflank-mailman (input) for mailman id 635818;
 Sat, 18 Nov 2023 19:01: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 1r4QZa-0001Ag-SY
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:01: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 1r4QZa-0001NK-Rh
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:01:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r4QZa-0000tG-Qm
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:01: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=OZ0gYTLSRCRnAuR80mCs8ox7BD3Jy9AOAnVtmaplV8E=; b=AHRbiFYMZISgrdbopXMc4jdUKy
	LVf60wKZzNJk6Sxwn4HlL3wx8OzGyAiSpXznDfBUKNsPGg1W1YcNk2ap8H+D2UAzyCnYLg3rHYH3w
	w1KZEyalzx5G7jnMEdCXLaYAMm7dxYaxaRuCiqj+HMt+Go8Z0iisQUmu5qLL0Kk2VSXM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation/eclair: add a deviation for MISRA C:2012 Rule 8.6
Message-Id: <E1r4QZa-0000tG-Qm@xenbits.xenproject.org>
Date: Sat, 18 Nov 2023 19:01:42 +0000

commit 83e9e305103ef00ba3b546657d47c4aa85899cff
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Fri Nov 17 18:16:34 2023 -0800
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Nov 17 18:16:34 2023 -0800

    automation/eclair: add a deviation for MISRA C:2012 Rule 8.6
    
    Update ECLAIR configuration to take into account the search
    procedure adopted by Unix linkers.
    Update deviations.rst accordingly and tag Rule 8.6 as "clean".
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 11 +++++++++++
 automation/eclair_analysis/ECLAIR/tagging.ecl    |  2 +-
 docs/misra/deviations.rst                        | 12 ++++++++++++
 3 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index b7c6d85fbf..5b7cf4c947 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -172,6 +172,17 @@ definition is compiled-out or optimized-out by the compiler)"
 -config=MC3R1.R8.6,reports+={deliberate, "first_area(^.*has no definition$)"}
 -doc_end
 
+-doc_begin="The search procedure for Unix linkers is well defined, see ld(1)
+manual: \"The linker will search an archive only once, at the location where it
+is specified on the command line. If the archive defines a symbol which was
+undefined in some object which appeared before the archive on the command line,
+the linker will include the appropriate file(s) from the archive\".
+In Xen, thanks to the order in which file names appear in the build commands,
+if arch-specific definitions are present, they get always linked in before
+searching in the lib.a archive resulting from xen/lib."
+-config=MC3R1.R8.6,declarations+={deliberate, "loc(file(^xen/lib/.*$))"}
+-doc_end
+
 -doc_begin="The gnu_inline attribute without static is deliberately allowed."
 -config=MC3R1.R8.10,declarations+={deliberate,"property(gnu_inline)"}
 -doc_end
diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/eclair_analysis/ECLAIR/tagging.ecl
index e82277fea3..d5d3bff396 100644
--- a/automation/eclair_analysis/ECLAIR/tagging.ecl
+++ b/automation/eclair_analysis/ECLAIR/tagging.ecl
@@ -30,7 +30,7 @@
 
 -doc_begin="Clean guidelines: new violations for these guidelines are not accepted."
 
--service_selector={clean_guidelines_common,"MC3R1.D1.1||MC3R1.D2.1||MC3R1.D4.11||MC3R1.D4.14||MC3R1.R1.1||MC3R1.R1.3||MC3R1.R1.4||MC3R1.R2.2||MC3R1.R3.1||MC3R1.R3.2||MC3R1.R4.1||MC3R1.R4.2||MC3R1.R5.1||MC3R1.R5.2||MC3R1.R5.4||MC3R1.R6.1||MC3R1.R6.2||MC3R1.R7.1||MC3R1.R8.1||MC3R1.R8.5||MC3R1.R8.8||MC3R1.R8.10||MC3R1.R8.12||MC3R1.R8.14||MC3R1.R9.2||MC3R1.R9.4||MC3R1.R9.5||MC3R1.R12.5||MC3R1.R17.3||MC3R1.R17.4||MC3R1.R17.6||MC3R1.R20.13||MC3R1.R20.14||MC3R1.R21.13||MC3R1.R21.19||MC3R1.R21.21||MC3R1.R22.2||MC3R1.R22.4||MC3R1.R22.5||MC3R1.R22.6"
+-service_selector={clean_guidelines_common,"MC3R1.D1.1||MC3R1.D2.1||MC3R1.D4.11||MC3R1.D4.14||MC3R1.R1.1||MC3R1.R1.3||MC3R1.R1.4||MC3R1.R2.2||MC3R1.R3.1||MC3R1.R3.2||MC3R1.R4.1||MC3R1.R4.2||MC3R1.R5.1||MC3R1.R5.2||MC3R1.R5.4||MC3R1.R6.1||MC3R1.R6.2||MC3R1.R7.1||MC3R1.R8.1||MC3R1.R8.5||MC3R1.R8.6||MC3R1.R8.8||MC3R1.R8.10||MC3R1.R8.12||MC3R1.R8.14||MC3R1.R9.2||MC3R1.R9.4||MC3R1.R9.5||MC3R1.R12.5||MC3R1.R17.3||MC3R1.R17.4||MC3R1.R17.6||MC3R1.R20.13||MC3R1.R20.14||MC3R1.R21.13||MC3R1.R21.19||MC3R1.R21.21||MC3R1.R22.2||MC3R1.R22.4||MC3R1.R22.5||MC3R1.R22.6"
 }
 
 -setq=target,getenv("XEN_TARGET_ARCH")
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index b5a46f7f87..95872b40a2 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -153,6 +153,18 @@ Deviations related to MISRA C:2012 Rules:
        definition is compiled-out or optimized-out by the compiler).
      - Tagged as `deliberate` in ECLAIR.
 
+   * - R8.6
+     - The search procedure for Unix linkers is well defined, see ld(1) manual:
+       "The linker will search an archive only once, at the location where it
+       is specified on the command line. If the archive defines a symbol which
+       was undefined in some object which appeared before the archive on the
+       command line, the linker will include the appropriate file(s) from the
+       archive".
+       In Xen, thanks to the order in which file names appear in the build
+       commands, if arch-specific definitions are present, they get always
+       linked in before searching in the lib.a archive resulting from xen/lib.
+     - Tagged as `deliberate` for ECLAIR.
+
    * - R8.10
      - The gnu_inline attribute without static is deliberately allowed.
      - Tagged as `deliberate` for ECLAIR.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 18 19:01:54 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Nov 2023 19:01:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.635819.991653 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r4QZm-0001Dp-2I; Sat, 18 Nov 2023 19:01:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 635819.991653; Sat, 18 Nov 2023 19:01: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 1r4QZl-0001Dc-Tw; Sat, 18 Nov 2023 19:01:53 +0000
Received: by outflank-mailman (input) for mailman id 635819;
 Sat, 18 Nov 2023 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 1r4QZk-0001DU-VO
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:01: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 1r4QZk-0001NS-UY
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:01:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r4QZk-0000tg-Tp
 for xen-changelog@lists.xenproject.org; Sat, 18 Nov 2023 19:01: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=GYBB3HSs6BRG896a6Dpcy8+EKdbGinoI8tf3t+QmMOs=; b=fnTbIFkWQjLZ4yAsr0R+y8eXLQ
	DuchfCCMsS+j06NvBpdB/qlRE3zkD6CEKZeZlAPM7a7PyOEQw9xxSlxVLoWl98qZ8GkTcbCegwMHR
	MfdIYU6Y9RGFDB9/dmANFrnyMOynR2AnCmcB9yqLTDSGrXK4umZr9jJlIOmUnZ/P5qjE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: introduce function type bug_fn_t.
Message-Id: <E1r4QZk-0000tg-Tp@xenbits.xenproject.org>
Date: Sat, 18 Nov 2023 19:01:52 +0000

commit 98758ae48974d6d24f999e4d9324e463d326f66f
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Fri Nov 17 09:28:26 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Nov 17 18:29:51 2023 -0800

    xen: introduce function type bug_fn_t.
    
    Introduce function type bug_fn_t. This improves readability and could be
    used to help validating that the function passed to
    run_in_exception_handle() has the expected prototype.
    
    Use the newly-intoduced type to address a violation of MISRA
    C:2012 Rule 8.2.
    
    Suggested-by: Julien Grall <julien@xen.org>
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    [stefano: minor commit improvement]
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/traps.c  | 2 +-
 xen/include/xen/bug.h | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index ce89f16404..8492e2b7bb 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1236,7 +1236,7 @@ int do_bug_frame(const struct cpu_user_regs *regs, vaddr_t pc)
 
     if ( id == BUGFRAME_run_fn )
     {
-        void (*fn)(const struct cpu_user_regs *) = (void *)regs->BUG_FN_REG;
+        bug_fn_t *fn = (void *)regs->BUG_FN_REG;
 
         fn(regs);
         return 0;
diff --git a/xen/include/xen/bug.h b/xen/include/xen/bug.h
index e8a4eea71a..cb5138410e 100644
--- a/xen/include/xen/bug.h
+++ b/xen/include/xen/bug.h
@@ -99,6 +99,9 @@ struct bug_frame {
 
 #endif
 
+struct cpu_user_regs;
+typedef void bug_fn_t(const struct cpu_user_regs *regs);
+
 #ifndef run_in_exception_handler
 
 /*
@@ -132,8 +135,6 @@ struct bug_frame {
 
 #ifdef CONFIG_GENERIC_BUG_FRAME
 
-struct cpu_user_regs;
-
 /*
  * Returns a negative value in case of an error otherwise
  * BUGFRAME_{run_fn, warn, bug, assert}
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 04:11:10 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 04:11:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.637499.993323 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5I6J-0004c0-MW; Tue, 21 Nov 2023 04:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 637499.993323; Tue, 21 Nov 2023 04: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 1r5I6J-0004bs-Ju; Tue, 21 Nov 2023 04:11:03 +0000
Received: by outflank-mailman (input) for mailman id 637499;
 Tue, 21 Nov 2023 04: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 1r5I6I-0004bm-G6
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04: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 1r5I6I-0006Ws-Bi
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5I6I-0007hD-AU
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04: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=Q9AKrg3IVMwCS0g5IaZIM7zYA4vxrxRAA/iNW/WNj2M=; b=hZbMMVbrIht3ebtaDYA2ABjVCk
	GwBwW95bwxIZdZv0sCRegk1hN2Oh6cXvlsIP9jkcPu+IRyc5D8QnfbpiuVT4yOPMMf7H354KPdKMg
	iqerTuwB8WSam0xKa56cu5euDRdzLA9H/EZ50Ktu1TwUeJHo6Q9Y1N/I1NMEgcAqEKus=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/sched: fix sched_move_domain()
Message-Id: <E1r5I6I-0007hD-AU@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 04:11:02 +0000

commit 4709ec82917668c2df958ef91b4f21c049c76bee
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 20 10:49:29 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 20 10:49:29 2023 +0100

    xen/sched: fix sched_move_domain()
    
    When moving a domain out of a cpupool running with the credit2
    scheduler and having multiple run-queues, the following ASSERT() can
    be observed:
    
    (XEN) Xen call trace:
    (XEN)    [<ffff82d04023a700>] R credit2.c#csched2_unit_remove+0xe3/0xe7
    (XEN)    [<ffff82d040246adb>] S sched_move_domain+0x2f3/0x5b1
    (XEN)    [<ffff82d040234cf7>] S cpupool.c#cpupool_move_domain_locked+0x1d/0x3b
    (XEN)    [<ffff82d040236025>] S cpupool_move_domain+0x24/0x35
    (XEN)    [<ffff82d040206513>] S domain_kill+0xa5/0x116
    (XEN)    [<ffff82d040232b12>] S do_domctl+0xe5f/0x1951
    (XEN)    [<ffff82d0402276ba>] S timer.c#timer_lock+0x69/0x143
    (XEN)    [<ffff82d0402dc71b>] S pv_hypercall+0x44e/0x4a9
    (XEN)    [<ffff82d0402012b7>] S lstar_enter+0x137/0x140
    (XEN)
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 1:
    (XEN) Assertion 'svc->rqd == c2rqd(sched_unit_master(unit))' failed at common/sched/credit2.c:1159
    (XEN) ****************************************
    
    This is happening as sched_move_domain() is setting a different cpu
    for a scheduling unit without telling the scheduler. When this unit is
    removed from the scheduler, the ASSERT() will trigger.
    
    In non-debug builds the result is usually a clobbered pointer, leading
    to another crash a short time later.
    
    Fix that by swapping the two involved actions (setting another cpu and
    removing the unit from the scheduler).
    
    Link: https://github.com/Dasharo/dasharo-issues/issues/488
    Fixes: 70fadc41635b ("xen/cpupool: support moving domain between cpupools with different granularity")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@cloud.com>
---
 xen/common/sched/core.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 12deefa745..eba0cea4bb 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -732,18 +732,20 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
     old_domdata = d->sched_priv;
 
     /*
-     * Temporarily move all units to same processor to make locking
-     * easier when moving the new units to the new processors.
+     * Remove all units from the old scheduler, and temporarily move them to
+     * the same processor to make locking easier when moving the new units to
+     * new processors.
      */
     new_p = cpumask_first(d->cpupool->cpu_valid);
     for_each_sched_unit ( d, unit )
     {
-        spinlock_t *lock = unit_schedule_lock_irq(unit);
+        spinlock_t *lock;
+
+        sched_remove_unit(old_ops, unit);
 
+        lock = unit_schedule_lock_irq(unit);
         sched_set_res(unit, get_sched_res(new_p));
         spin_unlock_irq(lock);
-
-        sched_remove_unit(old_ops, unit);
     }
 
     old_units = d->sched_unit_list;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 04:11:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 04:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.637500.993328 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5I6T-0004df-O4; Tue, 21 Nov 2023 04:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 637500.993328; Tue, 21 Nov 2023 04: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 1r5I6T-0004dX-LI; Tue, 21 Nov 2023 04:11:13 +0000
Received: by outflank-mailman (input) for mailman id 637500;
 Tue, 21 Nov 2023 04: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 1r5I6S-0004dL-Fh
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04: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 1r5I6S-0006Wx-Es
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5I6S-0007hn-Do
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04: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=Cilcb0wg4t48EQvpFBrw2vmzH30163Num9cnlOmYU5k=; b=7HOQsoOaXL4E6WSX45AVOKFdsU
	vzMxbcpUKKOC5zNURq3A3jXG0Es18P9S5ay3M0GmG6Im++uWpfWaNKy9Aip7xJBSoD5okJI6NJIFT
	H3KlVPzl3eYKJszuXkdkC34/GAUP0nquFavteOQOB6hIvi6LzTwzSLeCrI+Sp96xUxtQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvm: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r5I6S-0007hn-Do@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 04:11:12 +0000

commit f5b4c5f537e33bf0efc654cbd071790f341c6b73
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Mon Nov 20 10:51:13 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 20 10:51:13 2023 +0100

    x86/hvm: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/x86/hvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/x86/hvm.c b/xen/drivers/passthrough/x86/hvm.c
index 8175ba629a..d3627e4af7 100644
--- a/xen/drivers/passthrough/x86/hvm.c
+++ b/xen/drivers/passthrough/x86/hvm.c
@@ -724,8 +724,8 @@ bool pt_pirq_cleanup_check(struct hvm_pirq_dpci *dpci)
 }
 
 int pt_pirq_iterate(struct domain *d,
-                    int (*cb)(struct domain *,
-                              struct hvm_pirq_dpci *, void *),
+                    int (*cb)(struct domain *d,
+                              struct hvm_pirq_dpci *pirq_dpci, void *arg),
                     void *arg)
 {
     int rc = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 04:11:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 04:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.637501.993332 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5I6d-0004fl-Pb; Tue, 21 Nov 2023 04:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 637501.993332; Tue, 21 Nov 2023 04: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 1r5I6d-0004fZ-Mk; Tue, 21 Nov 2023 04:11:23 +0000
Received: by outflank-mailman (input) for mailman id 637501;
 Tue, 21 Nov 2023 04:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5I6c-0004fN-JV
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04: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 1r5I6c-0006X9-IE
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5I6c-0007iJ-Gt
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04: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=qdd900QBh/nr4EaKifyBS0tWQ/LI8AebaxsIb61H8H0=; b=kyEoB3GlfQDrQEKqIxy6JOATWY
	Mg11F4XZeZ2Ga1IdglPJlyN5tuKsYZ/ujA0pB0qHRr2/pMjJYRgDZaUQb3vtppFizf3BKqVr5zU0W
	qpi4Ksjc6X7qA0ECc1K6Rfd0VfxFB/wdMnn9bilDHCgSnSgZBW6YyPUhoO7AVkshnVxs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mmconfig: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r5I6c-0007iJ-Gt@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 04:11:22 +0000

commit 9b1fcb46481c92d0c1f002f3cf1c43ecb83e0900
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Mon Nov 20 10:51:41 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 20 10:51:41 2023 +0100

    x86/mmconfig: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/x86_64/mmconfig.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_64/mmconfig.h b/xen/arch/x86/x86_64/mmconfig.h
index 2d49fc79a0..3da4b21e9b 100644
--- a/xen/arch/x86/x86_64/mmconfig.h
+++ b/xen/arch/x86/x86_64/mmconfig.h
@@ -70,5 +70,5 @@ int pci_mmcfg_reserved(uint64_t address, unsigned int segment,
                        unsigned int start_bus, unsigned int end_bus,
                        unsigned int flags);
 int pci_mmcfg_arch_init(void);
-int pci_mmcfg_arch_enable(unsigned int);
-void pci_mmcfg_arch_disable(unsigned int);
+int pci_mmcfg_arch_enable(unsigned int idx);
+void pci_mmcfg_arch_disable(unsigned int idx);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 04:11:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 04:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.637502.993335 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5I6n-0004ia-Qi; Tue, 21 Nov 2023 04:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 637502.993335; Tue, 21 Nov 2023 04:11:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5I6n-0004iT-OE; Tue, 21 Nov 2023 04:11:33 +0000
Received: by outflank-mailman (input) for mailman id 637502;
 Tue, 21 Nov 2023 04:11:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5I6m-0004iL-MX
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04:11:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5I6m-0006Yn-LL
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5I6m-0007ij-KN
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04:11:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mRDksCwPuvbgk2grTd4UcrbSCIq68VY0+Qs9yioYFro=; b=mM3Ufm3637sL31las6M44UEwxR
	+nVk7rDwsEolPLR4L//AZXf673XUSmXWIYFRYXOq08i2Nhlq9nlC+GLTJf2/i1n7Xr3eN6caskuyt
	KC/aqJuIrU3SbPjK5AerJJQ5+Y90rto5EOFAi/vnuk8miXvzNe7dZxpxHg/QFHCxenss=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/vpmu: address a violation of MISRA C:2012 Rule 8.2
Message-Id: <E1r5I6m-0007ij-KN@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 04:11:32 +0000

commit 340a75a4f4b2f1ae0e09e7e50ec75f959b757408
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Mon Nov 20 10:52:10 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 20 10:52:10 2023 +0100

    x86/vpmu: address a violation of MISRA C:2012 Rule 8.2
    
    Add missing parameter name. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/vpmu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/vpmu.h b/xen/arch/x86/include/asm/vpmu.h
index b165acc6c2..7858aec6ca 100644
--- a/xen/arch/x86/include/asm/vpmu.h
+++ b/xen/arch/x86/include/asm/vpmu.h
@@ -35,7 +35,7 @@ struct arch_vpmu_ops {
     void (*arch_vpmu_destroy)(struct vcpu *v);
     int (*arch_vpmu_save)(struct vcpu *v, bool_t to_guest);
     int (*arch_vpmu_load)(struct vcpu *v, bool_t from_guest);
-    void (*arch_vpmu_dump)(const struct vcpu *);
+    void (*arch_vpmu_dump)(const struct vcpu *v);
 
 #ifdef CONFIG_MEM_SHARING
     int (*allocate_context)(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 04:11:44 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 04:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.637503.993340 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5I6y-0004n7-Sd; Tue, 21 Nov 2023 04:11:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 637503.993340; Tue, 21 Nov 2023 04: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 1r5I6y-0004mz-Pk; Tue, 21 Nov 2023 04:11:44 +0000
Received: by outflank-mailman (input) for mailman id 637503;
 Tue, 21 Nov 2023 04: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 1r5I6w-0004mQ-Px
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04: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 1r5I6w-0006Yu-P6
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5I6w-0007jA-NR
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04: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=ldlUYB2XX2JwG8lEjLbyuVgYGNLByh8umRI5kpSk5po=; b=VPORxffqw4yTnirv+B5Z4aBUjW
	mulr3CGI+qATQ/7NL3od/rBKFYHg/4XrRo9XmZz+9kpOaGCtYbj14utUjxctROsHoscLcoBf5fILl
	tRH5+620gZoHNQL6Y0e4xGDvfwhP5Bv2K3MpAPJid9nKApRVwxEUTvuefi40UPDTVWmM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/smp: address a violation of MISRA C:2012 Rule 8.2
Message-Id: <E1r5I6w-0007jA-NR@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 04:11:42 +0000

commit 45402cc136ef2565a8b6ac9d652fa0afd35bb7e3
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Mon Nov 20 10:52:43 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 20 10:52:43 2023 +0100

    x86/smp: address a violation of MISRA C:2012 Rule 8.2
    
    Add missing parameter name. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/smp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/smp.h b/xen/arch/x86/include/asm/smp.h
index c0b5d7cdd8..761edfcd34 100644
--- a/xen/arch/x86/include/asm/smp.h
+++ b/xen/arch/x86/include/asm/smp.h
@@ -32,7 +32,7 @@ extern bool park_offline_cpus;
 
 void smp_send_nmi_allbutself(void);
 
-void send_IPI_mask(const cpumask_t *, int vector);
+void send_IPI_mask(const cpumask_t *mask, int vector);
 void send_IPI_self(int vector);
 
 extern void (*mtrr_hook) (void);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 04:11:54 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 04:11:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.637504.993344 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5I78-0004pJ-U4; Tue, 21 Nov 2023 04:11:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 637504.993344; Tue, 21 Nov 2023 04: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 1r5I78-0004pC-RC; Tue, 21 Nov 2023 04:11:54 +0000
Received: by outflank-mailman (input) for mailman id 637504;
 Tue, 21 Nov 2023 04: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 1r5I76-0004p0-Sn
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04: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 1r5I76-0006ZM-Rz
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5I76-0007jd-RC
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04: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=kr565WXf42WSHIBPOe0/39R2Q2EI86iNJ95/ho2Kdjw=; b=L4iiyUys9nDbjrgmAPTto85O0T
	5GLY0IrQTgIRDpZpmDEbZ9vje2gCf4aKTxolE65871R+D887dsYrcQxSvHQ1pqdxo4a08mhCXGyTf
	bfm2fosPacG7tUBi/LjPOiJcpHErZb+Xp5OgJkeOI5evTp5jZDCH2QPJpjWbEMISn8TA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/pci: address a violation of MISRA C:2012 Rule 8.2
Message-Id: <E1r5I76-0007jd-RC@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 04:11:52 +0000

commit 8976587dc77a1369a3fa35f020fe6b6418c69a1c
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Mon Nov 20 10:53:17 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 20 10:53:17 2023 +0100

    x86/pci: address a violation of MISRA C:2012 Rule 8.2
    
    Add missing parameter name. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/pci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/pci.h b/xen/arch/x86/include/asm/pci.h
index e1dd12eb19..fd981de9de 100644
--- a/xen/arch/x86/include/asm/pci.h
+++ b/xen/arch/x86/include/asm/pci.h
@@ -37,7 +37,7 @@ struct arch_pci_dev {
 int pci_conf_write_intercept(unsigned int seg, unsigned int bdf,
                              unsigned int reg, unsigned int size,
                              uint32_t *data);
-int pci_msi_conf_write_intercept(struct pci_dev *, unsigned int reg,
+int pci_msi_conf_write_intercept(struct pci_dev *pdev, unsigned int reg,
                                  unsigned int size, uint32_t *data);
 bool_t pci_mmcfg_decode(unsigned long mfn, unsigned int *seg,
                         unsigned int *bdf);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 04:12:05 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 04:12:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.637505.993348 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5I7I-0004sR-Vf; Tue, 21 Nov 2023 04:12:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 637505.993348; Tue, 21 Nov 2023 04: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 1r5I7I-0004sJ-Sv; Tue, 21 Nov 2023 04:12:04 +0000
Received: by outflank-mailman (input) for mailman id 637505;
 Tue, 21 Nov 2023 04: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 1r5I7H-0004s2-0R
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04: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 1r5I7G-0006Zm-Vq
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04:12:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5I7G-0007kC-U9
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04: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=VR7OBH8ZI8sjyccVB1uz1KTfEvT30x5WlziqKer8Yvc=; b=g5CEvDjhV8cHUYOyO/dr5KNEP7
	zyNT+OzxDqp2cWsEK33231wRLRiobIJqibP0aLXjzG9OdX6B9dCHzXmGrf5emeawBnebLqQi1WC07
	redZk9Dx2hio7/iSmg3OgmMnOc5BTNJWVDm1y4RD2mGVeOdjpBWqRhNmAfvWF2jZ7qn4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/physdev: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r5I7G-0007kC-U9@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 04:12:02 +0000

commit 168f87f590ca7e13755875795c7114f9fc3f5108
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Mon Nov 20 10:53:51 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 20 10:53:51 2023 +0100

    x86/physdev: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/physdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 2f1d955a96..47c4da0af7 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -18,9 +18,9 @@
 #include <xsm/xsm.h>
 #include <asm/p2m.h>
 
-int physdev_map_pirq(domid_t, int type, int *index, int *pirq_p,
-                     struct msi_info *);
-int physdev_unmap_pirq(domid_t, int pirq);
+int physdev_map_pirq(domid_t domid, int type, int *index, int *pirq_p,
+                     struct msi_info *msi);
+int physdev_unmap_pirq(domid_t domid, int pirq);
 
 #include "x86_64/mmconfig.h"
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 04:12:15 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 04:12:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.637506.993352 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5I7T-0004vA-16; Tue, 21 Nov 2023 04:12:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 637506.993352; Tue, 21 Nov 2023 04:12: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 1r5I7S-0004v1-UL; Tue, 21 Nov 2023 04:12:14 +0000
Received: by outflank-mailman (input) for mailman id 637506;
 Tue, 21 Nov 2023 04: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 1r5I7R-0004ua-3k
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04: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 1r5I7R-0006Zw-2u
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5I7R-0007ky-1b
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04: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=VzC+cSBpD2xRnmZJ9K9K5i4VYPnOIh7l3hHSYxj98eY=; b=5KaJcYl6sJnbfMPxw9wYXFLYWP
	66aIuu1VyzssQMJMQJvC+l8ns7elb84v4Xf7ur/pWvdhgeEVtpEDYTbyyJiLtoVQJnsJU+8u75Ggl
	Y17shJ+y0YgOCyB5zy9XXKVLQZZ+yDgX/5TBriY2xE+obmEpGVzXtWFMRUUcSg7kOPJI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/platform_hypercall: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r5I7R-0007ky-1b@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 04:12:13 +0000

commit 05644bd9d2eb98c43b64e44525a52e96df14a081
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Mon Nov 20 10:54:15 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 20 10:54:15 2023 +0100

    x86/platform_hypercall: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/platform_hypercall.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 9469de9045..c1ab552c57 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -46,9 +46,9 @@ struct resource_access {
     xenpf_resource_entry_t *entries;
 };
 
-long cf_check cpu_frequency_change_helper(void *);
-void check_resource_access(struct resource_access *);
-void cf_check resource_access(void *);
+long cf_check cpu_frequency_change_helper(void *data);
+void check_resource_access(struct resource_access *ra);
+void cf_check resource_access(void *info);
 
 #ifndef COMPAT
 typedef long ret_t;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 04:12:25 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 04:12:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.637507.993356 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5I7d-0004xx-37; Tue, 21 Nov 2023 04:12:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 637507.993356; Tue, 21 Nov 2023 04:12: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 1r5I7c-0004xn-Vu; Tue, 21 Nov 2023 04:12:24 +0000
Received: by outflank-mailman (input) for mailman id 637507;
 Tue, 21 Nov 2023 04: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 1r5I7b-0004xa-7a
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04: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 1r5I7b-0006a3-6K
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04:12:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5I7b-0007lb-5F
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04: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=QSMqnqKTeyLJdbsCUwD0cZtA5Qjipe43eCVXAKkoJYI=; b=PgP6vlCl5/rdpkJbyjOqEfmapq
	nk5E7tVlLlfs/ymehuQU6CXO0GoJ8SPlZgBeB1F7ElvJ/B/OLu1YqlXkfg1/xDHMXgAqctZdsHlll
	JrCa/kgnN8QN3hAaJx/NIJ6RNkGM0USNAmc3BkrDaClzFdmnGgMfD/O9KBlp6+1O/LnI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/sysctl: address a violation of MISRA C:2012 Rule 8.2
Message-Id: <E1r5I7b-0007lb-5F@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 04:12:23 +0000

commit b264570ba2b31034bd203bcbfb4bfaeaab3dcad4
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Mon Nov 20 10:54:46 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 20 10:54:46 2023 +0100

    x86/sysctl: address a violation of MISRA C:2012 Rule 8.2
    
    Add missing parameter name. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/sysctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index c107f40c62..1d40d82c5a 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -118,7 +118,7 @@ long arch_do_sysctl(
         unsigned int cpu = sysctl->u.cpu_hotplug.cpu;
         unsigned int op  = sysctl->u.cpu_hotplug.op;
         bool plug;
-        long (*fn)(void *);
+        long (*fn)(void *data);
         void *hcpu;
 
         switch ( op )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 04:12:34 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 04:12:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.637508.993359 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5I7m-000515-5G; Tue, 21 Nov 2023 04:12:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 637508.993359; Tue, 21 Nov 2023 04: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 1r5I7m-00050y-2o; Tue, 21 Nov 2023 04:12:34 +0000
Received: by outflank-mailman (input) for mailman id 637508;
 Tue, 21 Nov 2023 04: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 1r5I7l-00050f-A5
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04: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 1r5I7l-0006aH-9I
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04:12:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5I7l-0007m7-8Q
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 04: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=82JuOpuWZDQPRJsRyp+smDEQpupMvDSSkYto7AeW6rw=; b=Q0lCqhZEJm6MJZL+xEfh5YsC+L
	NaOv66/BrOfDsrRSqgP+kredPUkoCYRkzwAY/YMPeoXO74tsx5TwjGDueN91Di/7lGvkNFgcGbMg4
	uaaUG823RR03BkEKT1JY36fMIdo1MhnT4gcjh6sxp67TWqC2gzvMkd3uKHLgZKReWcWA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] amd/iommu: fully initialize array in 'flush_command_buffer'
Message-Id: <E1r5I7l-0007m7-8Q@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 04:12:33 +0000

commit cfb777791d39e025cf625ba1fa080597d4defef6
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Mon Nov 20 10:55:12 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 20 10:55:12 2023 +0100

    amd/iommu: fully initialize array in 'flush_command_buffer'
    
    Fully explicit initialization of the cmd array resolves a violation of
    MISRA C:2012 Rule 9.3.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/amd/iommu_cmd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/amd/iommu_cmd.c b/xen/drivers/passthrough/amd/iommu_cmd.c
index cb28b36abc..49b9fcac94 100644
--- a/xen/drivers/passthrough/amd/iommu_cmd.c
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c
@@ -66,7 +66,8 @@ static void flush_command_buffer(struct amd_iommu *iommu,
                          IOMMU_COMP_WAIT_S_FLAG_MASK),
         (addr >> 32) | MASK_INSR(IOMMU_CMD_COMPLETION_WAIT,
                                  IOMMU_CMD_OPCODE_MASK),
-        CMD_COMPLETION_DONE
+        CMD_COMPLETION_DONE,
+        0
     };
     s_time_t start, timeout;
     static unsigned int __read_mostly threshold = 1;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 21:11:09 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 21:11:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.638250.994602 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5Y1P-0007Xc-Qd; Tue, 21 Nov 2023 21:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 638250.994602; Tue, 21 Nov 2023 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 1r5Y1P-0007XV-O4; Tue, 21 Nov 2023 21:11:03 +0000
Received: by outflank-mailman (input) for mailman id 638250;
 Tue, 21 Nov 2023 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 1r5Y1O-0007XP-AT
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 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 1r5Y1O-0003AQ-88
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5Y1O-0004t4-70
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 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=tvcHE9OlwiO1/gkRASRspNjmfTAHzcfn6qChV+yz9xg=; b=SM5eG9YmiErEE0NupwVJEQjWWh
	I8Ah5qDBIb61wb75wxzc2GA0/uaXTME3XbzpSXLS+MAE9y+AyWdvRkWaoXU2UKErti7bzI177PwhT
	wT2qclGWqSeovh3QG4/nXHNGWRD/9vxEbuMMzceWj4O0P4c3XUXgh4G/pmXw49WWAqC0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: make xenstore_buf externally visible
Message-Id: <E1r5Y1O-0004t4-70@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 21:11:02 +0000

commit 2be31de8351007b1840bc675c723d0c65f4b0f68
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Nov 21 10:49:49 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 21 21:05:11 2023 +0000

    Mini-OS: make xenstore_buf externally visible
    
    For support of the 9pfs frontend in Xenstore-stubdom xenstore_buf
    needs to be externally visible.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
---
 include/xenbus.h | 2 ++
 xenbus.c         | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/xenbus.h b/include/xenbus.h
index c0fc0ac..542ee45 100644
--- a/include/xenbus.h
+++ b/include/xenbus.h
@@ -8,12 +8,14 @@ typedef unsigned long xenbus_transaction_t;
 
 #ifdef CONFIG_XENBUS
 extern uint32_t xenbus_evtchn;
+extern struct xenstore_domain_interface *xenstore_buf;
 
 /* Initialize the XenBus system. */
 void init_xenbus(void);
 void get_xenbus(void *p);
 #else
 #define xenbus_evtchn ~0
+#define xenstore_buf NULL
 
 static inline void init_xenbus(void)
 {
diff --git a/xenbus.c b/xenbus.c
index 923e818..8bfd5bd 100644
--- a/xenbus.c
+++ b/xenbus.c
@@ -44,7 +44,7 @@
 #define DEBUG(_f, _a...)    ((void)0)
 #endif
 
-static struct xenstore_domain_interface *xenstore_buf;
+struct xenstore_domain_interface *xenstore_buf;
 static DECLARE_WAIT_QUEUE_HEAD(xb_waitq);
 DECLARE_WAIT_QUEUE_HEAD(xenbus_watch_queue);
 static __DECLARE_SEMAPHORE_GENERIC(xb_write_sem, 1);
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 21:11:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 21:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.638251.994607 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5Y1Z-0007Zd-SB; Tue, 21 Nov 2023 21:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 638251.994607; Tue, 21 Nov 2023 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 1r5Y1Z-0007ZV-PY; Tue, 21 Nov 2023 21:11:13 +0000
Received: by outflank-mailman (input) for mailman id 638251;
 Tue, 21 Nov 2023 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 1r5Y1Y-0007ZL-Dv
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 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 1r5Y1Y-0003An-Bt
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5Y1Y-0004ti-A6
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 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=VwwA2huVlM8zM8+ecRDt/I2M+D1coKJr4QB93UK9oLU=; b=FsoV/3Flp4WoyQ2kAn6mIoY1/v
	0ZVhtpvZgujKBg4MQ+3kETPAHvkApClD+YPGIfumjO9Lxw2gmV9y0rvgQFtwOYwMfxGDf2H6WZk+Q
	a4I9TpmNC+qw0jx5M2neVPeGOXOA+P6+titN9glp1igOXcRhPL9B+sBAk775PeTMUaWs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: get own domid
Message-Id: <E1r5Y1Y-0004ti-A6@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 21:11:12 +0000

commit b702dbdfc0dec45491abc9e31e23c37f95293b5b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Nov 21 10:49:50 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 21 21:05:11 2023 +0000

    Mini-OS: get own domid
    
    Get the own domid via creation of a temporary event channel. There is
    no "official" way to read the own domid in PV guests, so use the event
    channel interface to get it:
    
    - allocate an unbound event channel specifying DOMID_SELF for the
      other end
    
    - read the event channel status which will contain the own domid in
      unbound.dom
    
    - close the event channel
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 events.c      | 33 +++++++++++++++++++++++++++++++++
 include/lib.h |  3 +++
 2 files changed, 36 insertions(+)

diff --git a/events.c b/events.c
index cdae90f..4683e8e 100644
--- a/events.c
+++ b/events.c
@@ -261,6 +261,39 @@ int evtchn_get_peercontext(evtchn_port_t local_port, char *ctx, int size)
     return rc;
 }
 
+/* Replace below when a hypercall is available to get the domid. */
+domid_t get_domid(void)
+{
+    int rc;
+    domid_t domid = DOMID_INVALID;
+    evtchn_alloc_unbound_t op;
+    struct evtchn_status status;
+    struct evtchn_close close;
+
+    op.dom = DOMID_SELF;
+    op.remote_dom = DOMID_SELF;
+    rc = HYPERVISOR_event_channel_op(EVTCHNOP_alloc_unbound, &op);
+    if ( rc )
+    {
+        printk("ERROR: alloc_unbound failed with rc=%d", rc);
+        return domid;
+    }
+
+    status.dom = DOMID_SELF;
+    status.port = op.port;
+    rc = HYPERVISOR_event_channel_op(EVTCHNOP_status, &status);
+    if ( rc )
+        printk("ERROR: EVTCHNOP_status failed with rc=%d", rc);
+    else
+        domid = status.u.unbound.dom;
+
+    close.port = op.port;
+    rc = HYPERVISOR_event_channel_op(EVTCHNOP_close, &close);
+    if ( rc )
+        printk("WARN: close_port %d failed rc=%d. ignored\n", close.port, rc);
+
+    return domid;
+}
 
 /*
  * Local variables:
diff --git a/include/lib.h b/include/lib.h
index fd8c36d..dd68985 100644
--- a/include/lib.h
+++ b/include/lib.h
@@ -154,6 +154,9 @@ do {                                                           \
 /* Consistency check as much as possible. */
 void sanity_check(void);
 
+/* Get own domid. */
+domid_t get_domid(void);
+
 #ifdef HAVE_LIBC
 extern struct wait_queue_head event_queue;
 
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 21:11:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 21:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.638252.994610 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5Y1j-0007cT-Ti; Tue, 21 Nov 2023 21:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 638252.994610; Tue, 21 Nov 2023 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 1r5Y1j-0007cL-R6; Tue, 21 Nov 2023 21:11:23 +0000
Received: by outflank-mailman (input) for mailman id 638252;
 Tue, 21 Nov 2023 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 1r5Y1i-0007cB-Fk
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 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 1r5Y1i-0003Ay-Ey
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5Y1i-0004u9-Dt
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 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=oDGJHO9zO82dIDUBJ+h216IXPXOaJtM1BprAyvn3bf0=; b=oKz8Kprr+uWlknpz2f9XFNJ1xt
	lyHLYBWkoUp+WLsZwwzjOfEIjIcQlXh+KiqpCrc1uVsCkCoehuQd4W525nNQFKyLV/0LytgAU/vIZ
	eVzZ2mWjYR3/Ehr3Y1ucaYaM+WFf9rLPNAPE9MuGwjbOVLTUEFPitEKuVp00xeYY4Tuk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: don't crash if no shutdown node is available
Message-Id: <E1r5Y1i-0004u9-Dt@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 21:11:22 +0000

commit 961ed15f04f5d8fc96279836cf52bc36d0a5141e
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Nov 21 10:49:51 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 21 21:05:11 2023 +0000

    Mini-OS: don't crash if no shutdown node is available
    
    It might be perfectly fine not to have a control/shutdown Xenstore
    node. If this is the case, don't crash, but just terminate the
    shutdown thread after issuing a message that shutdown isn't available.
    
    In fini_shutdown() clearing the watch can result in an error now, in
    case the early exit above was taken. Just ignore this error now.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
---
 shutdown.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/shutdown.c b/shutdown.c
index bb2c6f1..ded6b64 100644
--- a/shutdown.c
+++ b/shutdown.c
@@ -75,7 +75,9 @@ static void shutdown_thread(void *p)
         xenbus_wait_for_watch(&events);
         if ((err = xenbus_read(XBT_NIL, path, &shutdown))) {
             free(err);
-            do_exit();
+            free(xenbus_unwatch_path_token(XBT_NIL, path, token));
+            printk("Shutdown Xenstore node not available.\n");
+            return;
         }
 
         if (end_shutdown_thread)
@@ -117,15 +119,9 @@ void init_shutdown(void)
 
 void fini_shutdown(void)
 {
-    char *err;
-
     end_shutdown_thread = 1;
     xenbus_release_wait_for_watch(&events);
-    err = xenbus_unwatch_path_token(XBT_NIL, path, token);
-    if (err) {
-        free(err);
-        do_exit();
-    }
+    free(xenbus_unwatch_path_token(XBT_NIL, path, token));
 }
 #endif
 
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 21:11:34 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 21:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.638253.994614 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5Y1t-0007f1-VO; Tue, 21 Nov 2023 21:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 638253.994614; Tue, 21 Nov 2023 21:11:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5Y1t-0007et-Sm; Tue, 21 Nov 2023 21:11:33 +0000
Received: by outflank-mailman (input) for mailman id 638253;
 Tue, 21 Nov 2023 21:11:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5Y1s-0007ej-In
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:11:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5Y1s-0003Cc-Hv
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5Y1s-0004ul-Gu
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 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=KlUCgEKBbi3KB9FzfVjoB5Nh01DBGQoBMWyLpKQAFAc=; b=BIK6H3ZYdHKp57yfWmAItNFgVI
	22kpy9eJCipkLZ9YAk6VAHSNaP5i1T8B3BQCv6M6Yl+S/vchicos9/QbjlKb4Kt+AmqDIUc+EWIKi
	zUgMEcxlE4lwXOcVT3LgiYnr1wUc7Ot1QzXRdsmm4gM17c7rBOKUKkkP//BNPObAwMCU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: fix 9pfs stat receive format
Message-Id: <E1r5Y1s-0004ul-Gu@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 21:11:32 +0000

commit 02c0e51fc9ab7cf404414431de224a62a62f558d
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Nov 21 10:49:52 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 21 21:05:11 2023 +0000

    Mini-OS: fix 9pfs stat receive format
    
    The format string of the received data for the 9pfs stat command is
    missing the initial 2 byte total length specifier. Add it.
    
    Fixes: 2d1dfccd3aa3 ("Mini-OS: add read and write support to 9pfsfront")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
---
 9pfront.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/9pfront.c b/9pfront.c
index 5da8a36..43c7409 100644
--- a/9pfront.c
+++ b/9pfront.c
@@ -711,6 +711,7 @@ static int p9_create(struct dev_9pfs *dev, uint32_t fid, char *path,
 static int p9_stat(struct dev_9pfs *dev, uint32_t fid, struct p9_stat *stat)
 {
     struct req *req = get_free_req(dev);
+    uint16_t total;
     int ret;
 
     if ( !req )
@@ -719,10 +720,10 @@ static int p9_stat(struct dev_9pfs *dev, uint32_t fid, struct p9_stat *stat)
     memset(stat, 0, sizeof(*stat));
     req->cmd = P9_CMD_STAT;
     send_9p(dev, req, "U", fid);
-    rcv_9p(dev, req, "uuUQUUULSSSSSUUU", &stat->size, &stat->type, &stat->dev,
-           stat->qid, &stat->mode, &stat->atime, &stat->mtime, &stat->length,
-           &stat->name, &stat->uid, &stat->gid, &stat->muid, &stat->extension,
-           &stat->n_uid, &stat->n_gid, &stat->n_muid);
+    rcv_9p(dev, req, "uuuUQUUULSSSSSUUU", &total, &stat->size, &stat->type,
+           &stat->dev, stat->qid, &stat->mode, &stat->atime, &stat->mtime,
+           &stat->length, &stat->name, &stat->uid, &stat->gid, &stat->muid,
+           &stat->extension, &stat->n_uid, &stat->n_gid, &stat->n_muid);
 
     ret = req->result;
 
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 21:11:44 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 21:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.638255.994618 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5Y24-0007jE-0X; Tue, 21 Nov 2023 21:11:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 638255.994618; Tue, 21 Nov 2023 21: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 1r5Y23-0007j6-UE; Tue, 21 Nov 2023 21:11:43 +0000
Received: by outflank-mailman (input) for mailman id 638255;
 Tue, 21 Nov 2023 21: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 1r5Y22-0007ik-Lj
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21: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 1r5Y22-0003Ck-Kw
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5Y22-0004vC-Jx
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21: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=zbnrU+JsdFY3RX7Urkx5Lr88vZxUdfjEfIdkDOrhmEg=; b=rE5bYxJnm5ynx9YUCck3DmMX0/
	QILm+ZaLBab2lYAu5AdlaOfP7lWeb3zmT2drGDln9tHyMFQNLBBIb8l3I4MyflEscaDonGB1tUcYr
	5y+l2baY17m1Std0arV6eqydvnUB5ErbAMRpHf6LoDTLdLwVTarR4nXBBfamf2esotw0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: fix 9pfs response receiving
Message-Id: <E1r5Y22-0004vC-Jx@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 21:11:42 +0000

commit b08019f0b2fbc30c75169a160acb9fd9af5d68f4
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Nov 21 10:49:53 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 21 21:05:11 2023 +0000

    Mini-OS: fix 9pfs response receiving
    
    When copying a 9pfs response chunk from the ring buffer across the
    ring end, the local ring pointer and length field are not updated
    correctly. Fix that.
    
    Fixes: 0924fec1de58 ("Mini-OS: add 9pfs transport layer")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 9pfront.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/9pfront.c b/9pfront.c
index 43c7409..35c5552 100644
--- a/9pfront.c
+++ b/9pfront.c
@@ -386,7 +386,9 @@ static void copy_bufs(unsigned char **buf1, unsigned char **buf2,
             printk("9pfs: short copy (dropping %u bytes)\n", len - *len1);
             len = *len1;
         }
-        memcpy(target, *buf1, *len1);
+        memcpy(target, *buf1, len);
+        *buf1 += len;
+        *len1 -= len;
     }
 }
 
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 21:33:05 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 21:33:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.638274.994653 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5YMh-0005KB-7c; Tue, 21 Nov 2023 21:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 638274.994653; Tue, 21 Nov 2023 21: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 1r5YMh-0005K4-4w; Tue, 21 Nov 2023 21:33:03 +0000
Received: by outflank-mailman (input) for mailman id 638274;
 Tue, 21 Nov 2023 21: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 1r5YMg-0005Jw-Fc
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21: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 1r5YMg-0003YN-Ae
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5YMg-0005l4-8m
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21: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=AffAKRide7g1RLYjWaFXtokOQNquJ4DynhQx+p4wMYU=; b=3J7542vKR5iUN1u3bZahiFfWs3
	wcmxvgcdoK2aBrzMEmqq0NIn0Xra5bAnz9l0RmZ8YVjJfA0q4m33Io6AQXG8Iqow0qmQawUlNsrbp
	+u+50sOqUVjXPZx6vw2/LVMidDVkdYxQ4JEHAO7ktqdxLea46iIkfIAeTypr91/iVyTY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Split page table related code to mmu/pt.c
Message-Id: <E1r5YMg-0005l4-8m@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 21:33:02 +0000

commit 1bf8a6aafca9cef0a183cca5bebf085c40582208
Author:     Henry Wang <Henry.Wang@arm.com>
AuthorDate: Thu Nov 16 22:50:25 2023 +0800
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Nov 20 19:07:45 2023 +0000

    xen/arm: Split page table related code to mmu/pt.c
    
    The extraction of MMU related code is the basis of MPU support.
    This commit starts this work by firstly splitting the page table
    related code to mmu/pt.c, so that we will not end up with again
    massive mm.c files.
    
    Introduce a mmu specific directory and setup the Makefiles for it.
    Move the page table related functions and macros from arch/arm/mm.c
    to arch/arm/mmu/pt.c.
    
    Take the opportunity to fix the in-code comment coding styles when
    possible, and drop the unnecessary #include headers in the original
    arch/arm/mm.c.
    
    Signed-off-by: Henry Wang <Henry.Wang@arm.com>
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/Makefile     |   1 +
 xen/arch/arm/mm.c         | 717 --------------------------------------------
 xen/arch/arm/mmu/Makefile |   1 +
 xen/arch/arm/mmu/pt.c     | 736 ++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 738 insertions(+), 717 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 7bf07e9920..c45b08b31e 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -1,5 +1,6 @@
 obj-$(CONFIG_ARM_32) += arm32/
 obj-$(CONFIG_ARM_64) += arm64/
+obj-$(CONFIG_MMU) += mmu/
 obj-$(CONFIG_ACPI) += acpi/
 obj-$(CONFIG_HAS_PCI) += pci/
 ifneq ($(CONFIG_NO_PLAT),y)
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index c34cc94c90..fd02493564 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -9,22 +9,14 @@
  */
 
 #include <xen/domain_page.h>
-#include <xen/errno.h>
 #include <xen/grant_table.h>
 #include <xen/guest_access.h>
-#include <xen/init.h>
 #include <xen/libfdt/libfdt.h>
 #include <xen/mm.h>
-#include <xen/pfn.h>
-#include <xen/pmap.h>
-#include <xen/sched.h>
 #include <xen/sizes.h>
-#include <xen/types.h>
-#include <xen/vmap.h>
 
 #include <xsm/xsm.h>
 
-#include <asm/fixmap.h>
 #include <asm/setup.h>
 
 #include <public/memory.h>
@@ -35,19 +27,6 @@
 #undef mfn_to_virt
 #define mfn_to_virt(mfn) __mfn_to_virt(mfn_x(mfn))
 
-#ifdef NDEBUG
-static inline void
-__attribute__ ((__format__ (__printf__, 1, 2)))
-mm_printk(const char *fmt, ...) {}
-#else
-#define mm_printk(fmt, args...)             \
-    do                                      \
-    {                                       \
-        dprintk(XENLOG_ERR, fmt, ## args);  \
-        WARN();                             \
-    } while (0)
-#endif
-
 /* Static start-of-day pagetables that we use before the allocators
  * are up. These are used by all CPUs during bringup before switching
  * to the CPUs own pagetables.
@@ -92,12 +71,10 @@ DEFINE_BOOT_PAGE_TABLES(boot_third, XEN_NR_ENTRIES(2));
  */
 
 #ifdef CONFIG_ARM_64
-#define HYP_PT_ROOT_LEVEL 0
 DEFINE_PAGE_TABLE(xen_pgtable);
 static DEFINE_PAGE_TABLE(xen_first);
 #define THIS_CPU_PGTABLE xen_pgtable
 #else
-#define HYP_PT_ROOT_LEVEL 1
 /* Per-CPU pagetable pages */
 /* xen_pgtable == root of the trie (zeroeth level on 64-bit, first on 32-bit) */
 DEFINE_PER_CPU(lpae_t *, xen_pgtable);
@@ -200,179 +177,6 @@ static void __init __maybe_unused build_assertions(void)
 #undef CHECK_DIFFERENT_SLOT
 }
 
-static lpae_t *xen_map_table(mfn_t mfn)
-{
-    /*
-     * During early boot, map_domain_page() may be unusable. Use the
-     * PMAP to map temporarily a page-table.
-     */
-    if ( system_state == SYS_STATE_early_boot )
-        return pmap_map(mfn);
-
-    return map_domain_page(mfn);
-}
-
-static void xen_unmap_table(const lpae_t *table)
-{
-    /*
-     * During early boot, xen_map_table() will not use map_domain_page()
-     * but the PMAP.
-     */
-    if ( system_state == SYS_STATE_early_boot )
-        pmap_unmap(table);
-    else
-        unmap_domain_page(table);
-}
-
-void dump_pt_walk(paddr_t ttbr, paddr_t addr,
-                  unsigned int root_level,
-                  unsigned int nr_root_tables)
-{
-    static const char *level_strs[4] = { "0TH", "1ST", "2ND", "3RD" };
-    const mfn_t root_mfn = maddr_to_mfn(ttbr);
-    DECLARE_OFFSETS(offsets, addr);
-    lpae_t pte, *mapping;
-    unsigned int level, root_table;
-
-#ifdef CONFIG_ARM_32
-    BUG_ON(root_level < 1);
-#endif
-    BUG_ON(root_level > 3);
-
-    if ( nr_root_tables > 1 )
-    {
-        /*
-         * Concatenated root-level tables. The table number will be
-         * the offset at the previous level. It is not possible to
-         * concatenate a level-0 root.
-         */
-        BUG_ON(root_level == 0);
-        root_table = offsets[root_level - 1];
-        printk("Using concatenated root table %u\n", root_table);
-        if ( root_table >= nr_root_tables )
-        {
-            printk("Invalid root table offset\n");
-            return;
-        }
-    }
-    else
-        root_table = 0;
-
-    mapping = xen_map_table(mfn_add(root_mfn, root_table));
-
-    for ( level = root_level; ; level++ )
-    {
-        if ( offsets[level] > XEN_PT_LPAE_ENTRIES )
-            break;
-
-        pte = mapping[offsets[level]];
-
-        printk("%s[0x%03x] = 0x%"PRIx64"\n",
-               level_strs[level], offsets[level], pte.bits);
-
-        if ( level == 3 || !pte.walk.valid || !pte.walk.table )
-            break;
-
-        /* For next iteration */
-        xen_unmap_table(mapping);
-        mapping = xen_map_table(lpae_get_mfn(pte));
-    }
-
-    xen_unmap_table(mapping);
-}
-
-void dump_hyp_walk(vaddr_t addr)
-{
-    uint64_t ttbr = READ_SYSREG64(TTBR0_EL2);
-
-    printk("Walking Hypervisor VA 0x%"PRIvaddr" "
-           "on CPU%d via TTBR 0x%016"PRIx64"\n",
-           addr, smp_processor_id(), ttbr);
-
-    dump_pt_walk(ttbr, addr, HYP_PT_ROOT_LEVEL, 1);
-}
-
-lpae_t mfn_to_xen_entry(mfn_t mfn, unsigned int attr)
-{
-    lpae_t e = (lpae_t) {
-        .pt = {
-            .valid = 1,           /* Mappings are present */
-            .table = 0,           /* Set to 1 for links and 4k maps */
-            .ai = attr,
-            .ns = 1,              /* Hyp mode is in the non-secure world */
-            .up = 1,              /* See below */
-            .ro = 0,              /* Assume read-write */
-            .af = 1,              /* No need for access tracking */
-            .ng = 1,              /* Makes TLB flushes easier */
-            .contig = 0,          /* Assume non-contiguous */
-            .xn = 1,              /* No need to execute outside .text */
-            .avail = 0,           /* Reference count for domheap mapping */
-        }};
-    /*
-     * For EL2 stage-1 page table, up (aka AP[1]) is RES1 as the translation
-     * regime applies to only one exception level (see D4.4.4 and G4.6.1
-     * in ARM DDI 0487B.a). If this changes, remember to update the
-     * hard-coded values in head.S too.
-     */
-
-    switch ( attr )
-    {
-    case MT_NORMAL_NC:
-        /*
-         * ARM ARM: Overlaying the shareability attribute (DDI
-         * 0406C.b B3-1376 to 1377)
-         *
-         * A memory region with a resultant memory type attribute of Normal,
-         * and a resultant cacheability attribute of Inner Non-cacheable,
-         * Outer Non-cacheable, must have a resultant shareability attribute
-         * of Outer Shareable, otherwise shareability is UNPREDICTABLE.
-         *
-         * On ARMv8 sharability is ignored and explicitly treated as Outer
-         * Shareable for Normal Inner Non_cacheable, Outer Non-cacheable.
-         */
-        e.pt.sh = LPAE_SH_OUTER;
-        break;
-    case MT_DEVICE_nGnRnE:
-    case MT_DEVICE_nGnRE:
-        /*
-         * Shareability is ignored for non-Normal memory, Outer is as
-         * good as anything.
-         *
-         * On ARMv8 sharability is ignored and explicitly treated as Outer
-         * Shareable for any device memory type.
-         */
-        e.pt.sh = LPAE_SH_OUTER;
-        break;
-    default:
-        e.pt.sh = LPAE_SH_INNER;  /* Xen mappings are SMP coherent */
-        break;
-    }
-
-    ASSERT(!(mfn_to_maddr(mfn) & ~PADDR_MASK));
-
-    lpae_set_mfn(e, mfn);
-
-    return e;
-}
-
-/* Map a 4k page in a fixmap entry */
-void set_fixmap(unsigned int map, mfn_t mfn, unsigned int flags)
-{
-    int res;
-
-    res = map_pages_to_xen(FIXMAP_ADDR(map), mfn, 1, flags);
-    BUG_ON(res != 0);
-}
-
-/* Remove a mapping from a fixmap entry */
-void clear_fixmap(unsigned int map)
-{
-    int res;
-
-    res = destroy_xen_mappings(FIXMAP_ADDR(map), FIXMAP_ADDR(map) + PAGE_SIZE);
-    BUG_ON(res != 0);
-}
-
 void flush_page_to_ram(unsigned long mfn, bool sync_icache)
 {
     void *v = map_domain_page(_mfn(mfn));
@@ -733,527 +537,6 @@ void *__init arch_vmap_virt_end(void)
     return (void *)(VMAP_VIRT_START + VMAP_VIRT_SIZE);
 }
 
-/*
- * This function should only be used to remap device address ranges
- * TODO: add a check to verify this assumption
- */
-void *ioremap_attr(paddr_t start, size_t len, unsigned int attributes)
-{
-    mfn_t mfn = _mfn(PFN_DOWN(start));
-    unsigned int offs = start & (PAGE_SIZE - 1);
-    unsigned int nr = PFN_UP(offs + len);
-    void *ptr = __vmap(&mfn, nr, 1, 1, attributes, VMAP_DEFAULT);
-
-    if ( ptr == NULL )
-        return NULL;
-
-    return ptr + offs;
-}
-
-void *ioremap(paddr_t pa, size_t len)
-{
-    return ioremap_attr(pa, len, PAGE_HYPERVISOR_NOCACHE);
-}
-
-static int create_xen_table(lpae_t *entry)
-{
-    mfn_t mfn;
-    void *p;
-    lpae_t pte;
-
-    if ( system_state != SYS_STATE_early_boot )
-    {
-        struct page_info *pg = alloc_domheap_page(NULL, 0);
-
-        if ( pg == NULL )
-            return -ENOMEM;
-
-        mfn = page_to_mfn(pg);
-    }
-    else
-        mfn = alloc_boot_pages(1, 1);
-
-    p = xen_map_table(mfn);
-    clear_page(p);
-    xen_unmap_table(p);
-
-    pte = mfn_to_xen_entry(mfn, MT_NORMAL);
-    pte.pt.table = 1;
-    write_pte(entry, pte);
-    /*
-     * No ISB here. It is deferred to xen_pt_update() as the new table
-     * will not be used for hardware translation table access as part of
-     * the mapping update.
-     */
-
-    return 0;
-}
-
-#define XEN_TABLE_MAP_FAILED 0
-#define XEN_TABLE_SUPER_PAGE 1
-#define XEN_TABLE_NORMAL_PAGE 2
-
-/*
- * Take the currently mapped table, find the corresponding entry,
- * and map the next table, if available.
- *
- * The read_only parameters indicates whether intermediate tables should
- * be allocated when not present.
- *
- * Return values:
- *  XEN_TABLE_MAP_FAILED: Either read_only was set and the entry
- *  was empty, or allocating a new page failed.
- *  XEN_TABLE_NORMAL_PAGE: next level mapped normally
- *  XEN_TABLE_SUPER_PAGE: The next entry points to a superpage.
- */
-static int xen_pt_next_level(bool read_only, unsigned int level,
-                             lpae_t **table, unsigned int offset)
-{
-    lpae_t *entry;
-    int ret;
-    mfn_t mfn;
-
-    entry = *table + offset;
-
-    if ( !lpae_is_valid(*entry) )
-    {
-        if ( read_only )
-            return XEN_TABLE_MAP_FAILED;
-
-        ret = create_xen_table(entry);
-        if ( ret )
-            return XEN_TABLE_MAP_FAILED;
-    }
-
-    /* The function xen_pt_next_level is never called at the 3rd 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(mfn);
-
-    return XEN_TABLE_NORMAL_PAGE;
-}
-
-/* Sanity check of the entry */
-static bool xen_pt_check_entry(lpae_t entry, mfn_t mfn, unsigned int level,
-                               unsigned int flags)
-{
-    /* Sanity check when modifying an entry. */
-    if ( (flags & _PAGE_PRESENT) && mfn_eq(mfn, INVALID_MFN) )
-    {
-        /* We don't allow modifying an invalid entry. */
-        if ( !lpae_is_valid(entry) )
-        {
-            mm_printk("Modifying invalid entry is not allowed.\n");
-            return false;
-        }
-
-        /* We don't allow modifying a table entry */
-        if ( !lpae_is_mapping(entry, level) )
-        {
-            mm_printk("Modifying a table entry is not allowed.\n");
-            return false;
-        }
-
-        /* We don't allow changing memory attributes. */
-        if ( entry.pt.ai != PAGE_AI_MASK(flags) )
-        {
-            mm_printk("Modifying memory attributes is not allowed (0x%x -> 0x%x).\n",
-                      entry.pt.ai, PAGE_AI_MASK(flags));
-            return false;
-        }
-
-        /* We don't allow modifying entry with contiguous bit set. */
-        if ( entry.pt.contig )
-        {
-            mm_printk("Modifying entry with contiguous bit set is not allowed.\n");
-            return false;
-        }
-    }
-    /* Sanity check when inserting a mapping */
-    else if ( flags & _PAGE_PRESENT )
-    {
-        /* We should be here with a valid MFN. */
-        ASSERT(!mfn_eq(mfn, INVALID_MFN));
-
-        /*
-         * We don't allow replacing any valid entry.
-         *
-         * Note that the function xen_pt_update() relies on this
-         * assumption and will skip the TLB flush. The function will need
-         * to be updated if the check is relaxed.
-         */
-        if ( lpae_is_valid(entry) )
-        {
-            if ( lpae_is_mapping(entry, level) )
-                mm_printk("Changing MFN for a valid entry is not allowed (%#"PRI_mfn" -> %#"PRI_mfn").\n",
-                          mfn_x(lpae_get_mfn(entry)), mfn_x(mfn));
-            else
-                mm_printk("Trying to replace a table with a mapping.\n");
-            return false;
-        }
-    }
-    /* Sanity check when removing a mapping. */
-    else if ( (flags & (_PAGE_PRESENT|_PAGE_POPULATE)) == 0 )
-    {
-        /* We should be here with an invalid MFN. */
-        ASSERT(mfn_eq(mfn, INVALID_MFN));
-
-        /* We don't allow removing a table */
-        if ( lpae_is_table(entry, level) )
-        {
-            mm_printk("Removing a table is not allowed.\n");
-            return false;
-        }
-
-        /* We don't allow removing a mapping with contiguous bit set. */
-        if ( entry.pt.contig )
-        {
-            mm_printk("Removing entry with contiguous bit set is not allowed.\n");
-            return false;
-        }
-    }
-    /* Sanity check when populating the page-table. No check so far. */
-    else
-    {
-        ASSERT(flags & _PAGE_POPULATE);
-        /* We should be here with an invalid MFN */
-        ASSERT(mfn_eq(mfn, INVALID_MFN));
-    }
-
-    return true;
-}
-
-/* Update an entry at the level @target. */
-static int xen_pt_update_entry(mfn_t root, unsigned long virt,
-                               mfn_t mfn, unsigned int target,
-                               unsigned int flags)
-{
-    int rc;
-    unsigned int level;
-    lpae_t *table;
-    /*
-     * The intermediate page tables are read-only when the MFN is not valid
-     * and we are not populating page table.
-     * This means we either modify permissions or remove an entry.
-     */
-    bool read_only = mfn_eq(mfn, INVALID_MFN) && !(flags & _PAGE_POPULATE);
-    lpae_t pte, *entry;
-
-    /* convenience aliases */
-    DECLARE_OFFSETS(offsets, (paddr_t)virt);
-
-    /* _PAGE_POPULATE and _PAGE_PRESENT should never be set together. */
-    ASSERT((flags & (_PAGE_POPULATE|_PAGE_PRESENT)) != (_PAGE_POPULATE|_PAGE_PRESENT));
-
-    table = xen_map_table(root);
-    for ( level = HYP_PT_ROOT_LEVEL; level < target; level++ )
-    {
-        rc = xen_pt_next_level(read_only, level, &table, offsets[level]);
-        if ( rc == XEN_TABLE_MAP_FAILED )
-        {
-            /*
-             * We are here because xen_pt_next_level has failed to map
-             * the intermediate page table (e.g the table does not exist
-             * and the pt is read-only). It is a valid case when
-             * removing a mapping as it may not exist in the page table.
-             * In this case, just ignore it.
-             */
-            if ( flags & (_PAGE_PRESENT|_PAGE_POPULATE) )
-            {
-                mm_printk("%s: Unable to map level %u\n", __func__, level);
-                rc = -ENOENT;
-                goto out;
-            }
-            else
-            {
-                rc = 0;
-                goto out;
-            }
-        }
-        else if ( rc != XEN_TABLE_NORMAL_PAGE )
-            break;
-    }
-
-    if ( level != target )
-    {
-        mm_printk("%s: Shattering superpage is not supported\n", __func__);
-        rc = -EOPNOTSUPP;
-        goto out;
-    }
-
-    entry = table + offsets[level];
-
-    rc = -EINVAL;
-    if ( !xen_pt_check_entry(*entry, mfn, level, flags) )
-        goto out;
-
-    /* If we are only populating page-table, then we are done. */
-    rc = 0;
-    if ( flags & _PAGE_POPULATE )
-        goto out;
-
-    /* We are removing the page */
-    if ( !(flags & _PAGE_PRESENT) )
-        memset(&pte, 0x00, sizeof(pte));
-    else
-    {
-        /* We are inserting a mapping => Create new pte. */
-        if ( !mfn_eq(mfn, INVALID_MFN) )
-        {
-            pte = mfn_to_xen_entry(mfn, PAGE_AI_MASK(flags));
-
-            /*
-             * First and second level pages set pte.pt.table = 0, but
-             * third level entries set pte.pt.table = 1.
-             */
-            pte.pt.table = (level == 3);
-        }
-        else /* We are updating the permission => Copy the current pte. */
-            pte = *entry;
-
-        /* Set permission */
-        pte.pt.ro = PAGE_RO_MASK(flags);
-        pte.pt.xn = PAGE_XN_MASK(flags);
-        /* Set contiguous bit */
-        pte.pt.contig = !!(flags & _PAGE_CONTIG);
-    }
-
-    write_pte(entry, pte);
-    /*
-     * No ISB or TLB flush here. They are deferred to xen_pt_update()
-     * as the entry will not be used as part of the mapping update.
-     */
-
-    rc = 0;
-
-out:
-    xen_unmap_table(table);
-
-    return rc;
-}
-
-/* Return the level where mapping should be done */
-static int xen_pt_mapping_level(unsigned long vfn, mfn_t mfn, unsigned long nr,
-                                unsigned int flags)
-{
-    unsigned int level;
-    unsigned long mask;
-
-    /*
-      * Don't take into account the MFN when removing mapping (i.e
-      * MFN_INVALID) to calculate the correct target order.
-      *
-      * Per the Arm Arm, `vfn` and `mfn` must be both superpage aligned.
-      * They are or-ed together and then checked against the size of
-      * each level.
-      *
-      * `left` is not included and checked separately to allow
-      * superpage mapping even if it is not properly aligned (the
-      * user may have asked to map 2MB + 4k).
-      */
-     mask = !mfn_eq(mfn, INVALID_MFN) ? mfn_x(mfn) : 0;
-     mask |= vfn;
-
-     /*
-      * Always use level 3 mapping unless the caller request block
-      * mapping.
-      */
-     if ( likely(!(flags & _PAGE_BLOCK)) )
-         level = 3;
-     else if ( !(mask & (BIT(FIRST_ORDER, UL) - 1)) &&
-               (nr >= BIT(FIRST_ORDER, UL)) )
-         level = 1;
-     else if ( !(mask & (BIT(SECOND_ORDER, UL) - 1)) &&
-               (nr >= BIT(SECOND_ORDER, UL)) )
-         level = 2;
-     else
-         level = 3;
-
-     return level;
-}
-
-#define XEN_PT_4K_NR_CONTIG 16
-
-/*
- * Check whether the contiguous bit can be set. Return the number of
- * contiguous entry allowed. If not allowed, return 1.
- */
-static unsigned int xen_pt_check_contig(unsigned long vfn, mfn_t mfn,
-                                        unsigned int level, unsigned long left,
-                                        unsigned int flags)
-{
-    unsigned long nr_contig;
-
-    /*
-     * Allow the contiguous bit to set when the caller requests block
-     * mapping.
-     */
-    if ( !(flags & _PAGE_BLOCK) )
-        return 1;
-
-    /*
-     * We don't allow to remove mapping with the contiguous bit set.
-     * So shortcut the logic and directly return 1.
-     */
-    if ( mfn_eq(mfn, INVALID_MFN) )
-        return 1;
-
-    /*
-     * The number of contiguous entries varies depending on the page
-     * granularity used. The logic below assumes 4KB.
-     */
-    BUILD_BUG_ON(PAGE_SIZE != SZ_4K);
-
-    /*
-     * In order to enable the contiguous bit, we should have enough entries
-     * to map left and both the virtual and physical address should be
-     * aligned to the size of 16 translation tables entries.
-     */
-    nr_contig = BIT(XEN_PT_LEVEL_ORDER(level), UL) * XEN_PT_4K_NR_CONTIG;
-
-    if ( (left < nr_contig) || ((mfn_x(mfn) | vfn) & (nr_contig - 1)) )
-        return 1;
-
-    return XEN_PT_4K_NR_CONTIG;
-}
-
-static DEFINE_SPINLOCK(xen_pt_lock);
-
-static int xen_pt_update(unsigned long virt,
-                         mfn_t mfn,
-                         /* const on purpose as it is used for TLB flush */
-                         const unsigned long nr_mfns,
-                         unsigned int flags)
-{
-    int rc = 0;
-    unsigned long vfn = virt >> PAGE_SHIFT;
-    unsigned long left = nr_mfns;
-
-    /*
-     * For arm32, page-tables are different on each CPUs. Yet, they share
-     * some common mappings. It is assumed that only common mappings
-     * will be modified with this function.
-     *
-     * XXX: Add a check.
-     */
-    const mfn_t root = maddr_to_mfn(READ_SYSREG64(TTBR0_EL2));
-
-    /*
-     * The hardware was configured to forbid mapping both writeable and
-     * executable.
-     * When modifying/creating mapping (i.e _PAGE_PRESENT is set),
-     * prevent any update if this happen.
-     */
-    if ( (flags & _PAGE_PRESENT) && !PAGE_RO_MASK(flags) &&
-         !PAGE_XN_MASK(flags) )
-    {
-        mm_printk("Mappings should not be both Writeable and Executable.\n");
-        return -EINVAL;
-    }
-
-    if ( flags & _PAGE_CONTIG )
-    {
-        mm_printk("_PAGE_CONTIG is an internal only flag.\n");
-        return -EINVAL;
-    }
-
-    if ( !IS_ALIGNED(virt, PAGE_SIZE) )
-    {
-        mm_printk("The virtual address is not aligned to the page-size.\n");
-        return -EINVAL;
-    }
-
-    spin_lock(&xen_pt_lock);
-
-    while ( left )
-    {
-        unsigned int order, level, nr_contig, new_flags;
-
-        level = xen_pt_mapping_level(vfn, mfn, left, flags);
-        order = XEN_PT_LEVEL_ORDER(level);
-
-        ASSERT(left >= BIT(order, UL));
-
-        /*
-         * Check if we can set the contiguous mapping and update the
-         * flags accordingly.
-         */
-        nr_contig = xen_pt_check_contig(vfn, mfn, level, left, flags);
-        new_flags = flags | ((nr_contig > 1) ? _PAGE_CONTIG : 0);
-
-        for ( ; nr_contig > 0; nr_contig-- )
-        {
-            rc = xen_pt_update_entry(root, vfn << PAGE_SHIFT, mfn, level,
-                                     new_flags);
-            if ( rc )
-                break;
-
-            vfn += 1U << order;
-            if ( !mfn_eq(mfn, INVALID_MFN) )
-                mfn = mfn_add(mfn, 1U << order);
-
-            left -= (1U << order);
-        }
-
-        if ( rc )
-            break;
-    }
-
-    /*
-     * The TLBs flush can be safely skipped when a mapping is inserted
-     * as we don't allow mapping replacement (see xen_pt_check_entry()).
-     * Although we still need an ISB to ensure any DSB in
-     * write_pte() will complete because the mapping may be used soon
-     * after.
-     *
-     * For all the other cases, the TLBs will be flushed unconditionally
-     * even if the mapping has failed. This is because we may have
-     * partially modified the PT. This will prevent any unexpected
-     * behavior afterwards.
-     */
-    if ( !((flags & _PAGE_PRESENT) && !mfn_eq(mfn, INVALID_MFN)) )
-        flush_xen_tlb_range_va(virt, PAGE_SIZE * nr_mfns);
-    else
-        isb();
-
-    spin_unlock(&xen_pt_lock);
-
-    return rc;
-}
-
-int map_pages_to_xen(unsigned long virt,
-                     mfn_t mfn,
-                     unsigned long nr_mfns,
-                     unsigned int flags)
-{
-    return xen_pt_update(virt, mfn, nr_mfns, flags);
-}
-
-int __init populate_pt_range(unsigned long virt, unsigned long nr_mfns)
-{
-    return xen_pt_update(virt, INVALID_MFN, nr_mfns, _PAGE_POPULATE);
-}
-
-int destroy_xen_mappings(unsigned long s, unsigned long e)
-{
-    ASSERT(IS_ALIGNED(s, PAGE_SIZE));
-    ASSERT(IS_ALIGNED(e, PAGE_SIZE));
-    ASSERT(s <= e);
-    return xen_pt_update(s, INVALID_MFN, (e - s) >> PAGE_SHIFT, 0);
-}
-
-int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int flags)
-{
-    ASSERT(IS_ALIGNED(s, PAGE_SIZE));
-    ASSERT(IS_ALIGNED(e, PAGE_SIZE));
-    ASSERT(s <= e);
-    return xen_pt_update(s, INVALID_MFN, (e - s) >> PAGE_SHIFT, flags);
-}
-
 /* Release all __init and __initdata ranges to be reused */
 void free_init_memory(void)
 {
diff --git a/xen/arch/arm/mmu/Makefile b/xen/arch/arm/mmu/Makefile
new file mode 100644
index 0000000000..bdfc2e077d
--- /dev/null
+++ b/xen/arch/arm/mmu/Makefile
@@ -0,0 +1 @@
+obj-y += pt.o
diff --git a/xen/arch/arm/mmu/pt.c b/xen/arch/arm/mmu/pt.c
new file mode 100644
index 0000000000..e6fc5ed45a
--- /dev/null
+++ b/xen/arch/arm/mmu/pt.c
@@ -0,0 +1,736 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * xen/arch/arm/mmu/pt.c
+ *
+ * MMU system page table related functions.
+ */
+
+#include <xen/domain_page.h>
+#include <xen/init.h>
+#include <xen/pfn.h>
+#include <xen/sizes.h>
+#include <xen/vmap.h>
+
+#include <asm/fixmap.h>
+
+#ifdef NDEBUG
+static inline void
+__attribute__ ((__format__ (__printf__, 1, 2)))
+mm_printk(const char *fmt, ...) {}
+#else
+#define mm_printk(fmt, args...)             \
+    do                                      \
+    {                                       \
+        dprintk(XENLOG_ERR, fmt, ## args);  \
+        WARN();                             \
+    } while (0)
+#endif
+
+#ifdef CONFIG_ARM_64
+#define HYP_PT_ROOT_LEVEL 0
+#else
+#define HYP_PT_ROOT_LEVEL 1
+#endif
+
+static lpae_t *xen_map_table(mfn_t mfn)
+{
+    /*
+     * During early boot, map_domain_page() may be unusable. Use the
+     * PMAP to map temporarily a page-table.
+     */
+    if ( system_state == SYS_STATE_early_boot )
+        return pmap_map(mfn);
+
+    return map_domain_page(mfn);
+}
+
+static void xen_unmap_table(const lpae_t *table)
+{
+    /*
+     * During early boot, xen_map_table() will not use map_domain_page()
+     * but the PMAP.
+     */
+    if ( system_state == SYS_STATE_early_boot )
+        pmap_unmap(table);
+    else
+        unmap_domain_page(table);
+}
+
+void dump_pt_walk(paddr_t ttbr, paddr_t addr,
+                  unsigned int root_level,
+                  unsigned int nr_root_tables)
+{
+    static const char *level_strs[4] = { "0TH", "1ST", "2ND", "3RD" };
+    const mfn_t root_mfn = maddr_to_mfn(ttbr);
+    DECLARE_OFFSETS(offsets, addr);
+    lpae_t pte, *mapping;
+    unsigned int level, root_table;
+
+#ifdef CONFIG_ARM_32
+    BUG_ON(root_level < 1);
+#endif
+    BUG_ON(root_level > 3);
+
+    if ( nr_root_tables > 1 )
+    {
+        /*
+         * Concatenated root-level tables. The table number will be
+         * the offset at the previous level. It is not possible to
+         * concatenate a level-0 root.
+         */
+        BUG_ON(root_level == 0);
+        root_table = offsets[root_level - 1];
+        printk("Using concatenated root table %u\n", root_table);
+        if ( root_table >= nr_root_tables )
+        {
+            printk("Invalid root table offset\n");
+            return;
+        }
+    }
+    else
+        root_table = 0;
+
+    mapping = xen_map_table(mfn_add(root_mfn, root_table));
+
+    for ( level = root_level; ; level++ )
+    {
+        if ( offsets[level] > XEN_PT_LPAE_ENTRIES )
+            break;
+
+        pte = mapping[offsets[level]];
+
+        printk("%s[0x%03x] = 0x%"PRIx64"\n",
+               level_strs[level], offsets[level], pte.bits);
+
+        if ( level == 3 || !pte.walk.valid || !pte.walk.table )
+            break;
+
+        /* For next iteration */
+        xen_unmap_table(mapping);
+        mapping = xen_map_table(lpae_get_mfn(pte));
+    }
+
+    xen_unmap_table(mapping);
+}
+
+void dump_hyp_walk(vaddr_t addr)
+{
+    uint64_t ttbr = READ_SYSREG64(TTBR0_EL2);
+
+    printk("Walking Hypervisor VA 0x%"PRIvaddr" "
+           "on CPU%d via TTBR 0x%016"PRIx64"\n",
+           addr, smp_processor_id(), ttbr);
+
+    dump_pt_walk(ttbr, addr, HYP_PT_ROOT_LEVEL, 1);
+}
+
+lpae_t mfn_to_xen_entry(mfn_t mfn, unsigned int attr)
+{
+    lpae_t e = (lpae_t) {
+        .pt = {
+            .valid = 1,           /* Mappings are present */
+            .table = 0,           /* Set to 1 for links and 4k maps */
+            .ai = attr,
+            .ns = 1,              /* Hyp mode is in the non-secure world */
+            .up = 1,              /* See below */
+            .ro = 0,              /* Assume read-write */
+            .af = 1,              /* No need for access tracking */
+            .ng = 1,              /* Makes TLB flushes easier */
+            .contig = 0,          /* Assume non-contiguous */
+            .xn = 1,              /* No need to execute outside .text */
+            .avail = 0,           /* Reference count for domheap mapping */
+        }};
+    /*
+     * For EL2 stage-1 page table, up (aka AP[1]) is RES1 as the translation
+     * regime applies to only one exception level (see D4.4.4 and G4.6.1
+     * in ARM DDI 0487B.a). If this changes, remember to update the
+     * hard-coded values in head.S too.
+     */
+
+    switch ( attr )
+    {
+    case MT_NORMAL_NC:
+        /*
+         * ARM ARM: Overlaying the shareability attribute (DDI
+         * 0406C.b B3-1376 to 1377)
+         *
+         * A memory region with a resultant memory type attribute of Normal,
+         * and a resultant cacheability attribute of Inner Non-cacheable,
+         * Outer Non-cacheable, must have a resultant shareability attribute
+         * of Outer Shareable, otherwise shareability is UNPREDICTABLE.
+         *
+         * On ARMv8 sharability is ignored and explicitly treated as Outer
+         * Shareable for Normal Inner Non_cacheable, Outer Non-cacheable.
+         */
+        e.pt.sh = LPAE_SH_OUTER;
+        break;
+    case MT_DEVICE_nGnRnE:
+    case MT_DEVICE_nGnRE:
+        /*
+         * Shareability is ignored for non-Normal memory, Outer is as
+         * good as anything.
+         *
+         * On ARMv8 sharability is ignored and explicitly treated as Outer
+         * Shareable for any device memory type.
+         */
+        e.pt.sh = LPAE_SH_OUTER;
+        break;
+    default:
+        e.pt.sh = LPAE_SH_INNER;  /* Xen mappings are SMP coherent */
+        break;
+    }
+
+    ASSERT(!(mfn_to_maddr(mfn) & ~PADDR_MASK));
+
+    lpae_set_mfn(e, mfn);
+
+    return e;
+}
+
+/* Map a 4k page in a fixmap entry */
+void set_fixmap(unsigned int map, mfn_t mfn, unsigned int flags)
+{
+    int res;
+
+    res = map_pages_to_xen(FIXMAP_ADDR(map), mfn, 1, flags);
+    BUG_ON(res != 0);
+}
+
+/* Remove a mapping from a fixmap entry */
+void clear_fixmap(unsigned int map)
+{
+    int res;
+
+    res = destroy_xen_mappings(FIXMAP_ADDR(map), FIXMAP_ADDR(map) + PAGE_SIZE);
+    BUG_ON(res != 0);
+}
+
+/*
+ * This function should only be used to remap device address ranges
+ * TODO: add a check to verify this assumption
+ */
+void *ioremap_attr(paddr_t start, size_t len, unsigned int attributes)
+{
+    mfn_t mfn = _mfn(PFN_DOWN(start));
+    unsigned int offs = start & (PAGE_SIZE - 1);
+    unsigned int nr = PFN_UP(offs + len);
+    void *ptr = __vmap(&mfn, nr, 1, 1, attributes, VMAP_DEFAULT);
+
+    if ( ptr == NULL )
+        return NULL;
+
+    return ptr + offs;
+}
+
+void *ioremap(paddr_t pa, size_t len)
+{
+    return ioremap_attr(pa, len, PAGE_HYPERVISOR_NOCACHE);
+}
+
+static int create_xen_table(lpae_t *entry)
+{
+    mfn_t mfn;
+    void *p;
+    lpae_t pte;
+
+    if ( system_state != SYS_STATE_early_boot )
+    {
+        struct page_info *pg = alloc_domheap_page(NULL, 0);
+
+        if ( pg == NULL )
+            return -ENOMEM;
+
+        mfn = page_to_mfn(pg);
+    }
+    else
+        mfn = alloc_boot_pages(1, 1);
+
+    p = xen_map_table(mfn);
+    clear_page(p);
+    xen_unmap_table(p);
+
+    pte = mfn_to_xen_entry(mfn, MT_NORMAL);
+    pte.pt.table = 1;
+    write_pte(entry, pte);
+    /*
+     * No ISB here. It is deferred to xen_pt_update() as the new table
+     * will not be used for hardware translation table access as part of
+     * the mapping update.
+     */
+
+    return 0;
+}
+
+#define XEN_TABLE_MAP_FAILED 0
+#define XEN_TABLE_SUPER_PAGE 1
+#define XEN_TABLE_NORMAL_PAGE 2
+
+/*
+ * Take the currently mapped table, find the corresponding entry,
+ * and map the next table, if available.
+ *
+ * The read_only parameters indicates whether intermediate tables should
+ * be allocated when not present.
+ *
+ * Return values:
+ *  XEN_TABLE_MAP_FAILED: Either read_only was set and the entry
+ *  was empty, or allocating a new page failed.
+ *  XEN_TABLE_NORMAL_PAGE: next level mapped normally
+ *  XEN_TABLE_SUPER_PAGE: The next entry points to a superpage.
+ */
+static int xen_pt_next_level(bool read_only, unsigned int level,
+                             lpae_t **table, unsigned int offset)
+{
+    lpae_t *entry;
+    int ret;
+    mfn_t mfn;
+
+    entry = *table + offset;
+
+    if ( !lpae_is_valid(*entry) )
+    {
+        if ( read_only )
+            return XEN_TABLE_MAP_FAILED;
+
+        ret = create_xen_table(entry);
+        if ( ret )
+            return XEN_TABLE_MAP_FAILED;
+    }
+
+    /* The function xen_pt_next_level is never called at the 3rd 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(mfn);
+
+    return XEN_TABLE_NORMAL_PAGE;
+}
+
+/* Sanity check of the entry */
+static bool xen_pt_check_entry(lpae_t entry, mfn_t mfn, unsigned int level,
+                               unsigned int flags)
+{
+    /* Sanity check when modifying an entry. */
+    if ( (flags & _PAGE_PRESENT) && mfn_eq(mfn, INVALID_MFN) )
+    {
+        /* We don't allow modifying an invalid entry. */
+        if ( !lpae_is_valid(entry) )
+        {
+            mm_printk("Modifying invalid entry is not allowed.\n");
+            return false;
+        }
+
+        /* We don't allow modifying a table entry */
+        if ( !lpae_is_mapping(entry, level) )
+        {
+            mm_printk("Modifying a table entry is not allowed.\n");
+            return false;
+        }
+
+        /* We don't allow changing memory attributes. */
+        if ( entry.pt.ai != PAGE_AI_MASK(flags) )
+        {
+            mm_printk("Modifying memory attributes is not allowed (0x%x -> 0x%x).\n",
+                      entry.pt.ai, PAGE_AI_MASK(flags));
+            return false;
+        }
+
+        /* We don't allow modifying entry with contiguous bit set. */
+        if ( entry.pt.contig )
+        {
+            mm_printk("Modifying entry with contiguous bit set is not allowed.\n");
+            return false;
+        }
+    }
+    /* Sanity check when inserting a mapping */
+    else if ( flags & _PAGE_PRESENT )
+    {
+        /* We should be here with a valid MFN. */
+        ASSERT(!mfn_eq(mfn, INVALID_MFN));
+
+        /*
+         * We don't allow replacing any valid entry.
+         *
+         * Note that the function xen_pt_update() relies on this
+         * assumption and will skip the TLB flush. The function will need
+         * to be updated if the check is relaxed.
+         */
+        if ( lpae_is_valid(entry) )
+        {
+            if ( lpae_is_mapping(entry, level) )
+                mm_printk("Changing MFN for a valid entry is not allowed (%#"PRI_mfn" -> %#"PRI_mfn").\n",
+                          mfn_x(lpae_get_mfn(entry)), mfn_x(mfn));
+            else
+                mm_printk("Trying to replace a table with a mapping.\n");
+            return false;
+        }
+    }
+    /* Sanity check when removing a mapping. */
+    else if ( (flags & (_PAGE_PRESENT|_PAGE_POPULATE)) == 0 )
+    {
+        /* We should be here with an invalid MFN. */
+        ASSERT(mfn_eq(mfn, INVALID_MFN));
+
+        /* We don't allow removing a table */
+        if ( lpae_is_table(entry, level) )
+        {
+            mm_printk("Removing a table is not allowed.\n");
+            return false;
+        }
+
+        /* We don't allow removing a mapping with contiguous bit set. */
+        if ( entry.pt.contig )
+        {
+            mm_printk("Removing entry with contiguous bit set is not allowed.\n");
+            return false;
+        }
+    }
+    /* Sanity check when populating the page-table. No check so far. */
+    else
+    {
+        ASSERT(flags & _PAGE_POPULATE);
+        /* We should be here with an invalid MFN */
+        ASSERT(mfn_eq(mfn, INVALID_MFN));
+    }
+
+    return true;
+}
+
+/* Update an entry at the level @target. */
+static int xen_pt_update_entry(mfn_t root, unsigned long virt,
+                               mfn_t mfn, unsigned int target,
+                               unsigned int flags)
+{
+    int rc;
+    unsigned int level;
+    lpae_t *table;
+    /*
+     * The intermediate page tables are read-only when the MFN is not valid
+     * and we are not populating page table.
+     * This means we either modify permissions or remove an entry.
+     */
+    bool read_only = mfn_eq(mfn, INVALID_MFN) && !(flags & _PAGE_POPULATE);
+    lpae_t pte, *entry;
+
+    /* convenience aliases */
+    DECLARE_OFFSETS(offsets, (paddr_t)virt);
+
+    /* _PAGE_POPULATE and _PAGE_PRESENT should never be set together. */
+    ASSERT((flags & (_PAGE_POPULATE|_PAGE_PRESENT)) != (_PAGE_POPULATE|_PAGE_PRESENT));
+
+    table = xen_map_table(root);
+    for ( level = HYP_PT_ROOT_LEVEL; level < target; level++ )
+    {
+        rc = xen_pt_next_level(read_only, level, &table, offsets[level]);
+        if ( rc == XEN_TABLE_MAP_FAILED )
+        {
+            /*
+             * We are here because xen_pt_next_level has failed to map
+             * the intermediate page table (e.g the table does not exist
+             * and the pt is read-only). It is a valid case when
+             * removing a mapping as it may not exist in the page table.
+             * In this case, just ignore it.
+             */
+            if ( flags & (_PAGE_PRESENT|_PAGE_POPULATE) )
+            {
+                mm_printk("%s: Unable to map level %u\n", __func__, level);
+                rc = -ENOENT;
+                goto out;
+            }
+            else
+            {
+                rc = 0;
+                goto out;
+            }
+        }
+        else if ( rc != XEN_TABLE_NORMAL_PAGE )
+            break;
+    }
+
+    if ( level != target )
+    {
+        mm_printk("%s: Shattering superpage is not supported\n", __func__);
+        rc = -EOPNOTSUPP;
+        goto out;
+    }
+
+    entry = table + offsets[level];
+
+    rc = -EINVAL;
+    if ( !xen_pt_check_entry(*entry, mfn, level, flags) )
+        goto out;
+
+    /* If we are only populating page-table, then we are done. */
+    rc = 0;
+    if ( flags & _PAGE_POPULATE )
+        goto out;
+
+    /* We are removing the page */
+    if ( !(flags & _PAGE_PRESENT) )
+        memset(&pte, 0x00, sizeof(pte));
+    else
+    {
+        /* We are inserting a mapping => Create new pte. */
+        if ( !mfn_eq(mfn, INVALID_MFN) )
+        {
+            pte = mfn_to_xen_entry(mfn, PAGE_AI_MASK(flags));
+
+            /*
+             * First and second level pages set pte.pt.table = 0, but
+             * third level entries set pte.pt.table = 1.
+             */
+            pte.pt.table = (level == 3);
+        }
+        else /* We are updating the permission => Copy the current pte. */
+            pte = *entry;
+
+        /* Set permission */
+        pte.pt.ro = PAGE_RO_MASK(flags);
+        pte.pt.xn = PAGE_XN_MASK(flags);
+        /* Set contiguous bit */
+        pte.pt.contig = !!(flags & _PAGE_CONTIG);
+    }
+
+    write_pte(entry, pte);
+    /*
+     * No ISB or TLB flush here. They are deferred to xen_pt_update()
+     * as the entry will not be used as part of the mapping update.
+     */
+
+    rc = 0;
+
+out:
+    xen_unmap_table(table);
+
+    return rc;
+}
+
+/* Return the level where mapping should be done */
+static int xen_pt_mapping_level(unsigned long vfn, mfn_t mfn, unsigned long nr,
+                                unsigned int flags)
+{
+    unsigned int level;
+    unsigned long mask;
+
+    /*
+      * Don't take into account the MFN when removing mapping (i.e
+      * MFN_INVALID) to calculate the correct target order.
+      *
+      * Per the Arm Arm, `vfn` and `mfn` must be both superpage aligned.
+      * They are or-ed together and then checked against the size of
+      * each level.
+      *
+      * `left` is not included and checked separately to allow
+      * superpage mapping even if it is not properly aligned (the
+      * user may have asked to map 2MB + 4k).
+      */
+     mask = !mfn_eq(mfn, INVALID_MFN) ? mfn_x(mfn) : 0;
+     mask |= vfn;
+
+     /*
+      * Always use level 3 mapping unless the caller request block
+      * mapping.
+      */
+     if ( likely(!(flags & _PAGE_BLOCK)) )
+         level = 3;
+     else if ( !(mask & (BIT(FIRST_ORDER, UL) - 1)) &&
+               (nr >= BIT(FIRST_ORDER, UL)) )
+         level = 1;
+     else if ( !(mask & (BIT(SECOND_ORDER, UL) - 1)) &&
+               (nr >= BIT(SECOND_ORDER, UL)) )
+         level = 2;
+     else
+         level = 3;
+
+     return level;
+}
+
+#define XEN_PT_4K_NR_CONTIG 16
+
+/*
+ * Check whether the contiguous bit can be set. Return the number of
+ * contiguous entry allowed. If not allowed, return 1.
+ */
+static unsigned int xen_pt_check_contig(unsigned long vfn, mfn_t mfn,
+                                        unsigned int level, unsigned long left,
+                                        unsigned int flags)
+{
+    unsigned long nr_contig;
+
+    /*
+     * Allow the contiguous bit to set when the caller requests block
+     * mapping.
+     */
+    if ( !(flags & _PAGE_BLOCK) )
+        return 1;
+
+    /*
+     * We don't allow to remove mapping with the contiguous bit set.
+     * So shortcut the logic and directly return 1.
+     */
+    if ( mfn_eq(mfn, INVALID_MFN) )
+        return 1;
+
+    /*
+     * The number of contiguous entries varies depending on the page
+     * granularity used. The logic below assumes 4KB.
+     */
+    BUILD_BUG_ON(PAGE_SIZE != SZ_4K);
+
+    /*
+     * In order to enable the contiguous bit, we should have enough entries
+     * to map left and both the virtual and physical address should be
+     * aligned to the size of 16 translation tables entries.
+     */
+    nr_contig = BIT(XEN_PT_LEVEL_ORDER(level), UL) * XEN_PT_4K_NR_CONTIG;
+
+    if ( (left < nr_contig) || ((mfn_x(mfn) | vfn) & (nr_contig - 1)) )
+        return 1;
+
+    return XEN_PT_4K_NR_CONTIG;
+}
+
+static DEFINE_SPINLOCK(xen_pt_lock);
+
+static int xen_pt_update(unsigned long virt,
+                         mfn_t mfn,
+                         /* const on purpose as it is used for TLB flush */
+                         const unsigned long nr_mfns,
+                         unsigned int flags)
+{
+    int rc = 0;
+    unsigned long vfn = virt >> PAGE_SHIFT;
+    unsigned long left = nr_mfns;
+
+    /*
+     * For arm32, page-tables are different on each CPUs. Yet, they share
+     * some common mappings. It is assumed that only common mappings
+     * will be modified with this function.
+     *
+     * XXX: Add a check.
+     */
+    const mfn_t root = maddr_to_mfn(READ_SYSREG64(TTBR0_EL2));
+
+    /*
+     * The hardware was configured to forbid mapping both writeable and
+     * executable.
+     * When modifying/creating mapping (i.e _PAGE_PRESENT is set),
+     * prevent any update if this happen.
+     */
+    if ( (flags & _PAGE_PRESENT) && !PAGE_RO_MASK(flags) &&
+         !PAGE_XN_MASK(flags) )
+    {
+        mm_printk("Mappings should not be both Writeable and Executable.\n");
+        return -EINVAL;
+    }
+
+    if ( flags & _PAGE_CONTIG )
+    {
+        mm_printk("_PAGE_CONTIG is an internal only flag.\n");
+        return -EINVAL;
+    }
+
+    if ( !IS_ALIGNED(virt, PAGE_SIZE) )
+    {
+        mm_printk("The virtual address is not aligned to the page-size.\n");
+        return -EINVAL;
+    }
+
+    spin_lock(&xen_pt_lock);
+
+    while ( left )
+    {
+        unsigned int order, level, nr_contig, new_flags;
+
+        level = xen_pt_mapping_level(vfn, mfn, left, flags);
+        order = XEN_PT_LEVEL_ORDER(level);
+
+        ASSERT(left >= BIT(order, UL));
+
+        /*
+         * Check if we can set the contiguous mapping and update the
+         * flags accordingly.
+         */
+        nr_contig = xen_pt_check_contig(vfn, mfn, level, left, flags);
+        new_flags = flags | ((nr_contig > 1) ? _PAGE_CONTIG : 0);
+
+        for ( ; nr_contig > 0; nr_contig-- )
+        {
+            rc = xen_pt_update_entry(root, vfn << PAGE_SHIFT, mfn, level,
+                                     new_flags);
+            if ( rc )
+                break;
+
+            vfn += 1U << order;
+            if ( !mfn_eq(mfn, INVALID_MFN) )
+                mfn = mfn_add(mfn, 1U << order);
+
+            left -= (1U << order);
+        }
+
+        if ( rc )
+            break;
+    }
+
+    /*
+     * The TLBs flush can be safely skipped when a mapping is inserted
+     * as we don't allow mapping replacement (see xen_pt_check_entry()).
+     * Although we still need an ISB to ensure any DSB in
+     * write_pte() will complete because the mapping may be used soon
+     * after.
+     *
+     * For all the other cases, the TLBs will be flushed unconditionally
+     * even if the mapping has failed. This is because we may have
+     * partially modified the PT. This will prevent any unexpected
+     * behavior afterwards.
+     */
+    if ( !((flags & _PAGE_PRESENT) && !mfn_eq(mfn, INVALID_MFN)) )
+        flush_xen_tlb_range_va(virt, PAGE_SIZE * nr_mfns);
+    else
+        isb();
+
+    spin_unlock(&xen_pt_lock);
+
+    return rc;
+}
+
+int map_pages_to_xen(unsigned long virt,
+                     mfn_t mfn,
+                     unsigned long nr_mfns,
+                     unsigned int flags)
+{
+    return xen_pt_update(virt, mfn, nr_mfns, flags);
+}
+
+int __init populate_pt_range(unsigned long virt, unsigned long nr_mfns)
+{
+    return xen_pt_update(virt, INVALID_MFN, nr_mfns, _PAGE_POPULATE);
+}
+
+int destroy_xen_mappings(unsigned long s, unsigned long e)
+{
+    ASSERT(IS_ALIGNED(s, PAGE_SIZE));
+    ASSERT(IS_ALIGNED(e, PAGE_SIZE));
+    ASSERT(s <= e);
+    return xen_pt_update(s, INVALID_MFN, (e - s) >> PAGE_SHIFT, 0);
+}
+
+int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int flags)
+{
+    ASSERT(IS_ALIGNED(s, PAGE_SIZE));
+    ASSERT(IS_ALIGNED(e, PAGE_SIZE));
+    ASSERT(s <= e);
+    return xen_pt_update(s, INVALID_MFN, (e - s) >> PAGE_SHIFT, flags);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 21:33:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 21:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.638275.994656 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5YMr-0005Mi-BS; Tue, 21 Nov 2023 21:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 638275.994656; Tue, 21 Nov 2023 21: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 1r5YMr-0005Mb-91; Tue, 21 Nov 2023 21:33:13 +0000
Received: by outflank-mailman (input) for mailman id 638275;
 Tue, 21 Nov 2023 21: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 1r5YMq-0005MR-Eb
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21: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 1r5YMq-0003Yo-Dl
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5YMq-0005lW-Cj
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dbtnYlRClhZmJrgZW9QN9aTmPr05PPeHKuKH9uGqmkk=; b=uGKO0bD5I7X881muL+73DOGrMk
	MCxK3Tlamb8QlJKaVZJdB2xf3bf+cc9qNIymnobRNOtMVj7Hz2rj8x6F42pZKIaF23JU0eWC2pQn6
	uy5dZjDrc9jVfKHZj7kxZZzp547HXhkUOm0DY3YRV9e/F/NgGCwKSTzSZCIRt1JyllTs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Split MMU system SMP MM bringup code to mmu/smpboot.c
Message-Id: <E1r5YMq-0005lW-Cj@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 21:33:12 +0000

commit 210e83ae56746024a7e0a83967e346d43fb56473
Author:     Henry Wang <Henry.Wang@arm.com>
AuthorDate: Thu Nov 16 22:50:26 2023 +0800
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Nov 20 19:07:45 2023 +0000

    xen/arm: Split MMU system SMP MM bringup code to mmu/smpboot.c
    
    Move the code related to secondary page table initialization, clear
    boot page tables and the global variable definitions of these boot
    page tables from arch/arm/mm.c to arch/arm/mmu/smpboot.c
    
    Since arm32 global variable cpu0_pgtable will be used by both
    arch/arm/mm.c and arch/arm/mmu/smpboot.c, to avoid exporting this
    variable, change the variable usage in arch/arm/mmu/smpboot.c to
    per_cpu(xen_pgtable, 0).
    
    To avoid exposing global variable phys_offset, use virt_to_maddr()
    to calculate init_ttbr for arm64.
    
    Take the opportunity to fix the in-code comment coding styles when
    possible.
    
    Signed-off-by: Henry Wang <Henry.Wang@arm.com>
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/mm.c          | 104 -------------------------------------
 xen/arch/arm/mmu/Makefile  |   1 +
 xen/arch/arm/mmu/smpboot.c | 124 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 125 insertions(+), 104 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index fd02493564..b7eb3a6e08 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -27,39 +27,6 @@
 #undef mfn_to_virt
 #define mfn_to_virt(mfn) __mfn_to_virt(mfn_x(mfn))
 
-/* Static start-of-day pagetables that we use before the allocators
- * are up. These are used by all CPUs during bringup before switching
- * to the CPUs own pagetables.
- *
- * These pagetables have a very simple structure. They include:
- *  - XEN_VIRT_SIZE worth of L3 mappings of xen at XEN_VIRT_START, boot_first
- *    and boot_second are used to populate the tables down to boot_third
- *    which contains the actual mapping.
- *  - a 1:1 mapping of xen at its current physical address. This uses a
- *    section mapping at whichever of boot_{pgtable,first,second}
- *    covers that physical address.
- *
- * For the boot CPU these mappings point to the address where Xen was
- * loaded by the bootloader. For secondary CPUs they point to the
- * relocated copy of Xen for the benefit of secondary CPUs.
- *
- * In addition to the above for the boot CPU the device-tree is
- * initially mapped in the boot misc slot. This mapping is not present
- * for secondary CPUs.
- *
- * Finally, if EARLY_PRINTK is enabled then xen_fixmap will be mapped
- * by the CPU once it has moved off the 1:1 mapping.
- */
-DEFINE_BOOT_PAGE_TABLE(boot_pgtable);
-#ifdef CONFIG_ARM_64
-DEFINE_BOOT_PAGE_TABLE(boot_first);
-DEFINE_BOOT_PAGE_TABLE(boot_first_id);
-#endif
-DEFINE_BOOT_PAGE_TABLE(boot_second_id);
-DEFINE_BOOT_PAGE_TABLE(boot_third_id);
-DEFINE_BOOT_PAGE_TABLE(boot_second);
-DEFINE_BOOT_PAGE_TABLES(boot_third, XEN_NR_ENTRIES(2));
-
 /* Main runtime page tables */
 
 /*
@@ -94,9 +61,6 @@ DEFINE_BOOT_PAGE_TABLE(xen_fixmap);
  */
 static DEFINE_PAGE_TABLES(xen_xenmap, XEN_NR_ENTRIES(2));
 
-/* Non-boot CPUs use this to find the correct pagetables. */
-uint64_t init_ttbr;
-
 static paddr_t phys_offset;
 
 /* Limits of the Xen heap */
@@ -284,13 +248,6 @@ static void xen_pt_enforce_wnx(void)
     flush_xen_tlb_local();
 }
 
-/* Clear a translation table and clean & invalidate the cache */
-static void clear_table(void *table)
-{
-    clear_page(table);
-    clean_and_invalidate_dcache_va_range(table, PAGE_SIZE);
-}
-
 /* Boot-time pagetable setup.
  * Changes here may need matching changes in head.S */
 void __init setup_pagetables(unsigned long boot_phys_offset)
@@ -369,67 +326,6 @@ void __init setup_pagetables(unsigned long boot_phys_offset)
 #endif
 }
 
-static void clear_boot_pagetables(void)
-{
-    /*
-     * Clear the copy of the boot pagetables. Each secondary CPU
-     * rebuilds these itself (see head.S).
-     */
-    clear_table(boot_pgtable);
-#ifdef CONFIG_ARM_64
-    clear_table(boot_first);
-    clear_table(boot_first_id);
-#endif
-    clear_table(boot_second);
-    clear_table(boot_third);
-}
-
-#ifdef CONFIG_ARM_64
-int init_secondary_pagetables(int cpu)
-{
-    clear_boot_pagetables();
-
-    /* Set init_ttbr for this CPU coming up. All CPus share a single setof
-     * pagetables, but rewrite it each time for consistency with 32 bit. */
-    init_ttbr = (uintptr_t) xen_pgtable + phys_offset;
-    clean_dcache(init_ttbr);
-    return 0;
-}
-#else
-int init_secondary_pagetables(int cpu)
-{
-    lpae_t *first;
-
-    first = alloc_xenheap_page(); /* root == first level on 32-bit 3-level trie */
-
-    if ( !first )
-    {
-        printk("CPU%u: Unable to allocate the first page-table\n", cpu);
-        return -ENOMEM;
-    }
-
-    /* Initialise root pagetable from root of boot tables */
-    memcpy(first, cpu0_pgtable, PAGE_SIZE);
-    per_cpu(xen_pgtable, cpu) = first;
-
-    if ( !init_domheap_mappings(cpu) )
-    {
-        printk("CPU%u: Unable to prepare the domheap page-tables\n", cpu);
-        per_cpu(xen_pgtable, cpu) = NULL;
-        free_xenheap_page(first);
-        return -ENOMEM;
-    }
-
-    clear_boot_pagetables();
-
-    /* Set init_ttbr for this CPU coming up */
-    init_ttbr = __pa(first);
-    clean_dcache(init_ttbr);
-
-    return 0;
-}
-#endif
-
 /* MMU setup for secondary CPUS (which already have paging enabled) */
 void mmu_init_secondary_cpu(void)
 {
diff --git a/xen/arch/arm/mmu/Makefile b/xen/arch/arm/mmu/Makefile
index bdfc2e077d..0e82015ee1 100644
--- a/xen/arch/arm/mmu/Makefile
+++ b/xen/arch/arm/mmu/Makefile
@@ -1 +1,2 @@
 obj-y += pt.o
+obj-y += smpboot.o
diff --git a/xen/arch/arm/mmu/smpboot.c b/xen/arch/arm/mmu/smpboot.c
new file mode 100644
index 0000000000..8b6a09f843
--- /dev/null
+++ b/xen/arch/arm/mmu/smpboot.c
@@ -0,0 +1,124 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * xen/arch/arm/mmu/smpboot.c
+ *
+ * MMU system secondary CPUs MM bringup code.
+ */
+
+#include <xen/domain_page.h>
+
+/*
+ * Static start-of-day pagetables that we use before the allocators
+ * are up. These are used by all CPUs during bringup before switching
+ * to the CPUs own pagetables.
+ *
+ * These pagetables have a very simple structure. They include:
+ *  - XEN_VIRT_SIZE worth of L3 mappings of xen at XEN_VIRT_START, boot_first
+ *    and boot_second are used to populate the tables down to boot_third
+ *    which contains the actual mapping.
+ *  - a 1:1 mapping of xen at its current physical address. This uses a
+ *    section mapping at whichever of boot_{pgtable,first,second}
+ *    covers that physical address.
+ *
+ * For the boot CPU these mappings point to the address where Xen was
+ * loaded by the bootloader. For secondary CPUs they point to the
+ * relocated copy of Xen for the benefit of secondary CPUs.
+ *
+ * In addition to the above for the boot CPU the device-tree is
+ * initially mapped in the boot misc slot. This mapping is not present
+ * for secondary CPUs.
+ *
+ * Finally, if EARLY_PRINTK is enabled then xen_fixmap will be mapped
+ * by the CPU once it has moved off the 1:1 mapping.
+ */
+DEFINE_BOOT_PAGE_TABLE(boot_pgtable);
+#ifdef CONFIG_ARM_64
+DEFINE_BOOT_PAGE_TABLE(boot_first);
+DEFINE_BOOT_PAGE_TABLE(boot_first_id);
+#endif
+DEFINE_BOOT_PAGE_TABLE(boot_second_id);
+DEFINE_BOOT_PAGE_TABLE(boot_third_id);
+DEFINE_BOOT_PAGE_TABLE(boot_second);
+DEFINE_BOOT_PAGE_TABLES(boot_third, XEN_NR_ENTRIES(2));
+
+/* Non-boot CPUs use this to find the correct pagetables. */
+uint64_t init_ttbr;
+
+/* Clear a translation table and clean & invalidate the cache */
+static void clear_table(void *table)
+{
+    clear_page(table);
+    clean_and_invalidate_dcache_va_range(table, PAGE_SIZE);
+}
+
+static void clear_boot_pagetables(void)
+{
+    /*
+     * Clear the copy of the boot pagetables. Each secondary CPU
+     * rebuilds these itself (see head.S).
+     */
+    clear_table(boot_pgtable);
+#ifdef CONFIG_ARM_64
+    clear_table(boot_first);
+    clear_table(boot_first_id);
+#endif
+    clear_table(boot_second);
+    clear_table(boot_third);
+}
+
+#ifdef CONFIG_ARM_64
+int init_secondary_pagetables(int cpu)
+{
+    clear_boot_pagetables();
+
+    /*
+     * Set init_ttbr for this CPU coming up. All CPUs share a single setof
+     * pagetables, but rewrite it each time for consistency with 32 bit.
+     */
+    init_ttbr = virt_to_maddr(xen_pgtable);
+    clean_dcache(init_ttbr);
+    return 0;
+}
+#else
+int init_secondary_pagetables(int cpu)
+{
+    lpae_t *first;
+
+    first = alloc_xenheap_page(); /* root == first level on 32-bit 3-level trie */
+
+    if ( !first )
+    {
+        printk("CPU%u: Unable to allocate the first page-table\n", cpu);
+        return -ENOMEM;
+    }
+
+    /* Initialise root pagetable from root of boot tables */
+    memcpy(first, per_cpu(xen_pgtable, 0), PAGE_SIZE);
+    per_cpu(xen_pgtable, cpu) = first;
+
+    if ( !init_domheap_mappings(cpu) )
+    {
+        printk("CPU%u: Unable to prepare the domheap page-tables\n", cpu);
+        per_cpu(xen_pgtable, cpu) = NULL;
+        free_xenheap_page(first);
+        return -ENOMEM;
+    }
+
+    clear_boot_pagetables();
+
+    /* Set init_ttbr for this CPU coming up */
+    init_ttbr = __pa(first);
+    clean_dcache(init_ttbr);
+
+    return 0;
+}
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 21:33:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 21:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.638276.994660 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5YN1-0005PH-DA; Tue, 21 Nov 2023 21:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 638276.994660; Tue, 21 Nov 2023 21: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 1r5YN1-0005P9-AV; Tue, 21 Nov 2023 21:33:23 +0000
Received: by outflank-mailman (input) for mailman id 638276;
 Tue, 21 Nov 2023 21: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 1r5YN0-0005Ot-Hn
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21: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 1r5YN0-0003Yz-H1
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5YN0-0005m1-Fw
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1nO7LmGLAaKeq8tntF4ZpLddnBGbdcFiOkGQHJfHVZU=; b=i85JO0qkSV9Yq/fxXMWR2+qLN6
	DBU2Md7tUOYgq4ttBeIvJTiOZ79BN3hEnQjaKLmjAarj4p932443VpaCtYqz2SQT1RaUbpkg2q3z1
	QxZ1f2zEoVKv4hTijT4YRzyiWihvy7KE528h+MgI7HQHoPtM8kinSehluRPqUESD3s30=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Fold mmu_init_secondary_cpu() to head.S
Message-Id: <E1r5YN0-0005m1-Fw@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 21:33:22 +0000

commit ea59db96a41a80d923678a782842ffe269ab7ff5
Author:     Henry Wang <Henry.Wang@arm.com>
AuthorDate: Thu Nov 16 22:50:27 2023 +0800
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Nov 20 19:07:45 2023 +0000

    xen/arm: Fold mmu_init_secondary_cpu() to head.S
    
    Currently mmu_init_secondary_cpu() only enforces the page table
    should not contain mapping that are both Writable and eXecutables
    after boot. To ease the arch/arm/mm.c split work, fold this function
    to head.S.
    
    For arm32, the WXN bit cannot be set early because at the point when
    the MMU is enabled, the page-tables may still contain mapping which
    are writable and executable. Therefore, introduce an assembly macro
    pt_enforce_wxn. The macro is called before secondary CPUs jumping
    into the C world.
    
    For arm64, set the SCTLR_Axx_ELx_WXN flag right when the MMU is
    enabled. This would avoid the extra TLB flush and SCTLR dance.
    
    Signed-off-by: Henry Wang <Henry.Wang@arm.com>
    Co-authored-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/arm32/head.S     | 20 ++++++++++++++++++++
 xen/arch/arm/arm64/mmu/head.S | 19 ++++++++++++-------
 xen/arch/arm/include/asm/mm.h |  2 --
 xen/arch/arm/mm.c             |  6 ------
 xen/arch/arm/smpboot.c        |  2 --
 5 files changed, 32 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index bbbdf7daf8..2c235fb34c 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -83,6 +83,25 @@
         isb
 .endm
 
+/*
+ * Enforce Xen page-tables do not contain mapping that are both
+ * Writable and eXecutables.
+ *
+ * This should be called on each secondary CPU.
+ */
+.macro pt_enforce_wxn tmp
+        mrc   CP32(\tmp, HSCTLR)
+        orr   \tmp, \tmp, #SCTLR_Axx_ELx_WXN
+        dsb
+        mcr   CP32(\tmp, HSCTLR)
+        /*
+         * The TLBs may cache SCTLR_EL2.WXN. So ensure it is synchronized
+         * before flushing the TLBs.
+         */
+        isb
+        flush_xen_tlb_local \tmp
+.endm
+
 /*
  * Common register usage in this file:
  *   r0  -
@@ -249,6 +268,7 @@ secondary_switched:
         dsb
         isb
         flush_xen_tlb_local r0
+        pt_enforce_wxn r0
 
 #ifdef CONFIG_EARLY_PRINTK
         /* Use a virtual address to access the UART. */
diff --git a/xen/arch/arm/arm64/mmu/head.S b/xen/arch/arm/arm64/mmu/head.S
index 412b28e649..10774f30e4 100644
--- a/xen/arch/arm/arm64/mmu/head.S
+++ b/xen/arch/arm/arm64/mmu/head.S
@@ -269,11 +269,13 @@ ENDPROC(create_page_tables)
  *
  * Inputs:
  *   x0 : Physical address of the page tables.
+ *   x1 : Extra flags of the SCTLR.
  *
- * Clobbers x0 - x4
+ * Clobbers x0 - x5
  */
 enable_mmu:
         mov   x4, x0
+        mov   x5, x1
         PRINT("- Turning on paging -\r\n")
 
         /*
@@ -289,6 +291,7 @@ enable_mmu:
         mrs   x0, SCTLR_EL2
         orr   x0, x0, #SCTLR_Axx_ELx_M  /* Enable MMU */
         orr   x0, x0, #SCTLR_Axx_ELx_C  /* Enable D-cache */
+        orr   x0, x0, x5                /* Enable extra flags */
         dsb   sy                     /* Flush PTE writes and finish reads */
         msr   SCTLR_EL2, x0          /* now paging is enabled */
         isb                          /* Now, flush the icache */
@@ -303,16 +306,17 @@ ENDPROC(enable_mmu)
  * Inputs:
  *   lr : Virtual address to return to.
  *
- * Clobbers x0 - x5
+ * Clobbers x0 - x6
  */
 ENTRY(enable_secondary_cpu_mm)
-        mov   x5, lr
+        mov   x6, lr
 
         load_paddr x0, init_ttbr
         ldr   x0, [x0]
 
+        mov   x1, #SCTLR_Axx_ELx_WXN        /* Enable WxN from the start */
         bl    enable_mmu
-        mov   lr, x5
+        mov   lr, x6
 
         /* Return to the virtual address requested by the caller. */
         ret
@@ -326,14 +330,15 @@ ENDPROC(enable_secondary_cpu_mm)
  * Inputs:
  *   lr : Virtual address to return to.
  *
- * Clobbers x0 - x5
+ * Clobbers x0 - x6
  */
 ENTRY(enable_boot_cpu_mm)
-        mov   x5, lr
+        mov   x6, lr
 
         bl    create_page_tables
         load_paddr x0, boot_pgtable
 
+        mov   x1, #0        /* No extra SCTLR flags */
         bl    enable_mmu
 
         /*
@@ -343,7 +348,7 @@ ENTRY(enable_boot_cpu_mm)
         ldr   x0, =1f
         br    x0
 1:
-        mov   lr, x5
+        mov   lr, x6
         /*
          * The 1:1 map may clash with other parts of the Xen virtual memory
          * layout. As it is not used anymore, remove it completely to
diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index d25e59f828..163d22ecd3 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -214,8 +214,6 @@ extern void remove_early_mappings(void);
 /* Allocate and initialise pagetables for a secondary CPU. Sets init_ttbr to the
  * new page table */
 extern int init_secondary_pagetables(int cpu);
-/* Switch secondary CPUS to its own pagetables and finalise MMU setup */
-extern void mmu_init_secondary_cpu(void);
 /*
  * For Arm32, set up the direct-mapped xenheap: up to 1GB of contiguous,
  * always-mapped memory. Base must be 32MB aligned and size a multiple of 32MB.
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index b7eb3a6e08..923a90925c 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -326,12 +326,6 @@ void __init setup_pagetables(unsigned long boot_phys_offset)
 #endif
 }
 
-/* MMU setup for secondary CPUS (which already have paging enabled) */
-void mmu_init_secondary_cpu(void)
-{
-    xen_pt_enforce_wnx();
-}
-
 #ifdef CONFIG_ARM_32
 /*
  * Set up the direct-mapped xenheap:
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 5533aed455..1cf6e50a85 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -361,8 +361,6 @@ void start_secondary(void)
      */
     update_system_features(&current_cpu_data);
 
-    mmu_init_secondary_cpu();
-
     gic_init_secondary_cpu();
 
     set_current(idle_vcpu[cpuid]);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 21:33:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 21:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.638277.994665 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5YNB-0005ST-FD; Tue, 21 Nov 2023 21:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 638277.994665; Tue, 21 Nov 2023 21: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 1r5YNB-0005SL-C8; Tue, 21 Nov 2023 21:33:33 +0000
Received: by outflank-mailman (input) for mailman id 638277;
 Tue, 21 Nov 2023 21: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 1r5YNA-0005S9-L7
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21: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 1r5YNA-0003Z8-KG
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5YNA-0005oB-JB
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:33:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DiPD2fXue3M7yQM06nFRS/0Qt2tvfDrGETtybCFaboA=; b=Twk99tkyVYqGhp+sYOCPK50NLw
	igPQJZKDDk/pHmRhMte601j7lHOD0Exus9TqKLfkYzqFDawS6yO9hphX5hxzZVj1XiTlRgzo3TR/Y
	zs07ikHBZJhDM2hsYU386nl7A9H5v4wM/X1/ohFiSI9L9sqghfXSWxROpOa/A86mR1aI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Extract MMU-specific MM code
Message-Id: <E1r5YNA-0005oB-JB@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 21:33:32 +0000

commit f661a20aa880255b6f5e6799d35cc92d9af5ea59
Author:     Henry Wang <Henry.Wang@arm.com>
AuthorDate: Thu Nov 16 22:50:28 2023 +0800
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Nov 20 19:07:45 2023 +0000

    xen/arm: Extract MMU-specific MM code
    
    Currently, most of the code is in arm/mm.{c,h} and arm/arm64/mm.c
    is MMU-specific. To make the MM code extendable, this commit extracts
    the MMU-specific MM code.
    
    Extract the boot CPU MM bringup code from arm/mm.c to mmu/setup.c.
    While moving, mark pte_of_xenaddr() as __init to make clear that
    this helper is only intended to be used during early boot.
    
    Move arm/arm64/mm.c to arm/arm64/mmu/mm.c. Since the function
    setup_directmap_mappings() has different implementations between
    arm32 and arm64, move their arch-specific implementation to
    arch-specific arm{32,64}/mmu/mm.c instead using #ifdef again.
    
    For header files, move MMU-related function declarations in
    asm/mm.h, declaration of global variable init_ttbr and the
    declaration of dump_pt_walk() in asm/page.h to asm/mmu/mm.h
    
    Also modify the build system (Makefiles in this case) to pick above
    mentioned code changes.
    
    Take the opportunity to fix the in-code comment coding styles when
    possible, and drop the unnecessary #include headers in the original
    arm/mm.c.
    
    Signed-off-by: Henry Wang <Henry.Wang@arm.com>
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/arm32/Makefile       |   1 +
 xen/arch/arm/arm32/mmu/Makefile   |   1 +
 xen/arch/arm/arm32/mmu/mm.c       |  31 +++
 xen/arch/arm/arm64/Makefile       |   1 -
 xen/arch/arm/arm64/mm.c           | 163 ----------------
 xen/arch/arm/arm64/mmu/Makefile   |   1 +
 xen/arch/arm/arm64/mmu/mm.c       | 200 ++++++++++++++++++++
 xen/arch/arm/include/asm/mm.h     |  25 +--
 xen/arch/arm/include/asm/mmu/mm.h |  50 +++++
 xen/arch/arm/include/asm/page.h   |  15 --
 xen/arch/arm/mm.c                 | 385 --------------------------------------
 xen/arch/arm/mmu/Makefile         |   1 +
 xen/arch/arm/mmu/setup.c          | 349 ++++++++++++++++++++++++++++++++++
 13 files changed, 640 insertions(+), 583 deletions(-)

diff --git a/xen/arch/arm/arm32/Makefile b/xen/arch/arm/arm32/Makefile
index 520fb42054..40a2b4803f 100644
--- a/xen/arch/arm/arm32/Makefile
+++ b/xen/arch/arm/arm32/Makefile
@@ -1,4 +1,5 @@
 obj-y += lib/
+obj-$(CONFIG_MMU) += mmu/
 
 obj-$(CONFIG_EARLY_PRINTK) += debug.o
 obj-y += domctl.o
diff --git a/xen/arch/arm/arm32/mmu/Makefile b/xen/arch/arm/arm32/mmu/Makefile
new file mode 100644
index 0000000000..b18cec4836
--- /dev/null
+++ b/xen/arch/arm/arm32/mmu/Makefile
@@ -0,0 +1 @@
+obj-y += mm.o
diff --git a/xen/arch/arm/arm32/mmu/mm.c b/xen/arch/arm/arm32/mmu/mm.c
new file mode 100644
index 0000000000..647baf4a81
--- /dev/null
+++ b/xen/arch/arm/arm32/mmu/mm.c
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#include <xen/init.h>
+#include <asm/fixmap.h>
+
+/*
+ * Set up the direct-mapped xenheap:
+ * up to 1GB of contiguous, always-mapped memory.
+ */
+void __init setup_directmap_mappings(unsigned long base_mfn,
+                                     unsigned long nr_mfns)
+{
+    int rc;
+
+    rc = map_pages_to_xen(XENHEAP_VIRT_START, _mfn(base_mfn), nr_mfns,
+                          PAGE_HYPERVISOR_RW | _PAGE_BLOCK);
+    if ( rc )
+        panic("Unable to setup the directmap mappings.\n");
+
+    /* Record where the directmap is, for translation routines. */
+    directmap_virt_end = XENHEAP_VIRT_START + nr_mfns * PAGE_SIZE;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/arm64/Makefile b/xen/arch/arm/arm64/Makefile
index f89d5fb4fb..72161ff22e 100644
--- a/xen/arch/arm/arm64/Makefile
+++ b/xen/arch/arm/arm64/Makefile
@@ -11,7 +11,6 @@ obj-y += entry.o
 obj-y += head.o
 obj-y += insn.o
 obj-$(CONFIG_LIVEPATCH) += livepatch.o
-obj-y += mm.o
 obj-y += smc.o
 obj-y += smpboot.o
 obj-$(CONFIG_ARM64_SVE) += sve.o sve-asm.o
diff --git a/xen/arch/arm/arm64/mm.c b/xen/arch/arm/arm64/mm.c
deleted file mode 100644
index cb69df0661..0000000000
--- a/xen/arch/arm/arm64/mm.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-
-#include <xen/init.h>
-#include <xen/mm.h>
-
-#include <asm/setup.h>
-
-/* Override macros from asm/page.h to make them work with mfn_t */
-#undef virt_to_mfn
-#define virt_to_mfn(va) _mfn(__virt_to_mfn(va))
-
-static DEFINE_PAGE_TABLE(xen_first_id);
-static DEFINE_PAGE_TABLE(xen_second_id);
-static DEFINE_PAGE_TABLE(xen_third_id);
-
-/*
- * The identity mapping may start at physical address 0. So we don't want
- * to keep it mapped longer than necessary.
- *
- * When this is called, we are still using the boot_pgtable.
- *
- * We need to prepare the identity mapping for both the boot page tables
- * and runtime page tables.
- *
- * The logic to create the entry is slightly different because Xen may
- * be running at a different location at runtime.
- */
-static void __init prepare_boot_identity_mapping(void)
-{
-    paddr_t id_addr = virt_to_maddr(_start);
-    lpae_t pte;
-    DECLARE_OFFSETS(id_offsets, id_addr);
-
-    /*
-     * We will be re-using the boot ID tables. They may not have been
-     * zeroed but they should be unlinked. So it is fine to use
-     * clear_page().
-     */
-    clear_page(boot_first_id);
-    clear_page(boot_second_id);
-    clear_page(boot_third_id);
-
-    if ( id_offsets[0] >= IDENTITY_MAPPING_AREA_NR_L0 )
-        panic("Cannot handle ID mapping above %uTB\n",
-              IDENTITY_MAPPING_AREA_NR_L0 >> 1);
-
-    /* Link first ID table */
-    pte = mfn_to_xen_entry(virt_to_mfn(boot_first_id), MT_NORMAL);
-    pte.pt.table = 1;
-    pte.pt.xn = 0;
-
-    write_pte(&boot_pgtable[id_offsets[0]], pte);
-
-    /* Link second ID table */
-    pte = mfn_to_xen_entry(virt_to_mfn(boot_second_id), MT_NORMAL);
-    pte.pt.table = 1;
-    pte.pt.xn = 0;
-
-    write_pte(&boot_first_id[id_offsets[1]], pte);
-
-    /* Link third ID table */
-    pte = mfn_to_xen_entry(virt_to_mfn(boot_third_id), MT_NORMAL);
-    pte.pt.table = 1;
-    pte.pt.xn = 0;
-
-    write_pte(&boot_second_id[id_offsets[2]], pte);
-
-    /* The mapping in the third table will be created at a later stage */
-}
-
-static void __init prepare_runtime_identity_mapping(void)
-{
-    paddr_t id_addr = virt_to_maddr(_start);
-    lpae_t pte;
-    DECLARE_OFFSETS(id_offsets, id_addr);
-
-    if ( id_offsets[0] >= IDENTITY_MAPPING_AREA_NR_L0 )
-        panic("Cannot handle ID mapping above %uTB\n",
-              IDENTITY_MAPPING_AREA_NR_L0 >> 1);
-
-    /* Link first ID table */
-    pte = pte_of_xenaddr((vaddr_t)xen_first_id);
-    pte.pt.table = 1;
-    pte.pt.xn = 0;
-
-    write_pte(&xen_pgtable[id_offsets[0]], pte);
-
-    /* Link second ID table */
-    pte = pte_of_xenaddr((vaddr_t)xen_second_id);
-    pte.pt.table = 1;
-    pte.pt.xn = 0;
-
-    write_pte(&xen_first_id[id_offsets[1]], pte);
-
-    /* Link third ID table */
-    pte = pte_of_xenaddr((vaddr_t)xen_third_id);
-    pte.pt.table = 1;
-    pte.pt.xn = 0;
-
-    write_pte(&xen_second_id[id_offsets[2]], pte);
-
-    /* The mapping in the third table will be created at a later stage */
-}
-
-void __init arch_setup_page_tables(void)
-{
-    prepare_boot_identity_mapping();
-    prepare_runtime_identity_mapping();
-}
-
-void update_identity_mapping(bool enable)
-{
-    paddr_t id_addr = virt_to_maddr(_start);
-    int rc;
-
-    if ( enable )
-        rc = map_pages_to_xen(id_addr, maddr_to_mfn(id_addr), 1,
-                              PAGE_HYPERVISOR_RX);
-    else
-        rc = destroy_xen_mappings(id_addr, id_addr + PAGE_SIZE);
-
-    BUG_ON(rc);
-}
-
-extern void switch_ttbr_id(uint64_t ttbr);
-
-typedef void (switch_ttbr_fn)(uint64_t ttbr);
-
-void __init switch_ttbr(uint64_t ttbr)
-{
-    vaddr_t id_addr = virt_to_maddr(switch_ttbr_id);
-    switch_ttbr_fn *fn = (switch_ttbr_fn *)id_addr;
-    lpae_t pte;
-
-    /* Enable the identity mapping in the boot page tables */
-    update_identity_mapping(true);
-
-    /* Enable the identity mapping in the runtime page tables */
-    pte = pte_of_xenaddr((vaddr_t)switch_ttbr_id);
-    pte.pt.table = 1;
-    pte.pt.xn = 0;
-    pte.pt.ro = 1;
-    write_pte(&xen_third_id[third_table_offset(id_addr)], pte);
-
-    /* Switch TTBR */
-    fn(ttbr);
-
-    /*
-     * Disable the identity mapping in the runtime page tables.
-     * Note it is not necessary to disable it in the boot page tables
-     * because they are not going to be used by this CPU anymore.
-     */
-    update_identity_mapping(false);
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/arch/arm/arm64/mmu/Makefile b/xen/arch/arm/arm64/mmu/Makefile
index 3340058c08..a8a750a3d0 100644
--- a/xen/arch/arm/arm64/mmu/Makefile
+++ b/xen/arch/arm/arm64/mmu/Makefile
@@ -1 +1,2 @@
 obj-y += head.o
+obj-y += mm.o
diff --git a/xen/arch/arm/arm64/mmu/mm.c b/xen/arch/arm/arm64/mmu/mm.c
new file mode 100644
index 0000000000..e68edd6151
--- /dev/null
+++ b/xen/arch/arm/arm64/mmu/mm.c
@@ -0,0 +1,200 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#include <xen/init.h>
+#include <xen/mm.h>
+
+#include <asm/setup.h>
+
+/* Override macros from asm/page.h to make them work with mfn_t */
+#undef virt_to_mfn
+#define virt_to_mfn(va) _mfn(__virt_to_mfn(va))
+
+static DEFINE_PAGE_TABLE(xen_first_id);
+static DEFINE_PAGE_TABLE(xen_second_id);
+static DEFINE_PAGE_TABLE(xen_third_id);
+
+/*
+ * The identity mapping may start at physical address 0. So we don't want
+ * to keep it mapped longer than necessary.
+ *
+ * When this is called, we are still using the boot_pgtable.
+ *
+ * We need to prepare the identity mapping for both the boot page tables
+ * and runtime page tables.
+ *
+ * The logic to create the entry is slightly different because Xen may
+ * be running at a different location at runtime.
+ */
+static void __init prepare_boot_identity_mapping(void)
+{
+    paddr_t id_addr = virt_to_maddr(_start);
+    lpae_t pte;
+    DECLARE_OFFSETS(id_offsets, id_addr);
+
+    /*
+     * We will be re-using the boot ID tables. They may not have been
+     * zeroed but they should be unlinked. So it is fine to use
+     * clear_page().
+     */
+    clear_page(boot_first_id);
+    clear_page(boot_second_id);
+    clear_page(boot_third_id);
+
+    if ( id_offsets[0] >= IDENTITY_MAPPING_AREA_NR_L0 )
+        panic("Cannot handle ID mapping above %uTB\n",
+              IDENTITY_MAPPING_AREA_NR_L0 >> 1);
+
+    /* Link first ID table */
+    pte = mfn_to_xen_entry(virt_to_mfn(boot_first_id), MT_NORMAL);
+    pte.pt.table = 1;
+    pte.pt.xn = 0;
+
+    write_pte(&boot_pgtable[id_offsets[0]], pte);
+
+    /* Link second ID table */
+    pte = mfn_to_xen_entry(virt_to_mfn(boot_second_id), MT_NORMAL);
+    pte.pt.table = 1;
+    pte.pt.xn = 0;
+
+    write_pte(&boot_first_id[id_offsets[1]], pte);
+
+    /* Link third ID table */
+    pte = mfn_to_xen_entry(virt_to_mfn(boot_third_id), MT_NORMAL);
+    pte.pt.table = 1;
+    pte.pt.xn = 0;
+
+    write_pte(&boot_second_id[id_offsets[2]], pte);
+
+    /* The mapping in the third table will be created at a later stage */
+}
+
+static void __init prepare_runtime_identity_mapping(void)
+{
+    paddr_t id_addr = virt_to_maddr(_start);
+    lpae_t pte;
+    DECLARE_OFFSETS(id_offsets, id_addr);
+
+    if ( id_offsets[0] >= IDENTITY_MAPPING_AREA_NR_L0 )
+        panic("Cannot handle ID mapping above %uTB\n",
+              IDENTITY_MAPPING_AREA_NR_L0 >> 1);
+
+    /* Link first ID table */
+    pte = pte_of_xenaddr((vaddr_t)xen_first_id);
+    pte.pt.table = 1;
+    pte.pt.xn = 0;
+
+    write_pte(&xen_pgtable[id_offsets[0]], pte);
+
+    /* Link second ID table */
+    pte = pte_of_xenaddr((vaddr_t)xen_second_id);
+    pte.pt.table = 1;
+    pte.pt.xn = 0;
+
+    write_pte(&xen_first_id[id_offsets[1]], pte);
+
+    /* Link third ID table */
+    pte = pte_of_xenaddr((vaddr_t)xen_third_id);
+    pte.pt.table = 1;
+    pte.pt.xn = 0;
+
+    write_pte(&xen_second_id[id_offsets[2]], pte);
+
+    /* The mapping in the third table will be created at a later stage */
+}
+
+void __init arch_setup_page_tables(void)
+{
+    prepare_boot_identity_mapping();
+    prepare_runtime_identity_mapping();
+}
+
+void update_identity_mapping(bool enable)
+{
+    paddr_t id_addr = virt_to_maddr(_start);
+    int rc;
+
+    if ( enable )
+        rc = map_pages_to_xen(id_addr, maddr_to_mfn(id_addr), 1,
+                              PAGE_HYPERVISOR_RX);
+    else
+        rc = destroy_xen_mappings(id_addr, id_addr + PAGE_SIZE);
+
+    BUG_ON(rc);
+}
+
+extern void switch_ttbr_id(uint64_t ttbr);
+
+typedef void (switch_ttbr_fn)(uint64_t ttbr);
+
+void __init switch_ttbr(uint64_t ttbr)
+{
+    vaddr_t id_addr = virt_to_maddr(switch_ttbr_id);
+    switch_ttbr_fn *fn = (switch_ttbr_fn *)id_addr;
+    lpae_t pte;
+
+    /* Enable the identity mapping in the boot page tables */
+    update_identity_mapping(true);
+
+    /* Enable the identity mapping in the runtime page tables */
+    pte = pte_of_xenaddr((vaddr_t)switch_ttbr_id);
+    pte.pt.table = 1;
+    pte.pt.xn = 0;
+    pte.pt.ro = 1;
+    write_pte(&xen_third_id[third_table_offset(id_addr)], pte);
+
+    /* Switch TTBR */
+    fn(ttbr);
+
+    /*
+     * Disable the identity mapping in the runtime page tables.
+     * Note it is not necessary to disable it in the boot page tables
+     * because they are not going to be used by this CPU anymore.
+     */
+    update_identity_mapping(false);
+}
+
+/* Map the region in the directmap area. */
+void __init setup_directmap_mappings(unsigned long base_mfn,
+                                     unsigned long nr_mfns)
+{
+    int rc;
+
+    /* First call sets the directmap physical and virtual offset. */
+    if ( mfn_eq(directmap_mfn_start, INVALID_MFN) )
+    {
+        unsigned long mfn_gb = base_mfn & ~((FIRST_SIZE >> PAGE_SHIFT) - 1);
+
+        directmap_mfn_start = _mfn(base_mfn);
+        directmap_base_pdx = mfn_to_pdx(_mfn(base_mfn));
+        /*
+         * The base address may not be aligned to the first level
+         * size (e.g. 1GB when using 4KB pages). This would prevent
+         * superpage mappings for all the regions because the virtual
+         * address and machine address should both be suitably aligned.
+         *
+         * Prevent that by offsetting the start of the directmap virtual
+         * address.
+         */
+        directmap_virt_start = DIRECTMAP_VIRT_START +
+            (base_mfn - mfn_gb) * PAGE_SIZE;
+    }
+
+    if ( base_mfn < mfn_x(directmap_mfn_start) )
+        panic("cannot add directmap mapping at %lx below heap start %lx\n",
+              base_mfn, mfn_x(directmap_mfn_start));
+
+    rc = map_pages_to_xen((vaddr_t)__mfn_to_virt(base_mfn),
+                          _mfn(base_mfn), nr_mfns,
+                          PAGE_HYPERVISOR_RW | _PAGE_BLOCK);
+    if ( rc )
+        panic("Unable to setup the directmap mappings.\n");
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index 163d22ecd3..d23ebc7df6 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -14,6 +14,12 @@
 # error "unknown ARM variant"
 #endif
 
+#if defined(CONFIG_MMU)
+# include <asm/mmu/mm.h>
+#else
+# error "Unknown memory management layout"
+#endif
+
 /* Align Xen to a 2 MiB boundary. */
 #define XEN_PADDR_ALIGN (1 << 21)
 
@@ -165,16 +171,6 @@ struct page_info
 #define _PGC_need_scrub   _PGC_allocated
 #define PGC_need_scrub    PGC_allocated
 
-/* Non-boot CPUs use this to find the correct pagetables. */
-extern uint64_t init_ttbr;
-
-extern mfn_t directmap_mfn_start, directmap_mfn_end;
-extern vaddr_t directmap_virt_end;
-#ifdef CONFIG_ARM_64
-extern vaddr_t directmap_virt_start;
-extern unsigned long directmap_base_pdx;
-#endif
-
 #ifdef CONFIG_ARM_32
 #define is_xen_heap_page(page) is_xen_heap_mfn(page_to_mfn(page))
 #define is_xen_heap_mfn(mfn) ({                                 \
@@ -197,7 +193,6 @@ extern unsigned long directmap_base_pdx;
 
 #define maddr_get_owner(ma)   (page_get_owner(maddr_to_page((ma))))
 
-#define frame_table ((struct page_info *)FRAMETABLE_VIRT_START)
 /* PDX of the first page in the frame table. */
 extern unsigned long frametable_base_pdx;
 
@@ -207,19 +202,11 @@ extern unsigned long frametable_base_pdx;
 extern void setup_pagetables(unsigned long boot_phys_offset);
 /* Map FDT in boot pagetable */
 extern void *early_fdt_map(paddr_t fdt_paddr);
-/* Switch to a new root page-tables */
-extern void switch_ttbr(uint64_t ttbr);
 /* Remove early mappings */
 extern void remove_early_mappings(void);
 /* Allocate and initialise pagetables for a secondary CPU. Sets init_ttbr to the
  * new page table */
 extern int init_secondary_pagetables(int cpu);
-/*
- * For Arm32, set up the direct-mapped xenheap: up to 1GB of contiguous,
- * always-mapped memory. Base must be 32MB aligned and size a multiple of 32MB.
- * For Arm64, map the region in the directmap area.
- */
-extern void setup_directmap_mappings(unsigned long base_mfn, unsigned long nr_mfns);
 /* Map a frame table to cover physical addresses ps through pe */
 extern void setup_frametable_mappings(paddr_t ps, paddr_t pe);
 /* map a physical range in virtual memory */
diff --git a/xen/arch/arm/include/asm/mmu/mm.h b/xen/arch/arm/include/asm/mmu/mm.h
new file mode 100644
index 0000000000..439ae314fd
--- /dev/null
+++ b/xen/arch/arm/include/asm/mmu/mm.h
@@ -0,0 +1,50 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef __ARM_MMU_MM_H__
+#define __ARM_MMU_MM_H__
+
+/* Non-boot CPUs use this to find the correct pagetables. */
+extern uint64_t init_ttbr;
+
+extern mfn_t directmap_mfn_start, directmap_mfn_end;
+extern vaddr_t directmap_virt_end;
+#ifdef CONFIG_ARM_64
+extern vaddr_t directmap_virt_start;
+extern unsigned long directmap_base_pdx;
+#endif
+
+#define frame_table ((struct page_info *)FRAMETABLE_VIRT_START)
+
+/*
+ * Print a walk of a page table or p2m
+ *
+ * ttbr is the base address register (TTBR0_EL2 or VTTBR_EL2)
+ * addr is the PA or IPA to translate
+ * root_level is the starting level of the page table
+ *   (e.g. TCR_EL2.SL0 or VTCR_EL2.SL0 )
+ * nr_root_tables is the number of concatenated tables at the root.
+ *   this can only be != 1 for P2M walks starting at the first or
+ *   subsequent level.
+ */
+void dump_pt_walk(paddr_t ttbr, paddr_t addr,
+                  unsigned int root_level,
+                  unsigned int nr_root_tables);
+
+/* Switch to a new root page-tables */
+extern void switch_ttbr(uint64_t ttbr);
+/*
+ * For Arm32, set up the direct-mapped xenheap: up to 1GB of contiguous,
+ * always-mapped memory. Base must be 32MB aligned and size a multiple of 32MB.
+ * For Arm64, map the region in the directmap area.
+ */
+extern void setup_directmap_mappings(unsigned long base_mfn, unsigned long nr_mfns);
+
+#endif /* __ARM_MMU_MM_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/include/asm/page.h b/xen/arch/arm/include/asm/page.h
index aa0080e8d7..ebaf5964f1 100644
--- a/xen/arch/arm/include/asm/page.h
+++ b/xen/arch/arm/include/asm/page.h
@@ -264,21 +264,6 @@ static inline void write_pte(lpae_t *p, lpae_t pte)
 /* Flush the dcache for an entire page. */
 void flush_page_to_ram(unsigned long mfn, bool sync_icache);
 
-/*
- * Print a walk of a page table or p2m
- *
- * ttbr is the base address register (TTBR0_EL2 or VTTBR_EL2)
- * addr is the PA or IPA to translate
- * root_level is the starting level of the page table
- *   (e.g. TCR_EL2.SL0 or VTCR_EL2.SL0 )
- * nr_root_tables is the number of concatenated tables at the root.
- *   this can only be != 1 for P2M walks starting at the first or
- *   subsequent level.
- */
-void dump_pt_walk(paddr_t ttbr, paddr_t addr,
-                  unsigned int root_level,
-                  unsigned int nr_root_tables);
-
 /* Print a walk of the hypervisor's page tables for a virtual addr. */
 extern void dump_hyp_walk(vaddr_t addr);
 /* Print a walk of the p2m for a domain for a physical address. */
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 923a90925c..eeb65ca6bb 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -11,136 +11,19 @@
 #include <xen/domain_page.h>
 #include <xen/grant_table.h>
 #include <xen/guest_access.h>
-#include <xen/libfdt/libfdt.h>
 #include <xen/mm.h>
-#include <xen/sizes.h>
 
 #include <xsm/xsm.h>
 
-#include <asm/setup.h>
-
 #include <public/memory.h>
 
 /* Override macros from asm/page.h to make them work with mfn_t */
 #undef virt_to_mfn
 #define virt_to_mfn(va) _mfn(__virt_to_mfn(va))
-#undef mfn_to_virt
-#define mfn_to_virt(mfn) __mfn_to_virt(mfn_x(mfn))
-
-/* Main runtime page tables */
-
-/*
- * For arm32 xen_pgtable are per-PCPU and are allocated before
- * bringing up each CPU. For arm64 xen_pgtable is common to all PCPUs.
- *
- * xen_second, xen_fixmap and xen_xenmap are always shared between all
- * PCPUs.
- */
-
-#ifdef CONFIG_ARM_64
-DEFINE_PAGE_TABLE(xen_pgtable);
-static DEFINE_PAGE_TABLE(xen_first);
-#define THIS_CPU_PGTABLE xen_pgtable
-#else
-/* Per-CPU pagetable pages */
-/* xen_pgtable == root of the trie (zeroeth level on 64-bit, first on 32-bit) */
-DEFINE_PER_CPU(lpae_t *, xen_pgtable);
-#define THIS_CPU_PGTABLE this_cpu(xen_pgtable)
-/* Root of the trie for cpu0, other CPU's PTs are dynamically allocated */
-static DEFINE_PAGE_TABLE(cpu0_pgtable);
-#endif
-
-/* Common pagetable leaves */
-/* Second level page table used to cover Xen virtual address space */
-static DEFINE_PAGE_TABLE(xen_second);
-/* Third level page table used for fixmap */
-DEFINE_BOOT_PAGE_TABLE(xen_fixmap);
-/*
- * Third level page table used to map Xen itself with the XN bit set
- * as appropriate.
- */
-static DEFINE_PAGE_TABLES(xen_xenmap, XEN_NR_ENTRIES(2));
-
-static paddr_t phys_offset;
-
-/* Limits of the Xen heap */
-mfn_t directmap_mfn_start __read_mostly = INVALID_MFN_INITIALIZER;
-mfn_t directmap_mfn_end __read_mostly;
-vaddr_t directmap_virt_end __read_mostly;
-#ifdef CONFIG_ARM_64
-vaddr_t directmap_virt_start __read_mostly;
-unsigned long directmap_base_pdx __read_mostly;
-#endif
 
 unsigned long frametable_base_pdx __read_mostly;
 unsigned long frametable_virt_end __read_mostly;
 
-extern char __init_begin[], __init_end[];
-
-/* Checking VA memory layout alignment. */
-static void __init __maybe_unused build_assertions(void)
-{
-    /* 2MB aligned regions */
-    BUILD_BUG_ON(XEN_VIRT_START & ~SECOND_MASK);
-    BUILD_BUG_ON(FIXMAP_ADDR(0) & ~SECOND_MASK);
-    /* 1GB aligned regions */
-#ifdef CONFIG_ARM_32
-    BUILD_BUG_ON(XENHEAP_VIRT_START & ~FIRST_MASK);
-#else
-    BUILD_BUG_ON(DIRECTMAP_VIRT_START & ~FIRST_MASK);
-#endif
-    /* Page table structure constraints */
-#ifdef CONFIG_ARM_64
-    /*
-     * The first few slots of the L0 table is reserved for the identity
-     * mapping. Check that none of the other regions are overlapping
-     * with it.
-     */
-#define CHECK_OVERLAP_WITH_IDMAP(virt) \
-    BUILD_BUG_ON(zeroeth_table_offset(virt) < IDENTITY_MAPPING_AREA_NR_L0)
-
-    CHECK_OVERLAP_WITH_IDMAP(XEN_VIRT_START);
-    CHECK_OVERLAP_WITH_IDMAP(VMAP_VIRT_START);
-    CHECK_OVERLAP_WITH_IDMAP(FRAMETABLE_VIRT_START);
-    CHECK_OVERLAP_WITH_IDMAP(DIRECTMAP_VIRT_START);
-#undef CHECK_OVERLAP_WITH_IDMAP
-#endif
-    BUILD_BUG_ON(first_table_offset(XEN_VIRT_START));
-#ifdef CONFIG_ARCH_MAP_DOMAIN_PAGE
-    BUILD_BUG_ON(DOMHEAP_VIRT_START & ~FIRST_MASK);
-#endif
-    /*
-     * The boot code expects the regions XEN_VIRT_START, FIXMAP_ADDR(0),
-     * BOOT_FDT_VIRT_START to use the same 0th (arm64 only) and 1st
-     * slot in the page tables.
-     */
-#define CHECK_SAME_SLOT(level, virt1, virt2) \
-    BUILD_BUG_ON(level##_table_offset(virt1) != level##_table_offset(virt2))
-
-#define CHECK_DIFFERENT_SLOT(level, virt1, virt2) \
-    BUILD_BUG_ON(level##_table_offset(virt1) == level##_table_offset(virt2))
-
-#ifdef CONFIG_ARM_64
-    CHECK_SAME_SLOT(zeroeth, XEN_VIRT_START, FIXMAP_ADDR(0));
-    CHECK_SAME_SLOT(zeroeth, XEN_VIRT_START, BOOT_FDT_VIRT_START);
-#endif
-    CHECK_SAME_SLOT(first, XEN_VIRT_START, FIXMAP_ADDR(0));
-    CHECK_SAME_SLOT(first, XEN_VIRT_START, BOOT_FDT_VIRT_START);
-
-    /*
-     * For arm32, the temporary mapping will re-use the domheap
-     * first slot and the second slots will match.
-     */
-#ifdef CONFIG_ARM_32
-    CHECK_SAME_SLOT(first, TEMPORARY_XEN_VIRT_START, DOMHEAP_VIRT_START);
-    CHECK_DIFFERENT_SLOT(first, XEN_VIRT_START, TEMPORARY_XEN_VIRT_START);
-    CHECK_SAME_SLOT(second, XEN_VIRT_START, TEMPORARY_XEN_VIRT_START);
-#endif
-
-#undef CHECK_SAME_SLOT
-#undef CHECK_DIFFERENT_SLOT
-}
-
 void flush_page_to_ram(unsigned long mfn, bool sync_icache)
 {
     void *v = map_domain_page(_mfn(mfn));
@@ -160,229 +43,6 @@ void flush_page_to_ram(unsigned long mfn, bool sync_icache)
         invalidate_icache();
 }
 
-lpae_t pte_of_xenaddr(vaddr_t va)
-{
-    paddr_t ma = va + phys_offset;
-
-    return mfn_to_xen_entry(maddr_to_mfn(ma), MT_NORMAL);
-}
-
-void * __init early_fdt_map(paddr_t fdt_paddr)
-{
-    /* We are using 2MB superpage for mapping the FDT */
-    paddr_t base_paddr = fdt_paddr & SECOND_MASK;
-    paddr_t offset;
-    void *fdt_virt;
-    uint32_t size;
-    int rc;
-
-    /*
-     * Check whether the physical FDT address is set and meets the minimum
-     * alignment requirement. Since we are relying on MIN_FDT_ALIGN to be at
-     * least 8 bytes so that we always access the magic and size fields
-     * of the FDT header after mapping the first chunk, double check if
-     * that is indeed the case.
-     */
-    BUILD_BUG_ON(MIN_FDT_ALIGN < 8);
-    if ( !fdt_paddr || fdt_paddr % MIN_FDT_ALIGN )
-        return NULL;
-
-    /* The FDT is mapped using 2MB superpage */
-    BUILD_BUG_ON(BOOT_FDT_VIRT_START % SZ_2M);
-
-    rc = map_pages_to_xen(BOOT_FDT_VIRT_START, maddr_to_mfn(base_paddr),
-                          SZ_2M >> PAGE_SHIFT,
-                          PAGE_HYPERVISOR_RO | _PAGE_BLOCK);
-    if ( rc )
-        panic("Unable to map the device-tree.\n");
-
-
-    offset = fdt_paddr % SECOND_SIZE;
-    fdt_virt = (void *)BOOT_FDT_VIRT_START + offset;
-
-    if ( fdt_magic(fdt_virt) != FDT_MAGIC )
-        return NULL;
-
-    size = fdt_totalsize(fdt_virt);
-    if ( size > MAX_FDT_SIZE )
-        return NULL;
-
-    if ( (offset + size) > SZ_2M )
-    {
-        rc = map_pages_to_xen(BOOT_FDT_VIRT_START + SZ_2M,
-                              maddr_to_mfn(base_paddr + SZ_2M),
-                              SZ_2M >> PAGE_SHIFT,
-                              PAGE_HYPERVISOR_RO | _PAGE_BLOCK);
-        if ( rc )
-            panic("Unable to map the device-tree\n");
-    }
-
-    return fdt_virt;
-}
-
-void __init remove_early_mappings(void)
-{
-    int rc;
-
-    /* destroy the _PAGE_BLOCK mapping */
-    rc = modify_xen_mappings(BOOT_FDT_VIRT_START,
-                             BOOT_FDT_VIRT_START + BOOT_FDT_VIRT_SIZE,
-                             _PAGE_BLOCK);
-    BUG_ON(rc);
-}
-
-/*
- * After boot, Xen page-tables should not contain mapping that are both
- * Writable and eXecutables.
- *
- * This should be called on each CPU to enforce the policy.
- */
-static void xen_pt_enforce_wnx(void)
-{
-    WRITE_SYSREG(READ_SYSREG(SCTLR_EL2) | SCTLR_Axx_ELx_WXN, SCTLR_EL2);
-    /*
-     * The TLBs may cache SCTLR_EL2.WXN. So ensure it is synchronized
-     * before flushing the TLBs.
-     */
-    isb();
-    flush_xen_tlb_local();
-}
-
-/* Boot-time pagetable setup.
- * Changes here may need matching changes in head.S */
-void __init setup_pagetables(unsigned long boot_phys_offset)
-{
-    uint64_t ttbr;
-    lpae_t pte, *p;
-    int i;
-
-    phys_offset = boot_phys_offset;
-
-    arch_setup_page_tables();
-
-#ifdef CONFIG_ARM_64
-    pte = pte_of_xenaddr((uintptr_t)xen_first);
-    pte.pt.table = 1;
-    pte.pt.xn = 0;
-    xen_pgtable[zeroeth_table_offset(XEN_VIRT_START)] = pte;
-
-    p = (void *) xen_first;
-#else
-    p = (void *) cpu0_pgtable;
-#endif
-
-    /* Map xen second level page-table */
-    p[0] = pte_of_xenaddr((uintptr_t)(xen_second));
-    p[0].pt.table = 1;
-    p[0].pt.xn = 0;
-
-    /* Break up the Xen mapping into pages and protect them separately. */
-    for ( i = 0; i < XEN_NR_ENTRIES(3); i++ )
-    {
-        vaddr_t va = XEN_VIRT_START + (i << PAGE_SHIFT);
-
-        if ( !is_kernel(va) )
-            break;
-        pte = pte_of_xenaddr(va);
-        pte.pt.table = 1; /* third level mappings always have this bit set */
-        if ( is_kernel_text(va) || is_kernel_inittext(va) )
-        {
-            pte.pt.xn = 0;
-            pte.pt.ro = 1;
-        }
-        if ( is_kernel_rodata(va) )
-            pte.pt.ro = 1;
-        xen_xenmap[i] = pte;
-    }
-
-    /* Initialise xen second level entries ... */
-    /* ... Xen's text etc */
-    for ( i = 0; i < XEN_NR_ENTRIES(2); i++ )
-    {
-        vaddr_t va = XEN_VIRT_START + (i << XEN_PT_LEVEL_SHIFT(2));
-
-        pte = pte_of_xenaddr((vaddr_t)(xen_xenmap + i * XEN_PT_LPAE_ENTRIES));
-        pte.pt.table = 1;
-        xen_second[second_table_offset(va)] = pte;
-    }
-
-    /* ... Fixmap */
-    pte = pte_of_xenaddr((vaddr_t)xen_fixmap);
-    pte.pt.table = 1;
-    xen_second[second_table_offset(FIXMAP_ADDR(0))] = pte;
-
-#ifdef CONFIG_ARM_64
-    ttbr = (uintptr_t) xen_pgtable + phys_offset;
-#else
-    ttbr = (uintptr_t) cpu0_pgtable + phys_offset;
-#endif
-
-    switch_ttbr(ttbr);
-
-    xen_pt_enforce_wnx();
-
-#ifdef CONFIG_ARM_32
-    per_cpu(xen_pgtable, 0) = cpu0_pgtable;
-#endif
-}
-
-#ifdef CONFIG_ARM_32
-/*
- * Set up the direct-mapped xenheap:
- * up to 1GB of contiguous, always-mapped memory.
- */
-void __init setup_directmap_mappings(unsigned long base_mfn,
-                                     unsigned long nr_mfns)
-{
-    int rc;
-
-    rc = map_pages_to_xen(XENHEAP_VIRT_START, _mfn(base_mfn), nr_mfns,
-                          PAGE_HYPERVISOR_RW | _PAGE_BLOCK);
-    if ( rc )
-        panic("Unable to setup the directmap mappings.\n");
-
-    /* Record where the directmap is, for translation routines. */
-    directmap_virt_end = XENHEAP_VIRT_START + nr_mfns * PAGE_SIZE;
-}
-#else /* CONFIG_ARM_64 */
-/* Map the region in the directmap area. */
-void __init setup_directmap_mappings(unsigned long base_mfn,
-                                     unsigned long nr_mfns)
-{
-    int rc;
-
-    /* First call sets the directmap physical and virtual offset. */
-    if ( mfn_eq(directmap_mfn_start, INVALID_MFN) )
-    {
-        unsigned long mfn_gb = base_mfn & ~((FIRST_SIZE >> PAGE_SHIFT) - 1);
-
-        directmap_mfn_start = _mfn(base_mfn);
-        directmap_base_pdx = mfn_to_pdx(_mfn(base_mfn));
-        /*
-         * The base address may not be aligned to the first level
-         * size (e.g. 1GB when using 4KB pages). This would prevent
-         * superpage mappings for all the regions because the virtual
-         * address and machine address should both be suitably aligned.
-         *
-         * Prevent that by offsetting the start of the directmap virtual
-         * address.
-         */
-        directmap_virt_start = DIRECTMAP_VIRT_START +
-            (base_mfn - mfn_gb) * PAGE_SIZE;
-    }
-
-    if ( base_mfn < mfn_x(directmap_mfn_start) )
-        panic("cannot add directmap mapping at %lx below heap start %lx\n",
-              base_mfn, mfn_x(directmap_mfn_start));
-
-    rc = map_pages_to_xen((vaddr_t)__mfn_to_virt(base_mfn),
-                          _mfn(base_mfn), nr_mfns,
-                          PAGE_HYPERVISOR_RW | _PAGE_BLOCK);
-    if ( rc )
-        panic("Unable to setup the directmap mappings.\n");
-}
-#endif
-
 /* Map a frame table to cover physical addresses ps through pe */
 void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
 {
@@ -422,51 +82,6 @@ void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
     frametable_virt_end = FRAMETABLE_VIRT_START + (nr_pdxs * sizeof(struct page_info));
 }
 
-void *__init arch_vmap_virt_end(void)
-{
-    return (void *)(VMAP_VIRT_START + VMAP_VIRT_SIZE);
-}
-
-/* Release all __init and __initdata ranges to be reused */
-void free_init_memory(void)
-{
-    paddr_t pa = virt_to_maddr(__init_begin);
-    unsigned long len = __init_end - __init_begin;
-    uint32_t insn;
-    unsigned int i, nr = len / sizeof(insn);
-    uint32_t *p;
-    int rc;
-
-    rc = modify_xen_mappings((unsigned long)__init_begin,
-                             (unsigned long)__init_end, PAGE_HYPERVISOR_RW);
-    if ( rc )
-        panic("Unable to map RW the init section (rc = %d)\n", rc);
-
-    /*
-     * From now on, init will not be used for execution anymore,
-     * so nuke the instruction cache to remove entries related to init.
-     */
-    invalidate_icache_local();
-
-#ifdef CONFIG_ARM_32
-    /* udf instruction i.e (see A8.8.247 in ARM DDI 0406C.c) */
-    insn = 0xe7f000f0;
-#else
-    insn = AARCH64_BREAK_FAULT;
-#endif
-    p = (uint32_t *)__init_begin;
-    for ( i = 0; i < nr; i++ )
-        *(p + i) = insn;
-
-    rc = destroy_xen_mappings((unsigned long)__init_begin,
-                              (unsigned long)__init_end);
-    if ( rc )
-        panic("Unable to remove the init section (rc = %d)\n", rc);
-
-    init_domheap_pages(pa, pa + len);
-    printk("Freed %ldkB init memory.\n", (long)(__init_end-__init_begin)>>10);
-}
-
 int steal_page(
     struct domain *d, struct page_info *page, unsigned int memflags)
 {
diff --git a/xen/arch/arm/mmu/Makefile b/xen/arch/arm/mmu/Makefile
index 0e82015ee1..98aea965df 100644
--- a/xen/arch/arm/mmu/Makefile
+++ b/xen/arch/arm/mmu/Makefile
@@ -1,2 +1,3 @@
 obj-y += pt.o
+obj-y += setup.o
 obj-y += smpboot.o
diff --git a/xen/arch/arm/mmu/setup.c b/xen/arch/arm/mmu/setup.c
new file mode 100644
index 0000000000..c2df976ab2
--- /dev/null
+++ b/xen/arch/arm/mmu/setup.c
@@ -0,0 +1,349 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * xen/arch/arm/mmu/setup.c
+ *
+ * MMU system boot CPU MM bringup code.
+ */
+
+#include <xen/init.h>
+#include <xen/libfdt/libfdt.h>
+#include <xen/sizes.h>
+
+#include <asm/fixmap.h>
+
+/* Override macros from asm/page.h to make them work with mfn_t */
+#undef mfn_to_virt
+#define mfn_to_virt(mfn) __mfn_to_virt(mfn_x(mfn))
+
+/* Main runtime page tables */
+
+/*
+ * For arm32 xen_pgtable are per-PCPU and are allocated before
+ * bringing up each CPU. For arm64 xen_pgtable is common to all PCPUs.
+ *
+ * xen_second, xen_fixmap and xen_xenmap are always shared between all
+ * PCPUs.
+ */
+
+#ifdef CONFIG_ARM_64
+DEFINE_PAGE_TABLE(xen_pgtable);
+static DEFINE_PAGE_TABLE(xen_first);
+#define THIS_CPU_PGTABLE xen_pgtable
+#else
+/* Per-CPU pagetable pages */
+/* xen_pgtable == root of the trie (zeroeth level on 64-bit, first on 32-bit) */
+DEFINE_PER_CPU(lpae_t *, xen_pgtable);
+#define THIS_CPU_PGTABLE this_cpu(xen_pgtable)
+/* Root of the trie for cpu0, other CPU's PTs are dynamically allocated */
+static DEFINE_PAGE_TABLE(cpu0_pgtable);
+#endif
+
+/* Common pagetable leaves */
+/* Second level page table used to cover Xen virtual address space */
+static DEFINE_PAGE_TABLE(xen_second);
+/* Third level page table used for fixmap */
+DEFINE_BOOT_PAGE_TABLE(xen_fixmap);
+/*
+ * Third level page table used to map Xen itself with the XN bit set
+ * as appropriate.
+ */
+static DEFINE_PAGE_TABLES(xen_xenmap, XEN_NR_ENTRIES(2));
+
+static paddr_t phys_offset;
+
+/* Limits of the Xen heap */
+mfn_t directmap_mfn_start __read_mostly = INVALID_MFN_INITIALIZER;
+mfn_t directmap_mfn_end __read_mostly;
+vaddr_t directmap_virt_end __read_mostly;
+#ifdef CONFIG_ARM_64
+vaddr_t directmap_virt_start __read_mostly;
+unsigned long directmap_base_pdx __read_mostly;
+#endif
+
+extern char __init_begin[], __init_end[];
+
+/* Checking VA memory layout alignment. */
+static void __init __maybe_unused build_assertions(void)
+{
+    /* 2MB aligned regions */
+    BUILD_BUG_ON(XEN_VIRT_START & ~SECOND_MASK);
+    BUILD_BUG_ON(FIXMAP_ADDR(0) & ~SECOND_MASK);
+    /* 1GB aligned regions */
+#ifdef CONFIG_ARM_32
+    BUILD_BUG_ON(XENHEAP_VIRT_START & ~FIRST_MASK);
+#else
+    BUILD_BUG_ON(DIRECTMAP_VIRT_START & ~FIRST_MASK);
+#endif
+    /* Page table structure constraints */
+#ifdef CONFIG_ARM_64
+    /*
+     * The first few slots of the L0 table is reserved for the identity
+     * mapping. Check that none of the other regions are overlapping
+     * with it.
+     */
+#define CHECK_OVERLAP_WITH_IDMAP(virt) \
+    BUILD_BUG_ON(zeroeth_table_offset(virt) < IDENTITY_MAPPING_AREA_NR_L0)
+
+    CHECK_OVERLAP_WITH_IDMAP(XEN_VIRT_START);
+    CHECK_OVERLAP_WITH_IDMAP(VMAP_VIRT_START);
+    CHECK_OVERLAP_WITH_IDMAP(FRAMETABLE_VIRT_START);
+    CHECK_OVERLAP_WITH_IDMAP(DIRECTMAP_VIRT_START);
+#undef CHECK_OVERLAP_WITH_IDMAP
+#endif
+    BUILD_BUG_ON(first_table_offset(XEN_VIRT_START));
+#ifdef CONFIG_ARCH_MAP_DOMAIN_PAGE
+    BUILD_BUG_ON(DOMHEAP_VIRT_START & ~FIRST_MASK);
+#endif
+    /*
+     * The boot code expects the regions XEN_VIRT_START, FIXMAP_ADDR(0),
+     * BOOT_FDT_VIRT_START to use the same 0th (arm64 only) and 1st
+     * slot in the page tables.
+     */
+#define CHECK_SAME_SLOT(level, virt1, virt2) \
+    BUILD_BUG_ON(level##_table_offset(virt1) != level##_table_offset(virt2))
+
+#define CHECK_DIFFERENT_SLOT(level, virt1, virt2) \
+    BUILD_BUG_ON(level##_table_offset(virt1) == level##_table_offset(virt2))
+
+#ifdef CONFIG_ARM_64
+    CHECK_SAME_SLOT(zeroeth, XEN_VIRT_START, FIXMAP_ADDR(0));
+    CHECK_SAME_SLOT(zeroeth, XEN_VIRT_START, BOOT_FDT_VIRT_START);
+#endif
+    CHECK_SAME_SLOT(first, XEN_VIRT_START, FIXMAP_ADDR(0));
+    CHECK_SAME_SLOT(first, XEN_VIRT_START, BOOT_FDT_VIRT_START);
+
+    /*
+     * For arm32, the temporary mapping will re-use the domheap
+     * first slot and the second slots will match.
+     */
+#ifdef CONFIG_ARM_32
+    CHECK_SAME_SLOT(first, TEMPORARY_XEN_VIRT_START, DOMHEAP_VIRT_START);
+    CHECK_DIFFERENT_SLOT(first, XEN_VIRT_START, TEMPORARY_XEN_VIRT_START);
+    CHECK_SAME_SLOT(second, XEN_VIRT_START, TEMPORARY_XEN_VIRT_START);
+#endif
+
+#undef CHECK_SAME_SLOT
+#undef CHECK_DIFFERENT_SLOT
+}
+
+lpae_t __init pte_of_xenaddr(vaddr_t va)
+{
+    paddr_t ma = va + phys_offset;
+
+    return mfn_to_xen_entry(maddr_to_mfn(ma), MT_NORMAL);
+}
+
+void * __init early_fdt_map(paddr_t fdt_paddr)
+{
+    /* We are using 2MB superpage for mapping the FDT */
+    paddr_t base_paddr = fdt_paddr & SECOND_MASK;
+    paddr_t offset;
+    void *fdt_virt;
+    uint32_t size;
+    int rc;
+
+    /*
+     * Check whether the physical FDT address is set and meets the minimum
+     * alignment requirement. Since we are relying on MIN_FDT_ALIGN to be at
+     * least 8 bytes so that we always access the magic and size fields
+     * of the FDT header after mapping the first chunk, double check if
+     * that is indeed the case.
+     */
+    BUILD_BUG_ON(MIN_FDT_ALIGN < 8);
+    if ( !fdt_paddr || fdt_paddr % MIN_FDT_ALIGN )
+        return NULL;
+
+    /* The FDT is mapped using 2MB superpage */
+    BUILD_BUG_ON(BOOT_FDT_VIRT_START % SZ_2M);
+
+    rc = map_pages_to_xen(BOOT_FDT_VIRT_START, maddr_to_mfn(base_paddr),
+                          SZ_2M >> PAGE_SHIFT,
+                          PAGE_HYPERVISOR_RO | _PAGE_BLOCK);
+    if ( rc )
+        panic("Unable to map the device-tree.\n");
+
+
+    offset = fdt_paddr % SECOND_SIZE;
+    fdt_virt = (void *)BOOT_FDT_VIRT_START + offset;
+
+    if ( fdt_magic(fdt_virt) != FDT_MAGIC )
+        return NULL;
+
+    size = fdt_totalsize(fdt_virt);
+    if ( size > MAX_FDT_SIZE )
+        return NULL;
+
+    if ( (offset + size) > SZ_2M )
+    {
+        rc = map_pages_to_xen(BOOT_FDT_VIRT_START + SZ_2M,
+                              maddr_to_mfn(base_paddr + SZ_2M),
+                              SZ_2M >> PAGE_SHIFT,
+                              PAGE_HYPERVISOR_RO | _PAGE_BLOCK);
+        if ( rc )
+            panic("Unable to map the device-tree\n");
+    }
+
+    return fdt_virt;
+}
+
+void __init remove_early_mappings(void)
+{
+    int rc;
+
+    /* destroy the _PAGE_BLOCK mapping */
+    rc = modify_xen_mappings(BOOT_FDT_VIRT_START,
+                             BOOT_FDT_VIRT_START + BOOT_FDT_VIRT_SIZE,
+                             _PAGE_BLOCK);
+    BUG_ON(rc);
+}
+
+/*
+ * After boot, Xen page-tables should not contain mapping that are both
+ * Writable and eXecutables.
+ *
+ * This should be called on each CPU to enforce the policy.
+ */
+static void xen_pt_enforce_wnx(void)
+{
+    WRITE_SYSREG(READ_SYSREG(SCTLR_EL2) | SCTLR_Axx_ELx_WXN, SCTLR_EL2);
+    /*
+     * The TLBs may cache SCTLR_EL2.WXN. So ensure it is synchronized
+     * before flushing the TLBs.
+     */
+    isb();
+    flush_xen_tlb_local();
+}
+
+/*
+ * Boot-time pagetable setup.
+ * Changes here may need matching changes in head.S
+ */
+void __init setup_pagetables(unsigned long boot_phys_offset)
+{
+    uint64_t ttbr;
+    lpae_t pte, *p;
+    int i;
+
+    phys_offset = boot_phys_offset;
+
+    arch_setup_page_tables();
+
+#ifdef CONFIG_ARM_64
+    pte = pte_of_xenaddr((uintptr_t)xen_first);
+    pte.pt.table = 1;
+    pte.pt.xn = 0;
+    xen_pgtable[zeroeth_table_offset(XEN_VIRT_START)] = pte;
+
+    p = (void *) xen_first;
+#else
+    p = (void *) cpu0_pgtable;
+#endif
+
+    /* Map xen second level page-table */
+    p[0] = pte_of_xenaddr((uintptr_t)(xen_second));
+    p[0].pt.table = 1;
+    p[0].pt.xn = 0;
+
+    /* Break up the Xen mapping into pages and protect them separately. */
+    for ( i = 0; i < XEN_NR_ENTRIES(3); i++ )
+    {
+        vaddr_t va = XEN_VIRT_START + (i << PAGE_SHIFT);
+
+        if ( !is_kernel(va) )
+            break;
+        pte = pte_of_xenaddr(va);
+        pte.pt.table = 1; /* third level mappings always have this bit set */
+        if ( is_kernel_text(va) || is_kernel_inittext(va) )
+        {
+            pte.pt.xn = 0;
+            pte.pt.ro = 1;
+        }
+        if ( is_kernel_rodata(va) )
+            pte.pt.ro = 1;
+        xen_xenmap[i] = pte;
+    }
+
+    /* Initialise xen second level entries ... */
+    /* ... Xen's text etc */
+    for ( i = 0; i < XEN_NR_ENTRIES(2); i++ )
+    {
+        vaddr_t va = XEN_VIRT_START + (i << XEN_PT_LEVEL_SHIFT(2));
+
+        pte = pte_of_xenaddr((vaddr_t)(xen_xenmap + i * XEN_PT_LPAE_ENTRIES));
+        pte.pt.table = 1;
+        xen_second[second_table_offset(va)] = pte;
+    }
+
+    /* ... Fixmap */
+    pte = pte_of_xenaddr((vaddr_t)xen_fixmap);
+    pte.pt.table = 1;
+    xen_second[second_table_offset(FIXMAP_ADDR(0))] = pte;
+
+#ifdef CONFIG_ARM_64
+    ttbr = (uintptr_t) xen_pgtable + phys_offset;
+#else
+    ttbr = (uintptr_t) cpu0_pgtable + phys_offset;
+#endif
+
+    switch_ttbr(ttbr);
+
+    xen_pt_enforce_wnx();
+
+#ifdef CONFIG_ARM_32
+    per_cpu(xen_pgtable, 0) = cpu0_pgtable;
+#endif
+}
+
+void *__init arch_vmap_virt_end(void)
+{
+    return (void *)(VMAP_VIRT_START + VMAP_VIRT_SIZE);
+}
+
+/* Release all __init and __initdata ranges to be reused */
+void free_init_memory(void)
+{
+    paddr_t pa = virt_to_maddr(__init_begin);
+    unsigned long len = __init_end - __init_begin;
+    uint32_t insn;
+    unsigned int i, nr = len / sizeof(insn);
+    uint32_t *p;
+    int rc;
+
+    rc = modify_xen_mappings((unsigned long)__init_begin,
+                             (unsigned long)__init_end, PAGE_HYPERVISOR_RW);
+    if ( rc )
+        panic("Unable to map RW the init section (rc = %d)\n", rc);
+
+    /*
+     * From now on, init will not be used for execution anymore,
+     * so nuke the instruction cache to remove entries related to init.
+     */
+    invalidate_icache_local();
+
+#ifdef CONFIG_ARM_32
+    /* udf instruction i.e (see A8.8.247 in ARM DDI 0406C.c) */
+    insn = 0xe7f000f0;
+#else
+    insn = AARCH64_BREAK_FAULT;
+#endif
+    p = (uint32_t *)__init_begin;
+    for ( i = 0; i < nr; i++ )
+        *(p + i) = insn;
+
+    rc = destroy_xen_mappings((unsigned long)__init_begin,
+                              (unsigned long)__init_end);
+    if ( rc )
+        panic("Unable to remove the init section (rc = %d)\n", rc);
+
+    init_domheap_pages(pa, pa + len);
+    printk("Freed %ldkB init memory.\n", (long)(__init_end-__init_begin)>>10);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 21:33:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 21:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.638278.994669 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5YNL-0005Vh-J4; Tue, 21 Nov 2023 21:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 638278.994669; Tue, 21 Nov 2023 21: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 1r5YNL-0005VZ-GI; Tue, 21 Nov 2023 21:33:43 +0000
Received: by outflank-mailman (input) for mailman id 638278;
 Tue, 21 Nov 2023 21: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 1r5YNK-0005VQ-OK
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21: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 1r5YNK-0003ZG-NU
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5YNK-0005oi-MZ
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:33:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=j3bF9jLxjTx77F5sU+W4pSFzHaps2KpZMrcHdFAbHBE=; b=IExx6MtM1O57TJTAZMwRQz+sKB
	HkT5Qgw6+RwUqSIu/KqFYwnoKCC6B9UOjoKVbP6UzkYK14/GuXfOkxGcir6DANR4l43aVsPks2meN
	GSjjFpD8fsY2sYz/xj6ylwEXAzR2A7oin2DomY/wu+U7vKFprp2zCGYgNI2laOK83CR4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Split MMU-specific setup_mm() and related code out
Message-Id: <E1r5YNK-0005oi-MZ@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 21:33:42 +0000

commit 672d67f339c09282ad7d33c8b846c8fa65c52ed0
Author:     Henry Wang <Henry.Wang@arm.com>
AuthorDate: Thu Nov 16 22:50:29 2023 +0800
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Nov 20 19:07:45 2023 +0000

    xen/arm: Split MMU-specific setup_mm() and related code out
    
    setup_mm() is used for Xen to setup memory management subsystem,
    such as boot allocator, direct-mapping, xenheap initialization,
    frametable and static memory pages, at boot time.
    
    We could inherit some components seamlessly for MPU support, such
    as the setup of boot allocator, whilst we need to implement some
    components differently for MPU, such as xenheap, etc. Also, there
    are some components that is specific to MMU only, for example the
    direct-mapping.
    
    Therefore in this commit, we split the MMU-specific setup_mm() and
    related code out. Since arm32 and arm64 have completely different
    setup_mm() implementation, take the opportunity to split the
    arch-specific setup_mm() to arch-specific files, so that we can
    avoid #ifdef. Also, make init_pdx(), init_staticmem_pages(), and
    populate_boot_allocator() public as these functions are now called
    from two different units, and make setup_mm() public for future MPU
    implementation.
    
    With above code movement, mark setup_directmap_mappings() as static
    because the only caller of this function is now in the same file
    with it. Drop the original setup_directmap_mappings() declaration
    and move the in-code comment on top of the declaration on top of
    the function implementation.
    
    Signed-off-by: Henry Wang <Henry.Wang@arm.com>
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Signed-off-by: Wei Chen <wei.chen@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/arm32/mmu/mm.c       | 278 +++++++++++++++++++++++++++++++-
 xen/arch/arm/arm64/mmu/mm.c       |  51 +++++-
 xen/arch/arm/include/asm/mmu/mm.h |   6 -
 xen/arch/arm/include/asm/setup.h  |   5 +
 xen/arch/arm/setup.c              | 324 +-------------------------------------
 5 files changed, 331 insertions(+), 333 deletions(-)

diff --git a/xen/arch/arm/arm32/mmu/mm.c b/xen/arch/arm/arm32/mmu/mm.c
index 647baf4a81..94d6cab49c 100644
--- a/xen/arch/arm/arm32/mmu/mm.c
+++ b/xen/arch/arm/arm32/mmu/mm.c
@@ -1,14 +1,21 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 
 #include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/libfdt/libfdt-xen.h>
+#include <xen/param.h>
+#include <xen/pfn.h>
 #include <asm/fixmap.h>
 
+static unsigned long opt_xenheap_megabytes __initdata;
+integer_param("xenheap_megabytes", opt_xenheap_megabytes);
+
 /*
- * Set up the direct-mapped xenheap:
- * up to 1GB of contiguous, always-mapped memory.
+ * Set up the direct-mapped xenheap: up to 1GB of contiguous,
+ * always-mapped memory. Base must be 32MB aligned and size a multiple of 32MB.
  */
-void __init setup_directmap_mappings(unsigned long base_mfn,
-                                     unsigned long nr_mfns)
+static void __init setup_directmap_mappings(unsigned long base_mfn,
+                                            unsigned long nr_mfns)
 {
     int rc;
 
@@ -21,6 +28,269 @@ void __init setup_directmap_mappings(unsigned long base_mfn,
     directmap_virt_end = XENHEAP_VIRT_START + nr_mfns * PAGE_SIZE;
 }
 
+/*
+ * Returns the end address of the highest region in the range s..e
+ * with required size and alignment that does not conflict with the
+ * modules from first_mod to nr_modules.
+ *
+ * For non-recursive callers first_mod should normally be 0 (all
+ * modules and Xen itself) or 1 (all modules but not Xen).
+ */
+static paddr_t __init consider_modules(paddr_t s, paddr_t e,
+                                       uint32_t size, paddr_t align,
+                                       int first_mod)
+{
+    const struct bootmodules *mi = &bootinfo.modules;
+    int i;
+    int nr;
+
+    s = (s+align-1) & ~(align-1);
+    e = e & ~(align-1);
+
+    if ( s > e ||  e - s < size )
+        return 0;
+
+    /* First check the boot modules */
+    for ( i = first_mod; i < mi->nr_mods; i++ )
+    {
+        paddr_t mod_s = mi->module[i].start;
+        paddr_t mod_e = mod_s + mi->module[i].size;
+
+        if ( s < mod_e && mod_s < e )
+        {
+            mod_e = consider_modules(mod_e, e, size, align, i+1);
+            if ( mod_e )
+                return mod_e;
+
+            return consider_modules(s, mod_s, size, align, i+1);
+        }
+    }
+
+    /* Now check any fdt reserved areas. */
+
+    nr = fdt_num_mem_rsv(device_tree_flattened);
+
+    for ( ; i < mi->nr_mods + nr; i++ )
+    {
+        paddr_t mod_s, mod_e;
+
+        if ( fdt_get_mem_rsv_paddr(device_tree_flattened,
+                                   i - mi->nr_mods,
+                                   &mod_s, &mod_e ) < 0 )
+            /* If we can't read it, pretend it doesn't exist... */
+            continue;
+
+        /* fdt_get_mem_rsv_paddr returns length */
+        mod_e += mod_s;
+
+        if ( s < mod_e && mod_s < e )
+        {
+            mod_e = consider_modules(mod_e, e, size, align, i+1);
+            if ( mod_e )
+                return mod_e;
+
+            return consider_modules(s, mod_s, size, align, i+1);
+        }
+    }
+
+    /*
+     * i is the current bootmodule we are evaluating, across all
+     * possible kinds of bootmodules.
+     *
+     * When retrieving the corresponding reserved-memory addresses, we
+     * need to index the bootinfo.reserved_mem bank starting from 0, and
+     * only counting the reserved-memory modules. Hence, we need to use
+     * i - nr.
+     */
+    nr += mi->nr_mods;
+    for ( ; i - nr < bootinfo.reserved_mem.nr_banks; i++ )
+    {
+        paddr_t r_s = bootinfo.reserved_mem.bank[i - nr].start;
+        paddr_t r_e = r_s + bootinfo.reserved_mem.bank[i - nr].size;
+
+        if ( s < r_e && r_s < e )
+        {
+            r_e = consider_modules(r_e, e, size, align, i + 1);
+            if ( r_e )
+                return r_e;
+
+            return consider_modules(s, r_s, size, align, i + 1);
+        }
+    }
+    return e;
+}
+
+/*
+ * Find a contiguous region that fits in the static heap region with
+ * required size and alignment, and return the end address of the region
+ * if found otherwise 0.
+ */
+static paddr_t __init fit_xenheap_in_static_heap(uint32_t size, paddr_t align)
+{
+    unsigned int i;
+    paddr_t end = 0, aligned_start, aligned_end;
+    paddr_t bank_start, bank_size, bank_end;
+
+    for ( i = 0 ; i < bootinfo.reserved_mem.nr_banks; i++ )
+    {
+        if ( bootinfo.reserved_mem.bank[i].type != MEMBANK_STATIC_HEAP )
+            continue;
+
+        bank_start = bootinfo.reserved_mem.bank[i].start;
+        bank_size = bootinfo.reserved_mem.bank[i].size;
+        bank_end = bank_start + bank_size;
+
+        if ( bank_size < size )
+            continue;
+
+        aligned_end = bank_end & ~(align - 1);
+        aligned_start = (aligned_end - size) & ~(align - 1);
+
+        if ( aligned_start > bank_start )
+            /*
+             * Allocate the xenheap as high as possible to keep low-memory
+             * available (assuming the admin supplied region below 4GB)
+             * for other use (e.g. domain memory allocation).
+             */
+            end = max(end, aligned_end);
+    }
+
+    return end;
+}
+
+void __init setup_mm(void)
+{
+    paddr_t ram_start, ram_end, ram_size, e, bank_start, bank_end, bank_size;
+    paddr_t static_heap_end = 0, static_heap_size = 0;
+    unsigned long heap_pages, xenheap_pages, domheap_pages;
+    unsigned int i;
+    const uint32_t ctr = READ_CP32(CTR);
+
+    if ( !bootinfo.mem.nr_banks )
+        panic("No memory bank\n");
+
+    /* We only supports instruction caches implementing the IVIPT extension. */
+    if ( ((ctr >> CTR_L1IP_SHIFT) & CTR_L1IP_MASK) == ICACHE_POLICY_AIVIVT )
+        panic("AIVIVT instruction cache not supported\n");
+
+    init_pdx();
+
+    ram_start = bootinfo.mem.bank[0].start;
+    ram_size  = bootinfo.mem.bank[0].size;
+    ram_end   = ram_start + ram_size;
+
+    for ( i = 1; i < bootinfo.mem.nr_banks; i++ )
+    {
+        bank_start = bootinfo.mem.bank[i].start;
+        bank_size = bootinfo.mem.bank[i].size;
+        bank_end = bank_start + bank_size;
+
+        ram_size  = ram_size + bank_size;
+        ram_start = min(ram_start,bank_start);
+        ram_end   = max(ram_end,bank_end);
+    }
+
+    total_pages = ram_size >> PAGE_SHIFT;
+
+    if ( bootinfo.static_heap )
+    {
+        for ( i = 0 ; i < bootinfo.reserved_mem.nr_banks; i++ )
+        {
+            if ( bootinfo.reserved_mem.bank[i].type != MEMBANK_STATIC_HEAP )
+                continue;
+
+            bank_start = bootinfo.reserved_mem.bank[i].start;
+            bank_size = bootinfo.reserved_mem.bank[i].size;
+            bank_end = bank_start + bank_size;
+
+            static_heap_size += bank_size;
+            static_heap_end = max(static_heap_end, bank_end);
+        }
+
+        heap_pages = static_heap_size >> PAGE_SHIFT;
+    }
+    else
+        heap_pages = total_pages;
+
+    /*
+     * If the user has not requested otherwise via the command line
+     * then locate the xenheap using these constraints:
+     *
+     *  - must be contiguous
+     *  - must be 32 MiB aligned
+     *  - must not include Xen itself or the boot modules
+     *  - must be at most 1GB or 1/32 the total RAM in the system (or static
+          heap if enabled) if less
+     *  - must be at least 32M
+     *
+     * We try to allocate the largest xenheap possible within these
+     * constraints.
+     */
+    if ( opt_xenheap_megabytes )
+        xenheap_pages = opt_xenheap_megabytes << (20-PAGE_SHIFT);
+    else
+    {
+        xenheap_pages = (heap_pages/32 + 0x1fffUL) & ~0x1fffUL;
+        xenheap_pages = max(xenheap_pages, 32UL<<(20-PAGE_SHIFT));
+        xenheap_pages = min(xenheap_pages, 1UL<<(30-PAGE_SHIFT));
+    }
+
+    do
+    {
+        e = bootinfo.static_heap ?
+            fit_xenheap_in_static_heap(pfn_to_paddr(xenheap_pages), MB(32)) :
+            consider_modules(ram_start, ram_end,
+                             pfn_to_paddr(xenheap_pages),
+                             32<<20, 0);
+        if ( e )
+            break;
+
+        xenheap_pages >>= 1;
+    } while ( !opt_xenheap_megabytes && xenheap_pages > 32<<(20-PAGE_SHIFT) );
+
+    if ( ! e )
+        panic("Not enough space for xenheap\n");
+
+    domheap_pages = heap_pages - xenheap_pages;
+
+    printk("Xen heap: %"PRIpaddr"-%"PRIpaddr" (%lu pages%s)\n",
+           e - (pfn_to_paddr(xenheap_pages)), e, xenheap_pages,
+           opt_xenheap_megabytes ? ", from command-line" : "");
+    printk("Dom heap: %lu pages\n", domheap_pages);
+
+    /*
+     * We need some memory to allocate the page-tables used for the
+     * directmap mappings. So populate the boot allocator first.
+     *
+     * This requires us to set directmap_mfn_{start, end} first so the
+     * direct-mapped Xenheap region can be avoided.
+     */
+    directmap_mfn_start = _mfn((e >> PAGE_SHIFT) - xenheap_pages);
+    directmap_mfn_end = mfn_add(directmap_mfn_start, xenheap_pages);
+
+    populate_boot_allocator();
+
+    setup_directmap_mappings(mfn_x(directmap_mfn_start), xenheap_pages);
+
+    /* Frame table covers all of RAM region, including holes */
+    setup_frametable_mappings(ram_start, ram_end);
+    max_page = PFN_DOWN(ram_end);
+
+    /*
+     * The allocators may need to use map_domain_page() (such as for
+     * scrubbing pages). So we need to prepare the domheap area first.
+     */
+    if ( !init_domheap_mappings(smp_processor_id()) )
+        panic("CPU%u: Unable to prepare the domheap page-tables\n",
+              smp_processor_id());
+
+    /* Add xenheap memory that was not already added to the boot allocator. */
+    init_xenheap_pages(mfn_to_maddr(directmap_mfn_start),
+                       mfn_to_maddr(directmap_mfn_end));
+
+    init_staticmem_pages();
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/arm/arm64/mmu/mm.c b/xen/arch/arm/arm64/mmu/mm.c
index e68edd6151..e05d54c850 100644
--- a/xen/arch/arm/arm64/mmu/mm.c
+++ b/xen/arch/arm/arm64/mmu/mm.c
@@ -2,6 +2,7 @@
 
 #include <xen/init.h>
 #include <xen/mm.h>
+#include <xen/pfn.h>
 
 #include <asm/setup.h>
 
@@ -154,8 +155,8 @@ void __init switch_ttbr(uint64_t ttbr)
 }
 
 /* Map the region in the directmap area. */
-void __init setup_directmap_mappings(unsigned long base_mfn,
-                                     unsigned long nr_mfns)
+static void __init setup_directmap_mappings(unsigned long base_mfn,
+                                            unsigned long nr_mfns)
 {
     int rc;
 
@@ -190,6 +191,52 @@ void __init setup_directmap_mappings(unsigned long base_mfn,
         panic("Unable to setup the directmap mappings.\n");
 }
 
+void __init setup_mm(void)
+{
+    const struct meminfo *banks = &bootinfo.mem;
+    paddr_t ram_start = INVALID_PADDR;
+    paddr_t ram_end = 0;
+    paddr_t ram_size = 0;
+    unsigned int i;
+
+    init_pdx();
+
+    /*
+     * We need some memory to allocate the page-tables used for the directmap
+     * mappings. But some regions may contain memory already allocated
+     * for other uses (e.g. modules, reserved-memory...).
+     *
+     * For simplicity, add all the free regions in the boot allocator.
+     */
+    populate_boot_allocator();
+
+    total_pages = 0;
+
+    for ( i = 0; i < banks->nr_banks; i++ )
+    {
+        const struct membank *bank = &banks->bank[i];
+        paddr_t bank_end = bank->start + bank->size;
+
+        ram_size = ram_size + bank->size;
+        ram_start = min(ram_start, bank->start);
+        ram_end = max(ram_end, bank_end);
+
+        setup_directmap_mappings(PFN_DOWN(bank->start),
+                                 PFN_DOWN(bank->size));
+    }
+
+    total_pages += ram_size >> PAGE_SHIFT;
+
+    directmap_virt_end = XENHEAP_VIRT_START + ram_end - ram_start;
+    directmap_mfn_start = maddr_to_mfn(ram_start);
+    directmap_mfn_end = maddr_to_mfn(ram_end);
+
+    setup_frametable_mappings(ram_start, ram_end);
+    max_page = PFN_DOWN(ram_end);
+
+    init_staticmem_pages();
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/arm/include/asm/mmu/mm.h b/xen/arch/arm/include/asm/mmu/mm.h
index 439ae314fd..c5e03a66bf 100644
--- a/xen/arch/arm/include/asm/mmu/mm.h
+++ b/xen/arch/arm/include/asm/mmu/mm.h
@@ -31,12 +31,6 @@ void dump_pt_walk(paddr_t ttbr, paddr_t addr,
 
 /* Switch to a new root page-tables */
 extern void switch_ttbr(uint64_t ttbr);
-/*
- * For Arm32, set up the direct-mapped xenheap: up to 1GB of contiguous,
- * always-mapped memory. Base must be 32MB aligned and size a multiple of 32MB.
- * For Arm64, map the region in the directmap area.
- */
-extern void setup_directmap_mappings(unsigned long base_mfn, unsigned long nr_mfns);
 
 #endif /* __ARM_MMU_MM_H__ */
 
diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index 98af6f55f5..6c71f8c31b 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -160,6 +160,11 @@ struct bootcmdline *boot_cmdline_find_by_kind(bootmodule_kind kind);
 struct bootcmdline * boot_cmdline_find_by_name(const char *name);
 const char *boot_module_kind_as_string(bootmodule_kind kind);
 
+void init_pdx(void);
+void init_staticmem_pages(void);
+void populate_boot_allocator(void);
+void setup_mm(void);
+
 extern uint32_t hyp_traps_vector[];
 void init_traps(void);
 
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 3f3a45719c..9b90185749 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -58,11 +58,6 @@ struct cpuinfo_arm __read_mostly system_cpuinfo;
 bool __read_mostly acpi_disabled;
 #endif
 
-#ifdef CONFIG_ARM_32
-static unsigned long opt_xenheap_megabytes __initdata;
-integer_param("xenheap_megabytes", opt_xenheap_megabytes);
-#endif
-
 domid_t __read_mostly max_init_domid;
 
 static __used void init_done(void)
@@ -547,138 +542,6 @@ static void * __init relocate_fdt(paddr_t dtb_paddr, size_t dtb_size)
     return fdt;
 }
 
-#ifdef CONFIG_ARM_32
-/*
- * Returns the end address of the highest region in the range s..e
- * with required size and alignment that does not conflict with the
- * modules from first_mod to nr_modules.
- *
- * For non-recursive callers first_mod should normally be 0 (all
- * modules and Xen itself) or 1 (all modules but not Xen).
- */
-static paddr_t __init consider_modules(paddr_t s, paddr_t e,
-                                       uint32_t size, paddr_t align,
-                                       int first_mod)
-{
-    const struct bootmodules *mi = &bootinfo.modules;
-    int i;
-    int nr;
-
-    s = (s+align-1) & ~(align-1);
-    e = e & ~(align-1);
-
-    if ( s > e ||  e - s < size )
-        return 0;
-
-    /* First check the boot modules */
-    for ( i = first_mod; i < mi->nr_mods; i++ )
-    {
-        paddr_t mod_s = mi->module[i].start;
-        paddr_t mod_e = mod_s + mi->module[i].size;
-
-        if ( s < mod_e && mod_s < e )
-        {
-            mod_e = consider_modules(mod_e, e, size, align, i+1);
-            if ( mod_e )
-                return mod_e;
-
-            return consider_modules(s, mod_s, size, align, i+1);
-        }
-    }
-
-    /* Now check any fdt reserved areas. */
-
-    nr = fdt_num_mem_rsv(device_tree_flattened);
-
-    for ( ; i < mi->nr_mods + nr; i++ )
-    {
-        paddr_t mod_s, mod_e;
-
-        if ( fdt_get_mem_rsv_paddr(device_tree_flattened,
-                                   i - mi->nr_mods,
-                                   &mod_s, &mod_e ) < 0 )
-            /* If we can't read it, pretend it doesn't exist... */
-            continue;
-
-        /* fdt_get_mem_rsv_paddr returns length */
-        mod_e += mod_s;
-
-        if ( s < mod_e && mod_s < e )
-        {
-            mod_e = consider_modules(mod_e, e, size, align, i+1);
-            if ( mod_e )
-                return mod_e;
-
-            return consider_modules(s, mod_s, size, align, i+1);
-        }
-    }
-
-    /*
-     * i is the current bootmodule we are evaluating, across all
-     * possible kinds of bootmodules.
-     *
-     * When retrieving the corresponding reserved-memory addresses, we
-     * need to index the bootinfo.reserved_mem bank starting from 0, and
-     * only counting the reserved-memory modules. Hence, we need to use
-     * i - nr.
-     */
-    nr += mi->nr_mods;
-    for ( ; i - nr < bootinfo.reserved_mem.nr_banks; i++ )
-    {
-        paddr_t r_s = bootinfo.reserved_mem.bank[i - nr].start;
-        paddr_t r_e = r_s + bootinfo.reserved_mem.bank[i - nr].size;
-
-        if ( s < r_e && r_s < e )
-        {
-            r_e = consider_modules(r_e, e, size, align, i + 1);
-            if ( r_e )
-                return r_e;
-
-            return consider_modules(s, r_s, size, align, i + 1);
-        }
-    }
-    return e;
-}
-
-/*
- * Find a contiguous region that fits in the static heap region with
- * required size and alignment, and return the end address of the region
- * if found otherwise 0.
- */
-static paddr_t __init fit_xenheap_in_static_heap(uint32_t size, paddr_t align)
-{
-    unsigned int i;
-    paddr_t end = 0, aligned_start, aligned_end;
-    paddr_t bank_start, bank_size, bank_end;
-
-    for ( i = 0 ; i < bootinfo.reserved_mem.nr_banks; i++ )
-    {
-        if ( bootinfo.reserved_mem.bank[i].type != MEMBANK_STATIC_HEAP )
-            continue;
-
-        bank_start = bootinfo.reserved_mem.bank[i].start;
-        bank_size = bootinfo.reserved_mem.bank[i].size;
-        bank_end = bank_start + bank_size;
-
-        if ( bank_size < size )
-            continue;
-
-        aligned_end = bank_end & ~(align - 1);
-        aligned_start = (aligned_end - size) & ~(align - 1);
-
-        if ( aligned_start > bank_start )
-            /*
-             * Allocate the xenheap as high as possible to keep low-memory
-             * available (assuming the admin supplied region below 4GB)
-             * for other use (e.g. domain memory allocation).
-             */
-            end = max(end, aligned_end);
-    }
-
-    return end;
-}
-#endif
-
 /*
  * Return the end of the non-module region starting at s. In other
  * words return s the start of the next modules after s.
@@ -713,7 +576,7 @@ static paddr_t __init next_module(paddr_t s, paddr_t *end)
     return lowest;
 }
 
-static void __init init_pdx(void)
+void __init init_pdx(void)
 {
     paddr_t bank_start, bank_size, bank_end;
 
@@ -758,7 +621,7 @@ static void __init init_pdx(void)
 }
 
 /* Static memory initialization */
-static void __init init_staticmem_pages(void)
+void __init init_staticmem_pages(void)
 {
 #ifdef CONFIG_STATIC_MEMORY
     unsigned int bank;
@@ -792,7 +655,7 @@ static void __init init_staticmem_pages(void)
  * allocator with the corresponding regions only, but with Xenheap excluded
  * on arm32.
  */
-static void __init populate_boot_allocator(void)
+void __init populate_boot_allocator(void)
 {
     unsigned int i;
     const struct meminfo *banks = &bootinfo.mem;
@@ -861,187 +724,6 @@ static void __init populate_boot_allocator(void)
     }
 }
 
-#ifdef CONFIG_ARM_32
-static void __init setup_mm(void)
-{
-    paddr_t ram_start, ram_end, ram_size, e, bank_start, bank_end, bank_size;
-    paddr_t static_heap_end = 0, static_heap_size = 0;
-    unsigned long heap_pages, xenheap_pages, domheap_pages;
-    unsigned int i;
-    const uint32_t ctr = READ_CP32(CTR);
-
-    if ( !bootinfo.mem.nr_banks )
-        panic("No memory bank\n");
-
-    /* We only supports instruction caches implementing the IVIPT extension. */
-    if ( ((ctr >> CTR_L1IP_SHIFT) & CTR_L1IP_MASK) == ICACHE_POLICY_AIVIVT )
-        panic("AIVIVT instruction cache not supported\n");
-
-    init_pdx();
-
-    ram_start = bootinfo.mem.bank[0].start;
-    ram_size  = bootinfo.mem.bank[0].size;
-    ram_end   = ram_start + ram_size;
-
-    for ( i = 1; i < bootinfo.mem.nr_banks; i++ )
-    {
-        bank_start = bootinfo.mem.bank[i].start;
-        bank_size = bootinfo.mem.bank[i].size;
-        bank_end = bank_start + bank_size;
-
-        ram_size  = ram_size + bank_size;
-        ram_start = min(ram_start,bank_start);
-        ram_end   = max(ram_end,bank_end);
-    }
-
-    total_pages = ram_size >> PAGE_SHIFT;
-
-    if ( bootinfo.static_heap )
-    {
-        for ( i = 0 ; i < bootinfo.reserved_mem.nr_banks; i++ )
-        {
-            if ( bootinfo.reserved_mem.bank[i].type != MEMBANK_STATIC_HEAP )
-                continue;
-
-            bank_start = bootinfo.reserved_mem.bank[i].start;
-            bank_size = bootinfo.reserved_mem.bank[i].size;
-            bank_end = bank_start + bank_size;
-
-            static_heap_size += bank_size;
-            static_heap_end = max(static_heap_end, bank_end);
-        }
-
-        heap_pages = static_heap_size >> PAGE_SHIFT;
-    }
-    else
-        heap_pages = total_pages;
-
-    /*
-     * If the user has not requested otherwise via the command line
-     * then locate the xenheap using these constraints:
-     *
-     *  - must be contiguous
-     *  - must be 32 MiB aligned
-     *  - must not include Xen itself or the boot modules
-     *  - must be at most 1GB or 1/32 the total RAM in the system (or static
-          heap if enabled) if less
-     *  - must be at least 32M
-     *
-     * We try to allocate the largest xenheap possible within these
-     * constraints.
-     */
-    if ( opt_xenheap_megabytes )
-        xenheap_pages = opt_xenheap_megabytes << (20-PAGE_SHIFT);
-    else
-    {
-        xenheap_pages = (heap_pages/32 + 0x1fffUL) & ~0x1fffUL;
-        xenheap_pages = max(xenheap_pages, 32UL<<(20-PAGE_SHIFT));
-        xenheap_pages = min(xenheap_pages, 1UL<<(30-PAGE_SHIFT));
-    }
-
-    do
-    {
-        e = bootinfo.static_heap ?
-            fit_xenheap_in_static_heap(pfn_to_paddr(xenheap_pages), MB(32)) :
-            consider_modules(ram_start, ram_end,
-                             pfn_to_paddr(xenheap_pages),
-                             32<<20, 0);
-        if ( e )
-            break;
-
-        xenheap_pages >>= 1;
-    } while ( !opt_xenheap_megabytes && xenheap_pages > 32<<(20-PAGE_SHIFT) );
-
-    if ( ! e )
-        panic("Not enough space for xenheap\n");
-
-    domheap_pages = heap_pages - xenheap_pages;
-
-    printk("Xen heap: %"PRIpaddr"-%"PRIpaddr" (%lu pages%s)\n",
-           e - (pfn_to_paddr(xenheap_pages)), e, xenheap_pages,
-           opt_xenheap_megabytes ? ", from command-line" : "");
-    printk("Dom heap: %lu pages\n", domheap_pages);
-
-    /*
-     * We need some memory to allocate the page-tables used for the
-     * directmap mappings. So populate the boot allocator first.
-     *
-     * This requires us to set directmap_mfn_{start, end} first so the
-     * direct-mapped Xenheap region can be avoided.
-     */
-    directmap_mfn_start = _mfn((e >> PAGE_SHIFT) - xenheap_pages);
-    directmap_mfn_end = mfn_add(directmap_mfn_start, xenheap_pages);
-
-    populate_boot_allocator();
-
-    setup_directmap_mappings(mfn_x(directmap_mfn_start), xenheap_pages);
-
-    /* Frame table covers all of RAM region, including holes */
-    setup_frametable_mappings(ram_start, ram_end);
-    max_page = PFN_DOWN(ram_end);
-
-    /*
-     * The allocators may need to use map_domain_page() (such as for
-     * scrubbing pages). So we need to prepare the domheap area first.
-     */
-    if ( !init_domheap_mappings(smp_processor_id()) )
-        panic("CPU%u: Unable to prepare the domheap page-tables\n",
-              smp_processor_id());
-
-    /* Add xenheap memory that was not already added to the boot allocator. */
-    init_xenheap_pages(mfn_to_maddr(directmap_mfn_start),
-                       mfn_to_maddr(directmap_mfn_end));
-
-    init_staticmem_pages();
-}
-#else /* CONFIG_ARM_64 */
-static void __init setup_mm(void)
-{
-    const struct meminfo *banks = &bootinfo.mem;
-    paddr_t ram_start = INVALID_PADDR;
-    paddr_t ram_end = 0;
-    paddr_t ram_size = 0;
-    unsigned int i;
-
-    init_pdx();
-
-    /*
-     * We need some memory to allocate the page-tables used for the directmap
-     * mappings. But some regions may contain memory already allocated
-     * for other uses (e.g. modules, reserved-memory...).
-     *
-     * For simplicity, add all the free regions in the boot allocator.
-     */
-    populate_boot_allocator();
-
-    total_pages = 0;
-
-    for ( i = 0; i < banks->nr_banks; i++ )
-    {
-        const struct membank *bank = &banks->bank[i];
-        paddr_t bank_end = bank->start + bank->size;
-
-        ram_size = ram_size + bank->size;
-        ram_start = min(ram_start, bank->start);
-        ram_end = max(ram_end, bank_end);
-
-        setup_directmap_mappings(PFN_DOWN(bank->start),
-                                 PFN_DOWN(bank->size));
-    }
-
-    total_pages += ram_size >> PAGE_SHIFT;
-
-    directmap_virt_end = XENHEAP_VIRT_START + ram_end - ram_start;
-    directmap_mfn_start = maddr_to_mfn(ram_start);
-    directmap_mfn_end = maddr_to_mfn(ram_end);
-
-    setup_frametable_mappings(ram_start, ram_end);
-    max_page = PFN_DOWN(ram_end);
-
-    init_staticmem_pages();
-}
-#endif
-
 static bool __init is_dom0less_mode(void)
 {
     struct bootmodules *mods = &bootinfo.modules;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 21:33:53 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 21:33:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.638280.994673 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5YNV-0005YV-LM; Tue, 21 Nov 2023 21:33:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 638280.994673; Tue, 21 Nov 2023 21:33: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 1r5YNV-0005YO-I1; Tue, 21 Nov 2023 21:33:53 +0000
Received: by outflank-mailman (input) for mailman id 638280;
 Tue, 21 Nov 2023 21:33: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 1r5YNU-0005YG-RH
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:33: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 1r5YNU-0003ZN-QO
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5YNU-0005pI-PY
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:33:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bNnskKr7Bqtm50JXPs+nQICB2bmO5jeIrt1JUoHSmZw=; b=3ubrTy+th56dqGYJb+50M6obS4
	JVzQhsKRS/IHk8mWEOcJ0/bjpI7J6+dJh8jRd7EscUxbXsTiek+6D+zNEBeEQWVPiawzWNqqE45oM
	ILpTpIlYAV7/yH3ypeq98wr2uev5elJUQ3Rq5lv+WBZP1F8azMe85Jq6nQyOs92GbVKk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Fold pmap and fixmap into MMU system
Message-Id: <E1r5YNU-0005pI-PY@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 21:33:52 +0000

commit e6bef277d4de3806764974f29f476acb8175ea4a
Author:     Henry Wang <Henry.Wang@arm.com>
AuthorDate: Thu Nov 16 22:50:30 2023 +0800
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Nov 20 19:07:45 2023 +0000

    xen/arm: Fold pmap and fixmap into MMU system
    
    fixmap and pmap are MMU-specific features, so fold them to the
    MMU system. Do the folding for pmap by moving the HAS_PMAP Kconfig
    selection under MMU. Since none of the definitions in asm/fixmap.h
    actually makes sense for the MPU, so do the folding for fixmap by
    limiting the inclusion of asm/fixmap.h for MPU code when necessary.
    To guarantee that, moving the implementation of copy_from_paddr()
    from kernel.c to mmu/setup.c, so that inclusion of asm/fixmap.h in
    the kernel.c can be dropped.
    
    Take the opportunity to add a missing space before and after '-' in
    "s = paddr & (PAGE_SIZE-1);" of copy_from_paddr().
    
    Signed-off-by: Henry Wang <Henry.Wang@arm.com>
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Signed-off-by: Wei Chen <wei.chen@arm.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/Kconfig     |  2 +-
 xen/arch/arm/kernel.c    | 28 ----------------------------
 xen/arch/arm/mmu/setup.c | 27 +++++++++++++++++++++++++++
 3 files changed, 28 insertions(+), 29 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 2939db429b..7b5b0c0c05 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -14,7 +14,6 @@ config ARM
 	select HAS_ALTERNATIVE
 	select HAS_DEVICE_TREE
 	select HAS_PASSTHROUGH
-	select HAS_PMAP
 	select HAS_UBSAN
 	select IOMMU_FORCE_PT_SHARE
 
@@ -60,6 +59,7 @@ config PADDR_BITS
 
 config MMU
 	def_bool y
+	select HAS_PMAP
 
 source "arch/Kconfig"
 
diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 508c54824d..bc3e5bd6f9 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -16,7 +16,6 @@
 #include <xen/vmap.h>
 
 #include <asm/byteorder.h>
-#include <asm/fixmap.h>
 #include <asm/kernel.h>
 #include <asm/setup.h>
 
@@ -41,33 +40,6 @@ struct minimal_dtb_header {
 
 #define DTB_MAGIC 0xd00dfeedU
 
-/**
- * copy_from_paddr - copy data from a physical address
- * @dst: destination virtual address
- * @paddr: source physical address
- * @len: length to copy
- */
-void __init copy_from_paddr(void *dst, paddr_t paddr, unsigned long len)
-{
-    void *src = (void *)FIXMAP_ADDR(FIXMAP_MISC);
-
-    while (len) {
-        unsigned long l, s;
-
-        s = paddr & (PAGE_SIZE-1);
-        l = min(PAGE_SIZE - s, len);
-
-        set_fixmap(FIXMAP_MISC, maddr_to_mfn(paddr), PAGE_HYPERVISOR_WC);
-        memcpy(dst, src + s, l);
-        clean_dcache_va_range(dst, l);
-        clear_fixmap(FIXMAP_MISC);
-
-        paddr += l;
-        dst += l;
-        len -= l;
-    }
-}
-
 static void __init place_modules(struct kernel_info *info,
                                  paddr_t kernbase, paddr_t kernend)
 {
diff --git a/xen/arch/arm/mmu/setup.c b/xen/arch/arm/mmu/setup.c
index c2df976ab2..a5a9b538ff 100644
--- a/xen/arch/arm/mmu/setup.c
+++ b/xen/arch/arm/mmu/setup.c
@@ -339,6 +339,33 @@ void free_init_memory(void)
     printk("Freed %ldkB init memory.\n", (long)(__init_end-__init_begin)>>10);
 }
 
+/**
+ * copy_from_paddr - copy data from a physical address
+ * @dst: destination virtual address
+ * @paddr: source physical address
+ * @len: length to copy
+ */
+void __init copy_from_paddr(void *dst, paddr_t paddr, unsigned long len)
+{
+    void *src = (void *)FIXMAP_ADDR(FIXMAP_MISC);
+
+    while (len) {
+        unsigned long l, s;
+
+        s = paddr & (PAGE_SIZE - 1);
+        l = min(PAGE_SIZE - s, len);
+
+        set_fixmap(FIXMAP_MISC, maddr_to_mfn(paddr), PAGE_HYPERVISOR_WC);
+        memcpy(dst, src + s, l);
+        clean_dcache_va_range(dst, l);
+        clear_fixmap(FIXMAP_MISC);
+
+        paddr += l;
+        dst += l;
+        len -= l;
+    }
+}
+
 /*
  * Local variables:
  * mode: C
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 21:34:03 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 21:34:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.638281.994677 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5YNf-0005cE-OE; Tue, 21 Nov 2023 21:34:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 638281.994677; Tue, 21 Nov 2023 21:34: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 1r5YNf-0005c6-LW; Tue, 21 Nov 2023 21:34:03 +0000
Received: by outflank-mailman (input) for mailman id 638281;
 Tue, 21 Nov 2023 21:34: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 1r5YNe-0005bo-UO
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:34: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 1r5YNe-0003Zh-TT
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:34:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5YNe-0005qH-Sd
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:34:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fc9Hu5z+Pcodh2zhMTXqH3x+ni7mCX+v55b9xgBgVG0=; b=gpqIeVU7vQXQE1K0Vevh3EsDlH
	TIrk/QuafpRfPhG9kBmj/KFPYyPzoKAX5cElFlnIDdNTZ9oTjHTTKIsbUL3XQWkkvsZmhjc3GDu4C
	X9+s39CNi6tG0DE3MfTykfegcabQDDN6biobPU79iz/8rlM/10tGrAXX8MMLGokgvxsg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Rename init_secondary_pagetables() to prepare_secondary_mm()
Message-Id: <E1r5YNe-0005qH-Sd@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 21:34:02 +0000

commit 1bf5c104feded4240eb7972806be2854c525681f
Author:     Penny Zheng <penny.zheng@arm.com>
AuthorDate: Thu Nov 16 22:50:31 2023 +0800
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Nov 20 19:07:45 2023 +0000

    xen/arm: Rename init_secondary_pagetables() to prepare_secondary_mm()
    
    init_secondary_pagetables() is a function in the common code path
    of both MMU and future MPU support. Since "page table" is a MMU
    specific concept, rename init_secondary_pagetables() to a generic
    name prepare_secondary_mm() as the preparation for MPU support.
    
    Reword the in-code comment on top of prepare_secondary_mm() because
    this function is now supposed to be MMU/MPU agnostic.
    
    Take the opportunity to fix the incorrect coding style of the in-code
    comments.
    
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Signed-off-by: Henry Wang <Henry.Wang@arm.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/arm32/head.S     | 2 +-
 xen/arch/arm/include/asm/mm.h | 5 ++---
 xen/arch/arm/mmu/smpboot.c    | 4 ++--
 xen/arch/arm/smpboot.c        | 2 +-
 4 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index 2c235fb34c..3011fb34aa 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -257,7 +257,7 @@ GLOBAL(init_secondary)
 secondary_switched:
         /*
          * Non-boot CPUs need to move on to the proper pagetables, which were
-         * setup in init_secondary_pagetables.
+         * setup in prepare_secondary_mm.
          *
          * XXX: This is not compliant with the Arm Arm.
          */
diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index d23ebc7df6..cbcf3bf147 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -204,9 +204,8 @@ extern void setup_pagetables(unsigned long boot_phys_offset);
 extern void *early_fdt_map(paddr_t fdt_paddr);
 /* Remove early mappings */
 extern void remove_early_mappings(void);
-/* Allocate and initialise pagetables for a secondary CPU. Sets init_ttbr to the
- * new page table */
-extern int init_secondary_pagetables(int cpu);
+/* Prepare the memory subystem to bring-up the given secondary CPU */
+extern int prepare_secondary_mm(int cpu);
 /* Map a frame table to cover physical addresses ps through pe */
 extern void setup_frametable_mappings(paddr_t ps, paddr_t pe);
 /* map a physical range in virtual memory */
diff --git a/xen/arch/arm/mmu/smpboot.c b/xen/arch/arm/mmu/smpboot.c
index 8b6a09f843..12f1a5d761 100644
--- a/xen/arch/arm/mmu/smpboot.c
+++ b/xen/arch/arm/mmu/smpboot.c
@@ -67,7 +67,7 @@ static void clear_boot_pagetables(void)
 }
 
 #ifdef CONFIG_ARM_64
-int init_secondary_pagetables(int cpu)
+int prepare_secondary_mm(int cpu)
 {
     clear_boot_pagetables();
 
@@ -80,7 +80,7 @@ int init_secondary_pagetables(int cpu)
     return 0;
 }
 #else
-int init_secondary_pagetables(int cpu)
+int prepare_secondary_mm(int cpu)
 {
     lpae_t *first;
 
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 1cf6e50a85..36db6b8880 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -448,7 +448,7 @@ int __cpu_up(unsigned int cpu)
 
     printk("Bringing up CPU%d\n", cpu);
 
-    rc = init_secondary_pagetables(cpu);
+    rc = prepare_secondary_mm(cpu);
     if ( rc < 0 )
         return rc;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 21:34:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 21:34:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.638282.994683 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5YNq-0005ek-RA; Tue, 21 Nov 2023 21:34:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 638282.994683; Tue, 21 Nov 2023 21: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 1r5YNq-0005ed-NC; Tue, 21 Nov 2023 21:34:14 +0000
Received: by outflank-mailman (input) for mailman id 638282;
 Tue, 21 Nov 2023 21: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 1r5YNp-0005eT-1s
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21: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 1r5YNp-0003a6-0c
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:34:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5YNo-0005r5-Vm
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:34:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dxfPcozVxjgaHuOWE5kgmZwIx2G87ytSNpHuU92qNXo=; b=JdNy+kpbWtvyHhIUK6ReQ+r5nN
	SQl9ZAWD9/uwE++/hDd07H4gkBn8whFxYdt0nCuJUyJWqx4mC0A+tXTkMV+RCwIRucp4MWFVhX8lT
	emRrM8+uKwKix0n9QcZAiVpHwvg/E4gsdAWqxv9OMMb8NGAAbqS3cfbV0lYB6KXF8hec=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: mmu: move MMU specific P2M code to mmu/p2m.{c,h}
Message-Id: <E1r5YNo-0005r5-Vm@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 21:34:12 +0000

commit ee0f41fda315e33118f956161894efa20abc300b
Author:     Penny Zheng <penny.zheng@arm.com>
AuthorDate: Thu Nov 16 22:50:32 2023 +0800
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Nov 20 19:07:45 2023 +0000

    xen/arm: mmu: move MMU specific P2M code to mmu/p2m.{c,h}
    
    Current P2M implementation is designed for MMU system only.
    We move the MMU-specific codes into mmu/p2m.c, and only keep generic
    codes in p2m.c, like VMID allocator, etc. We also move MMU-specific
    definitions and declarations to mmu/p2m.h, such as p2m_tlb_flush_sync().
    Also expose previously static functions p2m_vmid_allocator_init(),
    p2m_alloc_vmid() for further MPU usage. Since with the code movement
    p2m_free_vmid() is now used in two files, also expose p2m_free_vmid().
    
    With the code movement, global variable max_vmid is used in multiple
    files instead of a single file (and will be used in MPU P2M
    implementation), declare it in the header and remove the "static" of
    this variable.
    
    Also, since p2m_invalidate_root() should be MMU only and after the
    code movement the only caller of p2m_invalidate_root() outside of
    mmu/p2m.c is arch_domain_creation_finished(), creating a new function
    named p2m_domain_creation_finished() in mmu/p2m.c for the original
    code in arch_domain_creation_finished(), and marking
    p2m_invalidate_root() as static.
    
    Take the opportunity to fix the incorrect coding style when possible.
    When there is bit shift in macros, take the opportunity to add the
    missing 'U' as a compliance of MISRA.
    
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Signed-off-by: Wei Chen <wei.chen@arm.com>
    Signed-off-by: Henry Wang <Henry.Wang@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/domain.c              |   11 +-
 xen/arch/arm/include/asm/mmu/p2m.h |   26 +
 xen/arch/arm/include/asm/p2m.h     |   32 +-
 xen/arch/arm/mmu/Makefile          |    1 +
 xen/arch/arm/mmu/p2m.c             | 1834 ++++++++++++++++++++++++++++++++++
 xen/arch/arm/p2m.c                 | 1909 +-----------------------------------
 6 files changed, 1933 insertions(+), 1880 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 28e3aaa5e4..5e7a7f3e7e 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -870,16 +870,7 @@ int arch_domain_soft_reset(struct domain *d)
 
 void arch_domain_creation_finished(struct domain *d)
 {
-    /*
-     * To avoid flushing the whole guest RAM on the first Set/Way, we
-     * invalidate the P2M to track what has been accessed.
-     *
-     * This is only turned when IOMMU is not used or the page-table are
-     * not shared because bit[0] (e.g valid bit) unset will result
-     * IOMMU fault that could be not fixed-up.
-     */
-    if ( !iommu_use_hap_pt(d) )
-        p2m_invalidate_root(p2m_get_hostp2m(d));
+    p2m_domain_creation_finished(d);
 }
 
 static int is_guest_pv32_psr(uint32_t psr)
diff --git a/xen/arch/arm/include/asm/mmu/p2m.h b/xen/arch/arm/include/asm/mmu/p2m.h
new file mode 100644
index 0000000000..58496c0b09
--- /dev/null
+++ b/xen/arch/arm/include/asm/mmu/p2m.h
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef __ARM_MMU_P2M_H__
+#define __ARM_MMU_P2M_H__
+
+extern unsigned int p2m_root_order;
+extern unsigned int p2m_root_level;
+#define P2M_ROOT_ORDER p2m_root_order
+#define P2M_ROOT_LEVEL p2m_root_level
+#define P2M_ROOT_PAGES    (1U << P2M_ROOT_ORDER)
+
+struct p2m_domain;
+void p2m_force_tlb_flush_sync(struct p2m_domain *p2m);
+void p2m_tlb_flush_sync(struct p2m_domain *p2m);
+
+void p2m_clear_root_pages(struct p2m_domain *p2m);
+
+#endif /* __ARM_MMU_P2M_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/include/asm/p2m.h b/xen/arch/arm/include/asm/p2m.h
index 9ad312bfb5..4818dd4b6a 100644
--- a/xen/arch/arm/include/asm/p2m.h
+++ b/xen/arch/arm/include/asm/p2m.h
@@ -14,10 +14,19 @@
 /* Holds the bit size of IPAs in p2m tables.  */
 extern unsigned int p2m_ipa_bits;
 
-extern unsigned int p2m_root_order;
-extern unsigned int p2m_root_level;
-#define P2M_ROOT_ORDER    p2m_root_order
-#define P2M_ROOT_LEVEL p2m_root_level
+#define MAX_VMID_8_BIT  (1UL << 8)
+#define MAX_VMID_16_BIT (1UL << 16)
+
+#define INVALID_VMID 0 /* VMID 0 is reserved */
+
+#ifdef CONFIG_ARM_64
+extern unsigned int max_vmid;
+/* VMID is by default 8 bit width on AArch64 */
+#define MAX_VMID       max_vmid
+#else
+/* VMID is always 8 bit width on AArch32 */
+#define MAX_VMID        MAX_VMID_8_BIT
+#endif
 
 struct domain;
 
@@ -156,6 +165,12 @@ typedef enum {
 #endif
 #include <xen/p2m-common.h>
 
+#if defined(CONFIG_MMU)
+# include <asm/mmu/p2m.h>
+#else
+# error "Unknown memory management layout"
+#endif
+
 static inline bool arch_acquire_resource_check(struct domain *d)
 {
     /*
@@ -180,6 +195,10 @@ void p2m_altp2m_check(struct vcpu *v, uint16_t idx)
  */
 void p2m_restrict_ipa_bits(unsigned int ipa_bits);
 
+void p2m_vmid_allocator_init(void);
+int p2m_alloc_vmid(struct domain *d);
+void p2m_free_vmid(struct domain *d);
+
 /* Second stage paging setup, to be called on all CPUs */
 void setup_virt_paging(void);
 
@@ -242,8 +261,6 @@ static inline int p2m_is_write_locked(struct p2m_domain *p2m)
     return rw_is_write_locked(&p2m->lock);
 }
 
-void p2m_tlb_flush_sync(struct p2m_domain *p2m);
-
 /* Look up the MFN corresponding to a domain's GFN. */
 mfn_t p2m_lookup(struct domain *d, gfn_t gfn, p2m_type_t *t);
 
@@ -271,8 +288,7 @@ int p2m_set_entry(struct p2m_domain *p2m,
 
 bool p2m_resolve_translation_fault(struct domain *d, gfn_t gfn);
 
-void p2m_clear_root_pages(struct p2m_domain *p2m);
-void p2m_invalidate_root(struct p2m_domain *p2m);
+void p2m_domain_creation_finished(struct domain *d);
 
 /*
  * Clean & invalidate caches corresponding to a region [start,end) of guest
diff --git a/xen/arch/arm/mmu/Makefile b/xen/arch/arm/mmu/Makefile
index 98aea965df..67475fcd80 100644
--- a/xen/arch/arm/mmu/Makefile
+++ b/xen/arch/arm/mmu/Makefile
@@ -1,3 +1,4 @@
+obj-y += p2m.o
 obj-y += pt.o
 obj-y += setup.o
 obj-y += smpboot.o
diff --git a/xen/arch/arm/mmu/p2m.c b/xen/arch/arm/mmu/p2m.c
new file mode 100644
index 0000000000..6a5a080307
--- /dev/null
+++ b/xen/arch/arm/mmu/p2m.c
@@ -0,0 +1,1834 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#include <xen/cpu.h>
+#include <xen/domain_page.h>
+#include <xen/ioreq.h>
+#include <xen/lib.h>
+#include <xen/sched.h>
+#include <xen/softirq.h>
+
+#include <asm/alternative.h>
+#include <asm/event.h>
+#include <asm/flushtlb.h>
+#include <asm/page.h>
+
+unsigned int __read_mostly p2m_root_order;
+unsigned int __read_mostly p2m_root_level;
+
+static mfn_t __read_mostly empty_root_mfn;
+
+static uint64_t generate_vttbr(uint16_t vmid, mfn_t root_mfn)
+{
+    return (mfn_to_maddr(root_mfn) | ((uint64_t)vmid << 48));
+}
+
+static struct page_info *p2m_alloc_page(struct domain *d)
+{
+    struct page_info *pg;
+
+    /*
+     * For hardware domain, there should be no limit in the number of pages that
+     * can be allocated, so that the kernel may take advantage of the extended
+     * regions. Hence, allocate p2m pages for hardware domains from heap.
+     */
+    if ( is_hardware_domain(d) )
+    {
+        pg = alloc_domheap_page(NULL, 0);
+        if ( pg == NULL )
+            printk(XENLOG_G_ERR "Failed to allocate P2M pages for hwdom.\n");
+    }
+    else
+    {
+        spin_lock(&d->arch.paging.lock);
+        pg = page_list_remove_head(&d->arch.paging.p2m_freelist);
+        spin_unlock(&d->arch.paging.lock);
+    }
+
+    return pg;
+}
+
+static void p2m_free_page(struct domain *d, struct page_info *pg)
+{
+    if ( is_hardware_domain(d) )
+        free_domheap_page(pg);
+    else
+    {
+        spin_lock(&d->arch.paging.lock);
+        page_list_add_tail(pg, &d->arch.paging.p2m_freelist);
+        spin_unlock(&d->arch.paging.lock);
+    }
+}
+
+/* Return the size of the pool, in bytes. */
+int arch_get_paging_mempool_size(struct domain *d, uint64_t *size)
+{
+    *size = (uint64_t)ACCESS_ONCE(d->arch.paging.p2m_total_pages) << PAGE_SHIFT;
+    return 0;
+}
+
+/*
+ * Set the pool of pages to the required number of pages.
+ * Returns 0 for success, non-zero for failure.
+ * Call with d->arch.paging.lock held.
+ */
+int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted)
+{
+    struct page_info *pg;
+
+    ASSERT(spin_is_locked(&d->arch.paging.lock));
+
+    for ( ; ; )
+    {
+        if ( d->arch.paging.p2m_total_pages < pages )
+        {
+            /* Need to allocate more memory from domheap */
+            pg = alloc_domheap_page(NULL, 0);
+            if ( pg == NULL )
+            {
+                printk(XENLOG_ERR "Failed to allocate P2M pages.\n");
+                return -ENOMEM;
+            }
+            ACCESS_ONCE(d->arch.paging.p2m_total_pages) =
+                d->arch.paging.p2m_total_pages + 1;
+            page_list_add_tail(pg, &d->arch.paging.p2m_freelist);
+        }
+        else if ( d->arch.paging.p2m_total_pages > pages )
+        {
+            /* Need to return memory to domheap */
+            pg = page_list_remove_head(&d->arch.paging.p2m_freelist);
+            if( pg )
+            {
+                ACCESS_ONCE(d->arch.paging.p2m_total_pages) =
+                    d->arch.paging.p2m_total_pages - 1;
+                free_domheap_page(pg);
+            }
+            else
+            {
+                printk(XENLOG_ERR
+                       "Failed to free P2M pages, P2M freelist is empty.\n");
+                return -ENOMEM;
+            }
+        }
+        else
+            break;
+
+        /* Check to see if we need to yield and try again */
+        if ( preempted && general_preempt_check() )
+        {
+            *preempted = true;
+            return -ERESTART;
+        }
+    }
+
+    return 0;
+}
+
+int arch_set_paging_mempool_size(struct domain *d, uint64_t size)
+{
+    unsigned long pages = size >> PAGE_SHIFT;
+    bool preempted = false;
+    int rc;
+
+    if ( (size & ~PAGE_MASK) ||          /* Non page-sized request? */
+         pages != (size >> PAGE_SHIFT) ) /* 32-bit overflow? */
+        return -EINVAL;
+
+    spin_lock(&d->arch.paging.lock);
+    rc = p2m_set_allocation(d, pages, &preempted);
+    spin_unlock(&d->arch.paging.lock);
+
+    ASSERT(preempted == (rc == -ERESTART));
+
+    return rc;
+}
+
+int p2m_teardown_allocation(struct domain *d)
+{
+    int ret = 0;
+    bool preempted = false;
+
+    spin_lock(&d->arch.paging.lock);
+    if ( d->arch.paging.p2m_total_pages != 0 )
+    {
+        ret = p2m_set_allocation(d, 0, &preempted);
+        if ( preempted )
+        {
+            spin_unlock(&d->arch.paging.lock);
+            return -ERESTART;
+        }
+        ASSERT(d->arch.paging.p2m_total_pages == 0);
+    }
+    spin_unlock(&d->arch.paging.lock);
+
+    return ret;
+}
+
+void p2m_dump_info(struct domain *d)
+{
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+
+    p2m_read_lock(p2m);
+    printk("p2m mappings for domain %d (vmid %d):\n",
+           d->domain_id, p2m->vmid);
+    BUG_ON(p2m->stats.mappings[0] || p2m->stats.shattered[0]);
+    printk("  1G mappings: %ld (shattered %ld)\n",
+           p2m->stats.mappings[1], p2m->stats.shattered[1]);
+    printk("  2M mappings: %ld (shattered %ld)\n",
+           p2m->stats.mappings[2], p2m->stats.shattered[2]);
+    printk("  4K mappings: %ld\n", p2m->stats.mappings[3]);
+    p2m_read_unlock(p2m);
+}
+
+void dump_p2m_lookup(struct domain *d, paddr_t addr)
+{
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+
+    printk("dom%d IPA 0x%"PRIpaddr"\n", d->domain_id, addr);
+
+    printk("P2M @ %p mfn:%#"PRI_mfn"\n",
+           p2m->root, mfn_x(page_to_mfn(p2m->root)));
+
+    dump_pt_walk(page_to_maddr(p2m->root), addr,
+                 P2M_ROOT_LEVEL, P2M_ROOT_PAGES);
+}
+
+/*
+ * p2m_save_state and p2m_restore_state work in pair to workaround
+ * ARM64_WORKAROUND_AT_SPECULATE. p2m_save_state will set-up VTTBR to
+ * point to the empty page-tables to stop allocating TLB entries.
+ */
+void p2m_save_state(struct vcpu *p)
+{
+    p->arch.sctlr = READ_SYSREG(SCTLR_EL1);
+
+    if ( cpus_have_const_cap(ARM64_WORKAROUND_AT_SPECULATE) )
+    {
+        WRITE_SYSREG64(generate_vttbr(INVALID_VMID, empty_root_mfn), VTTBR_EL2);
+        /*
+         * Ensure VTTBR_EL2 is correctly synchronized so we can restore
+         * the next vCPU context without worrying about AT instruction
+         * speculation.
+         */
+        isb();
+    }
+}
+
+void p2m_restore_state(struct vcpu *n)
+{
+    struct p2m_domain *p2m = p2m_get_hostp2m(n->domain);
+    uint8_t *last_vcpu_ran;
+
+    if ( is_idle_vcpu(n) )
+        return;
+
+    WRITE_SYSREG(n->arch.sctlr, SCTLR_EL1);
+    WRITE_SYSREG(n->arch.hcr_el2, HCR_EL2);
+
+    /*
+     * ARM64_WORKAROUND_AT_SPECULATE: VTTBR_EL2 should be restored after all
+     * registers associated to EL1/EL0 translations regime have been
+     * synchronized.
+     */
+    asm volatile(ALTERNATIVE("nop", "isb", ARM64_WORKAROUND_AT_SPECULATE));
+    WRITE_SYSREG64(p2m->vttbr, VTTBR_EL2);
+
+    last_vcpu_ran = &p2m->last_vcpu_ran[smp_processor_id()];
+
+    /*
+     * While we are restoring an out-of-context translation regime
+     * we still need to ensure:
+     *  - VTTBR_EL2 is synchronized before flushing the TLBs
+     *  - All registers for EL1 are synchronized before executing an AT
+     *  instructions targeting S1/S2.
+     */
+    isb();
+
+    /*
+     * Flush local TLB for the domain to prevent wrong TLB translation
+     * when running multiple vCPU of the same domain on a single pCPU.
+     */
+    if ( *last_vcpu_ran != INVALID_VCPU_ID && *last_vcpu_ran != n->vcpu_id )
+        flush_guest_tlb_local();
+
+    *last_vcpu_ran = n->vcpu_id;
+}
+
+/*
+ * Force a synchronous P2M TLB flush.
+ *
+ * Must be called with the p2m lock held.
+ */
+void p2m_force_tlb_flush_sync(struct p2m_domain *p2m)
+{
+    unsigned long flags = 0;
+    uint64_t ovttbr;
+
+    ASSERT(p2m_is_write_locked(p2m));
+
+    /*
+     * ARM only provides an instruction to flush TLBs for the current
+     * VMID. So switch to the VTTBR of a given P2M if different.
+     */
+    ovttbr = READ_SYSREG64(VTTBR_EL2);
+    if ( ovttbr != p2m->vttbr )
+    {
+        uint64_t vttbr;
+
+        local_irq_save(flags);
+
+        /*
+         * ARM64_WORKAROUND_AT_SPECULATE: We need to stop AT to allocate
+         * TLBs entries because the context is partially modified. We
+         * only need the VMID for flushing the TLBs, so we can generate
+         * a new VTTBR with the VMID to flush and the empty root table.
+         */
+        if ( !cpus_have_const_cap(ARM64_WORKAROUND_AT_SPECULATE) )
+            vttbr = p2m->vttbr;
+        else
+            vttbr = generate_vttbr(p2m->vmid, empty_root_mfn);
+
+        WRITE_SYSREG64(vttbr, VTTBR_EL2);
+
+        /* Ensure VTTBR_EL2 is synchronized before flushing the TLBs */
+        isb();
+    }
+
+    flush_guest_tlb();
+
+    if ( ovttbr != READ_SYSREG64(VTTBR_EL2) )
+    {
+        WRITE_SYSREG64(ovttbr, VTTBR_EL2);
+        /* Ensure VTTBR_EL2 is back in place before continuing. */
+        isb();
+        local_irq_restore(flags);
+    }
+
+    p2m->need_flush = false;
+}
+
+void p2m_tlb_flush_sync(struct p2m_domain *p2m)
+{
+    if ( p2m->need_flush )
+        p2m_force_tlb_flush_sync(p2m);
+}
+
+/*
+ * Find and map the root page table. The caller is responsible for
+ * unmapping the table.
+ *
+ * The function will return NULL if the offset of the root table is
+ * invalid.
+ */
+static lpae_t *p2m_get_root_pointer(struct p2m_domain *p2m,
+                                    gfn_t gfn)
+{
+    unsigned long root_table;
+
+    /*
+     * While the root table index is the offset from the previous level,
+     * we can't use (P2M_ROOT_LEVEL - 1) because the root level might be
+     * 0. Yet we still want to check if all the unused bits are zeroed.
+     */
+    root_table = gfn_x(gfn) >> (XEN_PT_LEVEL_ORDER(P2M_ROOT_LEVEL) +
+                                XEN_PT_LPAE_SHIFT);
+    if ( root_table >= P2M_ROOT_PAGES )
+        return NULL;
+
+    return __map_domain_page(p2m->root + root_table);
+}
+
+/*
+ * Lookup the MFN corresponding to a domain's GFN.
+ * Lookup mem access in the ratrix tree.
+ * The entries associated to the GFN is considered valid.
+ */
+static p2m_access_t p2m_mem_access_radix_get(struct p2m_domain *p2m, gfn_t gfn)
+{
+    void *ptr;
+
+    if ( !p2m->mem_access_enabled )
+        return p2m->default_access;
+
+    ptr = radix_tree_lookup(&p2m->mem_access_settings, gfn_x(gfn));
+    if ( !ptr )
+        return p2m_access_rwx;
+    else
+        return radix_tree_ptr_to_int(ptr);
+}
+
+/*
+ * In the case of the P2M, the valid bit is used for other purpose. Use
+ * the type to check whether an entry is valid.
+ */
+static inline bool p2m_is_valid(lpae_t pte)
+{
+    return pte.p2m.type != p2m_invalid;
+}
+
+/*
+ * lpae_is_* helpers don't check whether the valid bit is set in the
+ * PTE. Provide our own overlay to check the valid bit.
+ */
+static inline bool p2m_is_mapping(lpae_t pte, unsigned int level)
+{
+    return p2m_is_valid(pte) && lpae_is_mapping(pte, level);
+}
+
+static inline bool p2m_is_superpage(lpae_t pte, unsigned int level)
+{
+    return p2m_is_valid(pte) && lpae_is_superpage(pte, level);
+}
+
+#define GUEST_TABLE_MAP_FAILED 0
+#define GUEST_TABLE_SUPER_PAGE 1
+#define GUEST_TABLE_NORMAL_PAGE 2
+
+static int p2m_create_table(struct p2m_domain *p2m, lpae_t *entry);
+
+/*
+ * Take the currently mapped table, find the corresponding GFN entry,
+ * and map the next table, if available. The previous table will be
+ * unmapped if the next level was mapped (e.g GUEST_TABLE_NORMAL_PAGE
+ * returned).
+ *
+ * The read_only parameters indicates whether intermediate tables should
+ * be allocated when not present.
+ *
+ * Return values:
+ *  GUEST_TABLE_MAP_FAILED: Either read_only was set and the entry
+ *  was empty, or allocating a new page failed.
+ *  GUEST_TABLE_NORMAL_PAGE: next level mapped normally
+ *  GUEST_TABLE_SUPER_PAGE: The next entry points to a superpage.
+ */
+static int p2m_next_level(struct p2m_domain *p2m, bool read_only,
+                          unsigned int level, lpae_t **table,
+                          unsigned int offset)
+{
+    lpae_t *entry;
+    int ret;
+    mfn_t mfn;
+
+    entry = *table + offset;
+
+    if ( !p2m_is_valid(*entry) )
+    {
+        if ( read_only )
+            return GUEST_TABLE_MAP_FAILED;
+
+        ret = p2m_create_table(p2m, entry);
+        if ( ret )
+            return GUEST_TABLE_MAP_FAILED;
+    }
+
+    /* The function p2m_next_level is never called at the 3rd level */
+    ASSERT(level < 3);
+    if ( p2m_is_mapping(*entry, level) )
+        return GUEST_TABLE_SUPER_PAGE;
+
+    mfn = lpae_get_mfn(*entry);
+
+    unmap_domain_page(*table);
+    *table = map_domain_page(mfn);
+
+    return GUEST_TABLE_NORMAL_PAGE;
+}
+
+/*
+ * Get the details of a given gfn.
+ *
+ * If the entry is present, the associated MFN will be returned and the
+ * access and type filled up. The page_order will correspond to the
+ * order of the mapping in the page table (i.e it could be a superpage).
+ *
+ * If the entry is not present, INVALID_MFN will be returned and the
+ * page_order will be set according to the order of the invalid range.
+ *
+ * valid will contain the value of bit[0] (e.g valid bit) of the
+ * entry.
+ */
+mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
+                    p2m_type_t *t, p2m_access_t *a,
+                    unsigned int *page_order,
+                    bool *valid)
+{
+    paddr_t addr = gfn_to_gaddr(gfn);
+    unsigned int level = 0;
+    lpae_t entry, *table;
+    int rc;
+    mfn_t mfn = INVALID_MFN;
+    p2m_type_t _t;
+    DECLARE_OFFSETS(offsets, addr);
+
+    ASSERT(p2m_is_locked(p2m));
+    BUILD_BUG_ON(THIRD_MASK != PAGE_MASK);
+
+    /* Allow t to be NULL */
+    t = t ?: &_t;
+
+    *t = p2m_invalid;
+
+    if ( valid )
+        *valid = false;
+
+    /* XXX: Check if the mapping is lower than the mapped gfn */
+
+    /* This gfn is higher than the highest the p2m map currently holds */
+    if ( gfn_x(gfn) > gfn_x(p2m->max_mapped_gfn) )
+    {
+        for ( level = P2M_ROOT_LEVEL; level < 3; level++ )
+            if ( (gfn_x(gfn) & (XEN_PT_LEVEL_MASK(level) >> PAGE_SHIFT)) >
+                 gfn_x(p2m->max_mapped_gfn) )
+                break;
+
+        goto out;
+    }
+
+    table = p2m_get_root_pointer(p2m, gfn);
+
+    /*
+     * the table should always be non-NULL because the gfn is below
+     * p2m->max_mapped_gfn and the root table pages are always present.
+     */
+    if ( !table )
+    {
+        ASSERT_UNREACHABLE();
+        level = P2M_ROOT_LEVEL;
+        goto out;
+    }
+
+    for ( level = P2M_ROOT_LEVEL; level < 3; level++ )
+    {
+        rc = p2m_next_level(p2m, true, level, &table, offsets[level]);
+        if ( rc == GUEST_TABLE_MAP_FAILED )
+            goto out_unmap;
+        else if ( rc != GUEST_TABLE_NORMAL_PAGE )
+            break;
+    }
+
+    entry = table[offsets[level]];
+
+    if ( p2m_is_valid(entry) )
+    {
+        *t = entry.p2m.type;
+
+        if ( a )
+            *a = p2m_mem_access_radix_get(p2m, gfn);
+
+        mfn = lpae_get_mfn(entry);
+        /*
+         * The entry may point to a superpage. Find the MFN associated
+         * to the GFN.
+         */
+        mfn = mfn_add(mfn,
+                      gfn_x(gfn) & ((1UL << XEN_PT_LEVEL_ORDER(level)) - 1));
+
+        if ( valid )
+            *valid = lpae_is_valid(entry);
+    }
+
+out_unmap:
+    unmap_domain_page(table);
+
+out:
+    if ( page_order )
+        *page_order = XEN_PT_LEVEL_ORDER(level);
+
+    return mfn;
+}
+
+static void p2m_set_permission(lpae_t *e, p2m_type_t t, p2m_access_t a)
+{
+    /* First apply type permissions */
+    switch ( t )
+    {
+    case p2m_ram_rw:
+        e->p2m.xn = 0;
+        e->p2m.write = 1;
+        break;
+
+    case p2m_ram_ro:
+        e->p2m.xn = 0;
+        e->p2m.write = 0;
+        break;
+
+    case p2m_iommu_map_rw:
+    case p2m_map_foreign_rw:
+    case p2m_grant_map_rw:
+    case p2m_mmio_direct_dev:
+    case p2m_mmio_direct_nc:
+    case p2m_mmio_direct_c:
+        e->p2m.xn = 1;
+        e->p2m.write = 1;
+        break;
+
+    case p2m_iommu_map_ro:
+    case p2m_map_foreign_ro:
+    case p2m_grant_map_ro:
+    case p2m_invalid:
+        e->p2m.xn = 1;
+        e->p2m.write = 0;
+        break;
+
+    case p2m_max_real_type:
+        BUG();
+        break;
+    }
+
+    /* Then restrict with access permissions */
+    switch ( a )
+    {
+    case p2m_access_rwx:
+        break;
+    case p2m_access_wx:
+        e->p2m.read = 0;
+        break;
+    case p2m_access_rw:
+        e->p2m.xn = 1;
+        break;
+    case p2m_access_w:
+        e->p2m.read = 0;
+        e->p2m.xn = 1;
+        break;
+    case p2m_access_rx:
+    case p2m_access_rx2rw:
+        e->p2m.write = 0;
+        break;
+    case p2m_access_x:
+        e->p2m.write = 0;
+        e->p2m.read = 0;
+        break;
+    case p2m_access_r:
+        e->p2m.write = 0;
+        e->p2m.xn = 1;
+        break;
+    case p2m_access_n:
+    case p2m_access_n2rwx:
+        e->p2m.read = e->p2m.write = 0;
+        e->p2m.xn = 1;
+        break;
+    }
+}
+
+static lpae_t mfn_to_p2m_entry(mfn_t mfn, p2m_type_t t, p2m_access_t a)
+{
+    /*
+     * sh, xn and write bit will be defined in the following switches
+     * based on mattr and t.
+     */
+    lpae_t e = (lpae_t) {
+        .p2m.af = 1,
+        .p2m.read = 1,
+        .p2m.table = 1,
+        .p2m.valid = 1,
+        .p2m.type = t,
+    };
+
+    BUILD_BUG_ON(p2m_max_real_type > (1 << 4));
+
+    switch ( t )
+    {
+    case p2m_mmio_direct_dev:
+        e.p2m.mattr = MATTR_DEV;
+        e.p2m.sh = LPAE_SH_OUTER;
+        break;
+
+    case p2m_mmio_direct_c:
+        e.p2m.mattr = MATTR_MEM;
+        e.p2m.sh = LPAE_SH_OUTER;
+        break;
+
+    /*
+     * ARM ARM: Overlaying the shareability attribute (DDI
+     * 0406C.b B3-1376 to 1377)
+     *
+     * A memory region with a resultant memory type attribute of Normal,
+     * and a resultant cacheability attribute of Inner Non-cacheable,
+     * Outer Non-cacheable, must have a resultant shareability attribute
+     * of Outer Shareable, otherwise shareability is UNPREDICTABLE.
+     *
+     * On ARMv8 shareability is ignored and explicitly treated as Outer
+     * Shareable for Normal Inner Non_cacheable, Outer Non-cacheable.
+     * See the note for table D4-40, in page 1788 of the ARM DDI 0487A.j.
+     */
+    case p2m_mmio_direct_nc:
+        e.p2m.mattr = MATTR_MEM_NC;
+        e.p2m.sh = LPAE_SH_OUTER;
+        break;
+
+    default:
+        e.p2m.mattr = MATTR_MEM;
+        e.p2m.sh = LPAE_SH_INNER;
+    }
+
+    p2m_set_permission(&e, t, a);
+
+    ASSERT(!(mfn_to_maddr(mfn) & ~PADDR_MASK));
+
+    lpae_set_mfn(e, mfn);
+
+    return e;
+}
+
+/* Generate table entry with correct attributes. */
+static lpae_t page_to_p2m_table(struct page_info *page)
+{
+    /*
+     * The access value does not matter because the hardware will ignore
+     * the permission fields for table entry.
+     *
+     * We use p2m_ram_rw so the entry has a valid type. This is important
+     * for p2m_is_valid() to return valid on table entries.
+     */
+    return mfn_to_p2m_entry(page_to_mfn(page), p2m_ram_rw, p2m_access_rwx);
+}
+
+static inline void p2m_write_pte(lpae_t *p, lpae_t pte, bool clean_pte)
+{
+    write_pte(p, pte);
+    if ( clean_pte )
+        clean_dcache(*p);
+}
+
+static inline void p2m_remove_pte(lpae_t *p, bool clean_pte)
+{
+    lpae_t pte;
+
+    memset(&pte, 0x00, sizeof(pte));
+    p2m_write_pte(p, pte, clean_pte);
+}
+
+/* Allocate a new page table page and hook it in via the given entry. */
+static int p2m_create_table(struct p2m_domain *p2m, lpae_t *entry)
+{
+    struct page_info *page;
+    lpae_t *p;
+
+    ASSERT(!p2m_is_valid(*entry));
+
+    page = p2m_alloc_page(p2m->domain);
+    if ( page == NULL )
+        return -ENOMEM;
+
+    page_list_add(page, &p2m->pages);
+
+    p = __map_domain_page(page);
+    clear_page(p);
+
+    if ( p2m->clean_pte )
+        clean_dcache_va_range(p, PAGE_SIZE);
+
+    unmap_domain_page(p);
+
+    p2m_write_pte(entry, page_to_p2m_table(page), p2m->clean_pte);
+
+    return 0;
+}
+
+static int p2m_mem_access_radix_set(struct p2m_domain *p2m, gfn_t gfn,
+                                    p2m_access_t a)
+{
+    int rc;
+
+    if ( !p2m->mem_access_enabled )
+        return 0;
+
+    if ( p2m_access_rwx == a )
+    {
+        radix_tree_delete(&p2m->mem_access_settings, gfn_x(gfn));
+        return 0;
+    }
+
+    rc = radix_tree_insert(&p2m->mem_access_settings, gfn_x(gfn),
+                           radix_tree_int_to_ptr(a));
+    if ( rc == -EEXIST )
+    {
+        /* If a setting already exists, change it to the new one */
+        radix_tree_replace_slot(
+            radix_tree_lookup_slot(
+                &p2m->mem_access_settings, gfn_x(gfn)),
+            radix_tree_int_to_ptr(a));
+        rc = 0;
+    }
+
+    return rc;
+}
+
+/*
+ * Put any references on the single 4K page referenced by pte.
+ * TODO: Handle superpages, for now we only take special references for leaf
+ * pages (specifically foreign ones, which can't be super mapped today).
+ */
+static void p2m_put_l3_page(const lpae_t pte)
+{
+    mfn_t mfn = lpae_get_mfn(pte);
+
+    ASSERT(p2m_is_valid(pte));
+
+    /*
+     * TODO: Handle other p2m types
+     *
+     * It's safe to do the put_page here because page_alloc will
+     * flush the TLBs if the page is reallocated before the end of
+     * this loop.
+     */
+    if ( p2m_is_foreign(pte.p2m.type) )
+    {
+        ASSERT(mfn_valid(mfn));
+        put_page(mfn_to_page(mfn));
+    }
+    /* Detect the xenheap page and mark the stored GFN as invalid. */
+    else if ( p2m_is_ram(pte.p2m.type) && is_xen_heap_mfn(mfn) )
+        page_set_xenheap_gfn(mfn_to_page(mfn), INVALID_GFN);
+}
+
+/* Free lpae sub-tree behind an entry */
+static void p2m_free_entry(struct p2m_domain *p2m,
+                           lpae_t entry, unsigned int level)
+{
+    unsigned int i;
+    lpae_t *table;
+    mfn_t mfn;
+    struct page_info *pg;
+
+    /* Nothing to do if the entry is invalid. */
+    if ( !p2m_is_valid(entry) )
+        return;
+
+    if ( p2m_is_superpage(entry, level) || (level == 3) )
+    {
+#ifdef CONFIG_IOREQ_SERVER
+        /*
+         * If this gets called then either the entry was replaced by an entry
+         * with a different base (valid case) or the shattering of a superpage
+         * has failed (error case).
+         * So, at worst, the spurious mapcache invalidation might be sent.
+         */
+        if ( p2m_is_ram(entry.p2m.type) &&
+             domain_has_ioreq_server(p2m->domain) )
+            ioreq_request_mapcache_invalidate(p2m->domain);
+#endif
+
+        p2m->stats.mappings[level]--;
+        /* Nothing to do if the entry is a super-page. */
+        if ( level == 3 )
+            p2m_put_l3_page(entry);
+        return;
+    }
+
+    table = map_domain_page(lpae_get_mfn(entry));
+    for ( i = 0; i < XEN_PT_LPAE_ENTRIES; i++ )
+        p2m_free_entry(p2m, *(table + i), level + 1);
+
+    unmap_domain_page(table);
+
+    /*
+     * Make sure all the references in the TLB have been removed before
+     * freing the intermediate page table.
+     * XXX: Should we defer the free of the page table to avoid the
+     * flush?
+     */
+    p2m_tlb_flush_sync(p2m);
+
+    mfn = lpae_get_mfn(entry);
+    ASSERT(mfn_valid(mfn));
+
+    pg = mfn_to_page(mfn);
+
+    page_list_del(pg, &p2m->pages);
+    p2m_free_page(p2m->domain, pg);
+}
+
+static bool p2m_split_superpage(struct p2m_domain *p2m, lpae_t *entry,
+                                unsigned int level, unsigned int target,
+                                const unsigned int *offsets)
+{
+    struct page_info *page;
+    unsigned int i;
+    lpae_t pte, *table;
+    bool rv = true;
+
+    /* Convenience aliases */
+    mfn_t mfn = lpae_get_mfn(*entry);
+    unsigned int next_level = level + 1;
+    unsigned int level_order = XEN_PT_LEVEL_ORDER(next_level);
+
+    /*
+     * This should only be called with target != level and the entry is
+     * a superpage.
+     */
+    ASSERT(level < target);
+    ASSERT(p2m_is_superpage(*entry, level));
+
+    page = p2m_alloc_page(p2m->domain);
+    if ( !page )
+        return false;
+
+    page_list_add(page, &p2m->pages);
+    table = __map_domain_page(page);
+
+    /*
+     * We are either splitting a first level 1G page into 512 second level
+     * 2M pages, or a second level 2M page into 512 third level 4K pages.
+     */
+    for ( i = 0; i < XEN_PT_LPAE_ENTRIES; i++ )
+    {
+        lpae_t *new_entry = table + i;
+
+        /*
+         * Use the content of the superpage entry and override
+         * the necessary fields. So the correct permission are kept.
+         */
+        pte = *entry;
+        lpae_set_mfn(pte, mfn_add(mfn, i << level_order));
+
+        /*
+         * First and second level pages set p2m.table = 0, but third
+         * level entries set p2m.table = 1.
+         */
+        pte.p2m.table = (next_level == 3);
+
+        write_pte(new_entry, pte);
+    }
+
+    /* Update stats */
+    p2m->stats.shattered[level]++;
+    p2m->stats.mappings[level]--;
+    p2m->stats.mappings[next_level] += XEN_PT_LPAE_ENTRIES;
+
+    /*
+     * Shatter superpage in the page to the level we want to make the
+     * changes.
+     * This is done outside the loop to avoid checking the offset to
+     * know whether the entry should be shattered for every entry.
+     */
+    if ( next_level != target )
+        rv = p2m_split_superpage(p2m, table + offsets[next_level],
+                                 level + 1, target, offsets);
+
+    if ( p2m->clean_pte )
+        clean_dcache_va_range(table, PAGE_SIZE);
+
+    unmap_domain_page(table);
+
+    /*
+     * Even if we failed, we should install the newly allocated LPAE
+     * entry. The caller will be in charge to free the sub-tree.
+     */
+    p2m_write_pte(entry, page_to_p2m_table(page), p2m->clean_pte);
+
+    return rv;
+}
+
+/*
+ * Insert an entry in the p2m. This should be called with a mapping
+ * equal to a page/superpage (4K, 2M, 1G).
+ */
+static int __p2m_set_entry(struct p2m_domain *p2m,
+                           gfn_t sgfn,
+                           unsigned int page_order,
+                           mfn_t smfn,
+                           p2m_type_t t,
+                           p2m_access_t a)
+{
+    unsigned int level = 0;
+    unsigned int target = 3 - (page_order / XEN_PT_LPAE_SHIFT);
+    lpae_t *entry, *table, orig_pte;
+    int rc;
+    /* A mapping is removed if the MFN is invalid. */
+    bool removing_mapping = mfn_eq(smfn, INVALID_MFN);
+    DECLARE_OFFSETS(offsets, gfn_to_gaddr(sgfn));
+
+    ASSERT(p2m_is_write_locked(p2m));
+
+    /*
+     * Check if the level target is valid: we only support
+     * 4K - 2M - 1G mapping.
+     */
+    ASSERT(target > 0 && target <= 3);
+
+    table = p2m_get_root_pointer(p2m, sgfn);
+    if ( !table )
+        return -EINVAL;
+
+    for ( level = P2M_ROOT_LEVEL; level < target; level++ )
+    {
+        /*
+         * Don't try to allocate intermediate page table if the mapping
+         * is about to be removed.
+         */
+        rc = p2m_next_level(p2m, removing_mapping,
+                            level, &table, offsets[level]);
+        if ( rc == GUEST_TABLE_MAP_FAILED )
+        {
+            /*
+             * We are here because p2m_next_level has failed to map
+             * the intermediate page table (e.g the table does not exist
+             * and they p2m tree is read-only). It is a valid case
+             * when removing a mapping as it may not exist in the
+             * page table. In this case, just ignore it.
+             */
+            rc = removing_mapping ?  0 : -ENOENT;
+            goto out;
+        }
+        else if ( rc != GUEST_TABLE_NORMAL_PAGE )
+            break;
+    }
+
+    entry = table + offsets[level];
+
+    /*
+     * If we are here with level < target, we must be at a leaf node,
+     * and we need to break up the superpage.
+     */
+    if ( level < target )
+    {
+        /* We need to split the original page. */
+        lpae_t split_pte = *entry;
+
+        ASSERT(p2m_is_superpage(*entry, level));
+
+        if ( !p2m_split_superpage(p2m, &split_pte, level, target, offsets) )
+        {
+            /*
+             * The current super-page is still in-place, so re-increment
+             * the stats.
+             */
+            p2m->stats.mappings[level]++;
+
+            /* Free the allocated sub-tree */
+            p2m_free_entry(p2m, split_pte, level);
+
+            rc = -ENOMEM;
+            goto out;
+        }
+
+        /*
+         * Follow the break-before-sequence to update the entry.
+         * For more details see (D4.7.1 in ARM DDI 0487A.j).
+         */
+        p2m_remove_pte(entry, p2m->clean_pte);
+        p2m_force_tlb_flush_sync(p2m);
+
+        p2m_write_pte(entry, split_pte, p2m->clean_pte);
+
+        /* then move to the level we want to make real changes */
+        for ( ; level < target; level++ )
+        {
+            rc = p2m_next_level(p2m, true, level, &table, offsets[level]);
+
+            /*
+             * The entry should be found and either be a table
+             * or a superpage if level 3 is not targeted
+             */
+            ASSERT(rc == GUEST_TABLE_NORMAL_PAGE ||
+                   (rc == GUEST_TABLE_SUPER_PAGE && target < 3));
+        }
+
+        entry = table + offsets[level];
+    }
+
+    /*
+     * We should always be there with the correct level because
+     * all the intermediate tables have been installed if necessary.
+     */
+    ASSERT(level == target);
+
+    orig_pte = *entry;
+
+    /*
+     * The radix-tree can only work on 4KB. This is only used when
+     * memaccess is enabled and during shutdown.
+     */
+    ASSERT(!p2m->mem_access_enabled || page_order == 0 ||
+           p2m->domain->is_dying);
+    /*
+     * The access type should always be p2m_access_rwx when the mapping
+     * is removed.
+     */
+    ASSERT(!mfn_eq(INVALID_MFN, smfn) || (a == p2m_access_rwx));
+    /*
+     * Update the mem access permission before update the P2M. So we
+     * don't have to revert the mapping if it has failed.
+     */
+    rc = p2m_mem_access_radix_set(p2m, sgfn, a);
+    if ( rc )
+        goto out;
+
+    /*
+     * Always remove the entry in order to follow the break-before-make
+     * sequence when updating the translation table (D4.7.1 in ARM DDI
+     * 0487A.j).
+     */
+    if ( lpae_is_valid(orig_pte) || removing_mapping )
+        p2m_remove_pte(entry, p2m->clean_pte);
+
+    if ( removing_mapping )
+        /* Flush can be deferred if the entry is removed */
+        p2m->need_flush |= !!lpae_is_valid(orig_pte);
+    else
+    {
+        lpae_t pte = mfn_to_p2m_entry(smfn, t, a);
+
+        if ( level < 3 )
+            pte.p2m.table = 0; /* Superpage entry */
+
+        /*
+         * It is necessary to flush the TLB before writing the new entry
+         * to keep coherency when the previous entry was valid.
+         *
+         * Although, it could be defered when only the permissions are
+         * changed (e.g in case of memaccess).
+         */
+        if ( lpae_is_valid(orig_pte) )
+        {
+            if ( likely(!p2m->mem_access_enabled) ||
+                 P2M_CLEAR_PERM(pte) != P2M_CLEAR_PERM(orig_pte) )
+                p2m_force_tlb_flush_sync(p2m);
+            else
+                p2m->need_flush = true;
+        }
+        else if ( !p2m_is_valid(orig_pte) ) /* new mapping */
+            p2m->stats.mappings[level]++;
+
+        p2m_write_pte(entry, pte, p2m->clean_pte);
+
+        p2m->max_mapped_gfn = gfn_max(p2m->max_mapped_gfn,
+                                      gfn_add(sgfn, (1UL << page_order) - 1));
+        p2m->lowest_mapped_gfn = gfn_min(p2m->lowest_mapped_gfn, sgfn);
+    }
+
+    if ( is_iommu_enabled(p2m->domain) &&
+         (lpae_is_valid(orig_pte) || lpae_is_valid(*entry)) )
+    {
+        unsigned int flush_flags = 0;
+
+        if ( lpae_is_valid(orig_pte) )
+            flush_flags |= IOMMU_FLUSHF_modified;
+        if ( lpae_is_valid(*entry) )
+            flush_flags |= IOMMU_FLUSHF_added;
+
+        rc = iommu_iotlb_flush(p2m->domain, _dfn(gfn_x(sgfn)),
+                               1UL << page_order, flush_flags);
+    }
+    else
+        rc = 0;
+
+    /*
+     * Free the entry only if the original pte was valid and the base
+     * is different (to avoid freeing when permission is changed).
+     */
+    if ( p2m_is_valid(orig_pte) &&
+         !mfn_eq(lpae_get_mfn(*entry), lpae_get_mfn(orig_pte)) )
+        p2m_free_entry(p2m, orig_pte, level);
+
+out:
+    unmap_domain_page(table);
+
+    return rc;
+}
+
+int p2m_set_entry(struct p2m_domain *p2m,
+                  gfn_t sgfn,
+                  unsigned long nr,
+                  mfn_t smfn,
+                  p2m_type_t t,
+                  p2m_access_t a)
+{
+    int rc = 0;
+
+    /*
+     * Any reference taken by the P2M mappings (e.g. foreign mapping) will
+     * be dropped in relinquish_p2m_mapping(). As the P2M will still
+     * be accessible after, we need to prevent mapping to be added when the
+     * domain is dying.
+     */
+    if ( unlikely(p2m->domain->is_dying) )
+        return -ENOMEM;
+
+    while ( nr )
+    {
+        unsigned long mask;
+        unsigned long order;
+
+        /*
+         * Don't take into account the MFN when removing mapping (i.e
+         * MFN_INVALID) to calculate the correct target order.
+         *
+         * XXX: Support superpage mappings if nr is not aligned to a
+         * superpage size.
+         */
+        mask = !mfn_eq(smfn, INVALID_MFN) ? mfn_x(smfn) : 0;
+        mask |= gfn_x(sgfn) | nr;
+
+        /* Always map 4k by 4k when memaccess is enabled */
+        if ( unlikely(p2m->mem_access_enabled) )
+            order = THIRD_ORDER;
+        else if ( !(mask & ((1UL << FIRST_ORDER) - 1)) )
+            order = FIRST_ORDER;
+        else if ( !(mask & ((1UL << SECOND_ORDER) - 1)) )
+            order = SECOND_ORDER;
+        else
+            order = THIRD_ORDER;
+
+        rc = __p2m_set_entry(p2m, sgfn, order, smfn, t, a);
+        if ( rc )
+            break;
+
+        sgfn = gfn_add(sgfn, (1 << order));
+        if ( !mfn_eq(smfn, INVALID_MFN) )
+           smfn = mfn_add(smfn, (1 << order));
+
+        nr -= (1 << order);
+    }
+
+    return rc;
+}
+
+/* Invalidate all entries in the table. The p2m should be write locked. */
+static void p2m_invalidate_table(struct p2m_domain *p2m, mfn_t mfn)
+{
+    lpae_t *table;
+    unsigned int i;
+
+    ASSERT(p2m_is_write_locked(p2m));
+
+    table = map_domain_page(mfn);
+
+    for ( i = 0; i < XEN_PT_LPAE_ENTRIES; i++ )
+    {
+        lpae_t pte = table[i];
+
+        /*
+         * Writing an entry can be expensive because it may involve
+         * cleaning the cache. So avoid updating the entry if the valid
+         * bit is already cleared.
+         */
+        if ( !pte.p2m.valid )
+            continue;
+
+        pte.p2m.valid = 0;
+
+        p2m_write_pte(&table[i], pte, p2m->clean_pte);
+    }
+
+    unmap_domain_page(table);
+
+    p2m->need_flush = true;
+}
+
+/*
+ * The domain will not be scheduled anymore, so in theory we should
+ * not need to flush the TLBs. Do it for safety purpose.
+ * Note that all the devices have already been de-assigned. So we don't
+ * need to flush the IOMMU TLB here.
+ */
+void p2m_clear_root_pages(struct p2m_domain *p2m)
+{
+    unsigned int i;
+
+    p2m_write_lock(p2m);
+
+    for ( i = 0; i < P2M_ROOT_PAGES; i++ )
+        clear_and_clean_page(p2m->root + i);
+
+    p2m_force_tlb_flush_sync(p2m);
+
+    p2m_write_unlock(p2m);
+}
+
+/*
+ * Invalidate all entries in the root page-tables. This is
+ * useful to get fault on entry and do an action.
+ *
+ * p2m_invalid_root() should not be called when the P2M is shared with
+ * the IOMMU because it will cause IOMMU fault.
+ */
+static void p2m_invalidate_root(struct p2m_domain *p2m)
+{
+    unsigned int i;
+
+    ASSERT(!iommu_use_hap_pt(p2m->domain));
+
+    p2m_write_lock(p2m);
+
+    for ( i = 0; i < P2M_ROOT_LEVEL; i++ )
+        p2m_invalidate_table(p2m, page_to_mfn(p2m->root + i));
+
+    p2m_write_unlock(p2m);
+}
+
+void p2m_domain_creation_finished(struct domain *d)
+{
+    /*
+     * To avoid flushing the whole guest RAM on the first Set/Way, we
+     * invalidate the P2M to track what has been accessed.
+     *
+     * This is only turned when IOMMU is not used or the page-table are
+     * not shared because bit[0] (e.g valid bit) unset will result
+     * IOMMU fault that could be not fixed-up.
+     */
+    if ( !iommu_use_hap_pt(d) )
+        p2m_invalidate_root(p2m_get_hostp2m(d));
+}
+
+/*
+ * Resolve any translation fault due to change in the p2m. This
+ * includes break-before-make and valid bit cleared.
+ */
+bool p2m_resolve_translation_fault(struct domain *d, gfn_t gfn)
+{
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    unsigned int level = 0;
+    bool resolved = false;
+    lpae_t entry, *table;
+
+    /* Convenience aliases */
+    DECLARE_OFFSETS(offsets, gfn_to_gaddr(gfn));
+
+    p2m_write_lock(p2m);
+
+    /* This gfn is higher than the highest the p2m map currently holds */
+    if ( gfn_x(gfn) > gfn_x(p2m->max_mapped_gfn) )
+        goto out;
+
+    table = p2m_get_root_pointer(p2m, gfn);
+    /*
+     * The table should always be non-NULL because the gfn is below
+     * p2m->max_mapped_gfn and the root table pages are always present.
+     */
+    if ( !table )
+    {
+        ASSERT_UNREACHABLE();
+        goto out;
+    }
+
+    /*
+     * Go down the page-tables until an entry has the valid bit unset or
+     * a block/page entry has been hit.
+     */
+    for ( level = P2M_ROOT_LEVEL; level <= 3; level++ )
+    {
+        int rc;
+
+        entry = table[offsets[level]];
+
+        if ( level == 3 )
+            break;
+
+        /* Stop as soon as we hit an entry with the valid bit unset. */
+        if ( !lpae_is_valid(entry) )
+            break;
+
+        rc = p2m_next_level(p2m, true, level, &table, offsets[level]);
+        if ( rc == GUEST_TABLE_MAP_FAILED )
+            goto out_unmap;
+        else if ( rc != GUEST_TABLE_NORMAL_PAGE )
+            break;
+    }
+
+    /*
+     * If the valid bit of the entry is set, it means someone was playing with
+     * the Stage-2 page table. Nothing to do and mark the fault as resolved.
+     */
+    if ( lpae_is_valid(entry) )
+    {
+        resolved = true;
+        goto out_unmap;
+    }
+
+    /*
+     * The valid bit is unset. If the entry is still not valid then the fault
+     * cannot be resolved, exit and report it.
+     */
+    if ( !p2m_is_valid(entry) )
+        goto out_unmap;
+
+    /*
+     * Now we have an entry with valid bit unset, but still valid from
+     * the P2M point of view.
+     *
+     * If an entry is pointing to a table, each entry of the table will
+     * have there valid bit cleared. This allows a function to clear the
+     * full p2m with just a couple of write. The valid bit will then be
+     * propagated on the fault.
+     * If an entry is pointing to a block/page, no work to do for now.
+     */
+    if ( lpae_is_table(entry, level) )
+        p2m_invalidate_table(p2m, lpae_get_mfn(entry));
+
+    /*
+     * Now that the work on the entry is done, set the valid bit to prevent
+     * another fault on that entry.
+     */
+    resolved = true;
+    entry.p2m.valid = 1;
+
+    p2m_write_pte(table + offsets[level], entry, p2m->clean_pte);
+
+    /*
+     * No need to flush the TLBs as the modified entry had the valid bit
+     * unset.
+     */
+
+out_unmap:
+    unmap_domain_page(table);
+
+out:
+    p2m_write_unlock(p2m);
+
+    return resolved;
+}
+
+static struct page_info *p2m_allocate_root(void)
+{
+    struct page_info *page;
+    unsigned int i;
+
+    page = alloc_domheap_pages(NULL, P2M_ROOT_ORDER, 0);
+    if ( page == NULL )
+        return NULL;
+
+    /* Clear both first level pages */
+    for ( i = 0; i < P2M_ROOT_PAGES; i++ )
+        clear_and_clean_page(page + i);
+
+    return page;
+}
+
+static int p2m_alloc_table(struct domain *d)
+{
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+
+    p2m->root = p2m_allocate_root();
+    if ( !p2m->root )
+        return -ENOMEM;
+
+    p2m->vttbr = generate_vttbr(p2m->vmid, page_to_mfn(p2m->root));
+
+    /*
+     * Make sure that all TLBs corresponding to the new VMID are flushed
+     * before using it
+     */
+    p2m_write_lock(p2m);
+    p2m_force_tlb_flush_sync(p2m);
+    p2m_write_unlock(p2m);
+
+    return 0;
+}
+
+int p2m_teardown(struct domain *d)
+{
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    unsigned long count = 0;
+    struct page_info *pg;
+    int rc = 0;
+
+    p2m_write_lock(p2m);
+
+    while ( (pg = page_list_remove_head(&p2m->pages)) )
+    {
+        p2m_free_page(p2m->domain, pg);
+        count++;
+        /* Arbitrarily preempt every 512 iterations */
+        if ( !(count % 512) && hypercall_preempt_check() )
+        {
+            rc = -ERESTART;
+            break;
+        }
+    }
+
+    p2m_write_unlock(p2m);
+
+    return rc;
+}
+
+void p2m_final_teardown(struct domain *d)
+{
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+
+    /* p2m not actually initialized */
+    if ( !p2m->domain )
+        return;
+
+    /*
+     * No need to call relinquish_p2m_mapping() here because
+     * p2m_final_teardown() is called either after domain_relinquish_resources()
+     * where relinquish_p2m_mapping() has been called.
+     */
+
+    ASSERT(page_list_empty(&p2m->pages));
+
+    while ( p2m_teardown_allocation(d) == -ERESTART )
+        continue; /* No preemption support here */
+    ASSERT(page_list_empty(&d->arch.paging.p2m_freelist));
+
+    if ( p2m->root )
+        free_domheap_pages(p2m->root, P2M_ROOT_ORDER);
+
+    p2m->root = NULL;
+
+    p2m_free_vmid(d);
+
+    radix_tree_destroy(&p2m->mem_access_settings, NULL);
+
+    p2m->domain = NULL;
+}
+
+int p2m_init(struct domain *d)
+{
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    int rc;
+    unsigned int cpu;
+
+    rwlock_init(&p2m->lock);
+    spin_lock_init(&d->arch.paging.lock);
+    INIT_PAGE_LIST_HEAD(&p2m->pages);
+    INIT_PAGE_LIST_HEAD(&d->arch.paging.p2m_freelist);
+
+    p2m->vmid = INVALID_VMID;
+    p2m->max_mapped_gfn = _gfn(0);
+    p2m->lowest_mapped_gfn = _gfn(ULONG_MAX);
+
+    p2m->default_access = p2m_access_rwx;
+    p2m->mem_access_enabled = false;
+    radix_tree_init(&p2m->mem_access_settings);
+
+    /*
+     * Some IOMMUs don't support coherent PT walk. When the p2m is
+     * shared with the CPU, Xen has to make sure that the PT changes have
+     * reached the memory
+     */
+    p2m->clean_pte = is_iommu_enabled(d) &&
+        !iommu_has_feature(d, IOMMU_FEAT_COHERENT_WALK);
+
+    /*
+     * Make sure that the type chosen to is able to store the an vCPU ID
+     * between 0 and the maximum of virtual CPUS supported as long as
+     * the INVALID_VCPU_ID.
+     */
+    BUILD_BUG_ON((1 << (sizeof(p2m->last_vcpu_ran[0]) * 8)) < MAX_VIRT_CPUS);
+    BUILD_BUG_ON((1 << (sizeof(p2m->last_vcpu_ran[0])* 8)) < INVALID_VCPU_ID);
+
+    for_each_possible_cpu(cpu)
+       p2m->last_vcpu_ran[cpu] = INVALID_VCPU_ID;
+
+    /*
+     * "Trivial" initialisation is now complete.  Set the backpointer so
+     * p2m_teardown() and friends know to do something.
+     */
+    p2m->domain = d;
+
+    rc = p2m_alloc_vmid(d);
+    if ( rc )
+        return rc;
+
+    rc = p2m_alloc_table(d);
+    if ( rc )
+        return rc;
+
+    return 0;
+}
+
+/*
+ * The function will go through the p2m and remove page reference when it
+ * is required. The mapping will be removed from the p2m.
+ *
+ * XXX: See whether the mapping can be left intact in the p2m.
+ */
+int relinquish_p2m_mapping(struct domain *d)
+{
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    unsigned long count = 0;
+    p2m_type_t t;
+    int rc = 0;
+    unsigned int order;
+    gfn_t start, end;
+
+    BUG_ON(!d->is_dying);
+    /* No mappings can be added in the P2M after the P2M lock is released. */
+    p2m_write_lock(p2m);
+
+    start = p2m->lowest_mapped_gfn;
+    end = gfn_add(p2m->max_mapped_gfn, 1);
+
+    for ( ; gfn_x(start) < gfn_x(end);
+          start = gfn_next_boundary(start, order) )
+    {
+        mfn_t mfn = p2m_get_entry(p2m, start, &t, NULL, &order, NULL);
+
+        count++;
+        /*
+         * Arbitrarily preempt every 512 iterations.
+         */
+        if ( !(count % 512) && hypercall_preempt_check() )
+        {
+            rc = -ERESTART;
+            break;
+        }
+
+        /*
+         * p2m_set_entry will take care of removing reference on page
+         * when it is necessary and removing the mapping in the p2m.
+         */
+        if ( !mfn_eq(mfn, INVALID_MFN) )
+        {
+            /*
+             * For valid mapping, the start will always be aligned as
+             * entry will be removed whilst relinquishing.
+             */
+            rc = __p2m_set_entry(p2m, start, order, INVALID_MFN,
+                                 p2m_invalid, p2m_access_rwx);
+            if ( unlikely(rc) )
+            {
+                printk(XENLOG_G_ERR "Unable to remove mapping gfn=%#"PRI_gfn" order=%u from the p2m of domain %d\n", gfn_x(start), order, d->domain_id);
+                break;
+            }
+        }
+    }
+
+    /*
+     * Update lowest_mapped_gfn so on the next call we still start where
+     * we stopped.
+     */
+    p2m->lowest_mapped_gfn = start;
+
+    p2m_write_unlock(p2m);
+
+    return rc;
+}
+
+/*
+ * Clean & invalidate RAM associated to the guest vCPU.
+ *
+ * The function can only work with the current vCPU and should be called
+ * with IRQ enabled as the vCPU could get preempted.
+ */
+void p2m_flush_vm(struct vcpu *v)
+{
+    struct p2m_domain *p2m = p2m_get_hostp2m(v->domain);
+    int rc;
+    gfn_t start = _gfn(0);
+
+    ASSERT(v == current);
+    ASSERT(local_irq_is_enabled());
+    ASSERT(v->arch.need_flush_to_ram);
+
+    do
+    {
+        rc = p2m_cache_flush_range(v->domain, &start, _gfn(ULONG_MAX));
+        if ( rc == -ERESTART )
+            do_softirq();
+    } while ( rc == -ERESTART );
+
+    if ( rc != 0 )
+        gprintk(XENLOG_WARNING,
+                "P2M has not been correctly cleaned (rc = %d)\n",
+                rc);
+
+    /*
+     * Invalidate the p2m to track which page was modified by the guest
+     * between call of p2m_flush_vm().
+     */
+    p2m_invalidate_root(p2m);
+
+    v->arch.need_flush_to_ram = false;
+}
+
+/* VTCR value to be configured by all CPUs. Set only once by the boot CPU */
+static register_t __read_mostly vtcr;
+
+static void setup_virt_paging_one(void *data)
+{
+    WRITE_SYSREG(vtcr, VTCR_EL2);
+
+    /*
+     * ARM64_WORKAROUND_AT_SPECULATE: We want to keep the TLBs free from
+     * entries related to EL1/EL0 translation regime until a guest vCPU
+     * is running. For that, we need to set-up VTTBR to point to an empty
+     * page-table and turn on stage-2 translation. The TLB entries
+     * associated with EL1/EL0 translation regime will also be flushed in case
+     * an AT instruction was speculated before hand.
+     */
+    if ( cpus_have_cap(ARM64_WORKAROUND_AT_SPECULATE) )
+    {
+        WRITE_SYSREG64(generate_vttbr(INVALID_VMID, empty_root_mfn), VTTBR_EL2);
+        WRITE_SYSREG(READ_SYSREG(HCR_EL2) | HCR_VM, HCR_EL2);
+        isb();
+
+        flush_all_guests_tlb_local();
+    }
+}
+
+void __init setup_virt_paging(void)
+{
+    /* Setup Stage 2 address translation */
+    register_t val = VTCR_RES1|VTCR_SH0_IS|VTCR_ORGN0_WBWA|VTCR_IRGN0_WBWA;
+
+    static const struct {
+        unsigned int pabits; /* Physical Address Size */
+        unsigned int t0sz;   /* Desired T0SZ, minimum in comment */
+        unsigned int root_order; /* Page order of the root of the p2m */
+        unsigned int sl0;    /* Desired SL0, maximum in comment */
+    } pa_range_info[] __initconst = {
+        /* T0SZ minimum and SL0 maximum from ARM DDI 0487H.a Table D5-6 */
+        /*      PA size, t0sz(min), root-order, sl0(max) */
+#ifdef CONFIG_ARM_64
+        [0] = { 32,      32/*32*/,  0,          1 },
+        [1] = { 36,      28/*28*/,  0,          1 },
+        [2] = { 40,      24/*24*/,  1,          1 },
+        [3] = { 42,      22/*22*/,  3,          1 },
+        [4] = { 44,      20/*20*/,  0,          2 },
+        [5] = { 48,      16/*16*/,  0,          2 },
+        [6] = { 52,      12/*12*/,  4,          2 },
+        [7] = { 0 }  /* Invalid */
+#else
+        { 32,      0/*0*/,    0,          1 },
+        { 40,      24/*24*/,  1,          1 }
+#endif
+    };
+
+    unsigned int i;
+    unsigned int pa_range = 0x10; /* Larger than any possible value */
+
+#ifdef CONFIG_ARM_32
+    /*
+     * Typecast pa_range_info[].t0sz into arm32 bit variant.
+     *
+     * VTCR.T0SZ is bits [3:0] and S(sign extension), bit[4] for arm322.
+     * Thus, pa_range_info[].t0sz is translated to its arm32 variant using
+     * struct bitfields.
+     */
+    struct
+    {
+        signed int val:5;
+    } t0sz_32;
+#else
+    /*
+     * Restrict "p2m_ipa_bits" if needed. As P2M table is always configured
+     * with IPA bits == PA bits, compare against "pabits".
+     */
+    if ( pa_range_info[system_cpuinfo.mm64.pa_range].pabits < p2m_ipa_bits )
+        p2m_ipa_bits = pa_range_info[system_cpuinfo.mm64.pa_range].pabits;
+
+    /*
+     * cpu info sanitization made sure we support 16bits VMID only if all
+     * cores are supporting it.
+     */
+    if ( system_cpuinfo.mm64.vmid_bits == MM64_VMID_16_BITS_SUPPORT )
+        max_vmid = MAX_VMID_16_BIT;
+#endif
+
+    /* Choose suitable "pa_range" according to the resulted "p2m_ipa_bits". */
+    for ( i = 0; i < ARRAY_SIZE(pa_range_info); i++ )
+    {
+        if ( p2m_ipa_bits == pa_range_info[i].pabits )
+        {
+            pa_range = i;
+            break;
+        }
+    }
+
+    /* Check if we found the associated entry in the array */
+    if ( pa_range >= ARRAY_SIZE(pa_range_info) || !pa_range_info[pa_range].pabits )
+        panic("%u-bit P2M is not supported\n", p2m_ipa_bits);
+
+#ifdef CONFIG_ARM_64
+    val |= VTCR_PS(pa_range);
+    val |= VTCR_TG0_4K;
+
+    /* Set the VS bit only if 16 bit VMID is supported. */
+    if ( MAX_VMID == MAX_VMID_16_BIT )
+        val |= VTCR_VS;
+#endif
+
+    val |= VTCR_SL0(pa_range_info[pa_range].sl0);
+    val |= VTCR_T0SZ(pa_range_info[pa_range].t0sz);
+
+    p2m_root_order = pa_range_info[pa_range].root_order;
+    p2m_root_level = 2 - pa_range_info[pa_range].sl0;
+
+#ifdef CONFIG_ARM_64
+    p2m_ipa_bits = 64 - pa_range_info[pa_range].t0sz;
+#else
+    t0sz_32.val = pa_range_info[pa_range].t0sz;
+    p2m_ipa_bits = 32 - t0sz_32.val;
+#endif
+
+    printk("P2M: %d-bit IPA with %d-bit PA and %d-bit VMID\n",
+           p2m_ipa_bits,
+           pa_range_info[pa_range].pabits,
+           ( MAX_VMID == MAX_VMID_16_BIT ) ? 16 : 8);
+
+    printk("P2M: %d levels with order-%d root, VTCR 0x%"PRIregister"\n",
+           4 - P2M_ROOT_LEVEL, P2M_ROOT_ORDER, val);
+
+    p2m_vmid_allocator_init();
+
+    /* It is not allowed to concatenate a level zero root */
+    BUG_ON( P2M_ROOT_LEVEL == 0 && P2M_ROOT_ORDER > 0 );
+    vtcr = val;
+
+    /*
+     * ARM64_WORKAROUND_AT_SPECULATE requires to allocate root table
+     * with all entries zeroed.
+     */
+    if ( cpus_have_cap(ARM64_WORKAROUND_AT_SPECULATE) )
+    {
+        struct page_info *root;
+
+        root = p2m_allocate_root();
+        if ( !root )
+            panic("Unable to allocate root table for ARM64_WORKAROUND_AT_SPECULATE\n");
+
+        empty_root_mfn = page_to_mfn(root);
+    }
+
+    setup_virt_paging_one(NULL);
+    smp_call_function(setup_virt_paging_one, NULL, 1);
+}
+
+static int cpu_virt_paging_callback(struct notifier_block *nfb,
+                                    unsigned long action,
+                                    void *hcpu)
+{
+    switch ( action )
+    {
+    case CPU_STARTING:
+        ASSERT(system_state != SYS_STATE_boot);
+        setup_virt_paging_one(NULL);
+        break;
+    default:
+        break;
+    }
+
+    return NOTIFY_DONE;
+}
+
+static struct notifier_block cpu_virt_paging_nfb = {
+    .notifier_call = cpu_virt_paging_callback,
+};
+
+static int __init cpu_virt_paging_init(void)
+{
+    register_cpu_notifier(&cpu_virt_paging_nfb);
+
+    return 0;
+}
+/*
+ * Initialization of the notifier has to be done at init rather than presmp_init
+ * phase because: the registered notifier is used to setup virtual paging for
+ * non-boot CPUs after the initial virtual paging for all CPUs is already setup,
+ * i.e. when a non-boot CPU is hotplugged after the system has booted. In other
+ * words, the notifier should be registered after the virtual paging is
+ * initially setup (setup_virt_paging() is called from start_xen()). This is
+ * required because vtcr config value has to be set before a notifier can fire.
+ */
+__initcall(cpu_virt_paging_init);
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index de32a2d638..b991b76ce4 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -1,191 +1,25 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-#include <xen/cpu.h>
-#include <xen/domain_page.h>
 #include <xen/iocap.h>
-#include <xen/ioreq.h>
 #include <xen/lib.h>
 #include <xen/sched.h>
 #include <xen/softirq.h>
 
-#include <asm/alternative.h>
 #include <asm/event.h>
 #include <asm/flushtlb.h>
 #include <asm/guest_walk.h>
 #include <asm/page.h>
 #include <asm/traps.h>
 
-#define MAX_VMID_8_BIT  (1UL << 8)
-#define MAX_VMID_16_BIT (1UL << 16)
-
-#define INVALID_VMID 0 /* VMID 0 is reserved */
-
-unsigned int __read_mostly p2m_root_order;
-unsigned int __read_mostly p2m_root_level;
 #ifdef CONFIG_ARM_64
-static unsigned int __read_mostly max_vmid = MAX_VMID_8_BIT;
-/* VMID is by default 8 bit width on AArch64 */
-#define MAX_VMID       max_vmid
-#else
-/* VMID is always 8 bit width on AArch32 */
-#define MAX_VMID        MAX_VMID_8_BIT
+unsigned int __read_mostly max_vmid = MAX_VMID_8_BIT;
 #endif
 
-#define P2M_ROOT_PAGES    (1<<P2M_ROOT_ORDER)
-
 /*
  * Set to the maximum configured support for IPA bits, so the number of IPA bits can be
  * restricted by external entity (e.g. IOMMU).
  */
 unsigned int __read_mostly p2m_ipa_bits = PADDR_BITS;
 
-static mfn_t __read_mostly empty_root_mfn;
-
-static uint64_t generate_vttbr(uint16_t vmid, mfn_t root_mfn)
-{
-    return (mfn_to_maddr(root_mfn) | ((uint64_t)vmid << 48));
-}
-
-static struct page_info *p2m_alloc_page(struct domain *d)
-{
-    struct page_info *pg;
-
-    /*
-     * For hardware domain, there should be no limit in the number of pages that
-     * can be allocated, so that the kernel may take advantage of the extended
-     * regions. Hence, allocate p2m pages for hardware domains from heap.
-     */
-    if ( is_hardware_domain(d) )
-    {
-        pg = alloc_domheap_page(NULL, 0);
-        if ( pg == NULL )
-            printk(XENLOG_G_ERR "Failed to allocate P2M pages for hwdom.\n");
-    }
-    else
-    {
-        spin_lock(&d->arch.paging.lock);
-        pg = page_list_remove_head(&d->arch.paging.p2m_freelist);
-        spin_unlock(&d->arch.paging.lock);
-    }
-
-    return pg;
-}
-
-static void p2m_free_page(struct domain *d, struct page_info *pg)
-{
-    if ( is_hardware_domain(d) )
-        free_domheap_page(pg);
-    else
-    {
-        spin_lock(&d->arch.paging.lock);
-        page_list_add_tail(pg, &d->arch.paging.p2m_freelist);
-        spin_unlock(&d->arch.paging.lock);
-    }
-}
-
-/* Return the size of the pool, in bytes. */
-int arch_get_paging_mempool_size(struct domain *d, uint64_t *size)
-{
-    *size = (uint64_t)ACCESS_ONCE(d->arch.paging.p2m_total_pages) << PAGE_SHIFT;
-    return 0;
-}
-
-/*
- * Set the pool of pages to the required number of pages.
- * Returns 0 for success, non-zero for failure.
- * Call with d->arch.paging.lock held.
- */
-int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted)
-{
-    struct page_info *pg;
-
-    ASSERT(spin_is_locked(&d->arch.paging.lock));
-
-    for ( ; ; )
-    {
-        if ( d->arch.paging.p2m_total_pages < pages )
-        {
-            /* Need to allocate more memory from domheap */
-            pg = alloc_domheap_page(NULL, 0);
-            if ( pg == NULL )
-            {
-                printk(XENLOG_ERR "Failed to allocate P2M pages.\n");
-                return -ENOMEM;
-            }
-            ACCESS_ONCE(d->arch.paging.p2m_total_pages) =
-                d->arch.paging.p2m_total_pages + 1;
-            page_list_add_tail(pg, &d->arch.paging.p2m_freelist);
-        }
-        else if ( d->arch.paging.p2m_total_pages > pages )
-        {
-            /* Need to return memory to domheap */
-            pg = page_list_remove_head(&d->arch.paging.p2m_freelist);
-            if( pg )
-            {
-                ACCESS_ONCE(d->arch.paging.p2m_total_pages) =
-                    d->arch.paging.p2m_total_pages - 1;
-                free_domheap_page(pg);
-            }
-            else
-            {
-                printk(XENLOG_ERR
-                       "Failed to free P2M pages, P2M freelist is empty.\n");
-                return -ENOMEM;
-            }
-        }
-        else
-            break;
-
-        /* Check to see if we need to yield and try again */
-        if ( preempted && general_preempt_check() )
-        {
-            *preempted = true;
-            return -ERESTART;
-        }
-    }
-
-    return 0;
-}
-
-int arch_set_paging_mempool_size(struct domain *d, uint64_t size)
-{
-    unsigned long pages = size >> PAGE_SHIFT;
-    bool preempted = false;
-    int rc;
-
-    if ( (size & ~PAGE_MASK) ||          /* Non page-sized request? */
-         pages != (size >> PAGE_SHIFT) ) /* 32-bit overflow? */
-        return -EINVAL;
-
-    spin_lock(&d->arch.paging.lock);
-    rc = p2m_set_allocation(d, pages, &preempted);
-    spin_unlock(&d->arch.paging.lock);
-
-    ASSERT(preempted == (rc == -ERESTART));
-
-    return rc;
-}
-
-int p2m_teardown_allocation(struct domain *d)
-{
-    int ret = 0;
-    bool preempted = false;
-
-    spin_lock(&d->arch.paging.lock);
-    if ( d->arch.paging.p2m_total_pages != 0 )
-    {
-        ret = p2m_set_allocation(d, 0, &preempted);
-        if ( preempted )
-        {
-            spin_unlock(&d->arch.paging.lock);
-            return -ERESTART;
-        }
-        ASSERT(d->arch.paging.p2m_total_pages == 0);
-    }
-    spin_unlock(&d->arch.paging.lock);
-
-    return ret;
-}
-
 /* Unlock the flush and do a P2M TLB flush if necessary */
 void p2m_write_unlock(struct p2m_domain *p2m)
 {
@@ -199,1268 +33,66 @@ void p2m_write_unlock(struct p2m_domain *p2m)
     write_unlock(&p2m->lock);
 }
 
-void p2m_dump_info(struct domain *d)
-{
-    struct p2m_domain *p2m = p2m_get_hostp2m(d);
-
-    p2m_read_lock(p2m);
-    printk("p2m mappings for domain %d (vmid %d):\n",
-           d->domain_id, p2m->vmid);
-    BUG_ON(p2m->stats.mappings[0] || p2m->stats.shattered[0]);
-    printk("  1G mappings: %ld (shattered %ld)\n",
-           p2m->stats.mappings[1], p2m->stats.shattered[1]);
-    printk("  2M mappings: %ld (shattered %ld)\n",
-           p2m->stats.mappings[2], p2m->stats.shattered[2]);
-    printk("  4K mappings: %ld\n", p2m->stats.mappings[3]);
-    p2m_read_unlock(p2m);
-}
-
 void memory_type_changed(struct domain *d)
 {
 }
 
-void dump_p2m_lookup(struct domain *d, paddr_t addr)
-{
-    struct p2m_domain *p2m = p2m_get_hostp2m(d);
-
-    printk("dom%d IPA 0x%"PRIpaddr"\n", d->domain_id, addr);
-
-    printk("P2M @ %p mfn:%#"PRI_mfn"\n",
-           p2m->root, mfn_x(page_to_mfn(p2m->root)));
-
-    dump_pt_walk(page_to_maddr(p2m->root), addr,
-                 P2M_ROOT_LEVEL, P2M_ROOT_PAGES);
-}
-
-/*
- * p2m_save_state and p2m_restore_state work in pair to workaround
- * ARM64_WORKAROUND_AT_SPECULATE. p2m_save_state will set-up VTTBR to
- * point to the empty page-tables to stop allocating TLB entries.
- */
-void p2m_save_state(struct vcpu *p)
-{
-    p->arch.sctlr = READ_SYSREG(SCTLR_EL1);
-
-    if ( cpus_have_const_cap(ARM64_WORKAROUND_AT_SPECULATE) )
-    {
-        WRITE_SYSREG64(generate_vttbr(INVALID_VMID, empty_root_mfn), VTTBR_EL2);
-        /*
-         * Ensure VTTBR_EL2 is correctly synchronized so we can restore
-         * the next vCPU context without worrying about AT instruction
-         * speculation.
-         */
-        isb();
-    }
-}
-
-void p2m_restore_state(struct vcpu *n)
-{
-    struct p2m_domain *p2m = p2m_get_hostp2m(n->domain);
-    uint8_t *last_vcpu_ran;
-
-    if ( is_idle_vcpu(n) )
-        return;
-
-    WRITE_SYSREG(n->arch.sctlr, SCTLR_EL1);
-    WRITE_SYSREG(n->arch.hcr_el2, HCR_EL2);
-
-    /*
-     * ARM64_WORKAROUND_AT_SPECULATE: VTTBR_EL2 should be restored after all
-     * registers associated to EL1/EL0 translations regime have been
-     * synchronized.
-     */
-    asm volatile(ALTERNATIVE("nop", "isb", ARM64_WORKAROUND_AT_SPECULATE));
-    WRITE_SYSREG64(p2m->vttbr, VTTBR_EL2);
-
-    last_vcpu_ran = &p2m->last_vcpu_ran[smp_processor_id()];
-
-    /*
-     * While we are restoring an out-of-context translation regime
-     * we still need to ensure:
-     *  - VTTBR_EL2 is synchronized before flushing the TLBs
-     *  - All registers for EL1 are synchronized before executing an AT
-     *  instructions targeting S1/S2.
-     */
-    isb();
-
-    /*
-     * Flush local TLB for the domain to prevent wrong TLB translation
-     * when running multiple vCPU of the same domain on a single pCPU.
-     */
-    if ( *last_vcpu_ran != INVALID_VCPU_ID && *last_vcpu_ran != n->vcpu_id )
-        flush_guest_tlb_local();
-
-    *last_vcpu_ran = n->vcpu_id;
-}
-
-/*
- * Force a synchronous P2M TLB flush.
- *
- * Must be called with the p2m lock held.
- */
-static void p2m_force_tlb_flush_sync(struct p2m_domain *p2m)
-{
-    unsigned long flags = 0;
-    uint64_t ovttbr;
-
-    ASSERT(p2m_is_write_locked(p2m));
-
-    /*
-     * ARM only provides an instruction to flush TLBs for the current
-     * VMID. So switch to the VTTBR of a given P2M if different.
-     */
-    ovttbr = READ_SYSREG64(VTTBR_EL2);
-    if ( ovttbr != p2m->vttbr )
-    {
-        uint64_t vttbr;
-
-        local_irq_save(flags);
-
-        /*
-         * ARM64_WORKAROUND_AT_SPECULATE: We need to stop AT to allocate
-         * TLBs entries because the context is partially modified. We
-         * only need the VMID for flushing the TLBs, so we can generate
-         * a new VTTBR with the VMID to flush and the empty root table.
-         */
-        if ( !cpus_have_const_cap(ARM64_WORKAROUND_AT_SPECULATE) )
-            vttbr = p2m->vttbr;
-        else
-            vttbr = generate_vttbr(p2m->vmid, empty_root_mfn);
-
-        WRITE_SYSREG64(vttbr, VTTBR_EL2);
-
-        /* Ensure VTTBR_EL2 is synchronized before flushing the TLBs */
-        isb();
-    }
-
-    flush_guest_tlb();
-
-    if ( ovttbr != READ_SYSREG64(VTTBR_EL2) )
-    {
-        WRITE_SYSREG64(ovttbr, VTTBR_EL2);
-        /* Ensure VTTBR_EL2 is back in place before continuing. */
-        isb();
-        local_irq_restore(flags);
-    }
-
-    p2m->need_flush = false;
-}
-
-void p2m_tlb_flush_sync(struct p2m_domain *p2m)
-{
-    if ( p2m->need_flush )
-        p2m_force_tlb_flush_sync(p2m);
-}
-
-/*
- * Find and map the root page table. The caller is responsible for
- * unmapping the table.
- *
- * The function will return NULL if the offset of the root table is
- * invalid.
- */
-static lpae_t *p2m_get_root_pointer(struct p2m_domain *p2m,
-                                    gfn_t gfn)
-{
-    unsigned long root_table;
-
-    /*
-     * While the root table index is the offset from the previous level,
-     * we can't use (P2M_ROOT_LEVEL - 1) because the root level might be
-     * 0. Yet we still want to check if all the unused bits are zeroed.
-     */
-    root_table = gfn_x(gfn) >> (XEN_PT_LEVEL_ORDER(P2M_ROOT_LEVEL) +
-                                XEN_PT_LPAE_SHIFT);
-    if ( root_table >= P2M_ROOT_PAGES )
-        return NULL;
-
-    return __map_domain_page(p2m->root + root_table);
-}
-
-/*
- * Lookup the MFN corresponding to a domain's GFN.
- * Lookup mem access in the ratrix tree.
- * The entries associated to the GFN is considered valid.
- */
-static p2m_access_t p2m_mem_access_radix_get(struct p2m_domain *p2m, gfn_t gfn)
-{
-    void *ptr;
-
-    if ( !p2m->mem_access_enabled )
-        return p2m->default_access;
-
-    ptr = radix_tree_lookup(&p2m->mem_access_settings, gfn_x(gfn));
-    if ( !ptr )
-        return p2m_access_rwx;
-    else
-        return radix_tree_ptr_to_int(ptr);
-}
-
-/*
- * In the case of the P2M, the valid bit is used for other purpose. Use
- * the type to check whether an entry is valid.
- */
-static inline bool p2m_is_valid(lpae_t pte)
-{
-    return pte.p2m.type != p2m_invalid;
-}
-
-/*
- * lpae_is_* helpers don't check whether the valid bit is set in the
- * PTE. Provide our own overlay to check the valid bit.
- */
-static inline bool p2m_is_mapping(lpae_t pte, unsigned int level)
-{
-    return p2m_is_valid(pte) && lpae_is_mapping(pte, level);
-}
-
-static inline bool p2m_is_superpage(lpae_t pte, unsigned int level)
-{
-    return p2m_is_valid(pte) && lpae_is_superpage(pte, level);
-}
-
-#define GUEST_TABLE_MAP_FAILED 0
-#define GUEST_TABLE_SUPER_PAGE 1
-#define GUEST_TABLE_NORMAL_PAGE 2
-
-static int p2m_create_table(struct p2m_domain *p2m, lpae_t *entry);
-
-/*
- * Take the currently mapped table, find the corresponding GFN entry,
- * and map the next table, if available. The previous table will be
- * unmapped if the next level was mapped (e.g GUEST_TABLE_NORMAL_PAGE
- * returned).
- *
- * The read_only parameters indicates whether intermediate tables should
- * be allocated when not present.
- *
- * Return values:
- *  GUEST_TABLE_MAP_FAILED: Either read_only was set and the entry
- *  was empty, or allocating a new page failed.
- *  GUEST_TABLE_NORMAL_PAGE: next level mapped normally
- *  GUEST_TABLE_SUPER_PAGE: The next entry points to a superpage.
- */
-static int p2m_next_level(struct p2m_domain *p2m, bool read_only,
-                          unsigned int level, lpae_t **table,
-                          unsigned int offset)
-{
-    lpae_t *entry;
-    int ret;
-    mfn_t mfn;
-
-    entry = *table + offset;
-
-    if ( !p2m_is_valid(*entry) )
-    {
-        if ( read_only )
-            return GUEST_TABLE_MAP_FAILED;
-
-        ret = p2m_create_table(p2m, entry);
-        if ( ret )
-            return GUEST_TABLE_MAP_FAILED;
-    }
-
-    /* The function p2m_next_level is never called at the 3rd level */
-    ASSERT(level < 3);
-    if ( p2m_is_mapping(*entry, level) )
-        return GUEST_TABLE_SUPER_PAGE;
-
-    mfn = lpae_get_mfn(*entry);
-
-    unmap_domain_page(*table);
-    *table = map_domain_page(mfn);
-
-    return GUEST_TABLE_NORMAL_PAGE;
-}
-
-/*
- * Get the details of a given gfn.
- *
- * If the entry is present, the associated MFN will be returned and the
- * access and type filled up. The page_order will correspond to the
- * order of the mapping in the page table (i.e it could be a superpage).
- *
- * If the entry is not present, INVALID_MFN will be returned and the
- * page_order will be set according to the order of the invalid range.
- *
- * valid will contain the value of bit[0] (e.g valid bit) of the
- * entry.
- */
-mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
-                    p2m_type_t *t, p2m_access_t *a,
-                    unsigned int *page_order,
-                    bool *valid)
-{
-    paddr_t addr = gfn_to_gaddr(gfn);
-    unsigned int level = 0;
-    lpae_t entry, *table;
-    int rc;
-    mfn_t mfn = INVALID_MFN;
-    p2m_type_t _t;
-    DECLARE_OFFSETS(offsets, addr);
-
-    ASSERT(p2m_is_locked(p2m));
-    BUILD_BUG_ON(THIRD_MASK != PAGE_MASK);
-
-    /* Allow t to be NULL */
-    t = t ?: &_t;
-
-    *t = p2m_invalid;
-
-    if ( valid )
-        *valid = false;
-
-    /* XXX: Check if the mapping is lower than the mapped gfn */
-
-    /* This gfn is higher than the highest the p2m map currently holds */
-    if ( gfn_x(gfn) > gfn_x(p2m->max_mapped_gfn) )
-    {
-        for ( level = P2M_ROOT_LEVEL; level < 3; level++ )
-            if ( (gfn_x(gfn) & (XEN_PT_LEVEL_MASK(level) >> PAGE_SHIFT)) >
-                 gfn_x(p2m->max_mapped_gfn) )
-                break;
-
-        goto out;
-    }
-
-    table = p2m_get_root_pointer(p2m, gfn);
-
-    /*
-     * the table should always be non-NULL because the gfn is below
-     * p2m->max_mapped_gfn and the root table pages are always present.
-     */
-    if ( !table )
-    {
-        ASSERT_UNREACHABLE();
-        level = P2M_ROOT_LEVEL;
-        goto out;
-    }
-
-    for ( level = P2M_ROOT_LEVEL; level < 3; level++ )
-    {
-        rc = p2m_next_level(p2m, true, level, &table, offsets[level]);
-        if ( rc == GUEST_TABLE_MAP_FAILED )
-            goto out_unmap;
-        else if ( rc != GUEST_TABLE_NORMAL_PAGE )
-            break;
-    }
-
-    entry = table[offsets[level]];
-
-    if ( p2m_is_valid(entry) )
-    {
-        *t = entry.p2m.type;
-
-        if ( a )
-            *a = p2m_mem_access_radix_get(p2m, gfn);
-
-        mfn = lpae_get_mfn(entry);
-        /*
-         * The entry may point to a superpage. Find the MFN associated
-         * to the GFN.
-         */
-        mfn = mfn_add(mfn,
-                      gfn_x(gfn) & ((1UL << XEN_PT_LEVEL_ORDER(level)) - 1));
-
-        if ( valid )
-            *valid = lpae_is_valid(entry);
-    }
-
-out_unmap:
-    unmap_domain_page(table);
-
-out:
-    if ( page_order )
-        *page_order = XEN_PT_LEVEL_ORDER(level);
-
-    return mfn;
-}
-
-mfn_t p2m_lookup(struct domain *d, gfn_t gfn, p2m_type_t *t)
-{
-    mfn_t mfn;
-    struct p2m_domain *p2m = p2m_get_hostp2m(d);
-
-    p2m_read_lock(p2m);
-    mfn = p2m_get_entry(p2m, gfn, t, NULL, NULL, NULL);
-    p2m_read_unlock(p2m);
-
-    return mfn;
-}
-
-struct page_info *p2m_get_page_from_gfn(struct domain *d, gfn_t gfn,
-                                        p2m_type_t *t)
-{
-    struct page_info *page;
-    p2m_type_t p2mt;
-    mfn_t mfn = p2m_lookup(d, gfn, &p2mt);
-
-    if ( t )
-        *t = p2mt;
-
-    if ( !p2m_is_any_ram(p2mt) )
-        return NULL;
-
-    if ( !mfn_valid(mfn) )
-        return NULL;
-
-    page = mfn_to_page(mfn);
-
-    /*
-     * get_page won't work on foreign mapping because the page doesn't
-     * belong to the current domain.
-     */
-    if ( p2m_is_foreign(p2mt) )
-    {
-        struct domain *fdom = page_get_owner_and_reference(page);
-        ASSERT(fdom != NULL);
-        ASSERT(fdom != d);
-        return page;
-    }
-
-    return get_page(page, d) ? page : NULL;
-}
-
-int guest_physmap_mark_populate_on_demand(struct domain *d,
-                                          unsigned long gfn,
-                                          unsigned int order)
-{
-    return -ENOSYS;
-}
-
-unsigned long p2m_pod_decrease_reservation(struct domain *d, gfn_t gfn,
-                                           unsigned int order)
-{
-    return 0;
-}
-
-static void p2m_set_permission(lpae_t *e, p2m_type_t t, p2m_access_t a)
-{
-    /* First apply type permissions */
-    switch ( t )
-    {
-    case p2m_ram_rw:
-        e->p2m.xn = 0;
-        e->p2m.write = 1;
-        break;
-
-    case p2m_ram_ro:
-        e->p2m.xn = 0;
-        e->p2m.write = 0;
-        break;
-
-    case p2m_iommu_map_rw:
-    case p2m_map_foreign_rw:
-    case p2m_grant_map_rw:
-    case p2m_mmio_direct_dev:
-    case p2m_mmio_direct_nc:
-    case p2m_mmio_direct_c:
-        e->p2m.xn = 1;
-        e->p2m.write = 1;
-        break;
-
-    case p2m_iommu_map_ro:
-    case p2m_map_foreign_ro:
-    case p2m_grant_map_ro:
-    case p2m_invalid:
-        e->p2m.xn = 1;
-        e->p2m.write = 0;
-        break;
-
-    case p2m_max_real_type:
-        BUG();
-        break;
-    }
-
-    /* Then restrict with access permissions */
-    switch ( a )
-    {
-    case p2m_access_rwx:
-        break;
-    case p2m_access_wx:
-        e->p2m.read = 0;
-        break;
-    case p2m_access_rw:
-        e->p2m.xn = 1;
-        break;
-    case p2m_access_w:
-        e->p2m.read = 0;
-        e->p2m.xn = 1;
-        break;
-    case p2m_access_rx:
-    case p2m_access_rx2rw:
-        e->p2m.write = 0;
-        break;
-    case p2m_access_x:
-        e->p2m.write = 0;
-        e->p2m.read = 0;
-        break;
-    case p2m_access_r:
-        e->p2m.write = 0;
-        e->p2m.xn = 1;
-        break;
-    case p2m_access_n:
-    case p2m_access_n2rwx:
-        e->p2m.read = e->p2m.write = 0;
-        e->p2m.xn = 1;
-        break;
-    }
-}
-
-static lpae_t mfn_to_p2m_entry(mfn_t mfn, p2m_type_t t, p2m_access_t a)
-{
-    /*
-     * sh, xn and write bit will be defined in the following switches
-     * based on mattr and t.
-     */
-    lpae_t e = (lpae_t) {
-        .p2m.af = 1,
-        .p2m.read = 1,
-        .p2m.table = 1,
-        .p2m.valid = 1,
-        .p2m.type = t,
-    };
-
-    BUILD_BUG_ON(p2m_max_real_type > (1 << 4));
-
-    switch ( t )
-    {
-    case p2m_mmio_direct_dev:
-        e.p2m.mattr = MATTR_DEV;
-        e.p2m.sh = LPAE_SH_OUTER;
-        break;
-
-    case p2m_mmio_direct_c:
-        e.p2m.mattr = MATTR_MEM;
-        e.p2m.sh = LPAE_SH_OUTER;
-        break;
-
-    /*
-     * ARM ARM: Overlaying the shareability attribute (DDI
-     * 0406C.b B3-1376 to 1377)
-     *
-     * A memory region with a resultant memory type attribute of Normal,
-     * and a resultant cacheability attribute of Inner Non-cacheable,
-     * Outer Non-cacheable, must have a resultant shareability attribute
-     * of Outer Shareable, otherwise shareability is UNPREDICTABLE.
-     *
-     * On ARMv8 shareability is ignored and explicitly treated as Outer
-     * Shareable for Normal Inner Non_cacheable, Outer Non-cacheable.
-     * See the note for table D4-40, in page 1788 of the ARM DDI 0487A.j.
-     */
-    case p2m_mmio_direct_nc:
-        e.p2m.mattr = MATTR_MEM_NC;
-        e.p2m.sh = LPAE_SH_OUTER;
-        break;
-
-    default:
-        e.p2m.mattr = MATTR_MEM;
-        e.p2m.sh = LPAE_SH_INNER;
-    }
-
-    p2m_set_permission(&e, t, a);
-
-    ASSERT(!(mfn_to_maddr(mfn) & ~PADDR_MASK));
-
-    lpae_set_mfn(e, mfn);
-
-    return e;
-}
-
-/* Generate table entry with correct attributes. */
-static lpae_t page_to_p2m_table(struct page_info *page)
-{
-    /*
-     * The access value does not matter because the hardware will ignore
-     * the permission fields for table entry.
-     *
-     * We use p2m_ram_rw so the entry has a valid type. This is important
-     * for p2m_is_valid() to return valid on table entries.
-     */
-    return mfn_to_p2m_entry(page_to_mfn(page), p2m_ram_rw, p2m_access_rwx);
-}
-
-static inline void p2m_write_pte(lpae_t *p, lpae_t pte, bool clean_pte)
-{
-    write_pte(p, pte);
-    if ( clean_pte )
-        clean_dcache(*p);
-}
-
-static inline void p2m_remove_pte(lpae_t *p, bool clean_pte)
-{
-    lpae_t pte;
-
-    memset(&pte, 0x00, sizeof(pte));
-    p2m_write_pte(p, pte, clean_pte);
-}
-
-/* Allocate a new page table page and hook it in via the given entry. */
-static int p2m_create_table(struct p2m_domain *p2m, lpae_t *entry)
-{
-    struct page_info *page;
-    lpae_t *p;
-
-    ASSERT(!p2m_is_valid(*entry));
-
-    page = p2m_alloc_page(p2m->domain);
-    if ( page == NULL )
-        return -ENOMEM;
-
-    page_list_add(page, &p2m->pages);
-
-    p = __map_domain_page(page);
-    clear_page(p);
-
-    if ( p2m->clean_pte )
-        clean_dcache_va_range(p, PAGE_SIZE);
-
-    unmap_domain_page(p);
-
-    p2m_write_pte(entry, page_to_p2m_table(page), p2m->clean_pte);
-
-    return 0;
-}
-
-static int p2m_mem_access_radix_set(struct p2m_domain *p2m, gfn_t gfn,
-                                    p2m_access_t a)
-{
-    int rc;
-
-    if ( !p2m->mem_access_enabled )
-        return 0;
-
-    if ( p2m_access_rwx == a )
-    {
-        radix_tree_delete(&p2m->mem_access_settings, gfn_x(gfn));
-        return 0;
-    }
-
-    rc = radix_tree_insert(&p2m->mem_access_settings, gfn_x(gfn),
-                           radix_tree_int_to_ptr(a));
-    if ( rc == -EEXIST )
-    {
-        /* If a setting already exists, change it to the new one */
-        radix_tree_replace_slot(
-            radix_tree_lookup_slot(
-                &p2m->mem_access_settings, gfn_x(gfn)),
-            radix_tree_int_to_ptr(a));
-        rc = 0;
-    }
-
-    return rc;
-}
-
-/*
- * Put any references on the single 4K page referenced by pte.
- * TODO: Handle superpages, for now we only take special references for leaf
- * pages (specifically foreign ones, which can't be super mapped today).
- */
-static void p2m_put_l3_page(const lpae_t pte)
-{
-    mfn_t mfn = lpae_get_mfn(pte);
-
-    ASSERT(p2m_is_valid(pte));
-
-    /*
-     * TODO: Handle other p2m types
-     *
-     * It's safe to do the put_page here because page_alloc will
-     * flush the TLBs if the page is reallocated before the end of
-     * this loop.
-     */
-    if ( p2m_is_foreign(pte.p2m.type) )
-    {
-        ASSERT(mfn_valid(mfn));
-        put_page(mfn_to_page(mfn));
-    }
-    /* Detect the xenheap page and mark the stored GFN as invalid. */
-    else if ( p2m_is_ram(pte.p2m.type) && is_xen_heap_mfn(mfn) )
-        page_set_xenheap_gfn(mfn_to_page(mfn), INVALID_GFN);
-}
-
-/* Free lpae sub-tree behind an entry */
-static void p2m_free_entry(struct p2m_domain *p2m,
-                           lpae_t entry, unsigned int level)
-{
-    unsigned int i;
-    lpae_t *table;
-    mfn_t mfn;
-    struct page_info *pg;
-
-    /* Nothing to do if the entry is invalid. */
-    if ( !p2m_is_valid(entry) )
-        return;
-
-    if ( p2m_is_superpage(entry, level) || (level == 3) )
-    {
-#ifdef CONFIG_IOREQ_SERVER
-        /*
-         * If this gets called then either the entry was replaced by an entry
-         * with a different base (valid case) or the shattering of a superpage
-         * has failed (error case).
-         * So, at worst, the spurious mapcache invalidation might be sent.
-         */
-        if ( p2m_is_ram(entry.p2m.type) &&
-             domain_has_ioreq_server(p2m->domain) )
-            ioreq_request_mapcache_invalidate(p2m->domain);
-#endif
-
-        p2m->stats.mappings[level]--;
-        /* Nothing to do if the entry is a super-page. */
-        if ( level == 3 )
-            p2m_put_l3_page(entry);
-        return;
-    }
-
-    table = map_domain_page(lpae_get_mfn(entry));
-    for ( i = 0; i < XEN_PT_LPAE_ENTRIES; i++ )
-        p2m_free_entry(p2m, *(table + i), level + 1);
-
-    unmap_domain_page(table);
-
-    /*
-     * Make sure all the references in the TLB have been removed before
-     * freing the intermediate page table.
-     * XXX: Should we defer the free of the page table to avoid the
-     * flush?
-     */
-    p2m_tlb_flush_sync(p2m);
-
-    mfn = lpae_get_mfn(entry);
-    ASSERT(mfn_valid(mfn));
-
-    pg = mfn_to_page(mfn);
-
-    page_list_del(pg, &p2m->pages);
-    p2m_free_page(p2m->domain, pg);
-}
-
-static bool p2m_split_superpage(struct p2m_domain *p2m, lpae_t *entry,
-                                unsigned int level, unsigned int target,
-                                const unsigned int *offsets)
-{
-    struct page_info *page;
-    unsigned int i;
-    lpae_t pte, *table;
-    bool rv = true;
-
-    /* Convenience aliases */
-    mfn_t mfn = lpae_get_mfn(*entry);
-    unsigned int next_level = level + 1;
-    unsigned int level_order = XEN_PT_LEVEL_ORDER(next_level);
-
-    /*
-     * This should only be called with target != level and the entry is
-     * a superpage.
-     */
-    ASSERT(level < target);
-    ASSERT(p2m_is_superpage(*entry, level));
-
-    page = p2m_alloc_page(p2m->domain);
-    if ( !page )
-        return false;
-
-    page_list_add(page, &p2m->pages);
-    table = __map_domain_page(page);
-
-    /*
-     * We are either splitting a first level 1G page into 512 second level
-     * 2M pages, or a second level 2M page into 512 third level 4K pages.
-     */
-    for ( i = 0; i < XEN_PT_LPAE_ENTRIES; i++ )
-    {
-        lpae_t *new_entry = table + i;
-
-        /*
-         * Use the content of the superpage entry and override


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 21:34:24 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 21:34:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.638283.994685 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5YO0-0005hc-UU; Tue, 21 Nov 2023 21:34:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 638283.994685; Tue, 21 Nov 2023 21: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 1r5YO0-0005hU-Rs; Tue, 21 Nov 2023 21:34:24 +0000
Received: by outflank-mailman (input) for mailman id 638283;
 Tue, 21 Nov 2023 21: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 1r5YNz-0005hI-4l
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21: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 1r5YNz-0003aD-40
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:34:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5YNz-0005rv-2f
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21: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=B2wmuGaJw1+yhoD5fh3Dd7YQC7fkYw8R2avs6PTZTqE=; b=f8gRK+IiaEraNNy6b1bnVHIVOe
	hvXSJdeCqD9G3zqH+QBBDBmKFTgMj+5Wy3vfGC/guom16glkWdDFW2vrlrZ797k4p+0bmoS8QdCmc
	8KiMzKVg/QdXOw45ArhEOBt/WpiFy8K+XYWE1DdmUD5EpVSFCnRR0sTj/YqbFJOVpTaM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm32: head: Introduce enable_{boot,secondary}_cpu_mm()
Message-Id: <E1r5YNz-0005rv-2f@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 21:34:23 +0000

commit a9f931e96f2101aa851636fb0a274acccee887dd
Author:     Ayan Kumar Halder <ayan.kumar.halder@amd.com>
AuthorDate: Mon Nov 20 14:48:58 2023 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Nov 20 19:11:18 2023 +0000

    xen/arm32: head: Introduce enable_{boot,secondary}_cpu_mm()
    
    All the MMU related functionality have been clubbed together in
    enable_boot_cpu_mm() for booting primary cpu and enable_secondary_cpu_mm() for
    booting secondary cpus.
    This is done in preparation for moving the code related to MMU in MMU specific
    file and in order to support non MMU cpus in future.
    
    This is based on d2f8df5b3ede ("xen/arm64: head.S: Introduce enable_{boot,secondary}_cpu_mm()").
    
    Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/arm32/head.S | 102 ++++++++++++++++++++++++++++++++++++----------
 1 file changed, 80 insertions(+), 22 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index 3011fb34aa..52fbb180ef 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -201,13 +201,11 @@ past_zImage:
 
         bl    check_cpu_mode
         bl    cpu_init
-        bl    create_page_tables
 
-        /* Address in the runtime mapping to jump to after the MMU is enabled */
         mov_w lr, primary_switched
-        b     enable_mmu
+        b     enable_boot_cpu_mm
+
 primary_switched:
-        bl    setup_fixmap
 #ifdef CONFIG_EARLY_PRINTK
         /* Use a virtual address to access the UART. */
         mov_w r11, EARLY_UART_VIRTUAL_ADDRESS
@@ -249,27 +247,11 @@ GLOBAL(init_secondary)
 #endif
         bl    check_cpu_mode
         bl    cpu_init
-        bl    create_page_tables
 
-        /* Address in the runtime mapping to jump to after the MMU is enabled */
         mov_w lr, secondary_switched
-        b     enable_mmu
-secondary_switched:
-        /*
-         * Non-boot CPUs need to move on to the proper pagetables, which were
-         * setup in prepare_secondary_mm.
-         *
-         * XXX: This is not compliant with the Arm Arm.
-         */
-        mov_w r4, init_ttbr          /* VA of HTTBR value stashed by CPU 0 */
-        ldrd  r4, r5, [r4]           /* Actual value */
-        dsb
-        mcrr  CP64(r4, r5, HTTBR)
-        dsb
-        isb
-        flush_xen_tlb_local r0
-        pt_enforce_wxn r0
+        b     enable_secondary_cpu_mm
 
+secondary_switched:
 #ifdef CONFIG_EARLY_PRINTK
         /* Use a virtual address to access the UART. */
         mov_w r11, EARLY_UART_VIRTUAL_ADDRESS
@@ -692,6 +674,82 @@ ready_to_switch:
         mov   pc, lr
 ENDPROC(switch_to_runtime_mapping)
 
+/*
+ * Enable mm (turn on the data cache and the MMU) for secondary CPUs.
+ * The function will return to the virtual address provided in LR (e.g. the
+ * runtime mapping).
+ *
+ * Inputs:
+ *   r9 : paddr(start)
+ *   r10: phys offset
+ *   lr : Virtual address to return to.
+ *
+ * Output:
+ *   r12: Was a temporary mapping created?
+ *
+ * Clobbers r0 - r6
+ */
+enable_secondary_cpu_mm:
+        mov   r6, lr
+
+        bl    create_page_tables
+
+        /* Address in the runtime mapping to jump to after the MMU is enabled */
+        mov_w lr, 1f
+        b     enable_mmu
+1:
+        /*
+         * Non-boot CPUs need to move on to the proper pagetables, which were
+         * setup in prepare_secondary_mm.
+         *
+         * XXX: This is not compliant with the Arm Arm.
+         */
+        mov_w r4, init_ttbr          /* VA of HTTBR value stashed by CPU 0 */
+        ldrd  r4, r5, [r4]           /* Actual value */
+        dsb
+        mcrr  CP64(r4, r5, HTTBR)
+        dsb
+        isb
+        flush_xen_tlb_local r0
+        pt_enforce_wxn r0
+
+        /* Return to the virtual address requested by the caller. */
+        mov   pc, r6
+ENDPROC(enable_secondary_cpu_mm)
+
+/*
+ * Enable mm (turn on the data cache and the MMU) for the boot CPU.
+ * The function will return to the virtual address provided in LR (e.g. the
+ * runtime mapping).
+ *
+ * Inputs:
+ *   r9 : paddr(start)
+ *   r10: phys offset
+ *   lr : Virtual address to return to.
+ *
+ * Output:
+ *   r12: Was a temporary mapping created?
+ *
+ * Clobbers r0 - r6
+ */
+enable_boot_cpu_mm:
+        mov   r6, lr
+
+        bl    create_page_tables
+
+        /* Address in the runtime mapping to jump to after the MMU is enabled */
+        mov_w lr, 1f
+        b     enable_mmu
+1:
+        mov   lr, r6
+
+        /*
+         * Prepare the fixmap. The function will return to the virtual address
+         * requested by the caller.
+         */
+        b     setup_fixmap
+ENDPROC(enable_boot_cpu_mm)
+
 /*
  * Remove the 1:1 map from the page-tables. It is not easy to keep track
  * where the 1:1 map was mapped, so we will look for the top-level entry
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 21 21:34:35 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Nov 2023 21:34:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.638284.994689 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r5YOB-0005kG-06; Tue, 21 Nov 2023 21:34:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 638284.994689; Tue, 21 Nov 2023 21: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 1r5YOA-0005k7-TL; Tue, 21 Nov 2023 21:34:34 +0000
Received: by outflank-mailman (input) for mailman id 638284;
 Tue, 21 Nov 2023 21: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 1r5YO9-0005jv-7t
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21: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 1r5YO9-0003aK-72
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r5YO9-0005so-67
 for xen-changelog@lists.xenproject.org; Tue, 21 Nov 2023 21: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=hkv5S49vWDcQ0IDqLED3/xG3EXCaAe0Y9CDTFNTuJAY=; b=rtEFUfC+v8hzcstNoJBNKomEqP
	eh7Yh5E+tvhs+OOOtJg6fEklQTigvIoexhJ4cJ4i8/aATkOtXpgKSta8I9P5rIfKwOU8cTmiXqXqr
	CYhYVk2PmUkIgQcHdZjUm2tbhglz5iP1v5/vjC7QS72xJQA4tfSsMbmKYV8EoYaHP/VY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm32: head Split and move MMU-specific head.S to mmu/head.S
Message-Id: <E1r5YO9-0005so-67@xenbits.xenproject.org>
Date: Tue, 21 Nov 2023 21:34:33 +0000

commit fa2da5bce90b3777aa7a323e1cf201c97b56d278
Author:     Ayan Kumar Halder <ayan.kumar.halder@amd.com>
AuthorDate: Mon Nov 20 14:48:59 2023 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Nov 20 19:11:18 2023 +0000

    xen/arm32: head Split and move MMU-specific head.S to mmu/head.S
    
    The MMU specific code in head.S will not be used on MPU systems.
    Instead of introducing more #ifdefs which will bring complexity
    to the code, move MMU related code to mmu/head.S and keep common
    code in head.S. Few notes while moving:
     - As "fail" in original head.S is very simple and this name is too
       easy to be conflicted, duplicate it in mmu/head.S instead of
       exporting it.
     - Realigned ".macro ret" so that the alignment matches to the other
       macros.
     - Rename puts to asm_puts, putn to asm_putn (this denotes that the
       macros are used within the context of assembly only).
     - Use ENTRY() for enable_secondary_cpu_mm, enable_boot_cpu_mm,
       setup_fixmap, asm_puts, asm_putn  as they will be used externally.
     - Removed early_puts() function definition when EARLY_PRINTK is not
       enabled.
    
    Also move the assembly macros shared by head.S and mmu/head.S to
    macros.h.
    
    This is based on 6734327d76be ("xen/arm64: Split and move MMU-specific head.S to mmu/head.S").
    
    Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/arm32/head.S               | 637 +-------------------------------
 xen/arch/arm/arm32/mmu/Makefile         |   1 +
 xen/arch/arm/arm32/mmu/head.S           | 575 ++++++++++++++++++++++++++++
 xen/arch/arm/include/asm/arm32/macros.h |  59 ++-
 4 files changed, 642 insertions(+), 630 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index 52fbb180ef..34ab14a9e2 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -22,86 +22,10 @@
 
 #define ZIMAGE_MAGIC_NUMBER 0x016f2818
 
-#define PT_PT     0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */
-#define PT_MEM    0xf7d /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=0 P=1 */
-#define PT_MEM_L3 0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */
-#define PT_DEV    0xe71 /* nG=1 AF=1 SH=10 AP=01 NS=1 ATTR=100 T=0 P=1 */
-#define PT_DEV_L3 0xe73 /* nG=1 AF=1 SH=10 AP=01 NS=1 ATTR=100 T=1 P=1 */
-
-#define PT_UPPER(x) (PT_##x & 0xf00)
-#define PT_LOWER(x) (PT_##x & 0x0ff)
-
-/* Convenience defines to get slot used by Xen mapping. */
-#define XEN_FIRST_SLOT      first_table_offset(XEN_VIRT_START)
-#define XEN_SECOND_SLOT     second_table_offset(XEN_VIRT_START)
-
-/* Offset between the early boot xen mapping and the runtime xen mapping */
-#define XEN_TEMPORARY_OFFSET      (TEMPORARY_XEN_VIRT_START - XEN_VIRT_START)
-
 #if defined(CONFIG_EARLY_PRINTK) && defined(CONFIG_EARLY_PRINTK_INC)
 #include CONFIG_EARLY_PRINTK_INC
 #endif
 
-/*
- * Move an immediate constant into a 32-bit register using movw/movt
- * instructions.
- */
-.macro mov_w reg, word
-        movw  \reg, #:lower16:\word
-        movt  \reg, #:upper16:\word
-.endm
-
-/*
- * Pseudo-op for PC relative adr <reg>, <symbol> where <symbol> is
- * within the range +/- 4GB of the PC.
- *
- * @dst: destination register
- * @sym: name of the symbol
- */
-.macro adr_l, dst, sym
-        mov_w \dst, \sym - .Lpc\@
-        .set  .Lpc\@, .+ 8          /* PC bias */
-        add   \dst, \dst, pc
-.endm
-
-.macro load_paddr rb, sym
-        mov_w \rb, \sym
-        add   \rb, \rb, r10
-.endm
-
-/*
- * Flush local TLBs
- *
- * @tmp: Scratch register
- *
- * See asm/arm32/flushtlb.h for the explanation of the sequence.
- */
-.macro flush_xen_tlb_local tmp
-        dsb   nshst
-        mcr   CP32(\tmp, TLBIALLH)
-        dsb   nsh
-        isb
-.endm
-
-/*
- * Enforce Xen page-tables do not contain mapping that are both
- * Writable and eXecutables.
- *
- * This should be called on each secondary CPU.
- */
-.macro pt_enforce_wxn tmp
-        mrc   CP32(\tmp, HSCTLR)
-        orr   \tmp, \tmp, #SCTLR_Axx_ELx_WXN
-        dsb
-        mcr   CP32(\tmp, HSCTLR)
-        /*
-         * The TLBs may cache SCTLR_EL2.WXN. So ensure it is synchronized
-         * before flushing the TLBs.
-         */
-        isb
-        flush_xen_tlb_local \tmp
-.endm
-
 /*
  * Common register usage in this file:
  *   r0  -
@@ -121,38 +45,6 @@
  *   r14 - LR
  *   r15 - PC
  */
-#ifdef CONFIG_EARLY_PRINTK
-/*
- * Macro to print a string to the UART, if there is one.
- *
- * Clobbers r0 - r3
- */
-#define PRINT(_s)           \
-        mov   r3, lr       ;\
-        adr_l r0, 98f      ;\
-        bl    puts         ;\
-        mov   lr, r3       ;\
-        RODATA_STR(98, _s)
-
-/*
- * Macro to print the value of register \rb
- *
- * Clobbers r0 - r4
- */
-.macro print_reg rb
-        mov   r0, \rb
-        mov   r4, lr
-        bl    putn
-        mov   lr, r4
-.endm
-
-#else /* CONFIG_EARLY_PRINTK */
-#define PRINT(s)
-
-.macro print_reg rb
-.endm
-
-#endif /* !CONFIG_EARLY_PRINTK */
 
         .section .text.header, "ax", %progbits
         .arm
@@ -355,480 +247,6 @@ cpu_init_done:
         mov   pc, r5                        /* Return address is in r5 */
 ENDPROC(cpu_init)
 
-/*
- * Macro to find the slot number at a given page-table level
- *
- * slot:     slot computed
- * virt:     virtual address
- * lvl:      page-table level
- *
- * Note that ubxf is unpredictable when the end bit is above 32-bit. So we
- * can't use it for first level offset.
- */
-.macro get_table_slot, slot, virt, lvl
-    .if \lvl == 1
-        lsr   \slot, \virt, #XEN_PT_LEVEL_SHIFT(\lvl)
-    .else
-        ubfx  \slot, \virt, #XEN_PT_LEVEL_SHIFT(\lvl), #XEN_PT_LPAE_SHIFT
-    .endif
-.endm
-
-/*
- * Macro to create a page table entry in \ptbl to \tbl (physical
- * address)
- *
- * ptbl:    table symbol where the entry will be created
- * tbl:     physical address of the table to point to
- * virt:    virtual address
- * lvl:     page-table level
- *
- * Preserves \virt
- * Clobbers \tbl, r1 - r3
- *
- * Note that \tbl and \virt should be in a register other than r1 - r3
- */
-.macro create_table_entry_from_paddr, ptbl, tbl, virt, lvl
-        get_table_slot r1, \virt, \lvl  /* r1 := slot in \tbl */
-        lsl   r1, r1, #3                /* r1 := slot offset in \tbl */
-
-        movw  r2, #PT_PT             /* r2:r3 := right for linear PT */
-        orr   r2, r2, \tbl           /*           + \tbl paddr */
-        mov   r3, #0
-
-        adr_l \tbl, \ptbl            /* \tbl := (v,p)addr of \ptbl */
-
-        strd  r2, r3, [\tbl, r1]
-.endm
-
-
-/*
- * Macro to create a page table entry in \ptbl to \tbl (symbol)
- *
- * ptbl:    table symbol where the entry will be created
- * tbl:     table symbol to point to
- * virt:    virtual address
- * lvl:     page-table level
- *
- * Preserves \virt
- * Clobbers r1 - r4
- *
- * Also use r10 for the phys offset.
- *
- * Note that \virt should be in a register other than r1 - r4
- */
-.macro create_table_entry, ptbl, tbl, virt, lvl
-        load_paddr r4, \tbl
-        create_table_entry_from_paddr \ptbl, r4, \virt, \lvl
- .endm
-
-/*
- * Macro to create a mapping entry in \tbl to \paddr. Only mapping in 3rd
- * level table (i.e page granularity) is supported.
- *
- * ptbl:     table symbol where the entry will be created
- * virt:    virtual address
- * phys:    physical address
- * type:    mapping type. If not specified it will be normal memory (PT_MEM_L3)
- *
- * Preserves \virt, \phys
- * Clobbers r1 - r4
- *
- * Note that \virt and \paddr should be in other registers than r1 - r4
- * and be distinct.
- */
-.macro create_mapping_entry, ptbl, virt, phys, type=PT_MEM_L3
-        mov_w r2, XEN_PT_LPAE_ENTRY_MASK
-        lsr   r1, \virt, #THIRD_SHIFT
-        and   r1, r1, r2             /* r1 := slot in \tlb */
-        lsl   r1, r1, #3             /* r1 := slot offset in \tlb */
-
-        lsr   r4, \phys, #THIRD_SHIFT
-        lsl   r4, r4, #THIRD_SHIFT   /* r4 := PAGE_ALIGNED(phys) */
-
-        movw  r2, #\type             /* r2:r3 := right for section PT */
-        orr   r2, r2, r4             /*          + PAGE_ALIGNED(phys) */
-        mov   r3, #0
-
-        adr_l r4, \ptbl
-
-        strd  r2, r3, [r4, r1]
-.endm
-
-/*
- * Rebuild the boot pagetable's first-level entries. The structure
- * is described in mm.c.
- *
- * After the CPU enables paging it will add the fixmap mapping
- * to these page tables, however this may clash with the 1:1
- * mapping. So each CPU must rebuild the page tables here with
- * the 1:1 in place.
- *
- * Inputs:
- *   r9 : paddr(start)
- *   r10: phys offset
- *
- * Output:
- *   r12: Was a temporary mapping created?
- *
- * Clobbers r0 - r5
- */
-create_page_tables:
-        /* Prepare the page-tables for mapping Xen */
-        mov_w r0, XEN_VIRT_START
-
-        /*
-         * We need to use a stash register because
-         * create_table_entry_paddr() will clobber the register storing
-         * the physical address of the table to point to.
-         */
-        adr_l r5, boot_third
-        mov_w r4, XEN_VIRT_START
-.rept XEN_NR_ENTRIES(2)
-        mov   r0, r5                        /* r0 := paddr(l3 table) */
-        create_table_entry_from_paddr boot_second, r0, r4, 2
-        add   r4, r4, #XEN_PT_LEVEL_SIZE(2) /* r4 := Next vaddr */
-        add   r5, r5, #PAGE_SIZE            /* r5 := Next table */
-.endr
-
-        /*
-         * Find the size of Xen in pages and multiply by the size of a
-         * PTE. This will then be compared in the mapping loop below.
-         *
-         * Note the multiplication is just to avoid using an extra
-         * register/instruction per iteration.
-         */
-        mov_w r0, _start            /* r0 := vaddr(_start) */
-        mov_w r1, _end              /* r1 := vaddr(_end) */
-        sub   r0, r1, r0            /* r0 := effective size of Xen */
-        lsr   r0, r0, #PAGE_SHIFT   /* r0 := Number of pages for Xen */
-        lsl   r0, r0, #3            /* r0 := Number of pages * PTE size */
-
-        /* Setup boot_third: */
-        adr_l r4, boot_third
-
-        lsr   r2, r9, #THIRD_SHIFT  /* Base address for 4K mapping */
-        lsl   r2, r2, #THIRD_SHIFT
-        orr   r2, r2, #PT_UPPER(MEM_L3) /* r2:r3 := map */
-        orr   r2, r2, #PT_LOWER(MEM_L3)
-        mov   r3, #0x0
-
-        /* ... map of vaddr(start) in boot_third */
-        mov   r1, #0
-1:      strd  r2, r3, [r4, r1]       /* Map vaddr(start) */
-        add   r2, r2, #PAGE_SIZE     /* Next page */
-        add   r1, r1, #8             /* Next slot */
-        cmp   r1, r0                 /* Loop until we map all of Xen */
-        blo   1b
-
-        /*
-         * Setup the 1:1 mapping so we can turn the MMU on. Note that
-         * only the first page of Xen will be part of the 1:1 mapping.
-         */
-        create_table_entry boot_pgtable, boot_second_id, r9, 1
-        create_table_entry boot_second_id, boot_third_id, r9, 2
-        create_mapping_entry boot_third_id, r9, r9
-
-        /*
-         * Find the first slot used. If the slot is not the same
-         * as TEMPORARY_AREA_FIRST_SLOT, then we will want to switch
-         * to the temporary mapping before jumping to the runtime
-         * virtual mapping.
-         */
-        get_table_slot r1, r9, 1     /* r1 := first slot */
-        cmp   r1, #TEMPORARY_AREA_FIRST_SLOT
-        bne   use_temporary_mapping
-
-        mov_w r0, XEN_VIRT_START
-        create_table_entry boot_pgtable, boot_second, r0, 1
-        mov   r12, #0                /* r12 := temporary mapping not created */
-        mov   pc, lr
-
-use_temporary_mapping:
-        /*
-         * The identity mapping is not using the first slot
-         * TEMPORARY_AREA_FIRST_SLOT. Create a temporary mapping.
-         * See switch_to_runtime_mapping for more details.
-         */
-        PRINT("- Create temporary mapping -\r\n")
-
-        /* Map boot_second (cover Xen mappings) to the temporary 1st slot */
-        mov_w r0, TEMPORARY_XEN_VIRT_START
-        create_table_entry boot_pgtable, boot_second, r0, 1
-
-        mov   r12, #1                /* r12 := temporary mapping created */
-        mov   pc, lr
-ENDPROC(create_page_tables)
-
-/*
- * Turn on the Data Cache and the MMU. The function will return
- * to the virtual address provided in LR (e.g. the runtime mapping).
- *
- * Inputs:
- *   r9 : paddr(start)
- *  r12 : Was the temporary mapping created?
- *   lr : Virtual address to return to
- *
- * Clobbers r0 - r5
- */
-enable_mmu:
-        PRINT("- Turning on paging -\r\n")
-
-        /*
-         * The state of the TLBs is unknown before turning on the MMU.
-         * Flush them to avoid stale one.
-         */
-        flush_xen_tlb_local r0
-
-        /* Write Xen's PT's paddr into the HTTBR */
-        adr_l r0, boot_pgtable
-        mov   r1, #0                 /* r0:r1 is paddr (boot_pagetable) */
-        mcrr  CP64(r0, r1, HTTBR)
-        isb
-
-        mrc   CP32(r0, HSCTLR)
-        /* Enable MMU and D-cache */
-        orr   r0, r0, #(SCTLR_Axx_ELx_M|SCTLR_Axx_ELx_C)
-        dsb                          /* Flush PTE writes and finish reads */
-        mcr   CP32(r0, HSCTLR)       /* now paging is enabled */
-        isb                          /* Now, flush the icache */
-
-        /*
-         * The MMU is turned on and we are in the 1:1 mapping. Switch
-         * to the runtime mapping.
-         */
-        mov   r5, lr                /* Save LR before overwritting it */
-        mov_w lr, 1f                /* Virtual address in the runtime mapping */
-        b     switch_to_runtime_mapping
-1:
-        mov   lr, r5                /* Restore LR */
-        /*
-         * At this point, either the 1:1 map or the temporary mapping
-         * will be present. The former may clash with other parts of the
-         * Xen virtual memory layout. As both of them are not used
-         * anymore, remove them completely to avoid having to worry
-         * about replacing existing mapping afterwards.
-         *
-         * On return this will jump to the virtual address requested by
-         * the caller.
-         */
-        teq   r12, #0
-        beq   remove_identity_mapping
-        b     remove_temporary_mapping
-ENDPROC(enable_mmu)
-
-/*
- * Switch to the runtime mapping. The logic depends on whether the
- * runtime virtual region is clashing with the physical address
- *
- *  - If it is not clashing, we can directly jump to the address in
- *    the runtime mapping.
- *  - If it is clashing, create_page_tables() would have mapped Xen to
- *    a temporary virtual address. We need to switch to the temporary
- *    mapping so we can remove the identity mapping and map Xen at the
- *    correct position.
- *
- * Inputs
- *    r9: paddr(start)
- *   r12: Was a temporary mapping created?
- *    lr: Address in the runtime mapping to jump to
- *
- * Clobbers r0 - r4
- */
-switch_to_runtime_mapping:
-        /*
-         * Jump to the runtime mapping if the virt and phys are not
-         * clashing
-         */
-        teq   r12, #0
-        beq   ready_to_switch
-
-        /* We are still in the 1:1 mapping. Jump to the temporary Virtual address. */
-        mov_w r0, 1f
-        add   r0, r0, #XEN_TEMPORARY_OFFSET /* r0 := address in temporary mapping */
-        mov   pc, r0
-
-1:
-        /* Remove boot_second_id */
-        mov   r2, #0
-        mov   r3, #0
-        adr_l r0, boot_pgtable
-        get_table_slot r1, r9, 1            /* r1 := first slot */
-        lsl   r1, r1, #3                    /* r1 := first slot offset */
-        strd  r2, r3, [r0, r1]
-
-        flush_xen_tlb_local r0
-
-        /* Map boot_second into boot_pgtable */
-        mov_w r0, XEN_VIRT_START
-        create_table_entry boot_pgtable, boot_second, r0, 1
-
-        /* Ensure any page table updates are visible before continuing */
-        dsb   nsh
-        /*
-         * The function will return on the runtime mapping. So we want
-         * to prevent instruction fetch before the dsb completes.
-         */
-        isb
-
-ready_to_switch:
-        mov   pc, lr
-ENDPROC(switch_to_runtime_mapping)
-
-/*
- * Enable mm (turn on the data cache and the MMU) for secondary CPUs.
- * The function will return to the virtual address provided in LR (e.g. the
- * runtime mapping).
- *
- * Inputs:
- *   r9 : paddr(start)
- *   r10: phys offset
- *   lr : Virtual address to return to.
- *
- * Output:
- *   r12: Was a temporary mapping created?
- *
- * Clobbers r0 - r6
- */
-enable_secondary_cpu_mm:
-        mov   r6, lr
-
-        bl    create_page_tables
-
-        /* Address in the runtime mapping to jump to after the MMU is enabled */
-        mov_w lr, 1f
-        b     enable_mmu
-1:
-        /*
-         * Non-boot CPUs need to move on to the proper pagetables, which were
-         * setup in prepare_secondary_mm.
-         *
-         * XXX: This is not compliant with the Arm Arm.
-         */
-        mov_w r4, init_ttbr          /* VA of HTTBR value stashed by CPU 0 */
-        ldrd  r4, r5, [r4]           /* Actual value */
-        dsb
-        mcrr  CP64(r4, r5, HTTBR)
-        dsb
-        isb
-        flush_xen_tlb_local r0
-        pt_enforce_wxn r0
-
-        /* Return to the virtual address requested by the caller. */
-        mov   pc, r6
-ENDPROC(enable_secondary_cpu_mm)
-
-/*
- * Enable mm (turn on the data cache and the MMU) for the boot CPU.
- * The function will return to the virtual address provided in LR (e.g. the
- * runtime mapping).
- *
- * Inputs:
- *   r9 : paddr(start)
- *   r10: phys offset
- *   lr : Virtual address to return to.
- *
- * Output:
- *   r12: Was a temporary mapping created?
- *
- * Clobbers r0 - r6
- */
-enable_boot_cpu_mm:
-        mov   r6, lr
-
-        bl    create_page_tables
-
-        /* Address in the runtime mapping to jump to after the MMU is enabled */
-        mov_w lr, 1f
-        b     enable_mmu
-1:
-        mov   lr, r6
-
-        /*
-         * Prepare the fixmap. The function will return to the virtual address
-         * requested by the caller.
-         */
-        b     setup_fixmap
-ENDPROC(enable_boot_cpu_mm)
-
-/*
- * Remove the 1:1 map from the page-tables. It is not easy to keep track
- * where the 1:1 map was mapped, so we will look for the top-level entry
- * exclusive to the 1:1 map and remove it.
- *
- * Inputs:
- *   r9 : paddr(start)
- *
- * Clobbers r0 - r3
- */
-remove_identity_mapping:
-        /* r2:r3 := invalid page-table entry */
-        mov   r2, #0x0
-        mov   r3, #0x0
-
-        /* Find the first slot used and remove it */
-        get_table_slot r1, r9, 1     /* r1 := first slot */
-        mov_w r0, boot_pgtable       /* r0 := root table */
-        lsl   r1, r1, #3             /* r1 := Slot offset */
-        strd  r2, r3, [r0, r1]
-
-        flush_xen_tlb_local r0
-        mov   pc, lr
-ENDPROC(remove_identity_mapping)
-
-/*
- * Remove the temporary mapping of Xen starting at TEMPORARY_XEN_VIRT_START.
- *
- * Clobbers r0 - r3
- */
-remove_temporary_mapping:
-        /* r2:r3 := invalid page-table entry */
-        mov   r2, #0
-        mov   r3, #0
-
-        adr_l r0, boot_pgtable
-        mov_w r1, TEMPORARY_XEN_VIRT_START
-        get_table_slot r1, r1, 1     /* r1 := first slot */
-        lsl   r1, r1, #3             /* r1 := first slot offset */
-        strd  r2, r3, [r0, r1]
-
-        flush_xen_tlb_local r0
-
-        mov  pc, lr
-ENDPROC(remove_temporary_mapping)
-
-/*
- * Map the UART in the fixmap (when earlyprintk is used) and hook the
- * fixmap table in the page tables.
- *
- * The fixmap cannot be mapped in create_page_tables because it may
- * clash with the 1:1 mapping.
- *
- * Inputs:
- *   r10: Physical offset
- *   r11: Early UART base physical address
- *
- * Clobbers r0 - r4
- */
-setup_fixmap:
-#if defined(CONFIG_EARLY_PRINTK)
-        /* Add UART to the fixmap table */
-        mov_w r0, EARLY_UART_VIRTUAL_ADDRESS
-        create_mapping_entry xen_fixmap, r0, r11, type=PT_DEV_L3
-#endif
-        /* Map fixmap into boot_second */
-        mov_w r0, FIXMAP_ADDR(0)
-        create_table_entry boot_second, xen_fixmap, r0, 2
-        /* Ensure any page table updates made above have occurred. */
-        dsb   nshst
-        /*
-         * The fixmap area will be used soon after. So ensure no hardware
-         * translation happens before the dsb completes.
-         */
-        isb
-
-        mov   pc, lr
-ENDPROC(setup_fixmap)
-
 /*
  * Setup the initial stack and jump to the C world
  *
@@ -856,38 +274,6 @@ fail:   PRINT("- Boot failed -\r\n")
         b     1b
 ENDPROC(fail)
 
-/*
- * Switch TTBR
- * r1:r0       ttbr
- *
- * TODO: This code does not comply with break-before-make.
- */
-ENTRY(switch_ttbr)
-        dsb                            /* Ensure the flushes happen before
-                                        * continuing */
-        isb                            /* Ensure synchronization with previous
-                                        * changes to text */
-        mcr   CP32(r0, TLBIALLH)       /* Flush hypervisor TLB */
-        mcr   CP32(r0, ICIALLU)        /* Flush I-cache */
-        mcr   CP32(r0, BPIALL)         /* Flush branch predictor */
-        dsb                            /* Ensure completion of TLB+BP flush */
-        isb
-
-        mcrr  CP64(r0, r1, HTTBR)
-
-        dsb                            /* ensure memory accesses do not cross
-                                        * over the TTBR0 write */
-        isb                            /* Ensure synchronization with previous
-                                        * changes to text */
-        mcr   CP32(r0, TLBIALLH)       /* Flush hypervisor TLB */
-        mcr   CP32(r0, ICIALLU)        /* Flush I-cache */
-        mcr   CP32(r0, BPIALL)         /* Flush branch predictor */
-        dsb                            /* Ensure completion of TLB+BP flush */
-        isb
-
-        mov pc, lr
-ENDPROC(switch_ttbr)
-
 #ifdef CONFIG_EARLY_PRINTK
 /*
  * Initialize the UART. Should only be called on the boot CPU.
@@ -908,26 +294,28 @@ ENDPROC(init_uart)
 
 /*
  * Print early debug messages.
+ * Note: This function must be called from assembly.
  * r0: Nul-terminated string to print.
  * r11: Early UART base address
  * Clobbers r0-r1
  */
-puts:
+ENTRY(asm_puts)
         early_uart_ready r11, r1
         ldrb  r1, [r0], #1           /* Load next char */
         teq   r1, #0                 /* Exit on nul */
         moveq pc, lr
         early_uart_transmit r11, r1
-        b puts
-ENDPROC(puts)
+        b asm_puts
+ENDPROC(asm_puts)
 
 /*
- * Print a 32-bit number in hex.  Specific to the PL011 UART.
+ * Print a 32-bit number in hex.
+ * Note: This function must be called from assembly.
  * r0: Number to print.
  * r11: Early UART base address
  * Clobbers r0-r3
  */
-putn:
+ENTRY(asm_putn)
         adr_l r1, hex
         mov   r3, #8
 1:
@@ -939,18 +327,11 @@ putn:
         subs  r3, r3, #1
         bne   1b
         mov   pc, lr
-ENDPROC(putn)
+ENDPROC(asm_putn)
 
 RODATA_STR(hex, "0123456789abcdef")
 
-#else  /* CONFIG_EARLY_PRINTK */
-
-ENTRY(early_puts)
-init_uart:
-puts:
-putn:   mov   pc, lr
-
-#endif /* !CONFIG_EARLY_PRINTK */
+#endif /* CONFIG_EARLY_PRINTK */
 
 /* This provides a C-API version of __lookup_processor_type */
 ENTRY(lookup_processor_type)
diff --git a/xen/arch/arm/arm32/mmu/Makefile b/xen/arch/arm/arm32/mmu/Makefile
index b18cec4836..a8a750a3d0 100644
--- a/xen/arch/arm/arm32/mmu/Makefile
+++ b/xen/arch/arm/arm32/mmu/Makefile
@@ -1 +1,2 @@
+obj-y += head.o
 obj-y += mm.o
diff --git a/xen/arch/arm/arm32/mmu/head.S b/xen/arch/arm/arm32/mmu/head.S
new file mode 100644
index 0000000000..4e6395e787
--- /dev/null
+++ b/xen/arch/arm/arm32/mmu/head.S
@@ -0,0 +1,575 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * xen/arch/arm/arm32/mmu/head.S
+ *
+ * Arm32 MMU specific start-of-day code.
+ */
+
+#include <asm/page.h>
+#include <asm/early_printk.h>
+
+#define PT_PT     0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */
+#define PT_MEM    0xf7d /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=0 P=1 */
+#define PT_MEM_L3 0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */
+#define PT_DEV    0xe71 /* nG=1 AF=1 SH=10 AP=01 NS=1 ATTR=100 T=0 P=1 */
+#define PT_DEV_L3 0xe73 /* nG=1 AF=1 SH=10 AP=01 NS=1 ATTR=100 T=1 P=1 */
+
+#define PT_UPPER(x) (PT_##x & 0xf00)
+#define PT_LOWER(x) (PT_##x & 0x0ff)
+
+/* Convenience defines to get slot used by Xen mapping. */
+#define XEN_FIRST_SLOT      first_table_offset(XEN_VIRT_START)
+#define XEN_SECOND_SLOT     second_table_offset(XEN_VIRT_START)
+
+/* Offset between the early boot xen mapping and the runtime xen mapping */
+#define XEN_TEMPORARY_OFFSET      (TEMPORARY_XEN_VIRT_START - XEN_VIRT_START)
+
+.macro load_paddr rb, sym
+        mov_w \rb, \sym
+        add   \rb, \rb, r10
+.endm
+
+/*
+ * Flush local TLBs
+ *
+ * @tmp: Scratch register
+ *
+ * See asm/arm32/flushtlb.h for the explanation of the sequence.
+ */
+.macro flush_xen_tlb_local tmp
+        dsb   nshst
+        mcr   CP32(\tmp, TLBIALLH)
+        dsb   nsh
+        isb
+.endm
+
+/*
+ * Enforce Xen page-tables do not contain mapping that are both
+ * Writable and eXecutables.
+ *
+ * This should be called on each secondary CPU.
+ */
+.macro pt_enforce_wxn tmp
+        mrc   CP32(\tmp, HSCTLR)
+        orr   \tmp, \tmp, #SCTLR_Axx_ELx_WXN
+        dsb
+        mcr   CP32(\tmp, HSCTLR)
+        /*
+         * The TLBs may cache SCTLR_EL2.WXN. So ensure it is synchronized
+         * before flushing the TLBs.
+         */
+        isb
+        flush_xen_tlb_local \tmp
+.endm
+
+/* Macro to find the slot number at a given page-table level
+ *
+ * slot:     slot computed
+ * virt:     virtual address
+ * lvl:      page-table level
+ *
+ * Note that ubxf is unpredictable when the end bit is above 32-bit. So we
+ * can't use it for first level offset.
+ */
+.macro get_table_slot, slot, virt, lvl
+    .if \lvl == 1
+        lsr   \slot, \virt, #XEN_PT_LEVEL_SHIFT(\lvl)
+    .else
+        ubfx  \slot, \virt, #XEN_PT_LEVEL_SHIFT(\lvl), #XEN_PT_LPAE_SHIFT
+    .endif
+.endm
+
+/*
+ * Macro to create a page table entry in \ptbl to \tbl (physical
+ * address)
+ *
+ * ptbl:    table symbol where the entry will be created
+ * tbl:     physical address of the table to point to
+ * virt:    virtual address
+ * lvl:     page-table level
+ *
+ * Preserves \virt
+ * Clobbers \tbl, r1 - r3
+ *
+ * Note that \tbl and \virt should be in a register other than r1 - r3
+ */
+.macro create_table_entry_from_paddr, ptbl, tbl, virt, lvl
+        get_table_slot r1, \virt, \lvl  /* r1 := slot in \tbl */
+        lsl   r1, r1, #3                /* r1 := slot offset in \tbl */
+
+        movw  r2, #PT_PT             /* r2:r3 := right for linear PT */
+        orr   r2, r2, \tbl           /*           + \tbl paddr */
+        mov   r3, #0
+
+        adr_l \tbl, \ptbl            /* \tbl := (v,p)addr of \ptbl */
+
+        strd  r2, r3, [\tbl, r1]
+.endm
+
+/*
+ * Macro to create a page table entry in \ptbl to \tbl (symbol)
+ *
+ * ptbl:    table symbol where the entry will be created
+ * tbl:     table symbol to point to
+ * virt:    virtual address
+ * lvl:     page-table level
+ *
+ * Preserves \virt
+ * Clobbers r1 - r4
+ *
+ * Also use r10 for the phys offset.
+ *
+ * Note that \virt should be in a register other than r1 - r4
+ */
+.macro create_table_entry, ptbl, tbl, virt, lvl
+        load_paddr r4, \tbl
+        create_table_entry_from_paddr \ptbl, r4, \virt, \lvl
+ .endm
+
+/*
+ * Macro to create a mapping entry in \tbl to \paddr. Only mapping in 3rd
+ * level table (i.e page granularity) is supported.
+ *
+ * ptbl:     table symbol where the entry will be created
+ * virt:    virtual address
+ * phys:    physical address
+ * type:    mapping type. If not specified it will be normal memory (PT_MEM_L3)
+ *
+ * Preserves \virt, \phys
+ * Clobbers r1 - r4
+ *
+ * Note that \virt and \paddr should be in other registers than r1 - r4
+ * and be distinct.
+ */
+.macro create_mapping_entry, ptbl, virt, phys, type=PT_MEM_L3
+        mov_w r2, XEN_PT_LPAE_ENTRY_MASK
+        lsr   r1, \virt, #THIRD_SHIFT
+        and   r1, r1, r2             /* r1 := slot in \tlb */
+        lsl   r1, r1, #3             /* r1 := slot offset in \tlb */
+
+        lsr   r4, \phys, #THIRD_SHIFT
+        lsl   r4, r4, #THIRD_SHIFT   /* r4 := PAGE_ALIGNED(phys) */
+
+        movw  r2, #\type             /* r2:r3 := right for section PT */
+        orr   r2, r2, r4             /*          + PAGE_ALIGNED(phys) */
+        mov   r3, #0
+
+        adr_l r4, \ptbl
+
+        strd  r2, r3, [r4, r1]
+.endm
+
+.section .text.idmap, "ax", %progbits
+
+/*
+ * Rebuild the boot pagetable's first-level entries. The structure
+ * is described in mm.c.
+ *
+ * After the CPU enables paging it will add the fixmap mapping
+ * to these page tables, however this may clash with the 1:1
+ * mapping. So each CPU must rebuild the page tables here with
+ * the 1:1 in place.
+ *
+ * Inputs:
+ *   r9 : paddr(start)
+ *   r10: phys offset
+ *
+ * Output:
+ *   r12: Was a temporary mapping created?
+ *
+ * Clobbers r0 - r5
+ */
+create_page_tables:
+        /* Prepare the page-tables for mapping Xen */
+        mov_w r0, XEN_VIRT_START
+
+        /*
+         * We need to use a stash register because
+         * create_table_entry_paddr() will clobber the register storing
+         * the physical address of the table to point to.
+         */
+        adr_l r5, boot_third
+        mov_w r4, XEN_VIRT_START
+.rept XEN_NR_ENTRIES(2)
+        mov   r0, r5                        /* r0 := paddr(l3 table) */
+        create_table_entry_from_paddr boot_second, r0, r4, 2
+        add   r4, r4, #XEN_PT_LEVEL_SIZE(2) /* r4 := Next vaddr */
+        add   r5, r5, #PAGE_SIZE            /* r5 := Next table */
+.endr
+
+        /*
+         * Find the size of Xen in pages and multiply by the size of a
+         * PTE. This will then be compared in the mapping loop below.
+         *
+         * Note the multiplication is just to avoid using an extra
+         * register/instruction per iteration.
+         */
+        mov_w r0, _start            /* r0 := vaddr(_start) */
+        mov_w r1, _end              /* r1 := vaddr(_end) */
+        sub   r0, r1, r0            /* r0 := effective size of Xen */
+        lsr   r0, r0, #PAGE_SHIFT   /* r0 := Number of pages for Xen */
+        lsl   r0, r0, #3            /* r0 := Number of pages * PTE size */
+
+        /* Setup boot_third: */
+        adr_l r4, boot_third
+
+        lsr   r2, r9, #THIRD_SHIFT  /* Base address for 4K mapping */
+        lsl   r2, r2, #THIRD_SHIFT
+        orr   r2, r2, #PT_UPPER(MEM_L3) /* r2:r3 := map */
+        orr   r2, r2, #PT_LOWER(MEM_L3)
+        mov   r3, #0x0
+
+        /* ... map of vaddr(start) in boot_third */
+        mov   r1, #0
+1:      strd  r2, r3, [r4, r1]       /* Map vaddr(start) */
+        add   r2, r2, #PAGE_SIZE     /* Next page */
+        add   r1, r1, #8             /* Next slot */
+        cmp   r1, r0                 /* Loop until we map all of Xen */
+        blo   1b
+
+        /*
+         * Setup the 1:1 mapping so we can turn the MMU on. Note that
+         * only the first page of Xen will be part of the 1:1 mapping.
+         */
+        create_table_entry boot_pgtable, boot_second_id, r9, 1
+        create_table_entry boot_second_id, boot_third_id, r9, 2
+        create_mapping_entry boot_third_id, r9, r9
+
+        /*
+         * Find the first slot used. If the slot is not the same
+         * as TEMPORARY_AREA_FIRST_SLOT, then we will want to switch
+         * to the temporary mapping before jumping to the runtime
+         * virtual mapping.
+         */
+        get_table_slot r1, r9, 1     /* r1 := first slot */
+        cmp   r1, #TEMPORARY_AREA_FIRST_SLOT
+        bne   use_temporary_mapping
+
+        mov_w r0, XEN_VIRT_START
+        create_table_entry boot_pgtable, boot_second, r0, 1
+        mov   r12, #0                /* r12 := temporary mapping not created */
+        mov   pc, lr
+
+use_temporary_mapping:
+        /*
+         * The identity mapping is not using the first slot
+         * TEMPORARY_AREA_FIRST_SLOT. Create a temporary mapping.
+         * See switch_to_runtime_mapping for more details.
+         */
+        PRINT("- Create temporary mapping -\r\n")
+
+        /* Map boot_second (cover Xen mappings) to the temporary 1st slot */
+        mov_w r0, TEMPORARY_XEN_VIRT_START
+        create_table_entry boot_pgtable, boot_second, r0, 1
+
+        mov   r12, #1                /* r12 := temporary mapping created */
+        mov   pc, lr
+ENDPROC(create_page_tables)
+
+/*
+ * Turn on the Data Cache and the MMU. The function will return
+ * to the virtual address provided in LR (e.g. the runtime mapping).
+ *
+ * Inputs:
+ *   r9 : paddr(start)
+ *  r12 : Was the temporary mapping created?
+ *   lr : Virtual address to return to
+ *
+ * Clobbers r0 - r5
+ */
+enable_mmu:
+        PRINT("- Turning on paging -\r\n")
+
+        /*
+         * The state of the TLBs is unknown before turning on the MMU.
+         * Flush them to avoid stale one.
+         */
+        flush_xen_tlb_local r0
+
+        /* Write Xen's PT's paddr into the HTTBR */
+        adr_l r0, boot_pgtable
+        mov   r1, #0                 /* r0:r1 is paddr (boot_pagetable) */
+        mcrr  CP64(r0, r1, HTTBR)
+        isb
+
+        mrc   CP32(r0, HSCTLR)
+        /* Enable MMU and D-cache */
+        orr   r0, r0, #(SCTLR_Axx_ELx_M|SCTLR_Axx_ELx_C)
+        dsb                          /* Flush PTE writes and finish reads */
+        mcr   CP32(r0, HSCTLR)       /* now paging is enabled */
+        isb                          /* Now, flush the icache */
+
+        /*
+         * The MMU is turned on and we are in the 1:1 mapping. Switch
+         * to the runtime mapping.
+         */
+        mov   r5, lr                /* Save LR before overwritting it */
+        mov_w lr, 1f                /* Virtual address in the runtime mapping */
+        b     switch_to_runtime_mapping
+1:
+        mov   lr, r5                /* Restore LR */
+        /*
+         * At this point, either the 1:1 map or the temporary mapping
+         * will be present. The former may clash with other parts of the
+         * Xen virtual memory layout. As both of them are not used
+         * anymore, remove them completely to avoid having to worry
+         * about replacing existing mapping afterwards.
+         *
+         * On return this will jump to the virtual address requested by
+         * the caller.
+         */
+        teq   r12, #0
+        beq   remove_identity_mapping
+        b     remove_temporary_mapping
+ENDPROC(enable_mmu)
+
+/*
+ * Switch to the runtime mapping. The logic depends on whether the
+ * runtime virtual region is clashing with the physical address
+ *
+ *  - If it is not clashing, we can directly jump to the address in
+ *    the runtime mapping.
+ *  - If it is clashing, create_page_tables() would have mapped Xen to
+ *    a temporary virtual address. We need to switch to the temporary
+ *    mapping so we can remove the identity mapping and map Xen at the
+ *    correct position.
+ *
+ * Inputs
+ *    r9: paddr(start)
+ *   r12: Was a temporary mapping created?
+ *    lr: Address in the runtime mapping to jump to
+ *
+ * Clobbers r0 - r4
+ */
+switch_to_runtime_mapping:
+        /*
+         * Jump to the runtime mapping if the virt and phys are not
+         * clashing
+         */
+        teq   r12, #0
+        beq   ready_to_switch
+
+        /* We are still in the 1:1 mapping. Jump to the temporary Virtual address. */
+        mov_w r0, 1f
+        add   r0, r0, #XEN_TEMPORARY_OFFSET /* r0 := address in temporary mapping */
+        mov   pc, r0
+
+1:
+        /* Remove boot_second_id */
+        mov   r2, #0
+        mov   r3, #0
+        adr_l r0, boot_pgtable
+        get_table_slot r1, r9, 1            /* r1 := first slot */
+        lsl   r1, r1, #3                    /* r1 := first slot offset */
+        strd  r2, r3, [r0, r1]
+
+        flush_xen_tlb_local r0
+
+        /* Map boot_second into boot_pgtable */
+        mov_w r0, XEN_VIRT_START
+        create_table_entry boot_pgtable, boot_second, r0, 1
+
+        /* Ensure any page table updates are visible before continuing */
+        dsb   nsh
+        /*
+         * The function will return on the runtime mapping. So we want
+         * to prevent instruction fetch before the dsb completes.
+         */
+        isb
+
+ready_to_switch:
+        mov   pc, lr
+ENDPROC(switch_to_runtime_mapping)
+
+/*
+ * Enable mm (turn on the data cache and the MMU) for secondary CPUs.
+ * The function will return to the virtual address provided in LR (e.g. the
+ * runtime mapping).
+ *
+ * Inputs:
+ *   r9 : paddr(start)
+ *   r10: phys offset
+ *   lr : Virtual address to return to.
+ *
+ * Output:
+ *   r12: Was a temporary mapping created?
+ *
+ * Clobbers r0 - r6
+ */
+ENTRY(enable_secondary_cpu_mm)
+        mov   r6, lr
+
+        bl    create_page_tables
+
+        /* Address in the runtime mapping to jump to after the MMU is enabled */
+        mov_w lr, 1f
+        b     enable_mmu
+1:
+        /*
+         * Non-boot CPUs need to move on to the proper pagetables, which were
+         * setup in prepare_secondary_mm.
+         *
+         * XXX: This is not compliant with the Arm Arm.
+         */
+        mov_w r4, init_ttbr          /* VA of HTTBR value stashed by CPU 0 */
+        ldrd  r4, r5, [r4]           /* Actual value */
+        dsb
+        mcrr  CP64(r4, r5, HTTBR)
+        dsb
+        isb
+        flush_xen_tlb_local r0
+        pt_enforce_wxn r0
+
+        /* Return to the virtual address requested by the caller. */
+        mov   pc, r6
+ENDPROC(enable_secondary_cpu_mm)
+
+/*
+ * Enable mm (turn on the data cache and the MMU) for the boot CPU.
+ * The function will return to the virtual address provided in LR (e.g. the
+ * runtime mapping).
+ *
+ * Inputs:
+ *   r9 : paddr(start)
+ *   r10: phys offset
+ *   lr : Virtual address to return to.
+ *
+ * Output:
+ *   r12: Was a temporary mapping created?
+ *
+ * Clobbers r0 - r6
+ */
+ENTRY(enable_boot_cpu_mm)
+        mov   r6, lr
+
+        bl    create_page_tables
+
+        /* Address in the runtime mapping to jump to after the MMU is enabled */
+        mov_w lr, 1f
+        b     enable_mmu
+1:
+        mov   lr, r6
+
+        /*
+         * Prepare the fixmap. The function will return to the virtual address
+         * requested by the caller.
+         */
+        b     setup_fixmap
+ENDPROC(enable_boot_cpu_mm)
+
+/*
+ * Remove the 1:1 map from the page-tables. It is not easy to keep track
+ * where the 1:1 map was mapped, so we will look for the top-level entry
+ * exclusive to the 1:1 map and remove it.
+ *
+ * Inputs:
+ *   r9 : paddr(start)
+ *
+ * Clobbers r0 - r3
+ */
+remove_identity_mapping:
+        /* r2:r3 := invalid page-table entry */
+        mov   r2, #0x0
+        mov   r3, #0x0
+
+        /* Find the first slot used and remove it */
+        get_table_slot r1, r9, 1     /* r1 := first slot */
+        mov_w r0, boot_pgtable       /* r0 := root table */
+        lsl   r1, r1, #3             /* r1 := Slot offset */
+        strd  r2, r3, [r0, r1]
+
+        flush_xen_tlb_local r0
+        mov   pc, lr
+ENDPROC(remove_identity_mapping)
+
+/*
+ * Remove the temporary mapping of Xen starting at TEMPORARY_XEN_VIRT_START.
+ *
+ * Clobbers r0 - r3
+ */
+remove_temporary_mapping:
+        /* r2:r3 := invalid page-table entry */
+        mov   r2, #0
+        mov   r3, #0
+
+        adr_l r0, boot_pgtable
+        mov_w r1, TEMPORARY_XEN_VIRT_START
+        get_table_slot r1, r1, 1     /* r1 := first slot */
+        lsl   r1, r1, #3             /* r1 := first slot offset */
+        strd  r2, r3, [r0, r1]
+
+        flush_xen_tlb_local r0
+
+        mov  pc, lr
+ENDPROC(remove_temporary_mapping)
+
+/*
+ * Map the UART in the fixmap (when earlyprintk is used) and hook the
+ * fixmap table in the page tables.
+ *
+ * The fixmap cannot be mapped in create_page_tables because it may
+ * clash with the 1:1 mapping.
+ *
+ * Inputs:
+ *   r10: Physical offset
+ *   r11: Early UART base physical address
+ *
+ * Clobbers r0 - r4
+ */
+setup_fixmap:
+#if defined(CONFIG_EARLY_PRINTK)
+        /* Add UART to the fixmap table */
+        mov_w r0, EARLY_UART_VIRTUAL_ADDRESS
+        create_mapping_entry xen_fixmap, r0, r11, type=PT_DEV_L3
+#endif
+        /* Map fixmap into boot_second */
+        mov_w r0, FIXMAP_ADDR(0)
+        create_table_entry boot_second, xen_fixmap, r0, 2
+        /* Ensure any page table updates made above have occurred. */
+        dsb   nshst
+        /*
+         * The fixmap area will be used soon after. So ensure no hardware
+         * translation happens before the dsb completes.
+         */
+        isb
+
+        mov   pc, lr
+ENDPROC(setup_fixmap)
+
+/* Fail-stop */
+fail:   PRINT("- Boot failed -\r\n")
+1:      wfe
+        b     1b
+ENDPROC(fail)
+
+/*
+ * Switch TTBR
+ * r1:r0       ttbr
+ *
+ * TODO: This code does not comply with break-before-make.
+ */
+ENTRY(switch_ttbr)
+        dsb                            /* Ensure the flushes happen before
+                                        * continuing */
+        isb                            /* Ensure synchronization with previous
+                                        * changes to text */
+        mcr   CP32(r0, TLBIALLH)       /* Flush hypervisor TLB */
+        mcr   CP32(r0, ICIALLU)        /* Flush I-cache */
+        mcr   CP32(r0, BPIALL)         /* Flush branch predictor */
+        dsb                            /* Ensure completion of TLB+BP flush */
+        isb
+
+        mcrr  CP64(r0, r1, HTTBR)
+
+        dsb                            /* ensure memory accesses do not cross
+                                        * over the TTBR0 write */
+        isb                            /* Ensure synchronization with previous
+                                        * changes to text */
+        mcr   CP32(r0, TLBIALLH)       /* Flush hypervisor TLB */
+        mcr   CP32(r0, ICIALLU)        /* Flush I-cache */
+        mcr   CP32(r0, BPIALL)         /* Flush branch predictor */
+        dsb                            /* Ensure completion of TLB+BP flush */
+        isb
+
+        mov pc, lr
+ENDPROC(switch_ttbr)
diff --git a/xen/arch/arm/include/asm/arm32/macros.h b/xen/arch/arm/include/asm/arm32/macros.h
index a4e20aa520..b84666c764 100644
--- a/xen/arch/arm/include/asm/arm32/macros.h
+++ b/xen/arch/arm/include/asm/arm32/macros.h
@@ -1,8 +1,63 @@
 #ifndef __ASM_ARM_ARM32_MACROS_H
 #define __ASM_ARM_ARM32_MACROS_H
 
-    .macro ret
+.macro ret
         mov     pc, lr
-    .endm
+.endm
+
+/*
+ * Move an immediate constant into a 32-bit register using movw/movt
+ * instructions.
+ */
+.macro mov_w reg, word
+        movw  \reg, #:lower16:\word
+        movt  \reg, #:upper16:\word
+.endm
+
+/*
+ * Pseudo-op for PC relative adr <reg>, <symbol> where <symbol> is
+ * within the range +/- 4GB of the PC.
+ *
+ * @dst: destination register
+ * @sym: name of the symbol
+ */
+.macro adr_l, dst, sym
+        mov_w \dst, \sym - .Lpc\@
+        .set  .Lpc\@, .+ 8          /* PC bias */
+        add   \dst, \dst, pc
+.endm
+
+#ifdef CONFIG_EARLY_PRINTK
+/*
+ * Macro to print a string to the UART, if there is one.
+ *
+ * Clobbers r0 - r3
+ */
+#define PRINT(_s)           \
+        mov   r3, lr       ;\
+        adr_l r0, 98f      ;\
+        bl    asm_puts     ;\
+        mov   lr, r3       ;\
+        RODATA_STR(98, _s)
+
+/*
+ * Macro to print the value of register \rb
+ *
+ * Clobbers r0 - r4
+ */
+.macro print_reg rb
+        mov   r0, \rb
+        mov   r4, lr
+        bl    asm_putn
+        mov   lr, r4
+.endm
+
+#else /* CONFIG_EARLY_PRINTK */
+#define PRINT(s)
+
+.macro print_reg rb
+.endm
+
+#endif /* !CONFIG_EARLY_PRINTK */
 
 #endif /* __ASM_ARM_ARM32_MACROS_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:44:10 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:44:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.639980.997689 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6FcJ-0003Qx-Br; Thu, 23 Nov 2023 19:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 639980.997689; Thu, 23 Nov 2023 19: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 1r6FcJ-0003Qo-9A; Thu, 23 Nov 2023 19:44:03 +0000
Received: by outflank-mailman (input) for mailman id 639980;
 Thu, 23 Nov 2023 19: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 1r6FcI-0003Qi-Cd
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19: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 1r6FcI-0001WV-AT
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FcI-0006yH-9S
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19: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=iVyIIb91P7Vq8G8oTxO99Jc7ZWultMwb7XR4FNCZVmA=; b=S762592BTAOSBh6tJ2tnUFxtNu
	iMnUy7KNaFsE1IjWv92yx80A7Um2RIFck1Aat0lLLR1tzQGTdb1Wfhpq/nZwAu/0qIV6bAWRNaFKx
	XsOZyVQpZj7p1invKi1JudbEAqlWWyxNRdAxkwKjAtMuvnOh7Bg69NYyib8sxm12XctY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/spinlock: fix coding style issues
Message-Id: <E1r6FcI-0006yH-9S@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:44:02 +0000

commit c9237aa2cf565eb92e0418b9da347e75c2c3156b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Nov 21 10:05:15 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 21 10:05:15 2023 +0100

    xen/spinlock: fix coding style issues
    
    Fix some coding style issues in spinlock coding:
    
    - Instead of u64 etc. use the preferred uint64_t etc. types
    - Remove some trailing spaces
    - Add missing spaces in "if" statements
    - Add some missing blank lines
    
    While modifying the line, add const for the observed_head() parameter.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/spinlock.c      | 20 +++++++++++---------
 xen/include/xen/spinlock.h | 16 ++++++++--------
 2 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
index 7f453234a9..d7194e518c 100644
--- a/xen/common/spinlock.c
+++ b/xen/common/spinlock.c
@@ -100,7 +100,7 @@ void check_lock(union lock_debug *debug, bool try)
      * every lock must be consistently observed else we can deadlock in
      * IRQ-context rendezvous functions (a rendezvous which gets every CPU
      * into IRQ context before any CPU is released from the rendezvous).
-     * 
+     *
      * If we can mix IRQ-disabled and IRQ-enabled callers, the following can
      * happen:
      *  * Lock is held by CPU A, with IRQs enabled
@@ -108,7 +108,7 @@ void check_lock(union lock_debug *debug, bool try)
      *  * Rendezvous starts -- CPU A takes interrupt and enters rendezbous spin
      *  * DEADLOCK -- CPU B will never enter rendezvous, CPU A will never exit
      *                the rendezvous, and will hence never release the lock.
-     * 
+     *
      * To guard against this subtle bug we latch the IRQ safety of every
      * spinlock in the system, on first use.
      *
@@ -151,12 +151,12 @@ static void check_barrier(union lock_debug *debug)
 
     /*
      * For a barrier, we have a relaxed IRQ-safety-consistency check.
-     * 
+     *
      * It is always safe to spin at the barrier with IRQs enabled -- that does
      * not prevent us from entering an IRQ-context rendezvous, and nor are
      * we preventing anyone else from doing so (since we do not actually
      * acquire the lock during a barrier operation).
-     * 
+     *
      * However, if we spin on an IRQ-unsafe lock with IRQs disabled then that
      * is clearly wrong, for the same reason outlined in check_lock() above.
      */
@@ -262,7 +262,7 @@ void spin_debug_disable(void)
 #ifdef CONFIG_DEBUG_LOCK_PROFILE
 
 #define LOCK_PROFILE_REL                                                     \
-    if (lock->profile)                                                       \
+    if ( lock->profile )                                                     \
     {                                                                        \
         lock->profile->time_hold += NOW() - lock->profile->time_locked;      \
         lock->profile->lock_cnt++;                                           \
@@ -270,10 +270,10 @@ void spin_debug_disable(void)
 #define LOCK_PROFILE_VAR    s_time_t block = 0
 #define LOCK_PROFILE_BLOCK  block = block ? : NOW();
 #define LOCK_PROFILE_GOT                                                     \
-    if (lock->profile)                                                       \
+    if ( lock->profile )                                                     \
     {                                                                        \
         lock->profile->time_locked = NOW();                                  \
-        if (block)                                                           \
+        if ( block )                                                         \
         {                                                                    \
             lock->profile->time_block += lock->profile->time_locked - block; \
             lock->profile->block_cnt++;                                      \
@@ -298,7 +298,7 @@ static always_inline spinlock_tickets_t observe_lock(spinlock_tickets_t *t)
     return v;
 }
 
-static always_inline u16 observe_head(spinlock_tickets_t *t)
+static always_inline uint16_t observe_head(const spinlock_tickets_t *t)
 {
     smp_rmb();
     return read_atomic(&t->head);
@@ -412,7 +412,7 @@ int _spin_trylock(spinlock_t *lock)
      */
     got_lock(&lock->debug);
 #ifdef CONFIG_DEBUG_LOCK_PROFILE
-    if (lock->profile)
+    if ( lock->profile )
         lock->profile->time_locked = NOW();
 #endif
     return 1;
@@ -616,6 +616,7 @@ int spinlock_profile_control(struct xen_sysctl_lockprof_op *pc)
     case XEN_SYSCTL_LOCKPROF_reset:
         spinlock_profile_reset('\0');
         break;
+
     case XEN_SYSCTL_LOCKPROF_query:
         pc->nr_elem = 0;
         par.rc = 0;
@@ -624,6 +625,7 @@ int spinlock_profile_control(struct xen_sysctl_lockprof_op *pc)
         pc->time = NOW() - lock_profile_start;
         rc = par.rc;
         break;
+
     default:
         rc = -EINVAL;
         break;
diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index 16d933ae7e..02a062a5b0 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -81,8 +81,8 @@ struct lock_profile {
     struct lock_profile *next;       /* forward link */
     const char          *name;       /* lock name */
     struct spinlock     *lock;       /* the lock itself */
-    u64                 lock_cnt;    /* # of complete locking ops */
-    u64                 block_cnt;   /* # of complete wait for lock */
+    uint64_t            lock_cnt;    /* # of complete locking ops */
+    uint64_t            block_cnt;   /* # of complete wait for lock */
     s_time_t            time_hold;   /* cumulated lock time */
     s_time_t            time_block;  /* cumulated wait time */
     s_time_t            time_locked; /* system time of last locking */
@@ -122,7 +122,7 @@ struct lock_profile_qhead {
         prof->lock = &(s)->l;                                                 \
         prof->next = (s)->profile_head.elem_q;                                \
         (s)->profile_head.elem_q = prof;                                      \
-    } while(0)
+    } while( 0 )
 
 void _lock_profile_register_struct(
     int32_t type, struct lock_profile_qhead *qhead, int32_t idx);
@@ -153,10 +153,10 @@ struct lock_profile_qhead { };
 #endif
 
 typedef union {
-    u32 head_tail;
+    uint32_t head_tail;
     struct {
-        u16 head;
-        u16 tail;
+        uint16_t head;
+        uint16_t tail;
     };
 } spinlock_tickets_t;
 
@@ -164,10 +164,10 @@ typedef union {
 
 typedef struct spinlock {
     spinlock_tickets_t tickets;
-    u16 recurse_cpu:SPINLOCK_CPU_BITS;
+    uint16_t recurse_cpu:SPINLOCK_CPU_BITS;
 #define SPINLOCK_NO_CPU        ((1u << SPINLOCK_CPU_BITS) - 1)
 #define SPINLOCK_RECURSE_BITS  (16 - SPINLOCK_CPU_BITS)
-    u16 recurse_cnt:SPINLOCK_RECURSE_BITS;
+    uint16_t recurse_cnt:SPINLOCK_RECURSE_BITS;
 #define SPINLOCK_MAX_RECURSE   ((1u << SPINLOCK_RECURSE_BITS) - 1)
     union lock_debug debug;
 #ifdef CONFIG_DEBUG_LOCK_PROFILE
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:44:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.639984.997703 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6FcT-0003iW-Ka; Thu, 23 Nov 2023 19:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 639984.997703; Thu, 23 Nov 2023 19: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 1r6FcT-0003iO-Hx; Thu, 23 Nov 2023 19:44:13 +0000
Received: by outflank-mailman (input) for mailman id 639984;
 Thu, 23 Nov 2023 19: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 1r6FcS-0003hw-Fd
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19: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 1r6FcS-0001Wg-EJ
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FcS-0006yo-Cm
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19: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=3g13h+NzfBa4RExkZkzF9tgBM/nfrE0O8/DbrfMcrHY=; b=ibB7YcxLkZzq9VL0KrdBwFwUgH
	N9tBpX4laiJi5pvE/h0be+QNYPrYqAjCNEqs8pjVAMddxxkJFJwqO10NlsfrYHTx5JEVLHn2hO0GC
	uR8b+SVUx+YIpbwhJvTlEW4ll8+7OxVKKQX93qQPp00AH61pGwFjs7GmFY/qGcil1Pfk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xenstored: use correct conversion specifier in the tracing function
Message-Id: <E1r6FcS-0006yo-Cm@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:44:12 +0000

commit 983aaa533bb664a7b6266faebe5f89cf4c5103a5
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Tue Nov 21 10:05:58 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 21 10:05:58 2023 +0100

    xenstored: use correct conversion specifier in the tracing function
    
    Previous change to xenstored used "%d" to format conn->id while in fact
    conn->id has "unsigned int" type, so "%u" should be used.
    
    Fixes: 97f8555acbf3 ("xenstored: print domain id in traces")
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstored/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index 311764eb0c..184b130d12 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -135,7 +135,7 @@ static void trace_io(const struct connection *conn,
 	now = time(NULL);
 	tm = localtime(&now);
 
-	trace("io: %s %p (d%d) %04d%02d%02d %02d:%02d:%02d %s (",
+	trace("io: %s %p (d%u) %04d%02d%02d %02d:%02d:%02d %s (",
 	      out ? "OUT" : "IN", conn, conn->id,
 	      tm->tm_year + 1900, tm->tm_mon + 1,
 	      tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:44:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.639985.997707 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Fcd-0003nT-M7; Thu, 23 Nov 2023 19:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 639985.997707; Thu, 23 Nov 2023 19: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 1r6Fcd-0003nM-JM; Thu, 23 Nov 2023 19:44:23 +0000
Received: by outflank-mailman (input) for mailman id 639985;
 Thu, 23 Nov 2023 19: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 1r6Fcc-0003mz-J3
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19: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 1r6Fcc-0001Ws-IE
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fcc-0006zL-GP
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19: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=6bVrh1PbgxoMLYTcuAWZ8SwB9dMrqyRRQAnclUIhNJM=; b=zJREb302BuYQ/yUhaamgdwYd7l
	bPoEB+V6Oxy1TPcBFFsuObT02vi47ozy0u76BDK7WFVW9OuVXFdRgGri9fyPxEHCe5BPYnn8wA6He
	Z7Ida9hGIOc6V8PZ1Xhl0zzS6YGR7ZHz+xYQMqNphlluBN7tPP0zqZNtiA6knnt5F/sc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] SUPPORT.md: change current version to 4.19-unstable
Message-Id: <E1r6Fcc-0006zL-GP@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:44:22 +0000

commit 40acb0c111c2ea7c1d109e7a89130714fd2994c1
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Nov 21 10:06:16 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 21 10:06:16 2023 +0100

    SUPPORT.md: change current version to 4.19-unstable
    
    The version in SUPPORT.md is still "4.18-rc".
    
    Change it to "4.19-unstable".
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 SUPPORT.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index fff4b4c5ba..a90d1108c9 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.18-rc
+    Xen-Version: 4.19-unstable
     Initial-Release: n/a
     Supported-Until: TBD
     Security-Support-Until: Unreleased - not yet security-supported
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:44:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.639986.997711 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Fcn-0003yh-NV; Thu, 23 Nov 2023 19:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 639986.997711; Thu, 23 Nov 2023 19: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 1r6Fcn-0003yZ-Kw; Thu, 23 Nov 2023 19:44:33 +0000
Received: by outflank-mailman (input) for mailman id 639986;
 Thu, 23 Nov 2023 19: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 1r6Fcm-0003vv-ME
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19: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 1r6Fcm-0001Wz-LN
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fcm-0006zm-KV
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19: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=AbcpgwKRc+Bvif2wAE1+5duBDk/C+k4txXf99mx2iqs=; b=blhGIzLyLcNEqLhDt9Bd6UMS3H
	sNaAKt705Zeei5JmRijl4lvGt1rn0iTTZjWJEAMzxpBoslx71PpsJu7f7XvZTWeLbhfnJi0BKM8D9
	RhxOrBKEebyLUakUsibA/T6GWjMdiFytsnDLUbTSI7ri7G6MfUJ4ay83Afor9M37e7yk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: modify or add declarations for variables where needed
Message-Id: <E1r6Fcm-0006zm-KV@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:44:32 +0000

commit 62c84c3031092fc6116d5f861a3cfc2e9cfb078c
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Tue Nov 21 10:06:57 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 21 10:06:57 2023 +0100

    xen: modify or add declarations for variables where needed
    
    Some variables with external linkage used in C code do not have
    a visible declaration where they are defined. Other variables
    can be made static, thereby eliminating the need for a declaration.
    Doing so also resolves violations of MISRA C:2012 Rule 8.4.
    
    Fix typo s/mcinfo_dumpped/mcinfo_dumped/ while making
    the variable static.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/include/asm/setup.h  | 3 +++
 xen/arch/arm/include/asm/smp.h    | 3 +++
 xen/arch/arm/platform_hypercall.c | 2 +-
 xen/arch/x86/cpu/mcheck/mce.c     | 7 ++++---
 xen/arch/x86/irq.c                | 2 +-
 5 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index 6c71f8c31b..ccb857ca2e 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -189,9 +189,12 @@ int map_range_to_domain(const struct dt_device_node *dev,
 extern lpae_t boot_pgtable[XEN_PT_LPAE_ENTRIES];
 
 #ifdef CONFIG_ARM_64
+extern lpae_t boot_first[XEN_PT_LPAE_ENTRIES];
 extern lpae_t boot_first_id[XEN_PT_LPAE_ENTRIES];
 #endif
+extern lpae_t boot_second[XEN_PT_LPAE_ENTRIES];
 extern lpae_t boot_second_id[XEN_PT_LPAE_ENTRIES];
+extern lpae_t boot_third[XEN_PT_LPAE_ENTRIES * XEN_NR_ENTRIES(2)];
 extern lpae_t boot_third_id[XEN_PT_LPAE_ENTRIES];
 
 /* Find where Xen will be residing at runtime and return a PT entry */
diff --git a/xen/arch/arm/include/asm/smp.h b/xen/arch/arm/include/asm/smp.h
index 22e12f38db..bd489793fa 100644
--- a/xen/arch/arm/include/asm/smp.h
+++ b/xen/arch/arm/include/asm/smp.h
@@ -6,6 +6,9 @@
 #include <asm/current.h>
 #endif
 
+extern struct init_info init_data;
+extern unsigned long smp_up_cpu;
+
 DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_mask);
 DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
 
diff --git a/xen/arch/arm/platform_hypercall.c b/xen/arch/arm/platform_hypercall.c
index 743687a303..fde4bc3e58 100644
--- a/xen/arch/arm/platform_hypercall.c
+++ b/xen/arch/arm/platform_hypercall.c
@@ -17,7 +17,7 @@
 #include <asm/current.h>
 #include <asm/event.h>
 
-DEFINE_SPINLOCK(xenpf_lock);
+static DEFINE_SPINLOCK(xenpf_lock);
 
 long do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 {
diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 6141b7eb9c..779a458cd8 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1682,13 +1682,14 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
     return ret;
 }
 
-int mcinfo_dumpped;
+static int mcinfo_dumped;
+
 static int cf_check x86_mcinfo_dump_panic(mctelem_cookie_t mctc)
 {
     struct mc_info *mcip = mctelem_dataptr(mctc);
 
     x86_mcinfo_dump(mcip);
-    mcinfo_dumpped++;
+    mcinfo_dumped++;
 
     return 0;
 }
@@ -1702,7 +1703,7 @@ static void mc_panic_dump(void)
     for_each_online_cpu(cpu)
         mctelem_process_deferred(cpu, x86_mcinfo_dump_panic,
                                  mctelem_has_deferred_lmce(cpu));
-    dprintk(XENLOG_ERR, "End dump mc_info, %x mcinfo dumped\n", mcinfo_dumpped);
+    dprintk(XENLOG_ERR, "End dump mc_info, %x mcinfo dumped\n", mcinfo_dumped);
 }
 
 void mc_panic(const char *s)
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 16d9fceba1..6e668b1b4f 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -43,7 +43,7 @@ int __read_mostly opt_irq_vector_map = OPT_IRQ_VECTOR_MAP_DEFAULT;
 static unsigned char __read_mostly irq_max_guests;
 integer_param("irq-max-guests", irq_max_guests);
 
-vmask_t global_used_vector_map;
+static vmask_t global_used_vector_map;
 
 struct irq_desc __read_mostly *irq_desc = NULL;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:44:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.639988.997714 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Fcx-00043g-Ot; Thu, 23 Nov 2023 19:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 639988.997714; Thu, 23 Nov 2023 19: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 1r6Fcx-00043X-MO; Thu, 23 Nov 2023 19:44:43 +0000
Received: by outflank-mailman (input) for mailman id 639988;
 Thu, 23 Nov 2023 19:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fcw-00043H-PU
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19: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 1r6Fcw-0001XP-Oj
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fcw-00070M-Nf
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19: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=V2avoh3eeHDSMZTM6zs5QXMB79D9UWxHYvVmyo4I7KM=; b=dq8esp1HLEEvBh/M5zsP28nJ6B
	p1p1JezVlxf3Wf5HX2RxidcVGV2gZYQKTe7i4ab4NUxhn04KxHj2Y1Me+37u200bQw8tJDEL3of5t
	P8Dz40tam/W0JEyXRDcWOneMvWQb5cNrteXG2fDCDp/OYiCxxUpQZKf4LsOqjGTu49fk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/grant: switch included header to make declarations visible
Message-Id: <E1r6Fcw-00070M-Nf@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:44:42 +0000

commit 5c7c09f64e0dc74a26de41544a0f0c2d54549336
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Tue Nov 21 10:07:51 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 21 10:07:51 2023 +0100

    x86/grant: switch included header to make declarations visible
    
    The declarations for {create,replace}_grant_p2m_mapping are
    not visible when these functions are defined, therefore the right
    header needs to be included to allow them to be visible.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/grant_table.c             | 3 +--
 xen/arch/x86/include/asm/hvm/grant_table.h | 2 ++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/grant_table.c b/xen/arch/x86/hvm/grant_table.c
index 30d51d54a9..afe449d888 100644
--- a/xen/arch/x86/hvm/grant_table.c
+++ b/xen/arch/x86/hvm/grant_table.c
@@ -9,8 +9,7 @@
 
 #include <xen/types.h>
 
-#include <public/grant_table.h>
-
+#include <asm/hvm/grant_table.h>
 #include <asm/p2m.h>
 
 int create_grant_p2m_mapping(uint64_t addr, mfn_t frame,
diff --git a/xen/arch/x86/include/asm/hvm/grant_table.h b/xen/arch/x86/include/asm/hvm/grant_table.h
index 33c1da1a25..01e23f79b8 100644
--- a/xen/arch/x86/include/asm/hvm/grant_table.h
+++ b/xen/arch/x86/include/asm/hvm/grant_table.h
@@ -10,6 +10,8 @@
 #ifndef __X86_HVM_GRANT_TABLE_H__
 #define __X86_HVM_GRANT_TABLE_H__
 
+#include <xen/mm-frame.h>
+
 #ifdef CONFIG_HVM
 
 int create_grant_p2m_mapping(uint64_t addr, mfn_t frame,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:44:53 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:44:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.639989.997719 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Fd7-000485-QT; Thu, 23 Nov 2023 19:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 639989.997719; Thu, 23 Nov 2023 19: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 1r6Fd7-00047x-Ns; Thu, 23 Nov 2023 19:44:53 +0000
Received: by outflank-mailman (input) for mailman id 639989;
 Thu, 23 Nov 2023 19:44:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fd6-00047m-TA
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:44:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fd6-0001XY-SQ
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fd6-000712-RE
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:44:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=A5q4YdSjeuvKBB5WsKsBTlN7R+9BW8OYc1+7dVdjetA=; b=tyDLsa7OmaRpN1b0hI9kMNITWr
	TsOTjVwxRzvbYWmGO3cUULIKe5u6yCNkcaKEIq3AV1mGNOCwbBCAchwWukKrI2Ezz5t3aXHaYNj8C
	6qjDWo7Q4i55RFE4M1kTxhtimLwPwYQ8XcpPr8e0nFptt+SqBSBYEdEeQu+PHYMhpzcI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/vm_event: add missing include for hvm_vm_event_do_resume
Message-Id: <E1r6Fd6-000712-RE@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:44:52 +0000

commit 8b9e6939a0c99a27fe6640073603fcbf098585b2
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Tue Nov 21 10:08:15 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 21 10:08:15 2023 +0100

    x86/vm_event: add missing include for hvm_vm_event_do_resume
    
    The missing header makes the declaration visible when the function
    is defined, thereby fixing a violation of MISRA C:2012 Rule 8.4.
    
    Fixes: 1366a0e76db6 ("x86/vm_event: add hvm/vm_event.{h,c}")
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/hvm/vm_event.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/vm_event.c b/xen/arch/x86/hvm/vm_event.c
index 3b064bcfad..c1af230e7a 100644
--- a/xen/arch/x86/hvm/vm_event.c
+++ b/xen/arch/x86/hvm/vm_event.c
@@ -24,6 +24,7 @@
 #include <xen/vm_event.h>
 #include <asm/hvm/emulate.h>
 #include <asm/hvm/support.h>
+#include <asm/hvm/vm_event.h>
 #include <asm/vm_event.h>
 
 static void hvm_vm_event_set_registers(const struct vcpu *v)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:45:03 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:45:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.639990.997722 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6FdH-0004BC-SB; Thu, 23 Nov 2023 19:45:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 639990.997722; Thu, 23 Nov 2023 19: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 1r6FdH-0004B4-PR; Thu, 23 Nov 2023 19:45:03 +0000
Received: by outflank-mailman (input) for mailman id 639990;
 Thu, 23 Nov 2023 19: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 1r6FdG-0004Ao-WB
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:45:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FdG-0001Y8-VS
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FdG-00071m-UX
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:45:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZPuGJnEvgUKR4i5rUXEPDEF+gAw1lAcPonHcuAn9PzM=; b=jWjGV4FnrDfZwsLV2BwIAsq3TL
	PahnfK2Gh8Rg+yGnP5MxUvds6fNfx39l6vGxgfPveLyGA+M1mUyuGUKrxGw+klC5EWLg4lm1RHIzk
	0iHr7RD7XB4Cr12dCHCatjyRI8qq013cXm4ngCs8jSlw8M4jAvtbrbU+kq9KGNKGspjo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/console: remove stub definition in consoled.h
Message-Id: <E1r6FdG-00071m-UX@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:45:02 +0000

commit e7ad219bb223113fc14df69655a07385fc2b2f86
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Tue Nov 21 10:08:46 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 21 10:08:46 2023 +0100

    xen/console: remove stub definition in consoled.h
    
    The stub definition of 'consoled_guest_tx' can be removed, since its
    its single caller uses the implementation built with PV_SHIM enabled.
    
    Fixes: 5ef49f185c2d ("x86/pv-shim: shadow PV console's page for L2 DomU")
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/include/xen/consoled.h | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/xen/include/xen/consoled.h b/xen/include/xen/consoled.h
index fd5d220a8a..2b30516b3a 100644
--- a/xen/include/xen/consoled.h
+++ b/xen/include/xen/consoled.h
@@ -3,18 +3,11 @@
 
 #include <public/io/console.h>
 
-#ifdef CONFIG_PV_SHIM
-
 void consoled_set_ring_addr(struct xencons_interface *ring);
 struct xencons_interface *consoled_get_ring_addr(void);
 size_t consoled_guest_rx(void);
 size_t consoled_guest_tx(char c);
 
-#else
-
-size_t consoled_guest_tx(char c) { return 0; }
-
-#endif /* !CONFIG_PV_SHIM */
 #endif /* __XEN_CONSOLED_H__ */
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:45:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:45:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.639991.997727 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6FdR-0004EM-VP; Thu, 23 Nov 2023 19:45:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 639991.997727; Thu, 23 Nov 2023 19: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 1r6FdR-0004EF-Sk; Thu, 23 Nov 2023 19:45:13 +0000
Received: by outflank-mailman (input) for mailman id 639991;
 Thu, 23 Nov 2023 19: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 1r6FdR-0004E9-3l
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19: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 1r6FdR-0001YI-2H
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:45:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FdR-00072K-1P
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19: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=frrETZA9xRGGQKoodVskILMla87hC8ifI89j2Z8NTw0=; b=GfTHoi/BSgI3VtyQMTnNJwzyi2
	BPmX1aEulO+0ZNNQfWX0yQZfa9gmJZfDBBHF11b0McxtDalR8FGpqiQ0sVxKWcikjuELFpI8PdF0B
	gzJYSufZC8cxNbD8Y1/Ji5Vmx4W9so3w766VcNsKZOoMFISFr8SB5QBwju+3Yxgb7SN4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mem_access: make function static
Message-Id: <E1r6FdR-00072K-1P@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:45:13 +0000

commit 707b8b8717d16e81bfef5c5cbfb6d177345f7a75
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Tue Nov 21 10:09:17 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 21 10:09:17 2023 +0100

    x86/mem_access: make function static
    
    The function is used only within this file, and therefore can be static.
    
    No functional change.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/mm/mem_access.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/mem_access.c b/xen/arch/x86/mm/mem_access.c
index 3449e0ee85..60a0cce68a 100644
--- a/xen/arch/x86/mm/mem_access.c
+++ b/xen/arch/x86/mm/mem_access.c
@@ -249,9 +249,9 @@ bool p2m_mem_access_check(paddr_t gpa, unsigned long gla,
     return (p2ma != p2m_access_n2rwx);
 }
 
-int p2m_set_altp2m_mem_access(struct domain *d, struct p2m_domain *hp2m,
-                              struct p2m_domain *ap2m, p2m_access_t a,
-                              gfn_t gfn)
+static int p2m_set_altp2m_mem_access(struct domain *d, struct p2m_domain *hp2m,
+                                     struct p2m_domain *ap2m, p2m_access_t a,
+                                     gfn_t gfn)
 {
     mfn_t mfn;
     p2m_type_t t;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:45:24 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:45:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.639992.997731 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Fdc-0004HH-0k; Thu, 23 Nov 2023 19:45:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 639992.997731; Thu, 23 Nov 2023 19:45:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Fdb-0004H9-UJ; Thu, 23 Nov 2023 19:45:23 +0000
Received: by outflank-mailman (input) for mailman id 639992;
 Thu, 23 Nov 2023 19: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 1r6Fdb-0004Gx-62
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19: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 1r6Fdb-0001YQ-5F
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:45:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fdb-00072o-4O
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19: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=Q5ATf1osdDUPvYCdmKUAeTmbrISrqDtNJu/MITRiByw=; b=pNWxeossIXZIWgtASTbS7mDqFG
	Ih8ada6Mfb4pifTQTIMJj91nS9USpY3uRCiSc7N4hRUR7kGzdvnSanOQFq3GpSOvTrLzcPl2p4Lo+
	dzXX1sKQvFcYUPZr+gRIpALOq+2bDEC+l7ga0/IjnJCf+XJyfjD7YeeQjqqgmQ2Z3WX0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/misra: exclude three more files
Message-Id: <E1r6Fdb-00072o-4O@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:45:23 +0000

commit a1f9490cccb7bda80d736cd439be4611286d2042
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Tue Nov 21 10:09:41 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 21 10:09:41 2023 +0100

    docs/misra: exclude three more files
    
    These files should not conform to MISRA guidelines at the moment,
    therefore they are added to the exclusion list.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 docs/misra/exclude-list.json | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/docs/misra/exclude-list.json b/docs/misra/exclude-list.json
index 575ed22a7f..b858a0baa1 100644
--- a/docs/misra/exclude-list.json
+++ b/docs/misra/exclude-list.json
@@ -145,6 +145,10 @@
             "rel_path": "common/zstd/*",
             "comment": "Imported from Linux, ignore for now"
         },
+        {
+            "rel_path": "common/symbols-dummy.c",
+            "comment": "The resulting code is not included in the final Xen binary, ignore for now"
+        },
         {
             "rel_path": "crypto/*",
             "comment": "Origin is external and documented in crypto/README.source"
@@ -189,6 +193,14 @@
             "rel_path": "include/acpi/acpixf.h",
             "comment": "Imported from Linux, ignore for now"
         },
+        {
+          "rel_path": "include/acpi/acexcep.h",
+          "comment": "Imported from Linux, ignore for now"
+        },
+        {
+          "rel_path": "include/acpi/acglobal.h",
+          "comment": "Imported from Linux, ignore for now"
+        },
         {
             "rel_path": "include/xen/acpi.h",
             "comment": "Imported from Linux, ignore for now"
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:45:35 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:45:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.639993.997735 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Fdn-0004LI-2T; Thu, 23 Nov 2023 19:45:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 639993.997735; Thu, 23 Nov 2023 19:45: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 1r6Fdm-0004L9-Vq; Thu, 23 Nov 2023 19:45:34 +0000
Received: by outflank-mailman (input) for mailman id 639993;
 Thu, 23 Nov 2023 19: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 1r6Fdl-0004Kr-97
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19: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 1r6Fdl-0001Yg-8I
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:45:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fdl-00075I-7S
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:45:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RKRQNl1vo7y7QJGlhB48wA1P2tr4J+gUT0TXrGJvA5U=; b=HDE4u5iT5dwBbBL8L91mGGrfYw
	YFa5hs+CDgtk/KeMRxmwJO9z9UHMpno7g3wTm3QJcUkvoHdP5N+tFPcKgTRUQCCKhgc9gOhp++am2
	EeK62UfPPW/0hg+Kzm7Tu0cW1gnDmUMoY3bkNwKqPNV5NEJ5IZgekBtyZQCEuQSd0Hgs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: Fix XEN_DOMCTL_gdbsx_guestmemio crash
Message-Id: <E1r6Fdl-00075I-7S@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:45:33 +0000

commit 71dd0f6e3b83d9f9fcf310904080752610da7033
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 20 16:26:33 2022 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 21 13:28:51 2023 +0000

    x86: Fix XEN_DOMCTL_gdbsx_guestmemio crash
    
    Prior to commit 9cd7e31b3f58 ("xen/iommu: cleanup iommu related domctl
    handling"), when CONFIG_GDBSX was compiled out, iommu_do_domctl() fell over a
    NULL pointer.  One of several bugs here is known-but-compiled-out subops
    falling into the default chain and hitting unrelated logic.
    
    Remove the CONFIG_GDBSX ifdefary in arch_do_domctl() by implementing
    gdbsx_domctl() and moving the logic across.
    
    As minor cleanup,
     * gdbsx_guest_mem_io() can become static
     * Remove opencoding of domain_vcpu() and %pd
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c            | 61 +---------------------------------
 xen/arch/x86/gdbsx.c             | 70 +++++++++++++++++++++++++++++++++++++++-
 xen/arch/x86/include/asm/gdbsx.h | 16 +++++++--
 3 files changed, 83 insertions(+), 64 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 1a8b4cff48..3c0ea85541 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -814,71 +814,12 @@ long arch_do_domctl(
     }
 #endif
 
-#ifdef CONFIG_GDBSX
     case XEN_DOMCTL_gdbsx_guestmemio:
-        ret = gdbsx_guest_mem_io(d, &domctl->u.gdbsx_guest_memio);
-        if ( !ret )
-           copyback = true;
-        break;
-
     case XEN_DOMCTL_gdbsx_pausevcpu:
-    {
-        struct vcpu *v;
-
-        ret = -EBUSY;
-        if ( !d->controller_pause_count )
-            break;
-        ret = -EINVAL;
-        if ( domctl->u.gdbsx_pauseunp_vcpu.vcpu >= d->max_vcpus ||
-             (v = d->vcpu[domctl->u.gdbsx_pauseunp_vcpu.vcpu]) == NULL )
-            break;
-        ret = vcpu_pause_by_systemcontroller(v);
-        break;
-    }
-
     case XEN_DOMCTL_gdbsx_unpausevcpu:
-    {
-        struct vcpu *v;
-
-        ret = -EBUSY;
-        if ( !d->controller_pause_count )
-            break;
-        ret = -EINVAL;
-        if ( domctl->u.gdbsx_pauseunp_vcpu.vcpu >= d->max_vcpus ||
-             (v = d->vcpu[domctl->u.gdbsx_pauseunp_vcpu.vcpu]) == NULL )
-            break;
-        ret = vcpu_unpause_by_systemcontroller(v);
-        if ( ret == -EINVAL )
-            printk(XENLOG_G_WARNING
-                   "WARN: d%d attempting to unpause %pv which is not paused\n",
-                   currd->domain_id, v);
-        break;
-    }
-
     case XEN_DOMCTL_gdbsx_domstatus:
-    {
-        struct vcpu *v;
-
-        domctl->u.gdbsx_domstatus.vcpu_id = -1;
-        domctl->u.gdbsx_domstatus.paused = d->controller_pause_count > 0;
-        if ( domctl->u.gdbsx_domstatus.paused )
-        {
-            for_each_vcpu ( d, v )
-            {
-                if ( v->arch.gdbsx_vcpu_event )
-                {
-                    domctl->u.gdbsx_domstatus.vcpu_id = v->vcpu_id;
-                    domctl->u.gdbsx_domstatus.vcpu_ev =
-                        v->arch.gdbsx_vcpu_event;
-                    v->arch.gdbsx_vcpu_event = 0;
-                    break;
-                }
-            }
-        }
-        copyback = true;
+        ret = gdbsx_domctl(d, domctl, &copyback);
         break;
-    }
-#endif
 
     case XEN_DOMCTL_setvcpuextstate:
     case XEN_DOMCTL_getvcpuextstate:
diff --git a/xen/arch/x86/gdbsx.c b/xen/arch/x86/gdbsx.c
index 6ef46e8ea7..21442f5dff 100644
--- a/xen/arch/x86/gdbsx.c
+++ b/xen/arch/x86/gdbsx.c
@@ -152,7 +152,8 @@ static unsigned int dbg_rw_guest_mem(struct domain *dp, unsigned long addr,
     return len;
 }
 
-int gdbsx_guest_mem_io(struct domain *d, struct xen_domctl_gdbsx_memio *iop)
+static int gdbsx_guest_mem_io(
+    struct domain *d, struct xen_domctl_gdbsx_memio *iop)
 {
     if ( d && !d->is_dying )
     {
@@ -178,6 +179,73 @@ void domain_pause_for_debugger(void)
         send_global_virq(VIRQ_DEBUGGER);
 }
 
+int gdbsx_domctl(struct domain *d, struct xen_domctl *domctl, bool *copyback)
+{
+    struct vcpu *v;
+    int ret;
+
+    switch ( domctl->cmd )
+    {
+    case XEN_DOMCTL_gdbsx_guestmemio:
+        ret = gdbsx_guest_mem_io(d, &domctl->u.gdbsx_guest_memio);
+        if ( !ret )
+            *copyback = true;
+        break;
+
+    case XEN_DOMCTL_gdbsx_pausevcpu:
+        ret = -EBUSY;
+        if ( !d->controller_pause_count )
+            break;
+        ret = -EINVAL;
+        if ( (v = domain_vcpu(d, domctl->u.gdbsx_pauseunp_vcpu.vcpu)) == NULL )
+            break;
+        ret = vcpu_pause_by_systemcontroller(v);
+        break;
+
+    case XEN_DOMCTL_gdbsx_unpausevcpu:
+        ret = -EBUSY;
+        if ( !d->controller_pause_count )
+            break;
+        ret = -EINVAL;
+        if ( (v = domain_vcpu(d, domctl->u.gdbsx_pauseunp_vcpu.vcpu)) == NULL )
+            break;
+        ret = vcpu_unpause_by_systemcontroller(v);
+        if ( ret == -EINVAL )
+            printk(XENLOG_G_WARNING
+                   "WARN: %pd attempting to unpause %pv which is not paused\n",
+                   current->domain, v);
+        break;
+
+    case XEN_DOMCTL_gdbsx_domstatus:
+        ret = 0;
+        domctl->u.gdbsx_domstatus.vcpu_id = -1;
+        domctl->u.gdbsx_domstatus.paused = d->controller_pause_count > 0;
+        if ( domctl->u.gdbsx_domstatus.paused )
+        {
+            for_each_vcpu ( d, v )
+            {
+                if ( v->arch.gdbsx_vcpu_event )
+                {
+                    domctl->u.gdbsx_domstatus.vcpu_id = v->vcpu_id;
+                    domctl->u.gdbsx_domstatus.vcpu_ev =
+                        v->arch.gdbsx_vcpu_event;
+                    v->arch.gdbsx_vcpu_event = 0;
+                    break;
+                }
+            }
+        }
+        *copyback = true;
+        break;
+
+    default:
+        ASSERT_UNREACHABLE();
+        ret = -ENOSYS;
+        break;
+    }
+
+    return ret;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/x86/include/asm/gdbsx.h b/xen/arch/x86/include/asm/gdbsx.h
index 938eb74e2e..e906be9ea3 100644
--- a/xen/arch/x86/include/asm/gdbsx.h
+++ b/xen/arch/x86/include/asm/gdbsx.h
@@ -2,18 +2,28 @@
 #ifndef __X86_GDBX_H__
 #define __X86_GDBX_H__
 
-#ifdef CONFIG_GDBSX
+#include <xen/stdbool.h>
 
 struct domain;
-struct xen_domctl_gdbsx_memio;
+struct xen_domctl;
 
-int gdbsx_guest_mem_io(struct domain *d, struct xen_domctl_gdbsx_memio *iop);
+#ifdef CONFIG_GDBSX
 
 void domain_pause_for_debugger(void);
 
+int gdbsx_domctl(struct domain *d, struct xen_domctl *domctl, bool *copyback);
+
 #else
 
+#include <xen/errno.h>
+
 static inline void domain_pause_for_debugger(void) {}
 
+static inline int gdbsx_domctl(
+    struct domain *d, struct xen_domctl *domctl, bool *copyback)
+{
+    return -ENOSYS;
+}
+
 #endif /* CONFIG_GDBSX */
 #endif /* __X86_GDBX_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:45:45 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:45:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.639994.997738 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Fdx-0004Oi-3U; Thu, 23 Nov 2023 19:45:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 639994.997738; Thu, 23 Nov 2023 19:45: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 1r6Fdx-0004OU-13; Thu, 23 Nov 2023 19:45:45 +0000
Received: by outflank-mailman (input) for mailman id 639994;
 Thu, 23 Nov 2023 19:45:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fdv-0004Nq-Bz
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:45:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fdv-0001ZD-BA
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:45:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fdv-00075h-AP
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:45:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Rrr+WWaLGe+ar3sDU+YkWYHuQw7hKIveFrYbqfvhs+Q=; b=pjvWKBu6MCp/2SlMiPqT4oIDdC
	565oN7AAfmFehULQ7A3FcPch6S/1jWq0ROXbsrXy2UD9Rv2tj/BQaWpTM7//zGNkLe10Xugtzr6+c
	Z3y/o10tc4QAklME0PqMIsE3hCC7LAbXQPiSVFaejmHGvVSETe1TCfeqMaSek8ukzlx0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Annotate printk() as cold
Message-Id: <E1r6Fdv-00075h-AP@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:45:43 +0000

commit 7e939abca7446256b59dc5d61e5ac444deb53da5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Feb 18 00:46:49 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 21 13:28:51 2023 +0000

    xen: Annotate printk() as cold
    
    There is no such thing as a fastpath with a printk() on it, making printk() an
    excellent heuristic for slowpaths.
    
    Net delta is:
    
      add/remove: 595/2 grow/shrink: 56/762 up/down: 70879/-87331 (-16452)
      Total: Before=4085425, After=4068973, chg -0.40%
    
    because cold functions are optimised differently.  For example, one function
    with a particularly large swing is:
    
      vmcs_dump_vcpu.cold                            -    2172   +2172
      vmcs_dump_vcpu                              7030     408   -6622
    
    with a net delta of 7030 down to 4450.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/lib.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 8eef557dd5..1793be5b6b 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -79,7 +79,7 @@ debugtrace_printk(const char *fmt, ...) {}
 /* Allows us to use '%p' as general-purpose machine-word format char. */
 #define _p(_x) ((void *)(unsigned long)(_x))
 extern void printk(const char *fmt, ...)
-    __attribute__ ((format (printf, 1, 2)));
+    __attribute__ ((format (printf, 1, 2), cold));
 
 #define printk_once(fmt, args...)               \
 ({                                              \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:45:55 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:45:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.639995.997743 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Fe7-0004cZ-5D; Thu, 23 Nov 2023 19:45:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 639995.997743; Thu, 23 Nov 2023 19:45:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Fe7-0004cR-2X; Thu, 23 Nov 2023 19:45:55 +0000
Received: by outflank-mailman (input) for mailman id 639995;
 Thu, 23 Nov 2023 19:45:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fe5-0004ac-El
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:45:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fe5-0001ZO-E0
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:45:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fe5-000768-DF
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:45:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lLns/8s9ra/1uy+afmkXshMd0MwXUGU0dRQoTW0pFV0=; b=WFQ25lRwXkz3mrjNDuSDXSWUlj
	fTO4q2JIkjlMTFk/e5W9VqUCXQkGiCRMmpG/K6KdYEml5ybGjUH04wuApdgC7iinbZJbDYjN8hOwm
	+XTtLjrdajThedIe5vvAtTJOfsd2+PoYf1enzHR/2gU2i0g0AtzJztli64+FKnXiUTO8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/entry: Use 32bit XOR in handle_ist_exception
Message-Id: <E1r6Fe5-000768-DF@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:45:53 +0000

commit 625f2cc66f53c7f1bf56562bf96c06510087d484
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 10 21:22:37 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 21 13:28:51 2023 +0000

    x86/entry: Use 32bit XOR in handle_ist_exception
    
    This is a micro-optimsiation for Silvermont microarchitectures, which don't
    recognise the 64bit form as a zeroing idiom.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/x86_64/entry.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 9a7b129aa7..d95fc75b34 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -1027,7 +1027,7 @@ handle_ist_exception:
          * Interrupted guest context. Clear the restore value for xen_cr3
          * and copy the context to stack bottom.
          */
-        xor   %r15, %r15
+        xor   %r15d, %r15d
         xor   %ebx, %ebx
         GET_CPUINFO_FIELD(guest_cpu_user_regs,di)
         movq  %rsp,%rsi
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:46:05 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:46:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.639996.997747 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6FeH-0004sr-6h; Thu, 23 Nov 2023 19:46:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 639996.997747; Thu, 23 Nov 2023 19:46:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6FeH-0004sh-3w; Thu, 23 Nov 2023 19:46:05 +0000
Received: by outflank-mailman (input) for mailman id 639996;
 Thu, 23 Nov 2023 19:46:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FeF-0004sX-II
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:46:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FeF-0001Zn-H7
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:46:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FeF-00077F-GH
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:46:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sP541yVJ/otJ8zhRMDnp18i3YT3iwfruQ9Kk7VSwSaA=; b=1QUh60QqbqxtUtvKhm3mOXaLUi
	PMLLhbytasU20iIHuVNvNLg29i4Pw5y8WSIz0P8vJO8+zPCLs/cj98xqiHvT/PPHcczypYQCYmzye
	XkRqTRRIawzkDh40+zKw8Rn6A4D2mtjL82UVTbQcGZVBbPlGsOW7bG7WL6zT0Oayc3ns=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/traps: More use of nocall
Message-Id: <E1r6FeF-00077F-GH@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:46:03 +0000

commit d9fc66554f2cebe74df20da848dc758e8ceb85f9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 26 18:21:35 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 21 13:28:51 2023 +0000

    x86/traps: More use of nocall
    
    sysenter_eflags_saved() and int80_direct_trap() are now only used by a single
    translation unit.  Move the declarations into the respective traps.c, renaming
    int80_direct_trap() to entry_int80() to match the style elsewhere.
    
    Annotate all 3 with nocall like all other entry paths.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/processor.h | 4 +---
 xen/arch/x86/pv/traps.c              | 3 ++-
 xen/arch/x86/traps.c                 | 2 ++
 xen/arch/x86/x86_64/entry.S          | 2 +-
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/include/asm/processor.h b/xen/arch/x86/include/asm/processor.h
index b0d2a62c07..ff62b080af 100644
--- a/xen/arch/x86/include/asm/processor.h
+++ b/xen/arch/x86/include/asm/processor.h
@@ -457,9 +457,7 @@ static inline void enable_nmis(void)
                      [cs] "r" (__HYPERVISOR_CS) );
 }
 
-void sysenter_entry(void);
-void sysenter_eflags_saved(void);
-void int80_direct_trap(void);
+void nocall sysenter_entry(void);
 
 struct stubs {
     union {
diff --git a/xen/arch/x86/pv/traps.c b/xen/arch/x86/pv/traps.c
index 240d1a2db7..83e84e2762 100644
--- a/xen/arch/x86/pv/traps.c
+++ b/xen/arch/x86/pv/traps.c
@@ -132,6 +132,7 @@ static void cf_check nmi_softirq(void)
     *v_ptr = NULL;
 }
 
+void nocall entry_int80(void);
 void nocall entry_int82(void);
 
 void __init pv_trap_init(void)
@@ -144,7 +145,7 @@ void __init pv_trap_init(void)
 
     /* Fast trap for int80 (faster than taking the #GP-fixup path). */
     _set_gate(idt_table + LEGACY_SYSCALL_VECTOR, SYS_DESC_irq_gate, 3,
-              &int80_direct_trap);
+              &entry_int80);
 
     open_softirq(NMI_SOFTIRQ, nmi_softirq);
 }
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index e1356f696a..9a6d29f24a 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1884,6 +1884,8 @@ void do_device_not_available(struct cpu_user_regs *regs)
 #endif
 }
 
+void nocall sysenter_eflags_saved(void);
+
 /* SAF-1-safe */
 void do_debug(struct cpu_user_regs *regs)
 {
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index d95fc75b34..c25b14dde6 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -385,7 +385,7 @@ UNLIKELY_END(sysenter_gpf)
 #endif
         jmp   .Lbounce_exception
 
-ENTRY(int80_direct_trap)
+ENTRY(entry_int80)
         ENDBR64
         ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP
         pushq $0
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:46:15 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:46:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.639997.997751 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6FeR-0005B0-85; Thu, 23 Nov 2023 19:46:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 639997.997751; Thu, 23 Nov 2023 19:46:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6FeR-0005As-5H; Thu, 23 Nov 2023 19:46:15 +0000
Received: by outflank-mailman (input) for mailman id 639997;
 Thu, 23 Nov 2023 19:46:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FeP-0005Af-Ki
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:46:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FeP-0001Zv-K2
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:46:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FeP-00077m-JE
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:46:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=n5aFO4fGROrDqmId4DigVjIaayHbMrCT0MYzP0FakAs=; b=JMASt+VdAtx9lRzYUunGVnf5QU
	T672czGgWaV16tSpOzVuSomSpbZRl2372Sw+vDiU+WkWoSU6mr8mal1LXKEPRXxkK66p2N1ZI9NoI
	N/Ar93PWsiQsqINsUotJjQhzv/uU8H2frsHcyvXH6cGGZ71MWG3DiDBFDccMeO397yow=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ioapic: Check 1k alignment for IO-APIC physical addresses
Message-Id: <E1r6FeP-00077m-JE@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:46:13 +0000

commit ee34444712999069cad457dd1792ea0921994c22
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Aug 5 12:39:30 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 21 13:28:51 2023 +0000

    x86/ioapic: Check 1k alignment for IO-APIC physical addresses
    
    The MP spec requires a minimum of 1k alignment.  So too does Xen's use of a
    single fixmap page to map the IO-APIC.
    
    Reject out-of-spec values so we don't end up in a position where a bad
    firmware value causes Xen to use the wrong mapping.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/io_apic.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 0ef61fb2f1..d11c880544 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2589,10 +2589,11 @@ static void __init ioapic_init_mappings(void)
         union IO_APIC_reg_01 reg_01;
         paddr_t ioapic_phys = mp_ioapics[i].mpc_apicaddr;
 
-        if ( !ioapic_phys )
+        if ( !ioapic_phys || !IS_ALIGNED(ioapic_phys, KB(1)) )
         {
             printk(KERN_ERR
-                   "WARNING: bogus zero IO-APIC address found in MPTABLE, disabling IO/APIC support!\n");
+                   "WARNING: bogus IO-APIC address %08lx found in MPTABLE, disabling IO-APIC support\n",
+                   ioapic_phys);
             smp_found_config = false;
             skip_ioapic_setup = true;
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:46:25 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:46:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.639998.997755 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Feb-0005IE-BF; Thu, 23 Nov 2023 19:46:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 639998.997755; Thu, 23 Nov 2023 19:46:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Feb-0005I6-8D; Thu, 23 Nov 2023 19:46:25 +0000
Received: by outflank-mailman (input) for mailman id 639998;
 Thu, 23 Nov 2023 19:46:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FeZ-0005HZ-Pu
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:46:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FeZ-0001a4-P4
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:46:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FeZ-00078T-OA
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:46:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OD6NJyDPisFK26CQ1h8kInmCYXY08jkaYUBqRP9D7P8=; b=IKltQFWrcMKMACgMhlXLska0mt
	JRUJnnShgzGqnmiI8Ls37sMoWx2rgtvlrj/o2iapHo/Bfz2iL6+yXapcO9WHz9v4Sv//IpMKYV9u9
	b6Hv8eVQsFyRJuaKR4vJApnThOL9AawKcLI2l82gdYyuSJ71A32t0y9LRrIRiBAWlgHE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/treewide: Switch bool_t to bool
Message-Id: <E1r6FeZ-00078T-OA@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:46:23 +0000

commit de577618c285e8c5806ebfcedf01ddbc9c3a7197
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 20 17:25:02 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 21 13:28:51 2023 +0000

    x86/treewide: Switch bool_t to bool
    
    ... as part of cleaning up the types used.  Minor style cleanup on some
    altered lines.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/microcode/core.c        |  4 ++--
 xen/arch/x86/cpu/mtrr/generic.c          |  2 +-
 xen/arch/x86/cpu/vpmu.c                  |  2 +-
 xen/arch/x86/cpu/vpmu_amd.c              |  4 ++--
 xen/arch/x86/cpu/vpmu_intel.c            |  6 +++---
 xen/arch/x86/hvm/asid.c                  |  4 ++--
 xen/arch/x86/hvm/emulate.c               | 28 ++++++++++++-------------
 xen/arch/x86/hvm/hvm.c                   | 36 ++++++++++++++++----------------
 xen/arch/x86/hvm/intercept.c             |  2 +-
 xen/arch/x86/hvm/mtrr.c                  | 12 +++++------
 xen/arch/x86/hvm/nestedhvm.c             |  4 ++--
 xen/arch/x86/hvm/stdvga.c                |  2 +-
 xen/arch/x86/hvm/svm/nestedsvm.c         | 16 +++++++-------
 xen/arch/x86/hvm/svm/svm.c               |  8 +++----
 xen/arch/x86/hvm/vlapic.c                | 31 ++++++++++++++-------------
 xen/arch/x86/hvm/vmx/vmcs.c              | 29 +++++++++++++------------
 xen/arch/x86/hvm/vmx/vmx.c               |  6 +++---
 xen/arch/x86/hvm/vmx/vvmx.c              | 20 +++++++++---------
 xen/arch/x86/include/asm/acpi.h          |  2 +-
 xen/arch/x86/include/asm/apic.h          |  2 +-
 xen/arch/x86/include/asm/domain.h        | 28 ++++++++++++-------------
 xen/arch/x86/include/asm/hardirq.h       |  2 +-
 xen/arch/x86/include/asm/hvm/asid.h      |  2 +-
 xen/arch/x86/include/asm/hvm/emulate.h   |  2 +-
 xen/arch/x86/include/asm/hvm/hvm.h       | 24 ++++++++++-----------
 xen/arch/x86/include/asm/hvm/io.h        |  8 +++----
 xen/arch/x86/include/asm/hvm/nestedhvm.h |  4 ++--
 xen/arch/x86/include/asm/hvm/vcpu.h      | 16 +++++++-------
 xen/arch/x86/include/asm/hvm/vlapic.h    | 12 +++++------
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h  | 10 ++++-----
 xen/arch/x86/include/asm/hvm/vmx/vmx.h   |  2 +-
 xen/arch/x86/include/asm/hvm/vmx/vvmx.h  |  2 +-
 xen/arch/x86/include/asm/mtrr.h          | 16 +++++++-------
 xen/arch/x86/include/asm/p2m.h           | 20 +++++++++---------
 xen/arch/x86/include/asm/page.h          |  2 +-
 xen/arch/x86/include/asm/paging.h        |  2 +-
 xen/arch/x86/include/asm/pci.h           |  8 +++----
 xen/arch/x86/include/asm/psr.h           |  2 +-
 xen/arch/x86/include/asm/vpmu.h          | 12 +++++------
 xen/arch/x86/mm/hap/nested_ept.c         | 12 +++++------
 xen/arch/x86/mm/mem_paging.c             |  2 +-
 xen/arch/x86/mm/p2m-ept.c                | 29 ++++++++++++-------------
 xen/arch/x86/mm/p2m-pod.c                |  2 +-
 xen/arch/x86/mm/p2m-pt.c                 |  6 +++---
 xen/arch/x86/mm/p2m.c                    |  9 ++++----
 xen/arch/x86/mm/paging.c                 |  6 +++---
 xen/arch/x86/x86_64/mmconf-fam10h.c      |  2 +-
 xen/arch/x86/x86_64/mmconfig-shared.c    |  8 +++----
 xen/arch/x86/x86_64/mmconfig_64.c        |  6 ++----
 49 files changed, 238 insertions(+), 238 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 65ebeb50de..95bcb52b22 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -58,7 +58,7 @@
 
 static module_t __initdata ucode_mod;
 static signed int __initdata ucode_mod_idx;
-static bool_t __initdata ucode_mod_forced;
+static bool __initdata ucode_mod_forced;
 static unsigned int nr_cores;
 
 /*
@@ -93,7 +93,7 @@ static struct ucode_mod_blob __initdata ucode_blob;
  * By default we will NOT parse the multiboot modules to see if there is
  * cpio image with the microcode images.
  */
-static bool_t __initdata ucode_scan;
+static bool __initdata ucode_scan;
 
 /* By default, ucode loading is done in NMI handler */
 static bool ucode_in_nmi = true;
diff --git a/xen/arch/x86/cpu/mtrr/generic.c b/xen/arch/x86/cpu/mtrr/generic.c
index 660ae26c23..25ae5f5b7d 100644
--- a/xen/arch/x86/cpu/mtrr/generic.c
+++ b/xen/arch/x86/cpu/mtrr/generic.c
@@ -120,7 +120,7 @@ void __init get_mtrr_state(void)
 	rdmsrl(MSR_MTRRcap, mtrr_state.mtrr_cap);
 }
 
-static bool_t __initdata mtrr_show;
+static bool __initdata mtrr_show;
 boolean_param("mtrr.show", mtrr_show);
 
 static const char *__init mtrr_attrib_to_str(mtrr_type x)
diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c
index a022126f18..ed84372b80 100644
--- a/xen/arch/x86/cpu/vpmu.c
+++ b/xen/arch/x86/cpu/vpmu.c
@@ -369,7 +369,7 @@ void vpmu_save(struct vcpu *v)
     apic_write(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
 }
 
-int vpmu_load(struct vcpu *v, bool_t from_guest)
+int vpmu_load(struct vcpu *v, bool from_guest)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     int ret;
diff --git a/xen/arch/x86/cpu/vpmu_amd.c b/xen/arch/x86/cpu/vpmu_amd.c
index 18266b9521..c28a7e3c47 100644
--- a/xen/arch/x86/cpu/vpmu_amd.c
+++ b/xen/arch/x86/cpu/vpmu_amd.c
@@ -31,7 +31,7 @@
 static unsigned int __read_mostly num_counters;
 static const u32 __read_mostly *counters;
 static const u32 __read_mostly *ctrls;
-static bool_t __read_mostly k7_counters_mirrored;
+static bool __read_mostly k7_counters_mirrored;
 
 #define F10H_NUM_COUNTERS   4
 #define F15H_NUM_COUNTERS   6
@@ -217,7 +217,7 @@ static int cf_check amd_vpmu_load(struct vcpu *v, bool from_guest)
 
     if ( from_guest )
     {
-        bool_t is_running = 0;
+        bool is_running = false;
         struct xen_pmu_amd_ctxt *guest_ctxt = &vpmu->xenpmu_data->pmu.c.amd;
 
         ASSERT(!has_vlapic(v->domain));
diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index 6330c89b47..0a73ae27a4 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -52,7 +52,7 @@
 
 /* Alias registers (0x4c1) for full-width writes to PMCs */
 #define MSR_PMC_ALIAS_MASK       (~(MSR_IA32_PERFCTR0 ^ MSR_IA32_A_PERFCTR0))
-static bool_t __read_mostly full_width_write;
+static bool __read_mostly full_width_write;
 
 /*
  * MSR_CORE_PERF_FIXED_CTR_CTRL contains the configuration of all fixed
@@ -607,7 +607,7 @@ static int cf_check core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
         tmp = msr - MSR_P6_EVNTSEL(0);
         if ( tmp >= 0 && tmp < arch_pmc_cnt )
         {
-            bool_t blocked = 0;
+            bool blocked = false;
             uint64_t umaskevent = msr_content & MSR_IA32_CMT_EVTSEL_UE_MASK;
             struct xen_pmu_cntr_pair *xen_pmu_cntr_pair =
                 vpmu_reg_pointer(core2_vpmu_cxt, arch_counters);
@@ -818,7 +818,7 @@ static int cf_check core2_vpmu_initialise(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     u64 msr_content;
-    static bool_t ds_warned;
+    static bool ds_warned;
 
     if ( v->domain->arch.cpuid->basic.pmu_version <= 1 ||
          v->domain->arch.cpuid->basic.pmu_version >= 6 )
diff --git a/xen/arch/x86/hvm/asid.c b/xen/arch/x86/hvm/asid.c
index 0faaa24a8f..8d27b7dba1 100644
--- a/xen/arch/x86/hvm/asid.c
+++ b/xen/arch/x86/hvm/asid.c
@@ -43,7 +43,7 @@ struct hvm_asid_data {
    uint64_t core_asid_generation;
    uint32_t next_asid;
    uint32_t max_asid;
-   bool_t disabled;
+   bool disabled;
 };
 
 static DEFINE_PER_CPU(struct hvm_asid_data, hvm_asid_data);
@@ -100,7 +100,7 @@ void hvm_asid_flush_core(void)
     data->disabled = 1;
 }
 
-bool_t hvm_asid_handle_vmenter(struct hvm_vcpu_asid *asid)
+bool hvm_asid_handle_vmenter(struct hvm_vcpu_asid *asid)
 {
     struct hvm_asid_data *data = &this_cpu(hvm_asid_data);
 
diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 254716c766..15d9962f3a 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -150,8 +150,8 @@ void hvmemul_cancel(struct vcpu *v)
 }
 
 static int hvmemul_do_io(
-    bool_t is_mmio, paddr_t addr, unsigned long *reps, unsigned int size,
-    uint8_t dir, bool_t df, bool_t data_is_addr, uintptr_t data)
+    bool is_mmio, paddr_t addr, unsigned long *reps, unsigned int size,
+    uint8_t dir, bool df, bool data_is_addr, uintptr_t data)
 {
     struct vcpu *curr = current;
     struct domain *currd = curr->domain;
@@ -363,8 +363,8 @@ static int hvmemul_do_io(
 }
 
 static int hvmemul_do_io_buffer(
-    bool_t is_mmio, paddr_t addr, unsigned long *reps, unsigned int size,
-    uint8_t dir, bool_t df, void *buffer)
+    bool is_mmio, paddr_t addr, unsigned long *reps, unsigned int size,
+    uint8_t dir, bool df, void *buffer)
 {
     int rc;
 
@@ -421,8 +421,8 @@ static inline void hvmemul_release_page(struct page_info *page)
 }
 
 static int hvmemul_do_io_addr(
-    bool_t is_mmio, paddr_t addr, unsigned long *reps,
-    unsigned int size, uint8_t dir, bool_t df, paddr_t ram_gpa)
+    bool is_mmio, paddr_t addr, unsigned long *reps,
+    unsigned int size, uint8_t dir, bool df, paddr_t ram_gpa)
 {
     struct vcpu *v = current;
     unsigned long ram_gmfn = paddr_to_pfn(ram_gpa);
@@ -510,7 +510,7 @@ static int hvmemul_do_pio_addr(uint16_t port,
                                unsigned long *reps,
                                unsigned int size,
                                uint8_t dir,
-                               bool_t df,
+                               bool df,
                                paddr_t ram_addr)
 {
     return hvmemul_do_io_addr(0, port, reps, size, dir, df, ram_addr);
@@ -534,7 +534,7 @@ static int hvmemul_do_mmio_buffer(paddr_t mmio_gpa,
                                   unsigned long *reps,
                                   unsigned int size,
                                   uint8_t dir,
-                                  bool_t df,
+                                  bool df,
                                   void *buffer)
 {
     return hvmemul_do_io_buffer(1, mmio_gpa, reps, size, dir, df, buffer);
@@ -554,7 +554,7 @@ static int hvmemul_do_mmio_addr(paddr_t mmio_gpa,
                                 unsigned long *reps,
                                 unsigned int size,
                                 uint8_t dir,
-                                bool_t df,
+                                bool df,
                                 paddr_t ram_gpa)
 {
     return hvmemul_do_io_addr(1, mmio_gpa, reps, size, dir, df, ram_gpa);
@@ -1034,7 +1034,7 @@ static struct hvm_mmio_cache *hvmemul_find_mmio_cache(
 }
 
 static void latch_linear_to_phys(struct hvm_vcpu_io *hvio, unsigned long gla,
-                                 unsigned long gpa, bool_t write)
+                                 unsigned long gpa, bool write)
 {
     if ( hvio->mmio_access.gla_valid )
         return;
@@ -1048,7 +1048,7 @@ static void latch_linear_to_phys(struct hvm_vcpu_io *hvio, unsigned long gla,
 
 static int hvmemul_linear_mmio_access(
     unsigned long gla, unsigned int size, uint8_t dir, void *buffer,
-    uint32_t pfec, struct hvm_emulate_ctxt *hvmemul_ctxt, bool_t known_gpfn)
+    uint32_t pfec, struct hvm_emulate_ctxt *hvmemul_ctxt, bool known_gpfn)
 {
     struct hvm_vcpu_io *hvio = &current->arch.hvm.hvm_io;
     unsigned long offset = gla & ~PAGE_MASK;
@@ -1101,7 +1101,7 @@ static int hvmemul_linear_mmio_access(
 static inline int hvmemul_linear_mmio_read(
     unsigned long gla, unsigned int size, void *buffer,
     uint32_t pfec, struct hvm_emulate_ctxt *hvmemul_ctxt,
-    bool_t translate)
+    bool translate)
 {
     return hvmemul_linear_mmio_access(gla, size, IOREQ_READ, buffer,
                                       pfec, hvmemul_ctxt, translate);
@@ -1110,7 +1110,7 @@ static inline int hvmemul_linear_mmio_read(
 static inline int hvmemul_linear_mmio_write(
     unsigned long gla, unsigned int size, void *buffer,
     uint32_t pfec, struct hvm_emulate_ctxt *hvmemul_ctxt,
-    bool_t translate)
+    bool translate)
 {
     return hvmemul_linear_mmio_access(gla, size, IOREQ_WRITE, buffer,
                                       pfec, hvmemul_ctxt, translate);
@@ -1990,7 +1990,7 @@ static int cf_check hvmemul_rep_stos(
     unsigned long addr;
     paddr_t gpa;
     p2m_type_t p2mt;
-    bool_t df = !!(ctxt->regs->eflags & X86_EFLAGS_DF);
+    bool df = ctxt->regs->eflags & X86_EFLAGS_DF;
     int rc = hvmemul_virtual_to_linear(seg, offset, bytes_per_rep, reps,
                                        hvm_access_write, hvmemul_ctxt, &addr);
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 482eebbabf..35a30df3b1 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -69,7 +69,7 @@
 
 #include <compat/hvm/hvm_op.h>
 
-bool_t __read_mostly hvm_enabled;
+bool __read_mostly hvm_enabled;
 
 #ifdef DBG_LEVEL_0
 unsigned int opt_hvm_debug_level __read_mostly;
@@ -87,12 +87,12 @@ unsigned long __section(".bss.page_aligned") __aligned(PAGE_SIZE)
     hvm_io_bitmap[HVM_IOBITMAP_SIZE / BYTES_PER_LONG];
 
 /* Xen command-line option to enable HAP */
-static bool_t __initdata opt_hap_enabled = 1;
+static bool __initdata opt_hap_enabled = true;
 boolean_param("hap", opt_hap_enabled);
 
 #ifndef opt_hvm_fep
 /* Permit use of the Forced Emulation Prefix in HVM guests */
-bool_t __read_mostly opt_hvm_fep;
+bool __read_mostly opt_hvm_fep;
 boolean_param("hvm_fep", opt_hvm_fep);
 #endif
 static const char __initconst warning_hvm_fep[] =
@@ -102,7 +102,7 @@ static const char __initconst warning_hvm_fep[] =
     "Please *DO NOT* use this in production.\n";
 
 /* Xen command-line option to enable altp2m */
-static bool_t __initdata opt_altp2m_enabled = 0;
+static bool __initdata opt_altp2m_enabled;
 boolean_param("altp2m", opt_altp2m_enabled);
 
 static int cf_check cpu_callback(
@@ -1857,7 +1857,7 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
     /* Check access permissions first, then handle faults */
     if ( !mfn_eq(mfn, INVALID_MFN) )
     {
-        bool_t violation;
+        bool violation;
 
         /* If the access is against the permissions, then send to vm_event */
         switch (p2ma)
@@ -1914,7 +1914,7 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
             /* Should #VE be emulated for this fault? */
             if ( p2m_is_altp2m(p2m) && !cpu_has_vmx_virt_exceptions )
             {
-                bool_t sve;
+                bool sve;
 
                 p2m->get_entry(p2m, _gfn(gfn), &p2mt, &p2ma, 0, NULL, &sve);
 
@@ -2125,7 +2125,7 @@ int hvm_set_efer(uint64_t value)
 }
 
 /* Exit UC mode only if all VCPUs agree on MTRR/PAT and are not in no_fill. */
-static bool_t domain_exit_uc_mode(struct vcpu *v)
+static bool domain_exit_uc_mode(struct vcpu *v)
 {
     struct domain *d = v->domain;
     struct vcpu *vs;
@@ -2142,7 +2142,7 @@ static bool_t domain_exit_uc_mode(struct vcpu *v)
     return 1;
 }
 
-static void hvm_set_uc_mode(struct vcpu *v, bool_t is_in_uc_mode)
+static void hvm_set_uc_mode(struct vcpu *v, bool is_in_uc_mode)
 {
     v->domain->arch.hvm.is_in_uc_mode = is_in_uc_mode;
     shadow_blow_tables_per_domain(v->domain);
@@ -2705,8 +2705,8 @@ struct hvm_write_map {
 
 /* On non-NULL return, we leave this function holding an additional 
  * ref on the underlying mfn, if any */
-static void *_hvm_map_guest_frame(unsigned long gfn, bool_t permanent,
-                                  bool_t *writable)
+static void *_hvm_map_guest_frame(unsigned long gfn, bool permanent,
+                                  bool *writable)
 {
     void *map;
     p2m_type_t p2mt;
@@ -2750,19 +2750,19 @@ static void *_hvm_map_guest_frame(unsigned long gfn, bool_t permanent,
     return map;
 }
 
-void *hvm_map_guest_frame_rw(unsigned long gfn, bool_t permanent,
-                             bool_t *writable)
+void *hvm_map_guest_frame_rw(unsigned long gfn, bool permanent,
+                             bool *writable)
 {
     *writable = 1;
     return _hvm_map_guest_frame(gfn, permanent, writable);
 }
 
-void *hvm_map_guest_frame_ro(unsigned long gfn, bool_t permanent)
+void *hvm_map_guest_frame_ro(unsigned long gfn, bool permanent)
 {
     return _hvm_map_guest_frame(gfn, permanent, NULL);
 }
 
-void hvm_unmap_guest_frame(void *p, bool_t permanent)
+void hvm_unmap_guest_frame(void *p, bool permanent)
 {
     mfn_t mfn;
     struct page_info *page;
@@ -2806,7 +2806,7 @@ void hvm_mapped_guest_frames_mark_dirty(struct domain *d)
     spin_unlock(&d->arch.hvm.write_map.lock);
 }
 
-static void *hvm_map_entry(unsigned long va, bool_t *writable)
+static void *hvm_map_entry(unsigned long va, bool *writable)
 {
     unsigned long gfn;
     uint32_t pfec;
@@ -2851,7 +2851,7 @@ static int task_switch_load_seg(
     struct segment_register desctab, segr;
     seg_desc_t *pdesc = NULL, desc;
     u8 dpl, rpl;
-    bool_t writable;
+    bool writable;
     int fault_type = X86_EXC_TS;
     struct vcpu *v = current;
 
@@ -3030,7 +3030,7 @@ void hvm_task_switch(
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     struct segment_register gdt, tr, prev_tr, segr;
     seg_desc_t *optss_desc = NULL, *nptss_desc = NULL, tss_desc;
-    bool_t otd_writable, ntd_writable;
+    bool otd_writable, ntd_writable;
     unsigned int eflags, new_cpl;
     pagefault_info_t pfinfo;
     int exn_raised, rc;
@@ -4642,7 +4642,7 @@ static int do_altp2m_op(
     case HVMOP_altp2m_set_domain_state:
     {
         struct vcpu *v;
-        bool_t ostate;
+        bool ostate;
 
         if ( nestedhvm_enabled(d) )
         {
diff --git a/xen/arch/x86/hvm/intercept.c b/xen/arch/x86/hvm/intercept.c
index 61664c0ad1..a949419cbe 100644
--- a/xen/arch/x86/hvm/intercept.c
+++ b/xen/arch/x86/hvm/intercept.c
@@ -324,7 +324,7 @@ bool relocate_portio_handler(struct domain *d, unsigned int old_port,
     return false;
 }
 
-bool_t hvm_mmio_internal(paddr_t gpa)
+bool hvm_mmio_internal(paddr_t gpa)
 {
     const struct hvm_io_handler *handler;
     const struct hvm_io_ops *ops;
diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c
index 7f486358b1..52df34a6de 100644
--- a/xen/arch/x86/hvm/mtrr.c
+++ b/xen/arch/x86/hvm/mtrr.c
@@ -359,7 +359,7 @@ uint32_t get_pat_flags(struct vcpu *v,
     return pat_type_2_pte_flags(pat_entry_value);
 }
 
-static inline bool_t valid_mtrr_type(uint8_t type)
+static inline bool valid_mtrr_type(uint8_t type)
 {
     switch ( type )
     {
@@ -373,8 +373,8 @@ static inline bool_t valid_mtrr_type(uint8_t type)
     return 0;
 }
 
-bool_t mtrr_def_type_msr_set(struct domain *d, struct mtrr_state *m,
-                             uint64_t msr_content)
+bool mtrr_def_type_msr_set(struct domain *d, struct mtrr_state *m,
+                           uint64_t msr_content)
 {
     uint8_t def_type = msr_content & 0xff;
     bool fixed_enabled = MASK_EXTR(msr_content, MTRRdefType_FE);
@@ -405,8 +405,8 @@ bool_t mtrr_def_type_msr_set(struct domain *d, struct mtrr_state *m,
     return 1;
 }
 
-bool_t mtrr_fix_range_msr_set(struct domain *d, struct mtrr_state *m,
-                              uint32_t row, uint64_t msr_content)
+bool mtrr_fix_range_msr_set(struct domain *d, struct mtrr_state *m,
+                            uint32_t row, uint64_t msr_content)
 {
     uint64_t *fixed_range_base = (uint64_t *)m->fixed_ranges;
 
@@ -428,7 +428,7 @@ bool_t mtrr_fix_range_msr_set(struct domain *d, struct mtrr_state *m,
     return 1;
 }
 
-bool_t mtrr_var_range_msr_set(
+bool mtrr_var_range_msr_set(
     struct domain *d, struct mtrr_state *m, uint32_t msr, uint64_t msr_content)
 {
     uint32_t index, phys_addr;
diff --git a/xen/arch/x86/hvm/nestedhvm.c b/xen/arch/x86/hvm/nestedhvm.c
index 64d7eec9a1..12bf7172b8 100644
--- a/xen/arch/x86/hvm/nestedhvm.c
+++ b/xen/arch/x86/hvm/nestedhvm.c
@@ -16,7 +16,7 @@
 static unsigned long *shadow_io_bitmap[3];
 
 /* Nested VCPU */
-bool_t
+bool
 nestedhvm_vcpu_in_guestmode(struct vcpu *v)
 {
     return vcpu_nestedhvm(v).nv_guestmode;
@@ -155,7 +155,7 @@ static int __init cf_check nestedhvm_setup(void)
 __initcall(nestedhvm_setup);
 
 unsigned long *
-nestedhvm_vcpu_iomap_get(bool_t ioport_80, bool_t ioport_ed)
+nestedhvm_vcpu_iomap_get(bool ioport_80, bool ioport_ed)
 {
     int i;
 
diff --git a/xen/arch/x86/hvm/stdvga.c b/xen/arch/x86/hvm/stdvga.c
index 8da07ff8a2..b16c59f772 100644
--- a/xen/arch/x86/hvm/stdvga.c
+++ b/xen/arch/x86/hvm/stdvga.c
@@ -126,7 +126,7 @@ static void stdvga_cache_disable(struct hvm_hw_stdvga *s)
     s->cache = STDVGA_CACHE_DISABLED;
 }
 
-static bool_t stdvga_cache_is_enabled(const struct hvm_hw_stdvga *s)
+static bool stdvga_cache_is_enabled(const struct hvm_hw_stdvga *s)
 {
     return s->cache == STDVGA_CACHE_ENABLED;
 }
diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index a09b6abaae..4073c317ec 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -50,7 +50,7 @@ int nestedsvm_vmcb_map(struct vcpu *v, uint64_t vmcbaddr)
 
     if ( !nv->nv_vvmcx )
     {
-        bool_t writable;
+        bool writable;
         void *vvmcx = hvm_map_guest_frame_rw(paddr_to_pfn(vmcbaddr), 1,
                                              &writable);
 
@@ -346,7 +346,7 @@ static int nsvm_vcpu_hostrestore(struct vcpu *v, struct cpu_user_regs *regs)
     return 0;
 }
 
-static int nsvm_vmrun_permissionmap(struct vcpu *v, bool_t viopm)
+static int nsvm_vmrun_permissionmap(struct vcpu *v, bool viopm)
 {
     struct svm_vcpu *arch_svm = &v->arch.hvm.svm;
     struct nestedsvm *svm = &vcpu_nestedsvm(v);
@@ -357,7 +357,7 @@ static int nsvm_vmrun_permissionmap(struct vcpu *v, bool_t viopm)
     unsigned int i;
     enum hvm_translation_result ret;
     unsigned long *ns_viomap;
-    bool_t ioport_80 = 1, ioport_ed = 1;
+    bool ioport_80 = true, ioport_ed = true;
 
     ns_msrpm_ptr = (unsigned long *)svm->ns_cached_msrpm;
 
@@ -853,9 +853,9 @@ uint64_t cf_check nsvm_vcpu_hostcr3(struct vcpu *v)
 
 static int
 nsvm_vmcb_guest_intercepts_msr(unsigned long *msr_bitmap,
-    uint32_t msr, bool_t write)
+    uint32_t msr, bool write)
 {
-    bool_t enabled;
+    bool enabled;
     unsigned long *msr_bit;
 
     msr_bit = svm_msrbit(msr_bitmap, msr);
@@ -887,7 +887,7 @@ nsvm_vmcb_guest_intercepts_ioio(paddr_t iopm_pa, uint64_t exitinfo1)
     ioio_info_t ioinfo;
     uint16_t port;
     unsigned int size;
-    bool_t enabled;
+    bool enabled;
 
     ioinfo.bytes = exitinfo1;
     port = ioinfo.fields.port;
@@ -926,7 +926,7 @@ nsvm_vmcb_guest_intercepts_ioio(paddr_t iopm_pa, uint64_t exitinfo1)
     return NESTEDHVM_VMEXIT_INJECT;
 }
 
-static bool_t
+static bool
 nsvm_vmcb_guest_intercepts_exitcode(struct vcpu *v,
     struct cpu_user_regs *regs, uint64_t exitcode)
 {
@@ -1289,7 +1289,7 @@ enum nestedhvm_vmexits
 nestedsvm_check_intercepts(struct vcpu *v, struct cpu_user_regs *regs,
     uint64_t exitcode)
 {
-    bool_t is_intercepted;
+    bool is_intercepted;
 
     ASSERT(vcpu_nestedhvm(v).nv_vmexit_pending == 0);
     is_intercepted = nsvm_vmcb_guest_intercepts_exitcode(v, regs, exitcode);
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 674e54e04a..df4cb3fd33 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -59,7 +59,7 @@ static DEFINE_PER_CPU_READ_MOSTLY(paddr_t, host_vmcb);
 static DEFINE_PER_CPU(struct vmcb_struct *, host_vmcb_va);
 #endif
 
-static bool_t amd_erratum383_found __read_mostly;
+static bool amd_erratum383_found __read_mostly;
 
 /* OSVW bits */
 static uint64_t osvw_length, osvw_status;
@@ -1014,7 +1014,7 @@ static void noreturn cf_check svm_do_resume(void)
     bool debug_state = (v->domain->debugger_attached ||
                         v->domain->arch.monitor.software_breakpoint_enabled ||
                         v->domain->arch.monitor.debug_exception_enabled);
-    bool_t vcpu_guestmode = 0;
+    bool vcpu_guestmode = false;
     struct vlapic *vlapic = vcpu_vlapic(v);
 
     if ( nestedhvm_enabled(v->domain) && nestedhvm_vcpu_in_guestmode(v) )
@@ -2537,7 +2537,7 @@ static struct hvm_function_table __initdata_cf_clobber svm_function_table = {
 
 const struct hvm_function_table * __init start_svm(void)
 {
-    bool_t printed = 0;
+    bool printed = false;
 
     svm_host_osvw_reset();
 
@@ -2594,7 +2594,7 @@ void svm_vmexit_handler(void)
     struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
     int insn_len, rc;
     vintr_t intr;
-    bool_t vcpu_guestmode = 0;
+    bool vcpu_guestmode = false;
     struct vlapic *vlapic = vcpu_vlapic(v);
 
     regs->rax = vmcb->rax;
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index a8e87c4446..a54010d71e 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -191,10 +191,10 @@ uint32_t vlapic_set_ppr(struct vlapic *vlapic)
    return ppr;
 }
 
-static bool_t vlapic_match_logical_addr(const struct vlapic *vlapic,
-                                        uint32_t mda)
+static bool vlapic_match_logical_addr(const struct vlapic *vlapic,
+                                      uint32_t mda)
 {
-    bool_t result = 0;
+    bool result = false;
     uint32_t logical_id = vlapic_get_reg(vlapic, APIC_LDR);
 
     if ( vlapic_x2apic_mode(vlapic) )
@@ -224,9 +224,9 @@ static bool_t vlapic_match_logical_addr(const struct vlapic *vlapic,
     return result;
 }
 
-bool_t vlapic_match_dest(
+bool vlapic_match_dest(
     const struct vlapic *target, const struct vlapic *source,
-    int short_hand, uint32_t dest, bool_t dest_mode)
+    int short_hand, uint32_t dest, bool dest_mode)
 {
     HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "target %p, source %p, dest %#x, "
                 "dest_mode %#x, short_hand %#x",
@@ -264,7 +264,7 @@ static void vlapic_init_sipi_one(struct vcpu *target, uint32_t icr)
     switch ( icr & APIC_MODE_MASK )
     {
     case APIC_DM_INIT: {
-        bool_t fpu_initialised;
+        bool fpu_initialised;
         int rc;
 
         /* No work on INIT de-assert for P4-type APIC. */
@@ -307,7 +307,7 @@ static void cf_check vlapic_init_sipi_action(void *data)
     uint32_t icr = vcpu_vlapic(origin)->init_sipi.icr;
     uint32_t dest = vcpu_vlapic(origin)->init_sipi.dest;
     uint32_t short_hand = icr & APIC_SHORT_MASK;
-    bool_t dest_mode = !!(icr & APIC_DEST_MASK);
+    bool dest_mode = icr & APIC_DEST_MASK;
     struct vcpu *v;
 
     if ( icr == 0 )
@@ -349,7 +349,8 @@ static void vlapic_accept_irq(struct vcpu *v, uint32_t icr_low)
     case APIC_DM_NMI:
         if ( !test_and_set_bool(v->arch.nmi_pending) )
         {
-            bool_t wake = 0;
+            bool wake = false;
+
             domain_lock(v->domain);
             if ( v->is_initialised )
                 wake = test_and_clear_bit(_VPF_down, &v->pause_flags);
@@ -373,7 +374,7 @@ static void vlapic_accept_irq(struct vcpu *v, uint32_t icr_low)
 
 struct vlapic *vlapic_lowest_prio(
     struct domain *d, const struct vlapic *source,
-    int short_hand, uint32_t dest, bool_t dest_mode)
+    int short_hand, uint32_t dest, bool dest_mode)
 {
     int old = hvm_domain_irq(d)->round_robin_prev_vcpu;
     uint32_t ppr, target_ppr = UINT_MAX;
@@ -457,8 +458,8 @@ void vlapic_handle_EOI(struct vlapic *vlapic, u8 vector)
     hvm_dpci_msi_eoi(d, vector);
 }
 
-static bool_t is_multicast_dest(struct vlapic *vlapic, unsigned int short_hand,
-                                uint32_t dest, bool_t dest_mode)
+static bool is_multicast_dest(struct vlapic *vlapic, unsigned int short_hand,
+                              uint32_t dest, bool dest_mode)
 {
     if ( vlapic_domain(vlapic)->max_vcpus <= 2 )
         return 0;
@@ -482,7 +483,7 @@ void vlapic_ipi(
 {
     unsigned int dest;
     unsigned int short_hand = icr_low & APIC_SHORT_MASK;
-    bool_t dest_mode = !!(icr_low & APIC_DEST_MASK);
+    bool dest_mode = icr_low & APIC_DEST_MASK;
 
     HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "icr = 0x%08x:%08x", icr_high, icr_low);
 
@@ -523,7 +524,7 @@ void vlapic_ipi(
         /* fall through */
     default: {
         struct vcpu *v;
-        bool_t batch = is_multicast_dest(vlapic, short_hand, dest, dest_mode);
+        bool batch = is_multicast_dest(vlapic, short_hand, dest, dest_mode);
 
         if ( batch )
             cpu_raise_softirq_batch_begin();
@@ -1342,7 +1343,7 @@ int vlapic_has_pending_irq(struct vcpu *v)
     return irr;
 }
 
-int vlapic_ack_pending_irq(struct vcpu *v, int vector, bool_t force_ack)
+int vlapic_ack_pending_irq(struct vcpu *v, int vector, bool force_ack)
 {
     struct vlapic *vlapic = vcpu_vlapic(v);
     int isr;
@@ -1377,7 +1378,7 @@ int vlapic_ack_pending_irq(struct vcpu *v, int vector, bool_t force_ack)
     return 1;
 }
 
-bool_t is_vlapic_lvtpc_enabled(struct vlapic *vlapic)
+bool is_vlapic_lvtpc_enabled(struct vlapic *vlapic)
 {
     return (vlapic_enabled(vlapic) &&
             !(vlapic_get_reg(vlapic, APIC_LVTPC) & APIC_LVT_MASKED));
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 6cefb88aec..6711697ff6 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -32,13 +32,13 @@
 #include <asm/tboot.h>
 #include <asm/apic.h>
 
-static bool_t __read_mostly opt_vpid_enabled = 1;
+static bool __read_mostly opt_vpid_enabled = true;
 boolean_param("vpid", opt_vpid_enabled);
 
-static bool_t __read_mostly opt_unrestricted_guest_enabled = 1;
+static bool __read_mostly opt_unrestricted_guest_enabled = true;
 boolean_param("unrestricted_guest", opt_unrestricted_guest_enabled);
 
-static bool_t __read_mostly opt_apicv_enabled = 1;
+static bool __read_mostly opt_apicv_enabled = true;
 boolean_param("apicv", opt_apicv_enabled);
 
 /*
@@ -168,12 +168,12 @@ u32 vmx_vmexit_control __read_mostly;
 u32 vmx_vmentry_control __read_mostly;
 u64 vmx_ept_vpid_cap __read_mostly;
 u64 vmx_vmfunc __read_mostly;
-bool_t vmx_virt_exception __read_mostly;
+bool vmx_virt_exception __read_mostly;
 
 static DEFINE_PER_CPU_READ_MOSTLY(paddr_t, vmxon_region);
 static DEFINE_PER_CPU(paddr_t, current_vmcs);
 static DEFINE_PER_CPU(struct list_head, active_vmcs_list);
-DEFINE_PER_CPU(bool_t, vmxon);
+DEFINE_PER_CPU(bool, vmxon);
 
 static u32 vmcs_revision_id __read_mostly;
 u64 __read_mostly vmx_basic_msr;
@@ -209,7 +209,7 @@ static void __init vmx_display_features(void)
 }
 
 static u32 adjust_vmx_controls(
-    const char *name, u32 ctl_min, u32 ctl_opt, u32 msr, bool_t *mismatch)
+    const char *name, u32 ctl_min, u32 ctl_opt, u32 msr, bool *mismatch)
 {
     u32 vmx_msr_low, vmx_msr_high, ctl = ctl_min | ctl_opt;
 
@@ -229,7 +229,7 @@ static u32 adjust_vmx_controls(
     return ctl;
 }
 
-static bool_t cap_check(const char *name, u32 expected, u32 saw)
+static bool cap_check(const char *name, u32 expected, u32 saw)
 {
     if ( saw != expected )
         printk("VMX %s: saw %#x expected %#x\n", name, saw, expected);
@@ -247,7 +247,7 @@ static int vmx_init_vmcs_config(bool bsp)
     u32 _vmx_vmexit_control;
     u32 _vmx_vmentry_control;
     u64 _vmx_vmfunc = 0;
-    bool_t mismatch = 0;
+    bool mismatch = false;
 
     rdmsr(MSR_IA32_VMX_BASIC, vmx_basic_msr_low, vmx_basic_msr_high);
 
@@ -802,7 +802,7 @@ struct foreign_vmcs {
 };
 static DEFINE_PER_CPU(struct foreign_vmcs, foreign_vmcs);
 
-bool_t vmx_vmcs_try_enter(struct vcpu *v)
+bool vmx_vmcs_try_enter(struct vcpu *v)
 {
     struct foreign_vmcs *fv;
 
@@ -840,7 +840,7 @@ bool_t vmx_vmcs_try_enter(struct vcpu *v)
 
 void vmx_vmcs_enter(struct vcpu *v)
 {
-    bool_t okay = vmx_vmcs_try_enter(v);
+    bool okay = vmx_vmcs_try_enter(v);
 
     ASSERT(okay);
 }
@@ -1599,10 +1599,9 @@ void vmx_clear_eoi_exit_bitmap(struct vcpu *v, u8 vector)
                 &v->arch.hvm.vmx.eoi_exitmap_changed);
 }
 
-bool_t vmx_vcpu_pml_enabled(const struct vcpu *v)
+bool vmx_vcpu_pml_enabled(const struct vcpu *v)
 {
-    return !!(v->arch.hvm.vmx.secondary_exec_control &
-              SECONDARY_EXEC_ENABLE_PML);
+    return v->arch.hvm.vmx.secondary_exec_control & SECONDARY_EXEC_ENABLE_PML;
 }
 
 int vmx_vcpu_enable_pml(struct vcpu *v)
@@ -1704,7 +1703,7 @@ void vmx_vcpu_flush_pml_buffer(struct vcpu *v)
     vmx_vmcs_exit(v);
 }
 
-bool_t vmx_domain_pml_enabled(const struct domain *d)
+bool vmx_domain_pml_enabled(const struct domain *d)
 {
     return d->arch.hvm.vmx.status & VMX_DOMAIN_PML_ENABLED;
 }
@@ -1872,7 +1871,7 @@ static void vmx_update_debug_state(struct vcpu *v)
 void cf_check vmx_do_resume(void)
 {
     struct vcpu *v = current;
-    bool_t debug_state;
+    bool debug_state;
     unsigned long host_cr4;
 
     if ( v->arch.hvm.vmx.active_cpu == smp_processor_id() )
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 1edc7f1e91..b99770d588 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -50,7 +50,7 @@
 #include <asm/prot-key.h>
 #include <public/arch-x86/cpuid.h>
 
-static bool_t __initdata opt_force_ept;
+static bool __initdata opt_force_ept;
 boolean_param("force-ept", opt_force_ept);
 
 static void cf_check vmx_ctxt_switch_from(struct vcpu *v);
@@ -2196,7 +2196,7 @@ static void cf_check vmx_process_isr(int isr, struct vcpu *v)
 
 static void __vmx_deliver_posted_interrupt(struct vcpu *v)
 {
-    bool_t running = v->is_running;
+    bool running = v->is_running;
 
     vcpu_unblock(v);
     /*
@@ -4793,7 +4793,7 @@ bool vmx_vmenter_helper(const struct cpu_user_regs *regs)
     struct domain *currd = curr->domain;
     u32 new_asid, old_asid;
     struct hvm_vcpu_asid *p_asid;
-    bool_t need_flush;
+    bool need_flush;
 
     ASSERT(hvmemul_cache_disabled(curr));
 
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index b7be424afb..e2bb71b0ab 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -811,7 +811,7 @@ static void unmap_io_bitmap(struct vcpu *v, unsigned int idx)
     }
 }
 
-static bool_t __must_check _map_io_bitmap(struct vcpu *v, u64 vmcs_reg)
+static bool __must_check _map_io_bitmap(struct vcpu *v, u64 vmcs_reg)
 {
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
     unsigned long gpa;
@@ -825,7 +825,7 @@ static bool_t __must_check _map_io_bitmap(struct vcpu *v, u64 vmcs_reg)
     return nvmx->iobitmap[index] != NULL;
 }
 
-static inline bool_t __must_check map_io_bitmap_all(struct vcpu *v)
+static inline bool __must_check map_io_bitmap_all(struct vcpu *v)
 {
    return _map_io_bitmap(v, IO_BITMAP_A) &&
           _map_io_bitmap(v, IO_BITMAP_B);
@@ -1148,7 +1148,7 @@ static uint64_t get_host_eptp(struct vcpu *v)
     return p2m_get_hostp2m(v->domain)->ept.eptp;
 }
 
-static bool_t nvmx_vpid_enabled(const struct vcpu *v)
+static bool nvmx_vpid_enabled(const struct vcpu *v)
 {
     uint32_t second_cntl;
 
@@ -1591,12 +1591,12 @@ static int nvmx_handle_vmxoff(struct cpu_user_regs *regs)
     return X86EMUL_OKAY;
 }
 
-static bool_t vvmcs_launched(struct list_head *launched_list,
-                             unsigned long vvmcs_mfn)
+static bool vvmcs_launched(struct list_head *launched_list,
+                           unsigned long vvmcs_mfn)
 {
     struct vvmcs_list *vvmcs;
     struct list_head *pos;
-    bool_t launched = 0;
+    bool launched = false;
 
     list_for_each(pos, launched_list)
     {
@@ -1679,7 +1679,7 @@ invalid_control_state:
 
 static int nvmx_handle_vmresume(struct cpu_user_regs *regs)
 {
-    bool_t launched;
+    bool launched;
     struct vcpu *v = current;
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
     unsigned long intr_shadow;
@@ -1715,7 +1715,7 @@ static int nvmx_handle_vmresume(struct cpu_user_regs *regs)
 
 static int nvmx_handle_vmlaunch(struct cpu_user_regs *regs)
 {
-    bool_t launched;
+    bool launched;
     struct vcpu *v = current;
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
     unsigned long intr_shadow;
@@ -1785,7 +1785,7 @@ static int nvmx_handle_vmptrld(struct cpu_user_regs *regs)
 
     if ( !vvmcx_valid(v) )
     {
-        bool_t writable;
+        bool writable;
         void *vvmcx = hvm_map_guest_frame_rw(paddr_to_pfn(gpa), 1, &writable);
 
         if ( vvmcx )
@@ -1894,7 +1894,7 @@ static int nvmx_handle_vmclear(struct cpu_user_regs *regs)
     else 
     {
         /* Even if this VMCS isn't the current one, we must clear it. */
-        bool_t writable;
+        bool writable;
 
         vvmcs = hvm_map_guest_frame_rw(paddr_to_pfn(gpa), 0, &writable);
 
diff --git a/xen/arch/x86/include/asm/acpi.h b/xen/arch/x86/include/asm/acpi.h
index 6ce79ce465..6d94f822d4 100644
--- a/xen/arch/x86/include/asm/acpi.h
+++ b/xen/arch/x86/include/asm/acpi.h
@@ -127,7 +127,7 @@ struct acpi_sleep_info {
     uint32_t sleep_state;
     uint64_t wakeup_vector;
     uint32_t vector_width;
-    bool_t sleep_extended;
+    bool sleep_extended;
 };
 
 #define MAX_MADT_ENTRIES	MAX(256, 2 * NR_CPUS)
diff --git a/xen/arch/x86/include/asm/apic.h b/xen/arch/x86/include/asm/apic.h
index 7625c0ecd6..f7ad7b20dd 100644
--- a/xen/arch/x86/include/asm/apic.h
+++ b/xen/arch/x86/include/asm/apic.h
@@ -139,7 +139,7 @@ static __inline void apic_icr_write(u32 low, u32 dest)
     }
 }
 
-static __inline bool_t apic_isr_read(u8 vector)
+static __inline bool apic_isr_read(uint8_t vector)
 {
     return (apic_read(APIC_ISR + ((vector & ~0x1f) >> 1)) >>
             (vector & 0x1f)) & 1;
diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h
index d033224d2b..4b6b7ceab1 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -106,17 +106,17 @@ struct shadow_domain {
 
     /* Shadow hashtable */
     struct page_info **hash_table;
-    bool_t hash_walking;  /* Some function is walking the hash table */
+    bool hash_walking;  /* Some function is walking the hash table */
 
     /* Fast MMIO path heuristic */
     bool has_fast_mmio_entries;
 
 #ifdef CONFIG_HVM
     /* OOS */
-    bool_t oos_active;
+    bool oos_active;
 
     /* Has this domain ever used HVMOP_pagetable_dying? */
-    bool_t pagetable_dying_op;
+    bool pagetable_dying_op;
 #endif
 
 #ifdef CONFIG_PV
@@ -160,7 +160,7 @@ struct shadow_vcpu {
         unsigned long off[SHADOW_OOS_FIXUPS];
     } oos_fixup[SHADOW_OOS_PAGES];
 
-    bool_t pagetable_dying;
+    bool pagetable_dying;
 #endif
 #endif
 };
@@ -199,7 +199,7 @@ struct paging_domain {
     /* flags to control paging operation */
     u32                     mode;
     /* Has that pool ever run out of memory? */
-    bool_t                  p2m_alloc_failed;
+    bool                    p2m_alloc_failed;
     /* extension for shadow paging support */
     struct shadow_domain    shadow;
     /* extension for hardware-assited paging */
@@ -353,7 +353,7 @@ struct arch_domain
     mm_lock_t nested_p2m_lock;
 
     /* altp2m: allow multiple copies of host p2m */
-    bool_t altp2m_active;
+    bool altp2m_active;
     struct p2m_domain *altp2m_p2m[MAX_ALTP2M];
     mm_lock_t altp2m_list_lock;
     uint64_t *altp2m_eptp;
@@ -364,10 +364,10 @@ struct arch_domain
     struct radix_tree_root irq_pirq;
 
     /* Is shared-info page in 32-bit format? */
-    bool_t has_32bit_shinfo;
+    bool has_32bit_shinfo;
 
     /* Is PHYSDEVOP_eoi to automatically unmask the event channel? */
-    bool_t auto_unmask;
+    bool auto_unmask;
 
     /*
      * The width of the FIP/FDP register in the FPU that needs to be
@@ -399,7 +399,7 @@ struct arch_domain
 
     /* TSC management (emulation, pv, scaling, stats) */
     int tsc_mode;            /* see asm/time.h */
-    bool_t vtsc;             /* tsc is emulated (may change after migrate) */
+    bool vtsc;               /* tsc is emulated (may change after migrate) */
     s_time_t vtsc_last;      /* previous TSC value (guarantee monotonicity) */
     uint64_t vtsc_offset;    /* adjustment for save/restore/migrate */
     uint32_t tsc_khz;        /* cached guest khz for certain emulated or
@@ -452,7 +452,7 @@ struct arch_domain
     } monitor;
 
     /* Mem_access emulation control */
-    bool_t mem_access_emulate_each_rep;
+    bool mem_access_emulate_each_rep;
 
     /* Don't unconditionally inject #GP for unhandled MSRs. */
     bool msr_relaxed;
@@ -544,8 +544,8 @@ struct pv_vcpu
     unsigned long sysenter_callback_eip;
     unsigned short syscall32_callback_cs;
     unsigned short sysenter_callback_cs;
-    bool_t syscall32_disables_events;
-    bool_t sysenter_disables_events;
+    bool syscall32_disables_events;
+    bool sysenter_disables_events;
 
     /*
      * 64bit segment bases.
@@ -586,7 +586,7 @@ struct pv_vcpu
     uint32_t dr7_emul;
 
     /* Deferred VA-based update state. */
-    bool_t need_update_runstate_area;
+    bool need_update_runstate_area;
     struct vcpu_time_info pending_system_time;
 };
 
@@ -656,7 +656,7 @@ struct arch_vcpu
     uint64_t xcr0_accum;
     /* This variable determines whether nonlazy extended state has been used,
      * and thus should be saved/restored. */
-    bool_t nonlazy_xstate_used;
+    bool nonlazy_xstate_used;
 
     /* Restore all FPU state (lazy and non-lazy state) on context switch? */
     bool fully_eager_fpu;
diff --git a/xen/arch/x86/include/asm/hardirq.h b/xen/arch/x86/include/asm/hardirq.h
index 276e3419d7..342361cb6f 100644
--- a/xen/arch/x86/include/asm/hardirq.h
+++ b/xen/arch/x86/include/asm/hardirq.h
@@ -9,7 +9,7 @@ typedef struct {
 	unsigned int __local_irq_count;
 	unsigned int nmi_count;
 	unsigned int mce_count;
-	bool_t __mwait_wakeup;
+	bool __mwait_wakeup;
 } __cacheline_aligned irq_cpustat_t;
 
 #include <xen/irq_cpustat.h>	/* Standard mappings for irq_cpustat_t above */
diff --git a/xen/arch/x86/include/asm/hvm/asid.h b/xen/arch/x86/include/asm/hvm/asid.h
index 0207f8fc29..17c58353d1 100644
--- a/xen/arch/x86/include/asm/hvm/asid.h
+++ b/xen/arch/x86/include/asm/hvm/asid.h
@@ -26,7 +26,7 @@ void hvm_asid_flush_core(void);
 
 /* Called before entry to guest context. Checks ASID allocation, returns a
  * boolean indicating whether all ASIDs must be flushed. */
-bool_t hvm_asid_handle_vmenter(struct hvm_vcpu_asid *asid);
+bool hvm_asid_handle_vmenter(struct hvm_vcpu_asid *asid);
 
 #endif /* __ASM_X86_HVM_ASID_H__ */
 
diff --git a/xen/arch/x86/include/asm/hvm/emulate.h b/xen/arch/x86/include/asm/hvm/emulate.h
index 398d0db078..29d679442e 100644
--- a/xen/arch/x86/include/asm/hvm/emulate.h
+++ b/xen/arch/x86/include/asm/hvm/emulate.h
@@ -50,7 +50,7 @@ struct hvm_emulate_ctxt {
 
     bool is_mem_access;
 
-    bool_t set_context;
+    bool set_context;
 };
 
 enum emul_kind {
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
index 6d53713fc3..a4c1af19ac 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -21,7 +21,7 @@ struct pirq; /* needed by pi_update_irte */
 
 #ifdef CONFIG_HVM_FEP
 /* Permit use of the Forced Emulation Prefix in HVM guests */
-extern bool_t opt_hvm_fep;
+extern bool opt_hvm_fep;
 #else
 #define opt_hvm_fep 0
 #endif
@@ -95,7 +95,7 @@ struct hvm_function_table {
     const char *name;
 
     /* Support Hardware-Assisted Paging? */
-    bool_t hap_supported;
+    bool hap_supported;
 
     /* Necessary hardware support for alternate p2m's? */
     bool altp2m_supported;
@@ -189,10 +189,10 @@ struct hvm_function_table {
     int (*nhvm_vcpu_reset)(struct vcpu *v);
     int (*nhvm_vcpu_vmexit_event)(struct vcpu *v, const struct x86_event *event);
     uint64_t (*nhvm_vcpu_p2m_base)(struct vcpu *v);
-    bool_t (*nhvm_vmcx_guest_intercepts_event)(
+    bool (*nhvm_vmcx_guest_intercepts_event)(
         struct vcpu *v, unsigned int vector, int errcode);
 
-    bool_t (*nhvm_vmcx_hap_enabled)(struct vcpu *v);
+    bool (*nhvm_vmcx_hap_enabled)(struct vcpu *v);
 
     enum hvm_intblk (*nhvm_intr_blocked)(struct vcpu *v);
     void (*nhvm_domain_relinquish_resources)(struct domain *d);
@@ -218,7 +218,7 @@ struct hvm_function_table {
     /* Alternate p2m */
     void (*altp2m_vcpu_update_p2m)(struct vcpu *v);
     void (*altp2m_vcpu_update_vmfunc_ve)(struct vcpu *v);
-    bool_t (*altp2m_vcpu_emulate_ve)(struct vcpu *v);
+    bool (*altp2m_vcpu_emulate_ve)(struct vcpu *v);
     int (*altp2m_vcpu_emulate_vmfunc)(const struct cpu_user_regs *regs);
 
     /* vmtrace */
@@ -247,7 +247,7 @@ struct hvm_function_table {
 };
 
 extern struct hvm_function_table hvm_funcs;
-extern bool_t hvm_enabled;
+extern bool hvm_enabled;
 extern s8 hvm_port80_allowed;
 
 extern const struct hvm_function_table *start_svm(void);
@@ -346,10 +346,10 @@ static inline bool hvm_virtual_to_linear_addr(
                                       access_type, active_cs, linear);
 }
 
-void *hvm_map_guest_frame_rw(unsigned long gfn, bool_t permanent,
-                             bool_t *writable);
-void *hvm_map_guest_frame_ro(unsigned long gfn, bool_t permanent);
-void hvm_unmap_guest_frame(void *p, bool_t permanent);
+void *hvm_map_guest_frame_rw(unsigned long gfn, bool permanent,
+                             bool *writable);
+void *hvm_map_guest_frame_ro(unsigned long gfn, bool permanent);
+void hvm_unmap_guest_frame(void *p, bool permanent);
 void hvm_mapped_guest_frames_mark_dirty(struct domain *d);
 
 int hvm_debug_op(struct vcpu *v, int32_t op);
@@ -616,7 +616,7 @@ static inline uint64_t nhvm_vcpu_p2m_base(struct vcpu *v)
 }
 
 /* returns true, when l1 guest intercepts the specified trap */
-static inline bool_t nhvm_vmcx_guest_intercepts_event(
+static inline bool nhvm_vmcx_guest_intercepts_event(
     struct vcpu *v, unsigned int vector, int errcode)
 {
     return alternative_call(hvm_funcs.nhvm_vmcx_guest_intercepts_event, v,
@@ -624,7 +624,7 @@ static inline bool_t nhvm_vmcx_guest_intercepts_event(
 }
 
 /* returns true when l1 guest wants to use hap to run l2 guest */
-static inline bool_t nhvm_vmcx_hap_enabled(struct vcpu *v)
+static inline bool nhvm_vmcx_hap_enabled(struct vcpu *v)
 {
     return alternative_call(hvm_funcs.nhvm_vmcx_hap_enabled, v);
 }
diff --git a/xen/arch/x86/include/asm/hvm/io.h b/xen/arch/x86/include/asm/hvm/io.h
index e5225e75ef..a977316578 100644
--- a/xen/arch/x86/include/asm/hvm/io.h
+++ b/xen/arch/x86/include/asm/hvm/io.h
@@ -54,8 +54,8 @@ typedef int (*hvm_io_write_t)(const struct hvm_io_handler *handler,
                               uint64_t addr,
                               uint32_t size,
                               uint64_t data);
-typedef bool_t (*hvm_io_accept_t)(const struct hvm_io_handler *handler,
-                                  const ioreq_t *p);
+typedef bool (*hvm_io_accept_t)(const struct hvm_io_handler *handler,
+                                const ioreq_t *p);
 typedef void (*hvm_io_complete_t)(const struct hvm_io_handler *handler);
 
 struct hvm_io_ops {
@@ -72,7 +72,7 @@ int hvm_io_intercept(ioreq_t *p);
 
 struct hvm_io_handler *hvm_next_io_handler(struct domain *d);
 
-bool_t hvm_mmio_internal(paddr_t gpa);
+bool hvm_mmio_internal(paddr_t gpa);
 
 void register_mmio_handler(struct domain *d,
                            const struct hvm_mmio_ops *ops);
@@ -121,7 +121,7 @@ struct hvm_hw_stdvga {
     uint8_t sr[8];
     uint8_t gr_index;
     uint8_t gr[9];
-    bool_t stdvga;
+    bool stdvga;
     enum stdvga_cache_state cache;
     uint32_t latch;
     struct page_info *vram_page[64];  /* shadow of 0xa0000-0xaffff */
diff --git a/xen/arch/x86/include/asm/hvm/nestedhvm.h b/xen/arch/x86/include/asm/hvm/nestedhvm.h
index 3d1ec53a6f..56a2019e1b 100644
--- a/xen/arch/x86/include/asm/hvm/nestedhvm.h
+++ b/xen/arch/x86/include/asm/hvm/nestedhvm.h
@@ -32,7 +32,7 @@ static inline bool nestedhvm_enabled(const struct domain *d)
 int nestedhvm_vcpu_initialise(struct vcpu *v);
 void nestedhvm_vcpu_destroy(struct vcpu *v);
 void nestedhvm_vcpu_reset(struct vcpu *v);
-bool_t nestedhvm_vcpu_in_guestmode(struct vcpu *v);
+bool nestedhvm_vcpu_in_guestmode(struct vcpu *v);
 #define nestedhvm_vcpu_enter_guestmode(v) \
     vcpu_nestedhvm(v).nv_guestmode = 1
 #define nestedhvm_vcpu_exit_guestmode(v)  \
@@ -50,7 +50,7 @@ int nestedhvm_hap_nested_page_fault(struct vcpu *v, paddr_t *L2_gpa,
                                     struct npfec npfec);
 
 /* IO permission map */
-unsigned long *nestedhvm_vcpu_iomap_get(bool_t ioport_80, bool_t ioport_ed);
+unsigned long *nestedhvm_vcpu_iomap_get(bool ioport_80, bool ioport_ed);
 
 /* Misc */
 #define nestedhvm_paging_mode_hap(v) (!!nhvm_vmcx_hap_enabled(v))
diff --git a/xen/arch/x86/include/asm/hvm/vcpu.h b/xen/arch/x86/include/asm/hvm/vcpu.h
index c9ef2b325b..64c7a6fede 100644
--- a/xen/arch/x86/include/asm/hvm/vcpu.h
+++ b/xen/arch/x86/include/asm/hvm/vcpu.h
@@ -60,7 +60,7 @@ struct hvm_vcpu_io {
      * For string instruction emulation we need to be able to signal a
      * necessary retry through other than function return codes.
      */
-    bool_t mmio_retry;
+    bool mmio_retry;
 
     unsigned long msix_unmask_address;
     unsigned long msix_snoop_address;
@@ -70,7 +70,7 @@ struct hvm_vcpu_io {
 };
 
 struct nestedvcpu {
-    bool_t nv_guestmode; /* vcpu in guestmode? */
+    bool nv_guestmode; /* vcpu in guestmode? */
     void *nv_vvmcx; /* l1 guest virtual VMCB/VMCS */
     void *nv_n1vmcx; /* VMCB/VMCS used to run l1 guest */
     void *nv_n2vmcx; /* shadow VMCB/VMCS used to run l2 guest */
@@ -85,22 +85,22 @@ struct nestedvcpu {
         struct nestedvmx nvmx;
     } u;
 
-    bool_t nv_flushp2m; /* True, when p2m table must be flushed */
+    bool nv_flushp2m; /* True, when p2m table must be flushed */
     struct p2m_domain *nv_p2m; /* used p2m table for this vcpu */
     bool stale_np2m; /* True when p2m_base in VMCx02 is no longer valid */
     uint64_t np2m_generation;
 
     struct hvm_vcpu_asid nv_n2asid;
 
-    bool_t nv_vmentry_pending;
-    bool_t nv_vmexit_pending;
-    bool_t nv_vmswitch_in_progress; /* true during vmentry/vmexit emulation */
+    bool nv_vmentry_pending;
+    bool nv_vmexit_pending;
+    bool nv_vmswitch_in_progress; /* true during vmentry/vmexit emulation */
 
     /* Does l1 guest intercept io ports 0x80 and/or 0xED ?
      * Useful to optimize io permission handling.
      */
-    bool_t nv_ioport80;
-    bool_t nv_ioportED;
+    bool nv_ioport80;
+    bool nv_ioportED;
 
     /* L2's control-resgister, just as the L2 sees them. */
     unsigned long       guest_cr[5];
diff --git a/xen/arch/x86/include/asm/hvm/vlapic.h b/xen/arch/x86/include/asm/hvm/vlapic.h
index f27454a136..88ef945243 100644
--- a/xen/arch/x86/include/asm/hvm/vlapic.h
+++ b/xen/arch/x86/include/asm/hvm/vlapic.h
@@ -66,7 +66,7 @@ struct vlapic {
     struct hvm_hw_lapic      hw;
     struct hvm_hw_lapic_regs *regs;
     struct {
-        bool_t               hw, regs;
+        bool                 hw, regs;
         uint32_t             id, ldr;
     }                        loaded;
     spinlock_t               esr_lock;
@@ -97,13 +97,13 @@ static inline void vlapic_set_reg(
 
 void vlapic_reg_write(struct vcpu *v, unsigned int reg, uint32_t val);
 
-bool_t is_vlapic_lvtpc_enabled(struct vlapic *vlapic);
+bool is_vlapic_lvtpc_enabled(struct vlapic *vlapic);
 
 bool vlapic_test_irq(const struct vlapic *vlapic, uint8_t vec);
 void vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig);
 
 int vlapic_has_pending_irq(struct vcpu *v);
-int vlapic_ack_pending_irq(struct vcpu *v, int vector, bool_t force_ack);
+int vlapic_ack_pending_irq(struct vcpu *v, int vector, bool force_ack);
 
 int  vlapic_init(struct vcpu *v);
 void vlapic_destroy(struct vcpu *v);
@@ -131,11 +131,11 @@ int vlapic_apicv_write(struct vcpu *v, unsigned int offset);
 
 struct vlapic *vlapic_lowest_prio(
     struct domain *d, const struct vlapic *source,
-    int short_hand, uint32_t dest, bool_t dest_mode);
+    int short_hand, uint32_t dest, bool dest_mode);
 
-bool_t vlapic_match_dest(
+bool vlapic_match_dest(
     const struct vlapic *target, const struct vlapic *source,
-    int short_hand, uint32_t dest, bool_t dest_mode);
+    int short_hand, uint32_t dest, bool dest_mode);
 
 static inline void vlapic_sync_pir_to_irr(struct vcpu *v)
 {
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
index e056643993..a9afdffae5 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
@@ -143,7 +143,7 @@ struct vmx_vcpu {
     unsigned long        host_cr0;
 
     /* Do we need to tolerate a spurious EPT_MISCONFIG VM exit? */
-    bool_t               ept_spurious_misconfig;
+    bool                 ept_spurious_misconfig;
 
     /* Processor Trace configured and enabled for the vcpu. */
     bool                 ipt_active;
@@ -183,7 +183,7 @@ struct vmx_vcpu {
 int vmx_create_vmcs(struct vcpu *v);
 void vmx_destroy_vmcs(struct vcpu *v);
 void vmx_vmcs_enter(struct vcpu *v);
-bool_t __must_check vmx_vmcs_try_enter(struct vcpu *v);
+bool __must_check vmx_vmcs_try_enter(struct vcpu *v);
 void vmx_vmcs_exit(struct vcpu *v);
 void vmx_vmcs_reload(struct vcpu *v);
 
@@ -663,13 +663,13 @@ void virtual_vmcs_vmwrite(const struct vcpu *, u32 encoding, u64 val);
 enum vmx_insn_errno virtual_vmcs_vmwrite_safe(const struct vcpu *v,
                                               u32 vmcs_encoding, u64 val);
 
-DECLARE_PER_CPU(bool_t, vmxon);
+DECLARE_PER_CPU(bool, vmxon);
 
-bool_t vmx_vcpu_pml_enabled(const struct vcpu *v);
+bool vmx_vcpu_pml_enabled(const struct vcpu *v);
 int vmx_vcpu_enable_pml(struct vcpu *v);
 void vmx_vcpu_disable_pml(struct vcpu *v);
 void vmx_vcpu_flush_pml_buffer(struct vcpu *v);
-bool_t vmx_domain_pml_enabled(const struct domain *d);
+bool vmx_domain_pml_enabled(const struct domain *d);
 int vmx_domain_enable_pml(struct domain *d);
 void vmx_domain_disable_pml(struct domain *d);
 void vmx_domain_flush_pml_buffers(struct domain *d);
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
index d4b335a2bc..31643ed481 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
@@ -585,7 +585,7 @@ void vmx_inject_extint(int trap, uint8_t source);
 void vmx_inject_nmi(void);
 
 void ept_walk_table(struct domain *d, unsigned long gfn);
-bool_t ept_handle_misconfig(uint64_t gpa);
+bool ept_handle_misconfig(uint64_t gpa);
 int epte_get_entry_emt(struct domain *d, gfn_t gfn, mfn_t mfn,
                        unsigned int order, bool *ipat, p2m_type_t type);
 void setup_ept_dump(void);
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vvmx.h b/xen/arch/x86/include/asm/hvm/vmx/vvmx.h
index dc9db69258..da10d3fa96 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vvmx.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vvmx.h
@@ -35,7 +35,7 @@ struct nestedvmx {
         u8            source;
     } intr;
     struct {
-        bool_t   enabled;
+        bool     enabled;
         uint32_t exit_reason;
         uint32_t exit_qual;
     } ept;
diff --git a/xen/arch/x86/include/asm/mtrr.h b/xen/arch/x86/include/asm/mtrr.h
index 1d2744eceb..36dac0a775 100644
--- a/xen/arch/x86/include/asm/mtrr.h
+++ b/xen/arch/x86/include/asm/mtrr.h
@@ -44,7 +44,7 @@ struct mtrr_state {
 
 	u64       mtrr_cap;
 	/* ranges in var MSRs are overlapped or not:0(no overlapped) */
-	bool_t    overlapped;
+	bool      overlapped;
 };
 extern struct mtrr_state mtrr_state;
 
@@ -68,19 +68,19 @@ extern void mtrr_aps_sync_begin(void);
 extern void mtrr_aps_sync_end(void);
 extern void mtrr_bp_restore(void);
 
-extern bool_t mtrr_var_range_msr_set(struct domain *d, struct mtrr_state *m,
-                                     uint32_t msr, uint64_t msr_content);
-extern bool_t mtrr_fix_range_msr_set(struct domain *d, struct mtrr_state *m,
-                                     uint32_t row, uint64_t msr_content);
-extern bool_t mtrr_def_type_msr_set(struct domain *d, struct mtrr_state *m,
-                                    uint64_t msr_content);
+extern bool mtrr_var_range_msr_set(struct domain *d, struct mtrr_state *m,
+                                   uint32_t msr, uint64_t msr_content);
+extern bool mtrr_fix_range_msr_set(struct domain *d, struct mtrr_state *m,
+                                   uint32_t row, uint64_t msr_content);
+extern bool mtrr_def_type_msr_set(struct domain *d, struct mtrr_state *m,
+                                  uint64_t msr_content);
 #ifdef CONFIG_HVM
 extern void memory_type_changed(struct domain *d);
 #else
 static inline void memory_type_changed(struct domain *d) {}
 #endif
 
-extern bool_t pat_msr_set(uint64_t *pat, uint64_t msr);
+extern bool pat_msr_set(uint64_t *pat, uint64_t msr);
 
 bool is_var_mtrr_overlapped(const struct mtrr_state *m);
 bool mtrr_pat_not_equal(const struct vcpu *vd, const struct vcpu *vs);
diff --git a/xen/arch/x86/include/asm/p2m.h b/xen/arch/x86/include/asm/p2m.h
index f2c7d58b59..32f3f394b0 100644
--- a/xen/arch/x86/include/asm/p2m.h
+++ b/xen/arch/x86/include/asm/p2m.h
@@ -27,7 +27,7 @@
 #endif
 #define P2M_DEBUGGING 0
 
-extern bool_t opt_hap_1gb, opt_hap_2mb;
+extern bool opt_hap_1gb, opt_hap_2mb;
 
 /*
  * The upper levels of the p2m pagetable always contain full rights; all 
@@ -245,7 +245,7 @@ struct p2m_domain {
                                     p2m_access_t *p2ma,
                                     p2m_query_t q,
                                     unsigned int *page_order,
-                                    bool_t *sve);
+                                    bool *sve);
     int                (*recalc)(struct p2m_domain *p2m,
                                  unsigned long gfn);
     void               (*enable_hardware_log_dirty)(struct p2m_domain *p2m);
@@ -284,11 +284,11 @@ struct p2m_domain {
      */
     void (*tlb_flush)(struct p2m_domain *p2m);
     unsigned int defer_flush;
-    bool_t need_flush;
+    bool need_flush;
 
     /* If true, and an access fault comes in and there is no vm_event listener, 
      * pause domain.  Otherwise, remove access restrictions. */
-    bool_t       access_required;
+    bool         access_required;
 
     /* Highest guest frame that's ever been mapped in the p2m */
     unsigned long max_mapped_pfn;
@@ -420,17 +420,17 @@ void np2m_schedule(int dir);
 static inline void np2m_schedule(int dir) {}
 #endif
 
-static inline bool_t p2m_is_hostp2m(const struct p2m_domain *p2m)
+static inline bool p2m_is_hostp2m(const struct p2m_domain *p2m)
 {
     return p2m->p2m_class == p2m_host;
 }
 
-static inline bool_t p2m_is_nestedp2m(const struct p2m_domain *p2m)
+static inline bool p2m_is_nestedp2m(const struct p2m_domain *p2m)
 {
     return p2m->p2m_class == p2m_nested;
 }
 
-static inline bool_t p2m_is_altp2m(const struct p2m_domain *p2m)
+static inline bool p2m_is_altp2m(const struct p2m_domain *p2m)
 {
     return p2m->p2m_class == p2m_alternate;
 }
@@ -450,11 +450,11 @@ void p2m_unlock_and_tlb_flush(struct p2m_domain *p2m);
 
 mfn_t __nonnull(3, 4) p2m_get_gfn_type_access(
     struct p2m_domain *p2m, gfn_t gfn, p2m_type_t *t,
-    p2m_access_t *a, p2m_query_t q, unsigned int *page_order, bool_t locked);
+    p2m_access_t *a, p2m_query_t q, unsigned int *page_order, bool locked);
 
 static inline mfn_t __nonnull(3, 4) _get_gfn_type_access(
     struct p2m_domain *p2m, gfn_t gfn, p2m_type_t *t,
-    p2m_access_t *a, p2m_query_t q, unsigned int *page_order, bool_t locked)
+    p2m_access_t *a, p2m_query_t q, unsigned int *page_order, bool locked)
 {
     if ( !p2m || !paging_mode_translate(p2m->domain) )
     {
@@ -888,7 +888,7 @@ static inline bool p2m_set_altp2m(struct vcpu *v, unsigned int idx)
 }
 
 /* Switch alternate p2m for a single vcpu */
-bool_t p2m_switch_vcpu_altp2m_by_id(struct vcpu *v, unsigned int idx);
+bool p2m_switch_vcpu_altp2m_by_id(struct vcpu *v, unsigned int idx);
 
 /* Check to see if vcpu should be switched to a different p2m. */
 void p2m_altp2m_check(struct vcpu *v, uint16_t idx);
diff --git a/xen/arch/x86/include/asm/page.h b/xen/arch/x86/include/asm/page.h
index c9466172ba..93a7b368ac 100644
--- a/xen/arch/x86/include/asm/page.h
+++ b/xen/arch/x86/include/asm/page.h
@@ -378,7 +378,7 @@ static inline unsigned int cacheattr_to_pte_flags(unsigned int cacheattr)
 }
 
 /* return true if permission increased */
-static inline bool_t
+static inline bool
 perms_strictly_increased(uint32_t old_flags, uint32_t new_flags)
 /* Given the flags of two entries, are the new flags a strict
  * increase in rights over the old ones? */
diff --git a/xen/arch/x86/include/asm/paging.h b/xen/arch/x86/include/asm/paging.h
index 62605d7697..76162a9429 100644
--- a/xen/arch/x86/include/asm/paging.h
+++ b/xen/arch/x86/include/asm/paging.h
@@ -210,7 +210,7 @@ int paging_domain_init(struct domain *d);
  * manipulate the log-dirty bitmap. */
 int paging_domctl(struct domain *d, struct xen_domctl_shadow_op *sc,
                   XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl,
-                  bool_t resuming);
+                  bool resuming);
 
 /* Call when destroying a vcpu/domain */
 void paging_vcpu_teardown(struct vcpu *v);
diff --git a/xen/arch/x86/include/asm/pci.h b/xen/arch/x86/include/asm/pci.h
index fd981de9de..6bfe87e278 100644
--- a/xen/arch/x86/include/asm/pci.h
+++ b/xen/arch/x86/include/asm/pci.h
@@ -39,11 +39,11 @@ int pci_conf_write_intercept(unsigned int seg, unsigned int bdf,
                              uint32_t *data);
 int pci_msi_conf_write_intercept(struct pci_dev *pdev, unsigned int reg,
                                  unsigned int size, uint32_t *data);
-bool_t pci_mmcfg_decode(unsigned long mfn, unsigned int *seg,
-                        unsigned int *bdf);
+bool pci_mmcfg_decode(unsigned long mfn, unsigned int *seg,
+                      unsigned int *bdf);
 
-bool_t pci_ro_mmcfg_decode(unsigned long mfn, unsigned int *seg,
-                           unsigned int *bdf);
+bool pci_ro_mmcfg_decode(unsigned long mfn, unsigned int *seg,
+                         unsigned int *bdf);
 
 /* MMCFG external variable defines */
 extern int pci_mmcfg_config_num;
diff --git a/xen/arch/x86/include/asm/psr.h b/xen/arch/x86/include/asm/psr.h
index 8ecb7a0eea..51df78794c 100644
--- a/xen/arch/x86/include/asm/psr.h
+++ b/xen/arch/x86/include/asm/psr.h
@@ -67,7 +67,7 @@ enum psr_type {
 
 extern struct psr_cmt *psr_cmt;
 
-static inline bool_t psr_cmt_enabled(void)
+static inline bool psr_cmt_enabled(void)
 {
     return !!psr_cmt;
 }
diff --git a/xen/arch/x86/include/asm/vpmu.h b/xen/arch/x86/include/asm/vpmu.h
index 7858aec6ca..6629093197 100644
--- a/xen/arch/x86/include/asm/vpmu.h
+++ b/xen/arch/x86/include/asm/vpmu.h
@@ -33,8 +33,8 @@ struct arch_vpmu_ops {
     int (*do_rdmsr)(unsigned int msr, uint64_t *msr_content);
     int (*do_interrupt)(struct cpu_user_regs *regs);
     void (*arch_vpmu_destroy)(struct vcpu *v);
-    int (*arch_vpmu_save)(struct vcpu *v, bool_t to_guest);
-    int (*arch_vpmu_load)(struct vcpu *v, bool_t from_guest);
+    int (*arch_vpmu_save)(struct vcpu *v, bool to_guest);
+    int (*arch_vpmu_load)(struct vcpu *v, bool from_guest);
     void (*arch_vpmu_dump)(const struct vcpu *v);
 
 #ifdef CONFIG_MEM_SHARING
@@ -87,12 +87,12 @@ static inline void vpmu_clear(struct vpmu_struct *vpmu)
     /* VPMU_AVAILABLE should be altered by get/put_vpmu(). */
     vpmu->flags &= VPMU_AVAILABLE;
 }
-static inline bool_t vpmu_is_set(const struct vpmu_struct *vpmu, const u32 mask)
+static inline bool vpmu_is_set(const struct vpmu_struct *vpmu, const u32 mask)
 {
     return !!(vpmu->flags & mask);
 }
-static inline bool_t vpmu_are_all_set(const struct vpmu_struct *vpmu,
-                                      const u32 mask)
+static inline bool vpmu_are_all_set(const struct vpmu_struct *vpmu,
+                                    const u32 mask)
 {
     return !!((vpmu->flags & mask) == mask);
 }
@@ -104,7 +104,7 @@ void vpmu_initialise(struct vcpu *v);
 void vpmu_destroy(struct vcpu *v);
 void vpmu_save(struct vcpu *v);
 void cf_check vpmu_save_force(void *arg);
-int vpmu_load(struct vcpu *v, bool_t from_guest);
+int vpmu_load(struct vcpu *v, bool from_guest);
 void vpmu_dump(struct vcpu *v);
 
 static inline int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
diff --git a/xen/arch/x86/mm/hap/nested_ept.c b/xen/arch/x86/mm/hap/nested_ept.c
index d6df48af54..d88d677825 100644
--- a/xen/arch/x86/mm/hap/nested_ept.c
+++ b/xen/arch/x86/mm/hap/nested_ept.c
@@ -42,7 +42,7 @@
 #define NEPT_2M_ENTRY_FLAG (1 << 10)
 #define NEPT_4K_ENTRY_FLAG (1 << 9)
 
-static bool_t nept_rsv_bits_check(ept_entry_t e, uint32_t level)
+static bool nept_rsv_bits_check(ept_entry_t e, uint32_t level)
 {
     uint64_t rsv_bits = EPT_MUST_RSV_BITS;
 
@@ -68,7 +68,7 @@ static bool_t nept_rsv_bits_check(ept_entry_t e, uint32_t level)
 }
 
 /* EMT checking*/
-static bool_t nept_emt_bits_check(ept_entry_t e, uint32_t level)
+static bool nept_emt_bits_check(ept_entry_t e, uint32_t level)
 {
     if ( e.sp || level == 1 )
     {
@@ -79,13 +79,13 @@ static bool_t nept_emt_bits_check(ept_entry_t e, uint32_t level)
     return 0;
 }
 
-static bool_t nept_permission_check(uint32_t rwx_acc, uint32_t rwx_bits)
+static bool nept_permission_check(uint32_t rwx_acc, uint32_t rwx_bits)
 {
     return !(EPTE_RWX_MASK & rwx_acc & ~rwx_bits);
 }
 
 /* nept's non-present check */
-static bool_t nept_non_present_check(ept_entry_t e)
+static bool nept_non_present_check(ept_entry_t e)
 {
     if ( e.epte & EPTE_RWX_MASK )
         return 0;
@@ -106,7 +106,7 @@ uint64_t nept_get_ept_vpid_cap(void)
     return caps;
 }
 
-static bool_t nept_rwx_bits_check(ept_entry_t e)
+static bool nept_rwx_bits_check(ept_entry_t e)
 {
     /*write only or write/execute only*/
     uint8_t rwx_bits = e.epte & EPTE_RWX_MASK;
@@ -122,7 +122,7 @@ static bool_t nept_rwx_bits_check(ept_entry_t e)
 }
 
 /* nept's misconfiguration check */
-static bool_t nept_misconfiguration_check(ept_entry_t e, uint32_t level)
+static bool nept_misconfiguration_check(ept_entry_t e, uint32_t level)
 {
     return nept_rsv_bits_check(e, level) ||
            nept_emt_bits_check(e, level) ||
diff --git a/xen/arch/x86/mm/mem_paging.c b/xen/arch/x86/mm/mem_paging.c
index 2c2b34ccf6..541ecbeeb0 100644
--- a/xen/arch/x86/mm/mem_paging.c
+++ b/xen/arch/x86/mm/mem_paging.c
@@ -431,7 +431,7 @@ int mem_paging_memop(XEN_GUEST_HANDLE_PARAM(xen_mem_paging_op_t) arg)
     int rc;
     xen_mem_paging_op_t mpo;
     struct domain *d;
-    bool_t copyback = 0;
+    bool copyback = false;
 
     if ( copy_from_guest(&mpo, arg, 1) )
         return -EFAULT;
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 85c4e8e54f..227bdf7c24 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -30,7 +30,8 @@
 
 #define is_epte_present(ept_entry)      ((ept_entry)->epte & 0x7)
 #define is_epte_superpage(ept_entry)    ((ept_entry)->sp)
-static inline bool_t is_epte_valid(ept_entry_t *e)
+
+static bool is_epte_valid(const ept_entry_t *e)
 {
     /* suppress_ve alone is not considered valid, so mask it off */
     return ((e->epte & ~(1ul << 63)) != 0 && e->sa_p2mt != p2m_invalid);
@@ -239,14 +240,14 @@ static void ept_free_entry(struct p2m_domain *p2m, ept_entry_t *ept_entry, int l
     p2m_free_ptp(p2m, mfn_to_page(_mfn(ept_entry->mfn)));
 }
 
-static bool_t ept_split_super_page(struct p2m_domain *p2m,
-                                   ept_entry_t *ept_entry,
-                                   unsigned int level, unsigned int target)
+static bool ept_split_super_page(
+    struct p2m_domain *p2m, ept_entry_t *ept_entry,
+    unsigned int level, unsigned int target)
 {
     ept_entry_t new_ept, *table;
     uint64_t trunk;
     unsigned int i;
-    bool_t rv = 1;
+    bool rv = true;
 
     /* End if the entry is a leaf entry or reaches the target level. */
     if ( level <= target )
@@ -305,7 +306,7 @@ static bool_t ept_split_super_page(struct p2m_domain *p2m,
  *  GUEST_TABLE_POD:
  *   The next entry is marked populate-on-demand.
  */
-static int ept_next_level(struct p2m_domain *p2m, bool_t read_only,
+static int ept_next_level(struct p2m_domain *p2m, bool read_only,
                           ept_entry_t **table, unsigned long *gfn_remainder,
                           int next_level)
 {
@@ -678,7 +679,7 @@ static int cf_check resolve_misconfig(struct p2m_domain *p2m, unsigned long gfn)
                                              _mfn(e.mfn),
                                              level * EPT_TABLE_ORDER, &ipat,
                                              e.sa_p2mt);
-                bool_t recalc = e.recalc;
+                bool recalc = e.recalc;
 
                 if ( recalc && p2m_is_changeable(e.sa_p2mt) )
                 {
@@ -760,11 +761,11 @@ static int cf_check resolve_misconfig(struct p2m_domain *p2m, unsigned long gfn)
     return rc;
 }
 
-bool_t ept_handle_misconfig(uint64_t gpa)
+bool ept_handle_misconfig(uint64_t gpa)
 {
     struct vcpu *curr = current;
     struct p2m_domain *p2m = p2m_get_hostp2m(curr->domain);
-    bool_t spurious;
+    bool spurious;
     int rc;
 
     if ( altp2m_active(curr->domain) )
@@ -798,11 +799,11 @@ ept_set_entry(struct p2m_domain *p2m, gfn_t gfn_, mfn_t mfn,
     unsigned int i, target = order / EPT_TABLE_ORDER;
     unsigned long fn_mask = !mfn_eq(mfn, INVALID_MFN) ? (gfn | mfn_x(mfn)) : gfn;
     int ret, rc = 0;
-    bool_t entry_written = 0;
-    bool_t need_modify_vtd_table = 1;
-    bool_t vtd_pte_present = 0;
+    bool entry_written = false;
+    bool need_modify_vtd_table = true;
+    bool vtd_pte_present = false;
     unsigned int iommu_flags = p2m_get_iommu_flags(p2mt, p2ma, mfn);
-    bool_t needs_sync = 1;
+    bool needs_sync = false;
     ept_entry_t old_entry = { .epte = 0 };
     ept_entry_t new_entry = { .epte = 0 };
     struct ept_data *ept = &p2m->ept;
@@ -1007,7 +1008,7 @@ static mfn_t cf_check ept_get_entry(
     ept_entry_t *ept_entry;
     u32 index;
     int i;
-    bool_t recalc = 0;
+    bool recalc = false;
     mfn_t mfn = INVALID_MFN;
     struct ept_data *ept = &p2m->ept;
 
diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index 9969eb45fa..9e5ad68df2 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -522,7 +522,7 @@ decrease_reservation(struct domain *d, gfn_t gfn, unsigned int order)
 {
     unsigned long ret = 0, i, n;
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
-    bool_t steal_for_cache;
+    bool steal_for_cache;
     long pod = 0, ram = 0;
 
     gfn_lock(p2m, gfn, order);
diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index b2b14746c1..640a11f564 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -213,7 +213,7 @@ p2m_free_entry(struct p2m_domain *p2m, l1_pgentry_t *p2m_entry, int page_order)
 static int
 p2m_next_level(struct p2m_domain *p2m, void **table,
                unsigned long *gfn_remainder, unsigned long gfn, u32 shift,
-               u32 max, unsigned int level, bool_t unmap)
+               u32 max, unsigned int level, bool unmap)
 {
     l1_pgentry_t *p2m_entry, new_entry;
     void *next;
@@ -765,7 +765,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, gfn_t gfn_, mfn_t mfn,
 static mfn_t cf_check
 p2m_pt_get_entry(struct p2m_domain *p2m, gfn_t gfn_,
                  p2m_type_t *t, p2m_access_t *a, p2m_query_t q,
-                 unsigned int *page_order, bool_t *sve)
+                 unsigned int *page_order, bool *sve)
 {
     mfn_t mfn;
     unsigned long gfn = gfn_x(gfn_);
@@ -774,7 +774,7 @@ p2m_pt_get_entry(struct p2m_domain *p2m, gfn_t gfn_,
     l1_pgentry_t *l1e;
     unsigned int flags;
     p2m_type_t l1t;
-    bool_t recalc;
+    bool recalc;
 
     ASSERT(paging_mode_translate(p2m->domain));
 
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 0983bd71d9..fe9ccabb87 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -39,7 +39,8 @@
 DEFINE_PERCPU_RWLOCK_GLOBAL(p2m_percpu_rwlock);
 
 /* Turn on/off host superpage page table support for hap, default on. */
-bool_t __initdata opt_hap_1gb = 1, __initdata opt_hap_2mb = 1;
+bool __initdata opt_hap_1gb = true;
+bool __initdata opt_hap_2mb = true;
 boolean_param("hap_1gb", opt_hap_1gb);
 boolean_param("hap_2mb", opt_hap_2mb);
 
@@ -272,7 +273,7 @@ void p2m_unlock_and_tlb_flush(struct p2m_domain *p2m)
 
 mfn_t p2m_get_gfn_type_access(struct p2m_domain *p2m, gfn_t gfn,
                               p2m_type_t *t, p2m_access_t *a, p2m_query_t q,
-                              unsigned int *page_order, bool_t locked)
+                              unsigned int *page_order, bool locked)
 {
     mfn_t mfn;
 
@@ -1765,10 +1766,10 @@ void p2m_altp2m_check(struct vcpu *v, uint16_t idx)
         p2m_switch_vcpu_altp2m_by_id(v, idx);
 }
 
-bool_t p2m_switch_vcpu_altp2m_by_id(struct vcpu *v, unsigned int idx)
+bool p2m_switch_vcpu_altp2m_by_id(struct vcpu *v, unsigned int idx)
 {
     struct domain *d = v->domain;
-    bool_t rc = 0;
+    bool rc = false;
 
     if ( idx >= MAX_ALTP2M )
         return rc;
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 34d833251b..541c2ea9b2 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -224,7 +224,7 @@ static int paging_log_dirty_enable(struct domain *d)
     return ret;
 }
 
-static int paging_log_dirty_disable(struct domain *d, bool_t resuming)
+static int paging_log_dirty_disable(struct domain *d, bool resuming)
 {
     int ret = 1;
 
@@ -394,7 +394,7 @@ bool paging_mfn_is_dirty(const struct domain *d, mfn_t gmfn)
  * clear the bitmap and stats as well. */
 static int paging_log_dirty_op(struct domain *d,
                                struct xen_domctl_shadow_op *sc,
-                               bool_t resuming)
+                               bool resuming)
 {
     int rv = 0, clean = 0, peek = 1;
     unsigned long pages = 0;
@@ -672,7 +672,7 @@ void paging_vcpu_init(struct vcpu *v)
 #if PG_log_dirty
 int paging_domctl(struct domain *d, struct xen_domctl_shadow_op *sc,
                   XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl,
-                  bool_t resuming)
+                  bool resuming)
 {
     int rc;
 
diff --git a/xen/arch/x86/x86_64/mmconf-fam10h.c b/xen/arch/x86/x86_64/mmconf-fam10h.c
index 36b32eb769..270dd97b6a 100644
--- a/xen/arch/x86/x86_64/mmconf-fam10h.c
+++ b/xen/arch/x86/x86_64/mmconf-fam10h.c
@@ -142,7 +142,7 @@ out:
 void fam10h_check_enable_mmcfg(void)
 {
 	u64 val;
-	bool_t print = opt_cpu_info;
+	bool print = opt_cpu_info;
 
 	if (!(pci_probe & PCI_CHECK_ENABLE_AMD_MMCONF))
 		return;
diff --git a/xen/arch/x86/x86_64/mmconfig-shared.c b/xen/arch/x86/x86_64/mmconfig-shared.c
index 5dee20fe9d..b3b2da7362 100644
--- a/xen/arch/x86/x86_64/mmconfig-shared.c
+++ b/xen/arch/x86/x86_64/mmconfig-shared.c
@@ -192,7 +192,7 @@ static const char *__init cf_check pci_mmcfg_amd_fam10h(void)
 
 static const char *__init cf_check pci_mmcfg_nvidia_mcp55(void)
 {
-    static bool_t __initdata mcp55_checked;
+    static bool __initdata mcp55_checked;
     int bus, i;
 
     static const u32 extcfg_regnum      = 0x90;
@@ -361,11 +361,11 @@ static int __init is_mmconf_reserved(
     return valid;
 }
 
-static bool_t __init pci_mmcfg_reject_broken(void)
+static bool __init pci_mmcfg_reject_broken(void)
 {
     typeof(pci_mmcfg_config[0]) *cfg;
     int i;
-    bool_t valid = 1;
+    bool valid = true;
 
     if ((pci_mmcfg_config_num == 0) ||
         (pci_mmcfg_config == NULL) ||
@@ -399,7 +399,7 @@ static bool_t __init pci_mmcfg_reject_broken(void)
 
 void __init acpi_mmcfg_init(void)
 {
-    bool_t valid = 1;
+    bool valid = true;
 
     pci_segments_init();
 
diff --git a/xen/arch/x86/x86_64/mmconfig_64.c b/xen/arch/x86/x86_64/mmconfig_64.c
index 2b3085931e..ffdc62700d 100644
--- a/xen/arch/x86/x86_64/mmconfig_64.c
+++ b/xen/arch/x86/x86_64/mmconfig_64.c
@@ -175,8 +175,7 @@ void pci_mmcfg_arch_disable(unsigned int idx)
            cfg->pci_segment, cfg->start_bus_number, cfg->end_bus_number);
 }
 
-bool_t pci_mmcfg_decode(unsigned long mfn, unsigned int *seg,
-                        unsigned int *bdf)
+bool pci_mmcfg_decode(unsigned long mfn, unsigned int *seg, unsigned int *bdf)
 {
     unsigned int idx;
 
@@ -197,8 +196,7 @@ bool_t pci_mmcfg_decode(unsigned long mfn, unsigned int *seg,
     return 0;
 }
 
-bool_t pci_ro_mmcfg_decode(unsigned long mfn, unsigned int *seg,
-                           unsigned int *bdf)
+bool pci_ro_mmcfg_decode(unsigned long mfn, unsigned int *seg, unsigned int *bdf)
 {
     const unsigned long *ro_map;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:46:35 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:46:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.639999.997759 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Fel-0005Le-El; Thu, 23 Nov 2023 19:46:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 639999.997759; Thu, 23 Nov 2023 19:46:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Fel-0005LX-Bw; Thu, 23 Nov 2023 19:46:35 +0000
Received: by outflank-mailman (input) for mailman id 639999;
 Thu, 23 Nov 2023 19:46:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fej-0005LG-UP
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:46:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fej-0001bf-Tb
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:46:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fej-00078x-Sm
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:46:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KEejV0DYnk2GfDfgg3eKYhTKvz/JxxFU7phrM7Xkby8=; b=hjFEdUNuesQrvTLk4jK1VLENZ0
	LiCLL0WQHKrGYBQi/Lch2R8gvOUy7FbAxJAzDq6PzPgHM1FwWoy3yGjzGiCb/z0r/4hNP+kmpgwfj
	xwrICg0GwPWZuE+kxFCsfrz/ROSbAlX3gbH3DphiKWuNwxpb+OHiSv1xJVcsaxuzx30I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/treewide: Switch bool_t to bool
Message-Id: <E1r6Fej-00078x-Sm@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:46:33 +0000

commit e0d0961f3f2e318b89e22865324e6446e077e2f0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 20 19:51:23 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 21 13:28:51 2023 +0000

    xen/treewide: Switch bool_t to bool
    
    ... as part of cleaning up the types used.  Minor style and/or MISRA cleanup
    on some altered lines.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/device_tree.c              | 34 +++++++++++++--------------
 xen/common/domain.c                   |  2 +-
 xen/common/domctl.c                   |  4 ++--
 xen/common/event_fifo.c               |  4 ++--
 xen/common/grant_table.c              | 14 +++++------
 xen/common/kernel.c                   |  2 +-
 xen/common/kexec.c                    |  4 ++--
 xen/common/keyhandler.c               |  4 ++--
 xen/common/kimage.c                   |  8 +++----
 xen/common/livepatch.c                | 20 ++++++++--------
 xen/common/memory.c                   |  2 +-
 xen/common/notifier.c                 |  2 +-
 xen/common/preempt.c                  |  2 +-
 xen/common/rangeset.c                 | 12 +++++-----
 xen/common/shutdown.c                 |  2 +-
 xen/common/symbols.c                  |  2 +-
 xen/common/sysctl.c                   |  4 ++--
 xen/common/tasklet.c                  |  4 ++--
 xen/common/timer.c                    |  8 +++----
 xen/common/trace.c                    | 12 +++++-----
 xen/drivers/acpi/apei/apei-base.c     |  2 +-
 xen/drivers/acpi/apei/apei-internal.h |  2 +-
 xen/drivers/acpi/apei/erst.c          |  2 +-
 xen/drivers/acpi/apei/hest.c          |  2 +-
 xen/drivers/char/console.c            |  8 +++----
 xen/drivers/char/ehci-dbgp.c          | 10 ++++----
 xen/drivers/char/ns16550.c            | 14 +++++------
 xen/drivers/char/pl011.c              |  2 +-
 xen/drivers/char/serial.c             |  2 +-
 xen/drivers/cpufreq/cpufreq.c         |  2 +-
 xen/drivers/video/vesa.c              |  2 +-
 xen/include/acpi/cpufreq/cpufreq.h    | 10 ++++----
 xen/include/xen/device_tree.h         | 44 +++++++++++++++++------------------
 xen/include/xen/domain.h              |  4 ++--
 xen/include/xen/gdbstub.h             |  2 +-
 xen/include/xen/irq.h                 |  2 +-
 xen/include/xen/kernel.h              |  2 +-
 xen/include/xen/kimage.h              |  8 +++----
 xen/include/xen/livepatch.h           |  6 ++---
 xen/include/xen/mm-frame.h            |  4 ++--
 xen/include/xen/mm.h                  |  6 ++---
 xen/include/xen/preempt.h             |  2 +-
 xen/include/xen/rangeset.h            |  8 +++----
 xen/include/xen/rwlock.h              |  2 +-
 xen/include/xen/serial.h              |  2 +-
 xen/include/xen/shutdown.h            |  2 +-
 xen/include/xen/tasklet.h             |  6 ++---
 47 files changed, 152 insertions(+), 152 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index b1c2952951..8d1017a49d 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -78,7 +78,7 @@ struct dt_bus
 {
     const char *name;
     const char *addresses;
-    bool_t (*match)(const struct dt_device_node *node);
+    bool (*match)(const struct dt_device_node *node);
     void (*count_cells)(const struct dt_device_node *child,
                         int *addrc, int *sizec);
     u64 (*map)(__be32 *addr, const __be32 *range, int na, int ns, int pna);
@@ -162,8 +162,8 @@ const void *dt_get_property(const struct dt_device_node *np,
     return pp ? pp->value : NULL;
 }
 
-bool_t dt_property_read_u32(const struct dt_device_node *np,
-                         const char *name, u32 *out_value)
+bool dt_property_read_u32(const struct dt_device_node *np,
+                          const char *name, u32 *out_value)
 {
     u32 len;
     const __be32 *val;
@@ -178,8 +178,8 @@ bool_t dt_property_read_u32(const struct dt_device_node *np,
 }
 
 
-bool_t dt_property_read_u64(const struct dt_device_node *np,
-                         const char *name, u64 *out_value)
+bool dt_property_read_u64(const struct dt_device_node *np,
+                          const char *name, u64 *out_value)
 {
     u32 len;
     const __be32 *val;
@@ -297,8 +297,8 @@ int dt_property_match_string(const struct dt_device_node *np,
     return -ENODATA;
 }
 
-bool_t dt_device_is_compatible(const struct dt_device_node *device,
-                               const char *compat)
+bool dt_device_is_compatible(const struct dt_device_node *device,
+                             const char *compat)
 {
     const char* cp;
     u32 cplen, l;
@@ -318,10 +318,10 @@ bool_t dt_device_is_compatible(const struct dt_device_node *device,
     return 0;
 }
 
-bool_t dt_machine_is_compatible(const char *compat)
+bool dt_machine_is_compatible(const char *compat)
 {
     const struct dt_device_node *root;
-    bool_t rc = 0;
+    bool rc = false;
 
     root = dt_find_node_by_path("/");
     if ( root )
@@ -408,9 +408,9 @@ dt_match_node(const struct dt_device_match *matches,
         return NULL;
 
     while ( matches->path || matches->type ||
-            matches->compatible || matches->not_available || matches->prop)
+            matches->compatible || matches->not_available || matches->prop )
     {
-        bool_t match = 1;
+        bool match = true;
 
         if ( matches->path )
             match &= dt_node_path_is_equal(node, matches->path);
@@ -481,7 +481,7 @@ dt_find_matching_node(struct dt_device_node *from,
     return NULL;
 }
 
-static int __dt_n_addr_cells(const struct dt_device_node *np, bool_t parent)
+static int __dt_n_addr_cells(const struct dt_device_node *np, bool parent)
 {
     const __be32 *ip;
 
@@ -498,7 +498,7 @@ static int __dt_n_addr_cells(const struct dt_device_node *np, bool_t parent)
     return DT_ROOT_NODE_ADDR_CELLS_DEFAULT;
 }
 
-static int __dt_n_size_cells(const struct dt_device_node *np, bool_t parent)
+static int __dt_n_size_cells(const struct dt_device_node *np, bool parent)
 {
     const __be32 *ip;
 
@@ -558,7 +558,7 @@ int dt_child_n_size_cells(const struct dt_device_node *parent)
 /*
  * Default translator (generic bus)
  */
-static bool_t dt_bus_default_match(const struct dt_device_node *node)
+static bool dt_bus_default_match(const struct dt_device_node *node)
 {
     /* Root node doesn't have "ranges" property */
     if ( node->parent == NULL )
@@ -636,7 +636,7 @@ static bool dt_node_is_pci(const struct dt_device_node *np)
     return is_pci;
 }
 
-static bool_t dt_bus_pci_match(const struct dt_device_node *np)
+static bool dt_bus_pci_match(const struct dt_device_node *np)
 {
     /*
      * "pciex" is PCI Express "vci" is for the /chaos bridge on 1st-gen PCI
@@ -1662,7 +1662,7 @@ int dt_device_get_irq(const struct dt_device_node *device, unsigned int index,
     return dt_irq_translate(&raw, out_irq);
 }
 
-bool_t dt_device_is_available(const struct dt_device_node *device)
+bool dt_device_is_available(const struct dt_device_node *device)
 {
     const char *status;
     u32 statlen;
@@ -1680,7 +1680,7 @@ bool_t dt_device_is_available(const struct dt_device_node *device)
     return 0;
 }
 
-bool_t dt_device_for_passthrough(const struct dt_device_node *device)
+bool dt_device_for_passthrough(const struct dt_device_node *device)
 {
     return (dt_find_property(device, "xen,passthrough", NULL) != NULL);
 
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 8f9ab01c0c..f15c2f1e95 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -51,7 +51,7 @@
 unsigned int xen_processor_pmbits = XEN_PROCESSOR_PM_PX;
 
 /* opt_dom0_vcpus_pin: If true, dom0 VCPUs are pinned. */
-bool_t opt_dom0_vcpus_pin;
+bool opt_dom0_vcpus_pin;
 boolean_param("dom0_vcpus_pin", opt_dom0_vcpus_pin);
 
 /* Protect updates/reads (resp.) of domain_list and domain_hash. */
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 505e29c0dc..f5a71ee5f7 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -126,7 +126,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
     arch_get_domain_info(d, info);
 }
 
-bool_t domctl_lock_acquire(void)
+bool domctl_lock_acquire(void)
 {
     /*
      * Caller may try to pause its own VCPUs. We must prevent deadlock
@@ -281,7 +281,7 @@ static struct vnuma_info *vnuma_init(const struct xen_domctl_vnuma *uinfo,
 long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
-    bool_t copyback = 0;
+    bool copyback = false;
     struct xen_domctl curop, *op = &curop;
     struct domain *d;
 
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 6cebc3868a..37cba9bc45 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -124,8 +124,8 @@ static int try_set_link(event_word_t *word, event_word_t *w, uint32_t link)
  * We block unmasking by the guest by marking the tail word as BUSY,
  * therefore, the cmpxchg() may fail at most 4 times.
  */
-static bool_t evtchn_fifo_set_link(struct domain *d, event_word_t *word,
-                                   uint32_t link)
+static bool evtchn_fifo_set_link(struct domain *d, event_word_t *word,
+                                 uint32_t link)
 {
     event_word_t w;
     unsigned int try;
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 89b7811c51..5721eab225 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2272,7 +2272,7 @@ gnttab_transfer(
 
     for ( i = 0; i < count; i++ )
     {
-        bool_t okay;
+        bool okay;
         int rc;
 
         if ( i && hypercall_preempt_check() )
@@ -2858,9 +2858,9 @@ struct gnttab_copy_buf {
     mfn_t mfn;
     struct page_info *page;
     void *virt;
-    bool_t read_only;
-    bool_t have_grant;
-    bool_t have_type;
+    bool read_only;
+    bool have_grant;
+    bool have_type;
 };
 
 static int gnttab_copy_lock_domain(domid_t domid, bool is_gref,
@@ -3006,9 +3006,9 @@ static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
     return rc;
 }
 
-static bool_t gnttab_copy_buf_valid(const struct gnttab_copy_ptr *p,
-                                    const struct gnttab_copy_buf *b,
-                                    bool_t has_gref)
+static bool gnttab_copy_buf_valid(
+    const struct gnttab_copy_ptr *p, const struct gnttab_copy_buf *b,
+    bool has_gref)
 {
     if ( !b->virt )
         return 0;
diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index e928d0b231..08dbaa2a05 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -504,7 +504,7 @@ __initcall(param_init);
 
 long do_xen_version(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
-    bool_t deny = !!xsm_xen_version(XSM_OTHER, cmd);
+    bool deny = xsm_xen_version(XSM_OTHER, cmd);
 
     switch ( cmd )
     {
diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 3ee5f05c2c..84fe8c3597 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -937,7 +937,7 @@ static int kexec_segments_add_segment(unsigned int *nr_segments,
 static int kexec_segments_from_ind_page(mfn_t mfn,
                                         unsigned int *nr_segments,
                                         xen_kexec_segment_t *segments,
-                                        bool_t compat)
+                                        bool compat)
 {
     void *page;
     kimage_entry_t *entry;
@@ -1215,7 +1215,7 @@ static int kexec_status(XEN_GUEST_HANDLE_PARAM(void) uarg)
 
 static int do_kexec_op_internal(unsigned long op,
                                 XEN_GUEST_HANDLE_PARAM(void) uarg,
-                                bool_t compat)
+                                bool compat)
 {
     int ret = -EINVAL;
 
diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index f4752859cc..99a2d72a02 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -24,7 +24,7 @@
 #include <asm/div64.h>
 
 static unsigned char keypress_key;
-static bool_t alt_key_handling;
+static bool alt_key_handling;
 
 static keyhandler_fn_t cf_check show_handlers, cf_check dump_hwdom_registers,
     cf_check dump_domains, cf_check read_clocks;
@@ -39,7 +39,7 @@ static struct keyhandler {
     };
 
     const char *desc;    /* Description for help message.                 */
-    bool_t irq_callback, /* Call in irq context? if not, tasklet context. */
+    bool irq_callback,   /* Call in irq context? if not, tasklet context. */
         diagnostic;      /* Include in 'dump all' handler.                */
 } key_table[128] __read_mostly =
 {
diff --git a/xen/common/kimage.c b/xen/common/kimage.c
index 210241dfb7..9961eac187 100644
--- a/xen/common/kimage.c
+++ b/xen/common/kimage.c
@@ -833,21 +833,21 @@ int kimage_load_segments(struct kexec_image *image)
     return 0;
 }
 
-kimage_entry_t *kimage_entry_next(kimage_entry_t *entry, bool_t compat)
+kimage_entry_t *kimage_entry_next(kimage_entry_t *entry, bool compat)
 {
     if ( compat )
         return (kimage_entry_t *)((uint32_t *)entry + 1);
     return entry + 1;
 }
 
-mfn_t kimage_entry_mfn(kimage_entry_t *entry, bool_t compat)
+mfn_t kimage_entry_mfn(kimage_entry_t *entry, bool compat)
 {
     if ( compat )
         return maddr_to_mfn(*(uint32_t *)entry);
     return maddr_to_mfn(*entry);
 }
 
-unsigned long kimage_entry_ind(kimage_entry_t *entry, bool_t compat)
+unsigned long kimage_entry_ind(kimage_entry_t *entry, bool compat)
 {
     if ( compat )
         return *(uint32_t *)entry & 0xf;
@@ -855,7 +855,7 @@ unsigned long kimage_entry_ind(kimage_entry_t *entry, bool_t compat)
 }
 
 int kimage_build_ind(struct kexec_image *image, mfn_t ind_mfn,
-                     bool_t compat)
+                     bool compat)
 {
     void *page;
     kimage_entry_t *entry;
diff --git a/xen/common/livepatch.c b/xen/common/livepatch.c
index d89a904bd4..845340c7f3 100644
--- a/xen/common/livepatch.c
+++ b/xen/common/livepatch.c
@@ -55,8 +55,8 @@ struct livepatch_work
                                     check_for_livepatch_work. */
     uint32_t timeout;            /* Timeout to do the operation. */
     struct payload *data;        /* The payload on which to act. */
-    volatile bool_t do_work;     /* Signals work to do. */
-    volatile bool_t ready;       /* Signals all CPUs synchronized. */
+    volatile bool do_work;       /* Signals work to do. */
+    volatile bool ready;         /* Signals all CPUs synchronized. */
     unsigned int cmd;            /* Action request: LIVEPATCH_ACTION_* */
 };
 
@@ -69,7 +69,7 @@ static struct livepatch_work livepatch_work;
  * would hammer a global livepatch_work structure on every guest VMEXIT.
  * Having an per-cpu lessens the load.
  */
-static DEFINE_PER_CPU(bool_t, work_to_do);
+static DEFINE_PER_CPU(bool, work_to_do);
 static DEFINE_PER_CPU(struct tasklet, livepatch_tasklet);
 
 static int get_name(const struct xen_livepatch_name *name, char *n)
@@ -106,10 +106,10 @@ static int verify_payload(const struct xen_sysctl_livepatch_upload *upload, char
     return 0;
 }
 
-bool_t is_patch(const void *ptr)
+bool is_patch(const void *ptr)
 {
     const struct payload *data;
-    bool_t r = 0;
+    bool r = false;
 
     /*
      * Only RCU locking since this list is only ever changed during apply
@@ -936,8 +936,8 @@ static int prepare_payload(struct payload *payload,
     return 0;
 }
 
-static bool_t is_payload_symbol(const struct livepatch_elf *elf,
-                                const struct livepatch_elf_sym *sym)
+static bool is_payload_symbol(const struct livepatch_elf *elf,
+                              const struct livepatch_elf_sym *sym)
 {
     if ( sym->sym->st_shndx == SHN_UNDEF ||
          sym->sym->st_shndx >= elf->hdr->e_shnum )
@@ -1018,7 +1018,7 @@ static int build_symbol_table(struct payload *payload,
 
     for ( i = 0; i < nsyms; i++ )
     {
-        bool_t found = 0;
+        bool found = 0;
 
         for ( j = 0; j < payload->nfuncs; j++ )
         {
@@ -1576,7 +1576,7 @@ static void livepatch_do_action(void)
     data->rc = rc;
 }
 
-static bool_t is_work_scheduled(const struct payload *data)
+static bool is_work_scheduled(const struct payload *data)
 {
     ASSERT(spin_is_locked(&payload_lock));
 
@@ -1864,7 +1864,7 @@ void check_for_livepatch_work(void)
  * Unless the 'internal' parameter is used - in which case we only
  * check against the hypervisor.
  */
-static int build_id_dep(struct payload *payload, bool_t internal)
+static int build_id_dep(struct payload *payload, bool internal)
 {
     const void *id = NULL;
     unsigned int len = 0;
diff --git a/xen/common/memory.c b/xen/common/memory.c
index fa165ebc14..b3b05c2ec0 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -757,7 +757,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
                              MEMF_no_refcount) )
             {
                 unsigned long dec_count;
-                bool_t drop_dom_ref;
+                bool drop_dom_ref;
 
                 /*
                  * Pages in in_chunk_list is stolen without
diff --git a/xen/common/notifier.c b/xen/common/notifier.c
index c9ea44db41..0f9aa0f93f 100644
--- a/xen/common/notifier.c
+++ b/xen/common/notifier.c
@@ -72,7 +72,7 @@ int notifier_call_chain(
     int ret = NOTIFY_DONE;
     struct list_head *cursor;
     struct notifier_block *nb = NULL;
-    bool_t reverse = !!(val & NOTIFY_REVERSE);
+    bool reverse = val & NOTIFY_REVERSE;
 
     cursor = pcursor && *pcursor ? &(*pcursor)->chain : &nh->head;
 
diff --git a/xen/common/preempt.c b/xen/common/preempt.c
index 3b4178fd44..0d2dd51ac2 100644
--- a/xen/common/preempt.c
+++ b/xen/common/preempt.c
@@ -25,7 +25,7 @@
 
 DEFINE_PER_CPU(unsigned int, __preempt_count);
 
-bool_t in_atomic(void)
+bool in_atomic(void)
 {
     return preempt_count() || in_irq() || !local_irq_is_enabled();
 }
diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c
index f3baf52ab6..27ba6099b5 100644
--- a/xen/common/rangeset.c
+++ b/xen/common/rangeset.c
@@ -248,11 +248,11 @@ int rangeset_remove_range(
     return rc;
 }
 
-bool_t rangeset_contains_range(
+bool rangeset_contains_range(
     struct rangeset *r, unsigned long s, unsigned long e)
 {
     struct range *x;
-    bool_t contains;
+    bool contains;
 
     ASSERT(s <= e);
 
@@ -267,11 +267,11 @@ bool_t rangeset_contains_range(
     return contains;
 }
 
-bool_t rangeset_overlaps_range(
+bool rangeset_overlaps_range(
     struct rangeset *r, unsigned long s, unsigned long e)
 {
     struct range *x;
-    bool_t overlaps;
+    bool overlaps;
 
     ASSERT(s <= e);
 
@@ -408,13 +408,13 @@ int rangeset_remove_singleton(
     return rangeset_remove_range(r, s, s);
 }
 
-bool_t rangeset_contains_singleton(
+bool rangeset_contains_singleton(
     struct rangeset *r, unsigned long s)
 {
     return rangeset_contains_range(r, s, s);
 }
 
-bool_t rangeset_is_empty(
+bool rangeset_is_empty(
     const struct rangeset *r)
 {
     return ((r == NULL) || list_empty(&r->range_list));
diff --git a/xen/common/shutdown.c b/xen/common/shutdown.c
index a933ee001e..37901a4f33 100644
--- a/xen/common/shutdown.c
+++ b/xen/common/shutdown.c
@@ -12,7 +12,7 @@
 #include <public/sched.h>
 
 /* opt_noreboot: If true, machine will need manual reset on error. */
-bool_t __read_mostly opt_noreboot;
+bool __read_mostly opt_noreboot;
 boolean_param("noreboot", opt_noreboot);
 
 static void noreturn maybe_reboot(void)
diff --git a/xen/common/symbols.c b/xen/common/symbols.c
index 691e617925..133b580768 100644
--- a/xen/common/symbols.c
+++ b/xen/common/symbols.c
@@ -98,7 +98,7 @@ static unsigned int get_symbol_offset(unsigned long pos)
     return name - symbols_names;
 }
 
-bool_t is_active_kernel_text(unsigned long addr)
+bool is_active_kernel_text(unsigned long addr)
 {
     return !!find_text_region(addr);
 }
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 7cabfb0230..3e2cc4906c 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -297,8 +297,8 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     {
         unsigned int i, j, num_nodes;
         struct xen_sysctl_numainfo *ni = &op->u.numainfo;
-        bool_t do_meminfo = !guest_handle_is_null(ni->meminfo);
-        bool_t do_distance = !guest_handle_is_null(ni->distance);
+        bool do_meminfo = !guest_handle_is_null(ni->meminfo);
+        bool do_distance = !guest_handle_is_null(ni->distance);
 
         num_nodes = last_node(node_online_map) + 1;
 
diff --git a/xen/common/tasklet.c b/xen/common/tasklet.c
index 3ad67b5c24..c8abad3c75 100644
--- a/xen/common/tasklet.c
+++ b/xen/common/tasklet.c
@@ -20,7 +20,7 @@
 #include <xen/cpu.h>
 
 /* Some subsystems call into us before we are initialised. We ignore them. */
-static bool_t tasklets_initialised;
+static bool tasklets_initialised;
 
 DEFINE_PER_CPU(unsigned long, tasklet_work_to_do);
 
@@ -37,7 +37,7 @@ static void tasklet_enqueue(struct tasklet *t)
     if ( t->is_softirq )
     {
         struct list_head *list = &per_cpu(softirq_tasklet_list, cpu);
-        bool_t was_empty = list_empty(list);
+        bool was_empty = list_empty(list);
         list_add_tail(&t->list, list);
         if ( was_empty )
             cpu_raise_softirq(cpu, TASKLET_SOFTIRQ);
diff --git a/xen/common/timer.c b/xen/common/timer.c
index 0fddfa7487..47e060e4e9 100644
--- a/xen/common/timer.c
+++ b/xen/common/timer.c
@@ -239,7 +239,7 @@ static inline void deactivate_timer(struct timer *timer)
     list_add(&timer->inactive, &per_cpu(timers, timer->cpu).inactive);
 }
 
-static inline bool_t timer_lock(struct timer *timer)
+static inline bool timer_lock(struct timer *timer)
 {
     unsigned int cpu;
 
@@ -264,7 +264,7 @@ static inline bool_t timer_lock(struct timer *timer)
 }
 
 #define timer_lock_irqsave(t, flags) ({         \
-    bool_t __x;                                 \
+    bool __x;                                   \
     local_irq_save(flags);                      \
     if ( !(__x = timer_lock(t)) )               \
         local_irq_restore(flags);               \
@@ -358,7 +358,7 @@ void migrate_timer(struct timer *timer, unsigned int new_cpu)
 {
     unsigned int old_cpu;
 #if CONFIG_NR_CPUS > 1
-    bool_t active;
+    bool active;
     unsigned long flags;
 
     rcu_read_lock(&timer_cpu_read_lock);
@@ -580,7 +580,7 @@ static void migrate_timers_from_cpu(unsigned int old_cpu)
     unsigned int new_cpu = cpumask_any(&cpu_online_map);
     struct timers *old_ts, *new_ts;
     struct timer *t;
-    bool_t notify = 0;
+    bool notify = false;
 
     ASSERT(!cpu_online(old_cpu) && cpu_online(new_cpu));
 
diff --git a/xen/common/trace.c b/xen/common/trace.c
index 17d62f7056..4e7b080e61 100644
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -433,7 +433,7 @@ int tb_control(struct xen_sysctl_tbuf_op *tbc)
     return rc;
 }
 
-static inline unsigned int calc_rec_size(bool_t cycles, unsigned int extra)
+static inline unsigned int calc_rec_size(bool cycles, unsigned int extra)
 {
     unsigned int rec_size = 4;
 
@@ -443,7 +443,7 @@ static inline unsigned int calc_rec_size(bool_t cycles, unsigned int extra)
     return rec_size;
 }
 
-static inline bool_t bogus(u32 prod, u32 cons)
+static inline bool bogus(u32 prod, u32 cons)
 {
     if ( unlikely(prod & 3) || unlikely(prod >= 2 * data_size) ||
          unlikely(cons & 3) || unlikely(cons >= 2 * data_size) )
@@ -546,7 +546,7 @@ static unsigned char *next_record(const struct t_buf *buf, uint32_t *next,
 static inline void __insert_record(struct t_buf *buf,
                                    unsigned long event,
                                    unsigned int extra,
-                                   bool_t cycles,
+                                   bool cycles,
                                    unsigned int rec_size,
                                    const void *extra_data)
 {
@@ -617,7 +617,7 @@ static inline void insert_wrap_record(struct t_buf *buf,
 {
     u32 space_left = calc_bytes_to_wrap(buf);
     unsigned int extra_space = space_left - sizeof(u32);
-    bool_t cycles = 0;
+    bool cycles = false;
 
     BUG_ON(space_left > size);
 
@@ -674,14 +674,14 @@ static DECLARE_SOFTIRQ_TASKLET(trace_notify_dom0_tasklet,
  *
  * Logs a trace record into the appropriate buffer.
  */
-void __trace_var(u32 event, bool_t cycles, unsigned int extra,
+void __trace_var(u32 event, bool cycles, unsigned int extra,
                  const void *extra_data)
 {
     struct t_buf *buf;
     unsigned long flags;
     u32 bytes_to_tail, bytes_to_wrap;
     unsigned int rec_size, total_size;
-    bool_t started_below_highwater;
+    bool started_below_highwater;
 
     if( !tb_init_done )
         return;
diff --git a/xen/drivers/acpi/apei/apei-base.c b/xen/drivers/acpi/apei/apei-base.c
index de75c1cef9..053a92c307 100644
--- a/xen/drivers/acpi/apei/apei-base.c
+++ b/xen/drivers/acpi/apei/apei-base.c
@@ -154,7 +154,7 @@ int cf_check apei_exec_noop(
  * execute all instructions belong to the action.
  */
 int __apei_exec_run(struct apei_exec_context *ctx, u8 action,
-		    bool_t optional)
+		    bool optional)
 {
 	int rc = -ENOENT;
 	u32 i, ip;
diff --git a/xen/drivers/acpi/apei/apei-internal.h b/xen/drivers/acpi/apei/apei-internal.h
index 360e94b9c8..90233077b7 100644
--- a/xen/drivers/acpi/apei/apei-internal.h
+++ b/xen/drivers/acpi/apei/apei-internal.h
@@ -48,7 +48,7 @@ static inline u64 apei_exec_ctx_get_output(struct apei_exec_context *ctx)
 	return ctx->value;
 }
 
-int __apei_exec_run(struct apei_exec_context *ctx, u8 action, bool_t optional);
+int __apei_exec_run(struct apei_exec_context *ctx, u8 action, bool optional);
 
 static inline int apei_exec_run(struct apei_exec_context *ctx, u8 action)
 {
diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index 40d8f00270..e006b3def2 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -58,7 +58,7 @@
 #define FIRMWARE_MAX_STALL	50			/* 50us */
 
 static struct acpi_table_erst *__read_mostly erst_tab;
-static bool_t __read_mostly erst_enabled;
+static bool __read_mostly erst_enabled;
 
 /* ERST Error Log Address Range atrributes */
 #define ERST_RANGE_RESERVED	0x0001
diff --git a/xen/drivers/acpi/apei/hest.c b/xen/drivers/acpi/apei/hest.c
index 5881275d2f..4ec28c3c11 100644
--- a/xen/drivers/acpi/apei/hest.c
+++ b/xen/drivers/acpi/apei/hest.c
@@ -39,7 +39,7 @@
 
 #define HEST_PFX "HEST: "
 
-static bool_t hest_disable;
+static bool hest_disable;
 boolean_param("hest_disable", hest_disable);
 
 /* HEST table parsing */
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 4824d4a91d..946af5e625 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -54,7 +54,7 @@ static unsigned char __read_mostly opt_conswitch[3] = "a";
 string_runtime_param("conswitch", opt_conswitch);
 
 /* sync_console: force synchronous console output (useful for debugging). */
-static bool_t __initdata opt_sync_console;
+static bool __initdata opt_sync_console;
 boolean_param("sync_console", opt_sync_console);
 static const char __initconst warning_sync_console[] =
     "WARNING: CONSOLE OUTPUT IS SYNCHRONOUS\n"
@@ -64,7 +64,7 @@ static const char __initconst warning_sync_console[] =
     "timekeeping. It is NOT recommended for production use!\n";
 
 /* console_to_ring: send guest (incl. dom 0) console data to console ring. */
-static bool_t __read_mostly opt_console_to_ring;
+static bool __read_mostly opt_console_to_ring;
 boolean_param("console_to_ring", opt_console_to_ring);
 
 /* console_timestamps: include a timestamp prefix on every Xen console line. */
@@ -760,7 +760,7 @@ long do_console_io(
  * *****************************************************
  */
 
-static bool_t console_locks_busted;
+static bool console_locks_busted;
 
 static void __putstr(const char *str)
 {
@@ -911,7 +911,7 @@ static void printk_start_of_line(const char *prefix)
 static void vprintk_common(const char *prefix, const char *fmt, va_list args)
 {
     struct vps {
-        bool_t continued, do_print;
+        bool continued, do_print;
     }            *state;
     static DEFINE_PER_CPU(struct vps, state);
     static char   buf[1024];
diff --git a/xen/drivers/char/ehci-dbgp.c b/xen/drivers/char/ehci-dbgp.c
index 00cbdd5454..72e1beabbb 100644
--- a/xen/drivers/char/ehci-dbgp.c
+++ b/xen/drivers/char/ehci-dbgp.c
@@ -332,7 +332,7 @@ struct ehci_dbgp {
     unsigned long timeout;
     struct timer timer;
     spinlock_t *lock;
-    bool_t reset_run;
+    bool reset_run;
     u8 bus, slot, func, bar;
     u16 pci_cr;
     u32 bar_val;
@@ -639,7 +639,7 @@ static int dbgp_control_msg(struct ehci_dbgp *dbgp, unsigned int devnum,
 {
     u32 addr, pids, ctrl;
     struct usb_ctrlrequest req;
-    bool_t read = (requesttype & USB_DIR_IN) != 0;
+    bool read = (requesttype & USB_DIR_IN) != 0;
     int ret;
 
     if ( size > (read ? DBGP_MAX_PACKET : 0) )
@@ -873,7 +873,7 @@ static int ehci_dbgp_external_startup(struct ehci_dbgp *dbgp)
     unsigned int dbg_port = dbgp->phys_port;
     unsigned int tries = 3;
     unsigned int reset_port_tries = 1;
-    bool_t try_hard_once = 1;
+    bool try_hard_once = true;
 
 try_port_reset_again:
     ret = ehci_dbgp_startup(dbgp);
@@ -1252,7 +1252,7 @@ static void cf_check _ehci_dbgp_poll(struct cpu_user_regs *regs)
     struct ehci_dbgp *dbgp = port->uart;
     unsigned long flags;
     unsigned int timeout = MICROSECS(DBGP_CHECK_INTERVAL);
-    bool_t empty = 0;
+    bool empty = false;
 
     if ( !dbgp->ehci_debug )
         return;
@@ -1300,7 +1300,7 @@ static void cf_check ehci_dbgp_poll(void *data)
 #endif
 }
 
-static bool_t ehci_dbgp_setup_preirq(struct ehci_dbgp *dbgp)
+static bool ehci_dbgp_setup_preirq(struct ehci_dbgp *dbgp)
 {
     if ( !ehci_dbgp_setup(dbgp) )
         return 1;
diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 28ddedd50d..ddf2a48be6 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -58,12 +58,12 @@ static struct ns16550 {
     struct timer timer;
     struct timer resume_timer;
     unsigned int timeout_ms;
-    bool_t intr_works;
-    bool_t dw_usr_bsy;
+    bool intr_works;
+    bool dw_usr_bsy;
 #ifdef NS16550_PCI
     /* PCI card parameters. */
-    bool_t pb_bdf_enable;   /* if =1, pb-bdf effective, port behind bridge */
-    bool_t ps_bdf_enable;   /* if =1, ps_bdf effective, port on pci card */
+    bool pb_bdf_enable;     /* if =1, pb-bdf effective, port behind bridge */
+    bool ps_bdf_enable;     /* if =1, ps_bdf effective, port on pci card */
     unsigned int pb_bdf[3]; /* pci bridge BDF */
     unsigned int ps_bdf[3]; /* pci serial port BDF */
     u32 bar;
@@ -101,8 +101,8 @@ struct ns16550_config_param {
     unsigned int reg_width;
     unsigned int fifo_size;
     u8 lsr_mask;
-    bool_t mmio;
-    bool_t bar0;
+    bool mmio;
+    bool bar0;
     unsigned int max_ports;
     unsigned int base_baud;
     unsigned int uart_offset;
@@ -1172,7 +1172,7 @@ static const struct ns16550_config __initconst uart_config[] =
 };
 
 static int __init
-pci_uart_config(struct ns16550 *uart, bool_t skip_amt, unsigned int idx)
+pci_uart_config(struct ns16550 *uart, bool skip_amt, unsigned int idx)
 {
     u64 orig_base = uart->io_base;
     unsigned int b, d, f, nextf, i;
diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
index f7bf3ad117..513b373b2e 100644
--- a/xen/drivers/char/pl011.c
+++ b/xen/drivers/char/pl011.c
@@ -39,7 +39,7 @@ static struct pl011 {
     /* /\* UART with no IRQ line: periodically-polled I/O. *\/ */
     /* struct timer timer; */
     /* unsigned int timeout_ms; */
-    /* bool_t probing, intr_works; */
+    /* bool probing, intr_works; */
     bool sbsa;  /* ARM SBSA generic interface */
     bool mmio32; /* 32-bit only MMIO */
 } pl011_com = {0};
diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c
index 00efe69574..6d792f06dd 100644
--- a/xen/drivers/char/serial.c
+++ b/xen/drivers/char/serial.c
@@ -29,7 +29,7 @@ static struct serial_port com[SERHND_IDX + 1] = {
     }
 };
 
-static bool_t __read_mostly post_irq;
+static bool __read_mostly post_irq;
 
 static inline void serial_start_tx(struct serial_port *port)
 {
diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
index 8d1e789eab..430351b775 100644
--- a/xen/drivers/cpufreq/cpufreq.c
+++ b/xen/drivers/cpufreq/cpufreq.c
@@ -139,7 +139,7 @@ static int __init cf_check setup_cpufreq_option(const char *str)
 }
 custom_param("cpufreq", setup_cpufreq_option);
 
-bool_t __read_mostly cpufreq_verbose;
+bool __read_mostly cpufreq_verbose;
 
 struct cpufreq_governor *__find_governor(const char *governor)
 {
diff --git a/xen/drivers/video/vesa.c b/xen/drivers/video/vesa.c
index b007ff5678..70feca21ac 100644
--- a/xen/drivers/video/vesa.c
+++ b/xen/drivers/video/vesa.c
@@ -145,7 +145,7 @@ static void cf_check lfb_flush(void)
     __asm__ __volatile__ ("sfence" : : : "memory");
 }
 
-void __init vesa_endboot(bool_t keep)
+void __init vesa_endboot(bool keep)
 {
     if ( keep )
     {
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 281e3f513d..b0c860f0ec 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -22,7 +22,7 @@
 
 DECLARE_PER_CPU(spinlock_t, cpufreq_statistic_lock);
 
-extern bool_t cpufreq_verbose;
+extern bool cpufreq_verbose;
 
 enum cpufreq_xen_opt {
     CPUFREQ_none,
@@ -52,8 +52,8 @@ struct cpufreq_cpuinfo {
 };
 
 struct perf_limits {
-    bool_t no_turbo;
-    bool_t turbo_disabled;
+    bool no_turbo;
+    bool turbo_disabled;
     uint32_t turbo_pct;
     uint32_t max_perf_pct; /* max performance in percentage */
     uint32_t min_perf_pct; /* min performance in percentage */
@@ -77,7 +77,7 @@ struct cpufreq_policy {
     struct perf_limits  limits;
     struct cpufreq_governor     *governor;
 
-    bool_t              resume; /* flag for cpufreq 1st run
+    bool                resume; /* flag for cpufreq 1st run
                                  * S3 wakeup, hotplug cpu, etc */
     s8                  turbo;  /* tristate flag: 0 for unsupported
                                  * -1 for disable, 1 for enabled
@@ -114,7 +114,7 @@ struct cpufreq_governor {
     char    name[CPUFREQ_NAME_LEN];
     int     (*governor)(struct cpufreq_policy *policy,
                         unsigned int event);
-    bool_t  (*handle_option)(const char *name, const char *value);
+    bool    (*handle_option)(const char *name, const char *value);
     struct list_head governor_list;
 };
 
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index a262bba2ed..3ae7b45429 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -29,7 +29,7 @@ struct dt_device_match {
     const char *path;
     const char *type;
     const char *compatible;
-    const bool_t not_available;
+    const bool not_available;
     /*
      * Property name to search for. We only search for the property's
      * existence.
@@ -95,7 +95,7 @@ struct dt_device_node {
     bool is_protected;
 
     /* HACK: Remove this if there is a need of space */
-    bool_t static_evtchn_created;
+    bool static_evtchn_created;
 
     /*
      * The main purpose of this list is to link the structure in the list
@@ -138,7 +138,7 @@ struct dt_irq {
 };
 
 /* If type == DT_IRQ_TYPE_NONE, assume we use level triggered */
-static inline bool_t dt_irq_is_level_triggered(const struct dt_irq *irq)
+static inline bool dt_irq_is_level_triggered(const struct dt_irq *irq)
 {
     unsigned int type = irq->type;
 
@@ -319,19 +319,19 @@ static inline const char *dt_node_name(const struct dt_device_node *np)
     return (np && np->name) ? np->name : "<no-node>";
 }
 
-static inline bool_t dt_node_name_is_equal(const struct dt_device_node *np,
-                                           const char *name)
+static inline bool dt_node_name_is_equal(const struct dt_device_node *np,
+                                         const char *name)
 {
     return !dt_node_cmp(np->name, name);
 }
 
-static inline bool_t dt_node_path_is_equal(const struct dt_device_node *np,
-                                           const char *path)
+static inline bool dt_node_path_is_equal(const struct dt_device_node *np,
+                                         const char *path)
 {
     return !dt_node_cmp(np->full_name, path);
 }
 
-static inline bool_t
+static inline bool
 dt_device_type_is_equal(const struct dt_device_node *device,
                         const char *type)
 {
@@ -360,8 +360,8 @@ static inline bool dt_device_is_protected(const struct dt_device_node *device)
     return device->is_protected;
 }
 
-static inline bool_t dt_property_name_is_equal(const struct dt_property *pp,
-                                               const char *name)
+static inline bool dt_property_name_is_equal(const struct dt_property *pp,
+                                             const char *name)
 {
     return !dt_prop_cmp(pp->name, name);
 }
@@ -372,7 +372,7 @@ dt_device_set_static_evtchn_created(struct dt_device_node *device)
     device->static_evtchn_created = true;
 }
 
-static inline bool_t
+static inline bool
 dt_device_static_evtchn_created(const struct dt_device_node *device)
 {
     return device->static_evtchn_created;
@@ -414,8 +414,8 @@ const struct dt_property *dt_find_property(const struct dt_device_node *np,
  *
  * Return true if get the desired value.
  */
-bool_t dt_property_read_u32(const struct dt_device_node *np,
-                            const char *name, u32 *out_value);
+bool dt_property_read_u32(const struct dt_device_node *np,
+                          const char *name, u32 *out_value);
 /**
  * dt_property_read_u64 - Helper to read a u64 property.
  * @np: node to get the value
@@ -424,8 +424,8 @@ bool_t dt_property_read_u32(const struct dt_device_node *np,
  *
  * Return true if get the desired value.
  */
-bool_t dt_property_read_u64(const struct dt_device_node *np,
-                            const char *name, u64 *out_value);
+bool dt_property_read_u64(const struct dt_device_node *np,
+                          const char *name, u64 *out_value);
 
 
 /**
@@ -491,8 +491,8 @@ static inline int dt_property_read_u32_array(const struct dt_device_node *np,
  * Search for a property in a device node.
  * Return true if the property exists false otherwise.
  */
-static inline bool_t dt_property_read_bool(const struct dt_device_node *np,
-                                           const char *name)
+static inline bool dt_property_read_bool(const struct dt_device_node *np,
+                                         const char *name)
 {
     const struct dt_property *prop = dt_find_property(np, name, NULL);
 
@@ -536,8 +536,8 @@ int dt_property_match_string(const struct dt_device_node *np,
  * Checks if the given "compat" string matches one of the strings in
  * the device's "compatible" property
  */
-bool_t dt_device_is_compatible(const struct dt_device_node *device,
-                               const char *compat);
+bool dt_device_is_compatible(const struct dt_device_node *device,
+                             const char *compat);
 
 /**
  * dt_machine_is_compatible - Test root of device tree for a given compatible value
@@ -546,7 +546,7 @@ bool_t dt_device_is_compatible(const struct dt_device_node *device,
  * Returns true if the root node has the given value in its
  * compatible property.
  */
-bool_t dt_machine_is_compatible(const char *compat);
+bool dt_machine_is_compatible(const char *compat);
 
 /**
  * dt_find_node_by_name - Find a node by its "name" property
@@ -764,7 +764,7 @@ int dt_child_n_addr_cells(const struct dt_device_node *parent);
  * Returns true if the status property is absent or set to "okay" or "ok",
  * false otherwise.
  */
-bool_t dt_device_is_available(const struct dt_device_node *device);
+bool dt_device_is_available(const struct dt_device_node *device);
 
 /**
  * dt_device_for_passthrough - Check if a device will be used for
@@ -775,7 +775,7 @@ bool_t dt_device_is_available(const struct dt_device_node *device);
  * Return true if the property "xen,passthrough" is present in the node,
  * false otherwise.
  */
-bool_t dt_device_for_passthrough(const struct dt_device_node *device);
+bool dt_device_for_passthrough(const struct dt_device_node *device);
 
 /**
  * dt_match_node - Tell if a device_node has a matching of dt_device_match
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 54d88bf5e3..460c8c3d27 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -124,7 +124,7 @@ void arch_dump_domain_info(struct domain *d);
 
 int arch_vcpu_reset(struct vcpu *);
 
-bool_t domctl_lock_acquire(void);
+bool domctl_lock_acquire(void);
 void domctl_lock_release(void);
 
 /*
@@ -144,7 +144,7 @@ void arch_hypercall_tasklet_result(struct vcpu *v, long res);
 
 extern unsigned int xen_processor_pmbits;
 
-extern bool_t opt_dom0_vcpus_pin;
+extern bool opt_dom0_vcpus_pin;
 extern cpumask_t dom0_cpus;
 extern bool dom0_affinity_relaxed;
 
diff --git a/xen/include/xen/gdbstub.h b/xen/include/xen/gdbstub.h
index 18c960969b..d2efeb0e3a 100644
--- a/xen/include/xen/gdbstub.h
+++ b/xen/include/xen/gdbstub.h
@@ -30,7 +30,7 @@ struct cpu_user_regs;
 struct gdb_context {
     int                 serhnd;           /* handle on our serial line */
     int                 console_steal_id; /* handle on stolen console */
-    bool_t              currently_attached;
+    bool                currently_attached;
     atomic_t            running;
     unsigned long       connected;
     u8                  signum;
diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
index 58d462e8e6..0bdfe29576 100644
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -21,7 +21,7 @@ struct irqaction {
     void (*handler)(int irq, void *dev_id, struct cpu_user_regs *regs);
     const char *name;
     void *dev_id;
-    bool_t free_on_release;
+    bool free_on_release;
 #ifdef CONFIG_IRQ_HAS_MULTIPLE_ACTION
     struct irqaction *next;
 #endif
diff --git a/xen/include/xen/kernel.h b/xen/include/xen/kernel.h
index 2c5ed7736c..560b1c2832 100644
--- a/xen/include/xen/kernel.h
+++ b/xen/include/xen/kernel.h
@@ -102,7 +102,7 @@ extern enum system_state {
     SYS_STATE_resume
 } system_state;
 
-bool_t is_active_kernel_text(unsigned long addr);
+bool is_active_kernel_text(unsigned long addr);
 
 extern const char xen_config_data[];
 extern const unsigned int xen_config_data_size;
diff --git a/xen/include/xen/kimage.h b/xen/include/xen/kimage.h
index cbfb9e9054..348f07f5c8 100644
--- a/xen/include/xen/kimage.h
+++ b/xen/include/xen/kimage.h
@@ -47,11 +47,11 @@ int kimage_load_segments(struct kexec_image *image);
 struct page_info *kimage_alloc_control_page(struct kexec_image *image,
                                             unsigned memflags);
 
-kimage_entry_t *kimage_entry_next(kimage_entry_t *entry, bool_t compat);
-mfn_t kimage_entry_mfn(kimage_entry_t *entry, bool_t compat);
-unsigned long kimage_entry_ind(kimage_entry_t *entry, bool_t compat);
+kimage_entry_t *kimage_entry_next(kimage_entry_t *entry, bool compat);
+mfn_t kimage_entry_mfn(kimage_entry_t *entry, bool compat);
+unsigned long kimage_entry_ind(kimage_entry_t *entry, bool compat);
 int kimage_build_ind(struct kexec_image *image, mfn_t ind_mfn,
-                     bool_t compat);
+                     bool compat);
 
 #endif /* __ASSEMBLY__ */
 
diff --git a/xen/include/xen/livepatch.h b/xen/include/xen/livepatch.h
index 9fdb29c382..458eef57a7 100644
--- a/xen/include/xen/livepatch.h
+++ b/xen/include/xen/livepatch.h
@@ -48,13 +48,13 @@ struct livepatch_symbol {
     const char *name;
     unsigned long value;
     unsigned int size;
-    bool_t new_symbol;
+    bool new_symbol;
 };
 
 int livepatch_op(struct xen_sysctl_livepatch_op *);
 void check_for_livepatch_work(void);
 unsigned long livepatch_symbols_lookup_by_name(const char *symname);
-bool_t is_patch(const void *addr);
+bool is_patch(const void *addr);
 
 /* Arch hooks. */
 int arch_livepatch_verify_elf(const struct livepatch_elf *elf);
@@ -169,7 +169,7 @@ static inline int livepatch_op(struct xen_sysctl_livepatch_op *op)
 }
 
 static inline void check_for_livepatch_work(void) { };
-static inline bool_t is_patch(const void *addr)
+static inline bool is_patch(const void *addr)
 {
     return 0;
 }
diff --git a/xen/include/xen/mm-frame.h b/xen/include/xen/mm-frame.h
index 0105ed0130..922ae41880 100644
--- a/xen/include/xen/mm-frame.h
+++ b/xen/include/xen/mm-frame.h
@@ -38,7 +38,7 @@ static inline mfn_t mfn_min(mfn_t x, mfn_t y)
     return _mfn(min(mfn_x(x), mfn_x(y)));
 }
 
-static inline bool_t mfn_eq(mfn_t x, mfn_t y)
+static inline bool mfn_eq(mfn_t x, mfn_t y)
 {
     return mfn_x(x) == mfn_x(y);
 }
@@ -77,7 +77,7 @@ static inline gfn_t gfn_min(gfn_t x, gfn_t y)
     return _gfn(min(gfn_x(x), gfn_x(y)));
 }
 
-static inline bool_t gfn_eq(gfn_t x, gfn_t y)
+static inline bool gfn_eq(gfn_t x, gfn_t y)
 {
     return gfn_x(x) == gfn_x(y);
 }
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 8b9618609f..595629cf3f 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -254,7 +254,7 @@ struct page_list_head
 # define INIT_PAGE_LIST_HEAD(head) ((head)->tail = (head)->next = NULL)
 # define INIT_PAGE_LIST_ENTRY(ent) ((ent)->prev = (ent)->next = PAGE_LIST_NULL)
 
-static inline bool_t
+static inline bool
 page_list_empty(const struct page_list_head *head)
 {
     return !head->next;
@@ -313,7 +313,7 @@ page_list_add_tail(struct page_info *page, struct page_list_head *head)
     }
     head->tail = page;
 }
-static inline bool_t
+static inline bool
 __page_list_del_head(struct page_info *page, struct page_list_head *head,
                      struct page_info *next, struct page_info *prev)
 {
@@ -427,7 +427,7 @@ page_list_splice(struct page_list_head *list, struct page_list_head *head)
 # define INIT_PAGE_LIST_HEAD             INIT_LIST_HEAD
 # define INIT_PAGE_LIST_ENTRY            INIT_LIST_HEAD
 
-static inline bool_t
+static inline bool
 page_list_empty(const struct page_list_head *head)
 {
     return !!list_empty(head);
diff --git a/xen/include/xen/preempt.h b/xen/include/xen/preempt.h
index bef83135a1..aa059b497b 100644
--- a/xen/include/xen/preempt.h
+++ b/xen/include/xen/preempt.h
@@ -26,7 +26,7 @@ DECLARE_PER_CPU(unsigned int, __preempt_count);
     preempt_count()--;                          \
 } while (0)
 
-bool_t in_atomic(void);
+bool in_atomic(void);
 
 #ifndef NDEBUG
 void ASSERT_NOT_IN_ATOMIC(void);
diff --git a/xen/include/xen/rangeset.h b/xen/include/xen/rangeset.h
index 135f33f606..a211e3dfac 100644
--- a/xen/include/xen/rangeset.h
+++ b/xen/include/xen/rangeset.h
@@ -52,7 +52,7 @@ void rangeset_limit(
 #define _RANGESETF_prettyprint_hex 0
 #define RANGESETF_prettyprint_hex  (1U << _RANGESETF_prettyprint_hex)
 
-bool_t __must_check rangeset_is_empty(
+bool __must_check rangeset_is_empty(
     const struct rangeset *r);
 
 /* Add/claim/remove/query a numeric range. */
@@ -62,9 +62,9 @@ int __must_check rangeset_claim_range(struct rangeset *r, unsigned long size,
                                       unsigned long *s);
 int __must_check rangeset_remove_range(
     struct rangeset *r, unsigned long s, unsigned long e);
-bool_t __must_check rangeset_contains_range(
+bool __must_check rangeset_contains_range(
     struct rangeset *r, unsigned long s, unsigned long e);
-bool_t __must_check rangeset_overlaps_range(
+bool __must_check rangeset_overlaps_range(
     struct rangeset *r, unsigned long s, unsigned long e);
 int rangeset_report_ranges(
     struct rangeset *r, unsigned long s, unsigned long e,
@@ -88,7 +88,7 @@ int __must_check rangeset_add_singleton(
     struct rangeset *r, unsigned long s);
 int __must_check rangeset_remove_singleton(
     struct rangeset *r, unsigned long s);
-bool_t __must_check rangeset_contains_singleton(
+bool __must_check rangeset_contains_singleton(
     struct rangeset *r, unsigned long s);
 
 /* swap contents */
diff --git a/xen/include/xen/rwlock.h b/xen/include/xen/rwlock.h
index e0d2b41c5c..08ba46de15 100644
--- a/xen/include/xen/rwlock.h
+++ b/xen/include/xen/rwlock.h
@@ -293,7 +293,7 @@ typedef struct percpu_rwlock percpu_rwlock_t;
 
 struct percpu_rwlock {
     rwlock_t            rwlock;
-    bool_t              writer_activating;
+    bool                writer_activating;
 #ifndef NDEBUG
     percpu_rwlock_t     **percpu_owner;
 #endif
diff --git a/xen/include/xen/serial.h b/xen/include/xen/serial.h
index f0aff7ea76..cf9701986f 100644
--- a/xen/include/xen/serial.h
+++ b/xen/include/xen/serial.h
@@ -48,7 +48,7 @@ struct serial_port {
     /* Transmit data buffer (interrupt-driven uart). */
     char               *txbuf;
     unsigned int        txbufp, txbufc;
-    bool_t              tx_quench;
+    bool                tx_quench;
     int                 tx_log_everything;
     /* Force synchronous transmit. */
     int                 sync;
diff --git a/xen/include/xen/shutdown.h b/xen/include/xen/shutdown.h
index b3f7e30cde..668aed0be5 100644
--- a/xen/include/xen/shutdown.h
+++ b/xen/include/xen/shutdown.h
@@ -4,7 +4,7 @@
 #include <xen/compiler.h>
 
 /* opt_noreboot: If true, machine will need manual reset on error. */
-extern bool_t opt_noreboot;
+extern bool opt_noreboot;
 
 void noreturn hwdom_shutdown(u8 reason);
 
diff --git a/xen/include/xen/tasklet.h b/xen/include/xen/tasklet.h
index 193acf8f42..1362d4af27 100644
--- a/xen/include/xen/tasklet.h
+++ b/xen/include/xen/tasklet.h
@@ -18,9 +18,9 @@ struct tasklet
 {
     struct list_head list;
     int scheduled_on;
-    bool_t is_softirq;
-    bool_t is_running;
-    bool_t is_dead;
+    bool is_softirq;
+    bool is_running;
+    bool is_dead;
     void (*func)(void *);
     void *data;
 };
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:46:45 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:46:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640000.997763 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Fev-0005Q1-Hs; Thu, 23 Nov 2023 19:46:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640000.997763; Thu, 23 Nov 2023 19:46:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Fev-0005Pt-FE; Thu, 23 Nov 2023 19:46:45 +0000
Received: by outflank-mailman (input) for mailman id 640000;
 Thu, 23 Nov 2023 19:46: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 1r6Feu-0005Pf-0z
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:46: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 1r6Feu-0001c2-0G
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:46:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fet-00079N-Vj
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:46:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pVqMACjdhkqvRAWbDTO+aOD19pBIDIxtX0j3hAvZSAc=; b=TdyQXf+28lyWqDDzKkkszFus/C
	vt5NgOe8IUYsale/BO42UTNZ+03vGOxYILMt7wG7J2+HXFHosb8LgVV5QAX2ngP8U80SxwfQbgsWW
	UeWFjDkGBnbsYXFBe1vgNoWzHVlMxvoZ6cEZ2SGhdtvHA4sii11YjBmJSiqp1P5Wn8xc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Drop bool_t
Message-Id: <E1r6Fet-00079N-Vj@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:46:43 +0000

commit 24b1107449ffabae2b9ad369065566eefc1201d3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 20 17:03:48 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 21 13:28:51 2023 +0000

    xen: Drop bool_t
    
    No more users.
    
    This completes the work started in commit 920234259475 ("xen/build: Use C99
    booleans"), July 2016.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/types.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/xen/include/xen/types.h b/xen/include/xen/types.h
index 64e75674da..449947b353 100644
--- a/xen/include/xen/types.h
+++ b/xen/include/xen/types.h
@@ -64,7 +64,6 @@ typedef __u64 __be64;
 
 typedef unsigned int __attribute__((__mode__(__pointer__))) uintptr_t;
 
-typedef bool bool_t;
 #define test_and_set_bool(b)   xchg(&(b), true)
 #define test_and_clear_bool(b) xchg(&(b), false)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:46:55 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:46:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640001.997766 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Ff5-0005Sl-J4; Thu, 23 Nov 2023 19:46:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640001.997766; Thu, 23 Nov 2023 19:46: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 1r6Ff5-0005Sd-Gb; Thu, 23 Nov 2023 19:46:55 +0000
Received: by outflank-mailman (input) for mailman id 640001;
 Thu, 23 Nov 2023 19:46: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 1r6Ff4-0005SQ-3n
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:46: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 1r6Ff4-0001cB-37
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:46:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Ff4-00079p-2O
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:46: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=VZNp01Awwp98w8OXLRtaOIeW00dFGFvURwN5jYoTdYE=; b=WGkxWXHMv4YFCnIE9qtV8i01v6
	x5z6O91FPbGMs7kNx6tLzLJzYJoK61UAuOw6LalN6bCDAgbzTmRLZYiKi4zC7ISyvaiZz6MDSl8w6
	e7Vd+QWpqWpBPIbXmfioA5anVQVTNJxNKSCnacu2CXiMOAqicf3klJNGLzUkUAjZAupc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/setup: Make the loader variable const
Message-Id: <E1r6Ff4-00079p-2O@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:46:54 +0000

commit 1a177d4669e13cfed9655f98504fb131ae9acf6b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 20 21:57:55 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 21 13:28:51 2023 +0000

    x86/setup: Make the loader variable const
    
    It is never written through, but has a string literal assigned, and needs to
    be const to support -Wwrite-strings.
    
    Suggested-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/setup.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index a3d3f797bb..c41dfdb2bd 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -971,8 +971,8 @@ static struct domain *__init create_dom0(const module_t *image,
 /* SAF-1-safe */
 void __init noreturn __start_xen(unsigned long mbi_p)
 {
-    const char *memmap_type = NULL;
-    char *cmdline, *kextra, *loader;
+    const char *memmap_type = NULL, *loader;
+    char *cmdline, *kextra;
     void *bsp_stack;
     struct cpu_info *info = get_cpu_info(), *bsp_info;
     unsigned int initrdidx, num_parked = 0;
@@ -1023,8 +1023,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         mod = __va(mbi->mods_addr);
     }
 
-    loader = (mbi->flags & MBI_LOADERNAME)
-        ? (char *)__va(mbi->boot_loader_name) : "unknown";
+    loader = (mbi->flags & MBI_LOADERNAME) ? __va(mbi->boot_loader_name)
+                                           : "unknown";
 
     /* Parse the command-line options. */
     cmdline = cmdline_cook((mbi->flags & MBI_CMDLINE) ?
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:47:05 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:47:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640002.997771 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6FfF-0005WE-L0; Thu, 23 Nov 2023 19:47:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640002.997771; Thu, 23 Nov 2023 19:47: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 1r6FfF-0005W4-I3; Thu, 23 Nov 2023 19:47:05 +0000
Received: by outflank-mailman (input) for mailman id 640002;
 Thu, 23 Nov 2023 19:47:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FfE-0005VR-6q
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:47:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FfE-0001cY-69
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:47:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FfE-0007AP-5G
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:47: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=oeb85bema0R3cOkU2NdNRZJO4BxbHErQLEWL2Hwsc94=; b=fVB/PoBIR2rCzejynsZP9x9zY4
	8uytLiiQlFZWVUaXv4wqv/d49e6lym048vuFk997lvy+lmwnR2Kb8smyZIzUgTd6KwVhG5yatBK0W
	lZ5Xtyx48HLd7E9p5Y7/xZzy0gGnY+FQ3lm9y4Hzyr4071UemEEqmSYP8WbndZgBuGIk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/duart: make dt_uart_init() compile with -Wwrite-strings
Message-Id: <E1r6FfE-0007AP-5G@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:47:04 +0000

commit 6c1d5f65162fec80c53c2f782e0546e9e5b98e7c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 20 21:33:10 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 21 13:28:51 2023 +0000

    arm/duart: make dt_uart_init() compile with -Wwrite-strings
    
    GCC complains:
    
      drivers/char/arm-uart.c: In function 'dt_uart_init':
      drivers/char/arm-uart.c:81:17: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
         81 |         options = "";
            |                 ^
    
    The problem is using the options string for both splitting opt_duart, and to
    hold a token "" for no options.
    
    Use two variables; one mutable and one const.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/drivers/char/arm-uart.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/char/arm-uart.c b/xen/drivers/char/arm-uart.c
index 8098a968c2..91f13a4136 100644
--- a/xen/drivers/char/arm-uart.c
+++ b/xen/drivers/char/arm-uart.c
@@ -42,7 +42,8 @@ static void __init dt_uart_init(void)
     struct dt_device_node *dev;
     int ret;
     const char *devpath = opt_dtuart;
-    char *options;
+    const char *options;
+    char *split;
 
     if ( !console_has("dtuart") )
         return; /* Not for us */
@@ -74,9 +75,12 @@ static void __init dt_uart_init(void)
         return;
     }
 
-    options = strchr(opt_dtuart, ':');
-    if ( options != NULL )
-        *(options++) = '\0';
+    split = strchr(opt_dtuart, ':');
+    if ( split )
+    {
+        split[0] = '\0';
+        options = split + 1;
+    }
     else
         options = "";
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:47:15 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:47:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640003.997774 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6FfP-0005ZB-MA; Thu, 23 Nov 2023 19:47:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640003.997774; Thu, 23 Nov 2023 19:47: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 1r6FfP-0005Z4-Jf; Thu, 23 Nov 2023 19:47:15 +0000
Received: by outflank-mailman (input) for mailman id 640003;
 Thu, 23 Nov 2023 19:47:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FfO-0005Yv-9m
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:47:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FfO-0001cf-93
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:47:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FfO-0007Au-8K
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:47:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uZ/+4r/1Wug72z2KNN7pqdSC96SXWuN/44Z1adx7IzQ=; b=6H7ONpeRxHeZ6ipwyuktub4VJP
	qB4BJ1k4S59VICcleU+4Pk7g04PwVGWGoagEnzaD+gNSaCthMEdWWmt7XjWOn59rQ8404YuqIa+77
	ty3WYU5fTBp4LYWgUE7MExhsHYx7lexRFvFzK6CiGwykxp90VRYangAW7A3GyNascVJ8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/platforms: Make compatbile with -Wwrite-strings
Message-Id: <E1r6FfO-0007Au-8K@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:47:14 +0000

commit 10081c2dc571775b538bb00982606a39832ad7e3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 20 21:33:59 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 21 13:28:51 2023 +0000

    arm/platforms: Make compatbile with -Wwrite-strings
    
    GCC complains:
    
      arch/arm/platforms/brcm.c: In function ‘brcm_populate_plat_regs’:
      arch/arm/platforms/brcm.c:76:27: error: passing argument 1 of ‘brcm_get_dt_node’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
         76 |     rc = brcm_get_dt_node("brcm,brcmstb-cpu-biu-ctrl", &node, &reg_base);
            |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    and
    
      arch/arm/platforms/exynos5.c: In function ‘exynos5_smp_init’:
      arch/arm/platforms/exynos5.c:109:20: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
        109 |         compatible = "samsung,exynos4210-sysram-ns";
            |                    ^
    
      arch/arm/acpi/domain_build.c: In function 'acpi_create_xsdt':
      ./include/acpi/actbl.h:66:33: error: passing argument 3 of 'acpi_xsdt_modify_entry' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
         66 | #define ACPI_SIG_FADT           "FACP"  /* Fixed ACPI Description Table */
            |                                 ^~~~~~
    
    In all cases, just make the relevant variable const.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/acpi/domain_build.c | 2 +-
 xen/arch/arm/platforms/brcm.c    | 2 +-
 xen/arch/arm/platforms/exynos5.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/acpi/domain_build.c b/xen/arch/arm/acpi/domain_build.c
index ed824c0178..b58389ce9e 100644
--- a/xen/arch/arm/acpi/domain_build.c
+++ b/xen/arch/arm/acpi/domain_build.c
@@ -245,7 +245,7 @@ static int __init acpi_create_rsdp(struct domain *d, struct membank tbl_add[])
 
 static void __init acpi_xsdt_modify_entry(u64 entry[],
                                           unsigned long entry_count,
-                                          char *signature, u64 addr)
+                                          const char *signature, u64 addr)
 {
     int i;
     struct acpi_table_header *table;
diff --git a/xen/arch/arm/platforms/brcm.c b/xen/arch/arm/platforms/brcm.c
index 951e4d6cc3..43a07ab1a6 100644
--- a/xen/arch/arm/platforms/brcm.c
+++ b/xen/arch/arm/platforms/brcm.c
@@ -35,7 +35,7 @@ static u32 brcm_boot_continuation_pc;
 
 static struct brcm_plat_regs regs;
 
-static __init int brcm_get_dt_node(char *compat_str,
+static __init int brcm_get_dt_node(const char *compat_str,
                                    const struct dt_device_node **dn,
                                    u32 *reg_base)
 {
diff --git a/xen/arch/arm/platforms/exynos5.c b/xen/arch/arm/platforms/exynos5.c
index c48093cd4f..f7c0952067 100644
--- a/xen/arch/arm/platforms/exynos5.c
+++ b/xen/arch/arm/platforms/exynos5.c
@@ -96,7 +96,7 @@ static int __init exynos5_smp_init(void)
 {
     struct dt_device_node *node;
     void __iomem *sysram;
-    char *compatible;
+    const char *compatible;
     paddr_t sysram_addr;
     paddr_t size;
     paddr_t sysram_offset;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:47:25 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:47:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640004.997779 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6FfZ-0005cJ-Nr; Thu, 23 Nov 2023 19:47:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640004.997779; Thu, 23 Nov 2023 19:47:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6FfZ-0005cB-L9; Thu, 23 Nov 2023 19:47:25 +0000
Received: by outflank-mailman (input) for mailman id 640004;
 Thu, 23 Nov 2023 19:47:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FfY-0005bd-DO
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:47:24 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FfY-0001cm-Ce
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:47:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FfY-0007BM-Bs
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:47:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bq5XBlNgH/uxx98tXDXCnURJGXsO69n7osf/Qc4+1rA=; b=5T+NgjtD4oqZDLTb1yOwF3uimu
	2/m13SPYvNL8GCW9Pa6qatKU5HrwExwee5oik0uDUrP3LJ87TN50oyrqK+OBn9MIu31VUnoYqVZV+
	w5uMPd7gWJls03SgIfqxr9MbsDBJMyw00yxvgvrAQm37Iq03p48WNSm4W0qmc9Rl8fiY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: add deviation for asm-only functions
Message-Id: <E1r6FfY-0007BM-Bs@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:47:24 +0000

commit 820ee3ec4dd5679715bd49a1d12b81cb1502260c
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Wed Nov 1 10:30:31 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Nov 21 17:50:57 2023 -0800

    x86: add deviation for asm-only functions
    
    As stated in rules.rst, functions used only in asm modules
    are allowed to have no prior declaration visible when being
    defined, hence these functions are marked with an
    'asmlinkage' macro, which is then deviated for MISRA C:2012
    Rule 8.4.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    [stefano: improve deviation text]
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 9 +++++++++
 docs/misra/deviations.rst                        | 7 +++++++
 xen/arch/x86/hvm/svm/intr.c                      | 2 +-
 xen/arch/x86/hvm/svm/nestedsvm.c                 | 2 +-
 xen/arch/x86/hvm/svm/svm.c                       | 4 ++--
 xen/arch/x86/hvm/vmx/intr.c                      | 2 +-
 xen/arch/x86/hvm/vmx/vmx.c                       | 4 ++--
 xen/arch/x86/hvm/vmx/vvmx.c                      | 2 +-
 xen/arch/x86/traps.c                             | 2 +-
 xen/arch/x86/x86_64/traps.c                      | 2 +-
 xen/include/xen/compiler.h                       | 5 +++++
 11 files changed, 31 insertions(+), 10 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 5b7cf4c947..c9e3a90801 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -162,6 +162,15 @@ Therefore the absence of prior declarations is safe."
 -config=MC3R1.R8.4,reports+={safe, "first_area(any_loc(file(gcov)))"}
 -doc_end
 
+-doc_begin="Recognize the occurrence of current_stack_pointer as a declaration."
+-file_tag+={asm_defns, "^xen/arch/x86/include/asm/asm_defns\\.h$"}
+-config=MC3R1.R8.4,declarations+={safe, "loc(file(asm_defns))&&^current_stack_pointer$"}
+-doc_end
+
+-doc_begin="asmlinkage is a marker to indicate that the function is only used to interface with asm modules."
+-config=MC3R1.R8.4,declarations+={safe,"loc(text(^(?s).*asmlinkage.*$, -1..0))"}
+-doc_end
+
 -doc_begin="The following variables are compiled in multiple translation units
 belonging to different executables and therefore are safe."
 -config=MC3R1.R8.6,declarations+={safe, "name(current_stack_pointer||bsearch||sort)"}
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 95872b40a2..160513b997 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -139,6 +139,13 @@ Deviations related to MISRA C:2012 Rules:
        configuration. Therefore, the absence of prior declarations is safe.
      - Tagged as `safe` for ECLAIR.
 
+   * - R8.4
+     - Functions and variables used only by asm modules are marked with
+       the `asmlinkage` macro. Existing code may use a SAF-1-safe
+       textual deviation (see safe.json), but new code should not use
+       it.
+     - Tagged as `safe` for ECLAIR.
+
    * - R8.6
      - The following variables are compiled in multiple translation units
        belonging to different executables and therefore are safe.
diff --git a/xen/arch/x86/hvm/svm/intr.c b/xen/arch/x86/hvm/svm/intr.c
index 192e17ebbf..4805c55672 100644
--- a/xen/arch/x86/hvm/svm/intr.c
+++ b/xen/arch/x86/hvm/svm/intr.c
@@ -123,7 +123,7 @@ static void svm_enable_intr_window(struct vcpu *v, struct hvm_intack intack)
         vmcb, general1_intercepts | GENERAL1_INTERCEPT_VINTR);
 }
 
-void svm_intr_assist(void)
+void asmlinkage svm_intr_assist(void)
 {
     struct vcpu *v = current;
     struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 4073c317ec..ee9602f5c8 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -1441,7 +1441,7 @@ nestedsvm_vcpu_vmexit(struct vcpu *v, struct cpu_user_regs *regs,
 }
 
 /* VCPU switch */
-void nsvm_vcpu_switch(void)
+void asmlinkage nsvm_vcpu_switch(void)
 {
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     struct vcpu *v = current;
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index df4cb3fd33..88bda6fb4c 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1056,7 +1056,7 @@ static void noreturn cf_check svm_do_resume(void)
     reset_stack_and_jump(svm_asm_do_resume);
 }
 
-void svm_vmenter_helper(void)
+void asmlinkage svm_vmenter_helper(void)
 {
     const struct cpu_user_regs *regs = guest_cpu_user_regs();
     struct vcpu *curr = current;
@@ -2586,7 +2586,7 @@ const struct hvm_function_table * __init start_svm(void)
     return &svm_function_table;
 }
 
-void svm_vmexit_handler(void)
+void asmlinkage svm_vmexit_handler(void)
 {
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     uint64_t exit_reason;
diff --git a/xen/arch/x86/hvm/vmx/intr.c b/xen/arch/x86/hvm/vmx/intr.c
index fd719c4c01..8beeaab151 100644
--- a/xen/arch/x86/hvm/vmx/intr.c
+++ b/xen/arch/x86/hvm/vmx/intr.c
@@ -224,7 +224,7 @@ void vmx_sync_exit_bitmap(struct vcpu *v)
     }
 }
 
-void vmx_intr_assist(void)
+void asmlinkage vmx_intr_assist(void)
 {
     struct hvm_intack intack;
     struct vcpu *v = current;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index b99770d588..5663bc0178 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -4035,7 +4035,7 @@ static void undo_nmis_unblocked_by_iret(void)
               guest_info | VMX_INTR_SHADOW_NMI);
 }
 
-void vmx_vmexit_handler(struct cpu_user_regs *regs)
+void asmlinkage vmx_vmexit_handler(struct cpu_user_regs *regs)
 {
     unsigned long exit_qualification, exit_reason, idtv_info, intr_info = 0;
     unsigned int vector = 0;
@@ -4787,7 +4787,7 @@ static void lbr_fixup(void)
 }
 
 /* Returns false if the vmentry has to be restarted */
-bool vmx_vmenter_helper(const struct cpu_user_regs *regs)
+bool asmlinkage vmx_vmenter_helper(const struct cpu_user_regs *regs)
 {
     struct vcpu *curr = current;
     struct domain *currd = curr->domain;
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index e2bb71b0ab..f14053e763 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1490,7 +1490,7 @@ static void nvmx_eptp_update(void)
     __vmwrite(EPT_POINTER, get_shadow_eptp(curr));
 }
 
-void nvmx_switch_guest(void)
+void asmlinkage nvmx_switch_guest(void)
 {
     struct vcpu *v = current;
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 9a6d29f24a..f2a77003ab 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2267,7 +2267,7 @@ void asm_domain_crash_synchronous(unsigned long addr)
 }
 
 #ifdef CONFIG_DEBUG
-void check_ist_exit(const struct cpu_user_regs *regs, bool ist_exit)
+void asmlinkage check_ist_exit(const struct cpu_user_regs *regs, bool ist_exit)
 {
     const unsigned int ist_mask =
         (1U << X86_EXC_NMI) | (1U << X86_EXC_DB) |
diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index e03e80813e..668605e5bc 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -266,7 +266,7 @@ void show_page_walk(unsigned long addr)
            l1_table_offset(addr), l1e_get_intpte(l1e), pfn);
 }
 
-void do_double_fault(struct cpu_user_regs *regs)
+void asmlinkage do_double_fault(struct cpu_user_regs *regs)
 {
     unsigned int cpu;
     unsigned long crs[8];
diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h
index a8be1f19cf..04b8bc18df 100644
--- a/xen/include/xen/compiler.h
+++ b/xen/include/xen/compiler.h
@@ -151,6 +151,11 @@
 # define ASM_FLAG_OUT(yes, no) no
 #endif
 
+/* Mark a function or variable as being used only to interface with asm */
+#ifndef asmlinkage
+#define asmlinkage
+#endif
+
 /*
  * NB: we need to disable the gcc-compat warnings for clang in some places or
  * else it will complain with: "'break' is bound to loop, GCC binds it to
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:47:35 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:47:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640005.997782 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Ffj-0005ez-PD; Thu, 23 Nov 2023 19:47:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640005.997782; Thu, 23 Nov 2023 19:47:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Ffj-0005es-Mp; Thu, 23 Nov 2023 19:47:35 +0000
Received: by outflank-mailman (input) for mailman id 640005;
 Thu, 23 Nov 2023 19:47:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Ffi-0005eh-GR
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:47:34 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Ffi-0001d5-Fg
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:47:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Ffi-0007Bp-Eq
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:47:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6gcjsDR/QNk/SiAH/ytGr4+It1nzgejQniN8khnwT10=; b=z/+V2RzuuMsK7EdGc1gM8lMX2o
	HlGj0lmc/OnY0wZsvK44aRaeFE1G1v73opxxTF7I47homh5yCQL4gV5EdShriDaiNq+nbRFqXoLOy
	rr44uhkS1VidfhqVGuF0fxRulyPVNpkOYAxOS7ak7T6LH7jVHVVFtwMlgNKOtO4Vtgqc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mm: Fix up bad bool conversion in ept_set_entry()
Message-Id: <E1r6Ffi-0007Bp-Eq@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:47:34 +0000

commit 0fa916aba8c873e3c2885ac448800f36ec2ffa0e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 22 10:26:03 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 22 13:37:17 2023 +0000

    x86/mm: Fix up bad bool conversion in ept_set_entry()
    
    This accidentally turned a 1 into false.
    
    Noticed by Coverity.
    
    Reported-by: Jan Beulich <JBeulich@suse.com>
    Fixes: de577618c285 ("x86/treewide: Switch bool_t to bool")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm/p2m-ept.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 227bdf7c24..f83610cb8c 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -803,7 +803,7 @@ ept_set_entry(struct p2m_domain *p2m, gfn_t gfn_, mfn_t mfn,
     bool need_modify_vtd_table = true;
     bool vtd_pte_present = false;
     unsigned int iommu_flags = p2m_get_iommu_flags(p2mt, p2ma, mfn);
-    bool needs_sync = false;
+    bool needs_sync = true;
     ept_entry_t old_entry = { .epte = 0 };
     ept_entry_t new_entry = { .epte = 0 };
     struct ept_data *ept = &p2m->ept;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:47:47 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:47:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640006.997786 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Ffu-0005hv-RQ; Thu, 23 Nov 2023 19:47:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640006.997786; Thu, 23 Nov 2023 19:47: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 1r6Ffu-0005hn-OK; Thu, 23 Nov 2023 19:47:46 +0000
Received: by outflank-mailman (input) for mailman id 640006;
 Thu, 23 Nov 2023 19:47:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Ffs-0005hU-JQ
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:47:44 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Ffs-0001dY-Ih
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:47:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Ffs-0007CI-Hp
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:47:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nv8QsjIRLWC7paRk7b2AN6TDle6LeihTJFz8mJ+70kk=; b=iSaT3T0ge+O/7F8U8EbRPc8hs2
	QhS9O7WjojB3tcIrqG5Z4wvNL9Db9lHFSCoHNpHefPtJjtpjcUZmGiJR/963Gop3wDSDnXox6BXu0
	55XOT05R+55biHYDpbG68bqQFRCm8RCLMTAf+L+3h5S+43OUML4mrPg6GRz/enGRb+iU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvm: Trivial style cleanup in vlapic.c
Message-Id: <E1r6Ffs-0007CI-Hp@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:47:44 +0000

commit 84915b80a976287c1d4bdb8229da2cb8eb334c27
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Sep 17 16:19:57 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 22 13:37:17 2023 +0000

    x86/hvm: Trivial style cleanup in vlapic.c
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/vlapic.c | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index a54010d71e..5cb87f8649 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -191,8 +191,7 @@ uint32_t vlapic_set_ppr(struct vlapic *vlapic)
    return ppr;
 }
 
-static bool vlapic_match_logical_addr(const struct vlapic *vlapic,
-                                      uint32_t mda)
+static bool vlapic_match_logical_addr(const struct vlapic *vlapic, uint32_t mda)
 {
     bool result = false;
     uint32_t logical_id = vlapic_get_reg(vlapic, APIC_LDR);
@@ -208,11 +207,11 @@ static bool vlapic_match_logical_addr(const struct vlapic *vlapic,
     {
     case APIC_DFR_FLAT:
         if ( logical_id & mda )
-            result = 1;
+            result = true;
         break;
     case APIC_DFR_CLUSTER:
         if ( ((logical_id >> 4) == (mda >> 0x4)) && (logical_id & mda & 0xf) )
-            result = 1;
+            result = true;
         break;
     default:
         printk(XENLOG_G_WARNING "%pv: bad LAPIC DFR value %08x\n",
@@ -244,7 +243,7 @@ bool vlapic_match_dest(
         return (target == source);
 
     case APIC_DEST_ALLINC:
-        return 1;
+        return true;
 
     case APIC_DEST_ALLBUT:
         return (target != source);
@@ -254,7 +253,7 @@ bool vlapic_match_dest(
         break;
     }
 
-    return 0;
+    return false;
 }
 
 static void vlapic_init_sipi_one(struct vcpu *target, uint32_t icr)
@@ -462,7 +461,7 @@ static bool is_multicast_dest(struct vlapic *vlapic, unsigned int short_hand,
                               uint32_t dest, bool dest_mode)
 {
     if ( vlapic_domain(vlapic)->max_vcpus <= 2 )
-        return 0;
+        return false;
 
     if ( short_hand )
         return short_hand != APIC_DEST_SELF;
@@ -837,7 +836,7 @@ void vlapic_reg_write(struct vcpu *v, unsigned int reg, uint32_t val)
 
     case APIC_LVTT:         /* LVT Timer Reg */
         if ( vlapic_lvtt_tdt(vlapic) !=
-             ((val & APIC_TIMER_MODE_MASK) == APIC_TIMER_MODE_TSC_DEADLINE))
+             ((val & APIC_TIMER_MODE_MASK) == APIC_TIMER_MODE_TSC_DEADLINE) )
         {
             vlapic_set_reg(vlapic, APIC_TMICT, 0);
             vlapic->hw.tdt_msr = 0;
@@ -1163,7 +1162,7 @@ int guest_wrmsr_apic_base(struct vcpu *v, uint64_t val)
     return X86EMUL_OKAY;
 }
 
-uint64_t  vlapic_tdt_msr_get(struct vlapic *vlapic)
+uint64_t vlapic_tdt_msr_get(struct vlapic *vlapic)
 {
     if ( !vlapic_lvtt_tdt(vlapic) )
         return 0;
@@ -1184,7 +1183,7 @@ void vlapic_tdt_msr_set(struct vlapic *vlapic, uint64_t value)
         HVM_DBG_LOG(DBG_LEVEL_VLAPIC_TIMER, "ignore tsc deadline msr write");
         return;
     }
-    
+
     /* new_value = 0, >0 && <= now, > now */
     guest_tsc = hvm_get_guest_tsc(v);
     if ( value > guest_tsc )
@@ -1539,8 +1538,8 @@ static int cf_check lapic_load_hidden(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
     }
     s = vcpu_vlapic(v);
-    
-    if ( hvm_load_entry_zeroextend(LAPIC, h, &s->hw) != 0 ) 
+
+    if ( hvm_load_entry_zeroextend(LAPIC, h, &s->hw) != 0 )
         return -EINVAL;
 
     s->loaded.hw = 1;
@@ -1573,8 +1572,8 @@ static int cf_check lapic_load_regs(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
     }
     s = vcpu_vlapic(v);
-    
-    if ( hvm_load_entry(LAPIC_REGS, h, s->regs) != 0 ) 
+
+    if ( hvm_load_entry(LAPIC_REGS, h, s->regs) != 0 )
         return -EINVAL;
 
     s->loaded.id = vlapic_get_reg(s, APIC_ID);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:47:55 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:47:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640007.997791 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Fg3-0005l9-U5; Thu, 23 Nov 2023 19:47:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640007.997791; Thu, 23 Nov 2023 19:47:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Fg3-0005l2-RO; Thu, 23 Nov 2023 19:47:55 +0000
Received: by outflank-mailman (input) for mailman id 640007;
 Thu, 23 Nov 2023 19:47:54 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fg2-0005kr-MU
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:47:54 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fg2-0001dk-Li
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:47:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fg2-0007Ch-Kx
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:47:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6f+vZLBrOX8TVNiHYBPBFzFfu+BjVWv1FeoZJaJwxXY=; b=vHAFBNK0WMLOFFJtGJvsOVa2sw
	mtgE5oN1+wSOTZOWJ9DtHLItFluBUJGxh1H8LjAtEKvoQl20hWpblAT88iG47Xn0MIwONCuqyEc4i
	8wte6ICz+tKSF2Dadwlzdrf0OxpXCczsERGDtLkzAO3WbmkBJf5J+VJvi6JRxDjYyo7Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] stubdom: Remove caml-stubdom
Message-Id: <E1r6Fg2-0007Ch-Kx@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:47:54 +0000

commit e536a497545f213ad36e74bfe11c75b4bd0f8e1b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Nov 22 08:21:10 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 22 13:37:17 2023 +0000

    stubdom: Remove caml-stubdom
    
    In order to build caml-stubdom, it must be explicitly enabled via
    "configure --enable-caml-stubdom". The build process is failing due to
    stubdom/ocaml.patch failing to apply. Since the patched file has been
    modified in 2014 the last time, it seems nobody cares for caml-stubdom
    since at least then.
    
    Remove caml-stubdom from the build system.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Christian Lindig <christian.lindig@cloud.com>
    Acked-by: Henry Wang <Henry.Wang@arm.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 CHANGELOG.md             |  2 ++
 INSTALL                  |  1 -
 stubdom/Makefile         | 52 --------------------------------------------
 stubdom/caml/Makefile    | 24 ---------------------
 stubdom/caml/hello.ml    |  4 ----
 stubdom/caml/main-caml.c | 42 ------------------------------------
 stubdom/caml/minios.cfg  |  0
 stubdom/configure        | 56 ------------------------------------------------
 stubdom/configure.ac     |  2 --
 stubdom/ocaml.patch      | 19 ----------------
 10 files changed, 2 insertions(+), 200 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index c341c9d0bf..4ecebb9f68 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
      for IPIs and Physical addressing mode for external interrupts.
 
 ### Removed
+- caml-stubdom.  It hasn't built since 2014, was pinned to Ocaml 4.02, and has
+  been superseded by the MirageOS/SOLO5 projects.
 
 ## [4.18.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.18.0) - 2023-11-16
 
diff --git a/INSTALL b/INSTALL
index 3816c17dcd..88c1464816 100644
--- a/INSTALL
+++ b/INSTALL
@@ -163,7 +163,6 @@ Build various stubom components, some are only example code. Its usually
 enough to specify just --enable-stubdom and leave these options alone.
   --enable-ioemu-stubdom
   --enable-c-stubdom
-  --enable-caml-stubdom
   --disable-pv-grub
   --disable-xenstore-stubdom
   --enable-vtpm-stubdom
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 0ddfce1ba2..71c9b2200e 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -257,37 +257,6 @@ $(TPMEMU_STAMPFILE): tpm_emulator-$(XEN_TARGET_ARCH) $(GMP_STAMPFILE)
 .PHONY: cross-tpmemu
 cross-tpmemu: $(TPMEMU_STAMPFILE)
 
-#############
-# Cross-ocaml
-#############
-
-CAMLLIB = $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/ocaml
-OCAML_STAMPFILE=$(CAMLLIB)/.dirstamp
-
-ocaml-$(OCAML_VERSION).tar.gz:
-	$(FETCHER) $@ $(OCAML_URL)/$@
-
-ocaml-$(XEN_TARGET_ARCH)/.dirstamp: ocaml-$(OCAML_VERSION).tar.gz ocaml.patch
-	tar xzf $<
-	cd ocaml-$(OCAML_VERSION) && patch -p0 < ../ocaml.patch
-	rm -rf ocaml-$(XEN_TARGET_ARCH)
-	mv ocaml-$(OCAML_VERSION) ocaml-$(XEN_TARGET_ARCH)
-	touch $@
-
-MINIOS_HASNOT=IPV6 INET_ATON
-
-.PHONY: cross-ocaml
-cross-ocaml: $(OCAML_STAMPFILE)
-$(OCAML_STAMPFILE): ocaml-$(XEN_TARGET_ARCH)/.dirstamp
-	cd ocaml-$(XEN_TARGET_ARCH) &&  ./configure -prefix $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf \
-		-no-pthread -no-shared-libs -no-tk -no-curses \
-		-cc "$(CC) -U_FORTIFY_SOURCE -fno-stack-protector -mno-red-zone"
-	$(foreach i,$(MINIOS_HASNOT),sed -i 's,^\(#define HAS_$(i)\),//\1,' ocaml-$(XEN_TARGET_ARCH)/config/s.h ; )
-	$(MAKE) DESTDIR= -C ocaml-$(XEN_TARGET_ARCH) world
-	$(MAKE) DESTDIR= -C ocaml-$(XEN_TARGET_ARCH) opt
-	$(MAKE) -C ocaml-$(XEN_TARGET_ARCH) install
-	touch $@
-
 #######
 # Links
 #######
@@ -419,17 +388,6 @@ ioemu: cross-zlib cross-libpci libxenguest ioemu-minios-config.mk
 	    $(QEMU_ROOT)/xen-setup-stubdom )
 	$(MAKE) DESTDIR= -C ioemu -f $(QEMU_ROOT)/Makefile
 
-######
-# caml
-######
-
-caml-minios-config.mk: $(CURDIR)/caml/minios.cfg
-	MINIOS_CONFIG="$<" CONFIG_FILE="$(CURDIR)/$@" $(MAKE) DESTDIR= -C $(MINI_OS) config
-
-.PHONY: caml
-caml: $(CROSS_ROOT)
-	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat caml-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) OCAMLC_CROSS_PREFIX=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/bin/
-
 ###
 # C
 ###
@@ -516,10 +474,6 @@ ioemu-stubdom: APP_OBJS=$(CURDIR)/ioemu/i386-stubdom/qemu.a $(CURDIR)/ioemu/i386
 ioemu-stubdom: mini-os-$(XEN_TARGET_ARCH)-ioemu lwip-$(XEN_TARGET_ARCH) libxenguest ioemu
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/ioemu-minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS="$(APP_OBJS)"
 
-.PHONY: caml-stubdom
-caml-stubdom: mini-os-$(XEN_TARGET_ARCH)-caml lwip-$(XEN_TARGET_ARCH) libxenguest cross-ocaml caml
-	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/caml/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS="$(CURDIR)/caml/main-caml.o $(CURDIR)/caml/caml.o $(CAMLLIB)/libasmrun.a"
-
 .PHONY: c-stubdom
 c-stubdom: mini-os-$(XEN_TARGET_ARCH)-c lwip-$(XEN_TARGET_ARCH) libxenguest c
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/c/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS=$(CURDIR)/c/main.a
@@ -580,8 +534,6 @@ endif
 
 install-c: c-stubdom
 
-install-caml: caml-stubdom
-
 install-xenstore: xenstore-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/xenstore-stubdom.gz"
@@ -642,13 +594,11 @@ clean: $(foreach lib,$(STUB_LIBS),clean-libxen$(lib))
 clean:
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-ioemu
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-c
-	rm -fr mini-os-$(XEN_TARGET_ARCH)-caml
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstorepvh
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpm
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpmmgr
-	$(MAKE) DESTDIR= -C caml clean
 	$(MAKE) DESTDIR= -C c clean
 	$(MAKE) -C vtpm clean
 	$(MAKE) -C vtpmmgr clean
@@ -672,7 +622,6 @@ crossclean: clean
 	rm -fr polarssl-$(XEN_TARGET_ARCH)
 	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -f mk-headers-$(XEN_TARGET_ARCH)
-	rm -fr ocaml-$(XEN_TARGET_ARCH)
 	rm -fr include
 
 # clean patched sources
@@ -695,7 +644,6 @@ downloadclean: patchclean
 	rm -f pciutils-$(LIBPCI_VERSION).tar.bz2
 	rm -f grub-$(GRUB_VERSION).tar.gz
 	rm -f lwip-$(LWIP_VERSION).tar.gz
-	rm -f ocaml-$(OCAML_VERSION).tar.gz
 	rm -f polarssl-$(POLARSSL_VERSION)-gpl.tgz
 
 .PHONY: distclean
diff --git a/stubdom/caml/Makefile b/stubdom/caml/Makefile
deleted file mode 100644
index f550de1680..0000000000
--- a/stubdom/caml/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-XEN_ROOT = $(CURDIR)/../..
-
-ifeq (,$(findstring clean,$(MAKECMDGOALS)))
-include $(XEN_ROOT)/Config.mk
-endif
-
-CAMLLIB = $(shell $(OCAMLC_CROSS_PREFIX)ocamlc -where)
-DEF_CPPFLAGS += -I$(CAMLLIB)
-
-OCAMLOPT=$(OCAMLC_CROSS_PREFIX)ocamlopt
-
-OBJS := hello.cmx
-LIBS := 
-
-all: main-caml.o caml.o
-
-%.cmx: %.ml
-	$(OCAMLOPT) -c $< -o $@
-
-caml.o: $(OBJS)
-	$(OCAMLOPT) $(LIBS) $^ -output-obj -o $@
-
-clean:
-	rm -f *.a *.o *.cmx *.cmi
diff --git a/stubdom/caml/hello.ml b/stubdom/caml/hello.ml
deleted file mode 100644
index 3a7181134a..0000000000
--- a/stubdom/caml/hello.ml
+++ /dev/null
@@ -1,4 +0,0 @@
-let main arg =
-  Printf.printf "Hello, world!\n%!."
-
-let _ = Callback.register "main" main
diff --git a/stubdom/caml/main-caml.c b/stubdom/caml/main-caml.c
deleted file mode 100644
index dd55aca38f..0000000000
--- a/stubdom/caml/main-caml.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Caml bootstrap
- *
- * Samuel Thibault <Samuel.Thibault@eu.citrix.net>, January 2008
- */
-
-#include <stdio.h>
-#include <errno.h>
-
-#include <caml/mlvalues.h>
-#include <caml/callback.h>
-#include <unistd.h>
-
-/* Ugly binary compatibility with Linux */
-FILE *_stderr asm("stderr");
-int *__errno_location;
-/* Will probably break everything, probably need to fetch from glibc */
-void *__ctype_b_loc;
-
-int main(int argc, char *argv[], char *envp[])
-{
-    value *val;
-
-    /* Get current thread's value */
-    _stderr = stderr;
-    __errno_location = &errno;
-
-    printf("starting caml\n");
-
-    /* Wait before things might hang up */
-    sleep(1);
-
-    caml_startup(argv);
-    val = caml_named_value("main");
-    if (!val) {
-        printf("Couldn't find Caml main");
-        return 1;
-    }
-    caml_callback(*val, Val_int(0));
-    printf("callback returned\n");
-    return 0;
-}
diff --git a/stubdom/caml/minios.cfg b/stubdom/caml/minios.cfg
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/stubdom/configure b/stubdom/configure
index 9a2226c3b7..6d41be91b6 100755
--- a/stubdom/configure
+++ b/stubdom/configure
@@ -600,8 +600,6 @@ POLARSSL_VERSION
 POLARSSL_URL
 GMP_VERSION
 GMP_URL
-OCAML_VERSION
-OCAML_URL
 GRUB_VERSION
 GRUB_URL
 LWIP_VERSION
@@ -633,7 +631,6 @@ debug
 xenstorepvh
 xenstore
 grub
-caml
 c
 host_os
 host_vendor
@@ -687,7 +684,6 @@ ac_user_opts='
 enable_option_checking
 enable_ioemu_stubdom
 enable_c_stubdom
-enable_caml_stubdom
 enable_pv_grub
 enable_xenstore_stubdom
 enable_xenstorepvh_stubdom
@@ -711,7 +707,6 @@ LIBPCI_URL
 NEWLIB_URL
 LWIP_URL
 GRUB_URL
-OCAML_URL
 GMP_URL
 POLARSSL_URL
 TPMEMU_URL'
@@ -1341,7 +1336,6 @@ Optional Features:
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --enable-ioemu-stubdom  Build and install ioemu-stubdom
   --enable-c-stubdom      Build and install c-stubdom (default is DISABLED)
-  --enable-caml-stubdom   Build and install caml-stubdom (default is DISABLED)
   --enable-pv-grub        Build and install pv-grub (default is DISABLED)
   --disable-xenstore-stubdom
                           Build and install xenstore-stubdom (default is
@@ -1371,7 +1365,6 @@ Some influential environment variables:
   NEWLIB_URL  Download url for newlib
   LWIP_URL    Download url for lwip
   GRUB_URL    Download url for grub
-  OCAML_URL   Download url for ocaml
   GMP_URL     Download url for libgmp
   POLARSSL_URL
               Download url for polarssl
@@ -2061,44 +2054,6 @@ fi
 
 
 
-# Check whether --enable-caml-stubdom was given.
-if test "${enable_caml_stubdom+set}" = set; then :
-  enableval=$enable_caml_stubdom;
-
-if test "x$enableval" = "xyes"; then :
-
-
-caml=y
-STUBDOM_TARGETS="$STUBDOM_TARGETS caml"
-STUBDOM_BUILD="$STUBDOM_BUILD caml-stubdom"
-STUBDOM_INSTALL="$STUBDOM_INSTALL install-caml"
-STUBDOM_UNINSTALL="$STUBDOM_UNINSTALL install-caml"
-
-
-else
-
-if test "x$enableval" = "xno"; then :
-
-
-caml=n
-
-
-fi
-
-fi
-
-
-else
-
-
-caml=n
-
-
-fi
-
-
-
-
 # Check whether --enable-pv-grub was given.
 if test "${enable_pv_grub+set}" = set; then :
   enableval=$enable_pv_grub;
@@ -3600,17 +3555,6 @@ GRUB_VERSION="0.97"
 
 
 
-if test "x$OCAML_URL" = "x"; then :
-
-	OCAML_URL="https://caml.inria.fr/pub/distrib/ocaml-4.02"
-
-fi
-OCAML_VERSION="4.02.0"
-
-
-
-
-
 if test "x$GMP_URL" = "x"; then :
 
 	if test "x$extfiles" = "xy"; then :
diff --git a/stubdom/configure.ac b/stubdom/configure.ac
index 471e371e14..fc736c0387 100644
--- a/stubdom/configure.ac
+++ b/stubdom/configure.ac
@@ -20,7 +20,6 @@ m4_include([../m4/fetcher.m4])
 # Enable/disable stub domains
 AX_STUBDOM_CONDITIONAL([ioemu-stubdom], [ioemu])
 AX_STUBDOM_DEFAULT_DISABLE([c-stubdom], [c])
-AX_STUBDOM_DEFAULT_DISABLE([caml-stubdom], [caml])
 AX_STUBDOM_DEFAULT_DISABLE([pv-grub], [grub])
 AX_STUBDOM_DEFAULT_ENABLE([xenstore-stubdom], [xenstore])
 AX_STUBDOM_DEFAULT_ENABLE([xenstorepvh-stubdom], [xenstorepvh])
@@ -60,7 +59,6 @@ AX_STUBDOM_LIB([LIBPCI], [libpci], [2.2.9], [https://mirrors.edge.kernel.org/pub
 AX_STUBDOM_LIB([NEWLIB], [newlib], [1.16.0], [https://sourceware.org/ftp/newlib])
 AX_STUBDOM_LIB([LWIP], [lwip], [1.3.0], [https://download.savannah.gnu.org/releases/lwip])
 AX_STUBDOM_LIB([GRUB], [grub], [0.97], [https://alpha.gnu.org/gnu/grub])
-AX_STUBDOM_LIB_NOEXT([OCAML], [ocaml], [4.02.0], [https://caml.inria.fr/pub/distrib/ocaml-4.02])
 AX_STUBDOM_LIB([GMP], [libgmp], [4.3.2], [https://gmplib.org/download/gmp/archive])
 AX_STUBDOM_LIB([POLARSSL], [polarssl], [1.1.4])
 AX_STUBDOM_LIB([TPMEMU], [berlios tpm emulator], [0.7.4])
diff --git a/stubdom/ocaml.patch b/stubdom/ocaml.patch
deleted file mode 100644
index 50db4869dd..0000000000
--- a/stubdom/ocaml.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- byterun/Makefile.orig	2009-04-07 12:14:02.000000000 +0100
-+++ byterun/Makefile	2009-04-07 12:13:50.000000000 +0100
-@@ -22,14 +22,14 @@
- DOBJS=$(OBJS:.o=.d.o) instrtrace.d.o
- PICOBJS=$(OBJS:.o=.pic.o)
- 
--#ifeq ($(SUPPORTS_SHARED_LIBRARIES),true)
-+ifeq ($(SUPPORTS_SHARED_LIBRARIES),true)
- 
- all:: libcamlrun_shared.so
- 
- install::
- 	cp libcamlrun_shared.so $(LIBDIR)/libcamlrun_shared.so
- 
--#endif
-+endif
- 
- ocamlrun$(EXE): libcamlrun.a prims.o
- 	$(MKEXE) $(BYTECCLINKOPTS) -o ocamlrun$(EXE) \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:48:06 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:48:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640009.997794 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6FgD-0005nm-Vk; Thu, 23 Nov 2023 19:48:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640009.997794; Thu, 23 Nov 2023 19:48:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6FgD-0005ne-T0; Thu, 23 Nov 2023 19:48:05 +0000
Received: by outflank-mailman (input) for mailman id 640009;
 Thu, 23 Nov 2023 19:48:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FgC-0005nS-PA
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:48:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FgC-0001e6-OS
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:48:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FgC-0007ED-Nn
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:48:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vxjFHygWkZnCMrBpK0SgSZ4RdLbbYhvYq6A/ctyz4qI=; b=W7LhUsRf508p4xBgKkDKDUvoLl
	55vgIpGZ9zei5dhEKWWg1PP0YTK9DrIdPCnnHOA3Qnn0ArFFX6DZ3i0/asNmYmFEZbof+itxmT9x5
	fyYOFiWAwcSU844ZCjqoDYbf8jaX1KiSCWgEsuFrx9ub0eeTnkXAVqv3ysTLVGWEGVwg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] config: update Mini-OS commit
Message-Id: <E1r6FgC-0007ED-Nn@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:48:04 +0000

commit 4b99ce89ebcd70eb183ffb03fa6efa78fa3ce2e1
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Nov 22 09:14:45 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 22 13:37:17 2023 +0000

    config: update Mini-OS commit
    
    Update the used commit for Mini-OS in order to be able to use the
    9pfs frontend.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 Config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Config.mk b/Config.mk
index 29c29f8d7f..2c43702958 100644
--- a/Config.mk
+++ b/Config.mk
@@ -226,7 +226,7 @@ QEMU_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/qemu-xen.git
 QEMU_UPSTREAM_REVISION ?= master
 
 MINIOS_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/mini-os.git
-MINIOS_UPSTREAM_REVISION ?= 5bcb28aaeba1c2506a82fab0cdad0201cd9b54b3
+MINIOS_UPSTREAM_REVISION ?= b08019f0b2fbc30c75169a160acb9fd9af5d68f4
 
 SEABIOS_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/seabios.git
 SEABIOS_UPSTREAM_REVISION ?= rel-1.16.2
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:48:16 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:48:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640010.997798 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6FgO-0005qh-0q; Thu, 23 Nov 2023 19:48:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640010.997798; Thu, 23 Nov 2023 19:48:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6FgN-0005qa-UU; Thu, 23 Nov 2023 19:48:15 +0000
Received: by outflank-mailman (input) for mailman id 640010;
 Thu, 23 Nov 2023 19:48:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FgM-0005qR-SB
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:48:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FgM-0001eE-RN
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:48:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FgM-0007Ee-QX
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:48:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BK31zU62NHEtR/g5DSgMAlr2lq0wvQn0gO2sFRGsB/Y=; b=Jx6D+/yVFzTpPrQWbggRueST+W
	yYbWi9VA/T3KRt2oGGinnjOqXbIy2CL4lJTuUT/z/F1tZ9bZH8lRGK7AlxHlxYmaTlp76uwehqpeU
	QL8hzEhMA5SLa5BufsO4VVi3euVRAjifxKw9vt9GPYsh2QHGgcs9hdMPaR/qhfTlrATQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: remove CR characters from serial output
Message-Id: <E1r6FgM-0007Ee-QX@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:48:14 +0000

commit b576497e3b7d3f986d4624993c3b12051818115d
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Nov 21 17:03:52 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 22 13:37:17 2023 +0000

    automation: remove CR characters from serial output
    
    The gitlab CI webpage seems to have issues displaying the \CR\CR\LF "\r\r\n"
    sequence on the web interface used as line returns by the Linux kernel serial
    output.  This leads to the QEMU tests output looking like:
    
    (XEN) Guest Loglevel: Nothing (Rate-limited: Errors and warnings)
    (XEN) *** Serial input to DOM0 (type 'CTRL-a' three times to switch input)
    (XEN) Freed 664kB init memory
    mapping kernel into physical memory
    about to get started...
    qemu-system-x86_64: terminating on signal 15 from pid 52 (timeout)
    
    This not helpful, so strip the CR characters from the output that goes to
    stdout, leaving the output in the serial output file untouched.
    
    All usages of `tee` are adjusted to strip CR from the output.
    
    Fixes: 3030a73bf849 ('automation: add a QEMU based x86_64 Dom0/DomU test')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/qemu-alpine-x86_64.sh          | 5 ++++-
 automation/scripts/qemu-smoke-dom0-arm32.sh       | 3 ++-
 automation/scripts/qemu-smoke-dom0-arm64.sh       | 3 ++-
 automation/scripts/qemu-smoke-dom0less-arm32.sh   | 3 ++-
 automation/scripts/qemu-smoke-dom0less-arm64.sh   | 3 ++-
 automation/scripts/qemu-smoke-riscv64.sh          | 2 +-
 automation/scripts/qemu-xtf-dom0less-arm64.sh     | 3 ++-
 automation/scripts/qubes-x86-64.sh                | 2 +-
 automation/scripts/xilinx-smoke-dom0less-arm64.sh | 2 +-
 9 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index 8c8d0b0cd7..a1c41c030a 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -84,7 +84,10 @@ qemu-system-x86_64 \
     -monitor none -serial stdio \
     -nographic \
     -device virtio-net-pci,netdev=n0 \
-    -netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0 |& tee smoke.serial
+    -netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0 |& \
+        # Remove carriage returns from the stdout output, as gitlab
+        # interface chokes on them
+        tee smoke.serial | sed 's/\r//'
 
 set -e
 (grep -q "Domain-0" smoke.serial && grep -q "BusyBox" smoke.serial) || exit 1
diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
index e6f303064a..281cae38b4 100755
--- a/automation/scripts/qemu-smoke-dom0-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
@@ -91,7 +91,8 @@ timeout -k 1 720 \
    -no-reboot \
    -device virtio-net-pci,netdev=n0 \
    -netdev user,id=n0,tftp=./ \
-   -bios /usr/lib/u-boot/qemu_arm/u-boot.bin |& tee ${serial_log}
+   -bios /usr/lib/u-boot/qemu_arm/u-boot.bin |& \
+      tee ${serial_log} | sed 's/\r//'
 
 set -e
 (grep -q "Domain-0" ${serial_log} && grep -q "^/ #" ${serial_log}) || exit 1
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index 0bf5cfdc61..bb3d3a6a81 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -104,7 +104,8 @@ timeout -k 1 720 \
     -no-reboot \
     -device virtio-net-pci,netdev=n0 \
     -netdev user,id=n0,tftp=binaries \
-    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& tee smoke.serial
+    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& \
+        tee smoke.serial | sed 's/\r//'
 
 set -e
 (grep -q "Domain-0" smoke.serial && grep -q "BusyBox" smoke.serial) || exit 1
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
index fb8f044a51..737adaf1a9 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -137,7 +137,8 @@ timeout -k 1 240 \
     -no-reboot \
     -device virtio-net-pci,netdev=n0 \
     -netdev user,id=n0,tftp=./ \
-    -bios /usr/lib/u-boot/qemu_arm/u-boot.bin |& tee ${serial_log}
+    -bios /usr/lib/u-boot/qemu_arm/u-boot.bin |& \
+        tee ${serial_log} | sed 's/\r//'
 
 set -e
 (grep -q "${dom0_prompt}" ${serial_log} && grep -q "${passed}" ${serial_log}) || exit 1
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index 75f575424a..b5ce7efdd4 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -201,7 +201,8 @@ timeout -k 1 240 \
     -no-reboot \
     -device virtio-net-pci,netdev=n0 \
     -netdev user,id=n0,tftp=binaries \
-    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& tee smoke.serial
+    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& \
+        tee smoke.serial | sed 's/\r//'
 
 set -e
 (grep -q "^Welcome to Alpine Linux" smoke.serial && grep -q "${passed}" smoke.serial) || exit 1
diff --git a/automation/scripts/qemu-smoke-riscv64.sh b/automation/scripts/qemu-smoke-riscv64.sh
index 4008191302..f90df3c051 100755
--- a/automation/scripts/qemu-smoke-riscv64.sh
+++ b/automation/scripts/qemu-smoke-riscv64.sh
@@ -13,7 +13,7 @@ qemu-system-riscv64 \
     -nographic \
     -m 2g \
     -kernel binaries/xen \
-    |& tee smoke.serial
+    |& tee smoke.serial | sed 's/\r//'
 
 set -e
 (grep -q "All set up" smoke.serial) || exit 1
diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
index 3ec9cf74e1..0c4578eda6 100755
--- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
+++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
@@ -61,7 +61,8 @@ timeout -k 1 120 \
     -no-reboot \
     -device virtio-net-pci,netdev=n0 \
     -netdev user,id=n0,tftp=binaries \
-    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& tee smoke.serial
+    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& \
+        tee smoke.serial | sed 's/\r//'
 
 set -e
 (grep -q "${passed}" smoke.serial) || exit 1
diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index 51323b1ae0..adec0f1f25 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -200,7 +200,7 @@ cp -f binaries/dom0-rootfs.cpio.gz $TFTP/initrd-dom0
 # the console
 mkfifo /tmp/console-stdin
 cat /tmp/console-stdin |\
-ssh $CONTROLLER console | tee smoke.serial &
+ssh $CONTROLLER console | tee smoke.serial | sed 's/\r//' &
 
 # start the system pointing at gitlab-ci predefined config
 ssh $CONTROLLER gitlabci poweron
diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
index 075305241c..2bf786f6ee 100755
--- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
+++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
@@ -136,7 +136,7 @@ cd $START
 # connect to serial
 set +e
 stty -F /dev/ttyUSB0 115200
-timeout -k 1 120 nohup sh -c "cat /dev/ttyUSB0 | tee smoke.serial"
+timeout -k 1 120 nohup sh -c "cat /dev/ttyUSB0 | tee smoke.serial | sed 's/\r//'"
 
 # stop the board
 cd /scratch/gitlab-runner
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:48:26 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:48:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640011.997802 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6FgY-0005tV-2P; Thu, 23 Nov 2023 19:48:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640011.997802; Thu, 23 Nov 2023 19:48: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 1r6FgX-0005tN-W7; Thu, 23 Nov 2023 19:48:25 +0000
Received: by outflank-mailman (input) for mailman id 640011;
 Thu, 23 Nov 2023 19:48: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 1r6FgW-0005tH-Ux
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:48:24 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FgW-0001eQ-U8
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:48:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FgW-0007FF-TQ
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:48:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cgoIEH+ukSc066/YMyVTk9ttto06fu640N1KMVtRgN4=; b=rGozZ2i6kmXCqZISb8rJGsHHgf
	W1bv4Fruyk1vEO7i0ZURhSxlnJJCUhCTDWawsyNjixD0DV21Ga5I7mGddtbhN2fgq9lkbPVqnxXJQ
	OschLNCv4cxmqMXhlHgOT9lhGjlBvr30DgzdA4hsEJt0Tg9fHbJW2Qf/UC+km9iz6SeU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: remove com1= parameter on QEMU smoke tests
Message-Id: <E1r6FgW-0007FF-TQ@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:48:24 +0000

commit 24532be9074395165b3ce1634216cc5d1e24e24a
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Nov 21 17:03:53 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 22 13:37:17 2023 +0000

    automation: remove com1= parameter on QEMU smoke tests
    
    The serial is already setup by the firmware, be consistent with the rest of the
    QEMU tests and don't specify a com1 setup.
    
    Note it's also bogus, as the extra ',' will make the intended DPS argument to
    be parsed as the io-base.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/qemu-smoke-x86-64.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/automation/scripts/qemu-smoke-x86-64.sh b/automation/scripts/qemu-smoke-x86-64.sh
index 188ff8e3d6..3014d07314 100755
--- a/automation/scripts/qemu-smoke-x86-64.sh
+++ b/automation/scripts/qemu-smoke-x86-64.sh
@@ -19,8 +19,7 @@ set +e
 timeout -k 1 30 \
 qemu-system-x86_64 -nographic -kernel binaries/xen \
         -initrd xtf/tests/example/$k \
-        -append "loglvl=all com1=115200,,8n1 console=com1 noreboot \
-                 console_timestamps=boot $extra" \
+        -append "loglvl=all console=com1 noreboot console_timestamps=boot $extra" \
         -m 512 -monitor none -serial file:smoke.serial
 set -e
 grep -q 'Test result: SUCCESS' smoke.serial || exit 1
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:48:36 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:48:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640012.997806 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Fgi-0005wc-5C; Thu, 23 Nov 2023 19:48:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640012.997806; Thu, 23 Nov 2023 19:48: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 1r6Fgi-0005wU-2Y; Thu, 23 Nov 2023 19:48:36 +0000
Received: by outflank-mailman (input) for mailman id 640012;
 Thu, 23 Nov 2023 19:48: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 1r6Fgh-0005wF-1d
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:48: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 1r6Fgh-0001eX-0u
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:48:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fgh-0007HC-09
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:48: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=VQkPf9XJVFYsHL2B/eypD9Voxiq8Y2LX08JZTyBKT04=; b=odSQ4c3dsQt5QQvKm5xuejXRLT
	yg0QdpFIIiuCKc3p0QC811/esvjNoXkT5nUfoJiz5rN0+N1TCqPpcu7c+DNPzluIYfq/mY5v6pXFd
	DALsoG7vktDE3faocfHm/59k64WJRBFtmiBsHJbWBTe6Qt471aMA9+yci7LtK2gu9FxE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: add Xen timestamps to all tests
Message-Id: <E1r6Fgh-0007HC-09@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:48:35 +0000

commit 7440355a29cdee7d6d9c7fd326dbc91f24d262af
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Nov 21 17:03:54 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 22 13:37:17 2023 +0000

    automation: add Xen timestamps to all tests
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/qemu-alpine-x86_64.sh          | 2 +-
 automation/scripts/qemu-smoke-dom0-arm32.sh       | 2 +-
 automation/scripts/qemu-smoke-dom0-arm64.sh       | 2 +-
 automation/scripts/qemu-smoke-dom0less-arm32.sh   | 2 +-
 automation/scripts/qemu-smoke-dom0less-arm64.sh   | 2 +-
 automation/scripts/qemu-xtf-dom0less-arm64.sh     | 2 +-
 automation/scripts/qubes-x86-64.sh                | 2 +-
 automation/scripts/xilinx-smoke-dom0less-arm64.sh | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index a1c41c030a..8e398dcea3 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -68,7 +68,7 @@ cd ../..
 cat >> binaries/pxelinux.0 << EOF
 #!ipxe
 
-kernel xen console=com1
+kernel xen console=com1 console_timestamps=boot
 module bzImage console=hvc0
 module xen-rootfs.cpio.gz
 boot
diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
index 281cae38b4..a4b487b080 100755
--- a/automation/scripts/qemu-smoke-dom0-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
@@ -63,7 +63,7 @@ XEN="xen-qemuarm"
 DOM0_KERNEL="zImage"
 DOM0_RAMDISK="initrd.gz"
 DOM0_CMD="console=hvc0 earlyprintk clk_ignore_unused root=/dev/ram0 rdinit=/sbin/init"
-XEN_CMD="console=dtuart dom0_mem=1024M bootscrub=0"
+XEN_CMD="console=dtuart dom0_mem=1024M bootscrub=0 console_timestamps=boot"
 
 NUM_DOMUS=0
 
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index bb3d3a6a81..e0bb37af36 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -79,7 +79,7 @@ DEVICE_TREE="virt-gicv2.dtb"
 XEN="xen"
 DOM0_KERNEL="Image"
 DOM0_RAMDISK="xen-rootfs.cpio.gz"
-XEN_CMD="console=dtuart dom0_mem=1024M"
+XEN_CMD="console=dtuart dom0_mem=1024M console_timestamps=boot"
 
 NUM_DOMUS=0
 
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
index 737adaf1a9..7e3cfbe9c4 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -89,7 +89,7 @@ MEMORY_END="0xC0000000"
 
 DEVICE_TREE="virt.dtb"
 XEN="xen"
-XEN_CMD="console=dtuart dom0_mem=512M bootscrub=0"
+XEN_CMD="console=dtuart dom0_mem=512M bootscrub=0 console_timestamps=boot"
 
 DOM0_KERNEL="vmlinuz"
 DOM0_RAMDISK="initrd.gz"
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index b5ce7efdd4..e748b8ef16 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -137,7 +137,7 @@ DEVICE_TREE="virt-gicv2.dtb"
 XEN="xen"
 DOM0_KERNEL="Image"
 DOM0_RAMDISK="dom0-rootfs.cpio.gz"
-XEN_CMD="console=dtuart dom0_mem=512M"
+XEN_CMD="console=dtuart dom0_mem=512M console_timestamps=boot"
 
 NUM_DOMUS=1
 DOMU_KERNEL[0]="Image"
diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
index 0c4578eda6..a667e0412c 100755
--- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
+++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
@@ -33,7 +33,7 @@ MEMORY_END="0xC0000000"
 XEN="xen"
 DEVICE_TREE="virt-gicv2.dtb"
 
-XEN_CMD="console=dtuart"
+XEN_CMD="console=dtuart console_timestamps=boot"
 
 DOMU_KERNEL[0]="xtf-test"
 DOMU_MEM[0]="128"
diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index adec0f1f25..d81ed7b931 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -185,7 +185,7 @@ TFTP=/scratch/gitlab-runner/tftp
 CONTROLLER=control@thor.testnet
 
 echo "
-multiboot2 (http)/gitlab-ci/xen $CONSOLE_OPTS loglvl=all guest_loglvl=all dom0_mem=4G $extra_xen_opts
+multiboot2 (http)/gitlab-ci/xen $CONSOLE_OPTS loglvl=all guest_loglvl=all dom0_mem=4G console_timestamps=boot $extra_xen_opts
 module2 (http)/gitlab-ci/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen
 module2 (http)/gitlab-ci/initrd-dom0
 " > $TFTP/grub.cfg
diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
index 2bf786f6ee..4a071c6ef1 100755
--- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
+++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
@@ -94,7 +94,7 @@ DEVICE_TREE="mpsoc_smmu.dtb"
 XEN="xen"
 DOM0_KERNEL="Image"
 DOM0_RAMDISK="dom0-rootfs.cpio.gz"
-XEN_CMD="console=dtuart dtuart=serial0 dom0_mem=1024M"
+XEN_CMD="console=dtuart dtuart=serial0 dom0_mem=1024M console_timestamps=boot"
 
 NUM_DOMUS=1
 DOMU_KERNEL[0]="Image"
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:48:46 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:48:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640013.997810 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Fgs-0005zD-6j; Thu, 23 Nov 2023 19:48:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640013.997810; Thu, 23 Nov 2023 19:48:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Fgs-0005z5-3z; Thu, 23 Nov 2023 19:48:46 +0000
Received: by outflank-mailman (input) for mailman id 640013;
 Thu, 23 Nov 2023 19:48: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 1r6Fgr-0005yt-4X
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:48: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 1r6Fgr-0001eu-3h
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:48:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fgr-0007Hh-2y
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:48:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RyFLZkcN//MBc9f1XB8mfSPrJkdrQ+SR9LKBWBuOf2o=; b=SVZ9TQmYIEI+ayP1ib1gKzJb2o
	hRtXZBWGSlF/kHNDNM5Grek5WSY29cwmlvLEeuEH7vBJwrWGr+cotowgyE12fj0uaoFdgWFNgzn61
	syiASKxGfOF5ZuSKbTYLsvqDq4d0n0XbuCi9ai3jT9T1CukK40h7I1b9svIhD/sLMQ9Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: fix jessie/stretch images to use archive.debian.org apt repos
Message-Id: <E1r6Fgr-0007Hh-2y@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:48:45 +0000

commit b5739330d7f46c86a06f516c3d70162f3916e1fe
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Nov 21 17:03:55 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 22 13:37:17 2023 +0000

    automation: fix jessie/stretch images to use archive.debian.org apt repos
    
    Otherwise it's impossible to build the images.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/build/debian/jessie-i386.dockerfile  | 7 +++++++
 automation/build/debian/jessie.dockerfile       | 7 +++++++
 automation/build/debian/stretch-i386.dockerfile | 7 +++++++
 automation/build/debian/stretch.dockerfile      | 7 +++++++
 4 files changed, 28 insertions(+)

diff --git a/automation/build/debian/jessie-i386.dockerfile b/automation/build/debian/jessie-i386.dockerfile
index c9ac15a3ff..a8dec82bb2 100644
--- a/automation/build/debian/jessie-i386.dockerfile
+++ b/automation/build/debian/jessie-i386.dockerfile
@@ -10,6 +10,13 @@ WORKDIR /build
 
 ENTRYPOINT ["linux32"]
 
+# replace repos in archive as release is EOL
+RUN cat <<"END" > /etc/apt/sources.list
+deb http://archive.debian.org/debian/ jessie main contrib non-free
+deb http://archive.debian.org/debian/ jessie-backports main contrib non-free
+deb http://archive.debian.org/debian-security/ jessie/updates main contrib non-free
+END
+
 # build depends
 RUN apt-get update && \
     apt-get --quiet --yes install \
diff --git a/automation/build/debian/jessie.dockerfile b/automation/build/debian/jessie.dockerfile
index 63b2c1e5b7..5c71c3e3ea 100644
--- a/automation/build/debian/jessie.dockerfile
+++ b/automation/build/debian/jessie.dockerfile
@@ -8,6 +8,13 @@ ENV USER root
 RUN mkdir /build
 WORKDIR /build
 
+# replace repos in archive as release is EOL
+RUN cat <<"END" > /etc/apt/sources.list
+deb http://archive.debian.org/debian/ jessie main contrib non-free
+deb http://archive.debian.org/debian/ jessie-backports main contrib non-free
+deb http://archive.debian.org/debian-security/ jessie/updates main contrib non-free
+END
+
 # build depends
 RUN apt-get update && \
     apt-get --quiet --yes install \
diff --git a/automation/build/debian/stretch-i386.dockerfile b/automation/build/debian/stretch-i386.dockerfile
index d93f74c979..9739651e25 100644
--- a/automation/build/debian/stretch-i386.dockerfile
+++ b/automation/build/debian/stretch-i386.dockerfile
@@ -10,6 +10,13 @@ WORKDIR /build
 
 ENTRYPOINT ["linux32"]
 
+# replace repos in archive as release is EOL
+RUN cat <<"END" > /etc/apt/sources.list
+deb http://archive.debian.org/debian/ stretch main contrib non-free
+deb http://archive.debian.org/debian/ stretch-backports main contrib non-free
+deb http://archive.debian.org/debian-security/ stretch/updates main contrib non-free
+END
+
 # build depends
 RUN apt-get update && \
     apt-get --quiet --yes install \
diff --git a/automation/build/debian/stretch.dockerfile b/automation/build/debian/stretch.dockerfile
index 1af6c691f8..2f1a99f450 100644
--- a/automation/build/debian/stretch.dockerfile
+++ b/automation/build/debian/stretch.dockerfile
@@ -8,6 +8,13 @@ ENV USER root
 RUN mkdir /build
 WORKDIR /build
 
+# replace repos in archive as release is EOL
+RUN cat <<"END" > /etc/apt/sources.list
+deb http://archive.debian.org/debian/ stretch main contrib non-free
+deb http://archive.debian.org/debian/ stretch-backports main contrib non-free
+deb http://archive.debian.org/debian-security/ stretch/updates main contrib non-free
+END
+
 # build depends
 RUN apt-get update && \
     apt-get --quiet --yes install \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:48:56 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:48:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640014.997814 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Fh2-00061z-7q; Thu, 23 Nov 2023 19:48:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640014.997814; Thu, 23 Nov 2023 19:48: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 1r6Fh2-00061s-5Q; Thu, 23 Nov 2023 19:48:56 +0000
Received: by outflank-mailman (input) for mailman id 640014;
 Thu, 23 Nov 2023 19:48:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fh1-00061l-7F
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:48:55 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fh1-0001f3-6V
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:48:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Fh1-0007ID-5k
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:48:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vEnLTUErQYr8YcoCX2ofFZ2wU0zGPxQSQN/u2XFHGPg=; b=v5NRLNKvUbfJrE3t2yDsSNX8Wk
	v6XXbFqpvnR0H3wJVAeZnz6+jS/XSl4wTRHfCrgEKOrIYdCiEnr3OfxO0q3QhkoTj2DcQt46htFzb
	uML4e/8qfG61i8bV9KvxPvvwZA2xyrdgPZYxHkw5p1RKP5/ohJ1NhksuYlZqgxHihx9s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: update tests to use Debian Bookworm
Message-Id: <E1r6Fh1-0007ID-5k@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:48:55 +0000

commit b78b4de1c51b741d48817aae562d9e040b072b83
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Nov 21 17:03:56 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 22 13:37:17 2023 +0000

    automation: update tests to use Debian Bookworm
    
    Switch tests using Stretch to Bookworm, as Stretch is EOL.
    
    Note the packages are not removed from the Stretch dockerfile, because the
    tests in stable branches will run using the old containers.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/build/debian/bookworm.dockerfile | 5 +++++
 automation/gitlab-ci/test.yaml              | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/automation/build/debian/bookworm.dockerfile b/automation/build/debian/bookworm.dockerfile
index ae008c8d46..7aea081c13 100644
--- a/automation/build/debian/bookworm.dockerfile
+++ b/automation/build/debian/bookworm.dockerfile
@@ -46,6 +46,11 @@ RUN apt-get update && \
         gnupg \
         apt-transport-https \
         golang \
+        # for test phase, qemu-smoke-* jobs
+        qemu-system-x86 \
+        # for test phase, qemu-alpine-* jobs
+        cpio \
+        busybox-static \
         && \
         apt-get autoremove -y && \
         apt-get clean && \
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 61e642cce0..6aabdb9d15 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -43,7 +43,7 @@
 .qemu-x86-64:
   extends: .test-jobs-common
   variables:
-    CONTAINER: debian:stretch
+    CONTAINER: debian:bookworm
     LOGFILE: qemu-smoke-x86-64.log
   artifacts:
     paths:
@@ -130,7 +130,7 @@
 build-each-commit-gcc:
   extends: .test-jobs-common
   variables:
-    CONTAINER: debian:stretch
+    CONTAINER: debian:bookworm
     XEN_TARGET_ARCH: x86_64
     CC: gcc
   script:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:49:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:49:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640015.997818 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6FhC-00064y-9P; Thu, 23 Nov 2023 19:49:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640015.997818; Thu, 23 Nov 2023 19:49: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 1r6FhC-00064r-6u; Thu, 23 Nov 2023 19:49:06 +0000
Received: by outflank-mailman (input) for mailman id 640015;
 Thu, 23 Nov 2023 19:49:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FhB-00064g-CE
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:49:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FhB-0001fS-AT
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:49:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FhB-0007In-8s
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:49:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RJP2yjOVW5hSSEOXxwwIXGkW/uKFKHNvPNO1tOHXpAI=; b=ALhYjnpnICimXPuHNs0u7O0QJO
	eQ9dQfZU44BsXciyLeLYgaNdYluqmK4gc3DeYUXzDe6y4pchId+wYflQ5FxsBTqY1MOBnb3JA5nWU
	+Wh8aUkp+wgexLElRyaew5OjG01hrpbH6U9qPGzh/XqZVBBBB32nHonNT2MRHYOG7iuo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: set architecture in docker files
Message-Id: <E1r6FhB-0007In-8s@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:49:05 +0000

commit 3b2ba63994f25aada6059503c52555d6b0658902
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Nov 21 17:03:57 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 22 13:37:17 2023 +0000

    automation: set architecture in docker files
    
    Pass the desired architecture of the image in the FROM instruction if the
    image is possibly multi-platform.
    
    This allows using the x86 Dockerfiles on OS X on arm64 hardware.
    
    No functional change intended.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/build/alpine/3.18.dockerfile                             | 2 +-
 automation/build/archlinux/current-riscv64.dockerfile               | 2 +-
 automation/build/archlinux/current.dockerfile                       | 2 +-
 automation/build/centos/7.dockerfile                                | 2 +-
 automation/build/debian/bookworm.dockerfile                         | 2 +-
 automation/build/debian/bullseye-ppc64le.dockerfile                 | 2 +-
 automation/build/debian/buster-gcc-ibt.dockerfile                   | 4 ++--
 automation/build/debian/jessie.dockerfile                           | 2 +-
 automation/build/debian/stretch.dockerfile                          | 2 +-
 automation/build/fedora/29.dockerfile                               | 2 +-
 automation/build/suse/opensuse-leap.dockerfile                      | 2 +-
 automation/build/suse/opensuse-tumbleweed.dockerfile                | 2 +-
 automation/build/ubuntu/bionic.dockerfile                           | 2 +-
 automation/build/ubuntu/focal.dockerfile                            | 2 +-
 automation/build/ubuntu/trusty.dockerfile                           | 2 +-
 automation/build/ubuntu/xenial-xilinx.dockerfile                    | 2 +-
 automation/build/ubuntu/xenial.dockerfile                           | 2 +-
 automation/tests-artifacts/alpine/3.18.dockerfile                   | 2 +-
 automation/tests-artifacts/kernel/6.1.19.dockerfile                 | 2 +-
 automation/tests-artifacts/qemu-system-ppc64/8.1.0-ppc64.dockerfile | 2 +-
 20 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/automation/build/alpine/3.18.dockerfile b/automation/build/alpine/3.18.dockerfile
index 5d2a69a060..4ae9cb5e9e 100644
--- a/automation/build/alpine/3.18.dockerfile
+++ b/automation/build/alpine/3.18.dockerfile
@@ -1,4 +1,4 @@
-FROM alpine:3.18
+FROM --platform=linux/amd64 alpine:3.18
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/build/archlinux/current-riscv64.dockerfile b/automation/build/archlinux/current-riscv64.dockerfile
index abf8e7bf0b..af75b5c720 100644
--- a/automation/build/archlinux/current-riscv64.dockerfile
+++ b/automation/build/archlinux/current-riscv64.dockerfile
@@ -1,4 +1,4 @@
-FROM archlinux
+FROM --platform=linux/amd64 archlinux
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/build/archlinux/current.dockerfile b/automation/build/archlinux/current.dockerfile
index 47e79637a4..d974a1434f 100644
--- a/automation/build/archlinux/current.dockerfile
+++ b/automation/build/archlinux/current.dockerfile
@@ -1,4 +1,4 @@
-FROM archlinux:base-devel
+FROM --platform=linux/amd64 archlinux:base-devel
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/build/centos/7.dockerfile b/automation/build/centos/7.dockerfile
index 69dcefb2f0..ab450f0b3a 100644
--- a/automation/build/centos/7.dockerfile
+++ b/automation/build/centos/7.dockerfile
@@ -1,4 +1,4 @@
-FROM centos:7
+FROM --platform=linux/amd64 centos:7
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/build/debian/bookworm.dockerfile b/automation/build/debian/bookworm.dockerfile
index 7aea081c13..459f8e30bd 100644
--- a/automation/build/debian/bookworm.dockerfile
+++ b/automation/build/debian/bookworm.dockerfile
@@ -1,4 +1,4 @@
-FROM debian:bookworm
+FROM --platform=linux/amd64 debian:bookworm
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/build/debian/bullseye-ppc64le.dockerfile b/automation/build/debian/bullseye-ppc64le.dockerfile
index 4de8458445..6fdfb6bc2b 100644
--- a/automation/build/debian/bullseye-ppc64le.dockerfile
+++ b/automation/build/debian/bullseye-ppc64le.dockerfile
@@ -1,4 +1,4 @@
-FROM debian:bullseye-slim
+FROM --platform=linux/amd64 debian:bullseye-slim
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/build/debian/buster-gcc-ibt.dockerfile b/automation/build/debian/buster-gcc-ibt.dockerfile
index 96ab4fe8a2..6a3e50ef6b 100644
--- a/automation/build/debian/buster-gcc-ibt.dockerfile
+++ b/automation/build/debian/buster-gcc-ibt.dockerfile
@@ -1,4 +1,4 @@
-FROM debian:buster-slim AS builder
+FROM --platform=linux/amd64 debian:buster-slim AS builder
 
 ENV DEBIAN_FRONTEND=noninteractive
 ENV USER root
@@ -41,7 +41,7 @@ RUN ./configure \
 RUN make -j`nproc` && make -j`nproc` install
 
 
-FROM debian:buster-slim
+FROM --platform=linux/amd64 debian:buster-slim
 COPY --from=builder /opt/gcc-11-ibt /opt/gcc-11-ibt
 
 LABEL maintainer.name="The Xen Project" \
diff --git a/automation/build/debian/jessie.dockerfile b/automation/build/debian/jessie.dockerfile
index 5c71c3e3ea..32fc952fbc 100644
--- a/automation/build/debian/jessie.dockerfile
+++ b/automation/build/debian/jessie.dockerfile
@@ -1,4 +1,4 @@
-FROM debian/eol:jessie
+FROM --platform=linux/amd64 debian/eol:jessie
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/build/debian/stretch.dockerfile b/automation/build/debian/stretch.dockerfile
index 2f1a99f450..e2706a8f35 100644
--- a/automation/build/debian/stretch.dockerfile
+++ b/automation/build/debian/stretch.dockerfile
@@ -1,4 +1,4 @@
-FROM debian:stretch
+FROM --platform=linux/amd64 debian:stretch
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/build/fedora/29.dockerfile b/automation/build/fedora/29.dockerfile
index e55b06a451..42a87ce6c8 100644
--- a/automation/build/fedora/29.dockerfile
+++ b/automation/build/fedora/29.dockerfile
@@ -1,4 +1,4 @@
-FROM fedora:29
+FROM --platform=linux/amd64 fedora:29
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/build/suse/opensuse-leap.dockerfile b/automation/build/suse/opensuse-leap.dockerfile
index 7010b71aca..e1ec38a414 100644
--- a/automation/build/suse/opensuse-leap.dockerfile
+++ b/automation/build/suse/opensuse-leap.dockerfile
@@ -1,4 +1,4 @@
-FROM opensuse/leap
+FROM --platform=linux/amd64 opensuse/leap
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/build/suse/opensuse-tumbleweed.dockerfile b/automation/build/suse/opensuse-tumbleweed.dockerfile
index 959e1f6939..38f6fda2ff 100644
--- a/automation/build/suse/opensuse-tumbleweed.dockerfile
+++ b/automation/build/suse/opensuse-tumbleweed.dockerfile
@@ -1,4 +1,4 @@
-FROM opensuse/tumbleweed
+FROM --platform=linux/amd64 opensuse/tumbleweed
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/build/ubuntu/bionic.dockerfile b/automation/build/ubuntu/bionic.dockerfile
index e15f54431e..77d7f93386 100644
--- a/automation/build/ubuntu/bionic.dockerfile
+++ b/automation/build/ubuntu/bionic.dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:18.04
+FROM --platform=linux/amd64 ubuntu:18.04
 LABEL maintainer.name="The Xen Project " \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/build/ubuntu/focal.dockerfile b/automation/build/ubuntu/focal.dockerfile
index e3d11194ee..30a9b8e84f 100644
--- a/automation/build/ubuntu/focal.dockerfile
+++ b/automation/build/ubuntu/focal.dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:20.04
+FROM --platform=linux/amd64 ubuntu:20.04
 LABEL maintainer.name="The Xen Project " \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/build/ubuntu/trusty.dockerfile b/automation/build/ubuntu/trusty.dockerfile
index 22e294c20c..0d33578c4e 100644
--- a/automation/build/ubuntu/trusty.dockerfile
+++ b/automation/build/ubuntu/trusty.dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:14.04
+FROM --platform=linux/amd64 ubuntu:14.04
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/build/ubuntu/xenial-xilinx.dockerfile b/automation/build/ubuntu/xenial-xilinx.dockerfile
index 5f70871352..49f27b3229 100644
--- a/automation/build/ubuntu/xenial-xilinx.dockerfile
+++ b/automation/build/ubuntu/xenial-xilinx.dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:16.04
+FROM --platform=linux/amd64 ubuntu:16.04
 LABEL maintainer.name="The Xen Project " \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/build/ubuntu/xenial.dockerfile b/automation/build/ubuntu/xenial.dockerfile
index 2d2ba3e31f..e8035434f8 100644
--- a/automation/build/ubuntu/xenial.dockerfile
+++ b/automation/build/ubuntu/xenial.dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:16.04
+FROM --platform=linux/amd64 ubuntu:16.04
 LABEL maintainer.name="The Xen Project " \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/tests-artifacts/alpine/3.18.dockerfile b/automation/tests-artifacts/alpine/3.18.dockerfile
index 5f521572b8..f1b4a8b7a1 100644
--- a/automation/tests-artifacts/alpine/3.18.dockerfile
+++ b/automation/tests-artifacts/alpine/3.18.dockerfile
@@ -1,4 +1,4 @@
-FROM alpine:3.18
+FROM --platform=linux/amd64 alpine:3.18
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/tests-artifacts/kernel/6.1.19.dockerfile b/automation/tests-artifacts/kernel/6.1.19.dockerfile
index d5b787c1cb..3a4096780d 100644
--- a/automation/tests-artifacts/kernel/6.1.19.dockerfile
+++ b/automation/tests-artifacts/kernel/6.1.19.dockerfile
@@ -1,4 +1,4 @@
-FROM debian:bookworm
+FROM --platform=linux/amd64 debian:bookworm
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/tests-artifacts/qemu-system-ppc64/8.1.0-ppc64.dockerfile b/automation/tests-artifacts/qemu-system-ppc64/8.1.0-ppc64.dockerfile
index 7376ca46ff..65857147bf 100644
--- a/automation/tests-artifacts/qemu-system-ppc64/8.1.0-ppc64.dockerfile
+++ b/automation/tests-artifacts/qemu-system-ppc64/8.1.0-ppc64.dockerfile
@@ -1,4 +1,4 @@
-FROM debian:bullseye-slim
+FROM --platform=linux/amd64 debian:bullseye-slim
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 23 19:49:16 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Nov 2023 19:49:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640016.997822 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6FhM-000677-Au; Thu, 23 Nov 2023 19:49:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640016.997822; Thu, 23 Nov 2023 19:49: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 1r6FhM-000670-8T; Thu, 23 Nov 2023 19:49:16 +0000
Received: by outflank-mailman (input) for mailman id 640016;
 Thu, 23 Nov 2023 19:49: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 1r6FhL-00066s-EO
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:49: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 1r6FhL-0001fZ-Df
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:49:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6FhL-0007JR-Cq
 for xen-changelog@lists.xenproject.org; Thu, 23 Nov 2023 19:49:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CNufxCCzIkLfofujWyumbKwdD3U1AmcByzo7Ny82Dj8=; b=NEME/cOFA8EDOBPxu2c4A65o3x
	j6sjLfV4XIm8mOboGklUaEQwVGEm35tl03xSVLt09ua2BRgssUmH5zlUglHr8fO+ep+6KV7eCOf32
	jdniqyRNMQTQGmzjZj0R7gLgBxQNKbF6yHvB2C9mA9pQCNvTKx4aW7IzDt22IhSD1hgY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: switch to multi-platform images when possible
Message-Id: <E1r6FhL-0007JR-Cq@xenbits.xenproject.org>
Date: Thu, 23 Nov 2023 19:49:15 +0000

commit c22fe7213c9b1f99cbc64c33e391afa223f9cd08
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Nov 21 17:03:58 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 22 13:37:17 2023 +0000

    automation: switch to multi-platform images when possible
    
    Instead of using specific architecture image, switch to using multi-arch ones
    and specify the desired architecture using the --platform option.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/build/alpine/3.18-arm64v8.dockerfile                       | 2 +-
 automation/build/debian/bookworm-arm64v8-arm32-gcc.dockerfile         | 2 +-
 automation/build/debian/bookworm-arm64v8.dockerfile                   | 2 +-
 automation/build/debian/bookworm-cppcheck.dockerfile                  | 4 ++--
 automation/build/debian/bookworm-i386.dockerfile                      | 2 +-
 automation/build/debian/stretch-i386.dockerfile                       | 2 +-
 automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile             | 2 +-
 automation/tests-artifacts/kernel/5.19-arm64v8.dockerfile             | 2 +-
 .../tests-artifacts/qemu-system-aarch64/6.0.0-arm64v8.dockerfile      | 2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/automation/build/alpine/3.18-arm64v8.dockerfile b/automation/build/alpine/3.18-arm64v8.dockerfile
index 470f5d72a9..91e9022024 100644
--- a/automation/build/alpine/3.18-arm64v8.dockerfile
+++ b/automation/build/alpine/3.18-arm64v8.dockerfile
@@ -1,4 +1,4 @@
-FROM arm64v8/alpine:3.18
+FROM --platform=linux/arm64/v8 alpine:3.18
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/build/debian/bookworm-arm64v8-arm32-gcc.dockerfile b/automation/build/debian/bookworm-arm64v8-arm32-gcc.dockerfile
index b3295c435e..a05ffeac04 100644
--- a/automation/build/debian/bookworm-arm64v8-arm32-gcc.dockerfile
+++ b/automation/build/debian/bookworm-arm64v8-arm32-gcc.dockerfile
@@ -1,4 +1,4 @@
-FROM arm64v8/debian:bookworm
+FROM --platform=linux/arm64/v8 debian:bookworm
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/build/debian/bookworm-arm64v8.dockerfile b/automation/build/debian/bookworm-arm64v8.dockerfile
index 640b1e0ead..2c432aacb7 100644
--- a/automation/build/debian/bookworm-arm64v8.dockerfile
+++ b/automation/build/debian/bookworm-arm64v8.dockerfile
@@ -1,4 +1,4 @@
-FROM arm64v8/debian:bookworm
+FROM --platform=linux/arm64/v8 debian:bookworm
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/build/debian/bookworm-cppcheck.dockerfile b/automation/build/debian/bookworm-cppcheck.dockerfile
index d64fb7b18c..633268376d 100644
--- a/automation/build/debian/bookworm-cppcheck.dockerfile
+++ b/automation/build/debian/bookworm-cppcheck.dockerfile
@@ -1,4 +1,4 @@
-FROM arm64v8/debian:bookworm AS builder
+FROM --platform=linux/arm64/v8 debian:bookworm AS builder
 
 ENV DEBIAN_FRONTEND=noninteractive
 ENV CPPCHECK_VERSION=2.7
@@ -24,7 +24,7 @@ RUN curl -fsSLO https://github.com/danmar/cppcheck/archive/"$CPPCHECK_VERSION".t
         FILESDIR=/usr/share/cppcheck \
         HAVE_RULES=yes CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function"
 
-FROM arm64v8/debian:bookworm
+FROM --platform=linux/arm64/v8 debian:bookworm
 COPY --from=builder /usr/bin/cppcheck /usr/bin/cppcheck
 COPY --from=builder /usr/share/cppcheck /usr/share/cppcheck
 
diff --git a/automation/build/debian/bookworm-i386.dockerfile b/automation/build/debian/bookworm-i386.dockerfile
index 559bf670f0..89a6503385 100644
--- a/automation/build/debian/bookworm-i386.dockerfile
+++ b/automation/build/debian/bookworm-i386.dockerfile
@@ -1,4 +1,4 @@
-FROM i386/debian:bookworm
+FROM --platform=linux/i386 debian:bookworm
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/build/debian/stretch-i386.dockerfile b/automation/build/debian/stretch-i386.dockerfile
index 9739651e25..da93fed8ea 100644
--- a/automation/build/debian/stretch-i386.dockerfile
+++ b/automation/build/debian/stretch-i386.dockerfile
@@ -1,4 +1,4 @@
-FROM i386/debian:stretch
+FROM --platform=linux/i386 debian:stretch
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile b/automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile
index cbd96d9bc6..94f69621f4 100644
--- a/automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile
+++ b/automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile
@@ -1,4 +1,4 @@
-FROM arm64v8/alpine:3.18
+FROM --platform=linux/arm64/v8 alpine:3.18
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/tests-artifacts/kernel/5.19-arm64v8.dockerfile b/automation/tests-artifacts/kernel/5.19-arm64v8.dockerfile
index a53a97d727..b0875ca0dd 100644
--- a/automation/tests-artifacts/kernel/5.19-arm64v8.dockerfile
+++ b/automation/tests-artifacts/kernel/5.19-arm64v8.dockerfile
@@ -1,4 +1,4 @@
-FROM arm64v8/debian:bookworm
+FROM --platform=linux/arm64/v8 debian:bookworm
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
diff --git a/automation/tests-artifacts/qemu-system-aarch64/6.0.0-arm64v8.dockerfile b/automation/tests-artifacts/qemu-system-aarch64/6.0.0-arm64v8.dockerfile
index e277e13b60..fb7b7b506e 100644
--- a/automation/tests-artifacts/qemu-system-aarch64/6.0.0-arm64v8.dockerfile
+++ b/automation/tests-artifacts/qemu-system-aarch64/6.0.0-arm64v8.dockerfile
@@ -1,4 +1,4 @@
-FROM arm64v8/debian:bookworm
+FROM --platform=linux/arm64/v8 debian:bookworm
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 04:33:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 04:33:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640169.998041 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6NsF-0001dl-7R; Fri, 24 Nov 2023 04:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640169.998041; Fri, 24 Nov 2023 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 1r6NsF-0001dd-4g; Fri, 24 Nov 2023 04:33:03 +0000
Received: by outflank-mailman (input) for mailman id 640169;
 Fri, 24 Nov 2023 04: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 1r6NsE-0001dQ-7j
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 04: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 1r6NsE-0002Id-6r
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 04:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6NsE-0004Tt-5h
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 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=AC6Ad28mfwz+Uo4DYCyh+IFoW9OsV1bXrF38mEZOXPs=; b=JlYxReBA9j+w1/40dVBAlUCVt0
	ezhcPqvXPAFul/chgqx6V9NDHb8uyeP1ahX1gsmw9JTp/10CQv29vUtoGqPjsLY/D3Oss6U1OdTKJ
	poV6psXD9zOf3A8B353pf8lXsYa789F9+G0CXpcYgTwvdd7ghBZjAJWhwXeonC9tJTps=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] update Xen version to 4.18.1-pre
Message-Id: <E1r6NsE-0004Tt-5h@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 04:33:02 +0000

commit 02f8d0adfba154664376a5c5dc8af3c927c79226
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 23 12:09:43 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 23 12:09:43 2023 +0100

    update Xen version to 4.18.1-pre
---
 Config.mk    |   2 --
 MAINTAINERS  | 106 +++++------------------------------------------------------
 xen/Makefile |   2 +-
 3 files changed, 10 insertions(+), 100 deletions(-)

diff --git a/Config.mk b/Config.mk
index 5cf610c2fd..29b0d1e12a 100644
--- a/Config.mk
+++ b/Config.mk
@@ -236,8 +236,6 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 
 QEMU_TRADITIONAL_URL ?= https://xenbits.xen.org/git-http/qemu-xen-traditional.git
 QEMU_TRADITIONAL_REVISION ?= xen-4.18.0
-# Wed Jul 15 10:01:40 2020 +0100
-# qemu-trad: remove Xen path dependencies
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
diff --git a/MAINTAINERS b/MAINTAINERS
index f61b5a32a1..c58e4615ab 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -54,6 +54,15 @@ list. Remember to copy the appropriate stable branch maintainer who
 will be listed in this section of the MAINTAINERS file in the
 appropriate branch.
 
+The maintainer for this branch is:
+
+	Jan Beulich <jbeulich@suse.com>
+
+Tools backport requests should also be copied to:
+
+       Anthony Perard <anthony.perard@citrix.com>
+
+
 	Unstable Subsystem Maintainers
 	==============================
 
@@ -104,103 +113,6 @@ Descriptions of section entries:
 	   xen-maintainers-<version format number of this file>
 
 
-	Check-in policy
-	===============
-
-In order for a patch to be checked in, in general, several conditions
-must be met:
-
-1. In order to get a change to a given file committed, it must have
-   the approval of at least one maintainer of that file.
-
-   A patch of course needs Acks from the maintainers of each file that
-   it changes; so a patch which changes xen/arch/x86/traps.c,
-   xen/arch/x86/mm/p2m.c, and xen/arch/x86/mm/shadow/multi.c would
-   require an Ack from each of the three sets of maintainers.
-
-   See below for rules on nested maintainership.
-
-2. Each change must have appropriate approval from someone other than
-   the person who wrote it.  This can be either:
-
-  a. An Acked-by from a maintainer of the code being touched (a
-     co-maintainer if available, or a more general level maintainer if
-     not available; see the secton on nested maintainership)
-
-  b. A Reviewed-by by anyone of suitable stature in the community
-
-3. Sufficient time must have been given for anyone to respond.  This
-   depends in large part upon the urgency and nature of the patch.
-   For a straightforward uncontroversial patch, a day or two may be
-   sufficient; for a controversial patch, a week or two may be better.
-
-4. There must be no "open" objections.
-
-In a case where one person submits a patch and a maintainer gives an
-Ack, the Ack stands in for both the approval requirement (#1) and the
-Acked-by-non-submitter requirement (#2).
-
-In a case where a maintainer themselves submits a patch, the
-Signed-off-by meets the approval requirement (#1); so a Review
-from anyone in the community suffices for requirement #2.
-
-Before a maintainer checks in their own patch with another community
-member's R-b but no co-maintainer Ack, it is especially important to
-give their co-maintainer opportunity to give feedback, perhaps
-declaring their intention to check it in without their co-maintainers
-ack a day before doing so.
-
-In the case where two people collaborate on a patch, at least one of
-whom is a maintainer -- typically where one maintainer will do an
-early version of the patch, and another maintainer will pick it up and
-revise it -- there should be two Signed-off-by's and one Acked-by or
-Reviewed-by; with the maintainer who did the most recent change
-sending the patch, and an Acked-by or Reviewed-by coming from the
-maintainer who did not most recently edit the patch.  This satisfies
-the requirement #2 because a) the Signed-off-by of the sender approves
-the final version of the patch; including all parts of the patch that
-the sender did not write b) the Reviewed-by approves the final version
-of the patch, including all patches that the reviewer did not write.
-Thus all code in the patch has been approved by someone who did not
-write it.
-
-Maintainers may choose to override non-maintainer objections in the
-case that consensus can't be reached.
-
-As always, no policy can cover all possible situations.  In
-exceptional circumstances, committers may commit a patch in absence of
-one or more of the above requirements, if they are reasonably
-confident that the other maintainers will approve of their decision in
-retrospect.
-
-       The meaning of nesting
-       ======================
-
-Many maintainership areas are "nested": for example, there are entries
-for xen/arch/x86 as well as xen/arch/x86/mm, and even
-xen/arch/x86/mm/shadow; and there is a section at the end called "THE
-REST" which lists all committers.  The meaning of nesting is that:
-
-1. Under normal circumstances, the Ack of the most specific maintainer
-is both necessary and sufficient to get a change to a given file
-committed.  So a change to xen/arch/x86/mm/shadow/multi.c requires the
-the Ack of the xen/arch/x86/mm/shadow maintainer for that part of the
-patch, but would not require the Ack of the xen/arch/x86 maintainer or
-the xen/arch/x86/mm maintainer.
-
-2. In unusual circumstances, a more general maintainer's Ack can stand
-in for or even overrule a specific maintainer's Ack.  Unusual
-circumstances might include:
- - The patch is fixing a high-priority issue causing immediate pain,
- and the more specific maintainer is not available.
- - The more specific maintainer has not responded either to the
- original patch, nor to "pings", within a reasonable amount of time.
- - The more general maintainer wants to overrule the more specific
- maintainer on some issue. (This should be exceptional.)
- - In the case of a disagreement between maintainers, THE REST can
- settle the matter by majority vote.  (This should be very exceptional
- indeed.)
-
 
 Maintainers List (try to look for most precise areas first)
 
diff --git a/xen/Makefile b/xen/Makefile
index b8de14dce1..e39290f638 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -6,7 +6,7 @@ this-makefile := $(call lastword,$(MAKEFILE_LIST))
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 18
-export XEN_EXTRAVERSION ?= .0$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .1-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 04:33:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 04:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640170.998045 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6NsP-0001fp-8u; Fri, 24 Nov 2023 04:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640170.998045; Fri, 24 Nov 2023 04: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 1r6NsP-0001fg-68; Fri, 24 Nov 2023 04:33:13 +0000
Received: by outflank-mailman (input) for mailman id 640170;
 Fri, 24 Nov 2023 04: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 1r6NsO-0001fY-CQ
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 04: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 1r6NsO-0002Il-Ap
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 04:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6NsO-0004UK-92
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 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=EeH9q0e7GflpqHGMzLNN+ze+cjDOZ9DrNAHCSTAgsYo=; b=2C9bKpZ4+zqmyN6VhDl3unUXYi
	iAGVe9Qt5IohcwBgEW0fDpw+V9jZy+JxlplSG3OuQUaJ3n9HReh3ZPZ25/vyhSKPS2NfuJT3RMR7o
	nBAiOGZ8Jsb1U3r5tIP45Y2CSfRkxUj4JfBep5CwiwR7ksHtzTpbQ8CpWc0w3fcd6s0g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/mem_sharing: add missing m2p entry when mapping shared_info page
Message-Id: <E1r6NsO-0004UK-92@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 04:33:12 +0000

commit 52be29df793f282822436c8c13e0948a01aee1ad
Author:     Tamas K Lengyel <tamas@tklengyel.com>
AuthorDate: Thu Nov 23 12:10:46 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 23 12:10:46 2023 +0100

    x86/mem_sharing: add missing m2p entry when mapping shared_info page
    
    When mapping in the shared_info page to a fork the m2p entry wasn't set
    resulting in the shared_info being reset even when the fork reset was called
    with only reset_state and not reset_memory. This results in an extra
    unnecessary TLB flush.
    
    Fixes: 1a0000ac775 ("mem_sharing: map shared_info page to same gfn during fork")
    Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 23eb39acf011ef9bbe02ed4619c55f208fbcd39b
    master date: 2023-10-31 16:10:14 +0000
---
 xen/arch/x86/mm/mem_sharing.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 94b6b782ef..142258f16a 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1847,6 +1847,8 @@ static int copy_special_pages(struct domain *cd, struct domain *d)
                                 p2m_ram_rw, p2m->default_access, -1);
             if ( rc )
                 return rc;
+
+            set_gpfn_from_mfn(mfn_x(new_mfn), gfn_x(old_gfn));
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 04:33:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 04:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640172.998049 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6NsZ-0001iT-AO; Fri, 24 Nov 2023 04:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640172.998049; Fri, 24 Nov 2023 04: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 1r6NsZ-0001iL-7Z; Fri, 24 Nov 2023 04:33:23 +0000
Received: by outflank-mailman (input) for mailman id 640172;
 Fri, 24 Nov 2023 04: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 1r6NsY-0001iF-EX
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 04: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 1r6NsY-0002J0-Dk
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 04:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6NsY-0004Uj-Cj
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 04: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=aYmfjb8FS5J9/rFdTFPUy0NSj3NOYbvzWyOJt65i/f4=; b=0mmLaPUhk6rGcZDcgM+urglrdF
	xTo/jYfi9aDQ1YC4kFeEcEJCNRj3VHhNueoiigoDgoY7ogg0c8UiSQjSqp6c/Og6U1kS7mNCuadpS
	yRAGQa4fUAOOa7guYCz6z+xzhgpwsZOJyaI1Zd8bbFzvHL6rzh5maRc+JFg9f1esVJfA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/pv-shim: fix grant table operations for 32-bit guests
Message-Id: <E1r6NsY-0004Uj-Cj@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 04:33:22 +0000

commit 880e06fdea401493a3f408deb0f411f7aeccee27
Author:     David Woodhouse <dwmw@amazon.co.uk>
AuthorDate: Thu Nov 23 12:11:21 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 23 12:11:21 2023 +0100

    x86/pv-shim: fix grant table operations for 32-bit guests
    
    When switching to call the shim functions from the normal handlers, the
    compat_grant_table_op() function was omitted, leaving it calling the
    real grant table operations in !PV_SHIM_EXCLUSIVE builds. This leaves a
    32-bit shim guest failing to set up its real grant table with the parent
    hypervisor.
    
    Fixes: e7db635f4428 ("x86/pv-shim: Don't modify the hypercall table")
    Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 93ec30bc545f15760039c23ee4b97b80c0b3b3b3
    master date: 2023-10-31 16:10:14 +0000
---
 xen/common/compat/grant_table.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/common/compat/grant_table.c b/xen/common/compat/grant_table.c
index e00bc24a34..af98eade17 100644
--- a/xen/common/compat/grant_table.c
+++ b/xen/common/compat/grant_table.c
@@ -63,6 +63,11 @@ int compat_grant_table_op(
     unsigned int i, cmd_op;
     XEN_GUEST_HANDLE_PARAM(void) cnt_uop;
 
+#ifdef CONFIG_PV_SHIM
+    if ( unlikely(pv_shim) )
+        return pv_shim_grant_table_op(cmd, uop, count);
+#endif
+
     set_xen_guest_handle(cnt_uop, NULL);
     cmd_op = cmd & GNTTABOP_CMD_MASK;
     if ( cmd_op != GNTTABOP_cache_flush )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 04:33:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 04:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640173.998052 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Nsj-0001lV-Bp; Fri, 24 Nov 2023 04:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640173.998052; Fri, 24 Nov 2023 04: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 1r6Nsj-0001lO-90; Fri, 24 Nov 2023 04:33:33 +0000
Received: by outflank-mailman (input) for mailman id 640173;
 Fri, 24 Nov 2023 04: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 1r6Nsi-0001lG-IS
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 04: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 1r6Nsi-0002J7-Gv
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 04:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Nsi-0004Wo-Fm
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 04: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=qRswoAHr7MSHYnbsZ8vrw11mOSSvCgBmAJKvyoogknY=; b=52HvYbP6pMzwJE36xw1CHgL9Jl
	XxPHlC3GGtiFK+9XSErtyzDLJYYLQt7SRj3mri4kiAJR5ymuETAcoUmEI9QQLwLufsQwTTLLJeMFS
	F69XhU2lnNXjiHne850bg3TXZrRIE1jGFM9udNdqxCo+NxvvYyqNPnNUWyEbtQsBYZME=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/x2apic: remove usage of ACPI_FADT_APIC_CLUSTER
Message-Id: <E1r6Nsi-0004Wo-Fm@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 04:33:32 +0000

commit 9e8edd4c75564530a6fb98f5abba267edb906313
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Thu Nov 23 12:12:18 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 23 12:12:18 2023 +0100

    x86/x2apic: remove usage of ACPI_FADT_APIC_CLUSTER
    
    The ACPI FADT APIC_CLUSTER flag mandates that when the interrupt delivery is
    Logical mode APIC must be configured for Cluster destination model.  However in
    apic_x2apic_probe() such flag is incorrectly used to gate whether Physical mode
    can be used.
    
    Since Xen when in x2APIC mode only uses Logical mode together with Cluster
    model completely remove checking for ACPI_FADT_APIC_CLUSTER, as Xen always
    fulfills the requirement signaled by the flag.
    
    Fixes: eb40ae41b658 ('x86/Kconfig: add option for default x2APIC destination mode')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 26a449ce32cef33f2cb50602be19fcc0c4223ba9
    master date: 2023-11-02 10:50:26 +0100
---
 xen/arch/x86/genapic/x2apic.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c
index ca1db27157..707deef98c 100644
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -231,8 +231,7 @@ const struct genapic *__init apic_x2apic_probe(void)
          */
         x2apic_phys = iommu_intremap != iommu_intremap_full ||
                       (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL) ||
-                      (IS_ENABLED(CONFIG_X2APIC_PHYSICAL) &&
-                       !(acpi_gbl_FADT.flags & ACPI_FADT_APIC_CLUSTER));
+                      IS_ENABLED(CONFIG_X2APIC_PHYSICAL);
     }
     else if ( !x2apic_phys )
         switch ( iommu_intremap )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 04:33:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 04:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640174.998058 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Nst-0001oL-Dh; Fri, 24 Nov 2023 04:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640174.998058; Fri, 24 Nov 2023 04: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 1r6Nst-0001oD-AS; Fri, 24 Nov 2023 04:33:43 +0000
Received: by outflank-mailman (input) for mailman id 640174;
 Fri, 24 Nov 2023 04: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 1r6Nss-0001o3-LO
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 04: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 1r6Nss-0002JZ-KB
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 04:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Nss-0004XH-J3
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 04: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=o2adG3ucD2K93DHrGRa/I+1lnnq9jUQv34aCHKSHobQ=; b=piYMSK0oBB0U8EZkVs/3I6eLvl
	CrT0H5hKkY2lXhB2en2CWz2e+ZlIf/nc9OblRrkpeTwCnc6BtIaYl9nrXqly7RUu1ormLeOnzcFaw
	iCLhJUNqNAhU74Ra6iDSuVwSHNXyBRb1FetcJmFEHSi3OpmHKWiTCtOz/UWCB7SLXoiI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/i8259: do not assume interrupts always target CPU0
Message-Id: <E1r6Nss-0004XH-J3@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 04:33:42 +0000

commit fcb1016bbd476e17c72b1837ae2a3eaac517fa52
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Thu Nov 23 12:12:47 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 23 12:12:47 2023 +0100

    x86/i8259: do not assume interrupts always target CPU0
    
    Sporadically we have seen the following during AP bringup on AMD platforms
    only:
    
    microcode: CPU59 updated from revision 0x830107a to 0x830107a, date = 2023-05-17
    microcode: CPU60 updated from revision 0x830104d to 0x830107a, date = 2023-05-17
    CPU60: No irq handler for vector 27 (IRQ -2147483648)
    microcode: CPU61 updated from revision 0x830107a to 0x830107a, date = 2023-05-17
    
    This is similar to the issue raised on Linux commit 36e9e1eab777e, where they
    observed i8259 (active) vectors getting delivered to CPUs different than 0.
    
    On AMD or Hygon platforms adjust the target CPU mask of i8259 interrupt
    descriptors to contain all possible CPUs, so that APs will reserve the vector
    at startup if any legacy IRQ is still delivered through the i8259.  Note that
    if the IO-APIC takes over those interrupt descriptors the CPU mask will be
    reset.
    
    Spurious i8259 interrupt vectors however (IRQ7 and IRQ15) can be injected even
    when all i8259 pins are masked, and hence would need to be handled on all CPUs.
    
    Continue to reserve PIC vectors on CPU0 only, but do check for such spurious
    interrupts on all CPUs if the vendor is AMD or Hygon.  Note that once the
    vectors get used by devices detecting PIC spurious interrupts will no longer be
    possible, however the device driver should be able to cope with spurious
    interrupts.  Such PIC spurious interrupts occurring when the vector is in use
    by a local APIC routed source will lead to an extra EOI, which might
    unintentionally clear a different vector from ISR.  Note this is already the
    current behavior, so assume it's infrequent enough to not cause real issues.
    
    Finally, adjust the printed message to display the CPU where the spurious
    interrupt has been received, so it looks like:
    
    microcode: CPU1 updated from revision 0x830107a to 0x830107a, date = 2023-05-17
    cpu1: spurious 8259A interrupt: IRQ7
    microcode: CPU2 updated from revision 0x830104d to 0x830107a, date = 2023-05-17
    
    Amends: 3fba06ba9f8b ('x86/IRQ: re-use legacy vector ranges on APs')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 87f37449d586b4d407b75235bb0a171e018e25ec
    master date: 2023-11-02 10:50:59 +0100
---
 xen/arch/x86/i8259.c | 21 +++++++++++++++++++--
 xen/arch/x86/irq.c   | 11 ++++++++++-
 2 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/i8259.c b/xen/arch/x86/i8259.c
index ed9f55abe5..e0fa1f96b4 100644
--- a/xen/arch/x86/i8259.c
+++ b/xen/arch/x86/i8259.c
@@ -222,7 +222,8 @@ static bool _mask_and_ack_8259A_irq(unsigned int irq)
         is_real_irq = false;
         /* Report spurious IRQ, once per IRQ line. */
         if (!(spurious_irq_mask & irqmask)) {
-            printk("spurious 8259A interrupt: IRQ%d.\n", irq);
+            printk("cpu%u: spurious 8259A interrupt: IRQ%u\n",
+                   smp_processor_id(), irq);
             spurious_irq_mask |= irqmask;
         }
         /*
@@ -349,7 +350,23 @@ void __init init_IRQ(void)
             continue;
         desc->handler = &i8259A_irq_type;
         per_cpu(vector_irq, cpu)[LEGACY_VECTOR(irq)] = irq;
-        cpumask_copy(desc->arch.cpu_mask, cpumask_of(cpu));
+
+        /*
+         * The interrupt affinity logic never targets interrupts to offline
+         * CPUs, hence it's safe to use cpumask_all here.
+         *
+         * Legacy PIC interrupts are only targeted to CPU0, but depending on
+         * the platform they can be distributed to any online CPU in hardware.
+         * Note this behavior has only been observed on AMD hardware. In order
+         * to cope install all active legacy vectors on all CPUs.
+         *
+         * IO-APIC will change the destination mask if/when taking ownership of
+         * the interrupt.
+         */
+        cpumask_copy(desc->arch.cpu_mask,
+                     (boot_cpu_data.x86_vendor &
+                      (X86_VENDOR_AMD | X86_VENDOR_HYGON) ? &cpumask_all
+                                                          : cpumask_of(cpu)));
         desc->arch.vector = LEGACY_VECTOR(irq);
     }
     
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index f42ad539dc..16d9fceba1 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1920,7 +1920,16 @@ void do_IRQ(struct cpu_user_regs *regs)
                 kind = "";
             if ( !(vector >= FIRST_LEGACY_VECTOR &&
                    vector <= LAST_LEGACY_VECTOR &&
-                   !smp_processor_id() &&
+                   (!smp_processor_id() ||
+                    /*
+                     * For AMD/Hygon do spurious PIC interrupt
+                     * detection on all CPUs, as it has been observed
+                     * that during unknown circumstances spurious PIC
+                     * interrupts have been delivered to CPUs
+                     * different than the BSP.
+                     */
+                    (boot_cpu_data.x86_vendor & (X86_VENDOR_AMD |
+                                                 X86_VENDOR_HYGON))) &&
                    bogus_8259A_irq(vector - FIRST_LEGACY_VECTOR)) )
             {
                 printk("CPU%u: No irq handler for vector %02x (IRQ %d%s)\n",
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 04:33:53 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 04:33:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640175.998061 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Nt3-0001qy-EP; Fri, 24 Nov 2023 04:33:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640175.998061; Fri, 24 Nov 2023 04:33: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 1r6Nt3-0001qr-Bu; Fri, 24 Nov 2023 04:33:53 +0000
Received: by outflank-mailman (input) for mailman id 640175;
 Fri, 24 Nov 2023 04:33: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 1r6Nt2-0001ql-O0
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 04:33: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 1r6Nt2-0002Jl-N9
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 04:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Nt2-0004Xl-MD
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 04: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=IuxOAfikH8R8hrVS5xDwzb6f6Ix7KhgpCxC8Y1kSTj8=; b=yJzSmasqwmZTR4RYwzMMhquB3c
	SxQSk37tXsSnRoTP0td3acVP6rfMgEA9Z2zlRN0hYax9mAUDiSPpAbQzYpye7p+K0pbiyygpRpqYu
	s/VSPJVpEmD4znX6Z/zH0gctsfJKyISryYeS8emH+vp/YOfEmYvIH3EuAOF3XUebt30E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/spec-ctrl: Add SRSO whitepaper URL
Message-Id: <E1r6Nt2-0004Xl-MD@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 04:33:52 +0000

commit 40bfa9dd57f1efdd0f0dc974e80a438d9db90874
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Nov 23 12:13:31 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 23 12:13:31 2023 +0100

    x86/spec-ctrl: Add SRSO whitepaper URL
    
    ... now that it exists in public.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 78a86b26868c12ae1cc3dd2a8bb9aa5eebaa41fd
    master date: 2023-11-07 17:47:34 +0000
---
 xen/arch/x86/spec_ctrl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
index 6fd7d44ce4..a8d8af22f6 100644
--- a/xen/arch/x86/spec_ctrl.c
+++ b/xen/arch/x86/spec_ctrl.c
@@ -903,6 +903,9 @@ static bool __init should_use_eager_fpu(void)
     }
 }
 
+/*
+ * https://www.amd.com/content/dam/amd/en/documents/corporate/cr/speculative-return-stack-overflow-whitepaper.pdf
+ */
 static void __init srso_calculations(bool hw_smt_enabled)
 {
     if ( !(boot_cpu_data.x86_vendor &
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 04:34:03 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 04:34:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640176.998065 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6NtD-0001tz-HT; Fri, 24 Nov 2023 04:34:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640176.998065; Fri, 24 Nov 2023 04:34: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 1r6NtD-0001ts-Ez; Fri, 24 Nov 2023 04:34:03 +0000
Received: by outflank-mailman (input) for mailman id 640176;
 Fri, 24 Nov 2023 04:34: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 1r6NtC-0001tk-R7
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 04:34: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 1r6NtC-0002K7-QI
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 04:34:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6NtC-0004Yi-PB
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 04:34:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kQo04NR9PJdrwF8y0e6iIS02VEbipr/CUeNX2sjJdV4=; b=alKCpLqr0j/7gkqkwUebfG419+
	UrRmpxiD6LjFk8Dd/xkps7Q1QexnKVdTCV0NUPcVLyGH5HamRq399UUTNaFzIEQLnMii5U00syqzy
	mqJT0ZoUrkC2geNh5kTi+koH/HKESnHNAvAbr4gHgNbGtZ5+rCCYLv1UeiNcXkqCh9RQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] xen/sched: fix sched_move_domain()
Message-Id: <E1r6NtC-0004Yi-PB@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 04:34:02 +0000

commit 3f9390fea5c51a6d64596d295902d28931eeca4c
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 23 12:13:53 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 23 12:13:53 2023 +0100

    xen/sched: fix sched_move_domain()
    
    When moving a domain out of a cpupool running with the credit2
    scheduler and having multiple run-queues, the following ASSERT() can
    be observed:
    
    (XEN) Xen call trace:
    (XEN)    [<ffff82d04023a700>] R credit2.c#csched2_unit_remove+0xe3/0xe7
    (XEN)    [<ffff82d040246adb>] S sched_move_domain+0x2f3/0x5b1
    (XEN)    [<ffff82d040234cf7>] S cpupool.c#cpupool_move_domain_locked+0x1d/0x3b
    (XEN)    [<ffff82d040236025>] S cpupool_move_domain+0x24/0x35
    (XEN)    [<ffff82d040206513>] S domain_kill+0xa5/0x116
    (XEN)    [<ffff82d040232b12>] S do_domctl+0xe5f/0x1951
    (XEN)    [<ffff82d0402276ba>] S timer.c#timer_lock+0x69/0x143
    (XEN)    [<ffff82d0402dc71b>] S pv_hypercall+0x44e/0x4a9
    (XEN)    [<ffff82d0402012b7>] S lstar_enter+0x137/0x140
    (XEN)
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 1:
    (XEN) Assertion 'svc->rqd == c2rqd(sched_unit_master(unit))' failed at common/sched/credit2.c:1159
    (XEN) ****************************************
    
    This is happening as sched_move_domain() is setting a different cpu
    for a scheduling unit without telling the scheduler. When this unit is
    removed from the scheduler, the ASSERT() will trigger.
    
    In non-debug builds the result is usually a clobbered pointer, leading
    to another crash a short time later.
    
    Fix that by swapping the two involved actions (setting another cpu and
    removing the unit from the scheduler).
    
    Link: https://github.com/Dasharo/dasharo-issues/issues/488
    Fixes: 70fadc41635b ("xen/cpupool: support moving domain between cpupools with different granularity")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@cloud.com>
    master commit: 4709ec82917668c2df958ef91b4f21c049c76bee
    master date: 2023-11-20 10:49:29 +0100
---
 xen/common/sched/core.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 12deefa745..eba0cea4bb 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -732,18 +732,20 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
     old_domdata = d->sched_priv;
 
     /*
-     * Temporarily move all units to same processor to make locking
-     * easier when moving the new units to the new processors.
+     * Remove all units from the old scheduler, and temporarily move them to
+     * the same processor to make locking easier when moving the new units to
+     * new processors.
      */
     new_p = cpumask_first(d->cpupool->cpu_valid);
     for_each_sched_unit ( d, unit )
     {
-        spinlock_t *lock = unit_schedule_lock_irq(unit);
+        spinlock_t *lock;
+
+        sched_remove_unit(old_ops, unit);
 
+        lock = unit_schedule_lock_irq(unit);
         sched_set_res(unit, get_sched_res(new_p));
         spin_unlock_irq(lock);
-
-        sched_remove_unit(old_ops, unit);
     }
 
     old_units = d->sched_unit_list;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 05:22:07 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 05:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640177.998069 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Ode-0002kj-Lx; Fri, 24 Nov 2023 05:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640177.998069; Fri, 24 Nov 2023 05: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 1r6Ode-0002kc-JF; Fri, 24 Nov 2023 05:22:02 +0000
Received: by outflank-mailman (input) for mailman id 640177;
 Fri, 24 Nov 2023 05: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 1r6Odd-0002kW-C8
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 05: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 1r6Odd-0003fF-9T
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 05:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6Odd-0006ry-8P
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 05: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=vfhvWaeRwC1zXSKoHmDuai3vy55ySxYg1DgESPJany0=; b=rW6wJdH+uT6csDgKOxCvERwwcs
	L+8N3GlGE/KA8aoaQuC0thrv/OlkjMkBZuRGliIs6hEBSttkYOoK7X+t94O1ZHxNGxz0sE25/DJLN
	IInfUdIrbhc2RuI4gYHL0O28gjOUCkOxrHQtcEpt5ldv1iR3ZPSs9q2Enya5sOXOjnUE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] xen/sched: fix sched_move_domain()
Message-Id: <E1r6Odd-0006ry-8P@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 05:22:01 +0000

commit e1f9cb16e2efbb202f2f8a9aa7c5ff1d392ece33
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 23 12:24:12 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 23 12:24:12 2023 +0100

    xen/sched: fix sched_move_domain()
    
    When moving a domain out of a cpupool running with the credit2
    scheduler and having multiple run-queues, the following ASSERT() can
    be observed:
    
    (XEN) Xen call trace:
    (XEN)    [<ffff82d04023a700>] R credit2.c#csched2_unit_remove+0xe3/0xe7
    (XEN)    [<ffff82d040246adb>] S sched_move_domain+0x2f3/0x5b1
    (XEN)    [<ffff82d040234cf7>] S cpupool.c#cpupool_move_domain_locked+0x1d/0x3b
    (XEN)    [<ffff82d040236025>] S cpupool_move_domain+0x24/0x35
    (XEN)    [<ffff82d040206513>] S domain_kill+0xa5/0x116
    (XEN)    [<ffff82d040232b12>] S do_domctl+0xe5f/0x1951
    (XEN)    [<ffff82d0402276ba>] S timer.c#timer_lock+0x69/0x143
    (XEN)    [<ffff82d0402dc71b>] S pv_hypercall+0x44e/0x4a9
    (XEN)    [<ffff82d0402012b7>] S lstar_enter+0x137/0x140
    (XEN)
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 1:
    (XEN) Assertion 'svc->rqd == c2rqd(sched_unit_master(unit))' failed at common/sched/credit2.c:1159
    (XEN) ****************************************
    
    This is happening as sched_move_domain() is setting a different cpu
    for a scheduling unit without telling the scheduler. When this unit is
    removed from the scheduler, the ASSERT() will trigger.
    
    In non-debug builds the result is usually a clobbered pointer, leading
    to another crash a short time later.
    
    Fix that by swapping the two involved actions (setting another cpu and
    removing the unit from the scheduler).
    
    Link: https://github.com/Dasharo/dasharo-issues/issues/488
    Fixes: 70fadc41635b ("xen/cpupool: support moving domain between cpupools with different granularity")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@cloud.com>
    master commit: 4709ec82917668c2df958ef91b4f21c049c76bee
    master date: 2023-11-20 10:49:29 +0100
---
 xen/common/sched/core.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 43132ff6e0..4bba16d315 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -732,18 +732,20 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
     old_domdata = d->sched_priv;
 
     /*
-     * Temporarily move all units to same processor to make locking
-     * easier when moving the new units to the new processors.
+     * Remove all units from the old scheduler, and temporarily move them to
+     * the same processor to make locking easier when moving the new units to
+     * new processors.
      */
     new_p = cpumask_first(d->cpupool->cpu_valid);
     for_each_sched_unit ( d, unit )
     {
-        spinlock_t *lock = unit_schedule_lock_irq(unit);
+        spinlock_t *lock;
+
+        sched_remove_unit(old_ops, unit);
 
+        lock = unit_schedule_lock_irq(unit);
         sched_set_res(unit, get_sched_res(new_p));
         spin_unlock_irq(lock);
-
-        sched_remove_unit(old_ops, unit);
     }
 
     old_units = d->sched_unit_list;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 12:44:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 12:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640646.999133 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6VXP-0008CR-N8; Fri, 24 Nov 2023 12:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640646.999133; Fri, 24 Nov 2023 12: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 1r6VXP-0008CJ-KF; Fri, 24 Nov 2023 12:44:03 +0000
Received: by outflank-mailman (input) for mailman id 640646;
 Fri, 24 Nov 2023 12:44:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VXN-00084m-Qa
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VXN-0004Fm-Pl
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VXN-0003ry-N4
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12: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=IEV140F51uZv/eWMZ/k5pngR9b+maRvqBbU4jAZjqm8=; b=3g7fpV1NUsh5LHrqzblbN0+nBt
	08wYeXBeOWbCcOk7SR6jZlqkBNUv0mkserzYLFsI49lRek2FMY92PSiUHoZaoKtGFKnyCD81ebja6
	j/ha41NrxwWiTgjVM1tb6b2HwXEetLmyamBqDS1Xu4pqAMf85MggTxSFFmZZE6K6VJS8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86emul: deal with decode failure in predicates test
Message-Id: <E1r6VXN-0003ry-N4@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 12:44:01 +0000

commit 9dfc82459004c7962afbf9152303068ab0e0bfad
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 23 10:03:38 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 23 10:03:38 2023 +0100

    x86emul: deal with decode failure in predicates test
    
    Don't let this end in SEGV, due to the subsequent NULL deref.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/tests/x86_emulator/predicates.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tools/tests/x86_emulator/predicates.c b/tools/tests/x86_emulator/predicates.c
index 744cc847bc..4e90f5b625 100644
--- a/tools/tests/x86_emulator/predicates.c
+++ b/tools/tests/x86_emulator/predicates.c
@@ -2189,6 +2189,13 @@ void do_test(uint8_t *instr, unsigned int len, unsigned int modrm,
     {
         s = x86_decode_insn(ctxt, fetch);
 
+        if ( !s )
+        {
+            print_insn(instr, len);
+            printf(" failed to decode\n");
+            return;
+        }
+
         if ( x86_insn_length(s, ctxt) != len )
         {
             print_insn(instr, len);
@@ -2218,6 +2225,13 @@ void do_test(uint8_t *instr, unsigned int len, unsigned int modrm,
 
         s = x86_decode_insn(ctxt, fetch);
 
+        if ( !s )
+        {
+            print_insn(instr, len);
+            printf(" failed to decode\n");
+            return;
+        }
+
         if ( x86_insn_length(s, ctxt) != len )
         {
             print_insn(instr, len);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 12:44:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 12:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640647.999137 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6VXZ-0008Vv-Op; Fri, 24 Nov 2023 12:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640647.999137; Fri, 24 Nov 2023 12: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 1r6VXZ-0008Vo-Lp; Fri, 24 Nov 2023 12:44:13 +0000
Received: by outflank-mailman (input) for mailman id 640647;
 Fri, 24 Nov 2023 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 1r6VXX-0008PF-VR
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:44:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VXX-0004Fu-Sq
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VXX-0003sT-Ro
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:44:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OSCQ/ZJ2k2UwaCXVRsJZvJyUxphqG3yWqk935nckngE=; b=SsVHhDMTUMizkdubRc7k6MY/Cy
	nUVV32T7ysQx7GsmJ5WryZ2M1RhULNEF2vUy14gDihg51z/xCqYFnnnQVs3JNfTiAJd8aSoVzBwEy
	vkPNU5BlnBL9UVzRRFcO8+PB2k/GCue9WCybDu5dwKxBYP3cY4TrX6I7ACRQiIsXPCw0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpuid: enumerate and expose PREFETCHIT{0,1}
Message-Id: <E1r6VXX-0003sT-Ro@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 12:44:11 +0000

commit 843265ad0be5f1a15db858501dc4a5ea0d696f0f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 23 10:04:07 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 23 10:04:07 2023 +0100

    x86/cpuid: enumerate and expose PREFETCHIT{0,1}
    
    There's nothing else that should need doing in order for guests to be
    able to use these insns, as the encodings are in what's otherwise NOP
    space.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/misc/xen-cpuid.c                      | 2 ++
 xen/include/public/arch-x86/cpufeatureset.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/tools/misc/xen-cpuid.c b/tools/misc/xen-cpuid.c
index 7370f1b56e..2024b39dd3 100644
--- a/tools/misc/xen-cpuid.c
+++ b/tools/misc/xen-cpuid.c
@@ -220,6 +220,8 @@ static const char *const str_7d1[32] =
 {
     [ 4] = "avx-vnni-int8",       [ 5] = "avx-ne-convert",
 
+    [14] = "prefetchi",
+
     [18] = "cet-sss",
 };
 
diff --git a/xen/include/public/arch-x86/cpufeatureset.h b/xen/include/public/arch-x86/cpufeatureset.h
index 6b6ce2745c..a8945161f5 100644
--- a/xen/include/public/arch-x86/cpufeatureset.h
+++ b/xen/include/public/arch-x86/cpufeatureset.h
@@ -310,6 +310,7 @@ XEN_CPUFEATURE(MCDT_NO,            13*32+ 5) /*A  MCDT_NO */
 /* Intel-defined CPU features, CPUID level 0x00000007:1.edx, word 15 */
 XEN_CPUFEATURE(AVX_VNNI_INT8,      15*32+ 4) /*A  AVX-VNNI-INT8 Instructions */
 XEN_CPUFEATURE(AVX_NE_CONVERT,     15*32+ 5) /*A  AVX-NE-CONVERT Instructions */
+XEN_CPUFEATURE(PREFETCHI,          15*32+14) /*A  PREFETCHIT{0,1} Instructions */
 XEN_CPUFEATURE(CET_SSS,            15*32+18) /*   CET Supervisor Shadow Stacks safe to use */
 
 /* Intel-defined CPU features, MSR_ARCH_CAPS 0x10a.eax, word 16 */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 12:44:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 12:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640648.999141 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6VXj-0001JY-QG; Fri, 24 Nov 2023 12:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640648.999141; Fri, 24 Nov 2023 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 1r6VXj-0001JQ-NQ; Fri, 24 Nov 2023 12:44:23 +0000
Received: by outflank-mailman (input) for mailman id 640648;
 Fri, 24 Nov 2023 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 1r6VXi-0001Dg-0x
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 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 1r6VXi-0004GA-02
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VXh-0003tB-V1
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:44:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dzGIet6DJAxenPtSZXLCypEuaIBWZaxzWcMj/NU+CWo=; b=WlXgDvxxmjBl7ClL+7XVne+WrU
	pNsBUwirKoKpz0/nOLcsW90O3rNUPAYTAX7RYEjRp+aSc3ofP4DTnLlLVA3mHmbTDnZdbtV0aH6jN
	J9XaJ+TyaMnHGn8CsoyZrVWgXjFag1crzc1jLYuSlWG+aDPKO0LzikIiWhORX/f8gf/k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ACPI: constify acpi_enter_sleep argument
Message-Id: <E1r6VXh-0003tB-V1@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 12:44:21 +0000

commit 3ea5918ead1944ac45c53792d5a580d0c47d9329
Author:     Frediano Ziglio <frediano.ziglio@cloud.com>
AuthorDate: Thu Nov 23 10:05:01 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 23 10:05:01 2023 +0100

    x86/ACPI: constify acpi_enter_sleep argument
    
    Minor style change, structure is not changed.
    No functional change.
    
    Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/acpi/power.c       | 2 +-
 xen/arch/x86/include/asm/acpi.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index 81233738b1..861d12aab0 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -342,7 +342,7 @@ static long cf_check enter_state_helper(void *data)
  * Dom0 issues this hypercall in place of writing pm1a_cnt. Xen then
  * takes over the control and put the system into sleep state really.
  */
-int acpi_enter_sleep(struct xenpf_enter_acpi_sleep *sleep)
+int acpi_enter_sleep(const struct xenpf_enter_acpi_sleep *sleep)
 {
     if ( sleep->sleep_state == ACPI_STATE_S3 &&
          (!acpi_sinfo.wakeup_vector || !acpi_sinfo.vector_width ||
diff --git a/xen/arch/x86/include/asm/acpi.h b/xen/arch/x86/include/asm/acpi.h
index 6d94f822d4..0df92d3714 100644
--- a/xen/arch/x86/include/asm/acpi.h
+++ b/xen/arch/x86/include/asm/acpi.h
@@ -106,7 +106,7 @@ extern s8 acpi_numa;
 extern struct acpi_sleep_info acpi_sinfo;
 #define acpi_video_flags bootsym(video_flags)
 struct xenpf_enter_acpi_sleep;
-extern int acpi_enter_sleep(struct xenpf_enter_acpi_sleep *sleep);
+extern int acpi_enter_sleep(const struct xenpf_enter_acpi_sleep *sleep);
 extern int acpi_enter_state(u32 state);
 
 struct acpi_sleep_info {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 12:44:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 12:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640649.999146 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6VXt-0001pQ-Rx; Fri, 24 Nov 2023 12:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640649.999146; Fri, 24 Nov 2023 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 1r6VXt-0001pI-Oo; Fri, 24 Nov 2023 12:44:33 +0000
Received: by outflank-mailman (input) for mailman id 640649;
 Fri, 24 Nov 2023 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 1r6VXs-0001nE-3v
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 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 1r6VXs-0004GR-38
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VXs-0003tp-28
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 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=90J54XEmEB6Sz/+zcBXuQWQj13dP9oY1VWe9/7HdLCc=; b=XopYDSRUdx2PiWwgHeYpmJ4PUz
	rUkMrfx5E66VgIyDtufDnzY2hd4En+H3TaQBxRv8W5gS2m+3RsGJEN0MbNbAa7MfPIIeAqilxKaj6
	YjOWb5ETl5K3+ocPqPJIJFyst/8ZTOJTknZrnYeizt5jdJ8mdoiMfZOEi6P89beCY6Q0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: add asmlinkage macro to variables only used in asm code
Message-Id: <E1r6VXs-0003tp-28@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 12:44:32 +0000

commit 5c72b54b65071ca34a45f157a0db96dcfa250e0f
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Thu Nov 23 10:06:17 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 23 10:06:17 2023 +0100

    x86: add asmlinkage macro to variables only used in asm code
    
    To avoid a violation of MISRA C:2012 Rule 8.4, as permitted
    by docs/misra/rules.rst.
    
    The current_stack_pointer is a declaration: mark it as such
    for ECLAIR.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/setup.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index c41dfdb2bd..c8947d3f96 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -75,7 +75,8 @@ static bool __initdata opt_invpcid = true;
 boolean_param("invpcid", opt_invpcid);
 bool __read_mostly use_invpcid;
 
-unsigned long __read_mostly cr4_pv32_mask;
+/* Only used in asm code and within this source file */
+unsigned long asmlinkage __read_mostly cr4_pv32_mask;
 
 /* **** Linux config option: propagated to domain0. */
 /* "acpi=off":    Sisables both ACPI table parsing and interpreter. */
@@ -146,14 +147,15 @@ cpumask_t __read_mostly cpu_present_map;
 
 unsigned long __read_mostly xen_phys_start;
 
-char __section(".init.bss.stack_aligned") __aligned(STACK_SIZE)
+/* Only used in asm code and within this source file */
+char asmlinkage __section(".init.bss.stack_aligned") __aligned(STACK_SIZE)
     cpu0_stack[STACK_SIZE];
 
 /* Used by the BSP/AP paths to find the higher half stack mapping to use. */
 void *stack_start = cpu0_stack + STACK_SIZE - sizeof(struct cpu_info);
 
 /* Used by the boot asm to stash the relocated multiboot info pointer. */
-unsigned int __initdata multiboot_ptr;
+unsigned int asmlinkage __initdata multiboot_ptr;
 
 struct cpuinfo_x86 __read_mostly boot_cpu_data = { 0, 0, 0, 0, -1 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 12:44:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 12:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640650.999148 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6VY3-0002FY-Sj; Fri, 24 Nov 2023 12:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640650.999148; Fri, 24 Nov 2023 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 1r6VY3-0002FQ-QA; Fri, 24 Nov 2023 12:44:43 +0000
Received: by outflank-mailman (input) for mailman id 640650;
 Fri, 24 Nov 2023 12:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VY2-0002BP-73
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 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 1r6VY2-0004Gm-6J
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VY2-0003uT-5K
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 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=+MDok+6fKQOuN3WHQb9OXuMJWFf7OPA6g7upp5RLnOw=; b=w6ZadpCO1Xp3H3Q7UsXB1L8rAF
	8LwqjT1Ea76Na5ODSbguNlVz6RsLMazFIwM7CIiP+e/Nvb3agMPEdLCZTjNfwtCsCE+NdYDKZ+XKJ
	spRYommM0VpKDOemwPeyDNusNOzEYpql5UTxhEv2psLz8dYrZZKABZZeF+m0mWDMBbHs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/common: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r6VY2-0003uT-5K@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 12:44:42 +0000

commit 89c1784f5f94817b713958fdbe241c1005d9c75e
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Thu Nov 23 10:07:50 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 23 10:07:50 2023 +0100

    xen/common: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/runtime.c       | 2 +-
 xen/common/rangeset.c          | 6 +++---
 xen/common/spinlock.c          | 8 ++++----
 xen/common/stop_machine.c      | 4 ++--
 xen/common/tasklet.c           | 5 +++--
 xen/common/timer.c             | 4 ++--
 xen/include/xen/rangeset.h     | 4 ++--
 xen/include/xen/spinlock.h     | 2 +-
 xen/include/xen/stop_machine.h | 2 +-
 xen/include/xen/tasklet.h      | 7 ++++---
 xen/include/xen/timer.h        | 4 ++--
 11 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
index 5cb7504c96..d952c3ba78 100644
--- a/xen/common/efi/runtime.c
+++ b/xen/common/efi/runtime.c
@@ -26,7 +26,7 @@ struct efi_rs_state {
 };
 
 struct efi_rs_state efi_rs_enter(void);
-void efi_rs_leave(struct efi_rs_state *);
+void efi_rs_leave(struct efi_rs_state *state);
 
 #ifndef COMPAT
 
diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c
index 27ba6099b5..16a4c3b842 100644
--- a/xen/common/rangeset.c
+++ b/xen/common/rangeset.c
@@ -288,7 +288,7 @@ bool rangeset_overlaps_range(
 
 int rangeset_report_ranges(
     struct rangeset *r, unsigned long s, unsigned long e,
-    int (*cb)(unsigned long s, unsigned long e, void *), void *ctxt)
+    int (*cb)(unsigned long s, unsigned long e, void *data), void *ctxt)
 {
     struct range *x;
     int rc = 0;
@@ -357,8 +357,8 @@ int rangeset_claim_range(struct rangeset *r, unsigned long size,
 }
 
 int rangeset_consume_ranges(struct rangeset *r,
-                            int (*cb)(unsigned long s, unsigned long e, void *,
-                                      unsigned long *c),
+                            int (*cb)(unsigned long s, unsigned long e,
+                                      void *ctxt, unsigned long *c),
                             void *ctxt)
 {
     int rc = 0;
diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
index d7194e518c..d5fa400b78 100644
--- a/xen/common/spinlock.c
+++ b/xen/common/spinlock.c
@@ -305,7 +305,7 @@ static always_inline uint16_t observe_head(const spinlock_tickets_t *t)
 }
 
 static void always_inline spin_lock_common(spinlock_t *lock,
-                                           void (*cb)(void *), void *data)
+                                           void (*cb)(void *data), void *data)
 {
     spinlock_tickets_t tickets = SPINLOCK_TICKET_INC;
     LOCK_PROFILE_VAR;
@@ -331,7 +331,7 @@ void _spin_lock(spinlock_t *lock)
     spin_lock_common(lock, NULL, NULL);
 }
 
-void _spin_lock_cb(spinlock_t *lock, void (*cb)(void *), void *data)
+void _spin_lock_cb(spinlock_t *lock, void (*cb)(void *data), void *data)
 {
     spin_lock_common(lock, cb, data);
 }
@@ -498,8 +498,8 @@ struct lock_profile_anc {
     const char                *name;     /* descriptive string for print */
 };
 
-typedef void lock_profile_subfunc(
-    struct lock_profile *, int32_t, int32_t, void *);
+typedef void lock_profile_subfunc(struct lock_profile *data, int32_t type,
+    int32_t idx, void *par);
 
 extern struct lock_profile *__lock_profile_start;
 extern struct lock_profile *__lock_profile_end;
diff --git a/xen/common/stop_machine.c b/xen/common/stop_machine.c
index 3adbe380de..398cfd507c 100644
--- a/xen/common/stop_machine.c
+++ b/xen/common/stop_machine.c
@@ -46,7 +46,7 @@ struct stopmachine_data {
 
     unsigned int fn_cpu;
     int fn_result;
-    int (*fn)(void *);
+    int (*fn)(void *data);
     void *fn_data;
 };
 
@@ -73,7 +73,7 @@ static void stopmachine_wait_state(void)
  * mandatory to be called only on an idle vcpu, as otherwise active core
  * scheduling might hang.
  */
-int stop_machine_run(int (*fn)(void *), void *data, unsigned int cpu)
+int stop_machine_run(int (*fn)(void *data), void *data, unsigned int cpu)
 {
     unsigned int i, nr_cpus;
     unsigned int this = smp_processor_id();
diff --git a/xen/common/tasklet.c b/xen/common/tasklet.c
index c8abad3c75..4c8d87a338 100644
--- a/xen/common/tasklet.c
+++ b/xen/common/tasklet.c
@@ -199,7 +199,7 @@ static void migrate_tasklets_from_cpu(unsigned int cpu, struct list_head *list)
     spin_unlock_irqrestore(&tasklet_lock, flags);
 }
 
-void tasklet_init(struct tasklet *t, void (*func)(void *), void *data)
+void tasklet_init(struct tasklet *t, void (*func)(void *data), void *data)
 {
     memset(t, 0, sizeof(*t));
     INIT_LIST_HEAD(&t->list);
@@ -208,7 +208,8 @@ void tasklet_init(struct tasklet *t, void (*func)(void *), void *data)
     t->data = data;
 }
 
-void softirq_tasklet_init(struct tasklet *t, void (*func)(void *), void *data)
+void softirq_tasklet_init(struct tasklet *t,
+                          void (*func)(void *data), void *data)
 {
     tasklet_init(t, func, data);
     t->is_softirq = 1;
diff --git a/xen/common/timer.c b/xen/common/timer.c
index 47e060e4e9..785177e7fa 100644
--- a/xen/common/timer.c
+++ b/xen/common/timer.c
@@ -291,7 +291,7 @@ static bool active_timer(const struct timer *timer)
 
 void init_timer(
     struct timer *timer,
-    void        (*function)(void *),
+    void        (*function)(void *data),
     void         *data,
     unsigned int  cpu)
 {
@@ -441,7 +441,7 @@ void kill_timer(struct timer *timer)
 
 static void execute_timer(struct timers *ts, struct timer *t)
 {
-    void (*fn)(void *) = t->function;
+    void (*fn)(void *data) = t->function;
     void *data = t->data;
 
     t->status = TIMER_STATUS_inactive;
diff --git a/xen/include/xen/rangeset.h b/xen/include/xen/rangeset.h
index a211e3dfac..8be0722787 100644
--- a/xen/include/xen/rangeset.h
+++ b/xen/include/xen/rangeset.h
@@ -68,7 +68,7 @@ bool __must_check rangeset_overlaps_range(
     struct rangeset *r, unsigned long s, unsigned long e);
 int rangeset_report_ranges(
     struct rangeset *r, unsigned long s, unsigned long e,
-    int (*cb)(unsigned long s, unsigned long e, void *), void *ctxt);
+    int (*cb)(unsigned long s, unsigned long e, void *data), void *ctxt);
 
 /*
  * Note that the consume function can return an error value apart from
@@ -77,7 +77,7 @@ int rangeset_report_ranges(
  */
 int rangeset_consume_ranges(struct rangeset *r,
                             int (*cb)(unsigned long s, unsigned long e,
-                                      void *, unsigned long *c),
+                                      void *ctxt, unsigned long *c),
                             void *ctxt);
 
 /* Merge rangeset r2 into rangeset r1. */
diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index 02a062a5b0..c44e7d4929 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -179,7 +179,7 @@ typedef struct spinlock {
 #define spin_lock_init(l) (*(l) = (spinlock_t)SPIN_LOCK_UNLOCKED)
 
 void _spin_lock(spinlock_t *lock);
-void _spin_lock_cb(spinlock_t *lock, void (*cb)(void *), void *data);
+void _spin_lock_cb(spinlock_t *lock, void (*cb)(void *data), void *data);
 void _spin_lock_irq(spinlock_t *lock);
 unsigned long _spin_lock_irqsave(spinlock_t *lock);
 
diff --git a/xen/include/xen/stop_machine.h b/xen/include/xen/stop_machine.h
index c63da1b309..0bbf71f112 100644
--- a/xen/include/xen/stop_machine.h
+++ b/xen/include/xen/stop_machine.h
@@ -14,6 +14,6 @@
  *
  * This can be thought of as a very heavy write lock, equivalent to
  * grabbing every spinlock in the kernel. */
-int stop_machine_run(int (*fn)(void *), void *data, unsigned int cpu);
+int stop_machine_run(int (*fn)(void *data), void *data, unsigned int cpu);
 
 #endif /* __XEN_STOP_MACHINE_H__ */
diff --git a/xen/include/xen/tasklet.h b/xen/include/xen/tasklet.h
index 1362d4af27..593d6a2400 100644
--- a/xen/include/xen/tasklet.h
+++ b/xen/include/xen/tasklet.h
@@ -21,7 +21,7 @@ struct tasklet
     bool is_softirq;
     bool is_running;
     bool is_dead;
-    void (*func)(void *);
+    void (*func)(void *data);
     void *data;
 };
 
@@ -59,8 +59,9 @@ void tasklet_schedule_on_cpu(struct tasklet *t, unsigned int cpu);
 void tasklet_schedule(struct tasklet *t);
 void do_tasklet(void);
 void tasklet_kill(struct tasklet *t);
-void tasklet_init(struct tasklet *t, void (*func)(void *), void *data);
-void softirq_tasklet_init(struct tasklet *t, void (*func)(void *), void *data);
+void tasklet_init(struct tasklet *t, void (*func)(void *data), void *data);
+void softirq_tasklet_init(struct tasklet *t,
+                          void (*func)(void *data), void *data);
 void tasklet_subsys_init(void);
 
 #endif /* __XEN_TASKLET_H__ */
diff --git a/xen/include/xen/timer.h b/xen/include/xen/timer.h
index 3a2a05c6de..fb28517515 100644
--- a/xen/include/xen/timer.h
+++ b/xen/include/xen/timer.h
@@ -29,7 +29,7 @@ struct timer {
     };
 
     /* On expiry, '(*function)(data)' will be executed in softirq context. */
-    void (*function)(void *);
+    void (*function)(void *data);
     void *data;
 
     /* CPU on which this timer will be installed and executed. */
@@ -57,7 +57,7 @@ struct timer {
  */
 void init_timer(
     struct timer *timer,
-    void        (*function)(void *),
+    void        (*function)(void *data),
     void         *data,
     unsigned int  cpu);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 12:44:54 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 12:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640651.999154 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6VYD-0002kO-W7; Fri, 24 Nov 2023 12:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640651.999154; Fri, 24 Nov 2023 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 1r6VYD-0002kB-Rd; Fri, 24 Nov 2023 12:44:53 +0000
Received: by outflank-mailman (input) for mailman id 640651;
 Fri, 24 Nov 2023 12:44:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VYC-0002gM-A1
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:44:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VYC-0004HD-9D
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VYC-0003v5-8L
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:44:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mypU6R/ccsp5VNNWR3LpktQDR3UOgBl77DcaPl6dnNE=; b=WvBC/9OufK0L6tSeiP1kWlwef5
	LlMLP5JT6qmnrvJKH04KL63XRlnP3y4LmJf+8CJnwaxB9qOPuubYmFtBtW67Koc07tA0uiG9299na
	x85ArRFZvb4aayykT04RrfKtZXIRS5D340hxP1Fn6VY09B3AWPyLd287UJi45zzxONfU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/serial: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r6VYC-0003v5-8L@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 12:44:52 +0000

commit 764851a8be3437d8e925b9f1942c82eda1a1ac2d
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Thu Nov 23 10:08:38 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 23 10:08:38 2023 +0100

    xen/serial: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/include/xen/serial.h | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/xen/include/xen/serial.h b/xen/include/xen/serial.h
index cf9701986f..8d64fb5e86 100644
--- a/xen/include/xen/serial.h
+++ b/xen/include/xen/serial.h
@@ -15,7 +15,7 @@
 struct cpu_user_regs;
 
 /* Register a character-receive hook on the specified COM port. */
-typedef void (*serial_rx_fn)(char, struct cpu_user_regs *);
+typedef void (*serial_rx_fn)(char c, struct cpu_user_regs *regs);
 void serial_set_rx_handler(int handle, serial_rx_fn fn);
 
 /* Number of characters we buffer for a polling receiver. */
@@ -63,31 +63,31 @@ struct serial_port {
 
 struct uart_driver {
     /* Driver initialisation (pre- and post-IRQ subsystem setup). */
-    void (*init_preirq)(struct serial_port *);
-    void (*init_irq)(struct serial_port *);
-    void (*init_postirq)(struct serial_port *);
+    void (*init_preirq)(struct serial_port *port);
+    void (*init_irq)(struct serial_port *port);
+    void (*init_postirq)(struct serial_port *port);
     /* Hook to clean up after Xen bootstrap (before domain 0 runs). */
-    void (*endboot)(struct serial_port *);
+    void (*endboot)(struct serial_port *port);
     /* Driver suspend/resume. */
-    void (*suspend)(struct serial_port *);
-    void (*resume)(struct serial_port *);
+    void (*suspend)(struct serial_port *port);
+    void (*resume)(struct serial_port *port);
     /* Return number of characters the port can hold for transmit,
      * or -EIO if port is inaccesible */
-    int (*tx_ready)(struct serial_port *);
+    int (*tx_ready)(struct serial_port *port);
     /* Put a character onto the serial line. */
-    void (*putc)(struct serial_port *, char);
+    void (*putc)(struct serial_port *port, char c);
     /* Flush accumulated characters. */
-    void (*flush)(struct serial_port *);
+    void (*flush)(struct serial_port *port);
     /* Get a character from the serial line: returns 0 if none available. */
-    int  (*getc)(struct serial_port *, char *);
+    int  (*getc)(struct serial_port *port, char *pc);
     /* Get IRQ number for this port's serial line: returns -1 if none. */
-    int  (*irq)(struct serial_port *);
+    int  (*irq)(struct serial_port *port);
     /* Unmask TX interrupt */
-    void  (*start_tx)(struct serial_port *);
+    void  (*start_tx)(struct serial_port *port);
     /* Mask TX interrupt */
-    void  (*stop_tx)(struct serial_port *);
+    void  (*stop_tx)(struct serial_port *port);
     /* Get serial information */
-    const struct vuart_info *(*vuart_info)(struct serial_port *);
+    const struct vuart_info *(*vuart_info)(struct serial_port *port);
 };
 
 /* 'Serial handles' are composed from the following fields. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 12:45:03 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 12:45:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640652.999157 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6VYN-00039Z-0d; Fri, 24 Nov 2023 12:45:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640652.999157; Fri, 24 Nov 2023 12:45: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 1r6VYM-00039R-UN; Fri, 24 Nov 2023 12:45:02 +0000
Received: by outflank-mailman (input) for mailman id 640652;
 Fri, 24 Nov 2023 12:45:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VYM-00039L-D7
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:45:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VYM-0004Ho-CH
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VYM-0003wK-BG
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:45:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3jZImkYA7f2PKohRYhdibMyvU5CPDFww9go/CjDBr1A=; b=yV8X2ibYMVHegyK7I76gqdXxLJ
	P7L9fSPEImuDUjVyHJ7DtqjD03LSM9vr+T10A8aMngWPSneM4LdDBwku5p3kHlEr5tN1pkY8plDhZ
	1y1cgmLK68TFR1O6up6hijct7UZ2rwyPxxQ1/4fPM0zc3gS3qXvwVyO/OZD4BGfDgTiw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/vmap: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r6VYM-0003wK-BG@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 12:45:02 +0000

commit 382257af0c9dc428e36d7dc290c82a2a6f5aedea
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Thu Nov 23 10:09:10 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 23 10:09:10 2023 +0100

    xen/vmap: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/include/xen/vmap.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/xen/vmap.h b/xen/include/xen/vmap.h
index b0f7632e89..2b7369e062 100644
--- a/xen/include/xen/vmap.h
+++ b/xen/include/xen/vmap.h
@@ -13,9 +13,9 @@ enum vmap_region {
 void vm_init_type(enum vmap_region type, void *start, void *end);
 
 void *__vmap(const mfn_t *mfn, unsigned int granularity, unsigned int nr,
-             unsigned int align, unsigned int flags, enum vmap_region);
+             unsigned int align, unsigned int flags, enum vmap_region type);
 void *vmap(const mfn_t *mfn, unsigned int nr);
-void vunmap(const void *);
+void vunmap(const void *va);
 
 void *vmalloc(size_t size);
 void *vmalloc_xen(size_t size);
@@ -23,7 +23,7 @@ void *vmalloc_xen(size_t size);
 void *vzalloc(size_t size);
 void vfree(void *va);
 
-void __iomem *ioremap(paddr_t, size_t);
+void __iomem *ioremap(paddr_t pa, size_t len);
 
 static inline void iounmap(void __iomem *va)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 12:45:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 12:45:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640653.999161 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6VYX-0003R4-29; Fri, 24 Nov 2023 12:45:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640653.999161; Fri, 24 Nov 2023 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 1r6VYW-0003Qw-Vm; Fri, 24 Nov 2023 12:45:12 +0000
Received: by outflank-mailman (input) for mailman id 640653;
 Fri, 24 Nov 2023 12:45:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VYW-0003Qo-GF
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:45:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VYW-0004I0-FO
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:45:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VYW-0003xu-ES
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:45:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7I70+3LES3n9mNWwrdRrG2lRfCSwR4KqIccAS4om1Ew=; b=7FhXda+KVyog+kERMcrci3d0ZI
	Kr6qbo7nkH2tmq2xAFGR5t1B/HDTMUUrZp/XNXf3CLGanJZNOKRoLq2OOtq9JiGsBsHWOT64yKOBb
	Y3m0ks6j4Bk3ZUYZOL6AT/xe0YbJfnp40W9WoUN7VvO4SwFPgS9gTZ8ZVgGdrrT6g2yo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/xalloc: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r6VYW-0003xu-ES@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 12:45:12 +0000

commit 8f45862580c962791e66df716389bb5b1dd704df
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Thu Nov 23 10:09:43 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 23 10:09:43 2023 +0100

    xen/xalloc: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/include/xen/xmalloc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/xen/xmalloc.h b/xen/include/xen/xmalloc.h
index 16979a117c..9ecddbff5e 100644
--- a/xen/include/xen/xmalloc.h
+++ b/xen/include/xen/xmalloc.h
@@ -63,7 +63,7 @@
     })
 
 /* Free any of the above. */
-extern void xfree(void *);
+extern void xfree(void *p);
 
 /* Free an allocation, and zero the pointer to it. */
 #define XFREE(p) do { \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 12:45:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 12:45:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640654.999165 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6VYh-0003dU-3X; Fri, 24 Nov 2023 12:45:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640654.999165; Fri, 24 Nov 2023 12:45:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6VYh-0003dN-0s; Fri, 24 Nov 2023 12:45:23 +0000
Received: by outflank-mailman (input) for mailman id 640654;
 Fri, 24 Nov 2023 12:45:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VYg-0003dF-J1
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:45:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VYg-0004I7-IN
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:45:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VYg-0003yQ-HT
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:45:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=drkMKSYDG9NqLq7qQ9EznFxkNz1oX5xabHItnnK2/uE=; b=sjYLORv34CyzjcT2zgb5Mys4el
	KGIi4W/+nJRZIhJz2sNzXSy6mrBGHyGNPJx6L69heFGKQzL0nUxcx2A4vPDsYi1ItboJL6KSy3sBH
	MsUOG/0S96Zke29jdDT0oX9oFVdF4gEq1FC/IiQXajM/FX/uSzQk68tj0yxvx4GMy7gw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: gicv3: clean up GICD_CTRL write
Message-Id: <E1r6VYg-0003yQ-HT@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 12:45:22 +0000

commit 1e2b13bcf0370eed53ece6f224a11651edb1f22e
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Wed Nov 22 09:46:00 2023 -0500
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Nov 23 10:54:02 2023 +0000

    xen/arm: gicv3: clean up GICD_CTRL write
    
    GICD_CTL_ENABLE is a GICv2 bit. Remove it. The definitions of
    GICD_CTL_ENABLE and GICD_CTLR_ENABLE_G1 are identical, so the value
    written is unchanged.
    
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/gic-v3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 172ff8c005..9b35a8c8a7 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -633,8 +633,8 @@ static void __init gicv3_dist_init(void)
     gicv3_dist_wait_for_rwp();
 
     /* Turn on the distributor */
-    writel_relaxed(GICD_CTL_ENABLE | GICD_CTLR_ARE_NS |
-                GICD_CTLR_ENABLE_G1A | GICD_CTLR_ENABLE_G1, GICD + GICD_CTLR);
+    writel_relaxed(GICD_CTLR_ARE_NS | GICD_CTLR_ENABLE_G1A |
+                   GICD_CTLR_ENABLE_G1, GICD + GICD_CTLR);
 
     /* Route all global IRQs to this CPU */
     affinity = gicv3_mpidr_to_affinity(smp_processor_id());
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 12:45:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 12:45:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640655.999169 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6VYr-0003p0-51; Fri, 24 Nov 2023 12:45:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640655.999169; Fri, 24 Nov 2023 12:45: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 1r6VYr-0003os-2F; Fri, 24 Nov 2023 12:45:33 +0000
Received: by outflank-mailman (input) for mailman id 640655;
 Fri, 24 Nov 2023 12:45: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 1r6VYq-0003ol-M7
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:45: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 1r6VYq-0004ID-LS
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:45:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VYq-0003yr-KT
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:45:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Eokw2v4FCpKq+5mpPo+YU2+s4gZ5hNUpUbKkYujWo8I=; b=if9zggZkj9HwcOcDqQGLE/bt5R
	q/L93rwf1YRVOCe+JRVm1t6dwU769Qz9o1Cpyi3AceqMeztKKrJEoVKNMbWAKCDKcv3QMMlcWeNSB
	swkZ9GTgWb6geCQje9fbPxdBcKk0+/UhcCzO04NuEMJPk7ZPCNnTnSXY5inoawzo1B5U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/setup: Clean up cmdline handling in create_dom0()
Message-Id: <E1r6VYq-0003yr-KT@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 12:45:32 +0000

commit 0dd323133022933dfb03de984c50eadd697cdd71
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 21 18:26:31 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Nov 23 11:20:01 2023 +0000

    x86/setup: Clean up cmdline handling in create_dom0()
    
    There's a confusing mix of variables; a static dom0_cmdline[], and a cmdline
    pointer which points to image->string before being pointed at the static
    buffer in order to be passed into construct_dom0().  cmdline being a mutable
    pointer falls over -Wwrite-strings builds.
    
    Delete the cmdline pointer, and rename dom0_cmdline[] to cmdline extending it
    to have full function scope.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/setup.c | 28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index c8947d3f96..478107ef28 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -875,6 +875,8 @@ static struct domain *__init create_dom0(const module_t *image,
                                          module_t *initrd, const char *kextra,
                                          const char *loader)
 {
+    static char __initdata cmdline[MAX_GUEST_CMDLINE];
+
     struct xen_domctl_createdomain dom0_cfg = {
         .flags = IS_ENABLED(CONFIG_TBOOT) ? XEN_DOMCTL_CDF_s3_integrity : 0,
         .max_evtchn_port = -1,
@@ -887,7 +889,6 @@ static struct domain *__init create_dom0(const module_t *image,
         },
     };
     struct domain *d;
-    char *cmdline;
     domid_t domid;
 
     if ( opt_dom0_pvh )
@@ -915,33 +916,30 @@ static struct domain *__init create_dom0(const module_t *image,
         panic("Error creating d%uv0\n", domid);
 
     /* Grab the DOM0 command line. */
-    cmdline = image->string ? __va(image->string) : NULL;
-    if ( cmdline || kextra )
+    if ( image->string || kextra )
     {
-        static char __initdata dom0_cmdline[MAX_GUEST_CMDLINE];
-
-        cmdline = cmdline_cook(cmdline, loader);
-        safe_strcpy(dom0_cmdline, cmdline);
+        if ( image->string )
+            safe_strcpy(cmdline, cmdline_cook(__va(image->string), loader));
 
         if ( kextra )
             /* kextra always includes exactly one leading space. */
-            safe_strcat(dom0_cmdline, kextra);
+            safe_strcat(cmdline, kextra);
 
         /* Append any extra parameters. */
-        if ( skip_ioapic_setup && !strstr(dom0_cmdline, "noapic") )
-            safe_strcat(dom0_cmdline, " noapic");
+        if ( skip_ioapic_setup && !strstr(cmdline, "noapic") )
+            safe_strcat(cmdline, " noapic");
+
         if ( (strlen(acpi_param) == 0) && acpi_disabled )
         {
             printk("ACPI is disabled, notifying Domain 0 (acpi=off)\n");
             safe_strcpy(acpi_param, "off");
         }
-        if ( (strlen(acpi_param) != 0) && !strstr(dom0_cmdline, "acpi=") )
+
+        if ( (strlen(acpi_param) != 0) && !strstr(cmdline, "acpi=") )
         {
-            safe_strcat(dom0_cmdline, " acpi=");
-            safe_strcat(dom0_cmdline, acpi_param);
+            safe_strcat(cmdline, " acpi=");
+            safe_strcat(cmdline, acpi_param);
         }
-
-        cmdline = dom0_cmdline;
     }
 
     /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 12:45:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 12:45:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640656.999173 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6VZ1-00046g-6C; Fri, 24 Nov 2023 12:45:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640656.999173; Fri, 24 Nov 2023 12:45: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 1r6VZ1-00046Z-3d; Fri, 24 Nov 2023 12:45:43 +0000
Received: by outflank-mailman (input) for mailman id 640656;
 Fri, 24 Nov 2023 12:45: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 1r6VZ0-00046T-PF
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:45: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 1r6VZ0-0004IK-OV
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:45:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VZ0-0003zI-NZ
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:45: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=9u6wPfOg8lAp9M3IMeoBmjrBZTC3DZHVpBpWRgyOC10=; b=ndOk4mdQTlRIR43j27qWCkuN7A
	VUmxgttzSidLEPCK0fKI7SJbaoWYFbTCZ4PGqYzPUpAi38YUxWOxrXMDD6ed+n31TV2aZQGSdPsFd
	jRCJYLR6IuyzL/GhgzU+bs8ATAB99ak3vHJzyUjZfpAwnMW6Hiob9tfoCHqkOdiclB3A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/setup: Rework cmdline_cook() to be compatible with -Wwrite-strings
Message-Id: <E1r6VZ0-0003zI-NZ@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 12:45:42 +0000

commit 858e3bf3493cc43e66acede71c3b159db0b82ef9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 20 22:10:59 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Nov 23 11:20:01 2023 +0000

    x86/setup: Rework cmdline_cook() to be compatible with -Wwrite-strings
    
    Rework the logic in __start_xen() to not potentially pass NULL into
    cmdline_cook().  This makes the logic easier to follow too, and the rest of
    __start_xen() is safe when initialising cmdline to the empty string.
    
    Update cmdline_cook() to take and return const pointers, and write a
    description of what it does.  It now requires a non-NULL input and guarentees
    to return a pointer somewhere in the 'p' string.
    
    Note this only compiles because strstr() launders the const off the pointer
    when assigning to the mutable kextra, but that logic only mutates the
    mbi->cmdline buffer.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/setup.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 478107ef28..bf9da48060 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -839,10 +839,15 @@ static bool __init loader_is_grub2(const char *loader_name)
     return (p != NULL) && (p[5] != '0');
 }
 
-static char * __init cmdline_cook(char *p, const char *loader_name)
+/*
+ * Clean up a command line string passed to us by a bootloader.  Strip leading
+ * whitespace, and optionally strip the first parameter if our divination of
+ * the bootloader suggests that it prepended the image name.
+ *
+ * Always returns a pointer within @p.
+ */
+static const char *__init cmdline_cook(const char *p, const char *loader_name)
 {
-    p = p ? : "";
-
     /* Strip leading whitespace. */
     while ( *p == ' ' )
         p++;
@@ -971,8 +976,8 @@ static struct domain *__init create_dom0(const module_t *image,
 /* SAF-1-safe */
 void __init noreturn __start_xen(unsigned long mbi_p)
 {
-    const char *memmap_type = NULL, *loader;
-    char *cmdline, *kextra;
+    const char *memmap_type = NULL, *loader, *cmdline = "";
+    char *kextra;
     void *bsp_stack;
     struct cpu_info *info = get_cpu_info(), *bsp_info;
     unsigned int initrdidx, num_parked = 0;
@@ -1027,9 +1032,9 @@ void __init noreturn __start_xen(unsigned long mbi_p)
                                            : "unknown";
 
     /* Parse the command-line options. */
-    cmdline = cmdline_cook((mbi->flags & MBI_CMDLINE) ?
-                           __va(mbi->cmdline) : NULL,
-                           loader);
+    if ( mbi->flags & MBI_CMDLINE )
+        cmdline = cmdline_cook(__va(mbi->cmdline), loader);
+
     if ( (kextra = strstr(cmdline, " -- ")) != NULL )
     {
         /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 12:45:54 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 12:45:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640657.999177 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6VZC-0004T9-7s; Fri, 24 Nov 2023 12:45:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640657.999177; Fri, 24 Nov 2023 12:45:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6VZC-0004T1-5N; Fri, 24 Nov 2023 12:45:54 +0000
Received: by outflank-mailman (input) for mailman id 640657;
 Fri, 24 Nov 2023 12:45: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 1r6VZA-0004QP-SY
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:45: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 1r6VZA-0004Il-Rg
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:45:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VZA-00040D-Qo
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:45: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=lctEzLs/kimSzK1YfJ8LffVizUzP1pOM2srbOOacVJs=; b=HiGNa2ppXuj0Uu9NMaxDJJAeV1
	q5KtnsB1iFJdwJEtDgyZqZauvqpREjdK/bvxFHzRR155DvWX5TT5I1e7NPwBhFVgM1vVOfUPED2kl
	xfFF5OZlO36m7LRx8udUFPvZGP10/KheWv5fjj5MZzsGQXqhbRFjFykDcRBWVNueSXE8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/efi: Simplify efi_arch_handle_cmdline()
Message-Id: <E1r6VZA-00040D-Qo@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 12:45:52 +0000

commit ef2071d45b480132b8cf6c65342ca67e992509c2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 21 19:47:23 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Nov 23 11:20:01 2023 +0000

    x86/efi: Simplify efi_arch_handle_cmdline()
    
    -Wwrite-strings is unhappy with assigning "xen" to a mutable pointer, but all
    this work is useless; it's just prepending the image name which cmdline_cook()
    intentionally strips back out (and allocating memory to do so).
    
    Simply forgo the work and identify EFI_LOADER as one of the loaders which
    doesn't prepend the image name.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/efi/efi-boot.h | 10 +---------
 xen/arch/x86/setup.c        |  7 +++++--
 2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index eebc54180b..1a2a2dd83c 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -309,6 +309,7 @@ static void __init efi_arch_handle_cmdline(CHAR16 *image_name,
 {
     union string name;
 
+    /* NB place_string() prepends, so call in reverse order. */
     if ( cmdline_options )
     {
         name.w = cmdline_options;
@@ -317,15 +318,6 @@ static void __init efi_arch_handle_cmdline(CHAR16 *image_name,
     }
     if ( cfgfile_options )
         place_string(&mbi.cmdline, cfgfile_options);
-    /* Insert image name last, as it gets prefixed to the other options. */
-    if ( image_name )
-    {
-        name.w = image_name;
-        w2s(&name);
-    }
-    else
-        name.s = "xen";
-    place_string(&mbi.cmdline, name.s);
 
     if ( mbi.cmdline )
         mbi.flags |= MBI_CMDLINE;
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index bf9da48060..f6b8a3efd7 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -852,8 +852,11 @@ static const char *__init cmdline_cook(const char *p, const char *loader_name)
     while ( *p == ' ' )
         p++;
 
-    /* GRUB2 and PVH don't not include image name as first item on command line. */
-    if ( xen_guest || loader_is_grub2(loader_name) )
+    /*
+     * PVH, our EFI loader, and GRUB2 don't include image name as first
+     * item on command line.
+     */
+    if ( xen_guest || efi_enabled(EFI_LOADER) || loader_is_grub2(loader_name) )
         return p;
 
     /* Strip image name plus whitespace. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 12:46:04 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 12:46:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640658.999181 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6VZM-0004kJ-9k; Fri, 24 Nov 2023 12:46:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640658.999181; Fri, 24 Nov 2023 12:46:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6VZM-0004kB-6l; Fri, 24 Nov 2023 12:46:04 +0000
Received: by outflank-mailman (input) for mailman id 640658;
 Fri, 24 Nov 2023 12:46:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VZK-0004hj-VK
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:46: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 1r6VZK-0004JD-Ud
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:46:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VZK-00041j-Tj
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:46: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=pWxKzyuMY9p2kSs3NFC188PjPMGUIn2X/Z9L+sDkdGc=; b=1jowdyruxbZ9DvfAPZSFBMwiK+
	jjhISREDYXuE8rDnCaNwpLOB0I8vevOG5YL2/e/lQkZr71DWyeng8N+Kb82+S4RHjsQpTANj90GBx
	qDAWuycPPelaQYMO9dhnKw9Wc3TmV8OZtBOfcgEDjbg5g+4F7k7plxjukr+JakQKEbog=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/efi: Simplify efi_arch_handle_cmdline()
Message-Id: <E1r6VZK-00041j-Tj@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 12:46:02 +0000

commit b1185ce66c999e815b2c2f12d6baa3e4436ee2fc
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 21 20:02:16 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Nov 23 11:20:01 2023 +0000

    arm/efi: Simplify efi_arch_handle_cmdline()
    
    -Wwrite-strings is unhappy with assigning "xen" to a mutable pointer, but this
    logic looks incorrect.  It was inherited from the x86 side, where the logic
    was redundant and has now been removed.
    
    In the ARM case it inserts the image name into "xen,xen-bootargs" and there is
    no logic at all to strip this before parsing it as the command line.
    
    The absence of any logic to strip an image name suggests that it shouldn't
    exist there, or having a Xen image named e.g. "hmp-unsafe" in the filesystem
    is going to lead to some unexpected behaviour on boot.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com>
    Tested-by: Henry Wang <Henry.Wang@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/efi/efi-boot.h | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index 1c3640bb65..59d217667f 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -461,7 +461,7 @@ static void __init efi_arch_handle_cmdline(CHAR16 *image_name,
     union string name;
     char *buf;
     EFI_STATUS status;
-    int prop_len;
+    int prop_len = 0;
     int chosen;
 
     /* locate chosen node, which is where we add Xen module info. */
@@ -473,20 +473,6 @@ static void __init efi_arch_handle_cmdline(CHAR16 *image_name,
     if ( EFI_ERROR(status) )
         PrintErrMesg(L"Unable to allocate string buffer", status);
 
-    if ( image_name )
-    {
-        name.w = image_name;
-        w2s(&name);
-    }
-    else
-        name.s = "xen";
-
-    prop_len = 0;
-    prop_len += snprintf(buf + prop_len,
-                           EFI_PAGE_SIZE - prop_len, "%s", name.s);
-    if ( prop_len >= EFI_PAGE_SIZE )
-        blexit(L"FDT string overflow");
-
     if ( cfgfile_options )
     {
         PrintMessage(L"Using bootargs from Xen configuration file.");
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 12:46:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 12:46:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640659.999185 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6VZW-00056M-Ak; Fri, 24 Nov 2023 12:46:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640659.999185; Fri, 24 Nov 2023 12:46: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 1r6VZW-00056D-8A; Fri, 24 Nov 2023 12:46:14 +0000
Received: by outflank-mailman (input) for mailman id 640659;
 Fri, 24 Nov 2023 12:46:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VZV-0004zn-1s
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:46:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VZV-0004JJ-19
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:46:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VZV-00042J-0L
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:46:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7JsEyAi1HO4oJc5lU6tobLDnHNmwN755ITrvQMrY4kA=; b=Yh5K03s62f/nkc/gH8TDeCUlyg
	14LJioNMOJw56aidj/pyzhMMKTh8nMYf7/Hg6bj0sMYKwAXRHzFp0iT5YM8rbiKF0IHEzFRjctH2B
	05kbwwXB0yKNiE42RCGJ4INsf5B/37nVpMDF+cuoKTKIjPLjYwpDZrm6uJDlDXyQNVqc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Enable -Wwrite-strings
Message-Id: <E1r6VZV-00042J-0L@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 12:46:13 +0000

commit 9153b64beac9983835b8804a1ed9b19ecb7e3c3f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue May 16 20:55:57 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Nov 23 11:20:01 2023 +0000

    xen: Enable -Wwrite-strings
    
    The codebase is now -Wwrite-strings clean.  Activate the option to cause
    string literals to have a const type, and prevent any violations of MISRA Rule
    7.4 being reintroduced.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index 7b869f4b30..ca571103c8 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -392,7 +392,7 @@ endif
 CFLAGS-$(CONFIG_CC_SPLIT_SECTIONS) += -ffunction-sections -fdata-sections
 
 CFLAGS += -nostdinc -fno-builtin -fno-common
-CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
+CFLAGS += -Werror -Wredundant-decls -Wwrite-strings -Wno-pointer-arith
 $(call cc-option-add,CFLAGS,CC,-Wvla)
 CFLAGS += -pipe -D__XEN__ -include $(srctree)/include/xen/config.h
 CFLAGS-$(CONFIG_DEBUG_INFO) += -g
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 12:46:24 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 12:46:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640660.999191 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6VZg-0005X6-F7; Fri, 24 Nov 2023 12:46:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640660.999191; Fri, 24 Nov 2023 12:46: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 1r6VZg-0005We-Ay; Fri, 24 Nov 2023 12:46:24 +0000
Received: by outflank-mailman (input) for mailman id 640660;
 Fri, 24 Nov 2023 12:46:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VZf-0005RW-6t
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:46:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VZf-0004JP-67
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:46:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VZf-00042u-3S
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:46:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Y3ZX3B4xRCrRfVteRdfD3xEObZMPFnihZkzesBmKu/M=; b=qGP38ibcbWoVTqDc5jCpuIt7zV
	C3p+1jpPFRLP/445GfzHGWjQbuNws/1YPGZxAHNKQ8O1M5gdA3tctD/0IEOOGFxVg3o3kHQHjVks6
	UBRsXCj1WVeb8T0/x9VXuJ0z5gTVv3x+oqODAcvRbFYk5sZiM5LymA4E9BVDOn6FI87U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/apic: Drop atomic accessors
Message-Id: <E1r6VZf-00042u-3S@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 12:46:23 +0000

commit e39cbf52b1aa5b868439274472296f9f47a39d77
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 22 13:28:21 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Nov 23 11:20:01 2023 +0000

    x86/apic: Drop atomic accessors
    
    The last users were dropped in commit 413e92e9bf13 ("x86/apic: Drop
    workarounds for Pentium/82489DX erratum").
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/x86/include/asm/apic.h | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/xen/arch/x86/include/asm/apic.h b/xen/arch/x86/include/asm/apic.h
index f7ad7b20dd..288b4933eb 100644
--- a/xen/arch/x86/include/asm/apic.h
+++ b/xen/arch/x86/include/asm/apic.h
@@ -54,11 +54,6 @@ static __inline void apic_mem_write(unsigned long reg, u32 v)
 	*((volatile u32 *)(APIC_BASE+reg)) = v;
 }
 
-static __inline void apic_mem_write_atomic(unsigned long reg, u32 v)
-{
-	(void)xchg((volatile u32 *)(APIC_BASE+reg), v);
-}
-
 static __inline u32 apic_mem_read(unsigned long reg)
 {
 	return *((volatile u32 *)(APIC_BASE+reg));
@@ -97,14 +92,6 @@ static __inline void apic_write(unsigned long reg, u32 v)
         apic_mem_write(reg, v);
 }
 
-static __inline void apic_write_atomic(unsigned long reg, u32 v)
-{
-    if ( x2apic_enabled )
-        apic_wrmsr(reg, v);
-    else
-        apic_mem_write_atomic(reg, v);
-}
-
 static __inline u32 apic_read(unsigned long reg)
 {
     if ( x2apic_enabled )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 12:46:34 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 12:46:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640661.999193 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6VZq-0005zh-Et; Fri, 24 Nov 2023 12:46:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640661.999193; Fri, 24 Nov 2023 12:46: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 1r6VZq-0005za-CP; Fri, 24 Nov 2023 12:46:34 +0000
Received: by outflank-mailman (input) for mailman id 640661;
 Fri, 24 Nov 2023 12:46:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VZp-0005yI-9h
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:46:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VZp-0004L0-8v
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:46:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VZp-00043J-8F
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:46:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Dw1F49Us/o3062xQtgu6cymYJJlkYFuDlAcyhER/Oc0=; b=6sa+y3XFuom/DKpjTmcQcgUA/3
	KWPovGT0g8TQpjnR/eIRnwb9Nj37IHcmMj0JTFRldV6gbroa2+QVtEWH5quRjmdmtSA8icyXnHDJI
	Ijs2K+jxO7D5eerGFhajDdA7EL/zuOxxrlUUpzwiPImb5sHa+nEfRKVYTwzOGXgmfmss=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/apic: Drop the APIC_MSR_BASE constant
Message-Id: <E1r6VZp-00043J-8F@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 12:46:33 +0000

commit 563193de858d55ab1665f9fe80bb5126332bf7bc
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 22 13:35:27 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Nov 23 11:20:01 2023 +0000

    x86/apic: Drop the APIC_MSR_BASE constant
    
    Use MSR_X2APIC_FIRST from msr-index.h instead.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/x86/include/asm/apic.h    | 4 ++--
 xen/arch/x86/include/asm/apicdef.h | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/include/asm/apic.h b/xen/arch/x86/include/asm/apic.h
index 288b4933eb..486d689478 100644
--- a/xen/arch/x86/include/asm/apic.h
+++ b/xen/arch/x86/include/asm/apic.h
@@ -69,7 +69,7 @@ static __inline void apic_wrmsr(unsigned long reg, uint64_t msr_content)
         reg == APIC_LVR)
         return;
 
-    wrmsrl(APIC_MSR_BASE + (reg >> 4), msr_content);
+    wrmsrl(MSR_X2APIC_FIRST + (reg >> 4), msr_content);
 }
 
 static __inline uint64_t apic_rdmsr(unsigned long reg)
@@ -79,7 +79,7 @@ static __inline uint64_t apic_rdmsr(unsigned long reg)
     if (reg == APIC_DFR)
         return -1u;
 
-    rdmsrl(APIC_MSR_BASE + (reg >> 4), msr_content);
+    rdmsrl(MSR_X2APIC_FIRST + (reg >> 4), msr_content);
     return msr_content;
 }
 
diff --git a/xen/arch/x86/include/asm/apicdef.h b/xen/arch/x86/include/asm/apicdef.h
index 8d1b0087d4..c4068ccc10 100644
--- a/xen/arch/x86/include/asm/apicdef.h
+++ b/xen/arch/x86/include/asm/apicdef.h
@@ -124,9 +124,6 @@
 
 #define APIC_BASE __fix_to_virt(FIX_APIC_BASE)
 
-/* It's only used in x2APIC mode of an x2APIC unit. */
-#define APIC_MSR_BASE 0x800
-
 #define MAX_IO_APICS 128
 
 extern bool x2apic_enabled;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Nov 24 12:46:44 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Nov 2023 12:46:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.640663.999199 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6Va0-0006P5-HN; Fri, 24 Nov 2023 12:46:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 640663.999199; Fri, 24 Nov 2023 12:46: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 1r6Va0-0006Ox-Du; Fri, 24 Nov 2023 12:46:44 +0000
Received: by outflank-mailman (input) for mailman id 640663;
 Fri, 24 Nov 2023 12:46:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VZz-0006NS-Ce
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:46:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VZz-0004LB-Bt
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:46:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6VZz-00043o-B1
 for xen-changelog@lists.xenproject.org; Fri, 24 Nov 2023 12:46:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=l0CYpj+hWfDOlI7x5I1i8lUeLDFQ25kmywXmMw2EGPE=; b=eKj/T0MPHONzmAtxKEPvcVfzCx
	Xce0lL3R7T01XytzJYnaWeHUi9PV7FMObFfx/+Ja2CEomdilEhmNlcyCJNjdlgJOjW+owD+ppG0ac
	OAsHoW+/BjTPNjTJzRU+gZ8ScbwBitAUh3x2otafqaqd4PvLoEPkcE1BDT+R8MzH0PNo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/MISRA: Remove nonstandard inline keywords
Message-Id: <E1r6VZz-00043o-B1@xenbits.xenproject.org>
Date: Fri, 24 Nov 2023 12:46:43 +0000

commit f96e2f64576cdbb147391c7cb399d393385719a9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 22 13:39:54 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Nov 23 11:20:01 2023 +0000

    xen/MISRA: Remove nonstandard inline keywords
    
    The differences between inline, __inline and __inline__ keywords (as far as
    GCC is concenred at least) are a vestigial remnant of older C standards, and
    in Xen we use inline almost exclusively.
    
    Replace __inline and __inline__ with regular inline, and remove their
    exceptions from the MISRA configuration.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Simone Ballarin <simone.ballarin@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/eclair_analysis/ECLAIR/toolchain.ecl |  6 +++---
 docs/misra/C-language-toolchain.rst             |  2 +-
 xen/arch/x86/include/asm/apic.h                 | 20 ++++++++++----------
 xen/include/acpi/cpufreq/cpufreq.h              |  4 ++--
 xen/include/xen/bitops.h                        |  4 ++--
 xen/include/xen/compiler.h                      |  7 +++----
 6 files changed, 21 insertions(+), 22 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/toolchain.ecl b/automation/eclair_analysis/ECLAIR/toolchain.ecl
index e6cd289b5e..71a1e2cce0 100644
--- a/automation/eclair_analysis/ECLAIR/toolchain.ecl
+++ b/automation/eclair_analysis/ECLAIR/toolchain.ecl
@@ -15,7 +15,7 @@
     _Static_assert: see Section \"2.1 C Language\" of "GCC_MANUAL".
     asm, __asm__: see Sections \"6.48 Alternate Keywords\" and \"6.47 How to Use Inline Assembly Language in C Code\" of "GCC_MANUAL".
     __volatile__: see Sections \"6.48 Alternate Keywords\" and \"6.47.2.1 Volatile\" of "GCC_MANUAL".
-    __const__, __inline__, __inline: see Section \"6.48 Alternate Keywords\" of "GCC_MANUAL".
+    __const__ : see Section \"6.48 Alternate Keywords\" of "GCC_MANUAL".
     typeof, __typeof__: see Section \"6.7 Referring to a Type with typeof\" of "GCC_MANUAL".
     __alignof__, __alignof: see Sections \"6.48 Alternate Keywords\" and \"6.44 Determining the Alignment of Functions, Types or Variables\" of "GCC_MANUAL".
     __attribute__: see Section \"6.39 Attribute Syntax\" of "GCC_MANUAL".
@@ -23,8 +23,8 @@
     __builtin_va_arg: non-documented GCC extension.
     __builtin_offsetof: see Section \"6.53 Support for offsetof\" of "GCC_MANUAL".
 "
--config=STD.tokenext,behavior+={c99, GCC_ARM64, "^(_Static_assert|asm|__asm__|__volatile__|__const__|__inline__|typeof|__typeof__|__alignof__|__attribute__|__builtin_types_compatible_p|__builtin_va_arg|__builtin_offsetof)$"}
--config=STD.tokenext,behavior+={c99, GCC_X86_64, "^(_Static_assert|asm|__asm__|__volatile__|__const__|__inline__|__inline|typeof|__typeof__|__alignof__|__alignof|__attribute__|__builtin_types_compatible_p|__builtin_va_arg|__builtin_offsetof)$"}
+-config=STD.tokenext,behavior+={c99, GCC_ARM64, "^(_Static_assert|asm|__asm__|__volatile__|__const__|typeof|__typeof__|__alignof__|__attribute__|__builtin_types_compatible_p|__builtin_va_arg|__builtin_offsetof)$"}
+-config=STD.tokenext,behavior+={c99, GCC_X86_64, "^(_Static_assert|asm|__asm__|__volatile__|__const__|typeof|__typeof__|__alignof__|__alignof|__attribute__|__builtin_types_compatible_p|__builtin_va_arg|__builtin_offsetof)$"}
 -doc_end
 
 -doc_begin="Non-documented GCC extension."
diff --git a/docs/misra/C-language-toolchain.rst b/docs/misra/C-language-toolchain.rst
index 2866cb191b..b7c2000992 100644
--- a/docs/misra/C-language-toolchain.rst
+++ b/docs/misra/C-language-toolchain.rst
@@ -84,7 +84,7 @@ The table columns are as follows:
           see Sections "6.48 Alternate Keywords" and "6.47 How to Use Inline Assembly Language in C Code" of GCC_MANUAL.
        __volatile__:
           see Sections "6.48 Alternate Keywords" and "6.47.2.1 Volatile" of GCC_MANUAL.
-       __const__, __inline__, __inline:
+       __const__:
           see Section "6.48 Alternate Keywords" of GCC_MANUAL.
        typeof, __typeof__:
           see Section "6.7 Referring to a Type with typeof" of GCC_MANUAL.
diff --git a/xen/arch/x86/include/asm/apic.h b/xen/arch/x86/include/asm/apic.h
index 486d689478..b20fae7ebc 100644
--- a/xen/arch/x86/include/asm/apic.h
+++ b/xen/arch/x86/include/asm/apic.h
@@ -49,12 +49,12 @@ const struct genapic *apic_x2apic_probe(void);
  * Basic functions accessing APICs.
  */
 
-static __inline void apic_mem_write(unsigned long reg, u32 v)
+static inline void apic_mem_write(unsigned long reg, u32 v)
 {
 	*((volatile u32 *)(APIC_BASE+reg)) = v;
 }
 
-static __inline u32 apic_mem_read(unsigned long reg)
+static inline u32 apic_mem_read(unsigned long reg)
 {
 	return *((volatile u32 *)(APIC_BASE+reg));
 }
@@ -63,7 +63,7 @@ static __inline u32 apic_mem_read(unsigned long reg)
  * access the 64-bit ICR register.
  */
 
-static __inline void apic_wrmsr(unsigned long reg, uint64_t msr_content)
+static inline void apic_wrmsr(unsigned long reg, uint64_t msr_content)
 {
     if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR ||
         reg == APIC_LVR)
@@ -72,7 +72,7 @@ static __inline void apic_wrmsr(unsigned long reg, uint64_t msr_content)
     wrmsrl(MSR_X2APIC_FIRST + (reg >> 4), msr_content);
 }
 
-static __inline uint64_t apic_rdmsr(unsigned long reg)
+static inline uint64_t apic_rdmsr(unsigned long reg)
 {
     uint64_t msr_content;
 
@@ -83,7 +83,7 @@ static __inline uint64_t apic_rdmsr(unsigned long reg)
     return msr_content;
 }
 
-static __inline void apic_write(unsigned long reg, u32 v)
+static inline void apic_write(unsigned long reg, u32 v)
 {
 
     if ( x2apic_enabled )
@@ -92,7 +92,7 @@ static __inline void apic_write(unsigned long reg, u32 v)
         apic_mem_write(reg, v);
 }
 
-static __inline u32 apic_read(unsigned long reg)
+static inline u32 apic_read(unsigned long reg)
 {
     if ( x2apic_enabled )
         return apic_rdmsr(reg);
@@ -100,7 +100,7 @@ static __inline u32 apic_read(unsigned long reg)
         return apic_mem_read(reg);
 }
 
-static __inline u64 apic_icr_read(void)
+static inline u64 apic_icr_read(void)
 {
     u32 lo, hi;
 
@@ -115,7 +115,7 @@ static __inline u64 apic_icr_read(void)
     return ((u64)lo) | (((u64)hi) << 32);
 }
 
-static __inline void apic_icr_write(u32 low, u32 dest)
+static inline void apic_icr_write(u32 low, u32 dest)
 {
     if ( x2apic_enabled )
         apic_wrmsr(APIC_ICR, low | ((uint64_t)dest << 32));
@@ -126,13 +126,13 @@ static __inline void apic_icr_write(u32 low, u32 dest)
     }
 }
 
-static __inline bool apic_isr_read(uint8_t vector)
+static inline bool apic_isr_read(uint8_t vector)
 {
     return (apic_read(APIC_ISR + ((vector & ~0x1f) >> 1)) >>
             (vector & 0x1f)) & 1;
 }
 
-static __inline u32 get_apic_id(void) /* Get the physical APIC id */
+static inline u32 get_apic_id(void)
 {
     u32 id = apic_read(APIC_ID);
     return x2apic_enabled ? id : GET_xAPIC_ID(id);
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index b0c860f0ec..3456d4c95f 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -148,7 +148,7 @@ extern int cpufreq_driver_getavg(unsigned int cpu, unsigned int flag);
 extern int cpufreq_update_turbo(int cpuid, int new_state);
 extern int cpufreq_get_turbo_status(int cpuid);
 
-static __inline__ int 
+static inline int
 __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event)
 {
     return policy->governor->governor(policy, event);
@@ -179,7 +179,7 @@ extern struct cpufreq_driver cpufreq_driver;
 
 int cpufreq_register_driver(const struct cpufreq_driver *);
 
-static __inline__
+static inline
 void cpufreq_verify_within_limits(struct cpufreq_policy *policy,
                                   unsigned int min, unsigned int max)
 {
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index edd6817d53..a88d45475c 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -127,7 +127,7 @@ static inline int generic_fls64(__u64 x)
 # endif
 #endif
 
-static __inline__ int get_bitmask_order(unsigned int count)
+static inline int get_bitmask_order(unsigned int count)
 {
     int order;
     
@@ -135,7 +135,7 @@ static __inline__ int get_bitmask_order(unsigned int count)
     return order;   /* We could be slightly more clever with -1 here... */
 }
 
-static __inline__ int get_count_order(unsigned int count)
+static inline int get_count_order(unsigned int count)
 {
     int order;
 
diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h
index 04b8bc18df..16d554f2a5 100644
--- a/xen/include/xen/compiler.h
+++ b/xen/include/xen/compiler.h
@@ -20,9 +20,8 @@
 #define likely(x)     __builtin_expect(!!(x),1)
 #define unlikely(x)   __builtin_expect(!!(x),0)
 
-#define inline        __inline__
-#define always_inline __inline__ __attribute__ ((__always_inline__))
-#define gnu_inline    __inline__ __attribute__ ((__gnu_inline__))
+#define always_inline inline __attribute__((__always_inline__))
+#define gnu_inline    inline __attribute__((__gnu_inline__))
 #define noinline      __attribute__((__noinline__))
 
 #define noreturn      __attribute__((__noreturn__))
@@ -83,7 +82,7 @@
  * inline functions not expanded inline get placed in .init.text.
  */
 #include <xen/init.h>
-#define __inline__ __inline__ __init
+#define inline inline __init
 #endif
 
 #define __attribute_pure__  __attribute__((__pure__))
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 25 01:11:07 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Nov 2023 01:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.641012.999831 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6hCJ-0000Nl-Dx; Sat, 25 Nov 2023 01:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 641012.999831; Sat, 25 Nov 2023 01:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6hCJ-0000Nd-BG; Sat, 25 Nov 2023 01:11:03 +0000
Received: by outflank-mailman (input) for mailman id 641012;
 Sat, 25 Nov 2023 01: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 1r6hCI-0000NU-46
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01: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 1r6hCI-0000uH-3D
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hCI-0000bM-1i
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01: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=m3dvlOIijLROj1h0oHI8wcxHUHqbDlwG+sId1UIILwg=; b=UTTVT4H4HgDnufuRw5LkKGCnpG
	/xHAXAytT09v2tjHkKjS65ED3ZEm2YKPtFM1+Bk1rQllScPu+Psl2viGmyFa826M/w0UH0ooBO5jq
	M/wpOeHulirZ7ySn+HLbOMJ7PvxXG4j2U3JGoxEB7ljX0V0JWtoxql3WXhZQjStz1aic=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/efi: Drop image_name from efi_arch_handle_cmdline()
Message-Id: <E1r6hCI-0000bM-1i@xenbits.xenproject.org>
Date: Sat, 25 Nov 2023 01:11:02 +0000

commit 5d4b948169691977361f2044471ba09450a25c78
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Nov 23 11:32:52 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Nov 23 17:21:00 2023 +0000

    xen/efi: Drop image_name from efi_arch_handle_cmdline()
    
    With all architectures no longer wanting an image name in the command line
    handling, drop the parameter and forgo making one up.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/arch/arm/efi/efi-boot.h |  3 +--
 xen/arch/x86/efi/efi-boot.h |  3 +--
 xen/common/efi/boot.c       | 15 +--------------
 3 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index 59d217667f..6e6db24455 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -454,8 +454,7 @@ static void __init efi_arch_memory_setup(void)
 {
 }
 
-static void __init efi_arch_handle_cmdline(CHAR16 *image_name,
-                                           CHAR16 *cmdline_options,
+static void __init efi_arch_handle_cmdline(CHAR16 *cmdline_options,
                                            const char *cfgfile_options)
 {
     union string name;
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 1a2a2dd83c..86467da301 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -303,8 +303,7 @@ static void __init efi_arch_cfg_file_late(const EFI_LOADED_IMAGE *image,
     }
 }
 
-static void __init efi_arch_handle_cmdline(CHAR16 *image_name,
-                                           CHAR16 *cmdline_options,
+static void __init efi_arch_handle_cmdline(CHAR16 *cmdline_options,
                                            const char *cfgfile_options)
 {
     union string name;
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index e5e86f22b2..6110819918 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -1462,21 +1462,8 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
             }
         }
 
-        /*
-         * EFI_LOAD_OPTION does not supply an image name as first component:
-         * Make one up.
-         */
-        if ( argc && !*argv )
-        {
-            EFI_FILE_HANDLE handle = get_parent_handle(loaded_image,
-                                                       &file_name);
-
-            handle->Close(handle);
-            *argv = file_name;
-        }
-
         name.s = get_value(&cfg, section.s, "options");
-        efi_arch_handle_cmdline(argc ? *argv : NULL, options, name.s);
+        efi_arch_handle_cmdline(options, name.s);
 
         if ( !base_video )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 25 01:11:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Nov 2023 01:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.641013.999834 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6hCT-0000Pv-FI; Sat, 25 Nov 2023 01:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 641013.999834; Sat, 25 Nov 2023 01: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 1r6hCT-0000Pn-Cd; Sat, 25 Nov 2023 01:11:13 +0000
Received: by outflank-mailman (input) for mailman id 641013;
 Sat, 25 Nov 2023 01:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hCS-0000Pb-9B
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01: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 1r6hCS-0000ul-7v
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hCS-0000bt-5F
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01: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=tlH1sEOp/qjRtKC/Fpkd5nd5oNO3kVih5LgKnIuK/zI=; b=TI24F84xLtb0xPLX7xxExTADQS
	T4NXWKWy0uweVIHoOy9AJNW5tQLk+uA7SLj6IaG/WxRuFeyfva4GOzOAh1r813mgyKsni5ByE89gO
	cb4/NgZx3K4mPshHBxt1ikclmySkgre72MQArQ568Y4NtzQznLEYpMO82Mlv8Je51SO8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/pygrub: add .gitignore file
Message-Id: <E1r6hCS-0000bt-5F@xenbits.xenproject.org>
Date: Sat, 25 Nov 2023 01:11:12 +0000

commit 9b1972dff546a8d8a5e9ed1bd8a047021a4c4169
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Nov 22 14:02:19 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Nov 23 17:21:00 2023 +0000

    tools/pygrub: add .gitignore file
    
    Add a local .gitignore file for tools/pygrub.
    
    As at least on some systems (e.g. OpenSUSE Leap 15.5) the build will
    produce a tools/pygrub/pygrub.egg-info directory, add it to the new
    .gitignore file, too.
    
    Use "/dir/" as pattern for ignoring a directory and its contents, as
    the "/dir/*" pattern won't ignore the directory itself (git just
    doesn't complain when seeing a directory without any not ignored file
    in it).
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 .gitignore              | 1 -
 tools/pygrub/.gitignore | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 2cea994934..3009545af2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -213,7 +213,6 @@ tools/misc/xencov
 tools/pkg-config/*
 tools/qemu-xen-build
 tools/xentrace/xenalyze
-tools/pygrub/build/*
 tools/python/build/*
 tools/tests/depriv/depriv-fd-checker
 tools/tests/x86_emulator/*.bin
diff --git a/tools/pygrub/.gitignore b/tools/pygrub/.gitignore
new file mode 100644
index 0000000000..4fdf23ed8e
--- /dev/null
+++ b/tools/pygrub/.gitignore
@@ -0,0 +1,2 @@
+/build/
+/pygrub.egg-info/
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 25 01:11:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Nov 2023 01:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.641014.999839 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6hCd-0000SI-HB; Sat, 25 Nov 2023 01:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 641014.999839; Sat, 25 Nov 2023 01: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 1r6hCd-0000SA-E4; Sat, 25 Nov 2023 01:11:23 +0000
Received: by outflank-mailman (input) for mailman id 641014;
 Sat, 25 Nov 2023 01:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hCc-0000S2-CP
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:11:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hCc-0000vD-BW
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hCc-0000cI-9y
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:11:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ArpeL9E7E1Abp+Iyunfh3IGXr39LZMrfo0DUkFbi5fY=; b=bJhXRRa2Ecxpo17cEy+8sk6M30
	50EKX32Sgl/T7W/EhxfLYfMTnmLznwGAyy0UvQrgAp9FRe7g7dZW8Q/zkasJY1BczmlV69x49/y8n
	+4EKGojX4k0V78I+vEXHtfF3tSDPNCITmwmJKDUz8O7EviWtqx+JzOygWdRMqrk16WgE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/python: add .gitignore file
Message-Id: <E1r6hCc-0000cI-9y@xenbits.xenproject.org>
Date: Sat, 25 Nov 2023 01:11:22 +0000

commit 16a0e16dab749bb50a95d93320d8c6b4b5544272
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Nov 22 14:02:20 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Nov 23 17:21:01 2023 +0000

    tools/python: add .gitignore file
    
    Add a local .gitignore file for tools/python.
    
    As at least on some systems (e.g. OpenSUSE Leap 15.5) the build will
    produce a tools/python/xen.egg-info directory, add it to the new
    .gitignore file, too.
    
    Use "/dir/" as pattern for ignoring a directory and its contents, as
    the "/dir/*" pattern won't ignore the directory itself (git just
    doesn't complain when seeing a directory without any not ignored file
    in it).
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 .gitignore              | 3 ---
 tools/python/.gitignore | 3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index 3009545af2..5b8f23271e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -213,7 +213,6 @@ tools/misc/xencov
 tools/pkg-config/*
 tools/qemu-xen-build
 tools/xentrace/xenalyze
-tools/python/build/*
 tools/tests/depriv/depriv-fd-checker
 tools/tests/x86_emulator/*.bin
 tools/tests/x86_emulator/*.tmp
@@ -370,8 +369,6 @@ tools/ocaml/test/raise_exception
 tools/debugger/kdd/kdd
 tools/firmware/etherboot/ipxe.tar.gz
 tools/firmware/etherboot/ipxe/
-tools/python/xen/lowlevel/xl/_pyxl_types.c
-tools/python/xen/lowlevel/xl/_pyxl_types.h
 tools/xl/xl
 
 docs/txt/misc/*.txt
diff --git a/tools/python/.gitignore b/tools/python/.gitignore
new file mode 100644
index 0000000000..e8545df68b
--- /dev/null
+++ b/tools/python/.gitignore
@@ -0,0 +1,3 @@
+/build/
+/xen.egg-info/
+/xen/lowlevel/xl/_pyxl_types.[ch]
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 25 01:11:34 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Nov 2023 01:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.641015.999842 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6hCo-0000Ve-Js; Sat, 25 Nov 2023 01:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 641015.999842; Sat, 25 Nov 2023 01: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 1r6hCo-0000VX-HP; Sat, 25 Nov 2023 01:11:34 +0000
Received: by outflank-mailman (input) for mailman id 641015;
 Sat, 25 Nov 2023 01:11:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hCm-0000V8-FP
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:11:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hCm-0000xL-EZ
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hCm-0000ch-DZ
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:11:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1bwqCRTCf2E+kQnWG+tqkrtMdleY6LVgtczuvDyA7LU=; b=nF/yzqrFcq+9p3jfu6sKsnP8r/
	RPBhXa8sMMduGRynmSVTACwNNTO3NOPg5y0MEdA29ANF/yyU90Fi99qpn7WF6CzE86wd4LdTcLAAP
	ITFWYCKtle3T6RUaENTRaUJ42KHWNZX9t59WdcYMY90eg/N80djCGl0MAaeneKfbYE1g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/pygrub: Set mount propagation to private recursively
Message-Id: <E1r6hCm-0000ch-DZ@xenbits.xenproject.org>
Date: Sat, 25 Nov 2023 01:11:32 +0000

commit c789c7ff7e67c1e385c09140c9192dc5f470b7ec
Author:     Alejandro Vallejo <alejandro.vallejo@cloud.com>
AuthorDate: Mon Nov 6 15:05:03 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Nov 23 17:21:01 2023 +0000

    tools/pygrub: Set mount propagation to private recursively
    
    This is important in order for every mount done inside a mount namespace to
    go away after the namespace itself goes away. The comment referring to
    unreliability in Linux 4.19 was just wrong.
    
    This patch sets the story straight and makes the depriv pygrub a bit more
    confined should a layer of the onion be vulnerable.
    
    Fixes: e0342ae5556f ("tools/pygrub: Deprivilege pygrub")
    Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/pygrub/src/pygrub | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index 541e562327..08540ad288 100755
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -55,6 +55,12 @@ def unshare(flags):
     if unshare(flags) < 0:
         raise OSError(ctypes.get_errno(), os.strerror(ctypes.get_errno()))
 
+    # It's very typical for systemd to mount / with MS_SHARED. That means
+    # any events in the new namespace get propagated back to the parent.
+    #
+    # Undo it so that every mount done in the NS stay confined within it.
+    subprocess.check_output(["mount", "--make-rprivate", "/"])
+
 def bind_mount(src, dst, options):
     open(dst, "a").close() # touch
 
@@ -113,11 +119,9 @@ def depriv(output_directory, output, device, uid, path_kernel, path_ramdisk):
             if rc != 0 or os.path.getsize(path) == 0:
                 os.unlink(path)
 
-        # Normally, unshare(CLONE_NEWNS) will ensure this is not required.
-        # However, this syscall doesn't exist in *BSD systems and doesn't
-        # auto-unmount everything on older Linux kernels (At least as of
-        # Linux 4.19, but it seems fixed in 5.15). Either way,
-        # recursively unmount everything if needed. Quietly.
+        # Unshare(CLONE_NEWNS) ensures this is not required, but that's not
+        # present on *BSD, so recursively unmount everything if needed.
+        # Quietly.
         with open('/dev/null', 'w') as devnull:
             subprocess.call(["umount", "-f", chroot + device_path],
                             stdout=devnull, stderr=devnull)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 25 01:11:44 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Nov 2023 01:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.641016.999847 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6hCy-0000aB-La; Sat, 25 Nov 2023 01:11:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 641016.999847; Sat, 25 Nov 2023 01: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 1r6hCy-0000Zm-Ip; Sat, 25 Nov 2023 01:11:44 +0000
Received: by outflank-mailman (input) for mailman id 641016;
 Sat, 25 Nov 2023 01:11:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hCw-0000Zc-Od
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:11:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hCw-0000xm-Hd
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hCw-0000dB-Ge
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:11:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pJXCHIY3mFPUC34HgIBA6m3qVrFxD6r/oCa4+wh5RrA=; b=Om+0c2GVpPFbrWOjjnlSG1am/2
	0al5byLOXW33u55OkEjKAEJM2Gc5/A5/Lja5plZ1KFSdRpgHSzJ4pkRE/v9Mq/1Ak7+RJ5RAPvg/3
	j/lQzzgKEPz2eF8YpBBYOW50C1eTbT0bgmRJ0MQyeGAQcBTEJNEIuHr8M12HLnLyjGSs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/pygrub: Fix bug in LIMIT_FSIZE env variable override
Message-Id: <E1r6hCw-0000dB-Ge@xenbits.xenproject.org>
Date: Sat, 25 Nov 2023 01:11:42 +0000

commit de577641cf4fc4c3b3ee89c3ee44304cadd8c65c
Author:     Alejandro Vallejo <alejandro.vallejo@cloud.com>
AuthorDate: Mon Nov 6 15:05:04 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Nov 23 17:21:01 2023 +0000

    tools/pygrub: Fix bug in LIMIT_FSIZE env variable override
    
    The env variable must be interpreted as an integer. As it is, the override
    logic simply causes an exception.
    
    Fixes: e0342ae5556f ("tools/pygrub: Deprivilege pygrub")
    Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/pygrub/src/pygrub | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index 08540ad288..327cf51774 100755
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -89,7 +89,7 @@ def downgrade_rlimits():
     # write permissions are bound.
     fsize = LIMIT_FSIZE
     if "PYGRUB_MAX_FILE_SIZE_MB" in os.environ.keys():
-        fsize = os.environ["PYGRUB_MAX_FILE_SIZE_MB"] << 20
+        fsize = int(os.environ["PYGRUB_MAX_FILE_SIZE_MB"]) << 20
 
     resource.setrlimit(resource.RLIMIT_FSIZE, (fsize, fsize))
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 25 01:11:54 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Nov 2023 01:11:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.641017.999851 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6hD8-0000dS-NB; Sat, 25 Nov 2023 01:11:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 641017.999851; Sat, 25 Nov 2023 01: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 1r6hD8-0000dK-KD; Sat, 25 Nov 2023 01:11:54 +0000
Received: by outflank-mailman (input) for mailman id 641017;
 Sat, 25 Nov 2023 01:11:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hD6-0000cw-LT
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:11:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hD6-0000yG-Ki
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hD6-0000dj-Jk
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:11:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OkVU8HFXc86zNAjvtBCXuqDib5Qe/knTIrSweB3VZX8=; b=u1LaqNvnWGInED07irTOGtFScM
	N9zEk+bZmcQdK9BmpOrQ1xVl5qRbORKlPQGF1rLSTdbDWaCoig06YNCG4OMFimfhYmpFHQ22hzJS8
	XXannunxgnnQBqfi0hERqAGq/QrKXgtF5JrDzJe486nU7Y7Hhu59IN2OstLg1WxIS3ns=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/pygrub: Fix expression before it's copied elsewhere
Message-Id: <E1r6hD6-0000dj-Jk@xenbits.xenproject.org>
Date: Sat, 25 Nov 2023 01:11:52 +0000

commit 2d63785a8ae0a19ceded010367df675d618ea340
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 22 20:02:17 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Nov 23 17:21:01 2023 +0000

    tools/pygrub: Fix expression before it's copied elsewhere
    
    This has an identical meaning, and is the more pythonic way of writing it.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
 tools/pygrub/src/pygrub | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index 327cf51774..2c06684d65 100755
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -88,7 +88,7 @@ def downgrade_rlimits():
     # filesystem we set RLIMIT_FSIZE to a high bound, so that the file
     # write permissions are bound.
     fsize = LIMIT_FSIZE
-    if "PYGRUB_MAX_FILE_SIZE_MB" in os.environ.keys():
+    if "PYGRUB_MAX_FILE_SIZE_MB" in os.environ:
         fsize = int(os.environ["PYGRUB_MAX_FILE_SIZE_MB"]) << 20
 
     resource.setrlimit(resource.RLIMIT_FSIZE, (fsize, fsize))
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 25 01:12:03 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Nov 2023 01:12:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.641018.999855 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6hDH-0000h3-O6; Sat, 25 Nov 2023 01:12:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 641018.999855; Sat, 25 Nov 2023 01:12:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6hDH-0000gu-LV; Sat, 25 Nov 2023 01:12:03 +0000
Received: by outflank-mailman (input) for mailman id 641018;
 Sat, 25 Nov 2023 01:12:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hDG-0000gj-OP
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:12:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hDG-0000zI-Nb
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:12:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hDG-0000eg-Mo
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:12:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jzKWgV9ExzGGdB6dy8hkJm4SLEs66+b+SzJFAF4ed6U=; b=ySmbOITw3bay7+pPbx1pCT6S4K
	GfES1IJZ/rzfDsOSNmTbHsa4y4BLdC2nFp4u5DxBKuMyEsXFELBrJDFTpxXFg7n8/HX9HS98TXtAf
	5F50GJe4ftlFRt3OFSAfcI3pbmkkziv6k+iknJmzJXqYU/u2O1qal9NmWnGr7sLAIsQM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/pygrub: Restrict depriv operation with RLIMIT_AS
Message-Id: <E1r6hDG-0000eg-Mo@xenbits.xenproject.org>
Date: Sat, 25 Nov 2023 01:12:02 +0000

commit 03d6720a4c62c283f9a9f09858eeccd24299b312
Author:     Alejandro Vallejo <alejandro.vallejo@cloud.com>
AuthorDate: Mon Nov 6 15:05:05 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Nov 23 17:21:01 2023 +0000

    tools/pygrub: Restrict depriv operation with RLIMIT_AS
    
    Prevents the depriv pygrub from consuming more than a fixed amount of
    memory.
    
    Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/pygrub/src/pygrub | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index 2c06684d65..9d51f96070 100755
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -39,6 +39,11 @@ SECTOR_SIZE = 512
 # pygrub
 LIMIT_FSIZE = 128 << 20
 
+# Unless provided through the env variable PYGRUB_MAX_RAM_USAGE_MB, then
+# this is the maximum amount of memory allowed to be used by the depriv
+# pygrub.
+LIMIT_AS = 2 * LIMIT_FSIZE
+
 CLONE_NEWNS = 0x00020000 # mount namespace
 CLONE_NEWNET = 0x40000000 # network namespace
 CLONE_NEWIPC = 0x08000000 # IPC namespace
@@ -75,6 +80,11 @@ def downgrade_rlimits():
     resource.setrlimit(resource.RLIMIT_CORE,     (0, 0))
     resource.setrlimit(resource.RLIMIT_MEMLOCK,  (0, 0))
 
+    max_ram_usage = LIMIT_AS
+    if "PYGRUB_MAX_RAM_USAGE_MB" in os.environ:
+        max_ram_usage = int(os.environ["PYGRUB_MAX_RAM_USAGE_MB"]) << 20
+    resource.setrlimit(resource.RLIMIT_AS,  (max_ram_usage, max_ram_usage))
+
     # py2's resource module doesn't know about resource.RLIMIT_MSGQUEUE
     #
     # TODO: Use resource.RLIMIT_MSGQUEUE after python2 is deprecated
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 25 01:12:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Nov 2023 01:12:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.641019.999858 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6hDR-0000jL-PP; Sat, 25 Nov 2023 01:12:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 641019.999858; Sat, 25 Nov 2023 01:12:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6hDR-0000jE-My; Sat, 25 Nov 2023 01:12:13 +0000
Received: by outflank-mailman (input) for mailman id 641019;
 Sat, 25 Nov 2023 01:12:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hDQ-0000j4-Re
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:12:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hDQ-0000zq-Qs
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:12:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hDQ-0000f5-Pr
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:12:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tnnktrD4fVAOr1Cz4tEOHaK/IThTXqICONKuIcoWP5k=; b=XHP6qADNFQiMsOl22ZjLy5Phym
	YjCTZN5BcFLDdNJH+nmpZyY40zK31oqIFIpqpaFxh1ShZs8kodN2Aa3LpT/BQ53hRKayIMJLz8x+e
	RJohnajUugCybnsBp8HyEc4PxxCVGS5oVke9oUrkOTNIHuS9kmoCOK4ckSoP/08nTYS0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86emul/test: fold AVX512VL scatter/gather test blobs with AVX512F ones
Message-Id: <E1r6hDQ-0000f5-Pr@xenbits.xenproject.org>
Date: Sat, 25 Nov 2023 01:12:12 +0000

commit f02829592efe4f55f6d95bb9e2359717109e8ebc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Nov 24 08:57:10 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 24 08:57:10 2023 +0100

    x86emul/test: fold AVX512VL scatter/gather test blobs with AVX512F ones
    
    Everywhere else the VL tests are grouped with the basic ones,
    distinguished simply by the "form" specifiers.
    
    No change to the generated test blobs, and hence no functional change.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/tests/x86_emulator/Makefile            |  8 ++-----
 tools/tests/x86_emulator/test_x86_emulator.c | 33 ++++++++++++++--------------
 2 files changed, 18 insertions(+), 23 deletions(-)

diff --git a/tools/tests/x86_emulator/Makefile b/tools/tests/x86_emulator/Makefile
index affabc0277..b45ad09c28 100644
--- a/tools/tests/x86_emulator/Makefile
+++ b/tools/tests/x86_emulator/Makefile
@@ -18,7 +18,7 @@ CFLAGS += $(CFLAGS_xeninclude)
 
 SIMD := 3dnow sse sse2 sse4 avx avx2 xop avx512f avx512bw avx512dq avx512er avx512vbmi avx512fp16
 FMA := fma4 fma
-SG := avx2-sg avx512f-sg avx512vl-sg
+SG := avx2-sg avx512f-sg
 AES := ssse3-aes avx-aes avx2-vaes avx512bw-vaes
 CLMUL := ssse3-pclmul avx-pclmul avx2-vpclmulqdq avx512bw-vpclmulqdq avx512vbmi2-vpclmulqdq
 SHA := sse4-sha avx-sha avx512f-sha
@@ -70,14 +70,10 @@ xop-flts := $(avx-flts)
 avx512f-vecs := 64 16 32
 avx512f-ints := 4 8
 avx512f-flts := 4 8
-avx512f-sg-vecs := 64
+avx512f-sg-vecs := $(avx512f-vecs)
 avx512f-sg-idxs := 4 8
 avx512f-sg-ints := $(avx512f-ints)
 avx512f-sg-flts := $(avx512f-flts)
-avx512vl-sg-vecs := 16 32
-avx512vl-sg-idxs := $(avx512f-sg-idxs)
-avx512vl-sg-ints := $(avx512f-ints)
-avx512vl-sg-flts := $(avx512f-flts)
 avx512bw-vecs := $(avx512f-vecs)
 avx512bw-ints := 1 2
 avx512bw-flts :=
diff --git a/tools/tests/x86_emulator/test_x86_emulator.c b/tools/tests/x86_emulator/test_x86_emulator.c
index 0757bd48b8..41002909f5 100644
--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -34,7 +34,6 @@ asm ( ".pushsection .test, \"ax\", @progbits; .popsection" );
 #include "avx512f.h"
 #include "avx512f-sg.h"
 #include "avx512f-sha.h"
-#include "avx512vl-sg.h"
 #include "avx512bw.h"
 #include "avx512bw-vaes.h"
 #include "avx512bw-vpclmulqdq.h"
@@ -462,22 +461,22 @@ static const struct {
     AVX512VL(VL u64x2,        avx512f,      16u8),
     AVX512VL(VL s64x4,        avx512f,      32i8),
     AVX512VL(VL u64x4,        avx512f,      32u8),
-    SIMD(AVX512VL S/G f32[4x32], avx512vl_sg, 16x4f4),
-    SIMD(AVX512VL S/G f64[2x32], avx512vl_sg, 16x4f8),
-    SIMD(AVX512VL S/G f32[2x64], avx512vl_sg, 16x8f4),
-    SIMD(AVX512VL S/G f64[2x64], avx512vl_sg, 16x8f8),
-    SIMD(AVX512VL S/G f32[8x32], avx512vl_sg, 32x4f4),
-    SIMD(AVX512VL S/G f64[4x32], avx512vl_sg, 32x4f8),
-    SIMD(AVX512VL S/G f32[4x64], avx512vl_sg, 32x8f4),
-    SIMD(AVX512VL S/G f64[4x64], avx512vl_sg, 32x8f8),
-    SIMD(AVX512VL S/G i32[4x32], avx512vl_sg, 16x4i4),
-    SIMD(AVX512VL S/G i64[2x32], avx512vl_sg, 16x4i8),
-    SIMD(AVX512VL S/G i32[2x64], avx512vl_sg, 16x8i4),
-    SIMD(AVX512VL S/G i64[2x64], avx512vl_sg, 16x8i8),
-    SIMD(AVX512VL S/G i32[8x32], avx512vl_sg, 32x4i4),
-    SIMD(AVX512VL S/G i64[4x32], avx512vl_sg, 32x4i8),
-    SIMD(AVX512VL S/G i32[4x64], avx512vl_sg, 32x8i4),
-    SIMD(AVX512VL S/G i64[4x64], avx512vl_sg, 32x8i8),
+    SIMD(AVX512VL S/G f32[4x32], avx512f_sg, 16x4f4),
+    SIMD(AVX512VL S/G f64[2x32], avx512f_sg, 16x4f8),
+    SIMD(AVX512VL S/G f32[2x64], avx512f_sg, 16x8f4),
+    SIMD(AVX512VL S/G f64[2x64], avx512f_sg, 16x8f8),
+    SIMD(AVX512VL S/G f32[8x32], avx512f_sg, 32x4f4),
+    SIMD(AVX512VL S/G f64[4x32], avx512f_sg, 32x4f8),
+    SIMD(AVX512VL S/G f32[4x64], avx512f_sg, 32x8f4),
+    SIMD(AVX512VL S/G f64[4x64], avx512f_sg, 32x8f8),
+    SIMD(AVX512VL S/G i32[4x32], avx512f_sg, 16x4i4),
+    SIMD(AVX512VL S/G i64[2x32], avx512f_sg, 16x4i8),
+    SIMD(AVX512VL S/G i32[2x64], avx512f_sg, 16x8i4),
+    SIMD(AVX512VL S/G i64[2x64], avx512f_sg, 16x8i8),
+    SIMD(AVX512VL S/G i32[8x32], avx512f_sg, 32x4i4),
+    SIMD(AVX512VL S/G i64[4x32], avx512f_sg, 32x4i8),
+    SIMD(AVX512VL S/G i32[4x64], avx512f_sg, 32x8i4),
+    SIMD(AVX512VL S/G i64[4x64], avx512f_sg, 32x8i8),
     SIMD(AVX512BW s8x64,     avx512bw,      64i1),
     SIMD(AVX512BW u8x64,     avx512bw,      64u1),
     SIMD(AVX512BW s16x32,    avx512bw,      64i2),
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 25 01:12:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Nov 2023 01:12:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.641020.999862 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6hDb-0000mI-Qy; Sat, 25 Nov 2023 01:12:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 641020.999862; Sat, 25 Nov 2023 01:12:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6hDb-0000mB-OQ; Sat, 25 Nov 2023 01:12:23 +0000
Received: by outflank-mailman (input) for mailman id 641020;
 Sat, 25 Nov 2023 01:12:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hDa-0000ly-Ui
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:12:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hDa-00010M-Ts
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:12:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hDa-0000fW-Su
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:12:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UO1er45Tn3XPiANM7dU7P3ECBsIrq2nAX/MzKLNBaqQ=; b=iYnEhgeKh3Xjso0tmD6HvHE3uI
	nykWA2YAVm5ihLm1C7mFKHJhIYyep18WBZ1WU4Vnhw0eVyVYydct+7nc5n3ztzdLAaZeg4macpCKl
	qEX+juh88jGT2bgoNmrZ4oycElgJz5YAR1v/Q91D3aZ6Gr8JTJLBRbW7JvyaTD6BKfYg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/pdx: amend definition of PDX_GROUP_COUNT
Message-Id: <E1r6hDa-0000fW-Su@xenbits.xenproject.org>
Date: Sat, 25 Nov 2023 01:12:22 +0000

commit 02d754aa5503496a080137573b2f2d11eed698c0
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Fri Nov 24 09:00:54 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 24 09:00:54 2023 +0100

    xen/pdx: amend definition of PDX_GROUP_COUNT
    
    The definition of PDX_GROUP_COUNT causes violations of
    MISRA C:2012 Rule 10.1, therefore the problematic part now uses
    the ISOLATE_LSB macro, which encapsulates the pattern.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/include/xen/pdx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/xen/pdx.h b/xen/include/xen/pdx.h
index bd535009ea..23f3956db8 100644
--- a/xen/include/xen/pdx.h
+++ b/xen/include/xen/pdx.h
@@ -70,7 +70,7 @@
 extern unsigned long max_pdx;
 
 #define PDX_GROUP_COUNT ((1 << PDX_GROUP_SHIFT) / \
-                         (sizeof(*frame_table) & -sizeof(*frame_table)))
+                         (ISOLATE_LSB(sizeof(*frame_table))))
 extern unsigned long pdx_group_valid[];
 
 /**
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 25 01:12:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Nov 2023 01:12:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.641021.999867 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6hDl-0000on-Se; Sat, 25 Nov 2023 01:12:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 641021.999867; Sat, 25 Nov 2023 01:12: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 1r6hDl-0000of-Q7; Sat, 25 Nov 2023 01:12:33 +0000
Received: by outflank-mailman (input) for mailman id 641021;
 Sat, 25 Nov 2023 01: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 1r6hDl-0000oV-1R
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01: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 1r6hDl-00010u-0W
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:12:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hDk-0000gR-Vs
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:12:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=x+Jw8UjrejqzhMueDxjhzaWNO+VgPI/BKmnLwPpOiN8=; b=Ig5s8wPbk2meB6/oeIFShpr4Q8
	WBOaFZs6AEiPPyD7VO1JbxODBQalgXQDxkaiDCnhFghPQ4gux1FlSyc5dpIkOG+bo9ITzqOCIyD61
	mMqbN7tVuGF6X1rGZOV68G8Vu1NH9P6Iotcg/2yl76uYALo8XVxlxY6EVtPk8AIWTRV0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86_64/mm: express macro CNT using ISOLATE_LSB
Message-Id: <E1r6hDk-0000gR-Vs@xenbits.xenproject.org>
Date: Sat, 25 Nov 2023 01:12:32 +0000

commit de4f3cf32759b7b9a18db2250a440bdeae17288b
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Fri Nov 24 09:02:09 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 24 09:02:09 2023 +0100

    x86_64/mm: express macro CNT using ISOLATE_LSB
    
    The various definitions of macro CNT (and the related BUILD_BUG_ON)
    can be rewritten using ISOLATE_LSB, encapsulating a violation of
    MISRA C:2012 Rule 10.1.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/x86_64/mm.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index c3ebb77714..b2a280fba3 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -351,9 +351,9 @@ static int setup_compat_m2p_table(struct mem_hotadd_info *info)
                 ~((1UL << (L2_PAGETABLE_SHIFT - 2)) - 1) );
 
 #define MFN(x) (((x) << L2_PAGETABLE_SHIFT) / sizeof(unsigned int))
-#define CNT ((sizeof(*frame_table) & -sizeof(*frame_table)) / \
+#define CNT (ISOLATE_LSB(sizeof(*frame_table)) / \
              sizeof(*compat_machine_to_phys_mapping))
-    BUILD_BUG_ON((sizeof(*frame_table) & -sizeof(*frame_table)) % \
+    BUILD_BUG_ON(ISOLATE_LSB(sizeof(*frame_table)) % \
                  sizeof(*compat_machine_to_phys_mapping));
 
     for ( i = smap; i < emap; i += (1UL << (L2_PAGETABLE_SHIFT - 2)) )
@@ -410,10 +410,10 @@ static int setup_m2p_table(struct mem_hotadd_info *info)
     va = RO_MPT_VIRT_START + smap * sizeof(*machine_to_phys_mapping);
 
 #define MFN(x) (((x) << L2_PAGETABLE_SHIFT) / sizeof(unsigned long))
-#define CNT ((sizeof(*frame_table) & -sizeof(*frame_table)) / \
+#define CNT (ISOLATE_LSB(sizeof(*frame_table)) / \
              sizeof(*machine_to_phys_mapping))
 
-    BUILD_BUG_ON((sizeof(*frame_table) & -sizeof(*frame_table)) % \
+    BUILD_BUG_ON(ISOLATE_LSB(sizeof(*frame_table)) % \
                  sizeof(*machine_to_phys_mapping));
 
     i = smap;
@@ -539,7 +539,7 @@ void __init paging_init(void)
     mpt_size  = (max_page * BYTES_PER_LONG) + (1UL << L2_PAGETABLE_SHIFT) - 1;
     mpt_size &= ~((1UL << L2_PAGETABLE_SHIFT) - 1UL);
 #define MFN(x) (((x) << L2_PAGETABLE_SHIFT) / sizeof(unsigned long))
-#define CNT ((sizeof(*frame_table) & -sizeof(*frame_table)) / \
+#define CNT (ISOLATE_LSB(sizeof(*frame_table)) / \
              sizeof(*machine_to_phys_mapping))
     BUILD_BUG_ON((sizeof(*frame_table) & ~sizeof(*frame_table)) % \
                  sizeof(*machine_to_phys_mapping));
@@ -666,7 +666,7 @@ void __init paging_init(void)
         mpt_size = 0;
 
 #define MFN(x) (((x) << L2_PAGETABLE_SHIFT) / sizeof(unsigned int))
-#define CNT ((sizeof(*frame_table) & -sizeof(*frame_table)) / \
+#define CNT (ISOLATE_LSB(sizeof(*frame_table)) / \
              sizeof(*compat_machine_to_phys_mapping))
     BUILD_BUG_ON((sizeof(*frame_table) & ~sizeof(*frame_table)) % \
                  sizeof(*compat_machine_to_phys_mapping));
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 25 01:12:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Nov 2023 01:12:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.641022.999871 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6hDv-0000s9-VO; Sat, 25 Nov 2023 01:12:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 641022.999871; Sat, 25 Nov 2023 01:12: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 1r6hDv-0000s1-Sn; Sat, 25 Nov 2023 01:12:43 +0000
Received: by outflank-mailman (input) for mailman id 641022;
 Sat, 25 Nov 2023 01: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 1r6hDv-0000rp-4E
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01: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 1r6hDv-00011Q-3V
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:12:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hDv-0000h2-2S
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01: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=aDwdwj1g2Lwb/JHO7oCij36JnAiP4DnlNXYkxDkxwa8=; b=YdWbJE2pO95mw2U9BU3hVrErFO
	XCZUd3Mr+YysS2rSCJ8/r2glqJR6llTuCFv/VjoXvUtEBwBo7O7TnIVroJ7Cnj94frmSTgFtj6a9y
	jZYvkddRUmi4E1E6cI9cX3Dv/AyCXO3zdWLxgN/TjeNg66XLqlImogfzMu8E8AmnsgTA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/vmap: use ISOLATE_LSB to wrap a violation of Rule 10.1
Message-Id: <E1r6hDv-0000h2-2S@xenbits.xenproject.org>
Date: Sat, 25 Nov 2023 01:12:43 +0000

commit 80d72670add5f98eb0bde1b2f7f2e3e94119df49
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Fri Nov 24 09:02:34 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 24 09:02:34 2023 +0100

    xen/vmap: use ISOLATE_LSB to wrap a violation of Rule 10.1
    
    No functional change.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/vmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/vmap.c b/xen/common/vmap.c
index 4fd6b3067e..330e2ba897 100644
--- a/xen/common/vmap.c
+++ b/xen/common/vmap.c
@@ -53,7 +53,7 @@ static void *vm_alloc(unsigned int nr, unsigned int align,
     if ( !align )
         align = 1;
     else if ( align & (align - 1) )
-        align &= -align;
+        align = ISOLATE_LSB(align);
 
     ASSERT((t >= VMAP_DEFAULT) && (t < VMAP_REGION_NR));
     if ( !vm_base[t] )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 25 01:12:54 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Nov 2023 01:12:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.641023.999874 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6hE6-0000vF-1h; Sat, 25 Nov 2023 01:12:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 641023.999874; Sat, 25 Nov 2023 01:12:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6hE5-0000v7-VF; Sat, 25 Nov 2023 01:12:53 +0000
Received: by outflank-mailman (input) for mailman id 641023;
 Sat, 25 Nov 2023 01: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 1r6hE5-0000us-77
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01: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 1r6hE5-00011z-6L
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:12:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hE5-0000hX-5S
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01: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=P3J5C5Tt5WR1um7ll0LHnh8QAjvuEs6r6RtHVhobCKA=; b=2IV3bpvRrO+J499TfbResk5ZMl
	impdGnnT2WA/Ip5rXa7bTDAt+/oV+vFYqK6X5UcGVrShYkm6yezpnlA8di93OCQRvnp6Z+5Pb/auO
	DJ6WdyiGEf/vYrgnRMCUfabjcPz3I3EuWl1jTCHaMpY1B5vm8ikXqD8JM6eDseeSZkLA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/iommu: use ISOLATE_LSB to wrap a violation of Rule 10.1
Message-Id: <E1r6hE5-0000hX-5S@xenbits.xenproject.org>
Date: Sat, 25 Nov 2023 01:12:53 +0000

commit 9b3476f13eade87f5335decc24d61304250a6d3c
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Fri Nov 24 09:03:16 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 24 09:03:16 2023 +0100

    xen/iommu: use ISOLATE_LSB to wrap a violation of Rule 10.1
    
    No functional change.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index f9a9f53dbd..996c31be12 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -560,7 +560,7 @@ int __init iommu_setup(void)
         rc = iommu_hardware_setup();
         if ( !rc )
             ops = iommu_get_ops();
-        if ( ops && (ops->page_sizes & -ops->page_sizes) != PAGE_SIZE )
+        if ( ops && (ISOLATE_LSB(ops->page_sizes)) != PAGE_SIZE )
         {
             printk(XENLOG_ERR "IOMMU: page size mask %lx unsupported\n",
                    ops->page_sizes);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 25 01:13:04 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Nov 2023 01:13:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.641024.999878 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6hEG-0000xl-36; Sat, 25 Nov 2023 01:13:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 641024.999878; Sat, 25 Nov 2023 01:13:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6hEG-0000xe-0P; Sat, 25 Nov 2023 01:13:04 +0000
Received: by outflank-mailman (input) for mailman id 641024;
 Sat, 25 Nov 2023 01:13:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hEF-0000xY-A2
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:13:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hEF-00012t-9F
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:13:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hEF-0000i5-8J
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01: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=IUynYrBNfeIAtDkiftBG54c5sj0Yd+dwi+FgAUf2IFs=; b=RstQHFoF6C17Hi0lDkvYdEEcFv
	mwIZ/BQnTSjRXHfXdVRFajnr4RSIbM7gxD2GkmmkG6q856b2qum0MsfFhHAgNb/Rl5q17xZU7BXnY
	eMiRvP0KQA9aPs0kw/XLcd/1yfM9h4a7V6KCAmaVe/zP302WDHoRKoeP7enmtoYoY5z8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/vPIC: correct vpic_domain()
Message-Id: <E1r6hEF-0000i5-8J@xenbits.xenproject.org>
Date: Sat, 25 Nov 2023 01:13:03 +0000

commit a66b02a6b6bb73232a4fe2cd6f9ed970f34fd157
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Nov 24 09:04:09 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 24 09:04:09 2023 +0100

    x86/vPIC: correct vpic_domain()
    
    Make it use its parameter in both places.
    
    Fixes: 00a70f44a68c ("[HVM] Update VPIC device model for new interrupt delivery code")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hvm/vpic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
index 2be1cd5855..938d611361 100644
--- a/xen/arch/x86/hvm/vpic.c
+++ b/xen/arch/x86/hvm/vpic.c
@@ -35,7 +35,7 @@
 #include <asm/hvm/save.h>
 
 #define vpic_domain(v) (container_of((v), struct domain, \
-                        arch.hvm.vpic[!vpic->is_master]))
+                                     arch.hvm.vpic[!(v)->is_master]))
 #define __vpic_lock(v) &container_of((v), struct hvm_domain, \
                                         vpic[!(v)->is_master])->irq_lock
 #define vpic_lock(v)   spin_lock(__vpic_lock(v))
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Nov 25 01:13:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Nov 2023 01:13:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.641025.999883 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r6hEQ-00010H-4Z; Sat, 25 Nov 2023 01:13:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 641025.999883; Sat, 25 Nov 2023 01: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 1r6hEQ-000109-1z; Sat, 25 Nov 2023 01:13:14 +0000
Received: by outflank-mailman (input) for mailman id 641025;
 Sat, 25 Nov 2023 01: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 1r6hEP-0000zz-D4
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01: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 1r6hEP-00013N-CE
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01:13:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r6hEP-0000iW-BM
 for xen-changelog@lists.xenproject.org; Sat, 25 Nov 2023 01: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=IL1VpKMkXSQpLpUzFQb9mCdYHXM0kcqcugiM1d1Yq2o=; b=BqdhuTmpXtRiNmh8o6AoQushZa
	ufFWnQapTpN5xaNvKxwKG2QdAEl+YO00sgcE52hIwF2OAZfD4C1QYdoJH9YT/7jZe1jndgR/nBm8n
	0RofT2ZSBIT/fqoiWRw91sjDhAl5kyc3pMhliSPcWNZm7g+LKpLTuZmEbRv9PogTrzDM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/sort: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r6hEP-0000iW-BM@xenbits.xenproject.org>
Date: Sat, 25 Nov 2023 01:13:13 +0000

commit 80c153c48b255bae61948827241c26671207cf4e
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Fri Nov 24 09:04:57 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 24 09:04:57 2023 +0100

    xen/sort: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/sort.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/xen/sort.h b/xen/include/xen/sort.h
index 2f52ff85b9..b953286284 100644
--- a/xen/include/xen/sort.h
+++ b/xen/include/xen/sort.h
@@ -23,8 +23,8 @@
 extern gnu_inline
 #endif
 void sort(void *base, size_t num, size_t size,
-          int (*cmp)(const void *, const void *),
-          void (*swap)(void *, void *, size_t))
+          int (*cmp)(const void *a, const void *b),
+          void (*swap)(void *a, void *b, size_t size))
 {
     /* pre-scale counters for performance */
     size_t i = (num / 2) * size, n = num * size, c, r;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:33:11 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:33:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644611.1005828 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gE4-0006Ed-1M; Thu, 30 Nov 2023 12:33:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644611.1005828; Thu, 30 Nov 2023 12: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 1r8gE3-0006EW-Uf; Thu, 30 Nov 2023 12:33:03 +0000
Received: by outflank-mailman (input) for mailman id 644611;
 Thu, 30 Nov 2023 12: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 1r8gE2-0006EQ-3v
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12: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 1r8gE1-0005PK-UT
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gE1-0005Hl-RZ
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12: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=HIfM/Uj+PqGSfDzBGUTqa2waHiXv7aOMXEyz8TZ+mdA=; b=jQ5xFT5SPRFtBXCfMHI7Eah5Cg
	3oabjOmlP8BkH1QOfKVE1d2KtlN9LSWVHSNtNjFDEq7G9Jcrx9hH3mSSAk4RIoFZee1uRAZc/4b0l
	ppBu9HoyeUtbu1s9VXZgC/UehtIT65cI43dOg03fu7aGSnpqL+ho2zdgJaR7pdHAcg/Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mem_sharing: Fix typo in comment
Message-Id: <E1r8gE1-0005Hl-RZ@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:33:01 +0000

commit b9eeb1992676ec83cee285b97fee94d03eaa9836
Author:     Frediano Ziglio <frediano.ziglio@cloud.com>
AuthorDate: Wed Nov 22 16:26:20 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Nov 27 12:05:58 2023 +0000

    x86/mem_sharing: Fix typo in comment
    
    ambigious -> ambiguous
    
    Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/mm/mem_sharing.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 142258f16a..9647e651f9 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1123,7 +1123,7 @@ err_out:
 /*
  * This function is intended to be used for plugging a "hole" in the client's
  * physmap with a shared memory entry. Unfortunately the definition of a "hole"
- * is currently ambigious. There are two cases one can run into a "hole":
+ * is currently ambiguous. There are two cases one can run into a "hole":
  *  1) there is no pagetable entry at all
  *  2) there is a pagetable entry with a type that passes p2m_is_hole
  *
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:33:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644612.1005831 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gEE-0006Kn-2Z; Thu, 30 Nov 2023 12:33:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644612.1005831; Thu, 30 Nov 2023 12: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 1r8gEE-0006Kg-09; Thu, 30 Nov 2023 12:33:14 +0000
Received: by outflank-mailman (input) for mailman id 644612;
 Thu, 30 Nov 2023 12: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 1r8gEC-0006KW-47
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12: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 1r8gEC-0005PO-1S
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gEC-0005IA-0S
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12: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=QvkzxLebQt/90Xtx2GF1gWN85bHh7vgD5ixucjNyN1A=; b=3LBzIFcPa0mnykRTF86Y8l2QmV
	EiskG4ki9hzvWogiCOU49GVw1B3c7hBok64uIxrNSQo4dkXUxQCH7HrC03FTE7jGiJ9Om3OetbdQt
	/DVJuZZlIvSV/tXocmA9x1wJe9BUwSdy4lx7LncLsmYMKIIPpC2xnYB+dG1G6zlzOoTA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mem_sharing: Release domain if we are not able to enable memory sharing
Message-Id: <E1r8gEC-0005IA-0S@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:33:12 +0000

commit fbcec32d6d3ea0ac329301925b317478316209ed
Author:     Frediano Ziglio <frediano.ziglio@cloud.com>
AuthorDate: Wed Nov 22 16:39:55 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Nov 27 12:06:13 2023 +0000

    x86/mem_sharing: Release domain if we are not able to enable memory sharing
    
    In case it's not possible to enable memory sharing (mem_sharing_control
    fails) we just return the error code without releasing the domain
    acquired some lines above by rcu_lock_live_remote_domain_by_id().
    
    Fixes: 72f8d45d69b8 ("x86/mem_sharing: enable mem_sharing on first memop")
    Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/mm/mem_sharing.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 9647e651f9..4f810706a3 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -2013,7 +2013,7 @@ int mem_sharing_memop(XEN_GUEST_HANDLE_PARAM(xen_mem_sharing_op_t) arg)
 
     if ( !mem_sharing_enabled(d) &&
          (rc = mem_sharing_control(d, true, 0)) )
-        return rc;
+        goto out;
 
     switch ( mso.op )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:33:24 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644613.1005836 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gEO-0006QM-4G; Thu, 30 Nov 2023 12:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644613.1005836; Thu, 30 Nov 2023 12: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 1r8gEO-0006QF-1a; Thu, 30 Nov 2023 12:33:24 +0000
Received: by outflank-mailman (input) for mailman id 644613;
 Thu, 30 Nov 2023 12: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 1r8gEM-0006Q0-5L
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12: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 1r8gEM-0005Pd-4a
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gEM-0005IZ-3m
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12: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=0+WJkhhcqqQxtV35GFnNY1xuxRDuxmZEuj8fcDYtR88=; b=reT+fDpi/N4fv+zBPI2uhWNhvp
	7usPOGbTceilkfCiiqs0jskhvDoFBwMdxZ/GwKTew0NQZ099yDWJm47U+NyBIPPyjKulvOW+JMrt0
	swqRZsjcavSU1K0qLtKdaSFit2T96BJ37GRyhd7LTVBld01IwsMe4MJIO73UbmLZKkso=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mm: preparation work to uniform modify_xen_mappings* interfaces
Message-Id: <E1r8gEM-0005IZ-3m@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:33:22 +0000

commit b82b867a6694368b9a74ed00397b2393d129a24d
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Mon Nov 27 15:14:00 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 27 15:14:00 2023 +0100

    x86/mm: preparation work to uniform modify_xen_mappings* interfaces
    
    The objective is to use parameter name "nf" to denote "new flags"
    in all the modify_xen_mappings* functions.
    Since modify_xen_mappings_lite() is currently using "nf" as identifier
    for a local variable, bad things could happen if new uses of such
    variable are committed while a renaming patch is waiting for the
    approval.
    To avoid such danger, as first thing rename the local variable from
    "nf" to "flags".
    
    No functional change.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 39544bd9f9..42c957c40e 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5903,15 +5903,15 @@ int destroy_xen_mappings(unsigned long s, unsigned long e)
 void init_or_livepatch modify_xen_mappings_lite(
     unsigned long s, unsigned long e, unsigned int _nf)
 {
-    unsigned long v = s, fm, nf;
+    unsigned long v = s, fm, flags;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_RW|_PAGE_PRESENT)
     fm = put_pte_flags(FLAGS_MASK);
-    nf = put_pte_flags(_nf & FLAGS_MASK);
+    flags = put_pte_flags(_nf & FLAGS_MASK);
 #undef FLAGS_MASK
 
-    ASSERT(nf & _PAGE_PRESENT);
+    ASSERT(flags & _PAGE_PRESENT);
     ASSERT(IS_ALIGNED(s, PAGE_SIZE) && s >= XEN_VIRT_START);
     ASSERT(IS_ALIGNED(e, PAGE_SIZE) && e <= XEN_VIRT_END);
 
@@ -5925,7 +5925,7 @@ void init_or_livepatch modify_xen_mappings_lite(
 
         if ( l2e_get_flags(l2e) & _PAGE_PSE )
         {
-            l2e_write_atomic(pl2e, l2e_from_intpte((l2e.l2 & ~fm) | nf));
+            l2e_write_atomic(pl2e, l2e_from_intpte((l2e.l2 & ~fm) | flags));
 
             v += 1UL << L2_PAGETABLE_SHIFT;
             continue;
@@ -5943,7 +5943,8 @@ void init_or_livepatch modify_xen_mappings_lite(
 
                 ASSERT(l1f & _PAGE_PRESENT);
 
-                l1e_write_atomic(pl1e, l1e_from_intpte((l1e.l1 & ~fm) | nf));
+                l1e_write_atomic(pl1e,
+                                 l1e_from_intpte((l1e.l1 & ~fm) | flags));
 
                 v += 1UL << L1_PAGETABLE_SHIFT;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:33:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644614.1005840 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gEX-0006Sm-5z; Thu, 30 Nov 2023 12:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644614.1005840; Thu, 30 Nov 2023 12: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 1r8gEX-0006Sf-34; Thu, 30 Nov 2023 12:33:33 +0000
Received: by outflank-mailman (input) for mailman id 644614;
 Thu, 30 Nov 2023 12: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 1r8gEW-0006SP-8q
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12: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 1r8gEW-0005Q4-7v
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gEW-0005Ke-73
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12: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=Vk82HXQGeOlcIUx5zRmQ8o8jgxiYn/N+qPXQTGmu4ZU=; b=e5QC8l9sv4Y3xXvrkIG7IOf749
	NL6A4eppV+k70SNI4VehhMso8D7aF8QptIBp8vgBXB6+EfBLrmTB9eFcOuBNRfgkUybcrS1lMUCF9
	E6CdAMALJZII6YHliDsKJpHo7VhXgTyp7lkUm2/Dk8Q+bITAyB5JI8PrPCwUEF/iL5t8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/mm: address violations of MISRA C:2012 Rules 8.2 and 8.3
Message-Id: <E1r8gEW-0005Ke-73@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:33:32 +0000

commit 46f2e2c3bcd5b17dae0fd1e45ed8619d6c047b55
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Mon Nov 27 15:15:09 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 27 15:15:09 2023 +0100

    xen/mm: address violations of MISRA C:2012 Rules 8.2 and 8.3
    
    Add missing parameter names and uniform the interfaces of
    modify_xen_mappings() and modify_xen_mappings_lite().
    
    No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/mmu/pt.c   |  4 ++--
 xen/arch/ppc/mm-radix.c |  2 +-
 xen/arch/x86/mm.c       |  4 ++--
 xen/include/xen/mm.h    | 16 +++++++++-------
 4 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/mmu/pt.c b/xen/arch/arm/mmu/pt.c
index e6fc5ed45a..a7755728ae 100644
--- a/xen/arch/arm/mmu/pt.c
+++ b/xen/arch/arm/mmu/pt.c
@@ -718,12 +718,12 @@ int destroy_xen_mappings(unsigned long s, unsigned long e)
     return xen_pt_update(s, INVALID_MFN, (e - s) >> PAGE_SHIFT, 0);
 }
 
-int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int flags)
+int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
 {
     ASSERT(IS_ALIGNED(s, PAGE_SIZE));
     ASSERT(IS_ALIGNED(e, PAGE_SIZE));
     ASSERT(s <= e);
-    return xen_pt_update(s, INVALID_MFN, (e - s) >> PAGE_SHIFT, flags);
+    return xen_pt_update(s, INVALID_MFN, (e - s) >> PAGE_SHIFT, nf);
 }
 
 /*
diff --git a/xen/arch/ppc/mm-radix.c b/xen/arch/ppc/mm-radix.c
index 11d0f27b60..daa411a6fa 100644
--- a/xen/arch/ppc/mm-radix.c
+++ b/xen/arch/ppc/mm-radix.c
@@ -271,7 +271,7 @@ void __init setup_initial_pagetables(void)
  */
 unsigned long __read_mostly frametable_base_pdx;
 
-void put_page(struct page_info *p)
+void put_page(struct page_info *page)
 {
     BUG_ON("unimplemented");
 }
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 42c957c40e..0a66db10b9 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5901,14 +5901,14 @@ int destroy_xen_mappings(unsigned long s, unsigned long e)
  * a problem.
  */
 void init_or_livepatch modify_xen_mappings_lite(
-    unsigned long s, unsigned long e, unsigned int _nf)
+    unsigned long s, unsigned long e, unsigned int nf)
 {
     unsigned long v = s, fm, flags;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_RW|_PAGE_PRESENT)
     fm = put_pte_flags(FLAGS_MASK);
-    flags = put_pte_flags(_nf & FLAGS_MASK);
+    flags = put_pte_flags(nf & FLAGS_MASK);
 #undef FLAGS_MASK
 
     ASSERT(flags & _PAGE_PRESENT);
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 595629cf3f..3d9b2d05a5 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -71,9 +71,10 @@
 
 struct page_info;
 
-void put_page(struct page_info *);
-bool __must_check get_page(struct page_info *, const struct domain *);
-struct domain *__must_check page_get_owner_and_reference(struct page_info *);
+void put_page(struct page_info *page);
+bool __must_check get_page(struct page_info *page,
+                           const struct domain *domain);
+struct domain *__must_check page_get_owner_and_reference(struct page_info *page);
 
 /* Boot-time allocator. Turns into generic allocator after bootstrap. */
 void init_boot_pages(paddr_t ps, paddr_t pe);
@@ -110,8 +111,9 @@ int map_pages_to_xen(
     unsigned long nr_mfns,
     unsigned int flags);
 /* Alter the permissions of a range of Xen virtual address space. */
-int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int flags);
-void modify_xen_mappings_lite(unsigned long s, unsigned long e, unsigned int flags);
+int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf);
+void modify_xen_mappings_lite(unsigned long s, unsigned long e,
+                              unsigned int nf);
 int destroy_xen_mappings(unsigned long s, unsigned long e);
 /* Retrieve the MFN mapped by VA in Xen virtual address space. */
 mfn_t xen_map_to_mfn(unsigned long va);
@@ -135,7 +137,7 @@ void free_domheap_pages(struct page_info *pg, unsigned int order);
 unsigned long avail_domheap_pages_region(
     unsigned int node, unsigned int min_width, unsigned int max_width);
 unsigned long avail_domheap_pages(void);
-unsigned long avail_node_heap_pages(unsigned int);
+unsigned long avail_node_heap_pages(unsigned int nodeid);
 #define alloc_domheap_page(d,f) (alloc_domheap_pages(d,0,f))
 #define free_domheap_page(p)  (free_domheap_pages(p,0))
 unsigned int online_page(mfn_t mfn, uint32_t *status);
@@ -528,7 +530,7 @@ static inline unsigned int get_order_from_pages(unsigned long nr_pages)
     return order;
 }
 
-void scrub_one_page(struct page_info *);
+void scrub_one_page(struct page_info *pg);
 
 #ifndef arch_free_heap_page
 #define arch_free_heap_page(d, pg) \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:33:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644615.1005843 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gEh-0006VX-7K; Thu, 30 Nov 2023 12:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644615.1005843; Thu, 30 Nov 2023 12: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 1r8gEh-0006VP-4j; Thu, 30 Nov 2023 12:33:43 +0000
Received: by outflank-mailman (input) for mailman id 644615;
 Thu, 30 Nov 2023 12: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 1r8gEg-0006VH-C8
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12: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 1r8gEg-0005QD-BC
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gEg-0005L5-AR
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12: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=iW2OGYOee6PG4AqZ0k9BR17MaUu3CzCMRQDlhlrPWbk=; b=yX9ORYbJxdVsuY7E14WhCa5Vns
	64XOouADQM1/W45RhYWS7IA3FBmJUCGxJnwoVUtnPKvlE5a5D3vqVdKvF9p5233EWGVTvDPtPwa/z
	wJyfjR308x7YqF52FWfvOa0xskFIY53/PJufYRML3lpww/+XQ4CABkL7D9zJMtsHqkNg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] livepatch: do not use .livepatch.funcs section to store internal state
Message-Id: <E1r8gEg-0005L5-AR@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:33:42 +0000

commit 82182ad7b46e0f7a3856bb12c7a9bf2e2a4570bc
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Nov 27 15:16:01 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 27 15:16:01 2023 +0100

    livepatch: do not use .livepatch.funcs section to store internal state
    
    Currently the livepatch logic inside of Xen will use fields of struct
    livepatch_func in order to cache internal state of patched functions.  Note
    this is a field that is part of the payload, and is loaded as an ELF section
    (.livepatch.funcs), taking into account the SHF_* flags in the section
    header.
    
    The flags for the .livepatch.funcs section, as set by livepatch-build-tools,
    are SHF_ALLOC, which leads to its contents (the array of livepatch_func
    structures) being placed in read-only memory:
    
    Section Headers:
      [Nr] Name              Type             Address           Offset
           Size              EntSize          Flags  Link  Info  Align
    [...]
      [ 4] .livepatch.funcs  PROGBITS         0000000000000000  00000080
           0000000000000068  0000000000000000   A       0     0     8
    
    This previously went unnoticed, as all writes to the fields of livepatch_func
    happen in the critical region that had WP disabled in CR0.  After 8676092a0f16
    however WP is no longer toggled in CR0 for patch application, and only the
    hypervisor .text mappings are made write-accessible.  That leads to the
    following page fault when attempting to apply a livepatch:
    
    ----[ Xen-4.19-unstable  x86_64  debug=y  Tainted:   C    ]----
    CPU:    4
    RIP:    e008:[<ffff82d040221e81>] common/livepatch.c#apply_payload+0x45/0x1e1
    [...]
    Xen call trace:
       [<ffff82d040221e81>] R common/livepatch.c#apply_payload+0x45/0x1e1
       [<ffff82d0402235b2>] F check_for_livepatch_work+0x385/0xaa5
       [<ffff82d04032508f>] F arch/x86/domain.c#idle_loop+0x92/0xee
    
    Pagetable walk from ffff82d040625079:
     L4[0x105] = 000000008c6c9063 ffffffffffffffff
     L3[0x141] = 000000008c6c6063 ffffffffffffffff
     L2[0x003] = 000000086a1e7063 ffffffffffffffff
     L1[0x025] = 800000086ca5d121 ffffffffffffffff
    
    ****************************************
    Panic on CPU 4:
    FATAL PAGE FAULT
    [error_code=0003]
    Faulting linear address: ffff82d040625079
    ****************************************
    
    Fix this by moving the internal Xen function patching state out of
    livepatch_func into an area not allocated as part of the ELF payload.  While
    there also constify the array of livepatch_func structures in order to prevent
    further surprises.
    
    Note there's still one field (old_addr) that gets set during livepatch load.  I
    consider this fine since the field is read-only after load, and at the point
    the field gets set the underlying mapping hasn't been made read-only yet.
    
    Fixes: 8676092a0f16 ('x86/livepatch: Fix livepatch application when CET is active')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 xen/arch/arm/arm32/livepatch.c      |  9 +++++----
 xen/arch/arm/arm64/livepatch.c      |  9 +++++----
 xen/arch/arm/livepatch.c            |  9 +++++----
 xen/arch/x86/livepatch.c            | 26 +++++++++++++------------
 xen/common/livepatch.c              | 25 +++++++++++++++++-------
 xen/include/public/sysctl.h         |  5 +----
 xen/include/xen/livepatch.h         | 38 +++++++++++++++++++++++++------------
 xen/include/xen/livepatch_payload.h |  3 ++-
 8 files changed, 76 insertions(+), 48 deletions(-)

diff --git a/xen/arch/arm/arm32/livepatch.c b/xen/arch/arm/arm32/livepatch.c
index 3c50283b2a..80d2659b78 100644
--- a/xen/arch/arm/arm32/livepatch.c
+++ b/xen/arch/arm/arm32/livepatch.c
@@ -11,23 +11,24 @@
 #include <asm/page.h>
 #include <asm/livepatch.h>
 
-void arch_livepatch_apply(struct livepatch_func *func)
+void arch_livepatch_apply(const struct livepatch_func *func,
+                          struct livepatch_fstate *state)
 {
     uint32_t insn;
     uint32_t *new_ptr;
     unsigned int i, len;
 
-    BUILD_BUG_ON(ARCH_PATCH_INSN_SIZE > sizeof(func->opaque));
+    BUILD_BUG_ON(ARCH_PATCH_INSN_SIZE > sizeof(state->insn_buffer));
     BUILD_BUG_ON(ARCH_PATCH_INSN_SIZE != sizeof(insn));
 
     ASSERT(vmap_of_xen_text);
 
-    len = livepatch_insn_len(func);
+    len = livepatch_insn_len(func, state);
     if ( !len )
         return;
 
     /* Save old ones. */
-    memcpy(func->opaque, func->old_addr, len);
+    memcpy(state->insn_buffer, func->old_addr, len);
 
     if ( func->new_addr )
     {
diff --git a/xen/arch/arm/arm64/livepatch.c b/xen/arch/arm/arm64/livepatch.c
index 62d2ef373a..df2cebedde 100644
--- a/xen/arch/arm/arm64/livepatch.c
+++ b/xen/arch/arm/arm64/livepatch.c
@@ -15,23 +15,24 @@
 #include <asm/insn.h>
 #include <asm/livepatch.h>
 
-void arch_livepatch_apply(struct livepatch_func *func)
+void arch_livepatch_apply(const struct livepatch_func *func,
+                          struct livepatch_fstate *state)
 {
     uint32_t insn;
     uint32_t *new_ptr;
     unsigned int i, len;
 
-    BUILD_BUG_ON(ARCH_PATCH_INSN_SIZE > sizeof(func->opaque));
+    BUILD_BUG_ON(ARCH_PATCH_INSN_SIZE > sizeof(state->insn_buffer));
     BUILD_BUG_ON(ARCH_PATCH_INSN_SIZE != sizeof(insn));
 
     ASSERT(vmap_of_xen_text);
 
-    len = livepatch_insn_len(func);
+    len = livepatch_insn_len(func, state);
     if ( !len )
         return;
 
     /* Save old ones. */
-    memcpy(func->opaque, func->old_addr, len);
+    memcpy(state->insn_buffer, func->old_addr, len);
 
     if ( func->new_addr )
         insn = aarch64_insn_gen_branch_imm((unsigned long)func->old_addr,
diff --git a/xen/arch/arm/livepatch.c b/xen/arch/arm/livepatch.c
index d646379c8c..bbca1e5a5e 100644
--- a/xen/arch/arm/livepatch.c
+++ b/xen/arch/arm/livepatch.c
@@ -69,7 +69,7 @@ void arch_livepatch_revive(void)
 int arch_livepatch_verify_func(const struct livepatch_func *func)
 {
     /* If NOPing only do up to maximum amount we can put in the ->opaque. */
-    if ( !func->new_addr && (func->new_size > sizeof(func->opaque) ||
+    if ( !func->new_addr && (func->new_size > LIVEPATCH_OPAQUE_SIZE ||
          func->new_size % ARCH_PATCH_INSN_SIZE) )
         return -EOPNOTSUPP;
 
@@ -79,15 +79,16 @@ int arch_livepatch_verify_func(const struct livepatch_func *func)
     return 0;
 }
 
-void arch_livepatch_revert(const struct livepatch_func *func)
+void arch_livepatch_revert(const struct livepatch_func *func,
+                           struct livepatch_fstate *state)
 {
     uint32_t *new_ptr;
     unsigned int len;
 
     new_ptr = func->old_addr - (void *)_start + vmap_of_xen_text;
 
-    len = livepatch_insn_len(func);
-    memcpy(new_ptr, func->opaque, len);
+    len = livepatch_insn_len(func, state);
+    memcpy(new_ptr, state->insn_buffer, len);
 
     clean_and_invalidate_dcache_va_range(new_ptr, len);
 }
diff --git a/xen/arch/x86/livepatch.c b/xen/arch/x86/livepatch.c
index a54d991c5f..ee539f001b 100644
--- a/xen/arch/x86/livepatch.c
+++ b/xen/arch/x86/livepatch.c
@@ -95,7 +95,7 @@ int arch_livepatch_verify_func(const struct livepatch_func *func)
     if ( !func->new_addr )
     {
         /* Only do up to maximum amount we can put in the ->opaque. */
-        if ( func->new_size > sizeof(func->opaque) )
+        if ( func->new_size > LIVEPATCH_OPAQUE_SIZE )
             return -EOPNOTSUPP;
 
         if ( func->old_size < func->new_size )
@@ -123,13 +123,14 @@ int arch_livepatch_verify_func(const struct livepatch_func *func)
  * "noinline" to cause control flow change and thus invalidate I$ and
  * cause refetch after modification.
  */
-void noinline arch_livepatch_apply(struct livepatch_func *func)
+void noinline arch_livepatch_apply(const struct livepatch_func *func,
+                                   struct livepatch_fstate *state)
 {
     uint8_t *old_ptr;
-    uint8_t insn[sizeof(func->opaque)];
+    uint8_t insn[sizeof(state->insn_buffer)];
     unsigned int len;
 
-    func->patch_offset = 0;
+    state->patch_offset = 0;
     old_ptr = func->old_addr;
 
     /*
@@ -141,14 +142,14 @@ void noinline arch_livepatch_apply(struct livepatch_func *func)
      * ENDBR64 or similar instructions).
      */
     if ( is_endbr64(old_ptr) || is_endbr64_poison(func->old_addr) )
-        func->patch_offset += ENDBR64_LEN;
+        state->patch_offset += ENDBR64_LEN;
 
     /* This call must be done with ->patch_offset already set. */
-    len = livepatch_insn_len(func);
+    len = livepatch_insn_len(func, state);
     if ( !len )
         return;
 
-    memcpy(func->opaque, old_ptr + func->patch_offset, len);
+    memcpy(state->insn_buffer, old_ptr + state->patch_offset, len);
     if ( func->new_addr )
     {
         int32_t val;
@@ -156,7 +157,7 @@ void noinline arch_livepatch_apply(struct livepatch_func *func)
         BUILD_BUG_ON(ARCH_PATCH_INSN_SIZE != (1 + sizeof(val)));
 
         insn[0] = 0xe9; /* Relative jump. */
-        val = func->new_addr - (func->old_addr + func->patch_offset +
+        val = func->new_addr - (func->old_addr + state->patch_offset +
                                 ARCH_PATCH_INSN_SIZE);
 
         memcpy(&insn[1], &val, sizeof(val));
@@ -164,17 +165,18 @@ void noinline arch_livepatch_apply(struct livepatch_func *func)
     else
         add_nops(insn, len);
 
-    memcpy(old_ptr + func->patch_offset, insn, len);
+    memcpy(old_ptr + state->patch_offset, insn, len);
 }
 
 /*
  * "noinline" to cause control flow change and thus invalidate I$ and
  * cause refetch after modification.
  */
-void noinline arch_livepatch_revert(const struct livepatch_func *func)
+void noinline arch_livepatch_revert(const struct livepatch_func *func,
+                                    struct livepatch_fstate *state)
 {
-    memcpy(func->old_addr + func->patch_offset, func->opaque,
-           livepatch_insn_len(func));
+    memcpy(func->old_addr + state->patch_offset, state->insn_buffer,
+           livepatch_insn_len(func, state));
 }
 
 /*
diff --git a/xen/common/livepatch.c b/xen/common/livepatch.c
index 845340c7f3..1209fea256 100644
--- a/xen/common/livepatch.c
+++ b/xen/common/livepatch.c
@@ -260,6 +260,9 @@ static void free_payload_data(struct payload *payload)
     vfree((void *)payload->text_addr);
 
     payload->pages = 0;
+
+    /* fstate gets allocated strictly after move_payload. */
+    XFREE(payload->fstate);
 }
 
 /*
@@ -656,6 +659,7 @@ static int prepare_payload(struct payload *payload,
 {
     const struct livepatch_elf_sec *sec;
     unsigned int i;
+    struct livepatch_func *funcs;
     struct livepatch_func *f;
     struct virtual_region *region;
     const Elf_Note *n;
@@ -666,14 +670,19 @@ static int prepare_payload(struct payload *payload,
         if ( !section_ok(elf, sec, sizeof(*payload->funcs)) )
             return -EINVAL;
 
-        payload->funcs = sec->load_addr;
+        payload->funcs = funcs = sec->load_addr;
         payload->nfuncs = sec->sec->sh_size / sizeof(*payload->funcs);
 
+        payload->fstate = xzalloc_array(typeof(*payload->fstate),
+                                        payload->nfuncs);
+        if ( !payload->fstate )
+            return -ENOMEM;
+
         for ( i = 0; i < payload->nfuncs; i++ )
         {
             int rc;
 
-            f = &(payload->funcs[i]);
+            f = &(funcs[i]);
 
             if ( f->version != LIVEPATCH_PAYLOAD_VERSION )
             {
@@ -1361,7 +1370,7 @@ static int apply_payload(struct payload *data)
     ASSERT(!local_irq_is_enabled());
 
     for ( i = 0; i < data->nfuncs; i++ )
-        common_livepatch_apply(&data->funcs[i]);
+        common_livepatch_apply(&data->funcs[i], &data->fstate[i]);
 
     arch_livepatch_revive();
 
@@ -1397,7 +1406,7 @@ static int revert_payload(struct payload *data)
     }
 
     for ( i = 0; i < data->nfuncs; i++ )
-        common_livepatch_revert(&data->funcs[i]);
+        common_livepatch_revert(&data->funcs[i], &data->fstate[i]);
 
     /*
      * Since we are running with IRQs disabled and the hooks may call common
@@ -1438,9 +1447,10 @@ static inline bool was_action_consistent(const struct payload *data, livepatch_f
 
     for ( i = 0; i < data->nfuncs; i++ )
     {
-        struct livepatch_func *f = &(data->funcs[i]);
+        const struct livepatch_func *f = &(data->funcs[i]);
+        const struct livepatch_fstate *s = &(data->fstate[i]);
 
-        if ( f->applied != expected_state )
+        if ( s->applied != expected_state )
         {
             printk(XENLOG_ERR LIVEPATCH "%s: Payload has a function: '%s' with inconsistent applied state.\n",
                    data->name, f->name ?: "noname");
@@ -2157,7 +2167,8 @@ static void cf_check livepatch_printall(unsigned char key)
 
         for ( i = 0; i < data->nfuncs; i++ )
         {
-            struct livepatch_func *f = &(data->funcs[i]);
+            const struct livepatch_func *f = &(data->funcs[i]);
+
             printk("    %s patch %p(%u) with %p (%u)\n",
                    f->name, f->old_addr, f->old_size, f->new_addr, f->new_size);
 
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index f1eba78405..9b19679cae 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -991,10 +991,7 @@ struct livepatch_func {
     uint32_t new_size;
     uint32_t old_size;
     uint8_t version;        /* MUST be LIVEPATCH_PAYLOAD_VERSION. */
-    uint8_t opaque[LIVEPATCH_OPAQUE_SIZE];
-    uint8_t applied;
-    uint8_t patch_offset;
-    uint8_t _pad[6];
+    uint8_t _pad[39];
     livepatch_expectation_t expect;
 };
 typedef struct livepatch_func livepatch_func_t;
diff --git a/xen/include/xen/livepatch.h b/xen/include/xen/livepatch.h
index 458eef57a7..df339a134e 100644
--- a/xen/include/xen/livepatch.h
+++ b/xen/include/xen/livepatch.h
@@ -13,6 +13,9 @@ struct xen_sysctl_livepatch_op;
 
 #include <xen/elfstructs.h>
 #include <xen/errno.h> /* For -ENOSYS or -EOVERFLOW */
+
+#include <public/sysctl.h> /* For LIVEPATCH_OPAQUE_SIZE */
+
 #ifdef CONFIG_LIVEPATCH
 
 /*
@@ -51,6 +54,12 @@ struct livepatch_symbol {
     bool new_symbol;
 };
 
+struct livepatch_fstate {
+    unsigned int patch_offset;
+    enum livepatch_func_state applied;
+    uint8_t insn_buffer[LIVEPATCH_OPAQUE_SIZE];
+};
+
 int livepatch_op(struct xen_sysctl_livepatch_op *);
 void check_for_livepatch_work(void);
 unsigned long livepatch_symbols_lookup_by_name(const char *symname);
@@ -87,10 +96,11 @@ void arch_livepatch_init(void);
 int arch_livepatch_verify_func(const struct livepatch_func *func);
 
 static inline
-unsigned int livepatch_insn_len(const struct livepatch_func *func)
+unsigned int livepatch_insn_len(const struct livepatch_func *func,
+                                const struct livepatch_fstate *state)
 {
     if ( !func->new_addr )
-        return func->new_size - func->patch_offset;
+        return func->new_size - state->patch_offset;
 
     return ARCH_PATCH_INSN_SIZE;
 }
@@ -117,39 +127,43 @@ int arch_livepatch_safety_check(void);
 int arch_livepatch_quiesce(void);
 void arch_livepatch_revive(void);
 
-void arch_livepatch_apply(struct livepatch_func *func);
-void arch_livepatch_revert(const struct livepatch_func *func);
+void arch_livepatch_apply(const struct livepatch_func *func,
+                          struct livepatch_fstate *state);
+void arch_livepatch_revert(const struct livepatch_func *func,
+                           struct livepatch_fstate *state);
 void arch_livepatch_post_action(void);
 
 void arch_livepatch_mask(void);
 void arch_livepatch_unmask(void);
 
-static inline void common_livepatch_apply(struct livepatch_func *func)
+static inline void common_livepatch_apply(const struct livepatch_func *func,
+                                          struct livepatch_fstate *state)
 {
     /* If the action has been already executed on this function, do nothing. */
-    if ( func->applied == LIVEPATCH_FUNC_APPLIED )
+    if ( state->applied == LIVEPATCH_FUNC_APPLIED )
     {
         printk(XENLOG_WARNING LIVEPATCH "%s: %s has been already applied before\n",
                 __func__, func->name);
         return;
     }
 
-    arch_livepatch_apply(func);
-    func->applied = LIVEPATCH_FUNC_APPLIED;
+    arch_livepatch_apply(func, state);
+    state->applied = LIVEPATCH_FUNC_APPLIED;
 }
 
-static inline void common_livepatch_revert(struct livepatch_func *func)
+static inline void common_livepatch_revert(const struct livepatch_func *func,
+                                           struct livepatch_fstate *state)
 {
     /* If the apply action hasn't been executed on this function, do nothing. */
-    if ( !func->old_addr || func->applied == LIVEPATCH_FUNC_NOT_APPLIED )
+    if ( !func->old_addr || state->applied == LIVEPATCH_FUNC_NOT_APPLIED )
     {
         printk(XENLOG_WARNING LIVEPATCH "%s: %s has not been applied before\n",
                 __func__, func->name);
         return;
     }
 
-    arch_livepatch_revert(func);
-    func->applied = LIVEPATCH_FUNC_NOT_APPLIED;
+    arch_livepatch_revert(func, state);
+    state->applied = LIVEPATCH_FUNC_NOT_APPLIED;
 }
 #else
 
diff --git a/xen/include/xen/livepatch_payload.h b/xen/include/xen/livepatch_payload.h
index 9f5f064205..b9cd4f2096 100644
--- a/xen/include/xen/livepatch_payload.h
+++ b/xen/include/xen/livepatch_payload.h
@@ -52,7 +52,8 @@ struct payload {
     size_t ro_size;                      /* .. and its size (if any). */
     unsigned int pages;                  /* Total pages for [text,rw,ro]_addr */
     struct list_head applied_list;       /* Linked to 'applied_list'. */
-    struct livepatch_func *funcs;        /* The array of functions to patch. */
+    const struct livepatch_func *funcs;  /* The array of functions to patch. */
+    struct livepatch_fstate *fstate;     /* State of patched functions. */
     unsigned int nfuncs;                 /* Nr of functions to patch. */
     const struct livepatch_symbol *symtab; /* All symbols. */
     const char *strtab;                  /* Pointer to .strtab. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:33:53 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:33:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644616.1005848 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gEr-0006aH-AH; Thu, 30 Nov 2023 12:33:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644616.1005848; Thu, 30 Nov 2023 12:33: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 1r8gEr-0006aA-7g; Thu, 30 Nov 2023 12:33:53 +0000
Received: by outflank-mailman (input) for mailman id 644616;
 Thu, 30 Nov 2023 12:33: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 1r8gEq-0006Zs-Gm
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:33: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 1r8gEq-0005QO-G0
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gEq-0005LZ-DR
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12: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=0D6wSzt0QWB/PLiu68283pa8UWy8PoS4VGMBs9dl7x8=; b=aSYgfYYqW3i2IKmfxIb6huMoIb
	e18kmC0G2rolDriwBgaXJgc0ZkxFksqR29PFT6Q1FsBtx3/3a9CI33GiXdnYsB3Pzm4mXZH+I28kc
	aBpyzulb3xHX3hvBvgqL3M1IjeiwPm+kvE6NX+Y8uVim1dZMqogYxBCqs0oDlE2ngabo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/platform_hypercall: address violations of MISRA C:2012 Rule 11.8
Message-Id: <E1r8gEq-0005LZ-DR@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:33:52 +0000

commit 09c2fe438da1dfc83f70d921b52240bea576615f
Author:     Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
AuthorDate: Mon Nov 27 15:16:43 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 27 15:16:43 2023 +0100

    x86/platform_hypercall: address violations of MISRA C:2012 Rule 11.8
    
    Add const qualifier in cast that unnecessarily removes it
    to comply with Rule 11.8.
    The variable info is declared with a const qualified type.
    No functional change.
    
    Signed-off-by: Maria Celeste Cesario  <maria.celeste.cesario@bugseng.com>
    Signed-off-by: Simone Ballarin  <simone.ballarin@bugseng.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/platform_hypercall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index c1ab552c57..4dde71db27 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -364,7 +364,7 @@ ret_t do_platform_op(
             if ( length > info->edd_device_params.length )
                 length = info->edd_device_params.length;
             if ( copy_to_compat(op->u.firmware_info.u.disk_info.edd_params,
-                                (u8 *)&info->edd_device_params,
+                                (const uint8_t *)&info->edd_device_params,
                                 length) )
                 break;
             if ( copy_to_compat(op->u.firmware_info.u.disk_info.edd_params,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:34:03 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:34:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644617.1005851 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gF1-0006hJ-Bg; Thu, 30 Nov 2023 12:34:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644617.1005851; Thu, 30 Nov 2023 12:34: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 1r8gF1-0006hD-97; Thu, 30 Nov 2023 12:34:03 +0000
Received: by outflank-mailman (input) for mailman id 644617;
 Thu, 30 Nov 2023 12:34: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 1r8gF0-0006fF-Jl
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:34: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 1r8gF0-0005Qi-J0
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:34:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gF0-0005MY-I7
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:34:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4U6NCh0i51MrUN8+anTaKMJdLNu3NOUxeiO+95bPfns=; b=h7Y3lKsZjjmppMgAzfajqrOEpL
	4bzblDH2EiFlcLGyB83EBUYmCL218cDaXyDxo9JWTN7Ib8vi6iPAgbcTwUvbsUNbe8fYF4XPhhMeX
	xUHfF3yBWdiVsvzOS1ORS/brptnlIexfh6kdVI2ieQBpdOe93xEdq/Y+D/3EwEhzIRxY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/boot/reloc: address violations of MISRA C:2012 Rule 11.8
Message-Id: <E1r8gF0-0005MY-I7@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:34:02 +0000

commit fe26cb2dd20fa864deb05e4b278bc9993ba120e6
Author:     Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
AuthorDate: Mon Nov 27 15:17:07 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 27 15:17:07 2023 +0100

    x86/boot/reloc: address violations of MISRA C:2012 Rule 11.8
    
    Add missing const qualifier in casting to comply with Rule 11.8.
    Argument tag is typically const qualified.
    No functional change.
    
    Signed-off-by: Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
    Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/boot/reloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c
index e093b7389c..df0bc710a7 100644
--- a/xen/arch/x86/boot/reloc.c
+++ b/xen/arch/x86/boot/reloc.c
@@ -67,7 +67,7 @@ struct vesa_mode_info {
 };
 #endif /* CONFIG_VIDEO */
 
-#define get_mb2_data(tag, type, member)   (((multiboot2_tag_##type##_t *)(tag))->member)
+#define get_mb2_data(tag, type, member)   (((const multiboot2_tag_##type##_t *)(tag))->member)
 #define get_mb2_string(tag, type, member) ((u32)get_mb2_data(tag, type, member))
 
 static u32 alloc;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:34:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:34:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644618.1005856 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gFB-0006po-DH; Thu, 30 Nov 2023 12:34:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644618.1005856; Thu, 30 Nov 2023 12:34: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 1r8gFB-0006pg-Ah; Thu, 30 Nov 2023 12:34:13 +0000
Received: by outflank-mailman (input) for mailman id 644618;
 Thu, 30 Nov 2023 12:34: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 1r8gFA-0006pY-N3
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:34: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 1r8gFA-0005Qt-M8
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:34:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gFA-0005ND-LJ
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:34:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=htocC/cYfkw7zt2HjwbW9LMGyuK8WljxOnufD3gl5kA=; b=NFj16RPdgkFlzksneVIfHFhvr4
	7jt5S7B51lSEqrrEFobTlIx9Bor0hQOaOrTA0NXL7hkTeG9mm5k6GqIjOOkGYd7eTBRJHXfGr3rcL
	mApTjqdsFmSHCtXvU0iUI8gnrmO7nxG+EQQzTvzOp13uyxPsGRM1wkSKCVcTq4jUYp1o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] AMD/IOMMU: address violations of MISRA C:2012 Rule 11.8
Message-Id: <E1r8gFA-0005ND-LJ@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:34:12 +0000

commit fc63c0ebefe7e9d166b07971273c1de62428eb18
Author:     Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
AuthorDate: Mon Nov 27 15:17:32 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 27 15:17:32 2023 +0100

    AMD/IOMMU: address violations of MISRA C:2012 Rule 11.8
    
    Drop an unnecessary cast discarding a const qualifier, to comply with
    Rule 11.8. The type of the formal parameter ivhd_block is const
    qualified.
    
    No functional change.
    
    Signed-off-by: Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
    Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/drivers/passthrough/amd/iommu_acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/amd/iommu_acpi.c b/xen/drivers/passthrough/amd/iommu_acpi.c
index 699d33f429..2e3b83014b 100644
--- a/xen/drivers/passthrough/amd/iommu_acpi.c
+++ b/xen/drivers/passthrough/amd/iommu_acpi.c
@@ -1232,7 +1232,7 @@ static int __init get_last_bdf_ivhd(
     while ( ivhd_block->header.length >=
             (block_length + sizeof(struct acpi_ivrs_de_header)) )
     {
-        ivhd_device = (const void *)((u8 *)ivhd_block + block_length);
+        ivhd_device = (const void *)ivhd_block + block_length;
 
         switch ( ivhd_device->header.type )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:34:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:34:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644619.1005859 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gFL-0006wt-Em; Thu, 30 Nov 2023 12:34:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644619.1005859; Thu, 30 Nov 2023 12:34: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 1r8gFL-0006wl-CC; Thu, 30 Nov 2023 12:34:23 +0000
Received: by outflank-mailman (input) for mailman id 644619;
 Thu, 30 Nov 2023 12:34: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 1r8gFK-0006vL-Ps
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:34: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 1r8gFK-0005R1-P4
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:34:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gFK-0005O9-OH
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:34:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ktWZ0fvZBn/0e9L2fQuEQhVt2KaYIRevfEp0SUyP14g=; b=vis00RbG4+OYhRJue9Jlp30+tI
	mqJM3PmIF1b/FH0kq+vCpX/7mKXDLl1UUoFtdL6/vO7gR8a4/J6pU1O9XnSbvomwVSfqdUUY33Yxk
	Hirsli8MkN3IZuSNwQ+43/wxAmhSphDNNGxWdgVvEAZvTCCQHxnAfJb0j7ddSoi5MEz0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/atomic: address violations of MISRA C:2012 Rule 11.8
Message-Id: <E1r8gFK-0005O9-OH@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:34:22 +0000

commit 17754972fa98bff2dfdec09b8094f54530bafcb8
Author:     Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
AuthorDate: Mon Nov 27 15:17:56 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 27 15:17:56 2023 +0100

    x86/atomic: address violations of MISRA C:2012 Rule 11.8
    
    Edit casts that unnecessarily remove const qualifiers
    to comply with Rule 11.8.
    The type of the provided pointer may be const qualified.
    No functional change.
    
    Signed-off-by: Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
    Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/include/asm/atomic.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/include/asm/atomic.h b/xen/arch/x86/include/asm/atomic.h
index 27aad43aaa..16bd0ebfd7 100644
--- a/xen/arch/x86/include/asm/atomic.h
+++ b/xen/arch/x86/include/asm/atomic.h
@@ -51,10 +51,10 @@ void __bad_atomic_size(void);
     unsigned long x_;                                     \
     CLANG_DISABLE_WARN_GCC_COMPAT_START                   \
     switch ( sizeof(*(p)) ) {                             \
-    case 1: x_ = read_u8_atomic((uint8_t *)(p)); break;   \
-    case 2: x_ = read_u16_atomic((uint16_t *)(p)); break; \
-    case 4: x_ = read_u32_atomic((uint32_t *)(p)); break; \
-    case 8: x_ = read_u64_atomic((uint64_t *)(p)); break; \
+    case 1: x_ = read_u8_atomic((const uint8_t *)(p)); break;   \
+    case 2: x_ = read_u16_atomic((const uint16_t *)(p)); break; \
+    case 4: x_ = read_u32_atomic((const uint32_t *)(p)); break; \
+    case 8: x_ = read_u64_atomic((const uint64_t *)(p)); break; \
     default: x_ = 0; __bad_atomic_size(); break;          \
     }                                                     \
     CLANG_DISABLE_WARN_GCC_COMPAT_END                     \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:34:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:34:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644620.1005864 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gFV-00072s-GZ; Thu, 30 Nov 2023 12:34:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644620.1005864; Thu, 30 Nov 2023 12:34: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 1r8gFV-00072k-Dc; Thu, 30 Nov 2023 12:34:33 +0000
Received: by outflank-mailman (input) for mailman id 644620;
 Thu, 30 Nov 2023 12:34: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 1r8gFU-00072a-Su
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:34: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 1r8gFU-0005RO-S9
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:34:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gFU-0005Ou-RQ
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:34:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RcAj46YVunZLvJxeKRp8NRYD49R0D5PHaLzZYWB0oCk=; b=KfyBa9xCDFzTb707IngkJvGE0f
	7OMAGMELgBp0BqnczaSjJ5RiM9uS6frZkiWhnP7OGZE5bZ7QaBxyDwZ9K4ufv+E5OD9+xHm6U6kc3
	5z3WLQ6eojfW813JZbmdjUZZSeOnSL0JAUOM36PIjMZ08d7HlJxjW073t/VxsNOIGtnY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: amend cpu_has_xen_{ibt,shstk}
Message-Id: <E1r8gFU-0005Ou-RQ@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:34:32 +0000

commit 72d51813d631fe27d37736b7a55eeec08f246983
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 27 15:18:48 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 27 15:18:48 2023 +0100

    x86: amend cpu_has_xen_{ibt,shstk}
    
    ... to evaluate to false at compile-time when the respective Kconfig
    control is off, thus allowing the compiler to eliminate then-dead code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/include/asm/cpufeature.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/include/asm/cpufeature.h b/xen/arch/x86/include/asm/cpufeature.h
index 06e1dd7f33..1aa221eb52 100644
--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -215,8 +215,10 @@ static inline bool boot_cpu_has(unsigned int feat)
 #define cpu_has_lfence_dispatch boot_cpu_has(X86_FEATURE_LFENCE_DISPATCH)
 #define cpu_has_nscb            boot_cpu_has(X86_FEATURE_NSCB)
 #define cpu_has_xen_lbr         boot_cpu_has(X86_FEATURE_XEN_LBR)
-#define cpu_has_xen_shstk       boot_cpu_has(X86_FEATURE_XEN_SHSTK)
-#define cpu_has_xen_ibt         boot_cpu_has(X86_FEATURE_XEN_IBT)
+#define cpu_has_xen_shstk       (IS_ENABLED(CONFIG_XEN_SHSTK) && \
+                                 boot_cpu_has(X86_FEATURE_XEN_SHSTK))
+#define cpu_has_xen_ibt         (IS_ENABLED(CONFIG_XEN_IBT) && \
+                                 boot_cpu_has(X86_FEATURE_XEN_IBT))
 
 #define cpu_has_msr_tsc_aux     (cpu_has_rdtscp || cpu_has_rdpid)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:34:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:34:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644621.1005867 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gFf-00079L-HU; Thu, 30 Nov 2023 12:34:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644621.1005867; Thu, 30 Nov 2023 12:34: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 1r8gFf-00079E-F3; Thu, 30 Nov 2023 12:34:43 +0000
Received: by outflank-mailman (input) for mailman id 644621;
 Thu, 30 Nov 2023 12:34: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 1r8gFe-00077g-WC
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12: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 1r8gFe-0005RY-VQ
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:34:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gFe-0005Pf-UZ
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:34: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=JTRN7XBD+SaJ39e4CkqhjaMTlFQwEDJjyiugXXs+hdA=; b=wSrY3oQxZBKVPyYbS+sSKsPO1w
	wovxIEEQKisNcQom0eNu1SRZHFTNqGrgn1EjG/HJy2DYoZIP797i6JLEogUL3qBNR7fi7YDZQLv59
	IdlhnDA4h2tUtRtL03NQW0dwpysu5X0dYDyJJ6ddcpPMlOWTBclgdO5QzV/ltvImaJME=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/gicv2: make GICv2 driver and vGICv2 optional
Message-Id: <E1r8gFe-0005Pf-UZ@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:34:42 +0000

commit 4a6962fa7f6c8a8f6539a0ca2158d1eeefb9fcd4
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Fri Nov 24 09:48:37 2023 +0000
Commit:     Julien Grall <julien@xen.org>
CommitDate: Tue Nov 28 19:20:44 2023 +0100

    arm/gicv2: make GICv2 driver and vGICv2 optional
    
    Introduce Kconfig GICV2 to be able to compile the GICv2 driver only
    when needed, the option is active by default.
    
    Introduce Kconfig VGICV2 that compiles the Generic Interrupt
    Controller v2 emulation for domains, it is required only when using
    GICv2 driver, otherwise using the GICv3 driver it is optional and can
    be deselected if the user doesn't want to offer the v2 emulation to
    domains or maybe its GICv3 hardware can't offer the GICv2 compatible
    mode.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/Kconfig        | 19 +++++++++++++++++++
 xen/arch/arm/Makefile       |  4 ++--
 xen/arch/arm/domain_build.c |  4 ++++
 xen/arch/arm/gic-v3.c       |  4 ++++
 xen/arch/arm/vgic.c         |  2 ++
 xen/arch/arm/vgic/Makefile  |  4 ++--
 6 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 7b5b0c0c05..57dc995712 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -80,6 +80,14 @@ config ARM_EFI
 	  UEFI firmware. A UEFI stub is provided to allow Xen to
 	  be booted as an EFI application.
 
+config GICV2
+	bool "GICv2 driver"
+	default y
+	select VGICV2
+	help
+	  Driver for the ARM Generic Interrupt Controller v2.
+	  If unsure, say Y
+
 config GICV3
 	bool "GICv3 driver"
 	depends on !NEW_VGIC
@@ -99,11 +107,22 @@ config OVERLAY_DTB
 	help
 	  Dynamic addition/removal of Xen device tree nodes using a dtbo.
 
+config VGICV2
+	bool "vGICv2 interface for domains"
+	default y
+	help
+	  Allow Xen to expose a Generic Interrupt Controller version 2 like to Xen
+	  domains. This can be configured at the domain creation.
+	  This option is mandatory when using GICv2.
+	  For GICv3, this allows domain to use GICv2 when the hardware supports it.
+	  If unsure say Y.
+
 config HVM
         def_bool y
 
 config NEW_VGIC
 	bool "Use new VGIC implementation"
+	select GICV2
 	---help---
 
 	This is an alternative implementation of the ARM GIC interrupt
diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index c45b08b31e..d83dc25c0d 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -23,7 +23,7 @@ obj-y += domctl.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-y += efi/
 obj-y += gic.o
-obj-y += gic-v2.o
+obj-$(CONFIG_GICV2) += gic-v2.o
 obj-$(CONFIG_GICV3) += gic-v3.o
 obj-$(CONFIG_HAS_ITS) += gic-v3-its.o
 obj-$(CONFIG_HAS_ITS) += gic-v3-lpi.o
@@ -58,7 +58,7 @@ obj-$(CONFIG_NEW_VGIC) += vgic/
 ifneq ($(CONFIG_NEW_VGIC),y)
 obj-y += gic-vgic.o
 obj-y += vgic.o
-obj-y += vgic-v2.o
+obj-$(CONFIG_VGICV2) += vgic-v2.o
 obj-$(CONFIG_GICV3) += vgic-v3.o
 obj-$(CONFIG_HAS_ITS) += vgic-v3-its.o
 endif
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 2dd2926b41..814a41bcc5 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2491,6 +2491,7 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo,
     return res;
 }
 
+#ifdef CONFIG_VGICV2
 static int __init make_gicv2_domU_node(struct kernel_info *kinfo)
 {
     void *fdt = kinfo->fdt;
@@ -2542,6 +2543,7 @@ static int __init make_gicv2_domU_node(struct kernel_info *kinfo)
 
     return res;
 }
+#endif
 
 #ifdef CONFIG_GICV3
 static int __init make_gicv3_domU_node(struct kernel_info *kinfo)
@@ -2617,8 +2619,10 @@ static int __init make_gic_domU_node(struct kernel_info *kinfo)
     case GIC_V3:
         return make_gicv3_domU_node(kinfo);
 #endif
+#ifdef CONFIG_VGICV2
     case GIC_V2:
         return make_gicv2_domU_node(kinfo);
+#endif
     default:
         panic("Unsupported GIC version\n");
     }
diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 9b35a8c8a7..18289cd645 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -1334,6 +1334,7 @@ static paddr_t __initdata dbase = INVALID_PADDR;
 static paddr_t __initdata vbase = INVALID_PADDR, vsize = 0;
 static paddr_t __initdata cbase = INVALID_PADDR, csize = 0;
 
+#ifdef CONFIG_VGICV2
 /* If the GICv3 supports GICv2, initialize it */
 static void __init gicv3_init_v2(void)
 {
@@ -1359,6 +1360,9 @@ static void __init gicv3_init_v2(void)
 
     vgic_v2_setup_hw(dbase, cbase, csize, vbase, 0);
 }
+#else
+static inline void gicv3_init_v2(void) { }
+#endif
 
 static void __init gicv3_ioremap_distributor(paddr_t dist_paddr)
 {
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index f6b49766f9..c04fc4f83f 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -96,10 +96,12 @@ int domain_vgic_register(struct domain *d, unsigned int *mmio_count)
            return -ENODEV;
         break;
 #endif
+#ifdef CONFIG_VGICV2
     case GIC_V2:
         if ( vgic_v2_init(d, mmio_count) )
             return -ENODEV;
         break;
+#endif
     default:
         printk(XENLOG_G_ERR "d%d: Unknown vGIC version %u\n",
                d->domain_id, d->arch.vgic.version);
diff --git a/xen/arch/arm/vgic/Makefile b/xen/arch/arm/vgic/Makefile
index 806826948e..60cbf7f2f9 100644
--- a/xen/arch/arm/vgic/Makefile
+++ b/xen/arch/arm/vgic/Makefile
@@ -1,5 +1,5 @@
 obj-y += vgic.o
-obj-y += vgic-v2.o
+obj-$(CONFIG_VGICV2) += vgic-v2.o
 obj-y += vgic-mmio.o
-obj-y += vgic-mmio-v2.o
+obj-$(CONFIG_VGICV2) += vgic-mmio-v2.o
 obj-y += vgic-init.o
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:34:54 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:34:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644622.1005872 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gFq-0007Eo-JL; Thu, 30 Nov 2023 12:34:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644622.1005872; Thu, 30 Nov 2023 12: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 1r8gFq-0007Eg-GZ; Thu, 30 Nov 2023 12:34:54 +0000
Received: by outflank-mailman (input) for mailman id 644622;
 Thu, 30 Nov 2023 12:34: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 1r8gFp-0007DC-32
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:34: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 1r8gFp-0005Rf-2F
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:34:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gFp-0005QY-1K
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:34: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=u3MNUil7yaGoIZhCIRvA85YAjZRSHv5mG7cJ4MPyvwQ=; b=QdV0n4H9mO6bpLbk6x7nTljTI0
	SEFOHwXpSPmrct8s7DP9nQC24xpzpNBzEIw0N3mEUgVYINUWb6FckqPUTk+z2Dy0+aIPTsOgggzyA
	vXE5c/2OZJYHhtt/llH+NRvPVzSo0UGAX95T54eJi+CvTY9x1hwZa9rHnip4pTm3vmZ8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Add asm/domain.h include to kernel.h
Message-Id: <E1r8gFp-0005QY-1K@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:34:53 +0000

commit dcb92d4ef142c2b74bf8b9b23e6c27fde9f2bc35
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Fri Nov 24 09:48:38 2023 +0000
Commit:     Julien Grall <julien@xen.org>
CommitDate: Tue Nov 28 19:20:44 2023 +0100

    xen/arm: Add asm/domain.h include to kernel.h
    
    The 'enum domain_type' is defined by 'asm/domain.h' which is not
    included (directly or indirectly) by 'asm/kernel.h'.
    
    This currently doesn't break the compilation because asm/domain.h will
    included by the user of 'kernel.h'. But it would be better to avoid
    relying on it. So add the include in 'asm/domain.h'.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/include/asm/kernel.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/arm/include/asm/kernel.h b/xen/arch/arm/include/asm/kernel.h
index 4617cdc83b..0a23e86c2d 100644
--- a/xen/arch/arm/include/asm/kernel.h
+++ b/xen/arch/arm/include/asm/kernel.h
@@ -7,6 +7,7 @@
 #define __ARCH_ARM_KERNEL_H__
 
 #include <xen/device_tree.h>
+#include <asm/domain.h>
 #include <asm/setup.h>
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:35:04 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:35:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644623.1005876 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gG0-0007HS-Ky; Thu, 30 Nov 2023 12:35:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644623.1005876; Thu, 30 Nov 2023 12: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 1r8gG0-0007HL-I9; Thu, 30 Nov 2023 12:35:04 +0000
Received: by outflank-mailman (input) for mailman id 644623;
 Thu, 30 Nov 2023 12:35: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 1r8gFz-0007H3-6I
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:35: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 1r8gFz-0005S2-5U
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:35:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gFz-0005SW-4n
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:35: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=3twswkhy0Zc5z94yP1RVtFbakePir1cGPw6/8byD+f0=; b=bW/CMLSjnCVzW3FLQ2GmW0TzzX
	AL+ITzB6flAi9oH733P7F1cv5KcJly7nG8R+xIk3ceiWMjqYs1YlFoV+s5GzKck4tPsmvZj0Mnx1s
	lFoMbRBSg9xG60JYUdtg/TqrJ2WqrxJXKToJTsgjsmu7pW4vah9Ajdv71lCgxtnAG3sM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/dom0less: put dom0less feature code in a separate module
Message-Id: <E1r8gFz-0005SW-4n@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:35:03 +0000

commit 8d2c3ab18cc1fce46945bd3aa1819a7aea0c564e
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Fri Nov 24 09:48:39 2023 +0000
Commit:     Julien Grall <julien@xen.org>
CommitDate: Tue Nov 28 19:21:23 2023 +0100

    arm/dom0less: put dom0less feature code in a separate module
    
    Currently the dom0less feature code is mostly inside domain_build.c
    and setup.c, it is a feature that may not be useful to everyone so
    put the code in a different compilation module in order to make it
    easier to disable the feature in the future.
    
    Move gic_interrupt_t in domain_build.h to use it with the function
    declaration, move its comment above the declaration.
    
    The following functions are now visible externally from domain_build
    because they are used also from the dom0less-build module:
     - get_allocation_size
     - set_interrupt
     - domain_fdt_begin_node
     - make_memory_node
     - make_resv_memory_node
     - make_hypervisor_node
     - make_psci_node
     - make_cpus_node
     - make_timer_node
     - handle_device_interrupts
     - construct_domain
     - process_shm
     - allocate_bank_memory
    
    The functions allocate_static_memory and assign_static_memory_11
    are now externally visible, so put their declarations into
    domain_build.h and move the #else and stub definition in the header
    as well.
    
    Move is_dom0less_mode from setup.c to dom0less-build.c and make it
    externally visible.
    
    The function allocate_bank_memory is used only by dom0less code
    at the moment, but it's been decided to leave it in domain_build.c
    in case that in the future the dom0 code can use it.
    
    Where spotted, fix code style issues.
    
    No functional change is intended.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/Makefile                     |    1 +
 xen/arch/arm/dom0less-build.c             | 1018 +++++++++++++++++++++++
 xen/arch/arm/domain_build.c               | 1265 ++++-------------------------
 xen/arch/arm/include/asm/dom0less-build.h |   20 +
 xen/arch/arm/include/asm/domain_build.h   |   60 ++
 xen/arch/arm/include/asm/setup.h          |    1 -
 xen/arch/arm/setup.c                      |   33 +-
 7 files changed, 1240 insertions(+), 1158 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index d83dc25c0d..d65920b0a8 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -16,6 +16,7 @@ obj-y += cpufeature.o
 obj-y += decode.o
 obj-y += device.o
 obj-$(CONFIG_IOREQ_SERVER) += dm.o
+obj-y += dom0less-build.init.o
 obj-y += domain.o
 obj-y += domain_build.init.o
 obj-$(CONFIG_ARCH_MAP_DOMAIN_PAGE) += domain_page.o
diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
new file mode 100644
index 0000000000..1ca9d39043
--- /dev/null
+++ b/xen/arch/arm/dom0less-build.c
@@ -0,0 +1,1018 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#include <xen/device_tree.h>
+#include <xen/err.h>
+#include <xen/event.h>
+#include <xen/grant_table.h>
+#include <xen/iocap.h>
+#include <xen/libfdt/libfdt.h>
+#include <xen/sched.h>
+#include <xen/serial.h>
+#include <xen/sizes.h>
+#include <xen/vmap.h>
+
+#include <asm/arm64/sve.h>
+#include <asm/dom0less-build.h>
+#include <asm/domain_build.h>
+
+bool __init is_dom0less_mode(void)
+{
+    struct bootmodules *mods = &bootinfo.modules;
+    struct bootmodule *mod;
+    unsigned int i;
+    bool dom0found = false;
+    bool domUfound = false;
+
+    /* Look into the bootmodules */
+    for ( i = 0 ; i < mods->nr_mods ; i++ )
+    {
+        mod = &mods->module[i];
+        /* Find if dom0 and domU kernels are present */
+        if ( mod->kind == BOOTMOD_KERNEL )
+        {
+            if ( mod->domU == false )
+            {
+                dom0found = true;
+                break;
+            }
+            else
+                domUfound = true;
+        }
+    }
+
+    /*
+     * If there is no dom0 kernel but at least one domU, then we are in
+     * dom0less mode
+     */
+    return ( !dom0found && domUfound );
+}
+
+static void __init allocate_memory(struct domain *d, struct kernel_info *kinfo)
+{
+    unsigned int i;
+    paddr_t bank_size;
+
+    printk(XENLOG_INFO "Allocating mappings totalling %ldMB for %pd:\n",
+           /* Don't want format this as PRIpaddr (16 digit hex) */
+           (unsigned long)(kinfo->unassigned_mem >> 20), d);
+
+    kinfo->mem.nr_banks = 0;
+    bank_size = MIN(GUEST_RAM0_SIZE, kinfo->unassigned_mem);
+    if ( !allocate_bank_memory(d, kinfo, gaddr_to_gfn(GUEST_RAM0_BASE),
+                               bank_size) )
+        goto fail;
+
+    bank_size = MIN(GUEST_RAM1_SIZE, kinfo->unassigned_mem);
+    if ( !allocate_bank_memory(d, kinfo, gaddr_to_gfn(GUEST_RAM1_BASE),
+                               bank_size) )
+        goto fail;
+
+    if ( kinfo->unassigned_mem )
+        goto fail;
+
+    for( i = 0; i < kinfo->mem.nr_banks; i++ )
+    {
+        printk(XENLOG_INFO "%pd BANK[%d] %#"PRIpaddr"-%#"PRIpaddr" (%ldMB)\n",
+               d,
+               i,
+               kinfo->mem.bank[i].start,
+               kinfo->mem.bank[i].start + kinfo->mem.bank[i].size,
+               /* Don't want format this as PRIpaddr (16 digit hex) */
+               (unsigned long)(kinfo->mem.bank[i].size >> 20));
+    }
+
+    return;
+
+fail:
+    panic("Failed to allocate requested domain memory."
+          /* Don't want format this as PRIpaddr (16 digit hex) */
+          " %ldKB unallocated. Fix the VMs configurations.\n",
+          (unsigned long)kinfo->unassigned_mem >> 10);
+}
+
+#ifdef CONFIG_VGICV2
+static int __init make_gicv2_domU_node(struct kernel_info *kinfo)
+{
+    void *fdt = kinfo->fdt;
+    int res = 0;
+    __be32 reg[(GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS) * 2];
+    __be32 *cells;
+    const struct domain *d = kinfo->d;
+
+    res = domain_fdt_begin_node(fdt, "interrupt-controller",
+                                vgic_dist_base(&d->arch.vgic));
+    if ( res )
+        return res;
+
+    res = fdt_property_cell(fdt, "#address-cells", 0);
+    if ( res )
+        return res;
+
+    res = fdt_property_cell(fdt, "#interrupt-cells", 3);
+    if ( res )
+        return res;
+
+    res = fdt_property(fdt, "interrupt-controller", NULL, 0);
+    if ( res )
+        return res;
+
+    res = fdt_property_string(fdt, "compatible", "arm,gic-400");
+    if ( res )
+        return res;
+
+    cells = &reg[0];
+    dt_child_set_range(&cells, GUEST_ROOT_ADDRESS_CELLS, GUEST_ROOT_SIZE_CELLS,
+                       vgic_dist_base(&d->arch.vgic), GUEST_GICD_SIZE);
+    dt_child_set_range(&cells, GUEST_ROOT_ADDRESS_CELLS, GUEST_ROOT_SIZE_CELLS,
+                       vgic_cpu_base(&d->arch.vgic), GUEST_GICC_SIZE);
+
+    res = fdt_property(fdt, "reg", reg, sizeof(reg));
+    if (res)
+        return res;
+
+    res = fdt_property_cell(fdt, "linux,phandle", kinfo->phandle_gic);
+    if (res)
+        return res;
+
+    res = fdt_property_cell(fdt, "phandle", kinfo->phandle_gic);
+    if (res)
+        return res;
+
+    res = fdt_end_node(fdt);
+
+    return res;
+}
+#endif
+
+#ifdef CONFIG_GICV3
+static int __init make_gicv3_domU_node(struct kernel_info *kinfo)
+{
+    void *fdt = kinfo->fdt;
+    int res = 0;
+    __be32 *reg, *cells;
+    const struct domain *d = kinfo->d;
+    unsigned int i, len = 0;
+
+    res = domain_fdt_begin_node(fdt, "interrupt-controller",
+                                vgic_dist_base(&d->arch.vgic));
+    if ( res )
+        return res;
+
+    res = fdt_property_cell(fdt, "#address-cells", 0);
+    if ( res )
+        return res;
+
+    res = fdt_property_cell(fdt, "#interrupt-cells", 3);
+    if ( res )
+        return res;
+
+    res = fdt_property(fdt, "interrupt-controller", NULL, 0);
+    if ( res )
+        return res;
+
+    res = fdt_property_string(fdt, "compatible", "arm,gic-v3");
+    if ( res )
+        return res;
+
+    /* reg specifies all re-distributors and Distributor. */
+    len = (GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS) *
+          (d->arch.vgic.nr_regions + 1) * sizeof(__be32);
+    reg = xmalloc_bytes(len);
+    if ( reg == NULL )
+        return -ENOMEM;
+    cells = reg;
+
+    dt_child_set_range(&cells, GUEST_ROOT_ADDRESS_CELLS, GUEST_ROOT_SIZE_CELLS,
+                       vgic_dist_base(&d->arch.vgic), GUEST_GICV3_GICD_SIZE);
+
+    for ( i = 0; i < d->arch.vgic.nr_regions; i++ )
+        dt_child_set_range(&cells,
+                           GUEST_ROOT_ADDRESS_CELLS, GUEST_ROOT_SIZE_CELLS,
+                           d->arch.vgic.rdist_regions[i].base,
+                           d->arch.vgic.rdist_regions[i].size);
+
+    res = fdt_property(fdt, "reg", reg, len);
+    xfree(reg);
+    if (res)
+        return res;
+
+    res = fdt_property_cell(fdt, "linux,phandle", kinfo->phandle_gic);
+    if (res)
+        return res;
+
+    res = fdt_property_cell(fdt, "phandle", kinfo->phandle_gic);
+    if (res)
+        return res;
+
+    res = fdt_end_node(fdt);
+
+    return res;
+}
+#endif
+
+static int __init make_gic_domU_node(struct kernel_info *kinfo)
+{
+    switch ( kinfo->d->arch.vgic.version )
+    {
+#ifdef CONFIG_GICV3
+    case GIC_V3:
+        return make_gicv3_domU_node(kinfo);
+#endif
+#ifdef CONFIG_VGICV2
+    case GIC_V2:
+        return make_gicv2_domU_node(kinfo);
+#endif
+    default:
+        panic("Unsupported GIC version\n");
+    }
+}
+
+#ifdef CONFIG_SBSA_VUART_CONSOLE
+static int __init make_vpl011_uart_node(struct kernel_info *kinfo)
+{
+    void *fdt = kinfo->fdt;
+    int res;
+    gic_interrupt_t intr;
+    __be32 reg[GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS];
+    __be32 *cells;
+    struct domain *d = kinfo->d;
+
+    res = domain_fdt_begin_node(fdt, "sbsa-uart", d->arch.vpl011.base_addr);
+    if ( res )
+        return res;
+
+    res = fdt_property_string(fdt, "compatible", "arm,sbsa-uart");
+    if ( res )
+        return res;
+
+    cells = &reg[0];
+    dt_child_set_range(&cells, GUEST_ROOT_ADDRESS_CELLS,
+                       GUEST_ROOT_SIZE_CELLS, d->arch.vpl011.base_addr,
+                       GUEST_PL011_SIZE);
+
+    res = fdt_property(fdt, "reg", reg, sizeof(reg));
+    if ( res )
+        return res;
+
+    set_interrupt(intr, d->arch.vpl011.virq, 0xf, DT_IRQ_TYPE_LEVEL_HIGH);
+
+    res = fdt_property(fdt, "interrupts", intr, sizeof (intr));
+    if ( res )
+        return res;
+
+    res = fdt_property_cell(fdt, "interrupt-parent",
+                            kinfo->phandle_gic);
+    if ( res )
+        return res;
+
+    /* Use a default baud rate of 115200. */
+    fdt_property_u32(fdt, "current-speed", 115200);
+
+    res = fdt_end_node(fdt);
+    if ( res )
+        return res;
+
+    return 0;
+}
+#endif
+
+/*
+ * Scan device tree properties for passthrough specific information.
+ * Returns < 0 on error
+ *         0 on success
+ */
+static int __init handle_passthrough_prop(struct kernel_info *kinfo,
+                                          const struct fdt_property *xen_reg,
+                                          const struct fdt_property *xen_path,
+                                          bool xen_force,
+                                          uint32_t address_cells,
+                                          uint32_t size_cells)
+{
+    const __be32 *cell;
+    unsigned int i, len;
+    struct dt_device_node *node;
+    int res;
+    paddr_t mstart, size, gstart;
+
+    /* xen,reg specifies where to map the MMIO region */
+    cell = (const __be32 *)xen_reg->data;
+    len = fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) *
+                                        sizeof(uint32_t));
+
+    for ( i = 0; i < len; i++ )
+    {
+        device_tree_get_reg(&cell, address_cells, size_cells,
+                            &mstart, &size);
+        gstart = dt_next_cell(address_cells, &cell);
+
+        if ( gstart & ~PAGE_MASK || mstart & ~PAGE_MASK || size & ~PAGE_MASK )
+        {
+            printk(XENLOG_ERR
+                   "DomU passthrough config has not page aligned addresses/sizes\n");
+            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%"PRIpaddr" - 0x%"PRIpaddr"\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),
+                               maddr_to_mfn(mstart),
+                               p2m_mmio_direct_dev);
+        if ( res < 0 )
+        {
+            printk(XENLOG_ERR
+                   "Failed to map %"PRIpaddr" to the guest at%"PRIpaddr"\n",
+                   mstart, gstart);
+            return -EFAULT;
+        }
+    }
+
+    /*
+     * If xen_force, we let the user assign a MMIO region with no
+     * associated path.
+     */
+    if ( xen_path == NULL )
+        return xen_force ? 0 : -EINVAL;
+
+    /*
+     * xen,path specifies the corresponding node in the host DT.
+     * Both interrupt mappings and IOMMU settings are based on it,
+     * as they are done based on the corresponding host DT node.
+     */
+    node = dt_find_node_by_path(xen_path->data);
+    if ( node == NULL )
+    {
+        printk(XENLOG_ERR "Couldn't find node %s in host_dt!\n",
+               (char *)xen_path->data);
+        return -EINVAL;
+    }
+
+    res = map_device_irqs_to_domain(kinfo->d, node, true, NULL);
+    if ( res < 0 )
+        return res;
+
+    res = iommu_add_dt_device(node);
+    if ( res < 0 )
+        return res;
+
+    /* If xen_force, we allow assignment of devices without IOMMU protection. */
+    if ( xen_force && !dt_device_is_protected(node) )
+        return 0;
+
+    return iommu_assign_dt_device(kinfo->d, node);
+}
+
+static int __init handle_prop_pfdt(struct kernel_info *kinfo,
+                                   const void *pfdt, int nodeoff,
+                                   uint32_t address_cells, uint32_t size_cells,
+                                   bool scan_passthrough_prop)
+{
+    void *fdt = kinfo->fdt;
+    int propoff, nameoff, res;
+    const struct fdt_property *prop, *xen_reg = NULL, *xen_path = NULL;
+    const char *name;
+    bool found, xen_force = false;
+
+    for ( propoff = fdt_first_property_offset(pfdt, nodeoff);
+          propoff >= 0;
+          propoff = fdt_next_property_offset(pfdt, propoff) )
+    {
+        if ( !(prop = fdt_get_property_by_offset(pfdt, propoff, NULL)) )
+            return -FDT_ERR_INTERNAL;
+
+        found = false;
+        nameoff = fdt32_to_cpu(prop->nameoff);
+        name = fdt_string(pfdt, nameoff);
+
+        if ( scan_passthrough_prop )
+        {
+            if ( dt_prop_cmp("xen,reg", name) == 0 )
+            {
+                xen_reg = prop;
+                found = true;
+            }
+            else if ( dt_prop_cmp("xen,path", name) == 0 )
+            {
+                xen_path = prop;
+                found = true;
+            }
+            else if ( dt_prop_cmp("xen,force-assign-without-iommu",
+                                  name) == 0 )
+            {
+                xen_force = true;
+                found = true;
+            }
+        }
+
+        /*
+         * Copy properties other than the ones above: xen,reg, xen,path,
+         * and xen,force-assign-without-iommu.
+         */
+        if ( !found )
+        {
+            res = fdt_property(fdt, name, prop->data, fdt32_to_cpu(prop->len));
+            if ( res )
+                return res;
+        }
+    }
+
+    /*
+     * Only handle passthrough properties if both xen,reg and xen,path
+     * are present, or if xen,force-assign-without-iommu is specified.
+     */
+    if ( xen_reg != NULL && (xen_path != NULL || xen_force) )
+    {
+        res = handle_passthrough_prop(kinfo, xen_reg, xen_path, xen_force,
+                                      address_cells, size_cells);
+        if ( res < 0 )
+        {
+            printk(XENLOG_ERR "Failed to assign device to %pd\n", kinfo->d);
+            return res;
+        }
+    }
+    else if ( (xen_path && !xen_reg) || (xen_reg && !xen_path && !xen_force) )
+    {
+        printk(XENLOG_ERR "xen,reg or xen,path missing for %pd\n",
+               kinfo->d);
+        return -EINVAL;
+    }
+
+    /* FDT_ERR_NOTFOUND => There is no more properties for this node */
+    return ( propoff != -FDT_ERR_NOTFOUND ) ? propoff : 0;
+}
+
+static int __init scan_pfdt_node(struct kernel_info *kinfo, const void *pfdt,
+                                 int nodeoff,
+                                 uint32_t address_cells, uint32_t size_cells,
+                                 bool scan_passthrough_prop)
+{
+    int rc = 0;
+    void *fdt = kinfo->fdt;
+    int node_next;
+
+    rc = fdt_begin_node(fdt, fdt_get_name(pfdt, nodeoff, NULL));
+    if ( rc )
+        return rc;
+
+    rc = handle_prop_pfdt(kinfo, pfdt, nodeoff, address_cells, size_cells,
+                          scan_passthrough_prop);
+    if ( rc )
+        return rc;
+
+    address_cells = device_tree_get_u32(pfdt, nodeoff, "#address-cells",
+                                        DT_ROOT_NODE_ADDR_CELLS_DEFAULT);
+    size_cells = device_tree_get_u32(pfdt, nodeoff, "#size-cells",
+                                     DT_ROOT_NODE_SIZE_CELLS_DEFAULT);
+
+    node_next = fdt_first_subnode(pfdt, nodeoff);
+    while ( node_next > 0 )
+    {
+        rc = scan_pfdt_node(kinfo, pfdt, node_next, address_cells, size_cells,
+                            scan_passthrough_prop);
+        if ( rc )
+            return rc;
+
+        node_next = fdt_next_subnode(pfdt, node_next);
+    }
+
+    return fdt_end_node(fdt);
+}
+
+static int __init check_partial_fdt(void *pfdt, size_t size)
+{
+    int res;
+
+    if ( fdt_magic(pfdt) != FDT_MAGIC )
+    {
+        dprintk(XENLOG_ERR, "Partial FDT is not a valid Flat Device Tree");
+        return -EINVAL;
+    }
+
+    res = fdt_check_header(pfdt);
+    if ( res )
+    {
+        dprintk(XENLOG_ERR, "Failed to check the partial FDT (%d)", res);
+        return -EINVAL;
+    }
+
+    if ( fdt_totalsize(pfdt) > size )
+    {
+        dprintk(XENLOG_ERR, "Partial FDT totalsize is too big");
+        return -EINVAL;
+    }
+
+    return 0;
+}
+
+static int __init domain_handle_dtb_bootmodule(struct domain *d,
+                                               struct kernel_info *kinfo)
+{
+    void *pfdt;
+    int res, node_next;
+
+    pfdt = ioremap_cache(kinfo->dtb_bootmodule->start,
+                         kinfo->dtb_bootmodule->size);
+    if ( pfdt == NULL )
+        return -EFAULT;
+
+    res = check_partial_fdt(pfdt, kinfo->dtb_bootmodule->size);
+    if ( res < 0 )
+        goto out;
+
+    for ( node_next = fdt_first_subnode(pfdt, 0);
+          node_next > 0;
+          node_next = fdt_next_subnode(pfdt, node_next) )
+    {
+        const char *name = fdt_get_name(pfdt, node_next, NULL);
+
+        if ( name == NULL )
+            continue;
+
+        /*
+         * Only scan /gic /aliases /passthrough, ignore the rest.
+         * They don't have to be parsed in order.
+         *
+         * Take the GIC phandle value from the special /gic node in the
+         * DTB fragment.
+         */
+        if ( dt_node_cmp(name, "gic") == 0 )
+        {
+            kinfo->phandle_gic = fdt_get_phandle(pfdt, node_next);
+            continue;
+        }
+
+        if ( dt_node_cmp(name, "aliases") == 0 )
+        {
+            res = scan_pfdt_node(kinfo, pfdt, node_next,
+                                 DT_ROOT_NODE_ADDR_CELLS_DEFAULT,
+                                 DT_ROOT_NODE_SIZE_CELLS_DEFAULT,
+                                 false);
+            if ( res )
+                goto out;
+            continue;
+        }
+        if ( dt_node_cmp(name, "passthrough") == 0 )
+        {
+            res = scan_pfdt_node(kinfo, pfdt, node_next,
+                                 DT_ROOT_NODE_ADDR_CELLS_DEFAULT,
+                                 DT_ROOT_NODE_SIZE_CELLS_DEFAULT,
+                                 true);
+            if ( res )
+                goto out;
+            continue;
+        }
+    }
+
+ out:
+    iounmap(pfdt);
+
+    return res;
+}
+
+/*
+ * The max size for DT is 2MB. However, the generated DT is small (not including
+ * domU passthrough DT nodes whose size we account separately), 4KB are enough
+ * for now, but we might have to increase it in the future.
+ */
+#define DOMU_DTB_SIZE 4096
+static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
+{
+    int addrcells, sizecells;
+    int ret, fdt_size = DOMU_DTB_SIZE;
+
+    kinfo->phandle_gic = GUEST_PHANDLE_GIC;
+    kinfo->gnttab_start = GUEST_GNTTAB_BASE;
+    kinfo->gnttab_size = GUEST_GNTTAB_SIZE;
+
+    addrcells = GUEST_ROOT_ADDRESS_CELLS;
+    sizecells = GUEST_ROOT_SIZE_CELLS;
+
+    /* Account for domU passthrough DT size */
+    if ( kinfo->dtb_bootmodule )
+        fdt_size += kinfo->dtb_bootmodule->size;
+
+    /* Cap to max DT size if needed */
+    fdt_size = min(fdt_size, SZ_2M);
+
+    kinfo->fdt = xmalloc_bytes(fdt_size);
+    if ( kinfo->fdt == NULL )
+        return -ENOMEM;
+
+    ret = fdt_create(kinfo->fdt, fdt_size);
+    if ( ret < 0 )
+        goto err;
+
+    ret = fdt_finish_reservemap(kinfo->fdt);
+    if ( ret < 0 )
+        goto err;
+
+    ret = fdt_begin_node(kinfo->fdt, "");
+    if ( ret < 0 )
+        goto err;
+
+    ret = fdt_property_cell(kinfo->fdt, "#address-cells", addrcells);
+    if ( ret )
+        goto err;
+
+    ret = fdt_property_cell(kinfo->fdt, "#size-cells", sizecells);
+    if ( ret )
+        goto err;
+
+    ret = make_chosen_node(kinfo);
+    if ( ret )
+        goto err;
+
+    ret = make_psci_node(kinfo->fdt);
+    if ( ret )
+        goto err;
+
+    ret = make_cpus_node(d, kinfo->fdt);
+    if ( ret )
+        goto err;
+
+    ret = make_memory_node(d, kinfo->fdt, addrcells, sizecells, &kinfo->mem);
+    if ( ret )
+        goto err;
+
+    ret = make_resv_memory_node(d, kinfo->fdt, addrcells, sizecells,
+                                &kinfo->shm_mem);
+    if ( ret )
+        goto err;
+
+    /*
+     * domain_handle_dtb_bootmodule has to be called before the rest of
+     * the device tree is generated because it depends on the value of
+     * the field phandle_gic.
+     */
+    if ( kinfo->dtb_bootmodule )
+    {
+        ret = domain_handle_dtb_bootmodule(d, kinfo);
+        if ( ret )
+            goto err;
+    }
+
+    ret = make_gic_domU_node(kinfo);
+    if ( ret )
+        goto err;
+
+    ret = make_timer_node(kinfo);
+    if ( ret )
+        goto err;
+
+    if ( kinfo->vpl011 )
+    {
+        ret = -EINVAL;
+#ifdef CONFIG_SBSA_VUART_CONSOLE
+        ret = make_vpl011_uart_node(kinfo);
+#endif
+        if ( ret )
+            goto err;
+    }
+
+    if ( kinfo->dom0less_feature & DOM0LESS_ENHANCED_NO_XS )
+    {
+        ret = make_hypervisor_node(d, kinfo, addrcells, sizecells);
+        if ( ret )
+            goto err;
+    }
+
+    ret = fdt_end_node(kinfo->fdt);
+    if ( ret < 0 )
+        goto err;
+
+    ret = fdt_finish(kinfo->fdt);
+    if ( ret < 0 )
+        goto err;
+
+    return 0;
+
+  err:
+    printk("Device tree generation failed (%d).\n", ret);
+    xfree(kinfo->fdt);
+
+    return -EINVAL;
+}
+
+static unsigned long __init domain_p2m_pages(unsigned long maxmem_kb,
+                                             unsigned int smp_cpus)
+{
+    /*
+     * Keep in sync with libxl__get_required_paging_memory().
+     * 256 pages (1MB) per vcpu, plus 1 page per MiB of RAM for the P2M map,
+     * plus 128 pages to cover extended regions.
+     */
+    unsigned long memkb = 4 * (256 * smp_cpus + (maxmem_kb / 1024) + 128);
+
+    BUILD_BUG_ON(PAGE_SIZE != SZ_4K);
+
+    return DIV_ROUND_UP(memkb, 1024) << (20 - PAGE_SHIFT);
+}
+
+static int __init alloc_xenstore_evtchn(struct domain *d)
+{
+    evtchn_alloc_unbound_t alloc;
+    int rc;
+
+    alloc.dom = d->domain_id;
+    alloc.remote_dom = hardware_domain->domain_id;
+    rc = evtchn_alloc_unbound(&alloc, 0);
+    if ( rc )
+    {
+        printk("Failed allocating event channel for domain\n");
+        return rc;
+    }
+
+    d->arch.hvm.params[HVM_PARAM_STORE_EVTCHN] = alloc.port;
+
+    return 0;
+}
+
+static int __init construct_domU(struct domain *d,
+                                 const struct dt_device_node *node)
+{
+    struct kernel_info kinfo = {};
+    const char *dom0less_enhanced;
+    int rc;
+    u64 mem;
+    u32 p2m_mem_mb;
+    unsigned long p2m_pages;
+
+    rc = dt_property_read_u64(node, "memory", &mem);
+    if ( !rc )
+    {
+        printk("Error building DomU: cannot read \"memory\" property\n");
+        return -EINVAL;
+    }
+    kinfo.unassigned_mem = (paddr_t)mem * SZ_1K;
+
+    rc = dt_property_read_u32(node, "xen,domain-p2m-mem-mb", &p2m_mem_mb);
+    /* If xen,domain-p2m-mem-mb is not specified, use the default value. */
+    p2m_pages = rc ?
+                p2m_mem_mb << (20 - PAGE_SHIFT) :
+                domain_p2m_pages(mem, d->max_vcpus);
+
+    spin_lock(&d->arch.paging.lock);
+    rc = p2m_set_allocation(d, p2m_pages, NULL);
+    spin_unlock(&d->arch.paging.lock);
+    if ( rc != 0 )
+        return rc;
+
+    printk("*** LOADING DOMU cpus=%u memory=%#"PRIx64"KB ***\n",
+           d->max_vcpus, mem);
+
+    kinfo.vpl011 = dt_property_read_bool(node, "vpl011");
+
+    rc = dt_property_read_string(node, "xen,enhanced", &dom0less_enhanced);
+    if ( rc == -EILSEQ ||
+         rc == -ENODATA ||
+         (rc == 0 && !strcmp(dom0less_enhanced, "enabled")) )
+    {
+        if ( hardware_domain )
+            kinfo.dom0less_feature = DOM0LESS_ENHANCED;
+        else
+            panic("At the moment, Xenstore support requires dom0 to be present\n");
+    }
+    else if ( rc == 0 && !strcmp(dom0less_enhanced, "no-xenstore") )
+        kinfo.dom0less_feature = DOM0LESS_ENHANCED_NO_XS;
+
+    if ( vcpu_create(d, 0) == NULL )
+        return -ENOMEM;
+
+    d->max_pages = ((paddr_t)mem * SZ_1K) >> PAGE_SHIFT;
+
+    kinfo.d = d;
+
+    rc = kernel_probe(&kinfo, node);
+    if ( rc < 0 )
+        return rc;
+
+#ifdef CONFIG_ARM_64
+    /* type must be set before allocate memory */
+    d->arch.type = kinfo.type;
+#endif
+    if ( !dt_find_property(node, "xen,static-mem", NULL) )
+        allocate_memory(d, &kinfo);
+    else if ( !is_domain_direct_mapped(d) )
+        allocate_static_memory(d, &kinfo, node);
+    else
+        assign_static_memory_11(d, &kinfo, node);
+
+#ifdef CONFIG_STATIC_SHM
+    rc = process_shm(d, &kinfo, node);
+    if ( rc < 0 )
+        return rc;
+#endif
+
+    /*
+     * Base address and irq number are needed when creating vpl011 device
+     * tree node in prepare_dtb_domU, so initialization on related variables
+     * shall be done first.
+     */
+    if ( kinfo.vpl011 )
+    {
+        rc = domain_vpl011_init(d, NULL);
+        if ( rc < 0 )
+            return rc;
+    }
+
+    rc = prepare_dtb_domU(d, &kinfo);
+    if ( rc < 0 )
+        return rc;
+
+    rc = construct_domain(d, &kinfo);
+    if ( rc < 0 )
+        return rc;
+
+    if ( kinfo.dom0less_feature & DOM0LESS_XENSTORE )
+    {
+        ASSERT(hardware_domain);
+        rc = alloc_xenstore_evtchn(d);
+        if ( rc < 0 )
+            return rc;
+        d->arch.hvm.params[HVM_PARAM_STORE_PFN] = ~0ULL;
+    }
+
+    return rc;
+}
+
+void __init create_domUs(void)
+{
+    struct dt_device_node *node;
+    const struct dt_device_node *cpupool_node,
+                                *chosen = dt_find_node_by_path("/chosen");
+
+    BUG_ON(chosen == NULL);
+    dt_for_each_child_node(chosen, node)
+    {
+        struct domain *d;
+        struct xen_domctl_createdomain d_cfg = {
+            .arch.gic_version = XEN_DOMCTL_CONFIG_GIC_NATIVE,
+            .flags = XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap,
+            /*
+             * The default of 1023 should be sufficient for guests because
+             * on ARM we don't bind physical interrupts to event channels.
+             * The only use of the evtchn port is inter-domain communications.
+             * 1023 is also the default value used in libxl.
+             */
+            .max_evtchn_port = 1023,
+            .max_grant_frames = -1,
+            .max_maptrack_frames = -1,
+            .grant_opts = XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),
+        };
+        unsigned int flags = 0U;
+        uint32_t val;
+        int rc;
+
+        if ( !dt_device_is_compatible(node, "xen,domain") )
+            continue;
+
+        if ( (max_init_domid + 1) >= DOMID_FIRST_RESERVED )
+            panic("No more domain IDs available\n");
+
+        if ( dt_find_property(node, "xen,static-mem", NULL) )
+            flags |= CDF_staticmem;
+
+        if ( dt_property_read_bool(node, "direct-map") )
+        {
+            if ( !(flags & CDF_staticmem) )
+                panic("direct-map is not valid for domain %s without static allocation.\n",
+                      dt_node_name(node));
+
+            flags |= CDF_directmap;
+        }
+
+        if ( !dt_property_read_u32(node, "cpus", &d_cfg.max_vcpus) )
+            panic("Missing property 'cpus' for domain %s\n",
+                  dt_node_name(node));
+
+        if ( dt_find_compatible_node(node, NULL, "multiboot,device-tree") &&
+             iommu_enabled )
+            d_cfg.flags |= XEN_DOMCTL_CDF_iommu;
+
+        if ( !dt_property_read_u32(node, "nr_spis", &d_cfg.arch.nr_spis) )
+        {
+            int vpl011_virq = GUEST_VPL011_SPI;
+
+            d_cfg.arch.nr_spis = gic_number_lines() - 32;
+
+            /*
+             * The VPL011 virq is GUEST_VPL011_SPI, unless direct-map is
+             * set, in which case it'll match the hardware.
+             *
+             * Since the domain is not yet created, we can't use
+             * d->arch.vpl011.irq. So the logic to find the vIRQ has to
+             * be hardcoded.
+             * The logic here shall be consistent with the one in
+             * domain_vpl011_init().
+             */
+            if ( flags & CDF_directmap )
+            {
+                vpl011_virq = serial_irq(SERHND_DTUART);
+                if ( vpl011_virq < 0 )
+                    panic("Error getting IRQ number for this serial port %d\n",
+                          SERHND_DTUART);
+            }
+
+            /*
+             * vpl011 uses one emulated SPI. If vpl011 is requested, make
+             * sure that we allocate enough SPIs for it.
+             */
+            if ( dt_property_read_bool(node, "vpl011") )
+                d_cfg.arch.nr_spis = MAX(d_cfg.arch.nr_spis,
+                                         vpl011_virq - 32 + 1);
+        }
+
+        /* Get the optional property domain-cpupool */
+        cpupool_node = dt_parse_phandle(node, "domain-cpupool", 0);
+        if ( cpupool_node )
+        {
+            int pool_id = btcpupools_get_domain_pool_id(cpupool_node);
+            if ( pool_id < 0 )
+                panic("Error getting cpupool id from domain-cpupool (%d)\n",
+                      pool_id);
+            d_cfg.cpupool_id = pool_id;
+        }
+
+        if ( dt_property_read_u32(node, "max_grant_version", &val) )
+            d_cfg.grant_opts = XEN_DOMCTL_GRANT_version(val);
+
+        if ( dt_property_read_u32(node, "max_grant_frames", &val) )
+        {
+            if ( val > INT32_MAX )
+                panic("max_grant_frames (%"PRIu32") overflow\n", val);
+            d_cfg.max_grant_frames = val;
+        }
+
+        if ( dt_property_read_u32(node, "max_maptrack_frames", &val) )
+        {
+            if ( val > INT32_MAX )
+                panic("max_maptrack_frames (%"PRIu32") overflow\n", val);
+            d_cfg.max_maptrack_frames = val;
+        }
+
+        if ( dt_get_property(node, "sve", &val) )
+        {
+#ifdef CONFIG_ARM64_SVE
+            unsigned int sve_vl_bits;
+            bool ret = false;
+
+            if ( !val )
+            {
+                /* Property found with no value, means max HW VL supported */
+                ret = sve_domctl_vl_param(-1, &sve_vl_bits);
+            }
+            else
+            {
+                if ( dt_property_read_u32(node, "sve", &val) )
+                    ret = sve_domctl_vl_param(val, &sve_vl_bits);
+                else
+                    panic("Error reading 'sve' property\n");
+            }
+
+            if ( ret )
+                d_cfg.arch.sve_vl = sve_encode_vl(sve_vl_bits);
+            else
+                panic("SVE vector length error\n");
+#else
+            panic("'sve' property found, but CONFIG_ARM64_SVE not selected\n");
+#endif
+        }
+
+        /*
+         * The variable max_init_domid is initialized with zero, so here it's
+         * very important to use the pre-increment operator to call
+         * domain_create() with a domid > 0. (domid == 0 is reserved for Dom0)
+         */
+        d = domain_create(++max_init_domid, &d_cfg, flags);
+        if ( IS_ERR(d) )
+            panic("Error creating domain %s (rc = %ld)\n",
+                  dt_node_name(node), PTR_ERR(d));
+
+        d->is_console = true;
+        dt_device_set_used_by(node, d->domain_id);
+
+        rc = construct_domU(d, node);
+        if ( rc )
+            panic("Could not set up domain %s (rc = %d)\n",
+                  dt_node_name(node), rc);
+    }
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 814a41bcc5..90dba16e42 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -29,6 +29,7 @@
 #include <asm/setup.h>
 #include <asm/arm64/sve.h>
 #include <asm/cpufeature.h>
+#include <asm/dom0less-build.h>
 #include <asm/domain_build.h>
 #include <xen/event.h>
 
@@ -118,7 +119,7 @@ struct vcpu *__init alloc_dom0_vcpu0(struct domain *dom0)
     return vcpu_create(dom0, 0);
 }
 
-static unsigned int __init get_allocation_size(paddr_t size)
+unsigned int __init get_allocation_size(paddr_t size)
 {
     /*
      * get_order_from_bytes returns the order greater than or equal to
@@ -414,10 +415,8 @@ static void __init allocate_memory_11(struct domain *d,
     }
 }
 
-static bool __init allocate_bank_memory(struct domain *d,
-                                        struct kernel_info *kinfo,
-                                        gfn_t sgfn,
-                                        paddr_t tot_size)
+bool __init allocate_bank_memory(struct domain *d, struct kernel_info *kinfo,
+                                 gfn_t sgfn, paddr_t tot_size)
 {
     int res;
     struct page_info *pg;
@@ -478,49 +477,6 @@ static bool __init allocate_bank_memory(struct domain *d,
     return true;
 }
 
-static void __init allocate_memory(struct domain *d, struct kernel_info *kinfo)
-{
-    unsigned int i;
-    paddr_t bank_size;
-
-    printk(XENLOG_INFO "Allocating mappings totalling %ldMB for %pd:\n",
-           /* Don't want format this as PRIpaddr (16 digit hex) */
-           (unsigned long)(kinfo->unassigned_mem >> 20), d);
-
-    kinfo->mem.nr_banks = 0;
-    bank_size = MIN(GUEST_RAM0_SIZE, kinfo->unassigned_mem);
-    if ( !allocate_bank_memory(d, kinfo, gaddr_to_gfn(GUEST_RAM0_BASE),
-                               bank_size) )
-        goto fail;
-
-    bank_size = MIN(GUEST_RAM1_SIZE, kinfo->unassigned_mem);
-    if ( !allocate_bank_memory(d, kinfo, gaddr_to_gfn(GUEST_RAM1_BASE),
-                               bank_size) )
-        goto fail;
-
-    if ( kinfo->unassigned_mem )
-        goto fail;
-
-    for( i = 0; i < kinfo->mem.nr_banks; i++ )
-    {
-        printk(XENLOG_INFO "%pd BANK[%d] %#"PRIpaddr"-%#"PRIpaddr" (%ldMB)\n",
-               d,
-               i,
-               kinfo->mem.bank[i].start,
-               kinfo->mem.bank[i].start + kinfo->mem.bank[i].size,
-               /* Don't want format this as PRIpaddr (16 digit hex) */
-               (unsigned long)(kinfo->mem.bank[i].size >> 20));
-    }
-
-    return;
-
-fail:
-    panic("Failed to allocate requested domain memory."
-          /* Don't want format this as PRIpaddr (16 digit hex) */
-          " %ldKB unallocated. Fix the VMs configurations.\n",
-          (unsigned long)kinfo->unassigned_mem >> 10);
-}
-
 #ifdef CONFIG_STATIC_MEMORY
 static bool __init append_static_memory_to_bank(struct domain *d,
                                                 struct membank *bank,
@@ -600,9 +556,8 @@ static int __init parse_static_mem_prop(const struct dt_device_node *node,
 }
 
 /* Allocate memory from static memory as RAM for one specific domain d. */
-static void __init allocate_static_memory(struct domain *d,
-                                          struct kernel_info *kinfo,
-                                          const struct dt_device_node *node)
+void __init allocate_static_memory(struct domain *d, struct kernel_info *kinfo,
+                                   const struct dt_device_node *node)
 {
     u32 addr_cells, size_cells, reg_cells;
     unsigned int nr_banks, gbank, bank = 0;
@@ -706,9 +661,8 @@ static void __init allocate_static_memory(struct domain *d,
  * The static memory will be directly mapped in the guest(Guest Physical
  * Address == Physical Address).
  */
-static void __init assign_static_memory_11(struct domain *d,
-                                           struct kernel_info *kinfo,
-                                           const struct dt_device_node *node)
+void __init assign_static_memory_11(struct domain *d, struct kernel_info *kinfo,
+                                    const struct dt_device_node *node)
 {
     u32 addr_cells, size_cells, reg_cells;
     unsigned int nr_banks, bank = 0;
@@ -942,8 +896,8 @@ static int __init append_shm_bank_to_domain(struct kernel_info *kinfo,
     return 0;
 }
 
-static int __init process_shm(struct domain *d, struct kernel_info *kinfo,
-                              const struct dt_device_node *node)
+int __init process_shm(struct domain *d, struct kernel_info *kinfo,
+                       const struct dt_device_node *node)
 {
     struct dt_device_node *shm_node;
 
@@ -1048,20 +1002,6 @@ static int __init process_shm(struct domain *d, struct kernel_info *kinfo,
     return 0;
 }
 #endif /* CONFIG_STATIC_SHM */
-#else
-static void __init allocate_static_memory(struct domain *d,
-                                          struct kernel_info *kinfo,
-                                          const struct dt_device_node *node)
-{
-    ASSERT_UNREACHABLE();
-}
-
-static void __init assign_static_memory_11(struct domain *d,
-                                           struct kernel_info *kinfo,
-                                           const struct dt_device_node *node)
-{
-    ASSERT_UNREACHABLE();
-}
 #endif
 
 /*
@@ -1265,17 +1205,10 @@ static int __init write_properties(struct domain *d, struct kernel_info *kinfo,
     return 0;
 }
 
-/*
- * Helper to write an interrupts with the GIC format
- * This code is assuming the irq is an PPI.
- */
-
-typedef __be32 gic_interrupt_t[3];
-
-static void __init set_interrupt(gic_interrupt_t interrupt,
-                                 unsigned int irq,
-                                 unsigned int cpumask,
-                                 unsigned int level)
+void __init set_interrupt(gic_interrupt_t interrupt,
+                          unsigned int irq,
+                          unsigned int cpumask,
+                          unsigned int level)
 {
     __be32 *cells = interrupt;
     bool is_ppi = !!(irq < 32);
@@ -1320,8 +1253,7 @@ static int __init fdt_property_interrupts(const struct kernel_info *kinfo,
  * unit (which contains the physical address) with name to generate a
  * node name.
  */
-static int __init domain_fdt_begin_node(void *fdt, const char *name,
-                                        uint64_t unit)
+int __init domain_fdt_begin_node(void *fdt, const char *name, uint64_t unit)
 {
     /*
      * The size of the buffer to hold the longest possible string (i.e.
@@ -1345,10 +1277,10 @@ static int __init domain_fdt_begin_node(void *fdt, const char *name,
     return fdt_begin_node(fdt, buf);
 }
 
-static int __init make_memory_node(const struct domain *d,
-                                   void *fdt,
-                                   int addrcells, int sizecells,
-                                   struct meminfo *mem)
+int __init make_memory_node(const struct domain *d,
+                            void *fdt,
+                            int addrcells, int sizecells,
+                            struct meminfo *mem)
 {
     unsigned int i;
     int res, reg_size = addrcells + sizecells;
@@ -1484,10 +1416,10 @@ static int __init make_shm_memory_node(const struct domain *d,
 }
 #endif
 
-static int __init make_resv_memory_node(const struct domain *d,
-                                        void *fdt,
-                                        int addrcells, int sizecells,
-                                        const struct meminfo *mem)
+int __init make_resv_memory_node(const struct domain *d,
+                                 void *fdt,
+                                 int addrcells, int sizecells,
+                                 const struct meminfo *mem)
 {
     int res = 0;
     /* Placeholder for reserved-memory\0 */
@@ -1820,9 +1752,9 @@ static int __init find_domU_holes(const struct kernel_info *kinfo,
     return res;
 }
 
-static int __init make_hypervisor_node(struct domain *d,
-                                       const struct kernel_info *kinfo,
-                                       int addrcells, int sizecells)
+int __init make_hypervisor_node(struct domain *d,
+                                const struct kernel_info *kinfo,
+                                int addrcells, int sizecells)
 {
     const char compat[] =
         "xen,xen-" XEN_VERSION_STRING "\0"
@@ -1939,7 +1871,7 @@ static int __init make_hypervisor_node(struct domain *d,
     return res;
 }
 
-static int __init make_psci_node(void *fdt)
+int __init make_psci_node(void *fdt)
 {
     int res;
     const char compat[] =
@@ -1975,7 +1907,7 @@ static int __init make_psci_node(void *fdt)
     return res;
 }
 
-static int __init make_cpus_node(const struct domain *d, void *fdt)
+int __init make_cpus_node(const struct domain *d, void *fdt)
 {
     int res;
     const struct dt_device_node *cpus = dt_find_node_by_path("/cpus");
@@ -2173,7 +2105,7 @@ static int __init make_gic_node(const struct domain *d, void *fdt,
     return res;
 }
 
-static int __init make_timer_node(const struct kernel_info *kinfo)
+int __init make_timer_node(const struct kernel_info *kinfo)
 {
     void *fdt = kinfo->fdt;
     static const struct dt_device_match timer_ids[] __initconst =
@@ -2491,773 +2423,161 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo,
     return res;
 }
 
-#ifdef CONFIG_VGICV2
-static int __init make_gicv2_domU_node(struct kernel_info *kinfo)
+static int __init prepare_dtb_hwdom(struct domain *d, struct kernel_info *kinfo)
 {
-    void *fdt = kinfo->fdt;
-    int res = 0;
-    __be32 reg[(GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS) * 2];
-    __be32 *cells;
-    const struct domain *d = kinfo->d;
-
-    res = domain_fdt_begin_node(fdt, "interrupt-controller",
-                                vgic_dist_base(&d->arch.vgic));
-    if ( res )
-        return res;
-
-    res = fdt_property_cell(fdt, "#address-cells", 0);
-    if ( res )
-        return res;
+    const p2m_type_t default_p2mt = p2m_mmio_direct_c;
+    const void *fdt;
+    int new_size;
+    int ret;
 
-    res = fdt_property_cell(fdt, "#interrupt-cells", 3);
-    if ( res )
-        return res;
+    ASSERT(dt_host && (dt_host->sibling == NULL));
 
-    res = fdt_property(fdt, "interrupt-controller", NULL, 0);
-    if ( res )
-        return res;
+    kinfo->phandle_gic = dt_interrupt_controller->phandle;
+    fdt = device_tree_flattened;
 
-    res = fdt_property_string(fdt, "compatible", "arm,gic-400");
-    if ( res )
-        return res;
+    new_size = fdt_totalsize(fdt) + DOM0_FDT_EXTRA_SIZE;
+    kinfo->fdt = xmalloc_bytes(new_size);
+    if ( kinfo->fdt == NULL )
+        return -ENOMEM;
 
-    cells = &reg[0];
-    dt_child_set_range(&cells, GUEST_ROOT_ADDRESS_CELLS, GUEST_ROOT_SIZE_CELLS,
-                       vgic_dist_base(&d->arch.vgic), GUEST_GICD_SIZE);
-    dt_child_set_range(&cells, GUEST_ROOT_ADDRESS_CELLS, GUEST_ROOT_SIZE_CELLS,
-                       vgic_cpu_base(&d->arch.vgic), GUEST_GICC_SIZE);
+    ret = fdt_create(kinfo->fdt, new_size);
+    if ( ret < 0 )
+        goto err;
 
-    res = fdt_property(fdt, "reg", reg, sizeof(reg));
-    if (res)
-        return res;
+    fdt_finish_reservemap(kinfo->fdt);
 
-    res = fdt_property_cell(fdt, "linux,phandle", kinfo->phandle_gic);
-    if (res)
-        return res;
+    ret = handle_node(d, kinfo, dt_host, default_p2mt);
+    if ( ret )
+        goto err;
 
-    res = fdt_property_cell(fdt, "phandle", kinfo->phandle_gic);
-    if (res)
-        return res;
+    ret = fdt_finish(kinfo->fdt);
+    if ( ret < 0 )
+        goto err;
 
-    res = fdt_end_node(fdt);
+    return 0;
 
-    return res;
+  err:
+    printk("Device tree generation failed (%d).\n", ret);
+    xfree(kinfo->fdt);
+    return -EINVAL;
 }
-#endif
 
-#ifdef CONFIG_GICV3
-static int __init make_gicv3_domU_node(struct kernel_info *kinfo)
+static void __init dtb_load(struct kernel_info *kinfo)
 {
-    void *fdt = kinfo->fdt;
-    int res = 0;
-    __be32 *reg, *cells;
-    const struct domain *d = kinfo->d;
-    unsigned int i, len = 0;
-
-    res = domain_fdt_begin_node(fdt, "interrupt-controller",
-                                vgic_dist_base(&d->arch.vgic));
-    if ( res )
-        return res;
-
-    res = fdt_property_cell(fdt, "#address-cells", 0);
-    if ( res )
-        return res;
-
-    res = fdt_property_cell(fdt, "#interrupt-cells", 3);
-    if ( res )
-        return res;
-
-    res = fdt_property(fdt, "interrupt-controller", NULL, 0);
-    if ( res )
-        return res;
-
-    res = fdt_property_string(fdt, "compatible", "arm,gic-v3");
-    if ( res )
-        return res;
-
-    /* reg specifies all re-distributors and Distributor. */
-    len = (GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS) *
-          (d->arch.vgic.nr_regions + 1) * sizeof(__be32);
-    reg = xmalloc_bytes(len);
-    if ( reg == NULL )
-        return -ENOMEM;
-    cells = reg;
-
-    dt_child_set_range(&cells, GUEST_ROOT_ADDRESS_CELLS, GUEST_ROOT_SIZE_CELLS,
-                       vgic_dist_base(&d->arch.vgic), GUEST_GICV3_GICD_SIZE);
-
-    for ( i = 0; i < d->arch.vgic.nr_regions; i++ )
-        dt_child_set_range(&cells,
-                           GUEST_ROOT_ADDRESS_CELLS, GUEST_ROOT_SIZE_CELLS,
-                           d->arch.vgic.rdist_regions[i].base,
-                           d->arch.vgic.rdist_regions[i].size);
-
-    res = fdt_property(fdt, "reg", reg, len);
-    xfree(reg);
-    if (res)
-        return res;
-
-    res = fdt_property_cell(fdt, "linux,phandle", kinfo->phandle_gic);
-    if (res)
-        return res;
-
-    res = fdt_property_cell(fdt, "phandle", kinfo->phandle_gic);
-    if (res)
-        return res;
+    unsigned long left;
 
-    res = fdt_end_node(fdt);
+    printk("Loading %pd DTB to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
+           kinfo->d, kinfo->dtb_paddr,
+           kinfo->dtb_paddr + fdt_totalsize(kinfo->fdt));
 
-    return res;
-}
-#endif
+    left = copy_to_guest_phys_flush_dcache(kinfo->d, kinfo->dtb_paddr,
+                                           kinfo->fdt,
+                                           fdt_totalsize(kinfo->fdt));
 
-static int __init make_gic_domU_node(struct kernel_info *kinfo)
-{
-    switch ( kinfo->d->arch.vgic.version )
-    {
-#ifdef CONFIG_GICV3
-    case GIC_V3:
-        return make_gicv3_domU_node(kinfo);
-#endif
-#ifdef CONFIG_VGICV2
-    case GIC_V2:
-        return make_gicv2_domU_node(kinfo);
-#endif
-    default:
-        panic("Unsupported GIC version\n");
-    }
+    if ( left != 0 )
+        panic("Unable to copy the DTB to %pd memory (left = %lu bytes)\n",
+              kinfo->d, left);
+    xfree(kinfo->fdt);
 }
 
-#ifdef CONFIG_SBSA_VUART_CONSOLE
-static int __init make_vpl011_uart_node(struct kernel_info *kinfo)
+static void __init initrd_load(struct kernel_info *kinfo)
 {
-    void *fdt = kinfo->fdt;
+    const struct bootmodule *mod = kinfo->initrd_bootmodule;
+    paddr_t load_addr = kinfo->initrd_paddr;
+    paddr_t paddr, len;
+    int node;
     int res;
-    gic_interrupt_t intr;
-    __be32 reg[GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS];
-    __be32 *cells;
-    struct domain *d = kinfo->d;
-
-    res = domain_fdt_begin_node(fdt, "sbsa-uart", d->arch.vpl011.base_addr);
-    if ( res )
-        return res;
+    __be32 val[2];
+    __be32 *cellp;
+    void __iomem *initrd;
 
-    res = fdt_property_string(fdt, "compatible", "arm,sbsa-uart");
-    if ( res )
-        return res;
+    if ( !mod || !mod->size )
+        return;
 
-    cells = &reg[0];
-    dt_child_set_range(&cells, GUEST_ROOT_ADDRESS_CELLS,
-                       GUEST_ROOT_SIZE_CELLS, d->arch.vpl011.base_addr,
-                       GUEST_PL011_SIZE);
+    paddr = mod->start;
+    len = mod->size;
 
-    res = fdt_property(fdt, "reg", reg, sizeof(reg));
-    if ( res )
-        return res;
+    printk("Loading %pd initrd from %"PRIpaddr" to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
+           kinfo->d, paddr, load_addr, load_addr + len);
 
-    set_interrupt(intr, d->arch.vpl011.virq, 0xf, DT_IRQ_TYPE_LEVEL_HIGH);
+    /* Fix up linux,initrd-start and linux,initrd-end in /chosen */
+    node = fdt_path_offset(kinfo->fdt, "/chosen");
+    if ( node < 0 )
+        panic("Cannot find the /chosen node\n");
 
-    res = fdt_property(fdt, "interrupts", intr, sizeof (intr));
+    cellp = (__be32 *)val;
+    dt_set_cell(&cellp, ARRAY_SIZE(val), load_addr);
+    res = fdt_setprop_inplace(kinfo->fdt, node, "linux,initrd-start",
+                              val, sizeof(val));
     if ( res )
-        return res;
+        panic("Cannot fix up \"linux,initrd-start\" property\n");
 
-    res = fdt_property_cell(fdt, "interrupt-parent",
-                            kinfo->phandle_gic);
+    cellp = (__be32 *)val;
+    dt_set_cell(&cellp, ARRAY_SIZE(val), load_addr + len);
+    res = fdt_setprop_inplace(kinfo->fdt, node, "linux,initrd-end",
+                              val, sizeof(val));
     if ( res )
-        return res;
+        panic("Cannot fix up \"linux,initrd-end\" property\n");
 
-    /* Use a default baud rate of 115200. */
-    fdt_property_u32(fdt, "current-speed", 115200);
+    initrd = ioremap_wc(paddr, len);
+    if ( !initrd )
+        panic("Unable to map the hwdom initrd\n");
 
-    res = fdt_end_node(fdt);
-    if ( res )
-        return res;
+    res = copy_to_guest_phys_flush_dcache(kinfo->d, load_addr,
+                                          initrd, len);
+    if ( res != 0 )
+        panic("Unable to copy the initrd in the hwdom memory\n");
 
-    return 0;
+    iounmap(initrd);
 }
-#endif
 
 /*
- * Scan device tree properties for passthrough specific information.
- * Returns < 0 on error
- *         0 on success
+ * Allocate the event channel PPIs and setup the HVM_PARAM_CALLBACK_IRQ.
+ * The allocated IRQ will be found in d->arch.evtchn_irq.
+ *
+ * Note that this should only be called once all PPIs used by the
+ * hardware domain have been registered.
  */
-static int __init handle_passthrough_prop(struct kernel_info *kinfo,
-                                          const struct fdt_property *xen_reg,
-                                          const struct fdt_property *xen_path,
-                                          bool xen_force,
-                                          uint32_t address_cells, uint32_t size_cells)
+void __init evtchn_allocate(struct domain *d)
 {
-    const __be32 *cell;
-    unsigned int i, len;
-    struct dt_device_node *node;
     int res;
-    paddr_t mstart, size, gstart;
+    u64 val;
 
-    /* xen,reg specifies where to map the MMIO region */
-    cell = (const __be32 *)xen_reg->data;
-    len = fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) *
-                                        sizeof(uint32_t));
+    res = vgic_allocate_ppi(d);
+    if ( res < 0 )
+        panic("Unable to allocate a PPI for the event channel interrupt\n");
 
-    for ( i = 0; i < len; i++ )
-    {
-        device_tree_get_reg(&cell, address_cells, size_cells,
-                            &mstart, &size);
-        gstart = dt_next_cell(address_cells, &cell);
+    d->arch.evtchn_irq = res;
 
-        if ( gstart & ~PAGE_MASK || mstart & ~PAGE_MASK || size & ~PAGE_MASK )
-        {
-            printk(XENLOG_ERR
-                    "DomU passthrough config has not page aligned addresses/sizes\n");
-            return -EINVAL;
-        }
+    printk("Allocating PPI %u for event channel interrupt\n",
+           d->arch.evtchn_irq);
 
-        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%"PRIpaddr" - 0x%"PRIpaddr"\n",
-                   kinfo->d->domain_id,
-                   mstart & PAGE_MASK, PAGE_ALIGN(mstart + size) - 1);
-            return res;
-        }
+    /* Set the value of domain param HVM_PARAM_CALLBACK_IRQ */
+    val = MASK_INSR(HVM_PARAM_CALLBACK_TYPE_PPI,
+                    HVM_PARAM_CALLBACK_IRQ_TYPE_MASK);
+    /* Active-low level-sensitive  */
+    val |= MASK_INSR(HVM_PARAM_CALLBACK_TYPE_PPI_FLAG_LOW_LEVEL,
+                     HVM_PARAM_CALLBACK_TYPE_PPI_FLAG_MASK);
+    val |= d->arch.evtchn_irq;
+    d->arch.hvm.params[HVM_PARAM_CALLBACK_IRQ] = val;
+}
 
-        res = map_regions_p2mt(kinfo->d,
-                               gaddr_to_gfn(gstart),
-                               PFN_DOWN(size),
-                               maddr_to_mfn(mstart),
-                               p2m_mmio_direct_dev);
-        if ( res < 0 )
-        {
-            printk(XENLOG_ERR
-                   "Failed to map %"PRIpaddr" to the guest at%"PRIpaddr"\n",
-                   mstart, gstart);
-            return -EFAULT;
-        }
-    }
+static int __init get_evtchn_dt_property(const struct dt_device_node *np,
+                                         uint32_t *port, uint32_t *phandle)
+{
+    const __be32 *prop = NULL;
+    uint32_t len;
 
-    /*
-     * If xen_force, we let the user assign a MMIO region with no
-     * associated path.
-     */
-    if ( xen_path == NULL )
-        return xen_force ? 0 : -EINVAL;
+    prop = dt_get_property(np, "xen,evtchn", &len);
+    if ( !prop )
+    {
+        printk(XENLOG_ERR "xen,evtchn property should not be empty.\n");
+        return -EINVAL;
+    }
 
-    /*
-     * xen,path specifies the corresponding node in the host DT.
-     * Both interrupt mappings and IOMMU settings are based on it,
-     * as they are done based on the corresponding host DT node.
-     */
-    node = dt_find_node_by_path(xen_path->data);
-    if ( node == NULL )
+    if ( !len || len < dt_cells_to_size(STATIC_EVTCHN_NODE_SIZE_CELLS) )
     {
-        printk(XENLOG_ERR "Couldn't find node %s in host_dt!\n",
-               (char *)xen_path->data);
-        return -EINVAL;
-    }
-
-    res = map_device_irqs_to_domain(kinfo->d, node, true, NULL);
-    if ( res < 0 )
-        return res;
-
-    res = iommu_add_dt_device(node);
-    if ( res < 0 )
-        return res;
-
-    /* If xen_force, we allow assignment of devices without IOMMU protection. */
-    if ( xen_force && !dt_device_is_protected(node) )
-        return 0;
-
-    return iommu_assign_dt_device(kinfo->d, node);
-}
-
-static int __init handle_prop_pfdt(struct kernel_info *kinfo,
-                                   const void *pfdt, int nodeoff,
-                                   uint32_t address_cells, uint32_t size_cells,
-                                   bool scan_passthrough_prop)
-{
-    void *fdt = kinfo->fdt;
-    int propoff, nameoff, res;
-    const struct fdt_property *prop, *xen_reg = NULL, *xen_path = NULL;
-    const char *name;
-    bool found, xen_force = false;
-
-    for ( propoff = fdt_first_property_offset(pfdt, nodeoff);
-          propoff >= 0;
-          propoff = fdt_next_property_offset(pfdt, propoff) )
-    {
-        if ( !(prop = fdt_get_property_by_offset(pfdt, propoff, NULL)) )
-            return -FDT_ERR_INTERNAL;
-
-        found = false;
-        nameoff = fdt32_to_cpu(prop->nameoff);
-        name = fdt_string(pfdt, nameoff);
-
-        if ( scan_passthrough_prop )
-        {
-            if ( dt_prop_cmp("xen,reg", name) == 0 )
-            {
-                xen_reg = prop;
-                found = true;
-            }
-            else if ( dt_prop_cmp("xen,path", name) == 0 )
-            {
-                xen_path = prop;
-                found = true;
-            }
-            else if ( dt_prop_cmp("xen,force-assign-without-iommu",
-                                  name) == 0 )
-            {
-                xen_force = true;
-                found = true;
-            }
-        }
-
-        /*
-         * Copy properties other than the ones above: xen,reg, xen,path,
-         * and xen,force-assign-without-iommu.
-         */
-        if ( !found )
-        {
-            res = fdt_property(fdt, name, prop->data, fdt32_to_cpu(prop->len));
-            if ( res )
-                return res;
-        }
-    }
-
-    /*
-     * Only handle passthrough properties if both xen,reg and xen,path
-     * are present, or if xen,force-assign-without-iommu is specified.
-     */
-    if ( xen_reg != NULL && (xen_path != NULL || xen_force) )
-    {
-        res = handle_passthrough_prop(kinfo, xen_reg, xen_path, xen_force,
-                                      address_cells, size_cells);
-        if ( res < 0 )
-        {
-            printk(XENLOG_ERR "Failed to assign device to %pd\n", kinfo->d);
-            return res;
-        }
-    }
-    else if ( (xen_path && !xen_reg) || (xen_reg && !xen_path && !xen_force) )
-    {
-        printk(XENLOG_ERR "xen,reg or xen,path missing for %pd\n",
-               kinfo->d);
-        return -EINVAL;
-    }
-
-    /* FDT_ERR_NOTFOUND => There is no more properties for this node */
-    return ( propoff != -FDT_ERR_NOTFOUND ) ? propoff : 0;
-}
-
-static int __init scan_pfdt_node(struct kernel_info *kinfo, const void *pfdt,
-                                 int nodeoff,
-                                 uint32_t address_cells, uint32_t size_cells,
-                                 bool scan_passthrough_prop)
-{
-    int rc = 0;
-    void *fdt = kinfo->fdt;
-    int node_next;
-
-    rc = fdt_begin_node(fdt, fdt_get_name(pfdt, nodeoff, NULL));
-    if ( rc )
-        return rc;
-
-    rc = handle_prop_pfdt(kinfo, pfdt, nodeoff, address_cells, size_cells,
-                          scan_passthrough_prop);
-    if ( rc )
-        return rc;
-
-    address_cells = device_tree_get_u32(pfdt, nodeoff, "#address-cells",
-                                        DT_ROOT_NODE_ADDR_CELLS_DEFAULT);
-    size_cells = device_tree_get_u32(pfdt, nodeoff, "#size-cells",
-                                     DT_ROOT_NODE_SIZE_CELLS_DEFAULT);
-
-    node_next = fdt_first_subnode(pfdt, nodeoff);
-    while ( node_next > 0 )
-    {
-        rc = scan_pfdt_node(kinfo, pfdt, node_next, address_cells, size_cells,
-                            scan_passthrough_prop);
-        if ( rc )
-            return rc;
-
-        node_next = fdt_next_subnode(pfdt, node_next);
-    }
-
-    return fdt_end_node(fdt);
-}
-
-static int __init check_partial_fdt(void *pfdt, size_t size)
-{
-    int res;
-
-    if ( fdt_magic(pfdt) != FDT_MAGIC )
-    {
-        dprintk(XENLOG_ERR, "Partial FDT is not a valid Flat Device Tree");
-        return -EINVAL;
-    }
-
-    res = fdt_check_header(pfdt);
-    if ( res )
-    {
-        dprintk(XENLOG_ERR, "Failed to check the partial FDT (%d)", res);
-        return -EINVAL;
-    }
-
-    if ( fdt_totalsize(pfdt) > size )
-    {
-        dprintk(XENLOG_ERR, "Partial FDT totalsize is too big");
-        return -EINVAL;
-    }
-
-    return 0;
-}
-
-static int __init domain_handle_dtb_bootmodule(struct domain *d,
-                                               struct kernel_info *kinfo)
-{
-    void *pfdt;
-    int res, node_next;
-
-    pfdt = ioremap_cache(kinfo->dtb_bootmodule->start,
-                         kinfo->dtb_bootmodule->size);
-    if ( pfdt == NULL )
-        return -EFAULT;
-
-    res = check_partial_fdt(pfdt, kinfo->dtb_bootmodule->size);
-    if ( res < 0 )
-        goto out;
-
-    for ( node_next = fdt_first_subnode(pfdt, 0); 
-          node_next > 0;
-          node_next = fdt_next_subnode(pfdt, node_next) )
-    {
-        const char *name = fdt_get_name(pfdt, node_next, NULL);
-
-        if ( name == NULL )
-            continue;
-
-        /*
-         * Only scan /gic /aliases /passthrough, ignore the rest.
-         * They don't have to be parsed in order.
-         *
-         * Take the GIC phandle value from the special /gic node in the
-         * DTB fragment.
-         */
-        if ( dt_node_cmp(name, "gic") == 0 )
-        {
-            kinfo->phandle_gic = fdt_get_phandle(pfdt, node_next);
-            continue;
-        }
-
-        if ( dt_node_cmp(name, "aliases") == 0 )
-        {
-            res = scan_pfdt_node(kinfo, pfdt, node_next,
-                                 DT_ROOT_NODE_ADDR_CELLS_DEFAULT,
-                                 DT_ROOT_NODE_SIZE_CELLS_DEFAULT,
-                                 false);
-            if ( res )
-                goto out;
-            continue;
-        }
-        if ( dt_node_cmp(name, "passthrough") == 0 )
-        {
-            res = scan_pfdt_node(kinfo, pfdt, node_next,
-                                 DT_ROOT_NODE_ADDR_CELLS_DEFAULT,
-                                 DT_ROOT_NODE_SIZE_CELLS_DEFAULT,
-                                 true);
-            if ( res )
-                goto out;
-            continue;
-        }
-    }
-
- out:
-    iounmap(pfdt);
-
-    return res;
-}
-
-/*
- * The max size for DT is 2MB. However, the generated DT is small (not including
- * domU passthrough DT nodes whose size we account separately), 4KB are enough
- * for now, but we might have to increase it in the future.
- */
-#define DOMU_DTB_SIZE 4096
-static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
-{
-    int addrcells, sizecells;
-    int ret, fdt_size = DOMU_DTB_SIZE;
-
-    kinfo->phandle_gic = GUEST_PHANDLE_GIC;
-    kinfo->gnttab_start = GUEST_GNTTAB_BASE;
-    kinfo->gnttab_size = GUEST_GNTTAB_SIZE;
-
-    addrcells = GUEST_ROOT_ADDRESS_CELLS;
-    sizecells = GUEST_ROOT_SIZE_CELLS;
-
-    /* Account for domU passthrough DT size */
-    if ( kinfo->dtb_bootmodule )
-        fdt_size += kinfo->dtb_bootmodule->size;
-
-    /* Cap to max DT size if needed */
-    fdt_size = min(fdt_size, SZ_2M);
-
-    kinfo->fdt = xmalloc_bytes(fdt_size);
-    if ( kinfo->fdt == NULL )
-        return -ENOMEM;
-
-    ret = fdt_create(kinfo->fdt, fdt_size);
-    if ( ret < 0 )
-        goto err;
-
-    ret = fdt_finish_reservemap(kinfo->fdt);
-    if ( ret < 0 )
-        goto err;
-
-    ret = fdt_begin_node(kinfo->fdt, "");
-    if ( ret < 0 )
-        goto err;
-
-    ret = fdt_property_cell(kinfo->fdt, "#address-cells", addrcells);
-    if ( ret )
-        goto err;
-
-    ret = fdt_property_cell(kinfo->fdt, "#size-cells", sizecells);
-    if ( ret )
-        goto err;
-
-    ret = make_chosen_node(kinfo);
-    if ( ret )
-        goto err;
-
-    ret = make_psci_node(kinfo->fdt);
-    if ( ret )
-        goto err;
-
-    ret = make_cpus_node(d, kinfo->fdt);
-    if ( ret )
-        goto err;
-
-    ret = make_memory_node(d, kinfo->fdt, addrcells, sizecells, &kinfo->mem);
-    if ( ret )
-        goto err;
-
-    ret = make_resv_memory_node(d, kinfo->fdt, addrcells, sizecells,
-                                &kinfo->shm_mem);
-    if ( ret )
-        goto err;
-
-    /*
-     * domain_handle_dtb_bootmodule has to be called before the rest of
-     * the device tree is generated because it depends on the value of
-     * the field phandle_gic.
-     */
-    if ( kinfo->dtb_bootmodule )
-    {
-        ret = domain_handle_dtb_bootmodule(d, kinfo);
-        if ( ret )
-            goto err;
-    }
-
-    ret = make_gic_domU_node(kinfo);
-    if ( ret )
-        goto err;
-
-    ret = make_timer_node(kinfo);
-    if ( ret )
-        goto err;
-
-    if ( kinfo->vpl011 )
-    {
-        ret = -EINVAL;
-#ifdef CONFIG_SBSA_VUART_CONSOLE
-        ret = make_vpl011_uart_node(kinfo);
-#endif
-        if ( ret )
-            goto err;
-    }
-
-    if ( kinfo->dom0less_feature & DOM0LESS_ENHANCED_NO_XS )
-    {
-        ret = make_hypervisor_node(d, kinfo, addrcells, sizecells);
-        if ( ret )
-            goto err;
-    }
-
-    ret = fdt_end_node(kinfo->fdt);
-    if ( ret < 0 )
-        goto err;
-
-    ret = fdt_finish(kinfo->fdt);
-    if ( ret < 0 )
-        goto err;
-
-    return 0;
-
-  err:
-    printk("Device tree generation failed (%d).\n", ret);
-    xfree(kinfo->fdt);
-
-    return -EINVAL;
-}
-
-static int __init prepare_dtb_hwdom(struct domain *d, struct kernel_info *kinfo)
-{
-    const p2m_type_t default_p2mt = p2m_mmio_direct_c;
-    const void *fdt;
-    int new_size;
-    int ret;
-
-    ASSERT(dt_host && (dt_host->sibling == NULL));
-
-    kinfo->phandle_gic = dt_interrupt_controller->phandle;
-    fdt = device_tree_flattened;
-
-    new_size = fdt_totalsize(fdt) + DOM0_FDT_EXTRA_SIZE;
-    kinfo->fdt = xmalloc_bytes(new_size);
-    if ( kinfo->fdt == NULL )
-        return -ENOMEM;
-
-    ret = fdt_create(kinfo->fdt, new_size);
-    if ( ret < 0 )
-        goto err;
-
-    fdt_finish_reservemap(kinfo->fdt);
-
-    ret = handle_node(d, kinfo, dt_host, default_p2mt);
-    if ( ret )
-        goto err;
-
-    ret = fdt_finish(kinfo->fdt);
-    if ( ret < 0 )
-        goto err;
-
-    return 0;
-
-  err:
-    printk("Device tree generation failed (%d).\n", ret);
-    xfree(kinfo->fdt);
-    return -EINVAL;
-}
-
-static void __init dtb_load(struct kernel_info *kinfo)
-{
-    unsigned long left;
-
-    printk("Loading %pd DTB to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
-           kinfo->d, kinfo->dtb_paddr,
-           kinfo->dtb_paddr + fdt_totalsize(kinfo->fdt));
-
-    left = copy_to_guest_phys_flush_dcache(kinfo->d, kinfo->dtb_paddr,
-                                           kinfo->fdt,
-                                           fdt_totalsize(kinfo->fdt));
-
-    if ( left != 0 )
-        panic("Unable to copy the DTB to %pd memory (left = %lu bytes)\n",
-              kinfo->d, left);
-    xfree(kinfo->fdt);
-}
-
-static void __init initrd_load(struct kernel_info *kinfo)
-{
-    const struct bootmodule *mod = kinfo->initrd_bootmodule;
-    paddr_t load_addr = kinfo->initrd_paddr;
-    paddr_t paddr, len;
-    int node;
-    int res;
-    __be32 val[2];
-    __be32 *cellp;
-    void __iomem *initrd;
-
-    if ( !mod || !mod->size )
-        return;
-
-    paddr = mod->start;
-    len = mod->size;
-
-    printk("Loading %pd initrd from %"PRIpaddr" to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
-           kinfo->d, paddr, load_addr, load_addr + len);
-
-    /* Fix up linux,initrd-start and linux,initrd-end in /chosen */
-    node = fdt_path_offset(kinfo->fdt, "/chosen");
-    if ( node < 0 )
-        panic("Cannot find the /chosen node\n");
-
-    cellp = (__be32 *)val;
-    dt_set_cell(&cellp, ARRAY_SIZE(val), load_addr);
-    res = fdt_setprop_inplace(kinfo->fdt, node, "linux,initrd-start",
-                              val, sizeof(val));
-    if ( res )
-        panic("Cannot fix up \"linux,initrd-start\" property\n");
-
-    cellp = (__be32 *)val;
-    dt_set_cell(&cellp, ARRAY_SIZE(val), load_addr + len);
-    res = fdt_setprop_inplace(kinfo->fdt, node, "linux,initrd-end",
-                              val, sizeof(val));
-    if ( res )
-        panic("Cannot fix up \"linux,initrd-end\" property\n");
-
-    initrd = ioremap_wc(paddr, len);
-    if ( !initrd )
-        panic("Unable to map the hwdom initrd\n");
-
-    res = copy_to_guest_phys_flush_dcache(kinfo->d, load_addr,
-                                          initrd, len);
-    if ( res != 0 )
-        panic("Unable to copy the initrd in the hwdom memory\n");
-
-    iounmap(initrd);
-}
-
-/*
- * Allocate the event channel PPIs and setup the HVM_PARAM_CALLBACK_IRQ.
- * The allocated IRQ will be found in d->arch.evtchn_irq.
- *
- * Note that this should only be called once all PPIs used by the
- * hardware domain have been registered.
- */
-void __init evtchn_allocate(struct domain *d)
-{
-    int res;
-    u64 val;
-
-    res = vgic_allocate_ppi(d);
-    if ( res < 0 )
-        panic("Unable to allocate a PPI for the event channel interrupt\n");
-
-    d->arch.evtchn_irq = res;
-
-    printk("Allocating PPI %u for event channel interrupt\n",
-           d->arch.evtchn_irq);
-
-    /* Set the value of domain param HVM_PARAM_CALLBACK_IRQ */
-    val = MASK_INSR(HVM_PARAM_CALLBACK_TYPE_PPI,
-                    HVM_PARAM_CALLBACK_IRQ_TYPE_MASK);
-    /* Active-low level-sensitive  */
-    val |= MASK_INSR(HVM_PARAM_CALLBACK_TYPE_PPI_FLAG_LOW_LEVEL,
-                     HVM_PARAM_CALLBACK_TYPE_PPI_FLAG_MASK);
-    val |= d->arch.evtchn_irq;
-    d->arch.hvm.params[HVM_PARAM_CALLBACK_IRQ] = val;
-}
-
-static int __init get_evtchn_dt_property(const struct dt_device_node *np,
-                                         uint32_t *port, uint32_t *phandle)
-{
-    const __be32 *prop = NULL;
-    uint32_t len;
-
-    prop = dt_get_property(np, "xen,evtchn", &len);
-    if ( !prop )
-    {
-        printk(XENLOG_ERR "xen,evtchn property should not be empty.\n");
-        return -EINVAL;
-    }
-
-    if ( !len || len < dt_cells_to_size(STATIC_EVTCHN_NODE_SIZE_CELLS) )
-    {
-        printk(XENLOG_ERR "xen,evtchn property value is not valid.\n");
+        printk(XENLOG_ERR "xen,evtchn property value is not valid.\n");
         return -EINVAL;
     }
 
@@ -3413,22 +2733,7 @@ static void __init find_gnttab_region(struct domain *d,
            kinfo->gnttab_start, kinfo->gnttab_start + kinfo->gnttab_size);
 }
 
-static unsigned long __init domain_p2m_pages(unsigned long maxmem_kb,
-                                             unsigned int smp_cpus)
-{
-    /*
-     * Keep in sync with libxl__get_required_paging_memory().
-     * 256 pages (1MB) per vcpu, plus 1 page per MiB of RAM for the P2M map,
-     * plus 128 pages to cover extended regions.
-     */
-    unsigned long memkb = 4 * (256 * smp_cpus + (maxmem_kb / 1024) + 128);
-
-    BUILD_BUG_ON(PAGE_SIZE != SZ_4K);
-
-    return DIV_ROUND_UP(memkb, 1024) << (20 - PAGE_SHIFT);
-}
-
-static int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
+int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
 {
     unsigned int i;
     struct vcpu *v = d->vcpu[0];
@@ -3519,296 +2824,6 @@ static int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
     return 0;
 }
 
-static int __init alloc_xenstore_evtchn(struct domain *d)
-{
-    evtchn_alloc_unbound_t alloc;
-    int rc;
-
-    alloc.dom = d->domain_id;
-    alloc.remote_dom = hardware_domain->domain_id;
-    rc = evtchn_alloc_unbound(&alloc, 0);
-    if ( rc )
-    {
-        printk("Failed allocating event channel for domain\n");
-        return rc;
-    }
-
-    d->arch.hvm.params[HVM_PARAM_STORE_EVTCHN] = alloc.port;
-
-    return 0;
-}
-
-static int __init construct_domU(struct domain *d,
-                                 const struct dt_device_node *node)
-{
-    struct kernel_info kinfo = {};
-    const char *dom0less_enhanced;
-    int rc;
-    u64 mem;
-    u32 p2m_mem_mb;
-    unsigned long p2m_pages;
-
-    rc = dt_property_read_u64(node, "memory", &mem);
-    if ( !rc )
-    {
-        printk("Error building DomU: cannot read \"memory\" property\n");
-        return -EINVAL;
-    }
-    kinfo.unassigned_mem = (paddr_t)mem * SZ_1K;
-
-    rc = dt_property_read_u32(node, "xen,domain-p2m-mem-mb", &p2m_mem_mb);
-    /* If xen,domain-p2m-mem-mb is not specified, use the default value. */
-    p2m_pages = rc ?
-                p2m_mem_mb << (20 - PAGE_SHIFT) :
-                domain_p2m_pages(mem, d->max_vcpus);
-
-    spin_lock(&d->arch.paging.lock);
-    rc = p2m_set_allocation(d, p2m_pages, NULL);
-    spin_unlock(&d->arch.paging.lock);
-    if ( rc != 0 )
-        return rc;
-
-    printk("*** LOADING DOMU cpus=%u memory=%#"PRIx64"KB ***\n",
-           d->max_vcpus, mem);
-
-    kinfo.vpl011 = dt_property_read_bool(node, "vpl011");
-
-    rc = dt_property_read_string(node, "xen,enhanced", &dom0less_enhanced);
-    if ( rc == -EILSEQ ||
-         rc == -ENODATA ||
-         (rc == 0 && !strcmp(dom0less_enhanced, "enabled")) )
-    {
-        if ( hardware_domain )
-            kinfo.dom0less_feature = DOM0LESS_ENHANCED;
-        else
-            panic("At the moment, Xenstore support requires dom0 to be present\n");
-    }
-    else if ( rc == 0 && !strcmp(dom0less_enhanced, "no-xenstore") )
-        kinfo.dom0less_feature = DOM0LESS_ENHANCED_NO_XS;
-
-    if ( vcpu_create(d, 0) == NULL )
-        return -ENOMEM;
-
-    d->max_pages = ((paddr_t)mem * SZ_1K) >> PAGE_SHIFT;
-
-    kinfo.d = d;
-
-    rc = kernel_probe(&kinfo, node);
-    if ( rc < 0 )
-        return rc;
-
-#ifdef CONFIG_ARM_64
-    /* type must be set before allocate memory */
-    d->arch.type = kinfo.type;
-#endif
-    if ( !dt_find_property(node, "xen,static-mem", NULL) )
-        allocate_memory(d, &kinfo);
-    else if ( !is_domain_direct_mapped(d) )
-        allocate_static_memory(d, &kinfo, node);
-    else
-        assign_static_memory_11(d, &kinfo, node);
-
-#ifdef CONFIG_STATIC_SHM
-    rc = process_shm(d, &kinfo, node);
-    if ( rc < 0 )
-        return rc;
-#endif
-
-    /*
-     * Base address and irq number are needed when creating vpl011 device
-     * tree node in prepare_dtb_domU, so initialization on related variables
-     * shall be done first.
-     */
-    if ( kinfo.vpl011 )
-    {
-        rc = domain_vpl011_init(d, NULL);
-        if ( rc < 0 )
-            return rc;
-    }
-
-    rc = prepare_dtb_domU(d, &kinfo);
-    if ( rc < 0 )
-        return rc;
-
-    rc = construct_domain(d, &kinfo);
-    if ( rc < 0 )
-        return rc;
-
-    if ( kinfo.dom0less_feature & DOM0LESS_XENSTORE )
-    {
-        ASSERT(hardware_domain);
-        rc = alloc_xenstore_evtchn(d);
-        if ( rc < 0 )
-            return rc;
-        d->arch.hvm.params[HVM_PARAM_STORE_PFN] = ~0ULL;
-    }
-
-    return rc;
-}
-
-void __init create_domUs(void)
-{
-    struct dt_device_node *node;
-    const struct dt_device_node *cpupool_node,
-                                *chosen = dt_find_node_by_path("/chosen");
-
-    BUG_ON(chosen == NULL);
-    dt_for_each_child_node(chosen, node)
-    {
-        struct domain *d;
-        struct xen_domctl_createdomain d_cfg = {
-            .arch.gic_version = XEN_DOMCTL_CONFIG_GIC_NATIVE,
-            .flags = XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap,
-            /*
-             * The default of 1023 should be sufficient for guests because
-             * on ARM we don't bind physical interrupts to event channels.
-             * The only use of the evtchn port is inter-domain communications.
-             * 1023 is also the default value used in libxl.
-             */
-            .max_evtchn_port = 1023,
-            .max_grant_frames = -1,
-            .max_maptrack_frames = -1,
-            .grant_opts = XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),
-        };
-        unsigned int flags = 0U;
-        uint32_t val;
-        int rc;
-
-        if ( !dt_device_is_compatible(node, "xen,domain") )
-            continue;
-
-        if ( (max_init_domid + 1) >= DOMID_FIRST_RESERVED )
-            panic("No more domain IDs available\n");
-
-        if ( dt_find_property(node, "xen,static-mem", NULL) )
-            flags |= CDF_staticmem;
-
-        if ( dt_property_read_bool(node, "direct-map") )
-        {
-            if ( !(flags & CDF_staticmem) )
-                panic("direct-map is not valid for domain %s without static allocation.\n",
-                      dt_node_name(node));
-
-            flags |= CDF_directmap;
-        }
-
-        if ( !dt_property_read_u32(node, "cpus", &d_cfg.max_vcpus) )
-            panic("Missing property 'cpus' for domain %s\n",
-                  dt_node_name(node));
-
-        if ( dt_find_compatible_node(node, NULL, "multiboot,device-tree") &&
-             iommu_enabled )
-            d_cfg.flags |= XEN_DOMCTL_CDF_iommu;
-
-        if ( !dt_property_read_u32(node, "nr_spis", &d_cfg.arch.nr_spis) )
-        {
-            int vpl011_virq = GUEST_VPL011_SPI;
-
-            d_cfg.arch.nr_spis = gic_number_lines() - 32;
-
-            /*
-             * The VPL011 virq is GUEST_VPL011_SPI, unless direct-map is
-             * set, in which case it'll match the hardware.
-             *
-             * Since the domain is not yet created, we can't use
-             * d->arch.vpl011.irq. So the logic to find the vIRQ has to
-             * be hardcoded.
-             * The logic here shall be consistent with the one in
-             * domain_vpl011_init().
-             */
-            if ( flags & CDF_directmap )
-            {
-                vpl011_virq = serial_irq(SERHND_DTUART);
-                if ( vpl011_virq < 0 )
-                    panic("Error getting IRQ number for this serial port %d\n",
-                          SERHND_DTUART);
-            }
-
-            /*
-             * vpl011 uses one emulated SPI. If vpl011 is requested, make
-             * sure that we allocate enough SPIs for it.
-             */
-            if ( dt_property_read_bool(node, "vpl011") )
-                d_cfg.arch.nr_spis = MAX(d_cfg.arch.nr_spis,
-                                         vpl011_virq - 32 + 1);
-        }
-
-        /* Get the optional property domain-cpupool */
-        cpupool_node = dt_parse_phandle(node, "domain-cpupool", 0);
-        if ( cpupool_node )
-        {
-            int pool_id = btcpupools_get_domain_pool_id(cpupool_node);
-            if ( pool_id < 0 )
-                panic("Error getting cpupool id from domain-cpupool (%d)\n",
-                      pool_id);
-            d_cfg.cpupool_id = pool_id;
-        }
-
-        if ( dt_property_read_u32(node, "max_grant_version", &val) )
-            d_cfg.grant_opts = XEN_DOMCTL_GRANT_version(val);
-
-        if ( dt_property_read_u32(node, "max_grant_frames", &val) )
-        {
-            if ( val > INT32_MAX )
-                panic("max_grant_frames (%"PRIu32") overflow\n", val);
-            d_cfg.max_grant_frames = val;
-        }
-
-        if ( dt_property_read_u32(node, "max_maptrack_frames", &val) )
-        {
-            if ( val > INT32_MAX )
-                panic("max_maptrack_frames (%"PRIu32") overflow\n", val);
-            d_cfg.max_maptrack_frames = val;
-        }
-
-        if ( dt_get_property(node, "sve", &val) )
-        {
-#ifdef CONFIG_ARM64_SVE
-            unsigned int sve_vl_bits;
-            bool ret = false;
-
-            if ( !val )
-            {
-                /* Property found with no value, means max HW VL supported */
-                ret = sve_domctl_vl_param(-1, &sve_vl_bits);
-            }
-            else
-            {
-                if ( dt_property_read_u32(node, "sve", &val) )
-                    ret = sve_domctl_vl_param(val, &sve_vl_bits);
-                else
-                    panic("Error reading 'sve' property\n");
-            }
-
-            if ( ret )
-                d_cfg.arch.sve_vl = sve_encode_vl(sve_vl_bits);
-            else
-                panic("SVE vector length error\n");
-#else
-            panic("'sve' property found, but CONFIG_ARM64_SVE not selected\n");
-#endif
-        }
-
-        /*
-         * The variable max_init_domid is initialized with zero, so here it's
-         * very important to use the pre-increment operator to call
-         * domain_create() with a domid > 0. (domid == 0 is reserved for Dom0)
-         */
-        d = domain_create(++max_init_domid, &d_cfg, flags);
-        if ( IS_ERR(d) )
-            panic("Error creating domain %s (rc = %ld)\n",
-                  dt_node_name(node), PTR_ERR(d));
-
-        d->is_console = true;
-        dt_device_set_used_by(node, d->domain_id);
-
-        rc = construct_domU(d, node);
-        if ( rc )
-            panic("Could not set up domain %s (rc = %d)\n",
-                  dt_node_name(node), rc);
-    }
-}
-
 static int __init construct_dom0(struct domain *d)
 {
     struct kernel_info kinfo = {};
diff --git a/xen/arch/arm/include/asm/dom0less-build.h b/xen/arch/arm/include/asm/dom0less-build.h
new file mode 100644
index 0000000000..e027225803
--- /dev/null
+++ b/xen/arch/arm/include/asm/dom0less-build.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __ASM_DOM0LESS_BUILD_H_
+#define __ASM_DOM0LESS_BUILD_H_
+
+#include <xen/stdbool.h>
+
+void create_domUs(void);
+bool is_dom0less_mode(void);
+
+#endif /* __ASM_DOM0LESS_BUILD_H_ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/include/asm/domain_build.h b/xen/arch/arm/include/asm/domain_build.h
index b9329c9ee0..b9ae0d170c 100644
--- a/xen/arch/arm/include/asm/domain_build.h
+++ b/xen/arch/arm/include/asm/domain_build.h
@@ -4,9 +4,47 @@
 #include <xen/sched.h>
 #include <asm/kernel.h>
 
+typedef __be32 gic_interrupt_t[3];
+
+bool allocate_bank_memory(struct domain *d, struct kernel_info *kinfo,
+                          gfn_t sgfn, paddr_t tot_size);
+int construct_domain(struct domain *d, struct kernel_info *kinfo);
+int domain_fdt_begin_node(void *fdt, const char *name, uint64_t unit);
+int make_resv_memory_node(const struct domain *d, void *fdt, int addrcells,
+                          int sizecells, const struct meminfo *mem);
 int make_chosen_node(const struct kernel_info *kinfo);
+int make_cpus_node(const struct domain *d, void *fdt);
+int make_hypervisor_node(struct domain *d, const struct kernel_info *kinfo,
+                         int addrcells, int sizecells);
+int make_memory_node(const struct domain *d, void *fdt, int addrcells,
+                     int sizecells, struct meminfo *mem);
+int make_psci_node(void *fdt);
+int make_timer_node(const struct kernel_info *kinfo);
 void evtchn_allocate(struct domain *d);
 
+unsigned int get_allocation_size(paddr_t size);
+
+/*
+ * handle_device_interrupts retrieves the interrupts configuration from
+ * a device tree node and maps those interrupts to the target domain.
+ *
+ * Returns:
+ *   < 0 error
+ *   0   success
+ */
+int handle_device_interrupts(struct domain *d, struct dt_device_node *dev,
+                             bool need_mapping);
+
+/*
+ * Helper to write an interrupts with the GIC format
+ * This code is assuming the irq is an PPI.
+ */
+void set_interrupt(gic_interrupt_t interrupt, unsigned int irq,
+                   unsigned int cpumask, unsigned int level);
+
+int process_shm(struct domain *d, struct kernel_info *kinfo,
+                const struct dt_device_node *node);
+
 #ifndef CONFIG_ACPI
 static inline int prepare_acpi(struct domain *d, struct kernel_info *kinfo)
 {
@@ -17,6 +55,28 @@ static inline int prepare_acpi(struct domain *d, struct kernel_info *kinfo)
 #else
 int prepare_acpi(struct domain *d, struct kernel_info *kinfo);
 #endif
+
+#ifdef CONFIG_STATIC_MEMORY
+void allocate_static_memory(struct domain *d, struct kernel_info *kinfo,
+                            const struct dt_device_node *node);
+void assign_static_memory_11(struct domain *d, struct kernel_info *kinfo,
+                             const struct dt_device_node *node);
+#else
+static inline void allocate_static_memory(struct domain *d,
+                                          struct kernel_info *kinfo,
+                                          const struct dt_device_node *node)
+{
+    ASSERT_UNREACHABLE();
+}
+
+static inline void assign_static_memory_11(struct domain *d,
+                                           struct kernel_info *kinfo,
+                                           const struct dt_device_node *node)
+{
+    ASSERT_UNREACHABLE();
+}
+#endif
+
 #endif
 
 /*
diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index ccb857ca2e..6d670d68ae 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -135,7 +135,6 @@ void acpi_create_efi_mmap_table(struct domain *d,
 
 int acpi_make_efi_nodes(void *fdt, struct membank tbl_add[]);
 
-void create_domUs(void);
 void create_dom0(void);
 void alloc_static_evtchn(void);
 
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 9b90185749..3f1081bed2 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -34,6 +34,7 @@
 #include <xen/warning.h>
 #include <xen/hypercall.h>
 #include <asm/alternative.h>
+#include <asm/dom0less-build.h>
 #include <asm/page.h>
 #include <asm/current.h>
 #include <asm/setup.h>
@@ -724,38 +725,6 @@ void __init populate_boot_allocator(void)
     }
 }
 
-static bool __init is_dom0less_mode(void)
-{
-    struct bootmodules *mods = &bootinfo.modules;
-    struct bootmodule *mod;
-    unsigned int i;
-    bool dom0found = false;
-    bool domUfound = false;
-
-    /* Look into the bootmodules */
-    for ( i = 0 ; i < mods->nr_mods ; i++ )
-    {
-        mod = &mods->module[i];
-        /* Find if dom0 and domU kernels are present */
-        if ( mod->kind == BOOTMOD_KERNEL )
-        {
-            if ( mod->domU == false )
-            {
-                dom0found = true;
-                break;
-            }
-            else
-                domUfound = true;
-        }
-    }
-
-    /*
-     * If there is no dom0 kernel but at least one domU, then we are in
-     * dom0less mode
-     */
-    return ( !dom0found && domUfound );
-}
-
 size_t __read_mostly dcache_line_bytes;
 
 /* C entry point for boot CPU */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:35:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:35:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644624.1005880 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gGA-0007OT-Oy; Thu, 30 Nov 2023 12:35:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644624.1005880; Thu, 30 Nov 2023 12:35: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 1r8gGA-0007OM-MN; Thu, 30 Nov 2023 12:35:14 +0000
Received: by outflank-mailman (input) for mailman id 644624;
 Thu, 30 Nov 2023 12:35: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 1r8gG9-0007OA-9w
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:35: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 1r8gG9-0005SG-90
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:35:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gG9-0005TY-8F
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:35: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=OP9apmUVnTwX4DRr/QwSMUzoNIoE42gt2SwTQuDejNI=; b=cbRAK4l19RKe6W8MQ1j0y8pRix
	F+VVUj9aoaQ01Y3NjLkH7F0YHrZ7UFSNpxcJMFC3egsUXebe9HRZ5g17qxtV/LRTdyezHvwWXRPGU
	jPAmwhgB6codZj3CAmJBUHnU+AZg76WfeSSP5iBcUa6ab3H/4iZkyNnlWqvZtVYqd//Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Move static memory build code in separate modules
Message-Id: <E1r8gG9-0005TY-8F@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:35:13 +0000

commit d7d80e7a326d6e54797421d19874acb0817169aa
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Fri Nov 24 09:48:40 2023 +0000
Commit:     Julien Grall <julien@xen.org>
CommitDate: Tue Nov 28 19:21:27 2023 +0100

    xen/arm: Move static memory build code in separate modules
    
    Move static memory and static shared memory code in separate modules
    so that they are included only when the corresponding feature is
    enabled, doing that we modularise the features and we remove some
    ifdefs from the code to improve readability.
    
    Move process_shm_node function from bootfdt module and make it
    externally visible.
    
    A static inline helper called process_shm_chosen is introduced, it
    will call the process_shm function for the '/chosen' node, and will
    be used by the function construct_dom0 instead of using directly
    process_shm, allowing some #ifdef to be removed.
    
    No functional changes are intended.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/Makefile                    |   2 +
 xen/arch/arm/arm32/mmu/mm.c              |   1 +
 xen/arch/arm/arm64/mmu/mm.c              |   1 +
 xen/arch/arm/bootfdt.c                   | 161 +-------
 xen/arch/arm/dom0less-build.c            |   4 +-
 xen/arch/arm/domain_build.c              | 654 +------------------------------
 xen/arch/arm/include/asm/domain_build.h  |  26 --
 xen/arch/arm/include/asm/setup.h         |   1 -
 xen/arch/arm/include/asm/static-memory.h |  45 +++
 xen/arch/arm/include/asm/static-shmem.h  |  66 ++++
 xen/arch/arm/setup.c                     |  24 --
 xen/arch/arm/static-memory.c             | 287 ++++++++++++++
 xen/arch/arm/static-shmem.c              | 547 ++++++++++++++++++++++++++
 13 files changed, 954 insertions(+), 865 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index d65920b0a8..2fcc3c2535 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -51,6 +51,8 @@ obj-y += setup.o
 obj-y += shutdown.o
 obj-y += smp.o
 obj-y += smpboot.o
+obj-$(CONFIG_STATIC_MEMORY) += static-memory.init.o
+obj-$(CONFIG_STATIC_SHM) += static-shmem.init.o
 obj-y += sysctl.o
 obj-y += time.o
 obj-y += traps.o
diff --git a/xen/arch/arm/arm32/mmu/mm.c b/xen/arch/arm/arm32/mmu/mm.c
index 94d6cab49c..cb441ca87c 100644
--- a/xen/arch/arm/arm32/mmu/mm.c
+++ b/xen/arch/arm/arm32/mmu/mm.c
@@ -6,6 +6,7 @@
 #include <xen/param.h>
 #include <xen/pfn.h>
 #include <asm/fixmap.h>
+#include <asm/static-memory.h>
 
 static unsigned long opt_xenheap_megabytes __initdata;
 integer_param("xenheap_megabytes", opt_xenheap_megabytes);
diff --git a/xen/arch/arm/arm64/mmu/mm.c b/xen/arch/arm/arm64/mmu/mm.c
index e05d54c850..d2651c9486 100644
--- a/xen/arch/arm/arm64/mmu/mm.c
+++ b/xen/arch/arm/arm64/mmu/mm.c
@@ -5,6 +5,7 @@
 #include <xen/pfn.h>
 
 #include <asm/setup.h>
+#include <asm/static-memory.h>
 
 /* Override macros from asm/page.h to make them work with mfn_t */
 #undef virt_to_mfn
diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
index d73f8e4971..b1f03eb2fc 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/arch/arm/bootfdt.c
@@ -15,6 +15,7 @@
 #include <xen/sort.h>
 #include <xsm/xsm.h>
 #include <asm/setup.h>
+#include <asm/static-shmem.h>
 
 static bool __init device_tree_node_is_available(const void *fdt, int node)
 {
@@ -423,166 +424,6 @@ static int __init process_domain_node(const void *fdt, int node,
                                    MEMBANK_STATIC_DOMAIN);
 }
 
-#ifdef CONFIG_STATIC_SHM
-static int __init process_shm_node(const void *fdt, int node,
-                                   uint32_t address_cells, uint32_t size_cells)
-{
-    const struct fdt_property *prop, *prop_id, *prop_role;
-    const __be32 *cell;
-    paddr_t paddr, gaddr, size;
-    struct meminfo *mem = &bootinfo.reserved_mem;
-    unsigned int i;
-    int len;
-    bool owner = false;
-    const char *shm_id;
-
-    if ( address_cells < 1 || size_cells < 1 )
-    {
-        printk("fdt: invalid #address-cells or #size-cells for static shared memory node.\n");
-        return -EINVAL;
-    }
-
-    /*
-     * "xen,shm-id" property holds an arbitrary string with a strict limit
-     * on the number of characters, MAX_SHM_ID_LENGTH
-     */
-    prop_id = fdt_get_property(fdt, node, "xen,shm-id", NULL);
-    if ( !prop_id )
-        return -ENOENT;
-    shm_id = (const char *)prop_id->data;
-    if ( strnlen(shm_id, MAX_SHM_ID_LENGTH) == MAX_SHM_ID_LENGTH )
-    {
-        printk("fdt: invalid xen,shm-id %s, it must be limited to %u characters\n",
-               shm_id, MAX_SHM_ID_LENGTH);
-        return -EINVAL;
-    }
-
-    /*
-     * "role" property is optional and if it is defined explicitly,
-     * it must be either `owner` or `borrower`.
-     */
-    prop_role = fdt_get_property(fdt, node, "role", NULL);
-    if ( prop_role )
-    {
-        if ( !strcmp(prop_role->data, "owner") )
-            owner = true;
-        else if ( strcmp(prop_role->data, "borrower") )
-        {
-            printk("fdt: invalid `role` property for static shared memory node.\n");
-            return -EINVAL;
-        }
-    }
-
-    /*
-     * xen,shared-mem = <paddr, gaddr, size>;
-     * Memory region starting from physical address #paddr of #size shall
-     * be mapped to guest physical address #gaddr as static shared memory
-     * region.
-     */
-    prop = fdt_get_property(fdt, node, "xen,shared-mem", &len);
-    if ( !prop )
-        return -ENOENT;
-
-    if ( len != dt_cells_to_size(address_cells + size_cells + address_cells) )
-    {
-        if ( len == dt_cells_to_size(size_cells + address_cells) )
-            printk("fdt: host physical address must be chosen by users at the moment.\n");
-
-        printk("fdt: invalid `xen,shared-mem` property.\n");
-        return -EINVAL;
-    }
-
-    cell = (const __be32 *)prop->data;
-    device_tree_get_reg(&cell, address_cells, address_cells, &paddr, &gaddr);
-    size = dt_next_cell(size_cells, &cell);
-
-    if ( !size )
-    {
-        printk("fdt: the size for static shared memory region can not be zero\n");
-        return -EINVAL;
-    }
-
-    for ( i = 0; i < mem->nr_banks; i++ )
-    {
-        /*
-         * Meet the following check:
-         * 1) The shm ID matches and the region exactly match
-         * 2) The shm ID doesn't match and the region doesn't overlap
-         * with an existing one
-         */
-        if ( paddr == mem->bank[i].start && size == mem->bank[i].size )
-        {
-            if ( strncmp(shm_id, mem->bank[i].shm_id, MAX_SHM_ID_LENGTH) == 0 )
-                break;
-            else
-            {
-                printk("fdt: xen,shm-id %s does not match for all the nodes using the same region.\n",
-                       shm_id);
-                return -EINVAL;
-            }
-        }
-        else
-        {
-            paddr_t end = paddr + size;
-            paddr_t bank_end = mem->bank[i].start + mem->bank[i].size;
-
-            if ( (end <= paddr) || (bank_end <= mem->bank[i].start) )
-            {
-                printk("fdt: static shared memory region %s overflow\n", shm_id);
-                return -EINVAL;
-            }
-
-            if ( check_reserved_regions_overlap(paddr, size) )
-                return -EINVAL;
-            else
-            {
-                if ( strcmp(shm_id, mem->bank[i].shm_id) != 0 )
-                    continue;
-                else
-                {
-                    printk("fdt: different shared memory region could not share the same shm ID %s\n",
-                           shm_id);
-                    return -EINVAL;
-                }
-            }
-        }
-    }
-
-    if ( i == mem->nr_banks )
-    {
-        if ( i < NR_MEM_BANKS )
-        {
-            /* Static shared memory shall be reserved from any other use. */
-            safe_strcpy(mem->bank[mem->nr_banks].shm_id, shm_id);
-            mem->bank[mem->nr_banks].start = paddr;
-            mem->bank[mem->nr_banks].size = size;
-            mem->bank[mem->nr_banks].type = MEMBANK_STATIC_DOMAIN;
-            mem->nr_banks++;
-        }
-        else
-        {
-            printk("Warning: Max number of supported memory regions reached.\n");
-            return -ENOSPC;
-        }
-    }
-    /*
-     * keep a count of the number of borrowers, which later may be used
-     * to calculate the reference count.
-     */
-    if ( !owner )
-        mem->bank[i].nr_shm_borrowers++;
-
-    return 0;
-}
-#else
-static int __init process_shm_node(const void *fdt, int node,
-                                   uint32_t address_cells, uint32_t size_cells)
-{
-    printk("CONFIG_STATIC_SHM must be enabled for parsing static shared memory nodes\n");
-    return -EINVAL;
-}
-#endif
-
 static int __init early_scan_node(const void *fdt,
                                   int node, const char *name, int depth,
                                   u32 address_cells, u32 size_cells,
diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 1ca9d39043..d39cbd969a 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -13,6 +13,8 @@
 #include <asm/arm64/sve.h>
 #include <asm/dom0less-build.h>
 #include <asm/domain_build.h>
+#include <asm/static-memory.h>
+#include <asm/static-shmem.h>
 
 bool __init is_dom0less_mode(void)
 {
@@ -806,11 +808,9 @@ static int __init construct_domU(struct domain *d,
     else
         assign_static_memory_11(d, &kinfo, node);
 
-#ifdef CONFIG_STATIC_SHM
     rc = process_shm(d, &kinfo, node);
     if ( rc < 0 )
         return rc;
-#endif
 
     /*
      * Base address and irq number are needed when creating vpl011 device
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 90dba16e42..7eb766da9c 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -31,6 +31,7 @@
 #include <asm/cpufeature.h>
 #include <asm/dom0less-build.h>
 #include <asm/domain_build.h>
+#include <asm/static-shmem.h>
 #include <xen/event.h>
 
 #include <xen/irq.h>
@@ -477,533 +478,6 @@ bool __init allocate_bank_memory(struct domain *d, struct kernel_info *kinfo,
     return true;
 }
 
-#ifdef CONFIG_STATIC_MEMORY
-static bool __init append_static_memory_to_bank(struct domain *d,
-                                                struct membank *bank,
-                                                mfn_t smfn,
-                                                paddr_t size)
-{
-    int res;
-    unsigned int nr_pages = PFN_DOWN(size);
-    gfn_t sgfn;
-
-    /*
-     * For direct-mapped domain, the GFN match the MFN.
-     * Otherwise, this is inferred on what has already been allocated
-     * in the bank.
-     */
-    if ( !is_domain_direct_mapped(d) )
-        sgfn = gaddr_to_gfn(bank->start + bank->size);
-    else
-        sgfn = gaddr_to_gfn(mfn_to_maddr(smfn));
-
-    res = guest_physmap_add_pages(d, sgfn, smfn, nr_pages);
-    if ( res )
-    {
-        dprintk(XENLOG_ERR, "Failed to map pages to DOMU: %d", res);
-        return false;
-    }
-
-    bank->size = bank->size + size;
-
-    return true;
-}
-
-static mfn_t __init acquire_static_memory_bank(struct domain *d,
-                                               const __be32 **cell,
-                                               u32 addr_cells, u32 size_cells,
-                                               paddr_t *pbase, paddr_t *psize)
-{
-    mfn_t smfn;
-    int res;
-
-    device_tree_get_reg(cell, addr_cells, size_cells, pbase, psize);
-    ASSERT(IS_ALIGNED(*pbase, PAGE_SIZE) && IS_ALIGNED(*psize, PAGE_SIZE));
-    if ( PFN_DOWN(*psize) > UINT_MAX )
-    {
-        printk(XENLOG_ERR "%pd: static memory size too large: %#"PRIpaddr,
-               d, *psize);
-        return INVALID_MFN;
-    }
-
-    smfn = maddr_to_mfn(*pbase);
-    res = acquire_domstatic_pages(d, smfn, PFN_DOWN(*psize), 0);
-    if ( res )
-    {
-        printk(XENLOG_ERR
-               "%pd: failed to acquire static memory: %d.\n", d, res);
-        return INVALID_MFN;
-    }
-
-    return smfn;
-}
-
-static int __init parse_static_mem_prop(const struct dt_device_node *node,
-                                        u32 *addr_cells, u32 *size_cells,
-                                        int *length, const __be32 **cell)
-{
-    const struct dt_property *prop;
-
-    prop = dt_find_property(node, "xen,static-mem", NULL);
-
-    *addr_cells = dt_n_addr_cells(node);
-    *size_cells = dt_n_size_cells(node);
-
-    *cell = (const __be32 *)prop->value;
-    *length = prop->length;
-
-    return 0;
-}
-
-/* Allocate memory from static memory as RAM for one specific domain d. */
-void __init allocate_static_memory(struct domain *d, struct kernel_info *kinfo,
-                                   const struct dt_device_node *node)
-{
-    u32 addr_cells, size_cells, reg_cells;
-    unsigned int nr_banks, gbank, bank = 0;
-    const uint64_t rambase[] = GUEST_RAM_BANK_BASES;
-    const uint64_t ramsize[] = GUEST_RAM_BANK_SIZES;
-    const __be32 *cell;
-    u64 tot_size = 0;
-    paddr_t pbase, psize, gsize;
-    mfn_t smfn;
-    int length;
-
-    if ( parse_static_mem_prop(node, &addr_cells, &size_cells, &length, &cell) )
-        goto fail;
-    reg_cells = addr_cells + size_cells;
-
-    /*
-     * The static memory will be mapped in the guest at the usual guest memory
-     * addresses (GUEST_RAM0_BASE, GUEST_RAM1_BASE) defined by
-     * xen/include/public/arch-arm.h.
-     */
-    gbank = 0;
-    gsize = ramsize[gbank];
-    kinfo->mem.bank[gbank].start = rambase[gbank];
-    nr_banks = length / (reg_cells * sizeof (u32));
-
-    for ( ; bank < nr_banks; bank++ )
-    {
-        smfn = acquire_static_memory_bank(d, &cell, addr_cells, size_cells,
-                                          &pbase, &psize);
-        if ( mfn_eq(smfn, INVALID_MFN) )
-            goto fail;
-
-        printk(XENLOG_INFO "%pd: STATIC BANK[%u] %#"PRIpaddr"-%#"PRIpaddr"\n",
-               d, bank, pbase, pbase + psize);
-
-        while ( 1 )
-        {
-            /* Map as much as possible the static range to the guest bank */
-            if ( !append_static_memory_to_bank(d, &kinfo->mem.bank[gbank], smfn,
-                                               min(psize, gsize)) )
-                goto fail;
-
-            /*
-             * The current physical bank is fully mapped.
-             * Handle the next physical bank.
-             */
-            if ( gsize >= psize )
-            {
-                gsize = gsize - psize;
-                break;
-            }
-            /*
-             * When current guest bank is not enough to map, exhaust
-             * the current one and seek to the next.
-             * Before seeking to the next, check if we still have available
-             * guest bank.
-             */
-            else if ( (gbank + 1) >= GUEST_RAM_BANKS )
-            {
-                printk(XENLOG_ERR "Exhausted all possible guest banks.\n");
-                goto fail;
-            }
-            else
-            {
-                psize = psize - gsize;
-                smfn = mfn_add(smfn, gsize >> PAGE_SHIFT);
-                /* Update to the next guest bank. */
-                gbank++;
-                gsize = ramsize[gbank];
-                kinfo->mem.bank[gbank].start = rambase[gbank];
-            }
-        }
-
-        tot_size += psize;
-    }
-
-    kinfo->mem.nr_banks = ++gbank;
-
-    kinfo->unassigned_mem -= tot_size;
-    /*
-     * The property 'memory' should match the amount of memory given to the
-     * guest.
-     * Currently, it is only possible to either acquire static memory or let
-     * Xen allocate. *Mixing* is not supported.
-     */
-    if ( kinfo->unassigned_mem )
-    {
-        printk(XENLOG_ERR
-               "Size of \"memory\" property doesn't match up with the sum-up of \"xen,static-mem\". Unsupported configuration.\n");
-        goto fail;
-    }
-
-    return;
-
- fail:
-    panic("Failed to allocate requested static memory for domain %pd.\n", d);
-}
-
-/*
- * Allocate static memory as RAM for one specific domain d.
- * The static memory will be directly mapped in the guest(Guest Physical
- * Address == Physical Address).
- */
-void __init assign_static_memory_11(struct domain *d, struct kernel_info *kinfo,
-                                    const struct dt_device_node *node)
-{
-    u32 addr_cells, size_cells, reg_cells;
-    unsigned int nr_banks, bank = 0;
-    const __be32 *cell;
-    paddr_t pbase, psize;
-    mfn_t smfn;
-    int length;
-
-    if ( parse_static_mem_prop(node, &addr_cells, &size_cells, &length, &cell) )
-    {
-        printk(XENLOG_ERR
-               "%pd: failed to parse \"xen,static-mem\" property.\n", d);
-        goto fail;
-    }
-    reg_cells = addr_cells + size_cells;
-    nr_banks = length / (reg_cells * sizeof(u32));
-
-    if ( nr_banks > NR_MEM_BANKS )
-    {
-        printk(XENLOG_ERR
-               "%pd: exceed max number of supported guest memory banks.\n", d);
-        goto fail;
-    }
-
-    for ( ; bank < nr_banks; bank++ )
-    {
-        smfn = acquire_static_memory_bank(d, &cell, addr_cells, size_cells,
-                                          &pbase, &psize);
-        if ( mfn_eq(smfn, INVALID_MFN) )
-            goto fail;
-
-        printk(XENLOG_INFO "%pd: STATIC BANK[%u] %#"PRIpaddr"-%#"PRIpaddr"\n",
-               d, bank, pbase, pbase + psize);
-
-        /* One guest memory bank is matched with one physical memory bank. */
-        kinfo->mem.bank[bank].start = pbase;
-        if ( !append_static_memory_to_bank(d, &kinfo->mem.bank[bank],
-                                           smfn, psize) )
-            goto fail;
-
-        kinfo->unassigned_mem -= psize;
-    }
-
-    kinfo->mem.nr_banks = nr_banks;
-
-    /*
-     * The property 'memory' should match the amount of memory given to
-     * the guest.
-     * Currently, it is only possible to either acquire static memory or
-     * let Xen allocate. *Mixing* is not supported.
-     */
-    if ( kinfo->unassigned_mem != 0 )
-    {
-        printk(XENLOG_ERR
-               "Size of \"memory\" property doesn't match up with the sum-up of \"xen,static-mem\".\n");
-        goto fail;
-    }
-
-    return;
-
- fail:
-    panic("Failed to assign requested static memory for direct-map domain %pd.\n",
-          d);
-}
-
-#ifdef CONFIG_STATIC_SHM
-static int __init acquire_nr_borrower_domain(struct domain *d,
-                                             paddr_t pbase, paddr_t psize,
-                                             unsigned long *nr_borrowers)
-{
-    unsigned int bank;
-
-    /* Iterate reserved memory to find requested shm bank. */
-    for ( bank = 0 ; bank < bootinfo.reserved_mem.nr_banks; bank++ )
-    {
-        paddr_t bank_start = bootinfo.reserved_mem.bank[bank].start;
-        paddr_t bank_size = bootinfo.reserved_mem.bank[bank].size;
-
-        if ( (pbase == bank_start) && (psize == bank_size) )
-            break;
-    }
-
-    if ( bank == bootinfo.reserved_mem.nr_banks )
-        return -ENOENT;
-
-    *nr_borrowers = bootinfo.reserved_mem.bank[bank].nr_shm_borrowers;
-
-    return 0;
-}
-
-/*
- * This function checks whether the static shared memory region is
- * already allocated to dom_io.
- */
-static bool __init is_shm_allocated_to_domio(paddr_t pbase)
-{
-    struct page_info *page;
-    struct domain *d;
-
-    page = maddr_to_page(pbase);
-    d = page_get_owner_and_reference(page);
-    if ( d == NULL )
-        return false;
-    put_page(page);
-
-    if ( d != dom_io )
-    {
-        printk(XENLOG_ERR
-               "shm memory node has already been allocated to a specific owner %pd, Please check your configuration\n",
-               d);
-        return false;
-    }
-
-    return true;
-}
-
-static mfn_t __init acquire_shared_memory_bank(struct domain *d,
-                                               paddr_t pbase, paddr_t psize)
-{
-    mfn_t smfn;
-    unsigned long nr_pfns;
-    int res;
-
-    /*
-     * Pages of statically shared memory shall be included
-     * into domain_tot_pages().
-     */
-    nr_pfns = PFN_DOWN(psize);
-    if ( (UINT_MAX - d->max_pages) < nr_pfns )
-    {
-        printk(XENLOG_ERR "%pd: Over-allocation for d->max_pages: %lu.\n",
-               d, nr_pfns);
-        return INVALID_MFN;
-    }
-    d->max_pages += nr_pfns;
-
-    smfn = maddr_to_mfn(pbase);
-    res = acquire_domstatic_pages(d, smfn, nr_pfns, 0);
-    if ( res )
-    {
-        printk(XENLOG_ERR
-               "%pd: failed to acquire static memory: %d.\n", d, res);
-        d->max_pages -= nr_pfns;
-        return INVALID_MFN;
-    }
-
-    return smfn;
-}
-
-static int __init assign_shared_memory(struct domain *d,
-                                       uint32_t addr_cells, uint32_t size_cells,
-                                       paddr_t pbase, paddr_t psize,
-                                       paddr_t gbase)
-{
-    mfn_t smfn;
-    int ret = 0;
-    unsigned long nr_pages, nr_borrowers, i;
-    struct page_info *page;
-
-    printk("%pd: allocate static shared memory BANK %#"PRIpaddr"-%#"PRIpaddr".\n",
-           d, pbase, pbase + psize);
-
-    smfn = acquire_shared_memory_bank(d, pbase, psize);
-    if ( mfn_eq(smfn, INVALID_MFN) )
-        return -EINVAL;
-
-    /*
-     * DOMID_IO is not auto-translated (i.e. it sees RAM 1:1). So we do not need
-     * to create mapping in the P2M.
-     */
-    nr_pages = PFN_DOWN(psize);
-    if ( d != dom_io )
-    {
-        ret = guest_physmap_add_pages(d, gaddr_to_gfn(gbase), smfn,
-                                      PFN_DOWN(psize));
-        if ( ret )
-        {
-            printk(XENLOG_ERR "Failed to map shared memory to %pd.\n", d);
-            return ret;
-        }
-    }
-
-    /*
-     * Get the right amount of references per page, which is the number of
-     * borrower domains.
-     */
-    ret = acquire_nr_borrower_domain(d, pbase, psize, &nr_borrowers);
-    if ( ret )
-        return ret;
-
-    /*
-     * Instead of letting borrower domain get a page ref, we add as many
-     * additional reference as the number of borrowers when the owner
-     * is allocated, since there is a chance that owner is created
-     * after borrower.
-     * So if the borrower is created first, it will cause adding pages
-     * in the P2M without reference.
-     */
-    page = mfn_to_page(smfn);
-    for ( i = 0; i < nr_pages; i++ )
-    {
-        if ( !get_page_nr(page + i, d, nr_borrowers) )
-        {
-            printk(XENLOG_ERR
-                   "Failed to add %lu references to page %"PRI_mfn".\n",
-                   nr_borrowers, mfn_x(smfn) + i);
-            goto fail;
-        }
-    }
-
-    return 0;
-
- fail:
-    while ( --i >= 0 )
-        put_page_nr(page + i, nr_borrowers);
-    return ret;
-}
-
-static int __init append_shm_bank_to_domain(struct kernel_info *kinfo,
-                                            paddr_t start, paddr_t size,
-                                            const char *shm_id)
-{
-    if ( kinfo->shm_mem.nr_banks >= NR_MEM_BANKS )
-        return -ENOMEM;
-
-    kinfo->shm_mem.bank[kinfo->shm_mem.nr_banks].start = start;
-    kinfo->shm_mem.bank[kinfo->shm_mem.nr_banks].size = size;
-    safe_strcpy(kinfo->shm_mem.bank[kinfo->shm_mem.nr_banks].shm_id, shm_id);
-    kinfo->shm_mem.nr_banks++;
-
-    return 0;
-}
-
-int __init process_shm(struct domain *d, struct kernel_info *kinfo,
-                       const struct dt_device_node *node)
-{
-    struct dt_device_node *shm_node;
-
-    dt_for_each_child_node(node, shm_node)
-    {
-        const struct dt_property *prop;
-        const __be32 *cells;
-        uint32_t addr_cells, size_cells;
-        paddr_t gbase, pbase, psize;
-        int ret = 0;
-        unsigned int i;
-        const char *role_str;
-        const char *shm_id;
-        bool owner_dom_io = true;
-
-        if ( !dt_device_is_compatible(shm_node, "xen,domain-shared-memory-v1") )
-            continue;
-
-        /*
-         * xen,shared-mem = <pbase, gbase, size>;
-         * TODO: pbase is optional.
-         */
-        addr_cells = dt_n_addr_cells(shm_node);
-        size_cells = dt_n_size_cells(shm_node);
-        prop = dt_find_property(shm_node, "xen,shared-mem", NULL);
-        BUG_ON(!prop);
-        cells = (const __be32 *)prop->value;
-        device_tree_get_reg(&cells, addr_cells, addr_cells, &pbase, &gbase);
-        psize = dt_read_paddr(cells, size_cells);
-        if ( !IS_ALIGNED(pbase, PAGE_SIZE) || !IS_ALIGNED(gbase, PAGE_SIZE) )
-        {
-            printk("%pd: physical address 0x%"PRIpaddr", or guest address 0x%"PRIpaddr" is not suitably aligned.\n",
-                   d, pbase, gbase);
-            return -EINVAL;
-        }
-        if ( !IS_ALIGNED(psize, PAGE_SIZE) )
-        {
-            printk("%pd: size 0x%"PRIpaddr" is not suitably aligned\n",
-                   d, psize);
-            return -EINVAL;
-        }
-
-        for ( i = 0; i < PFN_DOWN(psize); i++ )
-            if ( !mfn_valid(mfn_add(maddr_to_mfn(pbase), i)) )
-            {
-                printk("%pd: invalid physical address 0x%"PRI_mfn"\n",
-                       d, mfn_x(mfn_add(maddr_to_mfn(pbase), i)));
-                return -EINVAL;
-            }
-
-        /*
-         * "role" property is optional and if it is defined explicitly,
-         * then the owner domain is not the default "dom_io" domain.
-         */
-        if ( dt_property_read_string(shm_node, "role", &role_str) == 0 )
-            owner_dom_io = false;
-
-        if ( dt_property_read_string(shm_node, "xen,shm-id", &shm_id) )
-        {
-            printk("%pd: invalid \"xen,shm-id\" property", d);
-            return -EINVAL;
-        }
-        BUG_ON((strlen(shm_id) <= 0) || (strlen(shm_id) >= MAX_SHM_ID_LENGTH));
-
-        /*
-         * DOMID_IO is a fake domain and is not described in the Device-Tree.
-         * Therefore when the owner of the shared region is DOMID_IO, we will
-         * only find the borrowers.
-         */
-        if ( (owner_dom_io && !is_shm_allocated_to_domio(pbase)) ||
-             (!owner_dom_io && strcmp(role_str, "owner") == 0) )
-        {
-            /*
-             * We found the first borrower of the region, the owner was not
-             * specified, so they should be assigned to dom_io.
-             */
-            ret = assign_shared_memory(owner_dom_io ? dom_io : d,
-                                       addr_cells, size_cells,
-                                       pbase, psize, gbase);
-            if ( ret )
-                return ret;
-        }
-
-        if ( owner_dom_io || (strcmp(role_str, "borrower") == 0) )
-        {
-            /* Set up P2M foreign mapping for borrower domain. */
-            ret = map_regions_p2mt(d, _gfn(PFN_UP(gbase)), PFN_DOWN(psize),
-                                   _mfn(PFN_UP(pbase)), p2m_map_foreign_rw);
-            if ( ret )
-                return ret;
-        }
-
-        /*
-         * Record static shared memory region info for later setting
-         * up shm-node in guest device tree.
-         */
-        ret = append_shm_bank_to_domain(kinfo, gbase, psize, shm_id);
-        if ( ret )
-            return ret;
-    }
-
-    return 0;
-}
-#endif /* CONFIG_STATIC_SHM */
-#endif
-
 /*
  * When PCI passthrough is available we want to keep the
  * "linux,pci-domain" in sync for every host bridge.
@@ -1337,125 +811,6 @@ int __init make_memory_node(const struct domain *d,
     return res;
 }
 
-#ifdef CONFIG_STATIC_SHM
-static int __init make_shm_memory_node(const struct domain *d,
-                                       void *fdt,
-                                       int addrcells, int sizecells,
-                                       const struct meminfo *mem)
-{
-    unsigned int i = 0;
-    int res = 0;
-
-    if ( mem->nr_banks == 0 )
-        return -ENOENT;
-
-    /*
-     * For each shared memory region, a range is exposed under
-     * the /reserved-memory node as a child node. Each range sub-node is
-     * named xen-shmem@<address>.
-     */
-    dt_dprintk("Create xen-shmem node\n");
-
-    for ( ; i < mem->nr_banks; i++ )
-    {
-        uint64_t start = mem->bank[i].start;
-        uint64_t size = mem->bank[i].size;
-        const char compat[] = "xen,shared-memory-v1";
-        /* Worst case addrcells + sizecells */
-        __be32 reg[GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS];
-        __be32 *cells;
-        unsigned int len = (addrcells + sizecells) * sizeof(__be32);
-
-        res = domain_fdt_begin_node(fdt, "xen-shmem", mem->bank[i].start);
-        if ( res )
-            return res;
-
-        res = fdt_property(fdt, "compatible", compat, sizeof(compat));
-        if ( res )
-            return res;
-
-        cells = reg;
-        dt_child_set_range(&cells, addrcells, sizecells, start, size);
-
-        res = fdt_property(fdt, "reg", reg, len);
-        if ( res )
-            return res;
-
-        dt_dprintk("Shared memory bank %u: %#"PRIx64"->%#"PRIx64"\n",
-                   i, start, start + size);
-
-        res = fdt_property_string(fdt, "xen,id", mem->bank[i].shm_id);
-        if ( res )
-            return res;
-
-        /*
-         * TODO:
-         * - xen,offset: (borrower VMs only)
-         *   64 bit integer offset within the owner virtual machine's shared
-         *   memory region used for the mapping in the borrower VM
-         */
-        res = fdt_property_u64(fdt, "xen,offset", 0);
-        if ( res )
-            return res;
-
-        res = fdt_end_node(fdt);
-        if ( res )
-            return res;
-    }
-
-    return res;
-}
-#else
-static int __init make_shm_memory_node(const struct domain *d,
-                                       void *fdt,
-                                       int addrcells, int sizecells,
-                                       const struct meminfo *mem)
-{
-    ASSERT_UNREACHABLE();
-    return -EOPNOTSUPP;
-}
-#endif
-
-int __init make_resv_memory_node(const struct domain *d,
-                                 void *fdt,
-                                 int addrcells, int sizecells,
-                                 const struct meminfo *mem)
-{
-    int res = 0;
-    /* Placeholder for reserved-memory\0 */
-    const char resvbuf[16] = "reserved-memory";
-
-    if ( mem->nr_banks == 0 )
-        /* No shared memory provided. */
-        return 0;
-
-    dt_dprintk("Create reserved-memory node\n");
-
-    res = fdt_begin_node(fdt, resvbuf);
-    if ( res )
-        return res;
-
-    res = fdt_property(fdt, "ranges", NULL, 0);
-    if ( res )
-        return res;
-
-    res = fdt_property_cell(fdt, "#address-cells", addrcells);
-    if ( res )
-        return res;
-
-    res = fdt_property_cell(fdt, "#size-cells", sizecells);
-    if ( res )
-        return res;
-
-    res = make_shm_memory_node(d, fdt, addrcells, sizecells, mem);
-    if ( res )
-        return res;
-
-    res = fdt_end_node(fdt);
-
-    return res;
-}
-
 static int __init add_ext_regions(unsigned long s_gfn, unsigned long e_gfn,
                                   void *data)
 {
@@ -2828,9 +2183,6 @@ static int __init construct_dom0(struct domain *d)
 {
     struct kernel_info kinfo = {};
     int rc;
-#ifdef CONFIG_STATIC_SHM
-    const struct dt_device_node *chosen = dt_find_node_by_path("/chosen");
-#endif
 
     /* Sanity! */
     BUG_ON(d->domain_id != 0);
@@ -2865,11 +2217,9 @@ static int __init construct_dom0(struct domain *d)
     allocate_memory_11(d, &kinfo);
     find_gnttab_region(d, &kinfo);
 
-#ifdef CONFIG_STATIC_SHM
-    rc = process_shm(d, &kinfo, chosen);
+    rc = process_shm_chosen(d, &kinfo);
     if ( rc < 0 )
         return rc;
-#endif
 
     /* Map extra GIC MMIO, irqs and other hw stuffs to dom0. */
     rc = gic_map_hwdom_extra_mappings(d);
diff --git a/xen/arch/arm/include/asm/domain_build.h b/xen/arch/arm/include/asm/domain_build.h
index b9ae0d170c..da9e6025f3 100644
--- a/xen/arch/arm/include/asm/domain_build.h
+++ b/xen/arch/arm/include/asm/domain_build.h
@@ -10,8 +10,6 @@ bool allocate_bank_memory(struct domain *d, struct kernel_info *kinfo,
                           gfn_t sgfn, paddr_t tot_size);
 int construct_domain(struct domain *d, struct kernel_info *kinfo);
 int domain_fdt_begin_node(void *fdt, const char *name, uint64_t unit);
-int make_resv_memory_node(const struct domain *d, void *fdt, int addrcells,
-                          int sizecells, const struct meminfo *mem);
 int make_chosen_node(const struct kernel_info *kinfo);
 int make_cpus_node(const struct domain *d, void *fdt);
 int make_hypervisor_node(struct domain *d, const struct kernel_info *kinfo,
@@ -42,9 +40,6 @@ int handle_device_interrupts(struct domain *d, struct dt_device_node *dev,
 void set_interrupt(gic_interrupt_t interrupt, unsigned int irq,
                    unsigned int cpumask, unsigned int level);
 
-int process_shm(struct domain *d, struct kernel_info *kinfo,
-                const struct dt_device_node *node);
-
 #ifndef CONFIG_ACPI
 static inline int prepare_acpi(struct domain *d, struct kernel_info *kinfo)
 {
@@ -56,27 +51,6 @@ static inline int prepare_acpi(struct domain *d, struct kernel_info *kinfo)
 int prepare_acpi(struct domain *d, struct kernel_info *kinfo);
 #endif
 
-#ifdef CONFIG_STATIC_MEMORY
-void allocate_static_memory(struct domain *d, struct kernel_info *kinfo,
-                            const struct dt_device_node *node);
-void assign_static_memory_11(struct domain *d, struct kernel_info *kinfo,
-                             const struct dt_device_node *node);
-#else
-static inline void allocate_static_memory(struct domain *d,
-                                          struct kernel_info *kinfo,
-                                          const struct dt_device_node *node)
-{
-    ASSERT_UNREACHABLE();
-}
-
-static inline void assign_static_memory_11(struct domain *d,
-                                           struct kernel_info *kinfo,
-                                           const struct dt_device_node *node)
-{
-    ASSERT_UNREACHABLE();
-}
-#endif
-
 #endif
 
 /*
diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index 6d670d68ae..bda3c07b87 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -160,7 +160,6 @@ struct bootcmdline * boot_cmdline_find_by_name(const char *name);
 const char *boot_module_kind_as_string(bootmodule_kind kind);
 
 void init_pdx(void);
-void init_staticmem_pages(void);
 void populate_boot_allocator(void);
 void setup_mm(void);
 
diff --git a/xen/arch/arm/include/asm/static-memory.h b/xen/arch/arm/include/asm/static-memory.h
new file mode 100644
index 0000000000..3e3efd70c3
--- /dev/null
+++ b/xen/arch/arm/include/asm/static-memory.h
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __ASM_STATIC_MEMORY_H_
+#define __ASM_STATIC_MEMORY_H_
+
+#include <asm/kernel.h>
+
+#ifdef CONFIG_STATIC_MEMORY
+
+void allocate_static_memory(struct domain *d, struct kernel_info *kinfo,
+                            const struct dt_device_node *node);
+void assign_static_memory_11(struct domain *d, struct kernel_info *kinfo,
+                             const struct dt_device_node *node);
+void init_staticmem_pages(void);
+
+#else /* !CONFIG_STATIC_MEMORY */
+
+static inline void allocate_static_memory(struct domain *d,
+                                          struct kernel_info *kinfo,
+                                          const struct dt_device_node *node)
+{
+    ASSERT_UNREACHABLE();
+}
+
+static inline void assign_static_memory_11(struct domain *d,
+                                           struct kernel_info *kinfo,
+                                           const struct dt_device_node *node)
+{
+    ASSERT_UNREACHABLE();
+}
+
+static inline void init_staticmem_pages(void) {};
+
+#endif /* CONFIG_STATIC_MEMORY */
+
+#endif /* __ASM_STATIC_MEMORY_H_ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/include/asm/static-shmem.h b/xen/arch/arm/include/asm/static-shmem.h
new file mode 100644
index 0000000000..1536ff18b8
--- /dev/null
+++ b/xen/arch/arm/include/asm/static-shmem.h
@@ -0,0 +1,66 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __ASM_STATIC_SHMEM_H_
+#define __ASM_STATIC_SHMEM_H_
+
+#include <asm/kernel.h>
+
+#ifdef CONFIG_STATIC_SHM
+
+int make_resv_memory_node(const struct domain *d, void *fdt, int addrcells,
+                          int sizecells, const struct meminfo *mem);
+
+int process_shm(struct domain *d, struct kernel_info *kinfo,
+                const struct dt_device_node *node);
+
+static inline int process_shm_chosen(struct domain *d,
+                                     struct kernel_info *kinfo)
+{
+    const struct dt_device_node *node = dt_find_node_by_path("/chosen");
+
+    return process_shm(d, kinfo, node);
+}
+
+int process_shm_node(const void *fdt, int node, uint32_t address_cells,
+                     uint32_t size_cells);
+
+#else /* !CONFIG_STATIC_SHM */
+
+static inline int make_resv_memory_node(const struct domain *d, void *fdt,
+                                        int addrcells, int sizecells,
+                                        const struct meminfo *mem)
+{
+    return 0;
+}
+
+static inline int process_shm(struct domain *d, struct kernel_info *kinfo,
+                              const struct dt_device_node *node)
+{
+    return 0;
+}
+
+static inline int process_shm_chosen(struct domain *d,
+                                     struct kernel_info *kinfo)
+{
+    return 0;
+}
+
+static inline int process_shm_node(const void *fdt, int node,
+                                   uint32_t address_cells, uint32_t size_cells)
+{
+    printk("CONFIG_STATIC_SHM must be enabled for parsing static shared memory nodes\n");
+    return -EINVAL;
+}
+
+#endif /* CONFIG_STATIC_SHM */
+
+#endif /* __ASM_STATIC_SHMEM_H_ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 3f1081bed2..d2a47416e4 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -621,30 +621,6 @@ void __init init_pdx(void)
     }
 }
 
-/* Static memory initialization */
-void __init init_staticmem_pages(void)
-{
-#ifdef CONFIG_STATIC_MEMORY
-    unsigned int bank;
-
-    for ( bank = 0 ; bank < bootinfo.reserved_mem.nr_banks; bank++ )
-    {
-        if ( bootinfo.reserved_mem.bank[bank].type == MEMBANK_STATIC_DOMAIN )
-        {
-            mfn_t bank_start = _mfn(PFN_UP(bootinfo.reserved_mem.bank[bank].start));
-            unsigned long bank_pages = PFN_DOWN(bootinfo.reserved_mem.bank[bank].size);
-            mfn_t bank_end = mfn_add(bank_start, bank_pages);
-
-            if ( mfn_x(bank_end) <= mfn_x(bank_start) )
-                return;
-
-            unprepare_staticmem_pages(mfn_to_page(bank_start),
-                                      bank_pages, false);
-        }
-    }
-#endif
-}
-
 /*
  * Populate the boot allocator.
  * If a static heap was not provided by the admin, all the RAM but the
diff --git a/xen/arch/arm/static-memory.c b/xen/arch/arm/static-memory.c
new file mode 100644
index 0000000000..cffbab7241
--- /dev/null
+++ b/xen/arch/arm/static-memory.c
@@ -0,0 +1,287 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/sched.h>
+
+#include <asm/static-memory.h>
+
+static bool __init append_static_memory_to_bank(struct domain *d,
+                                                struct membank *bank,
+                                                mfn_t smfn,
+                                                paddr_t size)
+{
+    int res;
+    unsigned int nr_pages = PFN_DOWN(size);
+    gfn_t sgfn;
+
+    /*
+     * For direct-mapped domain, the GFN match the MFN.
+     * Otherwise, this is inferred on what has already been allocated
+     * in the bank.
+     */
+    if ( !is_domain_direct_mapped(d) )
+        sgfn = gaddr_to_gfn(bank->start + bank->size);
+    else
+        sgfn = gaddr_to_gfn(mfn_to_maddr(smfn));
+
+    res = guest_physmap_add_pages(d, sgfn, smfn, nr_pages);
+    if ( res )
+    {
+        dprintk(XENLOG_ERR, "Failed to map pages to DOMU: %d", res);
+        return false;
+    }
+
+    bank->size = bank->size + size;
+
+    return true;
+}
+
+static mfn_t __init acquire_static_memory_bank(struct domain *d,
+                                               const __be32 **cell,
+                                               u32 addr_cells, u32 size_cells,
+                                               paddr_t *pbase, paddr_t *psize)
+{
+    mfn_t smfn;
+    int res;
+
+    device_tree_get_reg(cell, addr_cells, size_cells, pbase, psize);
+    ASSERT(IS_ALIGNED(*pbase, PAGE_SIZE) && IS_ALIGNED(*psize, PAGE_SIZE));
+    if ( PFN_DOWN(*psize) > UINT_MAX )
+    {
+        printk(XENLOG_ERR "%pd: static memory size too large: %#"PRIpaddr,
+               d, *psize);
+        return INVALID_MFN;
+    }
+
+    smfn = maddr_to_mfn(*pbase);
+    res = acquire_domstatic_pages(d, smfn, PFN_DOWN(*psize), 0);
+    if ( res )
+    {
+        printk(XENLOG_ERR
+               "%pd: failed to acquire static memory: %d.\n", d, res);
+        return INVALID_MFN;
+    }
+
+    return smfn;
+}
+
+static int __init parse_static_mem_prop(const struct dt_device_node *node,
+                                        u32 *addr_cells, u32 *size_cells,
+                                        int *length, const __be32 **cell)
+{
+    const struct dt_property *prop;
+
+    prop = dt_find_property(node, "xen,static-mem", NULL);
+
+    *addr_cells = dt_n_addr_cells(node);
+    *size_cells = dt_n_size_cells(node);
+
+    *cell = (const __be32 *)prop->value;
+    *length = prop->length;
+
+    return 0;
+}
+
+/* Allocate memory from static memory as RAM for one specific domain d. */
+void __init allocate_static_memory(struct domain *d, struct kernel_info *kinfo,
+                                   const struct dt_device_node *node)
+{
+    u32 addr_cells, size_cells, reg_cells;
+    unsigned int nr_banks, gbank, bank = 0;
+    const uint64_t rambase[] = GUEST_RAM_BANK_BASES;
+    const uint64_t ramsize[] = GUEST_RAM_BANK_SIZES;
+    const __be32 *cell;
+    u64 tot_size = 0;
+    paddr_t pbase, psize, gsize;
+    mfn_t smfn;
+    int length;
+
+    if ( parse_static_mem_prop(node, &addr_cells, &size_cells, &length, &cell) )
+        goto fail;
+    reg_cells = addr_cells + size_cells;
+
+    /*
+     * The static memory will be mapped in the guest at the usual guest memory
+     * addresses (GUEST_RAM0_BASE, GUEST_RAM1_BASE) defined by
+     * xen/include/public/arch-arm.h.
+     */
+    gbank = 0;
+    gsize = ramsize[gbank];
+    kinfo->mem.bank[gbank].start = rambase[gbank];
+    nr_banks = length / (reg_cells * sizeof (u32));
+
+    for ( ; bank < nr_banks; bank++ )
+    {
+        smfn = acquire_static_memory_bank(d, &cell, addr_cells, size_cells,
+                                          &pbase, &psize);
+        if ( mfn_eq(smfn, INVALID_MFN) )
+            goto fail;
+
+        printk(XENLOG_INFO "%pd: STATIC BANK[%u] %#"PRIpaddr"-%#"PRIpaddr"\n",
+               d, bank, pbase, pbase + psize);
+
+        while ( 1 )
+        {
+            /* Map as much as possible the static range to the guest bank */
+            if ( !append_static_memory_to_bank(d, &kinfo->mem.bank[gbank], smfn,
+                                               min(psize, gsize)) )
+                goto fail;
+
+            /*
+             * The current physical bank is fully mapped.
+             * Handle the next physical bank.
+             */
+            if ( gsize >= psize )
+            {
+                gsize = gsize - psize;
+                break;
+            }
+            /*
+             * When current guest bank is not enough to map, exhaust
+             * the current one and seek to the next.
+             * Before seeking to the next, check if we still have available
+             * guest bank.
+             */
+            else if ( (gbank + 1) >= GUEST_RAM_BANKS )
+            {
+                printk(XENLOG_ERR "Exhausted all possible guest banks.\n");
+                goto fail;
+            }
+            else
+            {
+                psize = psize - gsize;
+                smfn = mfn_add(smfn, gsize >> PAGE_SHIFT);
+                /* Update to the next guest bank. */
+                gbank++;
+                gsize = ramsize[gbank];
+                kinfo->mem.bank[gbank].start = rambase[gbank];
+            }
+        }
+
+        tot_size += psize;
+    }
+
+    kinfo->mem.nr_banks = ++gbank;
+
+    kinfo->unassigned_mem -= tot_size;
+    /*
+     * The property 'memory' should match the amount of memory given to the
+     * guest.
+     * Currently, it is only possible to either acquire static memory or let
+     * Xen allocate. *Mixing* is not supported.
+     */
+    if ( kinfo->unassigned_mem )
+    {
+        printk(XENLOG_ERR
+               "Size of \"memory\" property doesn't match up with the sum-up of \"xen,static-mem\". Unsupported configuration.\n");
+        goto fail;
+    }
+
+    return;
+
+ fail:
+    panic("Failed to allocate requested static memory for domain %pd.\n", d);
+}
+
+/*
+ * Allocate static memory as RAM for one specific domain d.
+ * The static memory will be directly mapped in the guest(Guest Physical
+ * Address == Physical Address).
+ */
+void __init assign_static_memory_11(struct domain *d, struct kernel_info *kinfo,
+                                    const struct dt_device_node *node)
+{
+    u32 addr_cells, size_cells, reg_cells;
+    unsigned int nr_banks, bank = 0;
+    const __be32 *cell;
+    paddr_t pbase, psize;
+    mfn_t smfn;
+    int length;
+
+    if ( parse_static_mem_prop(node, &addr_cells, &size_cells, &length, &cell) )
+    {
+        printk(XENLOG_ERR
+               "%pd: failed to parse \"xen,static-mem\" property.\n", d);
+        goto fail;
+    }
+    reg_cells = addr_cells + size_cells;
+    nr_banks = length / (reg_cells * sizeof(u32));
+
+    if ( nr_banks > NR_MEM_BANKS )
+    {
+        printk(XENLOG_ERR
+               "%pd: exceed max number of supported guest memory banks.\n", d);
+        goto fail;
+    }
+
+    for ( ; bank < nr_banks; bank++ )
+    {
+        smfn = acquire_static_memory_bank(d, &cell, addr_cells, size_cells,
+                                          &pbase, &psize);
+        if ( mfn_eq(smfn, INVALID_MFN) )
+            goto fail;
+
+        printk(XENLOG_INFO "%pd: STATIC BANK[%u] %#"PRIpaddr"-%#"PRIpaddr"\n",
+               d, bank, pbase, pbase + psize);
+
+        /* One guest memory bank is matched with one physical memory bank. */
+        kinfo->mem.bank[bank].start = pbase;
+        if ( !append_static_memory_to_bank(d, &kinfo->mem.bank[bank],
+                                           smfn, psize) )
+            goto fail;
+
+        kinfo->unassigned_mem -= psize;
+    }
+
+    kinfo->mem.nr_banks = nr_banks;
+
+    /*
+     * The property 'memory' should match the amount of memory given to
+     * the guest.
+     * Currently, it is only possible to either acquire static memory or
+     * let Xen allocate. *Mixing* is not supported.
+     */
+    if ( kinfo->unassigned_mem != 0 )
+    {
+        printk(XENLOG_ERR
+               "Size of \"memory\" property doesn't match up with the sum-up of \"xen,static-mem\".\n");
+        goto fail;
+    }
+
+    return;
+
+ fail:
+    panic("Failed to assign requested static memory for direct-map domain %pd.\n",
+          d);
+}
+
+/* Static memory initialization */
+void __init init_staticmem_pages(void)
+{
+    unsigned int bank;
+
+    for ( bank = 0 ; bank < bootinfo.reserved_mem.nr_banks; bank++ )
+    {
+        if ( bootinfo.reserved_mem.bank[bank].type == MEMBANK_STATIC_DOMAIN )
+        {
+            mfn_t bank_start = _mfn(PFN_UP(bootinfo.reserved_mem.bank[bank].start));
+            unsigned long bank_pages = PFN_DOWN(bootinfo.reserved_mem.bank[bank].size);
+            mfn_t bank_end = mfn_add(bank_start, bank_pages);
+
+            if ( mfn_x(bank_end) <= mfn_x(bank_start) )
+                return;
+
+            unprepare_staticmem_pages(mfn_to_page(bank_start),
+                                      bank_pages, false);
+        }
+    }
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/static-shmem.c b/xen/arch/arm/static-shmem.c
new file mode 100644
index 0000000000..9097bc8b15
--- /dev/null
+++ b/xen/arch/arm/static-shmem.c
@@ -0,0 +1,547 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/libfdt/libfdt.h>
+#include <xen/sched.h>
+
+#include <asm/domain_build.h>
+#include <asm/static-shmem.h>
+
+static int __init acquire_nr_borrower_domain(struct domain *d,
+                                             paddr_t pbase, paddr_t psize,
+                                             unsigned long *nr_borrowers)
+{
+    unsigned int bank;
+
+    /* Iterate reserved memory to find requested shm bank. */
+    for ( bank = 0 ; bank < bootinfo.reserved_mem.nr_banks; bank++ )
+    {
+        paddr_t bank_start = bootinfo.reserved_mem.bank[bank].start;
+        paddr_t bank_size = bootinfo.reserved_mem.bank[bank].size;
+
+        if ( (pbase == bank_start) && (psize == bank_size) )
+            break;
+    }
+
+    if ( bank == bootinfo.reserved_mem.nr_banks )
+        return -ENOENT;
+
+    *nr_borrowers = bootinfo.reserved_mem.bank[bank].nr_shm_borrowers;
+
+    return 0;
+}
+
+/*
+ * This function checks whether the static shared memory region is
+ * already allocated to dom_io.
+ */
+static bool __init is_shm_allocated_to_domio(paddr_t pbase)
+{
+    struct page_info *page;
+    struct domain *d;
+
+    page = maddr_to_page(pbase);
+    d = page_get_owner_and_reference(page);
+    if ( d == NULL )
+        return false;
+    put_page(page);
+
+    if ( d != dom_io )
+    {
+        printk(XENLOG_ERR
+               "shm memory node has already been allocated to a specific owner %pd, Please check your configuration\n",
+               d);
+        return false;
+    }
+
+    return true;
+}
+
+static mfn_t __init acquire_shared_memory_bank(struct domain *d,
+                                               paddr_t pbase, paddr_t psize)
+{
+    mfn_t smfn;
+    unsigned long nr_pfns;
+    int res;
+
+    /*
+     * Pages of statically shared memory shall be included
+     * into domain_tot_pages().
+     */
+    nr_pfns = PFN_DOWN(psize);
+    if ( (UINT_MAX - d->max_pages) < nr_pfns )
+    {
+        printk(XENLOG_ERR "%pd: Over-allocation for d->max_pages: %lu.\n",
+               d, nr_pfns);
+        return INVALID_MFN;
+    }
+    d->max_pages += nr_pfns;
+
+    smfn = maddr_to_mfn(pbase);
+    res = acquire_domstatic_pages(d, smfn, nr_pfns, 0);
+    if ( res )
+    {
+        printk(XENLOG_ERR
+               "%pd: failed to acquire static memory: %d.\n", d, res);
+        d->max_pages -= nr_pfns;
+        return INVALID_MFN;
+    }
+
+    return smfn;
+}
+
+static int __init assign_shared_memory(struct domain *d,
+                                       uint32_t addr_cells, uint32_t size_cells,
+                                       paddr_t pbase, paddr_t psize,
+                                       paddr_t gbase)
+{
+    mfn_t smfn;
+    int ret = 0;
+    unsigned long nr_pages, nr_borrowers, i;
+    struct page_info *page;
+
+    printk("%pd: allocate static shared memory BANK %#"PRIpaddr"-%#"PRIpaddr".\n",
+           d, pbase, pbase + psize);
+
+    smfn = acquire_shared_memory_bank(d, pbase, psize);
+    if ( mfn_eq(smfn, INVALID_MFN) )
+        return -EINVAL;
+
+    /*
+     * DOMID_IO is not auto-translated (i.e. it sees RAM 1:1). So we do not need
+     * to create mapping in the P2M.
+     */
+    nr_pages = PFN_DOWN(psize);
+    if ( d != dom_io )
+    {
+        ret = guest_physmap_add_pages(d, gaddr_to_gfn(gbase), smfn,
+                                      PFN_DOWN(psize));
+        if ( ret )
+        {
+            printk(XENLOG_ERR "Failed to map shared memory to %pd.\n", d);
+            return ret;
+        }
+    }
+
+    /*
+     * Get the right amount of references per page, which is the number of
+     * borrower domains.
+     */
+    ret = acquire_nr_borrower_domain(d, pbase, psize, &nr_borrowers);
+    if ( ret )
+        return ret;
+
+    /*
+     * Instead of letting borrower domain get a page ref, we add as many
+     * additional reference as the number of borrowers when the owner
+     * is allocated, since there is a chance that owner is created
+     * after borrower.
+     * So if the borrower is created first, it will cause adding pages
+     * in the P2M without reference.
+     */
+    page = mfn_to_page(smfn);
+    for ( i = 0; i < nr_pages; i++ )
+    {
+        if ( !get_page_nr(page + i, d, nr_borrowers) )
+        {
+            printk(XENLOG_ERR
+                   "Failed to add %lu references to page %"PRI_mfn".\n",
+                   nr_borrowers, mfn_x(smfn) + i);
+            goto fail;
+        }
+    }
+
+    return 0;
+
+ fail:
+    while ( --i >= 0 )
+        put_page_nr(page + i, nr_borrowers);
+    return ret;
+}
+
+static int __init append_shm_bank_to_domain(struct kernel_info *kinfo,
+                                            paddr_t start, paddr_t size,
+                                            const char *shm_id)
+{
+    if ( kinfo->shm_mem.nr_banks >= NR_MEM_BANKS )
+        return -ENOMEM;
+
+    kinfo->shm_mem.bank[kinfo->shm_mem.nr_banks].start = start;
+    kinfo->shm_mem.bank[kinfo->shm_mem.nr_banks].size = size;
+    safe_strcpy(kinfo->shm_mem.bank[kinfo->shm_mem.nr_banks].shm_id, shm_id);
+    kinfo->shm_mem.nr_banks++;
+
+    return 0;
+}
+
+int __init process_shm(struct domain *d, struct kernel_info *kinfo,
+                       const struct dt_device_node *node)
+{
+    struct dt_device_node *shm_node;
+
+    dt_for_each_child_node(node, shm_node)
+    {
+        const struct dt_property *prop;
+        const __be32 *cells;
+        uint32_t addr_cells, size_cells;
+        paddr_t gbase, pbase, psize;
+        int ret = 0;
+        unsigned int i;
+        const char *role_str;
+        const char *shm_id;
+        bool owner_dom_io = true;
+
+        if ( !dt_device_is_compatible(shm_node, "xen,domain-shared-memory-v1") )
+            continue;
+
+        /*
+         * xen,shared-mem = <pbase, gbase, size>;
+         * TODO: pbase is optional.
+         */
+        addr_cells = dt_n_addr_cells(shm_node);
+        size_cells = dt_n_size_cells(shm_node);
+        prop = dt_find_property(shm_node, "xen,shared-mem", NULL);
+        BUG_ON(!prop);
+        cells = (const __be32 *)prop->value;
+        device_tree_get_reg(&cells, addr_cells, addr_cells, &pbase, &gbase);
+        psize = dt_read_paddr(cells, size_cells);
+        if ( !IS_ALIGNED(pbase, PAGE_SIZE) || !IS_ALIGNED(gbase, PAGE_SIZE) )
+        {
+            printk("%pd: physical address 0x%"PRIpaddr", or guest address 0x%"PRIpaddr" is not suitably aligned.\n",
+                   d, pbase, gbase);
+            return -EINVAL;
+        }
+        if ( !IS_ALIGNED(psize, PAGE_SIZE) )
+        {
+            printk("%pd: size 0x%"PRIpaddr" is not suitably aligned\n",
+                   d, psize);
+            return -EINVAL;
+        }
+
+        for ( i = 0; i < PFN_DOWN(psize); i++ )
+            if ( !mfn_valid(mfn_add(maddr_to_mfn(pbase), i)) )
+            {
+                printk("%pd: invalid physical address 0x%"PRI_mfn"\n",
+                       d, mfn_x(mfn_add(maddr_to_mfn(pbase), i)));
+                return -EINVAL;
+            }
+
+        /*
+         * "role" property is optional and if it is defined explicitly,
+         * then the owner domain is not the default "dom_io" domain.
+         */
+        if ( dt_property_read_string(shm_node, "role", &role_str) == 0 )
+            owner_dom_io = false;
+
+        if ( dt_property_read_string(shm_node, "xen,shm-id", &shm_id) )
+        {
+            printk("%pd: invalid \"xen,shm-id\" property", d);
+            return -EINVAL;
+        }
+        BUG_ON((strlen(shm_id) <= 0) || (strlen(shm_id) >= MAX_SHM_ID_LENGTH));
+
+        /*
+         * DOMID_IO is a fake domain and is not described in the Device-Tree.
+         * Therefore when the owner of the shared region is DOMID_IO, we will
+         * only find the borrowers.
+         */
+        if ( (owner_dom_io && !is_shm_allocated_to_domio(pbase)) ||
+             (!owner_dom_io && strcmp(role_str, "owner") == 0) )
+        {
+            /*
+             * We found the first borrower of the region, the owner was not
+             * specified, so they should be assigned to dom_io.
+             */
+            ret = assign_shared_memory(owner_dom_io ? dom_io : d,
+                                       addr_cells, size_cells,
+                                       pbase, psize, gbase);
+            if ( ret )
+                return ret;
+        }
+
+        if ( owner_dom_io || (strcmp(role_str, "borrower") == 0) )
+        {
+            /* Set up P2M foreign mapping for borrower domain. */
+            ret = map_regions_p2mt(d, _gfn(PFN_UP(gbase)), PFN_DOWN(psize),
+                                   _mfn(PFN_UP(pbase)), p2m_map_foreign_rw);
+            if ( ret )
+                return ret;
+        }
+
+        /*
+         * Record static shared memory region info for later setting
+         * up shm-node in guest device tree.
+         */
+        ret = append_shm_bank_to_domain(kinfo, gbase, psize, shm_id);
+        if ( ret )
+            return ret;
+    }
+
+    return 0;
+}
+
+static int __init make_shm_memory_node(const struct domain *d, void *fdt,
+                                       int addrcells, int sizecells,
+                                       const struct meminfo *mem)
+{
+    unsigned int i = 0;
+    int res = 0;
+
+    if ( mem->nr_banks == 0 )
+        return -ENOENT;
+
+    /*
+     * For each shared memory region, a range is exposed under
+     * the /reserved-memory node as a child node. Each range sub-node is
+     * named xen-shmem@<address>.
+     */
+    dt_dprintk("Create xen-shmem node\n");
+
+    for ( ; i < mem->nr_banks; i++ )
+    {
+        uint64_t start = mem->bank[i].start;
+        uint64_t size = mem->bank[i].size;
+        const char compat[] = "xen,shared-memory-v1";
+        /* Worst case addrcells + sizecells */
+        __be32 reg[GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS];
+        __be32 *cells;
+        unsigned int len = (addrcells + sizecells) * sizeof(__be32);
+
+        res = domain_fdt_begin_node(fdt, "xen-shmem", mem->bank[i].start);
+        if ( res )
+            return res;
+
+        res = fdt_property(fdt, "compatible", compat, sizeof(compat));
+        if ( res )
+            return res;
+
+        cells = reg;
+        dt_child_set_range(&cells, addrcells, sizecells, start, size);
+
+        res = fdt_property(fdt, "reg", reg, len);
+        if ( res )
+            return res;
+
+        dt_dprintk("Shared memory bank %u: %#"PRIx64"->%#"PRIx64"\n",
+                   i, start, start + size);
+
+        res = fdt_property_string(fdt, "xen,id", mem->bank[i].shm_id);
+        if ( res )
+            return res;
+
+        /*
+         * TODO:
+         * - xen,offset: (borrower VMs only)
+         *   64 bit integer offset within the owner virtual machine's shared
+         *   memory region used for the mapping in the borrower VM
+         */
+        res = fdt_property_u64(fdt, "xen,offset", 0);
+        if ( res )
+            return res;
+
+        res = fdt_end_node(fdt);
+        if ( res )
+            return res;
+    }
+
+    return res;
+}
+
+int __init process_shm_node(const void *fdt, int node, uint32_t address_cells,
+                            uint32_t size_cells)
+{
+    const struct fdt_property *prop, *prop_id, *prop_role;
+    const __be32 *cell;
+    paddr_t paddr, gaddr, size;
+    struct meminfo *mem = &bootinfo.reserved_mem;
+    unsigned int i;
+    int len;
+    bool owner = false;
+    const char *shm_id;
+
+    if ( address_cells < 1 || size_cells < 1 )
+    {
+        printk("fdt: invalid #address-cells or #size-cells for static shared memory node.\n");
+        return -EINVAL;
+    }
+
+    /*
+     * "xen,shm-id" property holds an arbitrary string with a strict limit
+     * on the number of characters, MAX_SHM_ID_LENGTH
+     */
+    prop_id = fdt_get_property(fdt, node, "xen,shm-id", NULL);
+    if ( !prop_id )
+        return -ENOENT;
+    shm_id = (const char *)prop_id->data;
+    if ( strnlen(shm_id, MAX_SHM_ID_LENGTH) == MAX_SHM_ID_LENGTH )
+    {
+        printk("fdt: invalid xen,shm-id %s, it must be limited to %u characters\n",
+               shm_id, MAX_SHM_ID_LENGTH);
+        return -EINVAL;
+    }
+
+    /*
+     * "role" property is optional and if it is defined explicitly,
+     * it must be either `owner` or `borrower`.
+     */
+    prop_role = fdt_get_property(fdt, node, "role", NULL);
+    if ( prop_role )
+    {
+        if ( !strcmp(prop_role->data, "owner") )
+            owner = true;
+        else if ( strcmp(prop_role->data, "borrower") )
+        {
+            printk("fdt: invalid `role` property for static shared memory node.\n");
+            return -EINVAL;
+        }
+    }
+
+    /*
+     * xen,shared-mem = <paddr, gaddr, size>;
+     * Memory region starting from physical address #paddr of #size shall
+     * be mapped to guest physical address #gaddr as static shared memory
+     * region.
+     */
+    prop = fdt_get_property(fdt, node, "xen,shared-mem", &len);
+    if ( !prop )
+        return -ENOENT;
+
+    if ( len != dt_cells_to_size(address_cells + size_cells + address_cells) )
+    {
+        if ( len == dt_cells_to_size(size_cells + address_cells) )
+            printk("fdt: host physical address must be chosen by users at the moment.\n");
+
+        printk("fdt: invalid `xen,shared-mem` property.\n");
+        return -EINVAL;
+    }
+
+    cell = (const __be32 *)prop->data;
+    device_tree_get_reg(&cell, address_cells, address_cells, &paddr, &gaddr);
+    size = dt_next_cell(size_cells, &cell);
+
+    if ( !size )
+    {
+        printk("fdt: the size for static shared memory region can not be zero\n");
+        return -EINVAL;
+    }
+
+    for ( i = 0; i < mem->nr_banks; i++ )
+    {
+        /*
+         * Meet the following check:
+         * 1) The shm ID matches and the region exactly match
+         * 2) The shm ID doesn't match and the region doesn't overlap
+         * with an existing one
+         */
+        if ( paddr == mem->bank[i].start && size == mem->bank[i].size )
+        {
+            if ( strncmp(shm_id, mem->bank[i].shm_id, MAX_SHM_ID_LENGTH) == 0 )
+                break;
+            else
+            {
+                printk("fdt: xen,shm-id %s does not match for all the nodes using the same region.\n",
+                       shm_id);
+                return -EINVAL;
+            }
+        }
+        else
+        {
+            paddr_t end = paddr + size;
+            paddr_t bank_end = mem->bank[i].start + mem->bank[i].size;
+
+            if ( (end <= paddr) || (bank_end <= mem->bank[i].start) )
+            {
+                printk("fdt: static shared memory region %s overflow\n", shm_id);
+                return -EINVAL;
+            }
+
+            if ( check_reserved_regions_overlap(paddr, size) )
+                return -EINVAL;
+            else
+            {
+                if ( strcmp(shm_id, mem->bank[i].shm_id) != 0 )
+                    continue;
+                else
+                {
+                    printk("fdt: different shared memory region could not share the same shm ID %s\n",
+                           shm_id);
+                    return -EINVAL;
+                }
+            }
+        }
+    }
+
+    if ( i == mem->nr_banks )
+    {
+        if ( i < NR_MEM_BANKS )
+        {
+            /* Static shared memory shall be reserved from any other use. */
+            safe_strcpy(mem->bank[mem->nr_banks].shm_id, shm_id);
+            mem->bank[mem->nr_banks].start = paddr;
+            mem->bank[mem->nr_banks].size = size;
+            mem->bank[mem->nr_banks].type = MEMBANK_STATIC_DOMAIN;
+            mem->nr_banks++;
+        }
+        else
+        {
+            printk("Warning: Max number of supported memory regions reached.\n");
+            return -ENOSPC;
+        }
+    }
+    /*
+     * keep a count of the number of borrowers, which later may be used
+     * to calculate the reference count.
+     */
+    if ( !owner )
+        mem->bank[i].nr_shm_borrowers++;
+
+    return 0;
+}
+
+int __init make_resv_memory_node(const struct domain *d, void *fdt,
+                                 int addrcells, int sizecells,
+                                 const struct meminfo *mem)
+{
+    int res = 0;
+    /* Placeholder for reserved-memory\0 */
+    const char resvbuf[16] = "reserved-memory";
+
+    if ( mem->nr_banks == 0 )
+        /* No shared memory provided. */
+        return 0;
+
+    dt_dprintk("Create reserved-memory node\n");
+
+    res = fdt_begin_node(fdt, resvbuf);
+    if ( res )
+        return res;
+
+    res = fdt_property(fdt, "ranges", NULL, 0);
+    if ( res )
+        return res;
+
+    res = fdt_property_cell(fdt, "#address-cells", addrcells);
+    if ( res )
+        return res;
+
+    res = fdt_property_cell(fdt, "#size-cells", sizecells);
+    if ( res )
+        return res;
+
+    res = make_shm_memory_node(d, fdt, addrcells, sizecells, mem);
+    if ( res )
+        return res;
+
+    res = fdt_end_node(fdt);
+
+    return res;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:35:24 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:35:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644625.1005884 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gGK-0007VY-Sb; Thu, 30 Nov 2023 12:35:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644625.1005884; Thu, 30 Nov 2023 12:35: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 1r8gGK-0007VR-Q1; Thu, 30 Nov 2023 12:35:24 +0000
Received: by outflank-mailman (input) for mailman id 644625;
 Thu, 30 Nov 2023 12:35: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 1r8gGJ-0007VG-D8
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:35: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 1r8gGJ-0005SO-CL
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:35:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gGJ-0005UO-BZ
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:35: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=G+9ls2ch+dBS231izPCSZNDhixSu2HrqNfthnr5HH1M=; b=CEWz/fnz0zGpCiNeQF/bAVZK4q
	ZN6KabQikIA6R8bKIPWkIura0W80ouIYFfwfLgvcYmT6ImCNI+GWi5DGlQiyiMaJWbF+3LRFcXRdE
	r1iSWQj7Humx5SwbsomCLbI3O/799nUuAHyjaPjCbyA9Q2ZlnGnPjRPhkdESsrN6kw9M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/dom0less: introduce Kconfig for dom0less feature
Message-Id: <E1r8gGJ-0005UO-BZ@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:35:23 +0000

commit 18540a313cc66a04eb15a67d74c7992a8576fbec
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Fri Nov 24 09:48:41 2023 +0000
Commit:     Julien Grall <julien@xen.org>
CommitDate: Tue Nov 28 19:21:43 2023 +0100

    arm/dom0less: introduce Kconfig for dom0less feature
    
    Introduce a Kconfig for the dom0less feature, enabled by default,
    to be able to choose if the feature should be compiled or not.
    
    Provide static inline stubs when the option is disabled for the
    functions externally visible.
    
    Use the new Kconfig to remove dom0less DT binding from the efi-boot.h
    code when the Kconfig is not enabled, do the same for
    allocate_bank_memory inside domain_build.c that currently is used
    only by dom0less-build.c module, but it's kept there provisioning
    its usage by dom0 code.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/Kconfig                      |  8 ++++++++
 xen/arch/arm/Makefile                     |  2 +-
 xen/arch/arm/domain_build.c               |  2 ++
 xen/arch/arm/efi/efi-boot.h               |  4 ++++
 xen/arch/arm/include/asm/dom0less-build.h | 12 ++++++++++++
 xen/common/Kconfig                        |  2 +-
 6 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 57dc995712..f73b62e50d 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -88,6 +88,14 @@ config GICV2
 	  Driver for the ARM Generic Interrupt Controller v2.
 	  If unsure, say Y
 
+config DOM0LESS_BOOT
+	bool "Dom0less boot support" if EXPERT
+	default y
+	help
+	  Dom0less boot support enables Xen to create and start domU guests during
+	  Xen boot without the need of a control domain (Dom0), which could be
+	  present anyway.
+
 config GICV3
 	bool "GICv3 driver"
 	depends on !NEW_VGIC
diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 2fcc3c2535..809772417c 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -16,7 +16,7 @@ obj-y += cpufeature.o
 obj-y += decode.o
 obj-y += device.o
 obj-$(CONFIG_IOREQ_SERVER) += dm.o
-obj-y += dom0less-build.init.o
+obj-$(CONFIG_DOM0LESS_BOOT) += dom0less-build.init.o
 obj-y += domain.o
 obj-y += domain_build.init.o
 obj-$(CONFIG_ARCH_MAP_DOMAIN_PAGE) += domain_page.o
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 7eb766da9c..df66fb88d8 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -416,6 +416,7 @@ static void __init allocate_memory_11(struct domain *d,
     }
 }
 
+#ifdef CONFIG_DOM0LESS_BOOT
 bool __init allocate_bank_memory(struct domain *d, struct kernel_info *kinfo,
                                  gfn_t sgfn, paddr_t tot_size)
 {
@@ -477,6 +478,7 @@ bool __init allocate_bank_memory(struct domain *d, struct kernel_info *kinfo,
 
     return true;
 }
+#endif
 
 /*
  * When PCI passthrough is available we want to keep the
diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index 6e6db24455..0cb29f90a0 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -787,6 +787,7 @@ static int __init handle_module_node(const EFI_LOADED_IMAGE *loaded_image,
     return 1;
 }
 
+#ifdef CONFIG_DOM0LESS_BOOT
 /*
  * This function checks for boot modules under the domU guest domain node
  * in the DT.
@@ -834,6 +835,7 @@ static int __init handle_dom0less_domain_node(const EFI_LOADED_IMAGE *loaded_ima
 
     return mb_modules_found;
 }
+#endif
 
 /*
  * This function checks for xen domain nodes under the /chosen node for possible
@@ -861,6 +863,7 @@ static int __init efi_check_dt_boot(const EFI_LOADED_IMAGE *loaded_image)
     {
         int ret;
 
+#ifdef CONFIG_DOM0LESS_BOOT
         if ( !fdt_node_check_compatible(fdt_efi, node, "xen,domain") )
         {
             /* Found a node with compatible xen,domain; handle this node. */
@@ -869,6 +872,7 @@ static int __init efi_check_dt_boot(const EFI_LOADED_IMAGE *loaded_image)
                 return ERROR_DT_MODULE_DOMU;
         }
         else
+#endif
         {
             ret = handle_module_node(loaded_image, &dir_handle, node, addr_len,
                                      size_len, false);
diff --git a/xen/arch/arm/include/asm/dom0less-build.h b/xen/arch/arm/include/asm/dom0less-build.h
index e027225803..5864944bda 100644
--- a/xen/arch/arm/include/asm/dom0less-build.h
+++ b/xen/arch/arm/include/asm/dom0less-build.h
@@ -5,9 +5,21 @@
 
 #include <xen/stdbool.h>
 
+#ifdef CONFIG_DOM0LESS_BOOT
+
 void create_domUs(void);
 bool is_dom0less_mode(void);
 
+#else /* !CONFIG_DOM0LESS_BOOT */
+
+static inline void create_domUs(void) {}
+static inline bool is_dom0less_mode(void)
+{
+    return false;
+}
+
+#endif /* CONFIG_DOM0LESS_BOOT */
+
 #endif /* __ASM_DOM0LESS_BUILD_H_ */
 
 /*
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 4d6fe05164..310ad4229c 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -100,7 +100,7 @@ config NUMA
 
 config STATIC_MEMORY
 	bool "Static Allocation Support (UNSUPPORTED)" if UNSUPPORTED
-	depends on ARM
+	depends on DOM0LESS_BOOT
 	help
 	  Static Allocation refers to system or sub-system(domains) for
 	  which memory areas are pre-defined by configuration using physical
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:35:34 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:35:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644626.1005889 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gGU-0007aq-UV; Thu, 30 Nov 2023 12:35:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644626.1005889; Thu, 30 Nov 2023 12:35: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 1r8gGU-0007ai-RY; Thu, 30 Nov 2023 12:35:34 +0000
Received: by outflank-mailman (input) for mailman id 644626;
 Thu, 30 Nov 2023 12:35: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 1r8gGT-0007aT-Ft
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:35: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 1r8gGT-0005So-FE
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:35:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gGT-0005W9-Ed
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:35: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=cRc34m7/81Qkgc1B72X6is5ExS+sYVvYeKHoOKtUo0Q=; b=lDdOx73r4ioQVJWa9WS3lOaCnu
	xYRSI4fX+O0Otb2FsS9ExY6S2nHhc0aP1e3SL6YNMt8vmrlIP2iiPsw9bVa7bBVF2ofACrIflDNiH
	F0gzO1VcEwfBbA2gUgQDqsSvujGZMfuUkY3Ny3xhTLipVPi59+dSJ3slhJrL6pdrmY9Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] domain: add ASSERT to help static analysis tools
Message-Id: <E1r8gGT-0005W9-Ed@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:35:33 +0000

commit caa221791d4214445f2913f51a3230cc5644ab8d
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Fri Nov 17 10:21:52 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Nov 28 19:12:53 2023 -0800

    domain: add ASSERT to help static analysis tools
    
    Static analysis tools may detect a possible null pointer
    dereference of 'config'. This ASSERT helps them in detecting
    that such a condition is not possible given that only
    real domains can enter this branch, which are guaranteeed to have
    a non-NULL config at this point, but this information is not
    inferred by the tool.
    
    Checking that the condition given in the assertion holds via
    testing is the means to protect release builds, where the assertion
    expands to effectively nothing.
    
    Suggested-by: Julien Grall <julien@xen.org>
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/domain.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index f15c2f1e95..cd2ca6d49a 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -700,6 +700,13 @@ struct domain *domain_create(domid_t domid,
 
     if ( !is_idle_domain(d) )
     {
+        /*
+         * The assertion helps static analysis tools infer that config cannot
+         * be NULL in this branch, which in turn means that it can be safely
+         * dereferenced. Therefore, this assertion is not redundant.
+         */
+        ASSERT(config);
+
         watchdog_domain_init(d);
         init_status |= INIT_watchdog;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:35:45 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:35:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644627.1005892 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gGe-0007en-Vz; Thu, 30 Nov 2023 12:35:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644627.1005892; Thu, 30 Nov 2023 12:35: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 1r8gGe-0007ef-T2; Thu, 30 Nov 2023 12:35:44 +0000
Received: by outflank-mailman (input) for mailman id 644627;
 Thu, 30 Nov 2023 12:35: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 1r8gGd-0007eY-JE
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:35: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 1r8gGd-0005Sw-IO
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:35:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gGd-0005XB-Hj
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:35: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=IMR++3gpU40c9wbVbCug3h0+Lj5c48zTEI9dyFTVrSQ=; b=quJFLjkkdczwR77VuLtt2lmble
	mOi7AcXOmoLJ5q2EMl+iL5kCNJ8FESf80TfhaSGRtoina6//qAqPSbuHdhUZ61pQLyJhZHWWvYbsT
	I6Fo9qt8OeEhVdtXF6wvq2erWaYngHZGG9YKn2mT4ruMUkoR8yUYP1eYjttPpqxP2dRc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: replace some occurrences of SAF-1-safe with asmlinkage attribute
Message-Id: <E1r8gGd-0005XB-Hj@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:35:43 +0000

commit 72ec070930fa4a34d7665ba2a7a42a91d0c85bed
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Fri Nov 24 09:11:47 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Nov 28 19:20:13 2023 -0800

    xen: replace some occurrences of SAF-1-safe with asmlinkage attribute
    
    The comment-based justifications for MISRA C:2012 Rule 8.4 are replaced
    by the asmlinkage pseudo-attribute, for the sake of uniformity.
    
    asmlinkage may in the future have the effect of altering the calling
    convention, therefore three special where the calling convention is
    altered by another macro retain the textual deviation.
    
    No functional change.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/cpuerrata.c |  7 +++----
 xen/arch/arm/setup.c     |  5 ++---
 xen/arch/arm/smpboot.c   |  3 +--
 xen/arch/arm/traps.c     | 21 +++++++--------------
 xen/arch/x86/extable.c   |  3 +--
 xen/arch/x86/setup.c     |  3 +--
 xen/arch/x86/traps.c     | 27 +++++++++------------------
 7 files changed, 24 insertions(+), 45 deletions(-)

diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
index 9137958fb6..a28fa6ac78 100644
--- a/xen/arch/arm/cpuerrata.c
+++ b/xen/arch/arm/cpuerrata.c
@@ -370,10 +370,9 @@ custom_param("spec-ctrl", parse_spec_ctrl);
 
 /* Arm64 only for now as for Arm32 the workaround is currently handled in C. */
 #ifdef CONFIG_ARM_64
-/* SAF-1-safe */
-void __init arm_enable_wa2_handling(const struct alt_instr *alt,
-                                    const uint32_t *origptr,
-                                    uint32_t *updptr, int nr_inst)
+void asmlinkage __init arm_enable_wa2_handling(const struct alt_instr *alt,
+                                               const uint32_t *origptr,
+                                               uint32_t *updptr, int nr_inst)
 {
     BUG_ON(nr_inst != 1);
 
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index d2a47416e4..d07ea044db 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -704,9 +704,8 @@ void __init populate_boot_allocator(void)
 size_t __read_mostly dcache_line_bytes;
 
 /* C entry point for boot CPU */
-/* SAF-1-safe */
-void __init start_xen(unsigned long boot_phys_offset,
-                      unsigned long fdt_paddr)
+void asmlinkage __init start_xen(unsigned long boot_phys_offset,
+                                 unsigned long fdt_paddr)
 {
     size_t fdt_size;
     const char *cmdline;
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 36db6b8880..7110bc11fc 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -303,8 +303,7 @@ smp_prepare_cpus(void)
 }
 
 /* Boot the current CPU */
-/* SAF-1-safe */
-void start_secondary(void)
+void asmlinkage start_secondary(void)
 {
     unsigned int cpuid = init_data.cpuid;
 
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 8492e2b7bb..3784e8276e 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -161,8 +161,7 @@ void init_traps(void)
     isb();
 }
 
-/* SAF-1-safe */
-void __div0(void)
+void asmlinkage __div0(void)
 {
     printk("Division by zero in hypervisor.\n");
     BUG();
@@ -1955,8 +1954,7 @@ static inline bool needs_ssbd_flip(struct vcpu *v)
  * Actions that needs to be done after entering the hypervisor from the
  * guest and before the interrupts are unmasked.
  */
-/* SAF-1-safe */
-void enter_hypervisor_from_guest_preirq(void)
+void asmlinkage enter_hypervisor_from_guest_preirq(void)
 {
     struct vcpu *v = current;
 
@@ -1970,8 +1968,7 @@ void enter_hypervisor_from_guest_preirq(void)
  * guest and before we handle any request. Depending on the exception trap,
  * this may be called with interrupts unmasked.
  */
-/* SAF-1-safe */
-void enter_hypervisor_from_guest(void)
+void asmlinkage enter_hypervisor_from_guest(void)
 {
     struct vcpu *v = current;
 
@@ -1999,8 +1996,7 @@ void enter_hypervisor_from_guest(void)
     vgic_sync_from_lrs(v);
 }
 
-/* SAF-1-safe */
-void do_trap_guest_sync(struct cpu_user_regs *regs)
+void asmlinkage do_trap_guest_sync(struct cpu_user_regs *regs)
 {
     const union hsr hsr = { .bits = regs->hsr };
 
@@ -2195,14 +2191,12 @@ void do_trap_guest_serror(struct cpu_user_regs *regs)
     __do_trap_serror(regs, true);
 }
 
-/* SAF-1-safe */
-void do_trap_irq(struct cpu_user_regs *regs)
+void asmlinkage do_trap_irq(struct cpu_user_regs *regs)
 {
     gic_interrupt(regs, 0);
 }
 
-/* SAF-1-safe */
-void do_trap_fiq(struct cpu_user_regs *regs)
+void asmlinkage do_trap_fiq(struct cpu_user_regs *regs)
 {
     gic_interrupt(regs, 1);
 }
@@ -2275,8 +2269,7 @@ static bool check_for_vcpu_work(void)
  *
  * The function will return with IRQ masked.
  */
-/* SAF-1-safe */
-void leave_hypervisor_to_guest(void)
+void asmlinkage leave_hypervisor_to_guest(void)
 {
     local_irq_disable();
 
diff --git a/xen/arch/x86/extable.c b/xen/arch/x86/extable.c
index 652010f413..1555b9408f 100644
--- a/xen/arch/x86/extable.c
+++ b/xen/arch/x86/extable.c
@@ -194,8 +194,7 @@ static int __init cf_check stub_selftest(void)
 __initcall(stub_selftest);
 #endif
 
-/* SAF-1-safe */
-unsigned long search_pre_exception_table(struct cpu_user_regs *regs)
+unsigned long asmlinkage search_pre_exception_table(struct cpu_user_regs *regs)
 {
     unsigned long addr = regs->rip;
     unsigned long fixup = search_one_extable(
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index f6b8a3efd7..3cba2be0af 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -976,8 +976,7 @@ static struct domain *__init create_dom0(const module_t *image,
 /* How much of the directmap is prebuilt at compile time. */
 #define PREBUILT_MAP_LIMIT (1 << L2_PAGETABLE_SHIFT)
 
-/* SAF-1-safe */
-void __init noreturn __start_xen(unsigned long mbi_p)
+void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 {
     const char *memmap_type = NULL, *loader, *cmdline = "";
     char *kextra;
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index f2a77003ab..7724306116 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -833,8 +833,7 @@ void fatal_trap(const struct cpu_user_regs *regs, bool show_remote)
           (regs->eflags & X86_EFLAGS_IF) ? "" : " IN INTERRUPT CONTEXT");
 }
 
-/* SAF-1-safe */
-void do_unhandled_trap(struct cpu_user_regs *regs)
+void asmlinkage do_unhandled_trap(struct cpu_user_regs *regs)
 {
     unsigned int trapnr = regs->entry_vector;
 
@@ -921,8 +920,7 @@ static bool extable_fixup(struct cpu_user_regs *regs, bool print)
     return true;
 }
 
-/* SAF-1-safe */
-void do_trap(struct cpu_user_regs *regs)
+void asmlinkage do_trap(struct cpu_user_regs *regs)
 {
     unsigned int trapnr = regs->entry_vector;
 
@@ -1154,8 +1152,7 @@ void cpuid_hypervisor_leaves(const struct vcpu *v, uint32_t leaf,
     }
 }
 
-/* SAF-1-safe */
-void do_invalid_op(struct cpu_user_regs *regs)
+void asmlinkage do_invalid_op(struct cpu_user_regs *regs)
 {
     u8 bug_insn[2];
     const void *eip = (const void *)regs->rip;
@@ -1200,8 +1197,7 @@ void do_invalid_op(struct cpu_user_regs *regs)
     panic("FATAL TRAP: vector = %d (invalid opcode)\n", X86_EXC_UD);
 }
 
-/* SAF-1-safe */
-void do_int3(struct cpu_user_regs *regs)
+void asmlinkage do_int3(struct cpu_user_regs *regs)
 {
     struct vcpu *curr = current;
 
@@ -1568,8 +1564,7 @@ static int fixup_page_fault(unsigned long addr, struct cpu_user_regs *regs)
     return 0;
 }
 
-/* SAF-1-safe */
-void do_page_fault(struct cpu_user_regs *regs)
+void asmlinkage do_page_fault(struct cpu_user_regs *regs)
 {
     unsigned long addr;
     unsigned int error_code;
@@ -1646,8 +1641,7 @@ void do_page_fault(struct cpu_user_regs *regs)
  * during early boot (an issue was seen once, but was most likely a hardware
  * problem).
  */
-/* SAF-1-safe */
-void __init do_early_page_fault(struct cpu_user_regs *regs)
+void asmlinkage __init do_early_page_fault(struct cpu_user_regs *regs)
 {
     static unsigned int __initdata stuck;
     static unsigned long __initdata prev_eip, prev_cr2;
@@ -1847,8 +1841,7 @@ void trigger_nmi_continuation(void)
     apic_wait_icr_idle();
 }
 
-/* SAF-1-safe */
-void do_device_not_available(struct cpu_user_regs *regs)
+void asmlinkage do_device_not_available(struct cpu_user_regs *regs)
 {
 #ifdef CONFIG_PV
     struct vcpu *curr = current;
@@ -1886,8 +1879,7 @@ void do_device_not_available(struct cpu_user_regs *regs)
 
 void nocall sysenter_eflags_saved(void);
 
-/* SAF-1-safe */
-void do_debug(struct cpu_user_regs *regs)
+void asmlinkage do_debug(struct cpu_user_regs *regs)
 {
     unsigned long dr6;
     struct vcpu *v = current;
@@ -2012,8 +2004,7 @@ void do_debug(struct cpu_user_regs *regs)
     pv_inject_hw_exception(X86_EXC_DB, X86_EVENT_NO_EC);
 }
 
-/* SAF-1-safe */
-void do_entry_CP(struct cpu_user_regs *regs)
+void asmlinkage do_entry_CP(struct cpu_user_regs *regs)
 {
     static const char errors[][10] = {
         [1] = "near ret",
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:35:55 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:35:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644628.1005896 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gGp-000887-1E; Thu, 30 Nov 2023 12:35:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644628.1005896; Thu, 30 Nov 2023 12:35: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 1r8gGo-000880-UQ; Thu, 30 Nov 2023 12:35:54 +0000
Received: by outflank-mailman (input) for mailman id 644628;
 Thu, 30 Nov 2023 12:35: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 1r8gGn-00087f-MR
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:35: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 1r8gGn-0005TB-LY
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:35:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gGn-0005Xw-Kp
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:35: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=1boW2Mqu1pVA8tEvgnWsaETS1b5Rhfsej7R8tEFdVzc=; b=l81DZ+SL4lZTKdtZ+slI9AYQsX
	/CNPZ+oob7XV9OT0MbsTlT4QHrQFjPOs/05iy/qeDreudUz+IYdBhUFooR068mXQWU1szEnLqFB2y
	hHblVwMYjuatvU3TsOK5xLPR9W+n2OWN+78AfNZJa4Y6gPKr9Dt4x6+h1YwenbDBzQG8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: remove <asm/delay.h>
Message-Id: <E1r8gGn-0005Xw-Kp@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:35:53 +0000

commit 84eba1dc6d21bf176291d37e3d90b87cf7227d08
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Nov 29 10:02:38 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 29 10:02:38 2023 +0100

    xen: remove <asm/delay.h>
    
    <asm/delay.h> only declares udelay() function so udelay()
    declaration was moved to xen/delay.h.
    
    For x86, __udelay() was renamed to udelay() and removed
    inclusion of <asm/delay.h> in x86 code.
    
    For ppc, udelay() stub definition was moved to ppc/stubs.c.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/arm/include/asm/delay.h  | 14 --------------
 xen/arch/ppc/include/asm/delay.h  | 12 ------------
 xen/arch/ppc/stubs.c              |  7 +++++++
 xen/arch/x86/cpu/microcode/core.c |  2 +-
 xen/arch/x86/delay.c              |  2 +-
 xen/arch/x86/include/asm/delay.h  | 13 -------------
 xen/include/xen/delay.h           |  2 +-
 7 files changed, 10 insertions(+), 42 deletions(-)

diff --git a/xen/arch/arm/include/asm/delay.h b/xen/arch/arm/include/asm/delay.h
deleted file mode 100644
index 042907d9d5..0000000000
--- a/xen/arch/arm/include/asm/delay.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef _ARM_DELAY_H
-#define _ARM_DELAY_H
-
-extern void udelay(unsigned long usecs);
-
-#endif /* defined(_ARM_DELAY_H) */
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/arch/ppc/include/asm/delay.h b/xen/arch/ppc/include/asm/delay.h
deleted file mode 100644
index da6635888b..0000000000
--- a/xen/arch/ppc/include/asm/delay.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef __ASM_PPC_DELAY_H__
-#define __ASM_PPC_DELAY_H__
-
-#include <xen/lib.h>
-
-static inline void udelay(unsigned long usecs)
-{
-    BUG_ON("unimplemented");
-}
-
-#endif /* __ASM_PPC_DELAY_H__ */
diff --git a/xen/arch/ppc/stubs.c b/xen/arch/ppc/stubs.c
index 4c276b0e39..a96e45626d 100644
--- a/xen/arch/ppc/stubs.c
+++ b/xen/arch/ppc/stubs.c
@@ -337,3 +337,10 @@ int __init parse_arch_dom0_param(const char *s, const char *e)
 {
     BUG_ON("unimplemented");
 }
+
+/* delay.c */
+
+void udelay(unsigned long usecs)
+{
+    BUG_ON("unimplemented");
+}
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 95bcb52b22..120a11d503 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -23,6 +23,7 @@
 
 #include <xen/alternative-call.h>
 #include <xen/cpu.h>
+#include <xen/delay.h>
 #include <xen/earlycpio.h>
 #include <xen/err.h>
 #include <xen/guest_access.h>
@@ -35,7 +36,6 @@
 
 #include <asm/apic.h>
 #include <asm/cpu-policy.h>
-#include <asm/delay.h>
 #include <asm/nmi.h>
 #include <asm/processor.h>
 #include <asm/setup.h>
diff --git a/xen/arch/x86/delay.c b/xen/arch/x86/delay.c
index 2662c26272..b3a41881a1 100644
--- a/xen/arch/x86/delay.c
+++ b/xen/arch/x86/delay.c
@@ -15,7 +15,7 @@
 #include <asm/msr.h>
 #include <asm/processor.h>
 
-void __udelay(unsigned long usecs)
+void udelay(unsigned long usecs)
 {
     unsigned long ticks = usecs * (cpu_khz / 1000);
     unsigned long s, e;
diff --git a/xen/arch/x86/include/asm/delay.h b/xen/arch/x86/include/asm/delay.h
deleted file mode 100644
index 9be2f46590..0000000000
--- a/xen/arch/x86/include/asm/delay.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef _X86_DELAY_H
-#define _X86_DELAY_H
-
-/*
- * Copyright (C) 1993 Linus Torvalds
- *
- * Delay routines calling functions in arch/i386/lib/delay.c
- */
-
-extern void __udelay(unsigned long usecs);
-#define udelay(n) __udelay(n)
-
-#endif /* defined(_X86_DELAY_H) */
diff --git a/xen/include/xen/delay.h b/xen/include/xen/delay.h
index 9150226271..8fd3b8f99f 100644
--- a/xen/include/xen/delay.h
+++ b/xen/include/xen/delay.h
@@ -3,7 +3,7 @@
 
 /* Copyright (C) 1993 Linus Torvalds */
 
-#include <asm/delay.h>
+void udelay(unsigned long usecs);
 
 static inline void mdelay(unsigned long msec)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:36:05 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:36:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644632.1005909 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gGz-0000HI-Do; Thu, 30 Nov 2023 12:36:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644632.1005909; Thu, 30 Nov 2023 12:36: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 1r8gGz-0000H8-Ap; Thu, 30 Nov 2023 12:36:05 +0000
Received: by outflank-mailman (input) for mailman id 644632;
 Thu, 30 Nov 2023 12:36: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 1r8gGx-0000DM-PN
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:36: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 1r8gGx-0005Tj-Og
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:36:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gGx-0005ZP-Nw
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:36: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=lvDdZAmDDSeSUYidNu2iwOX5vLqG6tHIdGjnSLuxhgc=; b=1KNSQ2v8I9y4lBzGXD3ucR4GJz
	m++70EtlEAzliGeVR8tQvVhS7h3Vc2c0IxyNadkYTjajvy/nqKAWgJtr5eedD5uRyltwUgtOgltTk
	BSiUMu7O5T+m/snG6OvQ9/PPfX8H5h/ZkBQixoOSClWBfhvkCFoRt2etPxZmMLgAgVzM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/console: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r8gGx-0005ZP-Nw@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:36:03 +0000

commit 07551414ca68d215b4877ae044b9ab6eb4cc1b55
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Nov 29 10:03:46 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 29 10:03:46 2023 +0100

    xen/console: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/char/console.c | 4 ++--
 xen/include/xen/console.h  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 946af5e625..0666564ec9 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -393,9 +393,9 @@ long read_console_ring(struct xen_sysctl_readconsole *op)
 static char serial_rx_ring[SERIAL_RX_SIZE];
 static unsigned int serial_rx_cons, serial_rx_prod;
 
-static void (*serial_steal_fn)(const char *, size_t nr) = early_puts;
+static void (*serial_steal_fn)(const char *str, size_t nr) = early_puts;
 
-int console_steal(int handle, void (*fn)(const char *, size_t nr))
+int console_steal(int handle, void (*fn)(const char *str, size_t nr))
 {
     if ( (handle == -1) || (handle != sercon_handle) )
         return 0;
diff --git a/xen/include/xen/console.h b/xen/include/xen/console.h
index ab5c30c0da..68759862e8 100644
--- a/xen/include/xen/console.h
+++ b/xen/include/xen/console.h
@@ -36,7 +36,7 @@ struct domain *console_input_domain(void);
  * Steal output from the console. Returns +ve identifier, else -ve error.
  * Takes the handle of the serial line to steal, and steal callback function.
  */
-int console_steal(int handle, void (*fn)(const char *, size_t nr));
+int console_steal(int handle, void (*fn)(const char *str, size_t nr));
 
 /* Give back stolen console. Takes the identifier returned by console_steal. */
 void console_giveback(int id);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:36:15 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:36:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644633.1005915 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gH9-0000hV-HA; Thu, 30 Nov 2023 12:36:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644633.1005915; Thu, 30 Nov 2023 12:36: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 1r8gH9-0000hK-De; Thu, 30 Nov 2023 12:36:15 +0000
Received: by outflank-mailman (input) for mailman id 644633;
 Thu, 30 Nov 2023 12:36: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 1r8gH7-0000dU-ST
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:36: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 1r8gH7-0005Tq-Ri
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:36:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gH7-0005aC-Qz
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:36: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=k0YSOw0z7LNzJqF79XuHd7EbICl2/fDBiwn5yg7r0BQ=; b=1yJLVp3beOSXQH2lwUYKWuYT+f
	7buUeH8p+fG5M38STXPzNlaccarPPC3uTX2m+V6yJl86VFtcPHvMTK700TpvRZIVPmgSIDTwnzaj3
	6t3rhIEjnfU/81uixBOwHTPYRdESbNaNKK+TX/KIb3N8v4EJsgouOPoF3mfgIVxrb5z4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/acpi: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r8gH7-0005aC-Qz@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:36:13 +0000

commit b0356bc0e092b584bc693f8d9ef32c911a0a725f
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Nov 29 10:04:12 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 29 10:04:12 2023 +0100

    xen/acpi: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/acpi/platform/aclinux.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/acpi/platform/aclinux.h b/xen/include/acpi/platform/aclinux.h
index 9e572460dc..f5e0a6108e 100644
--- a/xen/include/acpi/platform/aclinux.h
+++ b/xen/include/acpi/platform/aclinux.h
@@ -75,9 +75,9 @@
 
 #define acpi_thread_id struct vcpu *
 
-void *acpi_os_alloc_memory(size_t);
-void *acpi_os_zalloc_memory(size_t);
-void acpi_os_free_memory(void *);
+void *acpi_os_alloc_memory(size_t sz);
+void *acpi_os_zalloc_memory(size_t sz);
+void acpi_os_free_memory(void *ptr);
 
 #define ACPI_ALLOCATE(a)	acpi_os_alloc_memory(a)
 #define ACPI_ALLOCATE_ZEROED(a)	acpi_os_zalloc_memory(a)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:36:25 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:36:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644636.1005918 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gHJ-0000xm-Hk; Thu, 30 Nov 2023 12:36:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644636.1005918; Thu, 30 Nov 2023 12:36: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 1r8gHJ-0000xe-F6; Thu, 30 Nov 2023 12:36:25 +0000
Received: by outflank-mailman (input) for mailman id 644636;
 Thu, 30 Nov 2023 12:36: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 1r8gHH-0000uY-VN
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:36: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 1r8gHH-0005U1-UX
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:36:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gHH-0005b0-Tu
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:36: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=1z30I7zFWyRg0DuF6QdIPt+Nhkd89JdBhDrNm9MI+/M=; b=oL8MQwAzIA74oyAHccXEFu4bPG
	furL55WZ3QCeIyIA4kKWZ66gsbSBWjW9tW9madD0x3kcA2GGlC2gVkj3lCsSLyR4QBRAyFdP7QgG5
	SEBxtHqPpDmmwkPnovQOwAU28Knd/g+wBCE2hFTGawHkbetKeA1lcTvlEj1yViKPxVEY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/cpumask: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r8gHH-0005b0-Tu@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:36:23 +0000

commit 022d7d87cc41fc566fe6c8c9255ba3aabebe64b1
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Nov 29 10:04:48 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 29 10:04:48 2023 +0100

    xen/cpumask: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/cpumask.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/include/xen/cpumask.h b/xen/include/xen/cpumask.h
index 9826707909..145e140481 100644
--- a/xen/include/xen/cpumask.h
+++ b/xen/include/xen/cpumask.h
@@ -460,7 +460,9 @@ extern cpumask_t cpu_present_map;
 
 /* Copy to/from cpumap provided by control tools. */
 struct xenctl_bitmap;
-int cpumask_to_xenctl_bitmap(struct xenctl_bitmap *, const cpumask_t *);
-int xenctl_bitmap_to_cpumask(cpumask_var_t *, const struct xenctl_bitmap *);
+int cpumask_to_xenctl_bitmap(struct xenctl_bitmap *xenctl_cpumap,
+                             const cpumask_t *cpumask);
+int xenctl_bitmap_to_cpumask(cpumask_var_t *cpumask,
+                             const struct xenctl_bitmap *xenctl_cpumap);
 
 #endif /* __XEN_CPUMASK_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:36:35 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:36:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644637.1005922 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gHT-00014o-JC; Thu, 30 Nov 2023 12:36:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644637.1005922; Thu, 30 Nov 2023 12:36: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 1r8gHT-00014g-Ga; Thu, 30 Nov 2023 12:36:35 +0000
Received: by outflank-mailman (input) for mailman id 644637;
 Thu, 30 Nov 2023 12:36: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 1r8gHS-00012z-1r
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:36: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 1r8gHS-0005Vv-18
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:36:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gHS-0005bo-0T
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:36: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=uQihCn4tEMjKR3FfPHwLlnavn0cRwrZzO+F+kPbuLHs=; b=t3B4JulGP6tJuHLMBSZTsDmIgx
	1Gr5I76gyq5ICyChen4lu+rT5YhGBiP+lmZ7lG/hMWPkQvUqRvHWzw/IQ7L32wcpwjRnHW9qUAiap
	bZm3mORIsaDjWbwJ9Pg+O9clqjxXElzQpGpthE/GSDk6MrqPxHCRHzqUWS6padFV1jcc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/dmi: address a violation of MISRA C:2012 Rule 8.2
Message-Id: <E1r8gHS-0005bo-0T@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:36:34 +0000

commit 8b1571751824244ca42d40c04205cb19934c39b7
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Nov 29 10:05:28 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 29 10:05:28 2023 +0100

    xen/dmi: address a violation of MISRA C:2012 Rule 8.2
    
    Add missing parameter name. No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/dmi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/xen/dmi.h b/xen/include/xen/dmi.h
index 71a5c46dc6..0fef41842e 100644
--- a/xen/include/xen/dmi.h
+++ b/xen/include/xen/dmi.h
@@ -24,7 +24,7 @@ struct dmi_strmatch {
 };
 
 struct dmi_system_id {
-	int (*callback)(const struct dmi_system_id *);
+	int (*callback)(const struct dmi_system_id *d);
 	const char *ident;
 	struct dmi_strmatch matches[4];
 	void *driver_data;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:36:45 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:36:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644638.1005926 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gHd-0001AQ-LD; Thu, 30 Nov 2023 12:36:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644638.1005926; Thu, 30 Nov 2023 12:36: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 1r8gHd-0001AI-I0; Thu, 30 Nov 2023 12:36:45 +0000
Received: by outflank-mailman (input) for mailman id 644638;
 Thu, 30 Nov 2023 12:36: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 1r8gHc-0001A4-5X
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:36: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 1r8gHc-0005W3-4p
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:36:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gHc-0005cb-3M
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:36: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=Z1aUWJ/dVS72M0eZ4yV9ebB98kHs7LPryRBjWpfY35c=; b=ubsTbY5Z75RV//VrhhlPLZM9NP
	Mfub2KfK/BDBRAln1W1i30lxgT1A73ZL91auBVFWvRfcJSdEnvR6irZpyvhdG0QoGWZ1hK85/V9+X
	UyIy4Vt2m0t9/bV06yZfru4P5gXrCgzVn4ieVFVOcQI4aMJTeOSi1jF9tRqDa3XTaJIw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/x86: In x2APIC mode, derive LDR from APIC ID
Message-Id: <E1r8gHc-0005cb-3M@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:36:44 +0000

commit 90309854fd2440fb08b4c808f47d7670ba0d250d
Author:     Alejandro Vallejo <alejandro.vallejo@cloud.com>
AuthorDate: Wed Nov 29 10:05:55 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 29 10:05:55 2023 +0100

    xen/x86: In x2APIC mode, derive LDR from APIC ID
    
    Both Intel and AMD manuals agree that in x2APIC mode, the APIC LDR and ID
    registers are derivable from each other through a fixed formula.
    
    Xen uses that formula, but applies it to vCPU IDs (which are sequential)
    rather than x2APIC IDs (which are not, at the moment). As I understand it,
    this is an attempt to tightly pack vCPUs into clusters so each cluster has
    16 vCPUs rather than 8, but this is a spec violation.
    
    This patch fixes the implementation so we follow the x2APIC spec for new
    VMs, while preserving the behaviour (buggy or fixed) for migrated-in VMs.
    
    While touching that area, remove the existing printk statement in
    vlapic_load_fixup() (as the checks it performed didn't make sense in x2APIC
    mode and wouldn't affect the outcome) and put another printk as an else
    branch so we get warnings trying to load nonsensical LDR values we don't
    know about.
    
    Fixes: f9e0cccf7b35 ("x86/HVM: fix ID handling of x2APIC emulation")
    Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vlapic.c             | 64 ++++++++++++++++++++++++-----------
 xen/arch/x86/include/asm/hvm/domain.h |  3 ++
 2 files changed, 48 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 5cb87f8649..cdb69d9742 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1061,13 +1061,26 @@ static const struct hvm_mmio_ops vlapic_mmio_ops = {
     .write = vlapic_mmio_write,
 };
 
+static uint32_t x2apic_ldr_from_id(uint32_t id)
+{
+    return ((id & ~0xf) << 12) | (1 << (id & 0xf));
+}
+
 static void set_x2apic_id(struct vlapic *vlapic)
 {
-    u32 id = vlapic_vcpu(vlapic)->vcpu_id;
-    u32 ldr = ((id & ~0xf) << 12) | (1 << (id & 0xf));
+    const struct vcpu *v = vlapic_vcpu(vlapic);
+    uint32_t apic_id = v->vcpu_id * 2;
+    uint32_t apic_ldr = x2apic_ldr_from_id(apic_id);
 
-    vlapic_set_reg(vlapic, APIC_ID, id * 2);
-    vlapic_set_reg(vlapic, APIC_LDR, ldr);
+    /*
+     * Workaround for migrated domains to derive LDRs as the source host
+     * would've.
+     */
+    if ( v->domain->arch.hvm.bug_x2apic_ldr_vcpu_id )
+        apic_ldr = x2apic_ldr_from_id(v->vcpu_id);
+
+    vlapic_set_reg(vlapic, APIC_ID, apic_id);
+    vlapic_set_reg(vlapic, APIC_LDR, apic_ldr);
 }
 
 int guest_wrmsr_apic_base(struct vcpu *v, uint64_t val)
@@ -1498,27 +1511,40 @@ static int cf_check lapic_save_regs(struct vcpu *v, hvm_domain_context_t *h)
  */
 static void lapic_load_fixup(struct vlapic *vlapic)
 {
-    uint32_t id = vlapic->loaded.id;
+    const struct vcpu *v = vlapic_vcpu(vlapic);
+    uint32_t good_ldr = x2apic_ldr_from_id(vlapic->loaded.id);
 
-    if ( vlapic_x2apic_mode(vlapic) && id && vlapic->loaded.ldr == 1 )
+    /* Skip fixups on xAPIC mode, or if the x2APIC LDR is already correct */
+    if ( !vlapic_x2apic_mode(vlapic) ||
+         (vlapic->loaded.ldr == good_ldr) )
+        return;
+
+    if ( vlapic->loaded.ldr == 1 )
     {
-        /*
-         * This is optional: ID != 0 contradicts LDR == 1. It's being added
-         * to aid in eventual debugging of issues arising from the fixup done
-         * here, but can be dropped as soon as it is found to conflict with
-         * other (future) changes.
-         */
-        if ( GET_xAPIC_ID(id) != vlapic_vcpu(vlapic)->vcpu_id * 2 ||
-             id != SET_xAPIC_ID(GET_xAPIC_ID(id)) )
-            printk(XENLOG_G_WARNING "%pv: bogus APIC ID %#x loaded\n",
-                   vlapic_vcpu(vlapic), id);
+       /*
+        * Xen <= 4.4 may have a bug by which all the APICs configured in
+        * x2APIC mode got LDR = 1, which is inconsistent on every vCPU
+        * except for the one with ID = 0. We'll fix the bug now and assign
+        * an LDR value consistent with the APIC ID.
+        */
         set_x2apic_id(vlapic);
     }
-    else /* Undo an eventual earlier fixup. */
+    else if ( vlapic->loaded.ldr == x2apic_ldr_from_id(v->vcpu_id) )
     {
-        vlapic_set_reg(vlapic, APIC_ID, id);
-        vlapic_set_reg(vlapic, APIC_LDR, vlapic->loaded.ldr);
+        /*
+         * Migrations from Xen 4.4 to date (4.19 dev window, Nov 2023) may
+         * have LDR drived from the vCPU ID, not the APIC ID. We must preserve
+         * LDRs so new vCPUs use consistent derivations and existing guests,
+         * which may have already read the LDR at the source host, aren't
+         * surprised when interrupts stop working the way they did at the
+         * other end.
+         */
+        v->domain->arch.hvm.bug_x2apic_ldr_vcpu_id = true;
     }
+    else
+        printk(XENLOG_G_WARNING
+               "%pv: bogus x2APIC record: ID %#x, LDR %#x, expected LDR %#x\n",
+               v, vlapic->loaded.id, vlapic->loaded.ldr, good_ldr);
 }
 
 static int cf_check lapic_load_hidden(struct domain *d, hvm_domain_context_t *h)
diff --git a/xen/arch/x86/include/asm/hvm/domain.h b/xen/arch/x86/include/asm/hvm/domain.h
index 6e53ce4449..dd9d837e84 100644
--- a/xen/arch/x86/include/asm/hvm/domain.h
+++ b/xen/arch/x86/include/asm/hvm/domain.h
@@ -106,6 +106,9 @@ struct hvm_domain {
 
     bool                   is_s3_suspended;
 
+    /* Compatibility setting for a bug in x2APIC LDR */
+    bool bug_x2apic_ldr_vcpu_id;
+
     /* hypervisor intercepted msix table */
     struct list_head       msixtbl_list;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:36:55 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:36:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644639.1005930 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gHn-0001JZ-M7; Thu, 30 Nov 2023 12:36:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644639.1005930; Thu, 30 Nov 2023 12:36: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 1r8gHn-0001JQ-JO; Thu, 30 Nov 2023 12:36:55 +0000
Received: by outflank-mailman (input) for mailman id 644639;
 Thu, 30 Nov 2023 12:36: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 1r8gHm-0001Fa-8b
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:36: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 1r8gHm-0005WD-7v
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:36:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gHm-0005dL-7A
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:36: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=1ic4g2uOuHJ0rYzjL18fFrBSu3ifjvtkZxuSveuAQR4=; b=adqDjddGnYB+pL94avfMIA6M13
	cNJtz8AzqMjmyU5gQ3xC2ylC1PHmFTeowgrkV47z2Zo3YeUTq6uCO+KHEI05MDqilGTV8SesuAlg1
	f41UrQIOB6aqUOXt79B+teM71clI4ewuHnm0rFkeFr9b8FQv1G3oUxFTVl2pWN6WYt+Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/asm-generic: introduce stub header paging.h
Message-Id: <E1r8gHm-0005dL-7A@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:36:54 +0000

commit 94854f141904619b98e6a25356a0f5ede52b99fc
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Nov 29 10:07:02 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 29 10:07:02 2023 +0100

    xen/asm-generic: introduce stub header paging.h
    
    The patch introduces generic paging.h header for Arm, PPC and
    RISC-V.
    
    All mentioned above architectures use hardware virt extensions
    and hardware pagetable extensions thereby it makes sense to set
    paging_mode_translate and paging_mode_external by default.
    
    Also in this patch Arm and PPC architectures are switched to
    generic paging.h header.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/arm/include/asm/Makefile |  1 +
 xen/arch/arm/include/asm/paging.h | 16 ----------------
 xen/arch/ppc/include/asm/Makefile |  1 +
 xen/arch/ppc/include/asm/paging.h |  7 -------
 xen/include/asm-generic/paging.h  | 19 +++++++++++++++++++
 5 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/Makefile
index 821addb0bf..ece7fa66dd 100644
--- a/xen/arch/arm/include/asm/Makefile
+++ b/xen/arch/arm/include/asm/Makefile
@@ -1,2 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0-only
+generic-y += paging.h
 generic-y += vm_event.h
diff --git a/xen/arch/arm/include/asm/paging.h b/xen/arch/arm/include/asm/paging.h
deleted file mode 100644
index 6d1a000246..0000000000
--- a/xen/arch/arm/include/asm/paging.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _XEN_PAGING_H
-#define _XEN_PAGING_H
-
-#define paging_mode_translate(d)              (1)
-#define paging_mode_external(d)               (1)
-
-#endif /* XEN_PAGING_H */
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile
index 821addb0bf..ece7fa66dd 100644
--- a/xen/arch/ppc/include/asm/Makefile
+++ b/xen/arch/ppc/include/asm/Makefile
@@ -1,2 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0-only
+generic-y += paging.h
 generic-y += vm_event.h
diff --git a/xen/arch/ppc/include/asm/paging.h b/xen/arch/ppc/include/asm/paging.h
deleted file mode 100644
index eccacece29..0000000000
--- a/xen/arch/ppc/include/asm/paging.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __ASM_PPC_PAGING_H__
-#define __ASM_PPC_PAGING_H__
-
-#define paging_mode_translate(d)              (1)
-#define paging_mode_external(d)               (1)
-
-#endif /* __ASM_PPC_PAGING_H__ */
diff --git a/xen/include/asm-generic/paging.h b/xen/include/asm-generic/paging.h
new file mode 100644
index 0000000000..8df534cfdc
--- /dev/null
+++ b/xen/include/asm-generic/paging.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_GENERIC_PAGING_H__
+#define __ASM_GENERIC_PAGING_H__
+
+#include <xen/stdbool.h>
+
+#define paging_mode_translate(d)    ((void)(d), true)
+#define paging_mode_external(d)     ((void)(d), true)
+
+#endif /* __ASM_GENERIC_PAGING_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:37:05 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:37:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644640.1005933 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gHx-0001Mi-NJ; Thu, 30 Nov 2023 12:37:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644640.1005933; Thu, 30 Nov 2023 12:37: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 1r8gHx-0001Ma-Kl; Thu, 30 Nov 2023 12:37:05 +0000
Received: by outflank-mailman (input) for mailman id 644640;
 Thu, 30 Nov 2023 12:37: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 1r8gHw-0001MQ-BZ
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:37: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 1r8gHw-0005Wd-Al
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:37:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gHw-0005eK-A7
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:37: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=m1QQ5bpTGxG/4CcOHbjZ7rxF6GmsmTrWMHs04aZbfwQ=; b=FM1WCPzd6cMgZNYaoV1CyZIkxV
	hsoouV3hVjNmWaLYi2QugyEpW4NoCYvxX+i+opWBsty/8Yg8QVd99GsGja3bcjj1678XMT347rdgG
	qqE6yUP7ZP4EudzTuDRrZUvnDsKD7iZQ2hFW/OBa4x8nBMf1te07gAIEhrf9uGJbcDQk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/asm-generic: introduce generic hypercall.h
Message-Id: <E1r8gHw-0005eK-A7@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:37:04 +0000

commit 2ae2a306f47c6486572f742980680dfd3e5419a0
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Nov 29 10:08:11 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 29 10:08:11 2023 +0100

    xen/asm-generic: introduce generic hypercall.h
    
    Introduce an empty generic hypercall.h for archs which don't
    implement it.
    
    Drop PPC's hypercall.h and switch to generic one instead.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/ppc/include/asm/Makefile    |  1 +
 xen/arch/ppc/include/asm/hypercall.h |  5 -----
 xen/include/asm-generic/hypercall.h  | 18 ++++++++++++++++++
 3 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile
index ece7fa66dd..48d587f35d 100644
--- a/xen/arch/ppc/include/asm/Makefile
+++ b/xen/arch/ppc/include/asm/Makefile
@@ -1,3 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
+generic-y += hypercall.h
 generic-y += paging.h
 generic-y += vm_event.h
diff --git a/xen/arch/ppc/include/asm/hypercall.h b/xen/arch/ppc/include/asm/hypercall.h
deleted file mode 100644
index 1e8ca0ce9c..0000000000
--- a/xen/arch/ppc/include/asm/hypercall.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef __ASM_PPC_HYPERCALL_H__
-#define __ASM_PPC_HYPERCALL_H__
-
-#endif /* __ASM_PPC_HYPERCALL_H__ */
diff --git a/xen/include/asm-generic/hypercall.h b/xen/include/asm-generic/hypercall.h
new file mode 100644
index 0000000000..7743b35c0d
--- /dev/null
+++ b/xen/include/asm-generic/hypercall.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __XEN_HYPERCALL_H__
+#error "asm/hypercall.h should not be included directly - include xen/hypercall.h instead"
+#endif
+
+#ifndef __ASM_GENERIC_HYPERCALL_H__
+#define __ASM_GENERIC_HYPERCALL_H__
+
+#endif /* __ASM_GENERIC_HYPERCALL_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:37:15 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:37:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644641.1005937 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gI7-0001Zd-P6; Thu, 30 Nov 2023 12:37:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644641.1005937; Thu, 30 Nov 2023 12:37: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 1r8gI7-0001ZV-MB; Thu, 30 Nov 2023 12:37:15 +0000
Received: by outflank-mailman (input) for mailman id 644641;
 Thu, 30 Nov 2023 12:37: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 1r8gI6-0001ZF-ET
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:37: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 1r8gI6-0005Wo-De
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:37:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gI6-0005nU-Cz
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:37: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=lDikpfbWj7a6ZLLiNL54Gr5LFnguws5buUcAwuIs/XY=; b=vjYTEEOcVaOQtThzlZPBFv1PSQ
	bIahMCaRuteBtWj9BrjmzOWfyWSFLynBOIj79fqdQdgLA+BJGuTqL8lbD0w3kX33LGeCOcuZk6b3p
	gCpp8xyQVG0zFwCykfPStPXZTvkPZSktEWAem/dPCMZn6/9WPe3Yxy9kOR1QhMK75ZhY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/asm-generic: introduce generic header iocap.h
Message-Id: <E1r8gI6-0005nU-Cz@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:37:14 +0000

commit f6082c7b6c0331111eae41db036f5172c9078b8e
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Nov 29 10:08:52 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 29 10:08:52 2023 +0100

    xen/asm-generic: introduce generic header iocap.h
    
    iocap.h is common for Arm, PPC and RISC-V architectures thereby
    it was moved to asm-generic.
    
    Also Arm and PPC were switched to asm-generic version of iocap.h.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/arm/include/asm/Makefile |  1 +
 xen/arch/arm/include/asm/iocap.h  | 16 ----------------
 xen/arch/ppc/include/asm/Makefile |  1 +
 xen/arch/ppc/include/asm/iocap.h  |  8 --------
 xen/include/asm-generic/iocap.h   | 17 +++++++++++++++++
 5 files changed, 19 insertions(+), 24 deletions(-)

diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/Makefile
index ece7fa66dd..96e3aa6b6c 100644
--- a/xen/arch/arm/include/asm/Makefile
+++ b/xen/arch/arm/include/asm/Makefile
@@ -1,3 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
+generic-y += iocap.h
 generic-y += paging.h
 generic-y += vm_event.h
diff --git a/xen/arch/arm/include/asm/iocap.h b/xen/arch/arm/include/asm/iocap.h
deleted file mode 100644
index 276fefbc59..0000000000
--- a/xen/arch/arm/include/asm/iocap.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef __X86_IOCAP_H__
-#define __X86_IOCAP_H__
-
-#define cache_flush_permitted(d)                        \
-    (!rangeset_is_empty((d)->iomem_caps))
-
-#endif
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile
index 48d587f35d..9f5a0dfb31 100644
--- a/xen/arch/ppc/include/asm/Makefile
+++ b/xen/arch/ppc/include/asm/Makefile
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
 generic-y += hypercall.h
+generic-y += iocap.h
 generic-y += paging.h
 generic-y += vm_event.h
diff --git a/xen/arch/ppc/include/asm/iocap.h b/xen/arch/ppc/include/asm/iocap.h
deleted file mode 100644
index 76bf13a70f..0000000000
--- a/xen/arch/ppc/include/asm/iocap.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef __ASM_PPC_IOCAP_H__
-#define __ASM_PPC_IOCAP_H__
-
-#define cache_flush_permitted(d)                        \
-    (!rangeset_is_empty((d)->iomem_caps))
-
-#endif /* __ASM_PPC_IOCAP_H__ */
diff --git a/xen/include/asm-generic/iocap.h b/xen/include/asm-generic/iocap.h
new file mode 100644
index 0000000000..dd7cb45488
--- /dev/null
+++ b/xen/include/asm-generic/iocap.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_GENERIC_IOCAP_H__
+#define __ASM_GENERIC_IOCAP_H__
+
+#define cache_flush_permitted(d)                        \
+    (!rangeset_is_empty((d)->iomem_caps))
+
+#endif /* __ASM_GENERIC_IOCAP_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:37:25 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:37:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644642.1005942 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gIH-0001cO-Sk; Thu, 30 Nov 2023 12:37:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644642.1005942; Thu, 30 Nov 2023 12:37: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 1r8gIH-0001cG-QG; Thu, 30 Nov 2023 12:37:25 +0000
Received: by outflank-mailman (input) for mailman id 644642;
 Thu, 30 Nov 2023 12:37: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 1r8gIG-0001c8-HI
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:37: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 1r8gIG-0005Ws-Gb
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:37:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gIG-0005nv-Fu
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:37: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=mlExOd2K5mDqw23IpiiyZs7X/7baxVBDvzO6o2xTwAo=; b=0Tt+uRNObZXeDn8JERRtyc+pXC
	r3TUKGlaigrlxFNlsT4Uy59VP8GdFOxA1POGBFCpkLmt+PprDwkagmLr/KOpwcoU9CIJbo+NWI+pm
	JIlXvJcC1yUjZLsUkrQ0Xd7xcw5TSASbv5Ebgw3iABK4kzfg5MglKLvvQsWHHYVR8LYU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/asm-generic: introduce stub header <asm/random.h>
Message-Id: <E1r8gIG-0005nv-Fu@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:37:24 +0000

commit 18f30956548b95a3f5e3b45adbe3245f302e6bef
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Nov 29 10:09:55 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 29 10:09:55 2023 +0100

    xen/asm-generic: introduce stub header <asm/random.h>
    
    <asm/random.h> is common for Arm, PPC and RISC-V thereby it
    is moved to asm-generic.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/arm/include/asm/Makefile |  1 +
 xen/arch/arm/include/asm/random.h |  9 ---------
 xen/arch/ppc/include/asm/Makefile |  1 +
 xen/arch/ppc/include/asm/random.h |  9 ---------
 xen/include/asm-generic/random.h  | 19 +++++++++++++++++++
 5 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/Makefile
index 96e3aa6b6c..cac6d5e3df 100644
--- a/xen/arch/arm/include/asm/Makefile
+++ b/xen/arch/arm/include/asm/Makefile
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
 generic-y += iocap.h
 generic-y += paging.h
+generic-y += random.h
 generic-y += vm_event.h
diff --git a/xen/arch/arm/include/asm/random.h b/xen/arch/arm/include/asm/random.h
deleted file mode 100644
index b4acee276b..0000000000
--- a/xen/arch/arm/include/asm/random.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __ASM_RANDOM_H__
-#define __ASM_RANDOM_H__
-
-static inline unsigned int arch_get_random(void)
-{
-    return 0;
-}
-
-#endif /* __ASM_RANDOM_H__ */
diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile
index 9f5a0dfb31..d8f2a1453c 100644
--- a/xen/arch/ppc/include/asm/Makefile
+++ b/xen/arch/ppc/include/asm/Makefile
@@ -2,4 +2,5 @@
 generic-y += hypercall.h
 generic-y += iocap.h
 generic-y += paging.h
+generic-y += random.h
 generic-y += vm_event.h
diff --git a/xen/arch/ppc/include/asm/random.h b/xen/arch/ppc/include/asm/random.h
deleted file mode 100644
index 2f9e9bbae4..0000000000
--- a/xen/arch/ppc/include/asm/random.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __ASM_PPC_RANDOM_H__
-#define __ASM_PPC_RANDOM_H__
-
-static inline unsigned int arch_get_random(void)
-{
-    return 0;
-}
-
-#endif /* __ASM_PPC_RANDOM_H__ */
diff --git a/xen/include/asm-generic/random.h b/xen/include/asm-generic/random.h
new file mode 100644
index 0000000000..d0d35dd217
--- /dev/null
+++ b/xen/include/asm-generic/random.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_GENERIC_RANDOM_H__
+#define __ASM_GENERIC_RANDOM_H__
+
+static inline unsigned int arch_get_random(void)
+{
+    return 0;
+}
+
+#endif /* __ASM_GENERIC_RANDOM_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: BSD
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:37:35 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:37:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644643.1005946 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gIR-0001fE-UP; Thu, 30 Nov 2023 12:37:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644643.1005946; Thu, 30 Nov 2023 12:37: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 1r8gIR-0001f6-Rv; Thu, 30 Nov 2023 12:37:35 +0000
Received: by outflank-mailman (input) for mailman id 644643;
 Thu, 30 Nov 2023 12:37: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 1r8gIQ-0001eu-KK
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:37: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 1r8gIQ-0005XW-Je
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:37:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gIQ-0005ol-J0
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:37: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=O8IsOhhQUO9CUPj+r6HmEiL0w5IkoKOb0dCrF5lubI4=; b=BRPua304kpXwiJ8gVTDoQ+CQG8
	VV4UpqCvChKHIO3oky1UdkKK040ju7j36WXAi0kPhdgEV9WsmOPQ2WzGVjZXGhjcVWIdXokLwydd7
	RGyGVispR+OCJTGBDw2XUdzlMG5t8GTGoulV1o7rWH0Bhrg1/gb/l48BIisez1j0zkB0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/asm-generic: introduce generic header percpu.h
Message-Id: <E1r8gIQ-0005ol-J0@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:37:34 +0000

commit 7c20d1616deb26b810c7d86a834552b8c39a7799
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Nov 29 10:10:23 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 29 10:10:23 2023 +0100

    xen/asm-generic: introduce generic header percpu.h
    
    The patch introduces generic percpu.h which was based on Arm's version
    with the following changes:
     * makes __per_cpu_data_end[] constant
     * introduce get_per_cpu_offset() for macros this_cpu() and this_cpu_ptr()
     * add inclustion of <asm/current.h> as get_per_cpu_offset() is located there.
    
    Also it was changed a place where <asm/percpu.h> is included in <xen/percpu.h>
    because asm-generic version of percpu.h started to include <asm/current.h> which
    requires definition of DECLARE_PER_CPU.
    
    As well the patch switches Arm, PPC and x86 architectures to use asm-generic
    version of percpu.h.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/arm/include/asm/Makefile  |  1 +
 xen/arch/arm/include/asm/current.h |  3 +++
 xen/arch/arm/include/asm/percpu.h  | 33 ---------------------------------
 xen/arch/ppc/include/asm/Makefile  |  1 +
 xen/arch/ppc/include/asm/current.h |  6 ++++++
 xen/arch/ppc/include/asm/percpu.h  | 24 ------------------------
 xen/arch/x86/include/asm/Makefile  |  2 ++
 xen/arch/x86/include/asm/current.h |  2 ++
 xen/arch/x86/include/asm/percpu.h  | 22 ----------------------
 xen/include/asm-generic/percpu.h   | 37 +++++++++++++++++++++++++++++++++++++
 xen/include/xen/percpu.h           |  4 ++--
 11 files changed, 54 insertions(+), 81 deletions(-)

diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/Makefile
index cac6d5e3df..3faf1251ec 100644
--- a/xen/arch/arm/include/asm/Makefile
+++ b/xen/arch/arm/include/asm/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0-only
 generic-y += iocap.h
 generic-y += paging.h
+generic-y += percpu.h
 generic-y += random.h
 generic-y += vm_event.h
diff --git a/xen/arch/arm/include/asm/current.h b/xen/arch/arm/include/asm/current.h
index 51d1c8efa8..0be7ad6ef9 100644
--- a/xen/arch/arm/include/asm/current.h
+++ b/xen/arch/arm/include/asm/current.h
@@ -5,6 +5,7 @@
 #include <xen/percpu.h>
 
 #include <asm/processor.h>
+#include <asm/sysregs.h>
 
 /* Tell whether the guest vCPU enabled Workaround 2 (i.e variant 4) */
 #define CPUINFO_WORKAROUND_2_FLAG_SHIFT   0
@@ -60,6 +61,8 @@ do {                                                    \
     this_cpu(cpu_id) = (id);                            \
 } while ( 0 )
 
+#define get_per_cpu_offset()  READ_SYSREG(TPIDR_EL2)
+
 #endif
 
 #endif /* __ARM_CURRENT_H__ */
diff --git a/xen/arch/arm/include/asm/percpu.h b/xen/arch/arm/include/asm/percpu.h
deleted file mode 100644
index f1a8768080..0000000000
--- a/xen/arch/arm/include/asm/percpu.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef __ARM_PERCPU_H__
-#define __ARM_PERCPU_H__
-
-#ifndef __ASSEMBLY__
-
-#include <xen/types.h>
-#include <asm/sysregs.h>
-
-extern char __per_cpu_start[], __per_cpu_data_end[];
-extern unsigned long __per_cpu_offset[NR_CPUS];
-void percpu_init_areas(void);
-
-#define per_cpu(var, cpu)  \
-    (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]))
-#define this_cpu(var) \
-    (*RELOC_HIDE(&per_cpu__##var, READ_SYSREG(TPIDR_EL2)))
-
-#define per_cpu_ptr(var, cpu)  \
-    (*RELOC_HIDE(var, __per_cpu_offset[cpu]))
-#define this_cpu_ptr(var) \
-    (*RELOC_HIDE(var, READ_SYSREG(TPIDR_EL2)))
-
-#endif
-
-#endif /* __ARM_PERCPU_H__ */
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile
index d8f2a1453c..c0badf5717 100644
--- a/xen/arch/ppc/include/asm/Makefile
+++ b/xen/arch/ppc/include/asm/Makefile
@@ -2,5 +2,6 @@
 generic-y += hypercall.h
 generic-y += iocap.h
 generic-y += paging.h
+generic-y += percpu.h
 generic-y += random.h
 generic-y += vm_event.h
diff --git a/xen/arch/ppc/include/asm/current.h b/xen/arch/ppc/include/asm/current.h
index 0ca06033f9..e329a548e6 100644
--- a/xen/arch/ppc/include/asm/current.h
+++ b/xen/arch/ppc/include/asm/current.h
@@ -4,6 +4,8 @@
 
 #include <xen/percpu.h>
 
+#include <asm/processor.h>
+
 #ifndef __ASSEMBLY__
 
 struct vcpu;
@@ -38,6 +40,10 @@ static inline struct cpu_info *get_cpu_info(void)
 
 #define guest_cpu_user_regs() (&get_cpu_info()->guest_cpu_user_regs)
 
+#define smp_processor_id()      0 /* TODO: Fix this */
+
+#define get_per_cpu_offset()    smp_processor_id() /* TODO: Fix this */
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __ASM_PPC_CURRENT_H__ */
diff --git a/xen/arch/ppc/include/asm/percpu.h b/xen/arch/ppc/include/asm/percpu.h
deleted file mode 100644
index e7c40c0f03..0000000000
--- a/xen/arch/ppc/include/asm/percpu.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef __PPC_PERCPU_H__
-#define __PPC_PERCPU_H__
-
-#ifndef __ASSEMBLY__
-
-extern char __per_cpu_start[], __per_cpu_data_end[];
-extern unsigned long __per_cpu_offset[NR_CPUS];
-void percpu_init_areas(void);
-
-#define smp_processor_id() 0 /* TODO: Fix this */
-
-#define per_cpu(var, cpu)  \
-    (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]))
-#define this_cpu(var) \
-    (*RELOC_HIDE(&per_cpu__##var, smp_processor_id()))
-
-#define per_cpu_ptr(var, cpu)  \
-    (*RELOC_HIDE(var, __per_cpu_offset[cpu]))
-#define this_cpu_ptr(var) \
-    (*RELOC_HIDE(var, smp_processor_id()))
-
-#endif
-
-#endif /* __PPC_PERCPU_H__ */
diff --git a/xen/arch/x86/include/asm/Makefile b/xen/arch/x86/include/asm/Makefile
new file mode 100644
index 0000000000..874429ed30
--- /dev/null
+++ b/xen/arch/x86/include/asm/Makefile
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+generic-y += percpu.h
diff --git a/xen/arch/x86/include/asm/current.h b/xen/arch/x86/include/asm/current.h
index 35cca5cbe4..10950f36cc 100644
--- a/xen/arch/x86/include/asm/current.h
+++ b/xen/arch/x86/include/asm/current.h
@@ -102,6 +102,8 @@ static inline struct cpu_info *get_cpu_info(void)
 #define smp_processor_id()    (get_cpu_info()->processor_id)
 #define guest_cpu_user_regs() (&get_cpu_info()->guest_cpu_user_regs)
 
+#define get_per_cpu_offset()  (get_cpu_info()->per_cpu_offset)
+
 /*
  * Get the bottom-of-stack, as stored in the per-CPU TSS. This actually points
  * into the middle of cpu_info.guest_cpu_user_regs, at the section that
diff --git a/xen/arch/x86/include/asm/percpu.h b/xen/arch/x86/include/asm/percpu.h
deleted file mode 100644
index 2b0c29a233..0000000000
--- a/xen/arch/x86/include/asm/percpu.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef __X86_PERCPU_H__
-#define __X86_PERCPU_H__
-
-#ifndef __ASSEMBLY__
-extern char __per_cpu_start[], __per_cpu_data_end[];
-extern unsigned long __per_cpu_offset[NR_CPUS];
-void percpu_init_areas(void);
-#endif
-
-/* var is in discarded region: offset to particular copy we want */
-#define per_cpu(var, cpu)  \
-    (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]))
-#define this_cpu(var) \
-    (*RELOC_HIDE(&per_cpu__##var, get_cpu_info()->per_cpu_offset))
-
-#define this_cpu_ptr(var) \
-    (*RELOC_HIDE(var, get_cpu_info()->per_cpu_offset))
-
-#define per_cpu_ptr(var, cpu)  \
-    (*RELOC_HIDE(var, __per_cpu_offset[cpu]))
-
-#endif /* __X86_PERCPU_H__ */
diff --git a/xen/include/asm-generic/percpu.h b/xen/include/asm-generic/percpu.h
new file mode 100644
index 0000000000..60af4f9ff9
--- /dev/null
+++ b/xen/include/asm-generic/percpu.h
@@ -0,0 +1,37 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_GENERIC_PERCPU_H__
+#define __ASM_GENERIC_PERCPU_H__
+
+#ifndef __ASSEMBLY__
+
+#include <xen/types.h>
+#include <asm/current.h>
+
+extern char __per_cpu_start[];
+extern const char __per_cpu_data_end[];
+extern unsigned long __per_cpu_offset[NR_CPUS];
+void percpu_init_areas(void);
+
+#define per_cpu(var, cpu)  \
+    (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]))
+
+#define this_cpu(var) \
+    (*RELOC_HIDE(&per_cpu__##var, get_per_cpu_offset()))
+
+#define per_cpu_ptr(var, cpu)  \
+    (*RELOC_HIDE(var, __per_cpu_offset[cpu]))
+#define this_cpu_ptr(var) \
+    (*RELOC_HIDE(var, get_per_cpu_offset()))
+
+#endif
+
+#endif /* __ASM_GENERIC_PERCPU_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/xen/percpu.h b/xen/include/xen/percpu.h
index c7bf57cbcd..57522f346b 100644
--- a/xen/include/xen/percpu.h
+++ b/xen/include/xen/percpu.h
@@ -1,8 +1,6 @@
 #ifndef __XEN_PERCPU_H__
 #define __XEN_PERCPU_H__
 
-#include <asm/percpu.h>
-
 #define DECLARE_PER_CPU(type, name) \
     extern __typeof__(type) per_cpu__ ## name
 
@@ -29,6 +27,8 @@
 
 #define get_per_cpu_var(var)  (per_cpu__##var)
 
+#include <asm/percpu.h>
+
 /* Linux compatibility. */
 #define get_cpu_var(var) this_cpu(var)
 #define put_cpu_var(var)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:37:46 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:37:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644644.1005950 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gIb-0001kX-W4; Thu, 30 Nov 2023 12:37:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644644.1005950; Thu, 30 Nov 2023 12:37: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 1r8gIb-0001kP-TU; Thu, 30 Nov 2023 12:37:45 +0000
Received: by outflank-mailman (input) for mailman id 644644;
 Thu, 30 Nov 2023 12:37: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 1r8gIa-0001kF-N5
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:37: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 1r8gIa-0005Xf-MQ
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:37:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gIa-0005pE-Ln
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:37: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=tbHhLv08kDTj2k1okmjqTr5rOkzwTHjZRFDj1vZIp+k=; b=QGeVn1cTE4NZiEPwvONEiEYE01
	sQCUHsKSOTiCpEivtm8M254B81ZXWZ2vO1STuld0VBd7hnbCd/bkiOTe1FJFOh49f/QMkxWbyM7Ko
	1UqCrdxRbGFb71HhD2zQyIlu57TPUWsqEl778Sf2+mu44qQjE3HuJOaXRwUqodx5hr8w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/asm-generic: introduce generalized hardirq.h
Message-Id: <E1r8gIa-0005pE-Ln@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:37:44 +0000

commit f1ac700b442a463d98f6be304b58c137bb1ac072
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Nov 29 10:11:50 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 29 10:11:50 2023 +0100

    xen/asm-generic: introduce generalized hardirq.h
    
    <asm/hardirq.h> is common through archs thereby it is moved
    to asm-generic.
    
    Arm and PPC were switched to asm generic verstion of hardirq.h.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/arm/include/asm/Makefile  |  1 +
 xen/arch/arm/include/asm/hardirq.h | 27 ---------------------------
 xen/arch/ppc/include/asm/Makefile  |  1 +
 xen/arch/ppc/include/asm/hardirq.h | 19 -------------------
 xen/include/asm-generic/hardirq.h  | 29 +++++++++++++++++++++++++++++
 5 files changed, 31 insertions(+), 46 deletions(-)

diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/Makefile
index 3faf1251ec..36d95d6310 100644
--- a/xen/arch/arm/include/asm/Makefile
+++ b/xen/arch/arm/include/asm/Makefile
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
+generic-y += hardirq.h
 generic-y += iocap.h
 generic-y += paging.h
 generic-y += percpu.h
diff --git a/xen/arch/arm/include/asm/hardirq.h b/xen/arch/arm/include/asm/hardirq.h
deleted file mode 100644
index 67b6a673db..0000000000
--- a/xen/arch/arm/include/asm/hardirq.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef __ASM_HARDIRQ_H
-#define __ASM_HARDIRQ_H
-
-#include <xen/cache.h>
-#include <xen/smp.h>
-
-typedef struct {
-        unsigned long __softirq_pending;
-        unsigned int __local_irq_count;
-} __cacheline_aligned irq_cpustat_t;
-
-#include <xen/irq_cpustat.h>    /* Standard mappings for irq_cpustat_t above */
-
-#define in_irq() (local_irq_count(smp_processor_id()) != 0)
-
-#define irq_enter()     (local_irq_count(smp_processor_id())++)
-#define irq_exit()      (local_irq_count(smp_processor_id())--)
-
-#endif /* __ASM_HARDIRQ_H */
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile
index c0badf5717..9b38d2d381 100644
--- a/xen/arch/ppc/include/asm/Makefile
+++ b/xen/arch/ppc/include/asm/Makefile
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
+generic-y += hardirq.h
 generic-y += hypercall.h
 generic-y += iocap.h
 generic-y += paging.h
diff --git a/xen/arch/ppc/include/asm/hardirq.h b/xen/arch/ppc/include/asm/hardirq.h
deleted file mode 100644
index 343efc7e69..0000000000
--- a/xen/arch/ppc/include/asm/hardirq.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef __ASM_PPC_HARDIRQ_H__
-#define __ASM_PPC_HARDIRQ_H__
-
-#include <xen/cache.h>
-
-typedef struct {
-        unsigned long __softirq_pending;
-        unsigned int __local_irq_count;
-} __cacheline_aligned irq_cpustat_t;
-
-#include <xen/irq_cpustat.h>    /* Standard mappings for irq_cpustat_t above */
-
-#define in_irq() (local_irq_count(smp_processor_id()) != 0)
-
-#define irq_enter()     (local_irq_count(smp_processor_id())++)
-#define irq_exit()      (local_irq_count(smp_processor_id())--)
-
-#endif /* __ASM_PPC_HARDIRQ_H__ */
diff --git a/xen/include/asm-generic/hardirq.h b/xen/include/asm-generic/hardirq.h
new file mode 100644
index 0000000000..ddccf460b9
--- /dev/null
+++ b/xen/include/asm-generic/hardirq.h
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_GENERIC_HARDIRQ_H
+#define __ASM_GENERIC_HARDIRQ_H
+
+#include <xen/cache.h>
+#include <xen/smp.h>
+
+typedef struct {
+        unsigned long __softirq_pending;
+        unsigned int __local_irq_count;
+} __cacheline_aligned irq_cpustat_t;
+
+#include <xen/irq_cpustat.h>    /* Standard mappings for irq_cpustat_t above */
+
+#define in_irq() (local_irq_count(smp_processor_id()) != 0)
+
+#define irq_enter()     (local_irq_count(smp_processor_id())++)
+#define irq_exit()      (local_irq_count(smp_processor_id())--)
+
+#endif /* __ASM_GENERIC_HARDIRQ_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:37:56 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:37:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644645.1005954 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gIm-0001nI-1U; Thu, 30 Nov 2023 12:37:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644645.1005954; Thu, 30 Nov 2023 12:37: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 1r8gIl-0001nA-V3; Thu, 30 Nov 2023 12:37:55 +0000
Received: by outflank-mailman (input) for mailman id 644645;
 Thu, 30 Nov 2023 12:37: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 1r8gIk-0001mz-Q1
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:37: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 1r8gIk-0005Xm-PF
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:37:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gIk-0005pj-Ob
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:37: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=d1UmQtnSPTMh/qfKwn3Exh74AjWey7g6+TLBCBybeOU=; b=Wx/SJlcncnPgAkltCVQCTl9lOP
	LZcZiTm1Gzc/nJTfe76xGlcLie/gz2kKiTzDVfxSDsEqr7XnrMGITyKeBPYDrR//ovfij5lvuLdNy
	R37Te0e1xZdNfwx4eK/GDjEKH0qeeYD68vcz/4seyTog5JvCk3hdJnpaZ+CPXr7DNkFY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/asm-generic: introduce generic header altp2m.h
Message-Id: <E1r8gIk-0005pj-Ob@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:37:54 +0000

commit 7e1f5b68acc70a16f0848fb6b87a5eab9833663a
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Nov 29 10:12:16 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 29 10:12:16 2023 +0100

    xen/asm-generic: introduce generic header altp2m.h
    
    <asm/alt2pm.h> is common between several archs so it is
    moved to asm-generic.
    
    Arm and PPC were switched to asm-generic version of altp2m.h.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/arm/include/asm/Makefile |  1 +
 xen/arch/arm/include/asm/altp2m.h | 39 ---------------------------------------
 xen/arch/ppc/include/asm/Makefile |  1 +
 xen/arch/ppc/include/asm/altp2m.h | 25 -------------------------
 xen/include/asm-generic/altp2m.h  | 34 ++++++++++++++++++++++++++++++++++
 5 files changed, 36 insertions(+), 64 deletions(-)

diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/Makefile
index 36d95d6310..8221429c2c 100644
--- a/xen/arch/arm/include/asm/Makefile
+++ b/xen/arch/arm/include/asm/Makefile
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
+generic-y += altp2m.h
 generic-y += hardirq.h
 generic-y += iocap.h
 generic-y += paging.h
diff --git a/xen/arch/arm/include/asm/altp2m.h b/xen/arch/arm/include/asm/altp2m.h
deleted file mode 100644
index df50cb2f09..0000000000
--- a/xen/arch/arm/include/asm/altp2m.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Alternate p2m
- *
- * Copyright (c) 2014, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __ASM_ARM_ALTP2M_H
-#define __ASM_ARM_ALTP2M_H
-
-#include <xen/sched.h>
-
-/* Alternate p2m on/off per domain */
-static inline bool altp2m_active(const struct domain *d)
-{
-    /* Not implemented on ARM. */
-    return false;
-}
-
-/* Alternate p2m VCPU */
-static inline uint16_t altp2m_vcpu_idx(const struct vcpu *v)
-{
-    /* Not implemented on ARM, should not be reached. */
-    BUG();
-    return 0;
-}
-
-#endif /* __ASM_ARM_ALTP2M_H */
diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile
index 9b38d2d381..2da995bb2f 100644
--- a/xen/arch/ppc/include/asm/Makefile
+++ b/xen/arch/ppc/include/asm/Makefile
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
+generic-y += altp2m.h
 generic-y += hardirq.h
 generic-y += hypercall.h
 generic-y += iocap.h
diff --git a/xen/arch/ppc/include/asm/altp2m.h b/xen/arch/ppc/include/asm/altp2m.h
deleted file mode 100644
index bd5c9aa415..0000000000
--- a/xen/arch/ppc/include/asm/altp2m.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef __ASM_PPC_ALTP2M_H__
-#define __ASM_PPC_ALTP2M_H__
-
-#include <xen/bug.h>
-
-struct domain;
-struct vcpu;
-
-/* Alternate p2m on/off per domain */
-static inline bool altp2m_active(const struct domain *d)
-{
-    /* Not implemented on PPC. */
-    return false;
-}
-
-/* Alternate p2m VCPU */
-static inline uint16_t altp2m_vcpu_idx(const struct vcpu *v)
-{
-    /* Not implemented on PPC, should not be reached. */
-    ASSERT_UNREACHABLE();
-    return 0;
-}
-
-#endif /* __ASM_PPC_ALTP2M_H__ */
diff --git a/xen/include/asm-generic/altp2m.h b/xen/include/asm-generic/altp2m.h
new file mode 100644
index 0000000000..39865a842a
--- /dev/null
+++ b/xen/include/asm-generic/altp2m.h
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_GENERIC_ALTP2M_H
+#define __ASM_GENERIC_ALTP2M_H
+
+#include <xen/bug.h>
+
+struct domain;
+struct vcpu;
+
+/* Alternate p2m on/off per domain */
+static inline bool altp2m_active(const struct domain *d)
+{
+    /* Not implemented on GENERIC. */
+    return false;
+}
+
+/* Alternate p2m VCPU */
+static inline unsigned int altp2m_vcpu_idx(const struct vcpu *v)
+{
+    /* Not implemented on GENERIC, should not be reached. */
+    BUG();
+    return 0;
+}
+
+#endif /* __ASM_GENERIC_ALTP2M_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: BSD
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:38:07 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:38:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644646.1005958 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gIx-0001q1-2z; Thu, 30 Nov 2023 12:38:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644646.1005958; Thu, 30 Nov 2023 12:38: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 1r8gIx-0001pt-0J; Thu, 30 Nov 2023 12:38:07 +0000
Received: by outflank-mailman (input) for mailman id 644646;
 Thu, 30 Nov 2023 12:38: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 1r8gIu-0001pQ-VN
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:38: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 1r8gIu-0005Y6-SG
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:38:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gIu-0005qi-RS
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:38: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=bdDGvxmiV3mVS4bezywHxhoQgQi/fmW/lNMo/IzdWL0=; b=ImECzUgcnd/WeQW/FpN4A0oBvF
	nGyAs9XXP7u/DOw4y+Tqhx54c3V3O9cWV7PKMi8qci/F637MbUgqjQKNCHXaHZP1a93yapgJPaoxh
	mc1XugvY9qf2pwZmNtDfRsKc6gbVJMXOqfZeDLNhBy+1awWmBe3GErB+95z7A7JNkuVM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm64: Move print_reg macro to asm/arm64/macros.h
Message-Id: <E1r8gIu-0005qi-RS@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:38:04 +0000

commit 92696bf052da3f291a8bb6759fddfdb87c9de1f1
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Nov 29 10:06:45 2023 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Wed Nov 29 11:39:52 2023 +0100

    xen/arm64: Move print_reg macro to asm/arm64/macros.h
    
    Macro print_reg is used to print a value of a register passed as an
    argument. While today it is only used from within the common head.S,
    in the future we might want to make use of it from other files, just
    like PRINT(). It also serves as a great aid when debugging.
    
    Expose print_reg macro by moving it to asm/arm64/macros.h and:
     - rename putn to asm_putn to denote the usage from assembly only,
     - use ENTRY() for asm_putn to make it globally visible.
    
    This way the behavior will be consistent with what we already do on arm32.
    
    Take the opportunity to get rid of unneeded stubs for early_puts,
    init_uart and putn since the calls to them are already protected by
    respective #ifdef CONFIG_EARLY_PRINTK.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/arm64/head.S               | 32 ++++----------------------------
 xen/arch/arm/include/asm/arm64/macros.h | 15 +++++++++++++++
 2 files changed, 19 insertions(+), 28 deletions(-)

diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index 8dbd3300d8..9d7d83a5ed 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -74,25 +74,6 @@
  *  x30 - lr
  */
 
- #ifdef CONFIG_EARLY_PRINTK
-/*
- * Macro to print the value of register \xb
- *
- * Clobbers x0 - x4
- */
-.macro print_reg xb
-        mov   x0, \xb
-        mov   x4, lr
-        bl    putn
-        mov   lr, x4
-.endm
-
-#else /* CONFIG_EARLY_PRINTK */
-.macro print_reg xb
-.endm
-
-#endif /* !CONFIG_EARLY_PRINTK */
-
 .section .text.header, "ax", %progbits
 /*.aarch64*/
 
@@ -493,11 +474,12 @@ ENDPROC(asm_puts)
 
 /*
  * Print a 64-bit number in hex.
+ * Note: This function must be called from assembly.
  * x0: Number to print.
  * x23: Early UART base address
  * Clobbers x0-x3
  */
-putn:
+ENTRY(asm_putn)
         adr   x1, hex
         mov   x3, #16
 1:
@@ -510,18 +492,12 @@ putn:
         subs  x3, x3, #1
         b.ne  1b
         ret
-ENDPROC(putn)
+ENDPROC(asm_putn)
 
 hex:    .ascii "0123456789abcdef"
         .align 2
 
-#else  /* CONFIG_EARLY_PRINTK */
-
-ENTRY(early_puts)
-init_uart:
-putn:   ret
-
-#endif /* !CONFIG_EARLY_PRINTK */
+#endif /* CONFIG_EARLY_PRINTK */
 
 /* This provides a C-API version of __lookup_processor_type
  * TODO: For now, the implementation return NULL every time
diff --git a/xen/arch/arm/include/asm/arm64/macros.h b/xen/arch/arm/include/asm/arm64/macros.h
index fb9a060249..d108dc3a3a 100644
--- a/xen/arch/arm/include/asm/arm64/macros.h
+++ b/xen/arch/arm/include/asm/arm64/macros.h
@@ -45,9 +45,24 @@
         mov   lr, x3 ;     \
         RODATA_STR(98, _s)
 
+/*
+ * Macro to print the value of register \xb
+ *
+ * Clobbers x0 - x4
+ */
+.macro print_reg xb
+        mov   x0, \xb
+        mov   x4, lr
+        bl    asm_putn
+        mov   lr, x4
+.endm
+
 #else /* CONFIG_EARLY_PRINTK */
 #define PRINT(s)
 
+.macro print_reg xb
+.endm
+
 #endif /* !CONFIG_EARLY_PRINTK */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:38:19 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:38:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644647.1005962 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gJ7-0001zQ-6j; Thu, 30 Nov 2023 12:38:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644647.1005962; Thu, 30 Nov 2023 12:38: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 1r8gJ7-0001zI-3c; Thu, 30 Nov 2023 12:38:17 +0000
Received: by outflank-mailman (input) for mailman id 644647;
 Thu, 30 Nov 2023 12:38: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 1r8gJ4-0001tF-Vs
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:38: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 1r8gJ4-0005YA-V2
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:38:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gJ4-0005r9-UO
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:38: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=jsmQSVOmY+EUBAco4Z81JJVNvDlAG626TNuPJKUVreM=; b=Y6tQmW0gRhPI4/jSvFF3K+QY0C
	Ilkrz/2Fvwf5cKkiHB6YSumiXqUjMf9Ez+45M064g31yIUosJYsx0P54gWBWyRRP7yzbm56NfLXqD
	Cw0tFS0dueypIXxWnwY5pEjbw9II6hE0Za+zJKLMjBv7Dj4+DeAcHYHZluwAMoH+uW/o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] cirrus-ci: update FreeBSD versions
Message-Id: <E1r8gJ4-0005r9-UO@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:38:14 +0000

commit b3d32672861b88bf4c4b50593e2ce5000a0f16c5
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Nov 28 18:11:50 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 29 10:46:42 2023 +0000

    cirrus-ci: update FreeBSD versions
    
    FreeBSD 14.0 has already been released, so switch to the release version image,
    and introduce a FreeBSD 15.0 version to track current FreeBSD unstable
    (development) branch.
    
    Sample output at:
    
    https://github.com/royger/xen/runs/19105278189
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 .cirrus.yml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 7e0beb200d..385618c394 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -29,5 +29,11 @@ task:
 task:
   name: 'FreeBSD 14'
   freebsd_instance:
-    image_family: freebsd-14-0-snap
+    image_family: freebsd-14-0
+  << : *FREEBSD_TEMPLATE
+
+task:
+  name: 'FreeBSD 15'
+  freebsd_instance:
+    image_family: freebsd-15-0-snap
   << : *FREEBSD_TEMPLATE
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 30 12:38:27 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Nov 2023 12:38:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.644648.1005966 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8gJH-0002BM-86; Thu, 30 Nov 2023 12:38:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 644648.1005966; Thu, 30 Nov 2023 12:38: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 1r8gJH-0002BF-5D; Thu, 30 Nov 2023 12:38:27 +0000
Received: by outflank-mailman (input) for mailman id 644648;
 Thu, 30 Nov 2023 12:38: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 1r8gJF-00029c-2T
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:38: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 1r8gJF-0005YP-1i
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:38:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8gJF-0005rj-11
 for xen-changelog@lists.xenproject.org; Thu, 30 Nov 2023 12:38: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=Z0DQgX+lYbjMsBrzr/E3zfVx8mVfdmTOWiSjHymVHZk=; b=eQ4HBW5M6X3GXA4twWBD+0v8AA
	WN0YCJ+XH3zBAZVPVss5R/AxTzgHXESzyhc5k5HF+jmMX2MGZqoyb4++leb3NUJUfhjz+7QfXJVRr
	+q9lLar9hekypERHwF/WE3xXMR3j0RhdLntUkMFI80d4HM5HWB6zZei6M7XySwl9llO0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/livepatch: fix livepatch tests
Message-Id: <E1r8gJF-0005rj-11@xenbits.xenproject.org>
Date: Thu, 30 Nov 2023 12:38:25 +0000

commit 902377b690f42ddf44ae91c4b0751d597f1cd694
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Nov 28 18:41:31 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 29 10:46:42 2023 +0000

    xen/livepatch: fix livepatch tests
    
    The current set of in-tree livepatch tests in xen/test/livepatch started
    failing after the constify of the payload funcs array, and the movement of the
    status data into a separate array.
    
    Fix the tests so they respect the constness of the funcs array and also make
    use of the new location of the per-func state data.
    
    Fixes: 82182ad7b46e ('livepatch: do not use .livepatch.funcs section to store internal state')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 xen/test/livepatch/xen_action_hooks.c          | 12 +++++++-----
 xen/test/livepatch/xen_action_hooks_marker.c   | 20 ++++++++++++--------
 xen/test/livepatch/xen_action_hooks_noapply.c  | 22 +++++++++++++---------
 xen/test/livepatch/xen_action_hooks_nofunc.c   |  6 +++---
 xen/test/livepatch/xen_action_hooks_norevert.c | 24 ++++++++++++++----------
 xen/test/livepatch/xen_prepost_hooks.c         |  8 ++++----
 xen/test/livepatch/xen_prepost_hooks_fail.c    |  2 +-
 7 files changed, 54 insertions(+), 40 deletions(-)

diff --git a/xen/test/livepatch/xen_action_hooks.c b/xen/test/livepatch/xen_action_hooks.c
index 39b5313027..fa0b3ab35f 100644
--- a/xen/test/livepatch/xen_action_hooks.c
+++ b/xen/test/livepatch/xen_action_hooks.c
@@ -26,9 +26,10 @@ static int apply_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
+        struct livepatch_fstate *fstate = &payload->fstate[i];
 
-        func->applied = LIVEPATCH_FUNC_APPLIED;
+        fstate->applied = LIVEPATCH_FUNC_APPLIED;
         apply_cnt++;
 
         printk(KERN_DEBUG "%s: applying: %s\n", __func__, func->name);
@@ -47,9 +48,10 @@ static int revert_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
+        struct livepatch_fstate *fstate = &payload->fstate[i];
 
-        func->applied = LIVEPATCH_FUNC_NOT_APPLIED;
+        fstate->applied = LIVEPATCH_FUNC_NOT_APPLIED;
         revert_cnt++;
 
         printk(KERN_DEBUG "%s: reverting: %s\n", __func__, func->name);
@@ -68,7 +70,7 @@ static void post_revert_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
 
         printk(KERN_DEBUG "%s: reverted: %s\n", __func__, func->name);
     }
diff --git a/xen/test/livepatch/xen_action_hooks_marker.c b/xen/test/livepatch/xen_action_hooks_marker.c
index 4f807a577f..d2e22f70d1 100644
--- a/xen/test/livepatch/xen_action_hooks_marker.c
+++ b/xen/test/livepatch/xen_action_hooks_marker.c
@@ -23,9 +23,10 @@ static int pre_apply_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
+        struct livepatch_fstate *fstate = &payload->fstate[i];
 
-        BUG_ON(func->applied == LIVEPATCH_FUNC_APPLIED);
+        BUG_ON(fstate->applied == LIVEPATCH_FUNC_APPLIED);
         printk(KERN_DEBUG "%s: pre applied: %s\n", __func__, func->name);
     }
 
@@ -42,9 +43,10 @@ static void post_apply_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
+        struct livepatch_fstate *fstate = &payload->fstate[i];
 
-        BUG_ON(func->applied != LIVEPATCH_FUNC_APPLIED);
+        BUG_ON(fstate->applied != LIVEPATCH_FUNC_APPLIED);
         printk(KERN_DEBUG "%s: post applied: %s\n", __func__, func->name);
     }
 
@@ -59,9 +61,10 @@ static int pre_revert_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
+        struct livepatch_fstate *fstate = &payload->fstate[i];
 
-        BUG_ON(func->applied != LIVEPATCH_FUNC_APPLIED);
+        BUG_ON(fstate->applied != LIVEPATCH_FUNC_APPLIED);
         printk(KERN_DEBUG "%s: pre reverted: %s\n", __func__, func->name);
     }
 
@@ -78,9 +81,10 @@ static void post_revert_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
+        struct livepatch_fstate *fstate = &payload->fstate[i];
 
-        BUG_ON(func->applied == LIVEPATCH_FUNC_APPLIED);
+        BUG_ON(fstate->applied == LIVEPATCH_FUNC_APPLIED);
         printk(KERN_DEBUG "%s: post reverted: %s\n", __func__, func->name);
     }
 
diff --git a/xen/test/livepatch/xen_action_hooks_noapply.c b/xen/test/livepatch/xen_action_hooks_noapply.c
index 4c55c156a6..646a5fd2f0 100644
--- a/xen/test/livepatch/xen_action_hooks_noapply.c
+++ b/xen/test/livepatch/xen_action_hooks_noapply.c
@@ -25,9 +25,10 @@ static int pre_apply_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
+        struct livepatch_fstate *fstate = &payload->fstate[i];
 
-        BUG_ON(func->applied == LIVEPATCH_FUNC_APPLIED);
+        BUG_ON(fstate->applied == LIVEPATCH_FUNC_APPLIED);
         printk(KERN_DEBUG "%s: pre applied: %s\n", __func__, func->name);
     }
 
@@ -44,7 +45,7 @@ static int apply_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
 
         apply_cnt++;
         printk(KERN_DEBUG "%s: applying: %s\n", __func__, func->name);
@@ -63,10 +64,11 @@ static void post_apply_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
+        struct livepatch_fstate *fstate = &payload->fstate[i];
 
         BUG_ON(apply_cnt != 1);
-        BUG_ON(func->applied == LIVEPATCH_FUNC_APPLIED);
+        BUG_ON(fstate->applied == LIVEPATCH_FUNC_APPLIED);
         printk(KERN_DEBUG "%s: post applied: %s\n", __func__, func->name);
     }
 
@@ -81,9 +83,10 @@ static int pre_revert_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
+        struct livepatch_fstate *fstate = &payload->fstate[i];
 
-        BUG_ON(func->applied == LIVEPATCH_FUNC_APPLIED);
+        BUG_ON(fstate->applied == LIVEPATCH_FUNC_APPLIED);
         printk(KERN_DEBUG "%s: pre reverted: %s\n", __func__, func->name);
     }
 
@@ -100,9 +103,10 @@ static void post_revert_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
+        struct livepatch_fstate *fstate = &payload->fstate[i];
 
-        BUG_ON(func->applied == LIVEPATCH_FUNC_APPLIED);
+        BUG_ON(fstate->applied == LIVEPATCH_FUNC_APPLIED);
         printk(KERN_DEBUG "%s: post reverted: %s\n", __func__, func->name);
     }
 
diff --git a/xen/test/livepatch/xen_action_hooks_nofunc.c b/xen/test/livepatch/xen_action_hooks_nofunc.c
index 2b4e90436f..077c4c1738 100644
--- a/xen/test/livepatch/xen_action_hooks_nofunc.c
+++ b/xen/test/livepatch/xen_action_hooks_nofunc.c
@@ -23,7 +23,7 @@ static int apply_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
 
         apply_cnt++;
         printk(KERN_DEBUG "%s: applying: %s\n", __func__, func->name);
@@ -42,7 +42,7 @@ static int revert_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
 
         revert_cnt++;
         printk(KERN_DEBUG "%s: reverting: %s\n", __func__, func->name);
@@ -61,7 +61,7 @@ static void post_revert_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
 
         printk(KERN_DEBUG "%s: reverted: %s\n", __func__, func->name);
     }
diff --git a/xen/test/livepatch/xen_action_hooks_norevert.c b/xen/test/livepatch/xen_action_hooks_norevert.c
index ef77e72071..3e21ade6ab 100644
--- a/xen/test/livepatch/xen_action_hooks_norevert.c
+++ b/xen/test/livepatch/xen_action_hooks_norevert.c
@@ -25,9 +25,10 @@ static int pre_apply_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
+        struct livepatch_fstate *fstate = &payload->fstate[i];
 
-        BUG_ON(func->applied == LIVEPATCH_FUNC_APPLIED);
+        BUG_ON(fstate->applied == LIVEPATCH_FUNC_APPLIED);
         printk(KERN_DEBUG "%s: pre applied: %s\n", __func__, func->name);
     }
 
@@ -44,9 +45,10 @@ static void post_apply_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
+        struct livepatch_fstate *fstate = &payload->fstate[i];
 
-        BUG_ON(func->applied != LIVEPATCH_FUNC_APPLIED);
+        BUG_ON(fstate->applied != LIVEPATCH_FUNC_APPLIED);
         printk(KERN_DEBUG "%s: post applied: %s\n", __func__, func->name);
     }
 
@@ -61,9 +63,10 @@ static int pre_revert_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
+        struct livepatch_fstate *fstate = &payload->fstate[i];
 
-        BUG_ON(func->applied != LIVEPATCH_FUNC_APPLIED);
+        BUG_ON(fstate->applied != LIVEPATCH_FUNC_APPLIED);
         printk(KERN_DEBUG "%s: pre reverted: %s\n", __func__, func->name);
     }
 
@@ -80,7 +83,7 @@ static int revert_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
 
         revert_cnt++;
         printk(KERN_DEBUG "%s: reverting: %s\n", __func__, func->name);
@@ -99,16 +102,17 @@ static void post_revert_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
+        struct livepatch_fstate *fstate = &payload->fstate[i];
 
         BUG_ON(revert_cnt != 1);
-        BUG_ON(func->applied != LIVEPATCH_FUNC_APPLIED);
+        BUG_ON(fstate->applied != LIVEPATCH_FUNC_APPLIED);
 
         /* Outside of quiesce zone: MAY TRIGGER HOST CRASH/UNDEFINED BEHAVIOR */
         arch_livepatch_quiesce();
         common_livepatch_revert(payload);
         arch_livepatch_revive();
-        BUG_ON(func->applied == LIVEPATCH_FUNC_APPLIED);
+        BUG_ON(fstate->applied == LIVEPATCH_FUNC_APPLIED);
 
         printk(KERN_DEBUG "%s: post reverted: %s\n", __func__, func->name);
     }
diff --git a/xen/test/livepatch/xen_prepost_hooks.c b/xen/test/livepatch/xen_prepost_hooks.c
index 889377d6eb..17f5af6a19 100644
--- a/xen/test/livepatch/xen_prepost_hooks.c
+++ b/xen/test/livepatch/xen_prepost_hooks.c
@@ -30,7 +30,7 @@ static int pre_apply_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
 
         pre_apply_cnt++;
         printk(KERN_DEBUG "%s: applying: %s\n", __func__, func->name);
@@ -49,7 +49,7 @@ static void post_apply_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
 
         post_apply_cnt++;
         printk(KERN_DEBUG "%s: applied: %s\n", __func__, func->name);
@@ -66,7 +66,7 @@ static int pre_revert_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
 
         pre_revert_cnt++;
         printk(KERN_DEBUG "%s: reverting: %s\n", __func__, func->name);
@@ -86,7 +86,7 @@ static void post_revert_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
 
         post_revert_cnt++;
         printk(KERN_DEBUG "%s: reverted: %s\n", __func__, func->name);
diff --git a/xen/test/livepatch/xen_prepost_hooks_fail.c b/xen/test/livepatch/xen_prepost_hooks_fail.c
index c6feb5d32d..52fd7f642e 100644
--- a/xen/test/livepatch/xen_prepost_hooks_fail.c
+++ b/xen/test/livepatch/xen_prepost_hooks_fail.c
@@ -24,7 +24,7 @@ static int pre_apply_hook(livepatch_payload_t *payload)
 
     for (i = 0; i < payload->nfuncs; i++)
     {
-        struct livepatch_func *func = &payload->funcs[i];
+        const struct livepatch_func *func = &payload->funcs[i];
 
         printk(KERN_DEBUG "%s: pre applying: %s\n", __func__, func->name);
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master


