From xen-changelog-bounces@lists.xenproject.org Fri Dec 01 03:22:07 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 01 Dec 2023 03:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.645267.1007353 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8u6M-0007Za-Bq; Fri, 01 Dec 2023 03:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 645267.1007353; Fri, 01 Dec 2023 03:22:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8u6M-0007ZT-9K; Fri, 01 Dec 2023 03:22:02 +0000
Received: by outflank-mailman (input) for mailman id 645267;
 Fri, 01 Dec 2023 03:22:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8u6L-0007ZN-JR
 for xen-changelog@lists.xenproject.org; Fri, 01 Dec 2023 03:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8u6L-0003y6-Ia
 for xen-changelog@lists.xenproject.org; Fri, 01 Dec 2023 03:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8u6L-0003so-HZ
 for xen-changelog@lists.xenproject.org; Fri, 01 Dec 2023 03:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DTQ7dgM4nmxsGyf9e1thF4kxdCm0OcwIR49mFeIzk0A=; b=KZffZtaEvCpjrp43HAIghXcb/M
	NyQt9J3FkC02eLqlWNuiir1XAl3WeHzrr4ugTJEhqXn8ehY2T+VviPJl/5WVTNv+WGP/1pj6jTbin
	vIy4l88/HSSokjKD0cf89h8DjtijumXojQktGKkXGI6jx653cBYgG/B3GEKUshwH2Qmo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/bitops: encapsulate violation of MISRA C:2012 Rule 10.1
Message-Id: <E1r8u6L-0003so-HZ@xenbits.xenproject.org>
Date: Fri, 01 Dec 2023 03:22:01 +0000

commit 2f848d3cee46685ca0a9bc77dbb23417b4b35652
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Wed Nov 29 10:32:39 2023 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Wed Nov 29 18:21:58 2023 +0100

    arm/bitops: encapsulate violation of MISRA C:2012 Rule 10.1
    
    The definitions of ffs{l}? violate Rule 10.1, by using the well-known
    pattern (x & -x); its usage is wrapped by the ISOLATE_LSB macro.
    
    No functional change.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/include/asm/bitops.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/include/asm/bitops.h b/xen/arch/arm/include/asm/bitops.h
index 71ae14cab3..ab030b6cb0 100644
--- a/xen/arch/arm/include/asm/bitops.h
+++ b/xen/arch/arm/include/asm/bitops.h
@@ -9,6 +9,8 @@
 #ifndef _ARM_BITOPS_H
 #define _ARM_BITOPS_H
 
+#include <xen/macros.h>
+
 #include <asm/asm_defns.h>
 
 /*
@@ -155,8 +157,8 @@ static inline int fls(unsigned int x)
 }
 
 
-#define ffs(x) ({ unsigned int __t = (x); fls(__t & -__t); })
-#define ffsl(x) ({ unsigned long __t = (x); flsl(__t & -__t); })
+#define ffs(x) ({ unsigned int __t = (x); fls(ISOLATE_LSB(__t)); })
+#define ffsl(x) ({ unsigned long __t = (x); flsl(ISOLATE_LSB(__t)); })
 
 /**
  * find_first_set_bit - find the first set bit in @word
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 01 03:22:12 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 01 Dec 2023 03:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.645268.1007358 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8u6W-0007bL-Db; Fri, 01 Dec 2023 03:22:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 645268.1007358; Fri, 01 Dec 2023 03: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 1r8u6W-0007bC-Ak; Fri, 01 Dec 2023 03:22:12 +0000
Received: by outflank-mailman (input) for mailman id 645268;
 Fri, 01 Dec 2023 03: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 1r8u6V-0007b4-NX
 for xen-changelog@lists.xenproject.org; Fri, 01 Dec 2023 03: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 1r8u6V-0003yK-Md
 for xen-changelog@lists.xenproject.org; Fri, 01 Dec 2023 03:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8u6V-0003tQ-Km
 for xen-changelog@lists.xenproject.org; Fri, 01 Dec 2023 03: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=ZqTnamWSpRHbFxgtgyGZ8l6LrwGZEyOhYE4eojZECSQ=; b=NClU9UE3e7+x+cHV89Ghx9yTKZ
	C+TGw4TP62WziSha9yjzhBuXgpPviJbAe6DrF1mM+TNaMwV9/qIS8CYQRWlwrb3AfhcHox0nm2QPb
	opl3bEqjYeHev1mTv5QRPYpdptQcYoT5LqIqVSjd2rtUjZ8sX6mm0vpVpjRXYD7MR8ms=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation/eclair: make the docs for MISRA C:2012 Dir 4.1 visible to ECLAIR
Message-Id: <E1r8u6V-0003tQ-Km@xenbits.xenproject.org>
Date: Fri, 01 Dec 2023 03:22:11 +0000

commit ddf664a557d02e4d9cd68e66814faedc4a2a7a13
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Fri Nov 17 09:53:25 2023 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Wed Nov 29 18:25:38 2023 +0100

    automation/eclair: make the docs for MISRA C:2012 Dir 4.1 visible to ECLAIR
    
    To be able to check for the existence of the necessary subsections in
    the documentation for MISRA C:2012 Dir 4.1, ECLAIR needs to have a source
    file that is built.
    
    This file is generated from 'C-runtime-failures.rst' in docs/misra
    and the configuration is updated accordingly.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/eclair_analysis/build.sh   | 31 +++++++++++++++++++++++++++----
 automation/eclair_analysis/prepare.sh |  7 ++++---
 2 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/automation/eclair_analysis/build.sh b/automation/eclair_analysis/build.sh
index ec087dd822..122b93b805 100755
--- a/automation/eclair_analysis/build.sh
+++ b/automation/eclair_analysis/build.sh
@@ -33,12 +33,35 @@ else
   PROCESSORS=6
 fi
 
+# Variables driving the build
+CC=${CROSS_COMPILE}gcc-12
+CXX=${CROSS_COMPILE}g++-12
+
+runtime_failures_docs() {
+  doc="C-runtime-failures.rst"
+  builddir="automation/eclair_analysis"
+  
+  cd "${builddir}"
+  printf "/*\n\n" >"${doc}.c"
+  sed -e 's|\*/|*//*|g' "../../docs/misra/${doc}" >>"${doc}.c"
+  
+  # At least a dummy decl is needed to comply with the C standard.
+  printf "\n\n*/\ntypedef int dummy_typedef;\n" >>"${doc}.c"
+  
+  # The C language standard applicable to Xen is C99 (with extensions),
+  # therefore even this dummy file needs to be compiled with -std=c99.
+  # Cannot redirect to /dev/null because it would be excluded from the analysis
+  "${CC}" -std=c99 -c "${doc}.c" -o "${doc}.o"
+  cd -
+}
+
 (
-  cd xen
+  runtime_failures_docs
 
   make "-j${PROCESSORS}" "-l${PROCESSORS}.0"    \
        "CROSS_COMPILE=${CROSS_COMPILE}"         \
-       "CC=${CROSS_COMPILE}gcc-12"              \
-       "CXX=${CROSS_COMPILE}g++-12"             \
-       "XEN_TARGET_ARCH=${XEN_TARGET_ARCH}"
+       "CC=${CC}"                               \
+       "CXX=${CXX}"                             \
+       "XEN_TARGET_ARCH=${XEN_TARGET_ARCH}"     \
+       -C xen
 )
diff --git a/automation/eclair_analysis/prepare.sh b/automation/eclair_analysis/prepare.sh
index 0cac5eba00..fe9d16e48e 100755
--- a/automation/eclair_analysis/prepare.sh
+++ b/automation/eclair_analysis/prepare.sh
@@ -35,11 +35,12 @@ else
 fi
 
 (
-    cd xen
-    cp "${CONFIG_FILE}" .config
+    ./configure
+    cp "${CONFIG_FILE}" xen/.config
     make clean
     find . -type f -name "*.safparse" -print -delete
-    make -f ${script_dir}/Makefile.prepare prepare
+    cd xen
+    make -f "${script_dir}/Makefile.prepare" prepare
     # Translate the /* SAF-n-safe */ comments into ECLAIR CBTs
     scripts/xen-analysis.py --run-eclair --no-build --no-clean
 )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 01 03:22:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 01 Dec 2023 03:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.645269.1007361 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r8u6h-0007eA-Ej; Fri, 01 Dec 2023 03:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 645269.1007361; Fri, 01 Dec 2023 03: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 1r8u6h-0007e3-CA; Fri, 01 Dec 2023 03:22:23 +0000
Received: by outflank-mailman (input) for mailman id 645269;
 Fri, 01 Dec 2023 03:22: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 1r8u6f-0007dq-Qi
 for xen-changelog@lists.xenproject.org; Fri, 01 Dec 2023 03:22: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 1r8u6f-0003yS-Pz
 for xen-changelog@lists.xenproject.org; Fri, 01 Dec 2023 03:22:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r8u6f-0003tp-Om
 for xen-changelog@lists.xenproject.org; Fri, 01 Dec 2023 03:22: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=pD8Tj3x8m4UG7+dAvio0YTWom1rqfGiuh5IDb0LhbBA=; b=B45P6WY0RTUKYabNd2OVX+S5/+
	5JGzxw7McaU3X65yTbSbP2Fk356MnbVD/GCEwzM5mDez4S7WGEsw0s4kZhL7Gy75KVGtQ5jqp2+gG
	C8N2yvxJU47v9HZU6OF4UXxOLQZJIDvbsHdE1OIktWn7w5WFEnFy3WuPmRt5z6Mabh7A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/misra: add guidance on the format of Dir 4.1 docs for ECLAIR
Message-Id: <E1r8u6f-0003tp-Om@xenbits.xenproject.org>
Date: Fri, 01 Dec 2023 03:22:21 +0000

commit f0dd0cd9598f22ee5509bb5d1466e4821834c4ba
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Fri Nov 17 09:53:26 2023 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Wed Nov 29 18:25:38 2023 +0100

    docs/misra: add guidance on the format of Dir 4.1 docs for ECLAIR
    
    Additional guidance on the formatting of the document for ECLAIR
    is supplied.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 docs/misra/C-runtime-failures.rst | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/docs/misra/C-runtime-failures.rst b/docs/misra/C-runtime-failures.rst
index 1052b2afca..cac51d6b25 100644
--- a/docs/misra/C-runtime-failures.rst
+++ b/docs/misra/C-runtime-failures.rst
@@ -12,6 +12,14 @@ 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".
 
+The ECLAIR checker for MISRA C:2012 Directive 4.1 requires the documentation
+to be supplied using the following format:
+
+``Documentation for MISRA C:2012 Dir 4.1: <category> <description>``
+
+The matched categories are the ones listed below (e.g., ``overflow`` and
+``unexpected wrapping``). The content of the description is not checked and can
+span multiple lines.
 
 Documentation for MISRA C:2012 Dir 4.1: overflow
 ________________________________________________
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Dec 02 00:55:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 02 Dec 2023 00:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.645808.1008167 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r9EHe-0003Y0-Nn; Sat, 02 Dec 2023 00:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 645808.1008167; Sat, 02 Dec 2023 00: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 1r9EHe-0003Xr-Kj; Sat, 02 Dec 2023 00:55:02 +0000
Received: by outflank-mailman (input) for mailman id 645808;
 Sat, 02 Dec 2023 00: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 1r9EHe-0003Xl-57
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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 1r9EHd-0005Fr-VV
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r9EHd-0000jQ-UR
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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=zNP6Nebjjd1rxGWOL5Z0wRoECXhMpKjUnmUxoXi/b+4=; b=dOJmwL74BOKZWBAEI8C69K3kvN
	Pu/m2d0KSE+LPbkmQNiIDeJZgeqs8fEkMEBSTjeTPt6o03EwzBw4QKMG0si22K2yr2UW6FK7LjqhY
	aDpZG85zhDrBwylo1gNDfBEoNDRjfU1BKsfogCUNdDmE2OUEqYbmldfqxY8z0WWw+GzY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: Switch u-boot boot command to bootz for arm32 tests
Message-Id: <E1r9EHd-0000jQ-UR@xenbits.xenproject.org>
Date: Sat, 02 Dec 2023 00:55:01 +0000

commit 829b4731df9913741818986d5338d95d3f59d656
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Fri Nov 24 13:09:07 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Nov 29 18:38:21 2023 -0800

    automation: Switch u-boot boot command to bootz for arm32 tests
    
    Thanks to recent changes added to ImageBuilder to support the bootz
    command, which allows obtaining the effective image size (including NOLOAD
    sections) from the zImage header, switch the BOOT_CMD for arm32 tests to
    bootz. Among other scenarios, this change will enable us, in the future,
    to add tests with UBSAN enabled Xen, which would otherwise fail due to
    incorrect image placement resulting in overlapping.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/qemu-smoke-dom0-arm32.sh     | 2 +-
 automation/scripts/qemu-smoke-dom0less-arm32.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
index a4b487b080..d916489056 100755
--- a/automation/scripts/qemu-smoke-dom0-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
@@ -68,7 +68,7 @@ XEN_CMD="console=dtuart dom0_mem=1024M bootscrub=0 console_timestamps=boot"
 NUM_DOMUS=0
 
 LOAD_CMD="tftpb"
-BOOT_CMD="bootm"
+BOOT_CMD="bootz"
 UBOOT_SOURCE="boot.source"
 UBOOT_SCRIPT="boot.scr"' > config
 
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
index 7e3cfbe9c4..e31b6b9014 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -101,7 +101,7 @@ DOMU_MEM[0]="512"
 NUM_DOMUS=1
 
 LOAD_CMD="tftpb"
-BOOT_CMD="bootm"
+BOOT_CMD="bootz"
 UBOOT_SOURCE="boot.source"
 UBOOT_SCRIPT="boot.scr"' > config
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Dec 02 00:55:12 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 02 Dec 2023 00:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.645809.1008169 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r9EHo-0003Zf-Od; Sat, 02 Dec 2023 00:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 645809.1008169; Sat, 02 Dec 2023 00: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 1r9EHo-0003ZY-MD; Sat, 02 Dec 2023 00:55:12 +0000
Received: by outflank-mailman (input) for mailman id 645809;
 Sat, 02 Dec 2023 00: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 1r9EHo-0003ZS-3R
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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 1r9EHo-0005G5-2X
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r9EHo-0000k5-1P
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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=B5ElkFj5+IX2K0EOQruozlerV+0ai/R5rrsfA0hqjrM=; b=Gb/uF1pB2W4hP8RGG4atPeMKzS
	4xCXNS9ChvKsmFv28acZ8FjR+GVbMRyycSrTv7O+VvW+qrs5Qof1v7tnczIQmCTTcjZ60N4C8iNy5
	/KqdffpRxCDyM+Ojhml5YfFyIr9v9HeGNwW35TF49YnUhsOkvqK/PWAYsQkUlV88z2nQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/misra: fix a typo in rules.rst
Message-Id: <E1r9EHo-0000k5-1P@xenbits.xenproject.org>
Date: Sat, 02 Dec 2023 00:55:12 +0000

commit e5aba2909cc678cb7097d3cde52a4a4029c325ae
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Thu Nov 30 18:15:43 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Thu Nov 30 18:26:20 2023 -0800

    docs/misra: fix a typo in rules.rst
    
    No functional changes.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 docs/misra/rules.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 53dab0070c..75921b9a34 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -531,7 +531,7 @@ maintainers if you want to suggest a change.
        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
+       certain identifiers starting with two underscores are also commonly used
        in Linux (e.g. __set_bit) and we don't think it would be an improvement
        to rename them.
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Dec 02 00:55:22 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 02 Dec 2023 00:55:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.645810.1008173 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r9EHy-0003bj-Q8; Sat, 02 Dec 2023 00:55:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 645810.1008173; Sat, 02 Dec 2023 00: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 1r9EHy-0003bc-Nc; Sat, 02 Dec 2023 00:55:22 +0000
Received: by outflank-mailman (input) for mailman id 645810;
 Sat, 02 Dec 2023 00: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 1r9EHy-0003bU-8Z
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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 1r9EHy-0005GF-72
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r9EHy-0000kX-4o
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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=7iaVwouLV7msSclQp9MHNiCkMy5stGcNB43RV4XAZSs=; b=BDD9xpbqfQiKMVjRANVSjJuyj5
	wHcyVVsH27w0LbSEXz6tmghkHPoX3OkbNJj5KpJX58d0JrGzizqU7JW+XwJnbiPZ+KNpyR6d5LhsN
	QDgVlwc1u7NvMD+j04wqxhAjrzFkg/4ffXuGJ8fRGVCAOXC+8ncdrcUJeLzsJRkRDkZU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation/eclair: improve scheduled analyses
Message-Id: <E1r9EHy-0000kX-4o@xenbits.xenproject.org>
Date: Sat, 02 Dec 2023 00:55:22 +0000

commit def73fc14407252cc801f35cd7746e60ccd70884
Author:     Simone Ballarin <simone.ballarin@bugseng.com>
AuthorDate: Thu Nov 30 18:04:53 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Thu Nov 30 18:59:30 2023 -0800

    automation/eclair: improve scheduled analyses
    
    The scheduled analyses are intended to maintain an overall vision
    of the MISRA complaince of the entire project. For this reason,
    the file exclusions in "out_of_scope.ecl" should not be applied.
    
    This patch amends ECLAIR settings to prevent exempting files for
    scheduled analyses.
    
    Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/eclair_analysis/ECLAIR/action.settings |  2 +-
 automation/eclair_analysis/ECLAIR/analysis.ecl    | 12 ++++++++++--
 automation/gitlab-ci/analyze.yaml                 |  2 ++
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/action.settings b/automation/eclair_analysis/ECLAIR/action.settings
index f96368ffc7..3cba1a3afb 100644
--- a/automation/eclair_analysis/ECLAIR/action.settings
+++ b/automation/eclair_analysis/ECLAIR/action.settings
@@ -134,7 +134,7 @@ push)
     badgeLabel="ECLAIR ${ANALYSIS_KIND} ${ref}${variantHeadline} #${jobId}"
     ;;
 auto_pull_request)
-    git remote remove autoPRRemote || true
+    git remote remove autoPRRemote 2>/dev/null || true
     git remote add autoPRRemote "${autoPRRemoteUrl}"
     git fetch -q autoPRRemote
     subDir="${ref}"
diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/eclair_analysis/ECLAIR/analysis.ecl
index fe418d6da1..f8d4cc8c99 100644
--- a/automation/eclair_analysis/ECLAIR/analysis.ecl
+++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
@@ -2,7 +2,13 @@
 -project_name=getenv("ECLAIR_PROJECT_NAME")
 -project_root=getenv("ECLAIR_PROJECT_ROOT")
 
--setq=data_dir,getenv("ECLAIR_DATA_DIR")
+setq(data_dir,getenv("ECLAIR_DATA_DIR"))
+setq(analysis_kind,getenv("ANALYSIS_KIND"))
+setq(scheduled_analysis,nil)
+
+strings_map("scheduled-analysis",500,"","^.*scheduled$",0,setq(scheduled_analysis,t))
+strings_map("scheduled-analysis",500,"","^.*$",0)
+map_strings("scheduled-analysis",analysis_kind)
 
 -verbose
 
@@ -15,7 +21,9 @@
 
 -eval_file=toolchain.ecl
 -eval_file=public_APIs.ecl
--eval_file=out_of_scope.ecl
+if(not(scheduled_analysis),
+    eval_file("out_of_scope.ecl")
+)
 -eval_file=deviations.ecl
 -eval_file=call_properties.ecl
 -eval_file=tagging.ecl
diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
index bd9a68de31..6631db53fa 100644
--- a/automation/gitlab-ci/analyze.yaml
+++ b/automation/gitlab-ci/analyze.yaml
@@ -28,6 +28,8 @@
   extends: .eclair-analysis
   allow_failure: true
   rules:
+    - if: $CI_PIPELINE_SOURCE == "schedule"
+      when: never
     - if: $WTOKEN && $CI_PROJECT_PATH =~ /^xen-project\/people\/.*$/
       when: manual
     - !reference [.eclair-analysis, rules]
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Dec 02 00:55:32 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 02 Dec 2023 00:55:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.645811.1008178 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r9EI8-0003eO-Rh; Sat, 02 Dec 2023 00:55:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 645811.1008178; Sat, 02 Dec 2023 00:55: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 1r9EI8-0003eG-P2; Sat, 02 Dec 2023 00:55:32 +0000
Received: by outflank-mailman (input) for mailman id 645811;
 Sat, 02 Dec 2023 00: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 1r9EI8-0003e8-CM
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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 1r9EI8-0005GM-B4
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r9EI8-0000l1-9E
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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=e5tUI0YMVTwg69jaXaL3dInt/6OFbSQbmeAtoOZVJRc=; b=hOCLGMCy9No+63y4Z+hZksxLsj
	F18F4m9yCB+lAkEwJskY+ZWHelJGw5b64jJ+IpN3e/5ccBUt7rGJdk5o0t+IDgyWtYoTvEbcR2Wg9
	G3bHSNn/cJqypcV+uLnHD5qa3Rgx08aZkVG+3h9JG25CdzZe/h3/sI1Oe00vgvctwj88=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/domain: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r9EI8-0000l1-9E@xenbits.xenproject.org>
Date: Sat, 02 Dec 2023 00:55:32 +0000

commit 24dbf93ebda05c0563321ff0eb5f504286e5ba2d
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Fri Dec 1 10:48:38 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 1 10:48:38 2023 +0100

    xen/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>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/include/xen/domain.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 460c8c3d27..d345278b71 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -25,7 +25,7 @@ unsigned int dom0_max_vcpus(void);
 int parse_arch_dom0_param(const char *s, const char *e);
 struct vcpu *alloc_dom0_vcpu0(struct domain *dom0);
 
-int vcpu_reset(struct vcpu *);
+int vcpu_reset(struct vcpu *v);
 int vcpu_up(struct vcpu *v);
 
 void setup_system_domains(void);
@@ -65,9 +65,9 @@ void free_vcpu_struct(struct vcpu *v);
 
 /* Allocate/free a PIRQ structure. */
 #ifndef alloc_pirq_struct
-struct pirq *alloc_pirq_struct(struct domain *);
+struct pirq *alloc_pirq_struct(struct domain *d);
 #endif
-void cf_check free_pirq_struct(void *);
+void cf_check free_pirq_struct(void *ptr);
 
 /*
  * Initialise/destroy arch-specific details of a VCPU.
@@ -103,8 +103,8 @@ void arch_domain_creation_finished(struct domain *d);
 
 void arch_p2m_set_access_required(struct domain *d, bool access_required);
 
-int arch_set_info_guest(struct vcpu *, vcpu_guest_context_u);
-void arch_get_info_guest(struct vcpu *, vcpu_guest_context_u);
+int arch_set_info_guest(struct vcpu *v, vcpu_guest_context_u c);
+void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c);
 
 int arch_initialise_vcpu(struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg);
 int default_initialise_vcpu(struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg);
@@ -112,7 +112,7 @@ int default_initialise_vcpu(struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg);
 int arch_get_paging_mempool_size(struct domain *d, uint64_t *size /* bytes */);
 int arch_set_paging_mempool_size(struct domain *d, uint64_t size /* bytes */);
 
-bool update_runstate_area(struct vcpu *);
+bool update_runstate_area(struct vcpu *v);
 
 int domain_relinquish_resources(struct domain *d);
 
@@ -122,7 +122,7 @@ void arch_dump_vcpu_info(struct vcpu *v);
 
 void arch_dump_domain_info(struct domain *d);
 
-int arch_vcpu_reset(struct vcpu *);
+int arch_vcpu_reset(struct vcpu *v);
 
 bool domctl_lock_acquire(void);
 void domctl_lock_release(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Dec 02 00:55:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 02 Dec 2023 00:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.645812.1008182 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r9EII-0003hR-T3; Sat, 02 Dec 2023 00:55:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 645812.1008182; Sat, 02 Dec 2023 00:55: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 1r9EII-0003hJ-QO; Sat, 02 Dec 2023 00:55:42 +0000
Received: by outflank-mailman (input) for mailman id 645812;
 Sat, 02 Dec 2023 00: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 1r9EII-0003hD-F1
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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 1r9EII-0005GU-E8
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r9EII-0000lS-D7
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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=UVN5DBHW1PjTFKfkJtsKWGBOx1iFq8yuWg2hlb9LJo8=; b=zkcqEX4CQHyh7h3N3jj3B+CDjX
	y5kFL0ARdnhGISJuvdRbnSe2lIy5Prq8BNCdv5wyj1ir22cM9Pg0h3uC53MjAmKMC+JnqDD9/pUmo
	HJGAQ9gTievBHSRjEUYp6e1cRsAV0gOyCZFUUMzayeoqeQFhHamRPZiltBtgfvtfn2fQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/notifier: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r9EII-0000lS-D7@xenbits.xenproject.org>
Date: Sat, 02 Dec 2023 00:55:42 +0000

commit 59f31d970f1be4c6a764b3400a0b7c8d4fe9141a
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Fri Dec 1 10:49:34 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 1 10:49:34 2023 +0100

    xen/notifier: 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>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/include/xen/notifier.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/include/xen/notifier.h b/xen/include/xen/notifier.h
index 51453c1552..2a952484df 100644
--- a/xen/include/xen/notifier.h
+++ b/xen/include/xen/notifier.h
@@ -23,7 +23,8 @@
  */
 
 struct notifier_block {
-    int (*notifier_call)(struct notifier_block *, unsigned long, void *);
+    int (*notifier_call)(struct notifier_block *nfb, unsigned long action,
+                         void *hcpu);
     struct list_head chain;
     int priority;
 };
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Dec 02 00:55:52 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 02 Dec 2023 00:55:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.645813.1008186 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r9EIS-0003mq-UW; Sat, 02 Dec 2023 00:55:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 645813.1008186; Sat, 02 Dec 2023 00:55:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r9EIS-0003mi-Rp; Sat, 02 Dec 2023 00:55:52 +0000
Received: by outflank-mailman (input) for mailman id 645813;
 Sat, 02 Dec 2023 00: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 1r9EIS-0003mb-I0
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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 1r9EIS-0005Gd-HF
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r9EIS-0000lu-GE
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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=wssrAEGOamYVprWnTwJG2hLZJcfGJWvYnTNba7B6QEE=; b=Q+kRCZo+7oWqc44m6ZMXdzv2qq
	WL/xTehvB3gycc3gvkvCkkoDdvAROBmzBkVmCEfrNSXceWrcspHRsQvSG5bLnJsOXO47HlWsZjgGz
	tIyZR3qByl0LdBUqe7AhR9pk/G7oekcY/SD40BnLpjAU32GUQdkjcyw8BWPR3Jq8MFyE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/iommu: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1r9EIS-0000lu-GE@xenbits.xenproject.org>
Date: Sat, 02 Dec 2023 00:55:52 +0000

commit 80aeb9ccecfe1572d2936deeb6ba18cf592e5e8b
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Fri Dec 1 10:49:49 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 1 10:49:49 2023 +0100

    xen/iommu: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names to address violations of MISRA C:2012
    Rule 8.2 and remove uses of u{8,16,32} in favor of C standard types.
    No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/iommu.h | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index d5c2577091..69d572543c 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -262,14 +262,15 @@ struct iommu_ops {
     int (*init)(struct domain *d);
     void (*hwdom_init)(struct domain *d);
     int (*quarantine_init)(device_t *dev, bool scratch_page);
-    int (*add_device)(u8 devfn, device_t *dev);
+    int (*add_device)(uint8_t devfn, device_t *dev);
     int (*enable_device)(device_t *dev);
-    int (*remove_device)(u8 devfn, device_t *dev);
-    int (*assign_device)(struct domain *, u8 devfn, device_t *dev, u32 flag);
+    int (*remove_device)(uint8_t devfn, device_t *dev);
+    int (*assign_device)(struct domain *d, uint8_t devfn, device_t *dev,
+                         uint32_t flag);
     int (*reassign_device)(struct domain *s, struct domain *t,
-                           u8 devfn, device_t *dev);
+                           uint8_t devfn, device_t *dev);
 #ifdef CONFIG_HAS_PCI
-    int (*get_device_group_id)(u16 seg, u8 bus, u8 devfn);
+    int (*get_device_group_id)(uint16_t seg, uint8_t bus, uint8_t devfn);
 #endif /* HAS_PCI */
 
     void (*teardown)(struct domain *d);
@@ -308,7 +309,7 @@ struct iommu_ops {
     int __must_check (*iotlb_flush)(struct domain *d, dfn_t dfn,
                                     unsigned long page_count,
                                     unsigned int flush_flags);
-    int (*get_reserved_device_memory)(iommu_grdm_t *, void *);
+    int (*get_reserved_device_memory)(iommu_grdm_t *func, void *ctxt);
     void (*dump_page_tables)(struct domain *d);
 
 #ifdef CONFIG_HAS_DEVICE_TREE
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Dec 02 00:56:04 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 02 Dec 2023 00:56:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.645814.1008189 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r9EId-00045O-Vv; Sat, 02 Dec 2023 00:56:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 645814.1008189; Sat, 02 Dec 2023 00: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 1r9EId-00045H-TF; Sat, 02 Dec 2023 00:56:03 +0000
Received: by outflank-mailman (input) for mailman id 645814;
 Sat, 02 Dec 2023 00: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 1r9EIc-0003yh-LD
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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 1r9EIc-0005HP-KO
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00:56:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r9EIc-0000n3-JR
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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=QkhAzDa1cRo92FaMVtmA0Um0xDBM+FckCkBMF7CgCE4=; b=2HFub/olpLZDXXGqDa+dsOFfD2
	Ml1FKLfGem7VkhJzH2pfHI9jbmxl5PDo9+6Sq+33U2KZsaoaMvYWcKB9rIM79UC+O2FLGea4PdwfX
	GoDxItFz3un+W68ApgrIDSaNMMqA5RHoxfF2J1GI7QQLdsb/C4gvcFiffBG1Z4IZDJGI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/kernel: address a violation of MISRA C:2012 Rule 8.2
Message-Id: <E1r9EIc-0000n3-JR@xenbits.xenproject.org>
Date: Sat, 02 Dec 2023 00:56:02 +0000

commit 13832e2367fd3ac17326e3e22fcd347a344255b5
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Fri Dec 1 10:50:01 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 1 10:50:01 2023 +0100

    xen/kernel: 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>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/include/xen/kernel.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/xen/kernel.h b/xen/include/xen/kernel.h
index 560b1c2832..6bbd4a2827 100644
--- a/xen/include/xen/kernel.h
+++ b/xen/include/xen/kernel.h
@@ -112,7 +112,7 @@ struct vcpu;
 
 void show_execution_state(const struct cpu_user_regs *regs);
 void cf_check show_execution_state_nonconst(struct cpu_user_regs *regs);
-void vcpu_show_execution_state(struct vcpu *);
+void vcpu_show_execution_state(struct vcpu *v);
 
 #endif /* _LINUX_KERNEL_H */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Dec 02 00:56:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 02 Dec 2023 00:56:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.645815.1008194 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r9EIo-0004Rc-1D; Sat, 02 Dec 2023 00:56:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 645815.1008194; Sat, 02 Dec 2023 00: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 1r9EIn-0004RT-Ug; Sat, 02 Dec 2023 00:56:13 +0000
Received: by outflank-mailman (input) for mailman id 645815;
 Sat, 02 Dec 2023 00: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 1r9EIm-0004RI-O8
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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 1r9EIm-0005HW-NR
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00:56:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r9EIm-0000nU-MS
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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=DCSgqieNaBHSMNHsFW5Zc3Pep3Jy4ighSj3IF4JYu3Q=; b=X3sihs8LIDC26uLsr3WKarAhuX
	dxriAq7g88SvKJlX1snIEM790ae57MVDtRZ8wzk8yqkcPfqUHUq1BexwSbi4DAAw/P6xqtFKNXxNs
	jT+qBabwghWmabFRG9R2koEKTsdw0E1SxvrszyVjcDN/uFCMtgcSn3MkFeeDmegZqtyU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/param: address a violation of MISRA C:2012 Rule 8.2
Message-Id: <E1r9EIm-0000nU-MS@xenbits.xenproject.org>
Date: Sat, 02 Dec 2023 00:56:12 +0000

commit 5dc781b4afc942d8fa799dd1eb9447f260925f17
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Fri Dec 1 10:50:34 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 1 10:50:34 2023 +0100

    xen/param: 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>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/include/xen/param.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/xen/param.h b/xen/include/xen/param.h
index 93c3fe7cb7..9170455cde 100644
--- a/xen/include/xen/param.h
+++ b/xen/include/xen/param.h
@@ -22,7 +22,7 @@ struct kernel_param {
     unsigned int len;
     union {
         void *var;
-        int (*func)(const char *);
+        int (*func)(const char *s);
     } par;
 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Dec 02 00:56:24 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 02 Dec 2023 00:56:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.645816.1008198 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r9EIy-0004WK-3b; Sat, 02 Dec 2023 00:56:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 645816.1008198; Sat, 02 Dec 2023 00:56:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r9EIy-0004WC-12; Sat, 02 Dec 2023 00:56:24 +0000
Received: by outflank-mailman (input) for mailman id 645816;
 Sat, 02 Dec 2023 00: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 1r9EIw-0004Vz-S1
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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 1r9EIw-0005Hd-RG
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00:56:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r9EIw-0000nt-PU
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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=rN80Tm74DR4IT39r3qjNrmvYdyFm1owRQEHRWr/yEFk=; b=HyZRTYTiI5ZRKGFDwNytH/FvYV
	+vtjBap3miyuN05cFhS/moKamkhvHWBFuWrVKq6NnWcZwNpzlxCXoKLEtXK1LfF6p4Dth62Yu8pmH
	fpgZ2uSB7a3rtW0nfKxgppUFTGLm6sGk+e+FZcgsTExL3vDkwD5ogMwQ1C2U8M+ZPmFk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/perfc: address a violation of MISRA C:2012 Rule 8.2
Message-Id: <E1r9EIw-0000nt-PU@xenbits.xenproject.org>
Date: Sat, 02 Dec 2023 00:56:22 +0000

commit 498c130104b229dd0808fc912b7c7af945681f2f
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Fri Dec 1 10:50:44 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 1 10:50:44 2023 +0100

    xen/perfc: 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>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/include/xen/perfc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/xen/perfc.h b/xen/include/xen/perfc.h
index 96022c0748..f9009dc388 100644
--- a/xen/include/xen/perfc.h
+++ b/xen/include/xen/perfc.h
@@ -94,7 +94,7 @@ DECLARE_PER_CPU(perfc_t[NUM_PERFCOUNTERS], perfcounters);
 #endif
 
 struct xen_sysctl_perfc_op;
-int perfc_control(struct xen_sysctl_perfc_op *);
+int perfc_control(struct xen_sysctl_perfc_op *pc);
 
 extern void cf_check perfc_printall(unsigned char key);
 extern void cf_check perfc_reset(unsigned char key);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Dec 02 00:56:34 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 02 Dec 2023 00:56:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.645817.1008202 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r9EJ8-0004Z3-5C; Sat, 02 Dec 2023 00:56:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 645817.1008202; Sat, 02 Dec 2023 00:56:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r9EJ8-0004Yw-2U; Sat, 02 Dec 2023 00:56:34 +0000
Received: by outflank-mailman (input) for mailman id 645817;
 Sat, 02 Dec 2023 00: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 1r9EJ6-0004Yj-V9
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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 1r9EJ6-0005JJ-UR
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00:56:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r9EJ6-0000oL-TU
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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=hHLcSuct7feyoNezj38/Z5scLG+pwxAShHmslA2NyfE=; b=BTb4ALaWWO9JeqNF91scpnt9fh
	sIAE2ZNbm/XBhhbNgs1+INPF2vtq0sYaPveS/PpFwLltKlVmzD/8XpayEbdrw1T5L2DzdFEfANpv4
	OqEgk0ftnqbCuj1a7/fdo2GBj8jQSniWuxFHJ7cFu+97j/JN9Ls8RqR+7RXVtn5JBTgs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/serial: address a violation of MISRA C:2012 Rule 8.2
Message-Id: <E1r9EJ6-0000oL-TU@xenbits.xenproject.org>
Date: Sat, 02 Dec 2023 00:56:32 +0000

commit e7c4b68738539e601cd4b4b3d6499de0b19675a5
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Fri Dec 1 10:50:58 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 1 10:50:58 2023 +0100

    xen/serial: 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>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/include/xen/serial.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/xen/serial.h b/xen/include/xen/serial.h
index 8d64fb5e86..870ca2f6eb 100644
--- a/xen/include/xen/serial.h
+++ b/xen/include/xen/serial.h
@@ -181,7 +181,7 @@ static void inline xhci_dbc_uart_init(void) {};
 void arm_uart_init(void);
 
 struct physdev_dbgp_op;
-int dbgp_op(const struct physdev_dbgp_op *);
+int dbgp_op(const struct physdev_dbgp_op *op);
 
 /* Baud rate was pre-configured before invoking the UART driver. */
 #define BAUD_AUTO (-1)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Dec 02 00:56:44 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 02 Dec 2023 00:56:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.645818.1008205 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r9EJI-0004dS-6Q; Sat, 02 Dec 2023 00:56:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 645818.1008205; Sat, 02 Dec 2023 00:56: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 1r9EJI-0004dL-3u; Sat, 02 Dec 2023 00:56:44 +0000
Received: by outflank-mailman (input) for mailman id 645818;
 Sat, 02 Dec 2023 00: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 1r9EJH-0004dC-1q
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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 1r9EJH-0005JR-1A
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00:56:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r9EJH-0000ok-0R
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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=C/slklAKmkqAty6lbUVZRDwqW/C3dG53WjNA+l9Lecw=; b=sXsnHcewCeEBHHRc7oK+dr9n7I
	FTkhtUYA2dnxTTzD9kSM9o+XUQc+s/cfS6ALLKbuIE47yUKvizsTh3DBeruzsrDlxQlOXS+lVAduE
	Xm0/+16Msz37Lmu3yt86K7v+qPMr+cMIsWkqR0xO4wbydQZMSiL8MZMaO3QIUyKVi3dM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: mmu: add headers for missing declarations
Message-Id: <E1r9EJH-0000ok-0R@xenbits.xenproject.org>
Date: Sat, 02 Dec 2023 00:56:43 +0000

commit ebd7074dd0fbb881e3932bd6da3b8369dd290401
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Fri Dec 1 10:51:43 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 1 10:51:43 2023 +0100

    xen/arm: mmu: add headers for missing declarations
    
    The definitions needing the inclusion of asm/setup.h are
    boot_{first,second,third}(_id)?, whereas vmap.h is needed by arch_vmap_virt_end.
    
    No functional change.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/mmu/setup.c   | 1 +
 xen/arch/arm/mmu/smpboot.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/xen/arch/arm/mmu/setup.c b/xen/arch/arm/mmu/setup.c
index a5a9b538ff..d5264e51bc 100644
--- a/xen/arch/arm/mmu/setup.c
+++ b/xen/arch/arm/mmu/setup.c
@@ -8,6 +8,7 @@
 #include <xen/init.h>
 #include <xen/libfdt/libfdt.h>
 #include <xen/sizes.h>
+#include <xen/vmap.h>
 
 #include <asm/fixmap.h>
 
diff --git a/xen/arch/arm/mmu/smpboot.c b/xen/arch/arm/mmu/smpboot.c
index 12f1a5d761..b6fc0aae07 100644
--- a/xen/arch/arm/mmu/smpboot.c
+++ b/xen/arch/arm/mmu/smpboot.c
@@ -7,6 +7,8 @@
 
 #include <xen/domain_page.h>
 
+#include <asm/setup.h>
+
 /*
  * Static start-of-day pagetables that we use before the allocators
  * are up. These are used by all CPUs during bringup before switching
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Dec 02 00:56:54 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 02 Dec 2023 00:56:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.645819.1008210 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r9EJS-0004g0-84; Sat, 02 Dec 2023 00:56:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 645819.1008210; Sat, 02 Dec 2023 00:56: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 1r9EJS-0004fs-5M; Sat, 02 Dec 2023 00:56:54 +0000
Received: by outflank-mailman (input) for mailman id 645819;
 Sat, 02 Dec 2023 00: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 1r9EJR-0004fh-4c
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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 1r9EJR-0005Jp-3x
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00:56:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r9EJR-0000pC-39
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00: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=nsyFvJH8SKLqIeRisqNbHQnQuWL3Z6KB6/62mVtTESo=; b=t8QBI+osiZ7ZdpnpdRZ82v83bU
	PfekINJe7q5pIHK8TNnXxvKaBJdXCYkkoJIlhn7DknHXKV/gky2GXQ2DGMqIkupi+t7Nv8N3bekcS
	UNuaWThmkvQ6NGVRdCXE+1PxdCMW7EGyBSXzTe1ld/1x2Nccb7ta8b5qDuC2xatF/CH4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/misra: add entry to exclude-list.json
Message-Id: <E1r9EJR-0000pC-39@xenbits.xenproject.org>
Date: Sat, 02 Dec 2023 00:56:53 +0000

commit cd1a4a570971213b3ab870f45fca569b0cc43833
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Fri Dec 1 10:52:23 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 1 10:52:23 2023 +0100

    docs/misra: add entry to exclude-list.json
    
    x86/efi/check.c is not part of the final Xen binary, therefore
    it doesn't need to conform to MISRA guidelines at the moment.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 docs/misra/exclude-list.json | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/docs/misra/exclude-list.json b/docs/misra/exclude-list.json
index b858a0baa1..24e4de3ca5 100644
--- a/docs/misra/exclude-list.json
+++ b/docs/misra/exclude-list.json
@@ -93,6 +93,10 @@
             "rel_path": "arch/x86/x86_64/mmconf-fam10h.c",
             "comment": "Imported from Linux, ignore for now"
         },
+        {
+            "rel_path": "arch/x86/efi/check.c",
+            "comment": "The resulting code is not included in the final Xen binary, ignore for now"
+        },
         {
             "rel_path": "common/bitmap.c",
             "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 Sat Dec 02 00:57:04 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 02 Dec 2023 00:57:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.645820.1008213 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r9EJc-0004ik-9A; Sat, 02 Dec 2023 00:57:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 645820.1008213; Sat, 02 Dec 2023 00:57: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 1r9EJc-0004id-6i; Sat, 02 Dec 2023 00:57:04 +0000
Received: by outflank-mailman (input) for mailman id 645820;
 Sat, 02 Dec 2023 00:57: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 1r9EJb-0004iP-7l
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00:57: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 1r9EJb-0005KG-73
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00:57:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r9EJb-0000q0-5z
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00:57: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=HuM2zMmLsGXyhRFv22SPtkcopgpvwLJkDJ/RN9j1lzs=; b=c4rWCnvdg05WGol0U+4vjTW1vF
	Ez0Y4FIes7SM65KMAotdb6txYrnK43oV+efw6QWr3Z2Bux+knN8z16XJGepJckej0QcHHu2w/iyyG
	FeYMNOhthkTPlfUhUUUZ2pllvBFxxeW3Blz43O9dvuVsoFCrIC/IO/sTpejQb5TuXQxc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] .gitignore: generalize *.new
Message-Id: <E1r9EJb-0000q0-5z@xenbits.xenproject.org>
Date: Sat, 02 Dec 2023 00:57:03 +0000

commit 02ef46b675c24e8493b11f410f6650b00b393b6b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Dec 1 10:52:44 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 1 10:52:44 2023 +0100

    .gitignore: generalize *.new
    
    It's not only in xen/include/xen/ that we generate (intermediate) *.new
    files.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 .gitignore | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 5b8f23271e..d8b57e32f8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,6 +17,7 @@
 *.so.[0-9]*
 *.bin
 *.bak
+*.new
 *.tmp
 *.spot
 *.spit
@@ -277,7 +278,6 @@ xen/include/compat/*
 xen/include/config/
 xen/include/generated/
 xen/include/public/public
-xen/include/xen/*.new
 xen/include/xen/acm_policy.h
 xen/include/xen/compile.h
 xen/include/xen/hypercall-defs.h
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Dec 02 00:57:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 02 Dec 2023 00:57:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.645821.1008217 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r9EJm-0004lJ-AY; Sat, 02 Dec 2023 00:57:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 645821.1008217; Sat, 02 Dec 2023 00:57: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 1r9EJm-0004lC-87; Sat, 02 Dec 2023 00:57:14 +0000
Received: by outflank-mailman (input) for mailman id 645821;
 Sat, 02 Dec 2023 00:57: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 1r9EJl-0004l3-As
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00:57: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 1r9EJl-0005KN-9s
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00:57:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r9EJl-0000qV-96
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 00:57: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=YySr4jZXHfD+m0NjbYHKoV5JxNPXc/pMyJbwXyu68DY=; b=d+jdVhi4IZDFMJ984dvysr1jdg
	LQ/QfUOUxJCAKhbcvzok77eOgkjlZ/Zb+207qtiyCXWlO7Gg8dWjD+zMqZi7FAUU2sOEND338K/Z/
	sZNl4Wsna3uuajTWxsm8e994Q7DkpHuH3BY1+Krm3+CwoD38v+7gaQcR+EQABVLG9KP8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xg: Fix potential memory leak in cpu policy getters/setters
Message-Id: <E1r9EJl-0000qV-96@xenbits.xenproject.org>
Date: Sat, 02 Dec 2023 00:57:13 +0000

commit 1571ff7a987b88b20598a6d49910457f3b2c59f1
Author:     Alejandro Vallejo <alejandro.vallejo@cloud.com>
AuthorDate: Fri Dec 1 10:53:07 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 1 10:53:07 2023 +0100

    tools/xg: Fix potential memory leak in cpu policy getters/setters
    
    They allocate two different hypercall buffers, but leak the first
    allocation if the second one failed due to an early return that bypasses
    cleanup.
    
    Remove the early exit and go through _post() instead. Invoking _post() is
    benign even if _pre() failed.
    
    Fixes: 6b85e427098c ('x86/sysctl: Implement XEN_SYSCTL_get_cpu_policy')
    Fixes: 60529dfeca14 ('x86/domctl: Implement XEN_DOMCTL_get_cpu_policy')
    Fixes: 14ba07e6f816 ('x86/domctl: Implement XEN_DOMCTL_set_cpumsr_policy')
    Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/guest/xg_cpuid_x86.c | 86 +++++++++++++++++++----------------------
 1 file changed, 39 insertions(+), 47 deletions(-)

diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x86.c
index 4497087daa..db5aebc815 100644
--- a/tools/libs/guest/xg_cpuid_x86.c
+++ b/tools/libs/guest/xg_cpuid_x86.c
@@ -136,20 +136,20 @@ static int get_system_cpu_policy(xc_interface *xch, uint32_t index,
     DECLARE_HYPERCALL_BOUNCE(msrs,
                              *nr_msrs * sizeof(*msrs),
                              XC_HYPERCALL_BUFFER_BOUNCE_OUT);
-    int ret;
-
-    if ( xc_hypercall_bounce_pre(xch, leaves) ||
-         xc_hypercall_bounce_pre(xch, msrs) )
-        return -1;
+    int ret = -1;
 
-    sysctl.cmd = XEN_SYSCTL_get_cpu_policy;
-    sysctl.u.cpu_policy.index = index;
-    sysctl.u.cpu_policy.nr_leaves = *nr_leaves;
-    set_xen_guest_handle(sysctl.u.cpu_policy.leaves, leaves);
-    sysctl.u.cpu_policy.nr_msrs = *nr_msrs;
-    set_xen_guest_handle(sysctl.u.cpu_policy.msrs, msrs);
-
-    ret = do_sysctl(xch, &sysctl);
+    if ( !xc_hypercall_bounce_pre(xch, leaves) &&
+         !xc_hypercall_bounce_pre(xch, msrs) )
+    {
+        sysctl.cmd = XEN_SYSCTL_get_cpu_policy;
+        sysctl.u.cpu_policy.index = index;
+        sysctl.u.cpu_policy.nr_leaves = *nr_leaves;
+        set_xen_guest_handle(sysctl.u.cpu_policy.leaves, leaves);
+        sysctl.u.cpu_policy.nr_msrs = *nr_msrs;
+        set_xen_guest_handle(sysctl.u.cpu_policy.msrs, msrs);
+
+        ret = do_sysctl(xch, &sysctl);
+    }
 
     xc_hypercall_bounce_post(xch, leaves);
     xc_hypercall_bounce_post(xch, msrs);
@@ -174,20 +174,20 @@ static int get_domain_cpu_policy(xc_interface *xch, uint32_t domid,
     DECLARE_HYPERCALL_BOUNCE(msrs,
                              *nr_msrs * sizeof(*msrs),
                              XC_HYPERCALL_BUFFER_BOUNCE_OUT);
-    int ret;
-
-    if ( xc_hypercall_bounce_pre(xch, leaves) ||
-         xc_hypercall_bounce_pre(xch, msrs) )
-        return -1;
-
-    domctl.cmd = XEN_DOMCTL_get_cpu_policy;
-    domctl.domain = domid;
-    domctl.u.cpu_policy.nr_leaves = *nr_leaves;
-    set_xen_guest_handle(domctl.u.cpu_policy.leaves, leaves);
-    domctl.u.cpu_policy.nr_msrs = *nr_msrs;
-    set_xen_guest_handle(domctl.u.cpu_policy.msrs, msrs);
+    int ret = -1;
 
-    ret = do_domctl(xch, &domctl);
+    if ( !xc_hypercall_bounce_pre(xch, leaves) &&
+         !xc_hypercall_bounce_pre(xch, msrs) )
+    {
+        domctl.cmd = XEN_DOMCTL_get_cpu_policy;
+        domctl.domain = domid;
+        domctl.u.cpu_policy.nr_leaves = *nr_leaves;
+        set_xen_guest_handle(domctl.u.cpu_policy.leaves, leaves);
+        domctl.u.cpu_policy.nr_msrs = *nr_msrs;
+        set_xen_guest_handle(domctl.u.cpu_policy.msrs, msrs);
+
+        ret = do_domctl(xch, &domctl);
+    }
 
     xc_hypercall_bounce_post(xch, leaves);
     xc_hypercall_bounce_post(xch, msrs);
@@ -214,32 +214,24 @@ int xc_set_domain_cpu_policy(xc_interface *xch, uint32_t domid,
     DECLARE_HYPERCALL_BOUNCE(msrs,
                              nr_msrs * sizeof(*msrs),
                              XC_HYPERCALL_BUFFER_BOUNCE_IN);
-    int ret;
-
-    if ( err_leaf_p )
-        *err_leaf_p = -1;
-    if ( err_subleaf_p )
-        *err_subleaf_p = -1;
-    if ( err_msr_p )
-        *err_msr_p = -1;
+    int ret = -1;
 
-    if ( xc_hypercall_bounce_pre(xch, leaves) )
-        return -1;
-
-    if ( xc_hypercall_bounce_pre(xch, msrs) )
-        return -1;
-
-    domctl.cmd = XEN_DOMCTL_set_cpu_policy;
-    domctl.domain = domid;
-    domctl.u.cpu_policy.nr_leaves = nr_leaves;
-    set_xen_guest_handle(domctl.u.cpu_policy.leaves, leaves);
-    domctl.u.cpu_policy.nr_msrs = nr_msrs;
-    set_xen_guest_handle(domctl.u.cpu_policy.msrs, msrs);
     domctl.u.cpu_policy.err_leaf = -1;
     domctl.u.cpu_policy.err_subleaf = -1;
     domctl.u.cpu_policy.err_msr = -1;
 
-    ret = do_domctl(xch, &domctl);
+    if ( !xc_hypercall_bounce_pre(xch, leaves) &&
+         !xc_hypercall_bounce_pre(xch, msrs) )
+    {
+        domctl.cmd = XEN_DOMCTL_set_cpu_policy;
+        domctl.domain = domid;
+        domctl.u.cpu_policy.nr_leaves = nr_leaves;
+        set_xen_guest_handle(domctl.u.cpu_policy.leaves, leaves);
+        domctl.u.cpu_policy.nr_msrs = nr_msrs;
+        set_xen_guest_handle(domctl.u.cpu_policy.msrs, msrs);
+
+        ret = do_domctl(xch, &domctl);
+    }
 
     xc_hypercall_bounce_post(xch, leaves);
     xc_hypercall_bounce_post(xch, msrs);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Dec 02 10:44:09 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 02 Dec 2023 10:44:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.646056.1008592 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1r9NTf-0003HW-0P; Sat, 02 Dec 2023 10:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 646056.1008592; Sat, 02 Dec 2023 10: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 1r9NTe-0003HO-Tb; Sat, 02 Dec 2023 10:44:02 +0000
Received: by outflank-mailman (input) for mailman id 646056;
 Sat, 02 Dec 2023 10: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 1r9NTd-0003HI-St
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 10: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 1r9NTd-0001L3-IV
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 10:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1r9NTd-0002MC-HP
 for xen-changelog@lists.xenproject.org; Sat, 02 Dec 2023 10: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=03vPCii1z8mu+uHJqH7rLTNL2QAkbCL2AG4y2EU7aM4=; b=cgADKbyAAMd8x/MTrqMx9UYiYf
	kLH3IMQC1cuXND8LvtrlWOXXInStobIEPbDYZJFtvXh+zHeKq4R9SFnm/WCrRfi7+RquBZAwMygFG
	gZoldLwaD5vf/EUt5JgxW7Pwj5w7erRIwCj0qoI7XLCOhDuhNdAmsVkL3sqX6bB5ElGI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Move static event channel feature to a separate module
Message-Id: <E1r9NTd-0002MC-HP@xenbits.xenproject.org>
Date: Sat, 02 Dec 2023 10:44:01 +0000

commit 525c7c094b258e8a46b494488eef96f5670eb352
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Thu Nov 30 10:57:57 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Dec 1 18:59:34 2023 +0000

    xen/arm: Move static event channel feature to a separate module
    
    Move static event channel feature related code to a separate module
    (static-evtchn.{c,h}) in the spirit of fine granular configuration, so
    that the feature can be disabled if not needed.
    
    Introduce Kconfig option CONFIG_STATIC_EVTCHN, enabled by default (to
    keep the current behavior) dependent on CONFIG_DOM0LESS. While it could
    be possible to create a loopback connection for dom0 only, this use case
    does not really need this feature and all the docs and commit messages
    refer explicitly to the use in dom0less system.
    
    The only function visible externally is alloc_static_evtchn(), so move
    the prototype to static-evtchn.h and provide a stub in case a feature
    is disabled. Guard static_evtchn_created in struct dt_device_node as
    well as its helpers.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/arch/arm/Kconfig                     |   8 ++
 xen/arch/arm/Makefile                    |   1 +
 xen/arch/arm/domain_build.c              | 146 ----------------------------
 xen/arch/arm/include/asm/setup.h         |   1 -
 xen/arch/arm/include/asm/static-evtchn.h |  25 +++++
 xen/arch/arm/setup.c                     |   1 +
 xen/arch/arm/static-evtchn.c             | 161 +++++++++++++++++++++++++++++++
 xen/include/xen/device_tree.h            |   4 +
 8 files changed, 200 insertions(+), 147 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index f73b62e50d..50e9bfae1a 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -217,6 +217,14 @@ config STATIC_SHM
 	help
 	  This option enables statically shared memory on a dom0less system.
 
+config STATIC_EVTCHN
+	bool "Static event channel support on a dom0less system"
+	depends on DOM0LESS_BOOT
+	default y
+	help
+	  This option enables establishing static event channel communication
+	  between domains on a dom0less system (domU-domU as well as domU-dom0).
+
 endmenu
 
 menu "ARM errata workaround via the alternative framework"
diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 809772417c..33c677672f 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -51,6 +51,7 @@ obj-y += setup.o
 obj-y += shutdown.o
 obj-y += smp.o
 obj-y += smpboot.o
+obj-$(CONFIG_STATIC_EVTCHN) += static-evtchn.init.o
 obj-$(CONFIG_STATIC_MEMORY) += static-memory.init.o
 obj-$(CONFIG_STATIC_SHM) += static-shmem.init.o
 obj-y += sysctl.o
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index df66fb88d8..613b2885ce 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -38,8 +38,6 @@
 #include <xen/grant_table.h>
 #include <xen/serial.h>
 
-#define STATIC_EVTCHN_NODE_SIZE_CELLS 2
-
 static unsigned int __initdata opt_dom0_max_vcpus;
 integer_param("dom0_max_vcpus", opt_dom0_max_vcpus);
 
@@ -1919,150 +1917,6 @@ void __init evtchn_allocate(struct domain *d)
     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");
-        return -EINVAL;
-    }
-
-    *port = dt_next_cell(1, &prop);
-    *phandle = dt_next_cell(1, &prop);
-
-    return 0;
-}
-
-static int __init alloc_domain_evtchn(struct dt_device_node *node)
-{
-    int rc;
-    uint32_t domU1_port, domU2_port, remote_phandle;
-    struct dt_device_node *remote_node;
-    const struct dt_device_node *p1_node, *p2_node;
-    struct evtchn_alloc_unbound alloc_unbound;
-    struct evtchn_bind_interdomain bind_interdomain;
-    struct domain *d1 = NULL, *d2 = NULL;
-
-    if ( !dt_device_is_compatible(node, "xen,evtchn-v1") )
-        return 0;
-
-    /*
-     * Event channel is already created while parsing the other side of
-     * evtchn node.
-     */
-    if ( dt_device_static_evtchn_created(node) )
-        return 0;
-
-    rc = get_evtchn_dt_property(node, &domU1_port, &remote_phandle);
-    if ( rc )
-        return rc;
-
-    remote_node = dt_find_node_by_phandle(remote_phandle);
-    if ( !remote_node )
-    {
-        printk(XENLOG_ERR
-                "evtchn: could not find remote evtchn phandle\n");
-        return -EINVAL;
-    }
-
-    rc = get_evtchn_dt_property(remote_node, &domU2_port, &remote_phandle);
-    if ( rc )
-        return rc;
-
-    if ( node->phandle != remote_phandle )
-    {
-        printk(XENLOG_ERR "xen,evtchn property is not setup correctly.\n");
-        return -EINVAL;
-    }
-
-    p1_node = dt_get_parent(node);
-    if ( !p1_node )
-    {
-        printk(XENLOG_ERR "evtchn: evtchn parent node is NULL\n" );
-        return -EINVAL;
-    }
-
-    p2_node = dt_get_parent(remote_node);
-    if ( !p2_node )
-    {
-        printk(XENLOG_ERR "evtchn: remote parent node is NULL\n" );
-        return -EINVAL;
-    }
-
-    d1 = get_domain_by_id(p1_node->used_by);
-    d2 = get_domain_by_id(p2_node->used_by);
-
-    if ( !d1 || !d2 )
-    {
-        printk(XENLOG_ERR "evtchn: could not find domains\n" );
-        return -EINVAL;
-    }
-
-    alloc_unbound.dom = d1->domain_id;
-    alloc_unbound.remote_dom = d2->domain_id;
-
-    rc = evtchn_alloc_unbound(&alloc_unbound, domU1_port);
-    if ( rc < 0 )
-    {
-        printk(XENLOG_ERR
-                "evtchn_alloc_unbound() failure (Error %d) \n", rc);
-        return rc;
-    }
-
-    bind_interdomain.remote_dom  = d1->domain_id;
-    bind_interdomain.remote_port = domU1_port;
-
-    rc = evtchn_bind_interdomain(&bind_interdomain, d2, domU2_port);
-    if ( rc < 0 )
-    {
-        printk(XENLOG_ERR
-                "evtchn_bind_interdomain() failure (Error %d) \n", rc);
-        return rc;
-    }
-
-    dt_device_set_static_evtchn_created(node);
-    dt_device_set_static_evtchn_created(remote_node);
-
-    return 0;
-}
-
-void __init alloc_static_evtchn(void)
-{
-    struct dt_device_node *node, *evtchn_node;
-    struct dt_device_node *chosen = dt_find_node_by_path("/chosen");
-
-    BUG_ON(chosen == NULL);
-
-    if ( hardware_domain )
-        dt_device_set_used_by(chosen, hardware_domain->domain_id);
-
-    dt_for_each_child_node(chosen, node)
-    {
-        if ( hardware_domain )
-        {
-            if ( alloc_domain_evtchn(node) != 0 )
-                panic("Could not set up domains evtchn\n");
-        }
-
-        dt_for_each_child_node(node, evtchn_node)
-        {
-            if ( alloc_domain_evtchn(evtchn_node) != 0 )
-                panic("Could not set up domains evtchn\n");
-        }
-    }
-}
-
 static void __init find_gnttab_region(struct domain *d,
                                       struct kernel_info *kinfo)
 {
diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index bda3c07b87..d15a88d2e0 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -136,7 +136,6 @@ void acpi_create_efi_mmap_table(struct domain *d,
 int acpi_make_efi_nodes(void *fdt, struct membank tbl_add[]);
 
 void create_dom0(void);
-void alloc_static_evtchn(void);
 
 void discard_initial_modules(void);
 void fw_unreserved_regions(paddr_t s, paddr_t e,
diff --git a/xen/arch/arm/include/asm/static-evtchn.h b/xen/arch/arm/include/asm/static-evtchn.h
new file mode 100644
index 0000000000..f964522f6a
--- /dev/null
+++ b/xen/arch/arm/include/asm/static-evtchn.h
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __ASM_STATIC_EVTCHN_H_
+#define __ASM_STATIC_EVTCHN_H_
+
+#ifdef CONFIG_STATIC_EVTCHN
+
+void alloc_static_evtchn(void);
+
+#else /* !CONFIG_STATIC_EVTCHN */
+
+static inline void alloc_static_evtchn(void) {};
+
+#endif /* CONFIG_STATIC_EVTCHN */
+
+#endif /* __ASM_STATIC_EVTCHN_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 d07ea044db..59dd9bb25a 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -36,6 +36,7 @@
 #include <asm/alternative.h>
 #include <asm/dom0less-build.h>
 #include <asm/page.h>
+#include <asm/static-evtchn.h>
 #include <asm/current.h>
 #include <asm/setup.h>
 #include <asm/gic.h>
diff --git a/xen/arch/arm/static-evtchn.c b/xen/arch/arm/static-evtchn.c
new file mode 100644
index 0000000000..49db08d5c6
--- /dev/null
+++ b/xen/arch/arm/static-evtchn.c
@@ -0,0 +1,161 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/event.h>
+
+#include <asm/static-evtchn.h>
+
+#define STATIC_EVTCHN_NODE_SIZE_CELLS 2
+
+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");
+        return -EINVAL;
+    }
+
+    *port = dt_next_cell(1, &prop);
+    *phandle = dt_next_cell(1, &prop);
+
+    return 0;
+}
+
+static int __init alloc_domain_evtchn(struct dt_device_node *node)
+{
+    int rc;
+    uint32_t domU1_port, domU2_port, remote_phandle;
+    struct dt_device_node *remote_node;
+    const struct dt_device_node *p1_node, *p2_node;
+    struct evtchn_alloc_unbound alloc_unbound;
+    struct evtchn_bind_interdomain bind_interdomain;
+    struct domain *d1 = NULL, *d2 = NULL;
+
+    if ( !dt_device_is_compatible(node, "xen,evtchn-v1") )
+        return 0;
+
+    /*
+     * Event channel is already created while parsing the other side of
+     * evtchn node.
+     */
+    if ( dt_device_static_evtchn_created(node) )
+        return 0;
+
+    rc = get_evtchn_dt_property(node, &domU1_port, &remote_phandle);
+    if ( rc )
+        return rc;
+
+    remote_node = dt_find_node_by_phandle(remote_phandle);
+    if ( !remote_node )
+    {
+        printk(XENLOG_ERR
+                "evtchn: could not find remote evtchn phandle\n");
+        return -EINVAL;
+    }
+
+    rc = get_evtchn_dt_property(remote_node, &domU2_port, &remote_phandle);
+    if ( rc )
+        return rc;
+
+    if ( node->phandle != remote_phandle )
+    {
+        printk(XENLOG_ERR "xen,evtchn property is not setup correctly.\n");
+        return -EINVAL;
+    }
+
+    p1_node = dt_get_parent(node);
+    if ( !p1_node )
+    {
+        printk(XENLOG_ERR "evtchn: evtchn parent node is NULL\n" );
+        return -EINVAL;
+    }
+
+    p2_node = dt_get_parent(remote_node);
+    if ( !p2_node )
+    {
+        printk(XENLOG_ERR "evtchn: remote parent node is NULL\n" );
+        return -EINVAL;
+    }
+
+    d1 = get_domain_by_id(p1_node->used_by);
+    d2 = get_domain_by_id(p2_node->used_by);
+
+    if ( !d1 || !d2 )
+    {
+        printk(XENLOG_ERR "evtchn: could not find domains\n" );
+        return -EINVAL;
+    }
+
+    alloc_unbound.dom = d1->domain_id;
+    alloc_unbound.remote_dom = d2->domain_id;
+
+    rc = evtchn_alloc_unbound(&alloc_unbound, domU1_port);
+    if ( rc < 0 )
+    {
+        printk(XENLOG_ERR
+                "evtchn_alloc_unbound() failure (Error %d) \n", rc);
+        return rc;
+    }
+
+    bind_interdomain.remote_dom  = d1->domain_id;
+    bind_interdomain.remote_port = domU1_port;
+
+    rc = evtchn_bind_interdomain(&bind_interdomain, d2, domU2_port);
+    if ( rc < 0 )
+    {
+        printk(XENLOG_ERR
+                "evtchn_bind_interdomain() failure (Error %d) \n", rc);
+        return rc;
+    }
+
+    dt_device_set_static_evtchn_created(node);
+    dt_device_set_static_evtchn_created(remote_node);
+
+    return 0;
+}
+
+void __init alloc_static_evtchn(void)
+{
+    struct dt_device_node *node, *evtchn_node;
+    struct dt_device_node *chosen = dt_find_node_by_path("/chosen");
+
+    BUG_ON(chosen == NULL);
+
+    if ( hardware_domain )
+        dt_device_set_used_by(chosen, hardware_domain->domain_id);
+
+    dt_for_each_child_node(chosen, node)
+    {
+        if ( hardware_domain )
+        {
+            if ( alloc_domain_evtchn(node) != 0 )
+                panic("Could not set up domains evtchn\n");
+        }
+
+        dt_for_each_child_node(node, evtchn_node)
+        {
+            if ( alloc_domain_evtchn(evtchn_node) != 0 )
+                panic("Could not set up domains evtchn\n");
+        }
+    }
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 3ae7b45429..94a836cb4e 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -94,8 +94,10 @@ struct dt_device_node {
     /* IOMMU specific fields */
     bool is_protected;
 
+#ifdef CONFIG_STATIC_EVTCHN
     /* HACK: Remove this if there is a need of space */
     bool static_evtchn_created;
+#endif
 
     /*
      * The main purpose of this list is to link the structure in the list
@@ -366,6 +368,7 @@ static inline bool dt_property_name_is_equal(const struct dt_property *pp,
     return !dt_prop_cmp(pp->name, name);
 }
 
+#ifdef CONFIG_STATIC_EVTCHN
 static inline void
 dt_device_set_static_evtchn_created(struct dt_device_node *device)
 {
@@ -377,6 +380,7 @@ dt_device_static_evtchn_created(const struct dt_device_node *device)
 {
     return device->static_evtchn_created;
 }
+#endif /* CONFIG_STATIC_EVTCHN */
 
 /**
  * dt_find_compatible_node - Find a node based on type and one of the
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:55:09 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:55:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647195.1010011 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACDo-0006oR-Ch; Mon, 04 Dec 2023 16:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647195.1010011; Mon, 04 Dec 2023 16: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 1rACDo-0006oK-AG; Mon, 04 Dec 2023 16:55:04 +0000
Received: by outflank-mailman (input) for mailman id 647195;
 Mon, 04 Dec 2023 16:55: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 1rACDn-0006o6-37
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:55: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 1rACDm-0006rH-VM
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACDm-0002Hr-U8
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16: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=oLm0DQqmVEkE3TVIwInbbJs2UkBmtNasRDWADaF0jXc=; b=QLd1V4q1L5KlpW96lOCgtLLWEG
	uRDSzLgJ7x8rvDL83X4QQ1yHDSYd/BXc1VmnYhnFIQEP8V4RYZ/BIitL7NzmbME6DlNIO7Kjhri/6
	RPpmI1P+rWZLiftq0gM+Qa2A2U6w8tCcHYCFzEz+upWzdPyJQWTkdWl57NXC49QwvMz8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: link kernel separately
Message-Id: <E1rACDm-0002Hr-U8@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:55:02 +0000

commit 939c1b886ee2242ef4b88d2e50907424606f4780
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:24:52 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: link kernel separately
    
    Add an additional link step with linking all Mini-OS kernel binaries
    into a single object file.
    
    This is done in preparation of hiding Mini-OS internal symbols before
    linking the kernel with libraries and an application.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 Makefile | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 7ee181a..85c6db7 100644
--- a/Makefile
+++ b/Makefile
@@ -164,8 +164,11 @@ endif
 $(OBJ_DIR)/arch/x86/minios-x86%.lds:  arch/x86/minios-x86.lds.S
 	$(CPP) $(ASFLAGS) -P $< -o $@
 
-$(OBJ_DIR)/$(TARGET): $(OBJS) $(APP_O) arch_lib $(OBJ_DIR)/$(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds
-	$(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(APP_O) $(OBJS) $(LDARCHLIB) $(LDLIBS) -o $@.o
+$(OBJ_DIR)/$(TARGET)-kern.o: $(OBJS) arch_lib $(OBJ_DIR)/$(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds
+	$(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(OBJS) $(LDARCHLIB) -o $@
+
+$(OBJ_DIR)/$(TARGET): $(OBJ_DIR)/$(TARGET)-kern.o $(APP_O)
+	$(LD) -r $(LDFLAGS) $(OBJ_DIR)/$(TARGET)-kern.o $(APP_O) $(LDLIBS) -o $@.o
 	$(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start $@.o $@.o
 	$(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@-debug
 	strip -s $@-debug -o $@
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:55:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647197.1010016 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACDy-0006tO-EV; Mon, 04 Dec 2023 16:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647197.1010016; Mon, 04 Dec 2023 16: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 1rACDy-0006tG-Bl; Mon, 04 Dec 2023 16:55:14 +0000
Received: by outflank-mailman (input) for mailman id 647197;
 Mon, 04 Dec 2023 16:55: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 1rACDx-0006t2-3c
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:55: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 1rACDx-0006rQ-2m
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:55:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACDx-0002K0-1V
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:55:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kRa91X08pwMsObQD0UV6ULiikinwP/mBDKR/fTeYpS4=; b=eOlotfC91v7p0RAqHb8pol7MqO
	HQWH4NUJ2OP2lU3juCeUQRcfBKZAyRAdwoX5nkSUSXaZeJokoi94kaQTTBLNEV/Gge97UExmgpIJZ
	qRKbgNqQEda0rI7cwSnendK3V/fDKNhGZL+aL6xXgvoiM3RScrCfkqFk/xpSyNJ2+JSE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: explicitly mark symbols to be visible for apps
Message-Id: <E1rACDx-0002K0-1V@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:55:13 +0000

commit 584b8565b6b2c427526dd22f89d8bf77452dcd0b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:24:53 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: explicitly mark symbols to be visible for apps
    
    Add an EXPORT_SYMBOL() macro to explicitly mark a symbol to be visible
    for an app or library linked with Mini-OS. This prepares hiding all
    other symbols from external components, avoiding any problems with
    duplicate symbol names.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 .gitignore       |  1 +
 Makefile         |  3 ++-
 include/export.h | 10 ++++++++++
 include/lib.h    |  1 +
 4 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index abef46b..bacf787 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,3 +16,4 @@ mini-os.gz
 minios-config.mk
 mini-os-debug
 mini-os-debug.gz
+syms
diff --git a/Makefile b/Makefile
index 85c6db7..588496c 100644
--- a/Makefile
+++ b/Makefile
@@ -166,10 +166,11 @@ $(OBJ_DIR)/arch/x86/minios-x86%.lds:  arch/x86/minios-x86.lds.S
 
 $(OBJ_DIR)/$(TARGET)-kern.o: $(OBJS) arch_lib $(OBJ_DIR)/$(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds
 	$(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(OBJS) $(LDARCHLIB) -o $@
+	$(OBJCOPY) --dump-section .export_symbol=$(OBJ_DIR)/syms $@
 
 $(OBJ_DIR)/$(TARGET): $(OBJ_DIR)/$(TARGET)-kern.o $(APP_O)
 	$(LD) -r $(LDFLAGS) $(OBJ_DIR)/$(TARGET)-kern.o $(APP_O) $(LDLIBS) -o $@.o
-	$(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start $@.o $@.o
+	$(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start --remove-section=.export_symbol $@.o $@.o
 	$(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@-debug
 	strip -s $@-debug -o $@
 	gzip -n -f -9 -c $@-debug >$@-debug.gz
diff --git a/include/export.h b/include/export.h
new file mode 100644
index 0000000..7140ac6
--- /dev/null
+++ b/include/export.h
@@ -0,0 +1,10 @@
+#ifndef _EXPORT_H_
+#define _EXPORT_H_
+
+/* Mark a symbol to be visible for apps and libs. */
+#define EXPORT_SYMBOL(sym)          \
+    asm(".section .export_symbol\n" \
+        ".ascii \""#sym"\\n\"\n"    \
+        ".previous\n")
+
+#endif /* _EXPORT_H_ */
diff --git a/include/lib.h b/include/lib.h
index dd68985..abd4e9a 100644
--- a/include/lib.h
+++ b/include/lib.h
@@ -53,6 +53,7 @@
 #include <stddef.h>
 #include <xen/xen.h>
 #include <xen/event_channel.h>
+#include <mini-os/export.h>
 #include "gntmap.h"
 
 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:55:24 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647198.1010019 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACE8-0006zU-Fd; Mon, 04 Dec 2023 16:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647198.1010019; Mon, 04 Dec 2023 16: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 1rACE8-0006zM-DC; Mon, 04 Dec 2023 16:55:24 +0000
Received: by outflank-mailman (input) for mailman id 647198;
 Mon, 04 Dec 2023 16:55:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACE7-0006z9-9A
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:55:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACE7-0006rg-6Y
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:55:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACE7-0002Ux-59
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:55: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=e5cNfUfI4readtXQSR0TC8GKqttq9tHa4eI8ZdUJ7xQ=; b=E9S9MflLHVEy0Uth3g3j68IxIo
	bCZsDC88M+p/8RiNA5XM3y5vjW5WYRed1vi3ouP7VL8a4XklbyujsP2ubLh+e6iAsXd+w6O3jcV0E
	YqhAzjn3xoysSzmA3mKsHRLgzfwWdgUl3ovSkzIIP8ljfCCZXnNL+YucmF5NvpbULrfs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to kernel.c
Message-Id: <E1rACE7-0002Ux-59@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:55:23 +0000

commit 9a167ad2f2794e7a54d217543323d8da9073ff58
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:24:54 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to kernel.c
    
    Add the needed instances of EXPORT_SYMBOL() to kernel.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 kernel.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel.c b/kernel.c
index 1f97d8d..0b44494 100644
--- a/kernel.c
+++ b/kernel.c
@@ -50,6 +50,9 @@
 #include <xen/features.h>
 #include <xen/version.h>
 
+void _start(void);
+EXPORT_SYMBOL(_start);
+
 uint8_t xen_features[XENFEAT_NR_SUBMAPS * 32];
 char cmdline[MAX_CMDLINE_SIZE];
 
@@ -181,6 +184,7 @@ void stop_kernel(void)
     /* Reset arch details */
     arch_fini();
 }
+EXPORT_SYMBOL(stop_kernel);
 
 /*
  * do_exit: This is called whenever an IRET fails in entry.S.
@@ -199,3 +203,4 @@ void do_exit(void)
         HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
     }
 }
+EXPORT_SYMBOL(do_exit);
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:55:34 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647199.1010024 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACEI-00073U-HC; Mon, 04 Dec 2023 16:55:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647199.1010024; Mon, 04 Dec 2023 16: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 1rACEI-00073A-Ea; Mon, 04 Dec 2023 16:55:34 +0000
Received: by outflank-mailman (input) for mailman id 647199;
 Mon, 04 Dec 2023 16:55:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACEH-000734-AK
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:55: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 1rACEH-0006s4-9X
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:55:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACEH-0002X5-8X
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:55: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=i03xPcY63zCZcBz9FzohSDfjVDBf53gt4vwh2d+TMug=; b=V3KNXcLqDsp4fH2AKP3lHGhcuf
	EvBYoeKA0f6n75r0AoJCvVcV/078QHYS79giiKJAokbC66ZemiY6d4j33807Zb5IVJ5lXhi8THL+3
	3ClvS12yOk65YEgDDzZz0jJq5/x4c+RG0FfgMd1Dkjd3sg/L3sjYrCmU0KskUoD3z31g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to hypervisor.c
Message-Id: <E1rACEH-0002X5-8X@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:55:33 +0000

commit d1c0b78fb09297dee5ac325581c2af145b1847d1
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:24:55 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to hypervisor.c
    
    Add the needed instances of EXPORT_SYMBOL() to hypervisor.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 hypervisor.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hypervisor.c b/hypervisor.c
index d3857e7..f2cbbc1 100644
--- a/hypervisor.c
+++ b/hypervisor.c
@@ -31,6 +31,8 @@
 #include <mini-os/events.h>
 #include <xen/memory.h>
 
+EXPORT_SYMBOL(hypercall_page);
+
 #define active_evtchns(cpu,sh,idx)              \
     ((sh)->evtchn_pending[idx] &                \
      ~(sh)->evtchn_mask[idx])
@@ -157,6 +159,7 @@ inline void mask_evtchn(uint32_t port)
     shared_info_t *s = HYPERVISOR_shared_info;
     synch_set_bit(port, &s->evtchn_mask[0]);
 }
+EXPORT_SYMBOL(mask_evtchn);
 
 inline void unmask_evtchn(uint32_t port)
 {
@@ -180,9 +183,11 @@ inline void unmask_evtchn(uint32_t port)
             force_evtchn_callback();
     }
 }
+EXPORT_SYMBOL(unmask_evtchn);
 
 inline void clear_evtchn(uint32_t port)
 {
     shared_info_t *s = HYPERVISOR_shared_info;
     synch_clear_bit(port, &s->evtchn_pending[0]);
 }
+EXPORT_SYMBOL(clear_evtchn);
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:55:45 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:55:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647200.1010028 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACET-00078C-Ip; Mon, 04 Dec 2023 16:55:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647200.1010028; Mon, 04 Dec 2023 16:55: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 1rACET-000781-G5; Mon, 04 Dec 2023 16:55:45 +0000
Received: by outflank-mailman (input) for mailman id 647200;
 Mon, 04 Dec 2023 16: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 1rACER-00077T-G0
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:55:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACER-0006sa-F0
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:55:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACER-0002hq-Bl
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:55:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ONy+Ok66SzymbvRQt8ysyhuLDT8jH3ZdlevyWUupP24=; b=bmh7IlDWITO8nuIthiUgDxcZ+n
	jXYpk0eYeSAV4KVoE0y/zoBpitI5WrbZ0jG0jU5/ce0O/azi3viSopZHipVOQUB8fJD+MXm4lhZk+
	3A/dj8gbOCTFam0Q9ArxAFNuYYWUi2Gqn8pNDKpkkEw4HQ3+7AqlDiW6ZKEkmcjwsw/8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to sched.c
Message-Id: <E1rACER-0002hq-Bl@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:55:43 +0000

commit 4cc4cbff6e3b9997a879b213fb57b7d2c932c39b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:24:56 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to sched.c
    
    Add the needed instances of EXPORT_SYMBOL() to sched.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 arch/x86/sched.c | 5 +++++
 sched.c          | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/arch/x86/sched.c b/arch/x86/sched.c
index e7b6954..dabe6fd 100644
--- a/arch/x86/sched.c
+++ b/arch/x86/sched.c
@@ -142,11 +142,13 @@ unsigned long __local_irq_save(void)
     local_irq_save(flags);
     return flags;
 }
+EXPORT_SYMBOL(__local_irq_save);
 
 void __local_irq_restore(unsigned long flags)
 {
     local_irq_restore(flags);
 }
+EXPORT_SYMBOL(__local_irq_restore);
 
 unsigned long __local_save_flags(void)
 {
@@ -155,13 +157,16 @@ unsigned long __local_save_flags(void)
     local_save_flags(flags);
     return flags;
 }
+EXPORT_SYMBOL(__local_save_flags);
 
 void __local_irq_disable(void)
 {
     local_irq_disable();
 }
+EXPORT_SYMBOL(__local_irq_disable);
 
 void __local_irq_enable(void)
 {
     local_irq_enable();
 }
+EXPORT_SYMBOL(__local_irq_enable);
diff --git a/sched.c b/sched.c
index 6f89ea4..e162cb6 100644
--- a/sched.c
+++ b/sched.c
@@ -128,6 +128,7 @@ void schedule(void)
         }
     }
 }
+EXPORT_SYMBOL(schedule);
 
 struct thread* create_thread(char *name, void (*function)(void *), void *data)
 {
@@ -147,6 +148,7 @@ struct thread* create_thread(char *name, void (*function)(void *), void *data)
     local_irq_restore(flags);
     return thread;
 }
+EXPORT_SYMBOL(create_thread);
 
 #ifdef HAVE_LIBC
 static struct _reent callback_reent;
@@ -184,6 +186,7 @@ struct _reent *__getreent(void)
 #endif
     return _reent;
 }
+EXPORT_SYMBOL(__getreent);
 #endif
 
 void exit_thread(void)
@@ -205,12 +208,14 @@ void exit_thread(void)
         printk("schedule() returned!  Trying again\n");
     }
 }
+EXPORT_SYMBOL(exit_thread);
 
 void block(struct thread *thread)
 {
     thread->wakeup_time = 0LL;
     clear_runnable(thread);
 }
+EXPORT_SYMBOL(block);
 
 void msleep(uint32_t millisecs)
 {
@@ -219,12 +224,14 @@ void msleep(uint32_t millisecs)
     clear_runnable(thread);
     schedule();
 }
+EXPORT_SYMBOL(msleep);
 
 void wake(struct thread *thread)
 {
     thread->wakeup_time = 0LL;
     set_runnable(thread);
 }
+EXPORT_SYMBOL(wake);
 
 void idle_thread_fn(void *unused)
 {
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:55:54 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:55:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647202.1010042 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACEc-0007UR-QN; Mon, 04 Dec 2023 16:55:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647202.1010042; Mon, 04 Dec 2023 16: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 1rACEc-0007UJ-NT; Mon, 04 Dec 2023 16:55:54 +0000
Received: by outflank-mailman (input) for mailman id 647202;
 Mon, 04 Dec 2023 16: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 1rACEb-0007Ta-Kv
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16: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 1rACEb-0006sm-K1
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:55:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACEb-0002kb-HC
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16: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=AhvqrqY9BBWukwe/o6rrNSZsgOcxvsHJl48KYaorXOw=; b=HOSrsHNJZIzE8R0eP0X5pPsHKp
	c5WOg/d4JpeXFFQTCARmLnbKHLo3LSx3XIWNr1lGbLQtAegSuLvXp3WbwvjePVa1huez9pczh+no5
	EE1hl5gEqXwotZVa/y8eAhzi8tbrQHmzQbWDuCB57i8ruTw+eWsLGgjYC4pwwOaNsLEQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to mm.c
Message-Id: <E1rACEb-0002kb-HC@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:55:53 +0000

commit 03b2803897204433c0872729c4669716530e4e68
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:24:57 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to mm.c
    
    Add the needed instances of EXPORT_SYMBOL() to mm.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 arch/arm/mm.c | 2 ++
 arch/x86/mm.c | 5 +++++
 mm.c          | 4 ++++
 3 files changed, 11 insertions(+)

diff --git a/arch/arm/mm.c b/arch/arm/mm.c
index 11962f8..c269ab1 100644
--- a/arch/arm/mm.c
+++ b/arch/arm/mm.c
@@ -85,6 +85,7 @@ int do_map_frames(unsigned long addr,
 {
     return -ENOSYS;
 }
+EXPORT_SYMBOL(do_map_frames);
 
 /* Get Xen's suggested physical page assignments for the grant table. */
 static paddr_t get_gnttab_base(void)
@@ -149,3 +150,4 @@ unsigned long map_frame_virt(unsigned long mfn)
 {
     return mfn_to_virt(mfn);
 }
+EXPORT_SYMBOL(map_frame_virt);
diff --git a/arch/x86/mm.c b/arch/x86/mm.c
index cfc978f..767a5f0 100644
--- a/arch/x86/mm.c
+++ b/arch/x86/mm.c
@@ -493,6 +493,7 @@ pgentry_t *need_pgt(unsigned long va)
     offset = l1_table_offset(va);
     return &tab[offset];
 }
+EXPORT_SYMBOL(need_pgt);
 
 /*
  * Reserve an area of virtual address space for mappings and Heap
@@ -634,6 +635,7 @@ int do_map_frames(unsigned long va,
 
     return 0;
 }
+EXPORT_SYMBOL(do_map_frames);
 
 /*
  * Map an array of MFNs contiguous into virtual address space. Virtual
@@ -654,6 +656,7 @@ void *map_frames_ex(const unsigned long *mfns, unsigned long n,
 
     return (void *)va;
 }
+EXPORT_SYMBOL(map_frames_ex);
 
 /*
  * Unmap nun_frames frames mapped at virtual address va.
@@ -724,6 +727,7 @@ int unmap_frames(unsigned long va, unsigned long num_frames)
     }
     return 0;
 }
+EXPORT_SYMBOL(unmap_frames);
 
 /*
  * Clear some of the bootstrap memory
@@ -859,3 +863,4 @@ unsigned long map_frame_virt(unsigned long mfn)
 
     return addr;
 }
+EXPORT_SYMBOL(map_frame_virt);
diff --git a/mm.c b/mm.c
index 6493bdd..eb0e34d 100644
--- a/mm.c
+++ b/mm.c
@@ -280,6 +280,7 @@ unsigned long alloc_pages(int order)
 
     return 0;
 }
+EXPORT_SYMBOL(alloc_pages);
 
 void free_pages(void *pointer, int order)
 {
@@ -336,6 +337,7 @@ void free_pages(void *pointer, int order)
     free_head[order] = freed_ch;   
    
 }
+EXPORT_SYMBOL(free_pages);
 
 int free_physical_pages(xen_pfn_t *mfns, int n)
 {
@@ -352,6 +354,7 @@ int map_frame_rw(unsigned long addr, unsigned long mfn)
 {
     return do_map_frames(addr, &mfn, 1, 1, 1, DOMID_SELF, NULL, L1_PROT);
 }
+EXPORT_SYMBOL(map_frame_rw);
 
 #ifdef HAVE_LIBC
 void *sbrk(ptrdiff_t increment)
@@ -385,6 +388,7 @@ void *sbrk(ptrdiff_t increment)
 
     return (void *) old_brk;
 }
+EXPORT_SYMBOL(sbrk);
 #endif
 
 
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:56:04 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:56:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647203.1010046 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACEm-0007cb-Rf; Mon, 04 Dec 2023 16:56:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647203.1010046; Mon, 04 Dec 2023 16: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 1rACEm-0007cS-Ov; Mon, 04 Dec 2023 16:56:04 +0000
Received: by outflank-mailman (input) for mailman id 647203;
 Mon, 04 Dec 2023 16: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 1rACEl-0007bu-O7
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16: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 1rACEl-0006tF-NE
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:56:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACEl-0002wO-MK
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16: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=pLcXpVOG+HX0ypQ5z1Z9bbsNESoe8GqWL2k5mAPdS7Y=; b=5JDjBHed9S27YrEv9BSMP6bjZm
	cP9GJ726wFxpVG0hNu4rHPY4P/DzhvOUZAjDNeGuBUq56v/wFgP52S5X5+PJpCKE0w1NqQ+mE9x7+
	hLFhr/RP41VWdILfVAUr+WHYHK+qqG+CM8WNRxMcjxIE0Fzl2PM7OcVg9WEEZ6pGa0cs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to lib/sys.c
Message-Id: <E1rACEl-0002wO-MK@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:56:03 +0000

commit 4054da021186becc9a60064b56bc452a066a5161
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:24:58 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to lib/sys.c
    
    Add the needed instances of EXPORT_SYMBOL() to lib/sys.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 lib/sys.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 87 insertions(+), 5 deletions(-)

diff --git a/lib/sys.c b/lib/sys.c
index 118fc44..481067f 100644
--- a/lib/sys.c
+++ b/lib/sys.c
@@ -20,6 +20,7 @@
 
 #ifdef HAVE_LIBC
 #include <os.h>
+#include <export.h>
 #include <string.h>
 #include <console.h>
 #include <sched.h>
@@ -63,7 +64,8 @@
     { \
 	print_unsupported(#function); \
 	do_exit(); \
-    }
+    } \
+    EXPORT_SYMBOL(function)
 
 /* Log and err out on function call */
 #define unsupported_function_log(type, function, ret) \
@@ -73,7 +75,8 @@
 	print_unsupported(#function); \
 	errno = ENOSYS; \
 	return ret; \
-    }
+    } \
+    EXPORT_SYMBOL(function)
 
 /* Err out on function call */
 #define unsupported_function(type, function, ret) \
@@ -82,7 +85,8 @@
     { \
 	errno = ENOSYS; \
 	return ret; \
-    }
+    } \
+    EXPORT_SYMBOL(function)
 
 #define NOFILE 32
 #define N_MOUNTS  16
@@ -187,6 +191,7 @@ unsigned int alloc_file_type(const struct file_ops *ops)
 
     return ret;
 }
+EXPORT_SYMBOL(alloc_file_type);
 
 static const struct file_ops *get_file_ops(unsigned int type)
 {
@@ -203,8 +208,10 @@ struct file *get_file_from_fd(int fd)
 
     return (files[fd].type == FTYPE_NONE) ? NULL : files + fd;
 }
+EXPORT_SYMBOL(get_file_from_fd);
 
 DECLARE_WAIT_QUEUE_HEAD(event_queue);
+EXPORT_SYMBOL(event_queue);
 
 int alloc_fd(unsigned int type)
 {
@@ -222,6 +229,7 @@ int alloc_fd(unsigned int type)
     printk("Too many opened files\n");
     do_exit();
 }
+EXPORT_SYMBOL(alloc_fd);
 
 void close_all_files(void)
 {
@@ -232,6 +240,7 @@ void close_all_files(void)
             close(i);
     pthread_mutex_unlock(&fd_lock);
 }
+EXPORT_SYMBOL(close_all_files);
 
 int dup2(int oldfd, int newfd)
 {
@@ -243,33 +252,39 @@ int dup2(int oldfd, int newfd)
     pthread_mutex_unlock(&fd_lock);
     return 0;
 }
+EXPORT_SYMBOL(dup2);
 
 pid_t getpid(void)
 {
     return 1;
 }
+EXPORT_SYMBOL(getpid);
 
 pid_t getppid(void)
 {
     return 1;
 }
+EXPORT_SYMBOL(getppid);
 
 pid_t setsid(void)
 {
     return 1;
 }
+EXPORT_SYMBOL(setsid);
 
 char *getcwd(char *buf, size_t size)
 {
     snprintf(buf, size, "/");
     return buf;
 }
+EXPORT_SYMBOL(getcwd);
 
 int mkdir(const char *pathname, mode_t mode)
 {
     errno = EIO;
     return -1;
 }
+EXPORT_SYMBOL(mkdir);
 
 #ifdef CONFIG_CONSFRONT
 int posix_openpt(int flags)
@@ -282,6 +297,7 @@ int posix_openpt(int flags)
 
     return fd;
 }
+EXPORT_SYMBOL(posix_openpt);
 
 static int open_pt(struct mount_point *mnt, const char *pathname, int flags,
                    mode_t mode)
@@ -313,6 +329,8 @@ int posix_openpt(int flags)
 	errno = EIO;
 	return -1;
 }
+EXPORT_SYMBOL(posix_openpt);
+
 int open_savefile(const char *path, int save)
 {
 	errno = EIO;
@@ -378,6 +396,8 @@ int open(const char *pathname, int flags, ...)
     errno = EIO;
     return -1;
 }
+EXPORT_SYMBOL(open);
+EXPORT_SYMBOL(open64);
 
 int mount(const char *path, void *dev,
           int (*open)(struct mount_point *, const char *, int, mode_t))
@@ -422,6 +442,7 @@ int isatty(int fd)
 {
     return files[fd].type == FTYPE_CONSOLE;
 }
+EXPORT_SYMBOL(isatty);
 
 int read(int fd, void *buf, size_t nbytes)
 {
@@ -440,6 +461,7 @@ int read(int fd, void *buf, size_t nbytes)
     errno = EBADF;
     return -1;
 }
+EXPORT_SYMBOL(read);
 
 int write(int fd, const void *buf, size_t nbytes)
 {
@@ -458,6 +480,7 @@ int write(int fd, const void *buf, size_t nbytes)
     errno = EBADF;
     return -1;
 }
+EXPORT_SYMBOL(write);
 
 off_t lseek_default(struct file *file, off_t offset, int whence)
 {
@@ -510,11 +533,14 @@ off_t lseek(int fd, off_t offset, int whence)
     errno = ESPIPE;
     return (off_t) -1;
 }
+EXPORT_SYMBOL(lseek);
+EXPORT_SYMBOL(lseek64);
 
 int fsync(int fd) {
     errno = EBADF;
     return -1;
 }
+EXPORT_SYMBOL(fsync);
 
 int close(int fd)
 {
@@ -542,6 +568,7 @@ int close(int fd)
     errno = EBADF;
     return -1;
 }
+EXPORT_SYMBOL(close);
 
 static void init_stat(struct stat *buf)
 {
@@ -559,6 +586,7 @@ int stat(const char *path, struct stat *buf)
     errno = EIO;
     return -1;
 }
+EXPORT_SYMBOL(stat);
 
 int fstat(int fd, struct stat *buf)
 {
@@ -579,28 +607,34 @@ int fstat(int fd, struct stat *buf)
     errno = EBADF;
     return -1;
 }
+EXPORT_SYMBOL(fstat);
+EXPORT_SYMBOL(fstat64);
 
 int ftruncate(int fd, off_t length)
 {
     errno = EBADF;
     return -1;
 }
+EXPORT_SYMBOL(ftruncate);
 
 int remove(const char *pathname)
 {
     errno = EIO;
     return -1;
 }
+EXPORT_SYMBOL(remove);
 
 int unlink(const char *pathname)
 {
     return remove(pathname);
 }
+EXPORT_SYMBOL(unlink);
 
 int rmdir(const char *pathname)
 {
     return remove(pathname);
 }
+EXPORT_SYMBOL(rmdir);
 
 int fcntl(int fd, int cmd, ...)
 {
@@ -635,6 +669,7 @@ int fcntl(int fd, int cmd, ...)
     errno = ENOSYS;
     return -1;
 }
+EXPORT_SYMBOL(fcntl);
 
 DIR *opendir(const char *name)
 {
@@ -648,11 +683,13 @@ DIR *opendir(const char *name)
     ret->has_more = 1;
     return ret;
 }
+EXPORT_SYMBOL(opendir);
 
 struct dirent *readdir(DIR *dir)
 {
     return NULL;
 } 
+EXPORT_SYMBOL(readdir);
 
 int closedir(DIR *dir)
 {
@@ -664,6 +701,7 @@ int closedir(DIR *dir)
     free(dir);
     return 0;
 }
+EXPORT_SYMBOL(closedir);
 
 /* We assume that only the main thread calls select(). */
 
@@ -732,6 +770,7 @@ bool select_read_flag(struct file *file)
 {
     return file->read;
 }
+EXPORT_SYMBOL(select_read_flag);
 
 /* Just poll without blocking */
 static int select_poll(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds)
@@ -1044,6 +1083,7 @@ out:
     remove_waiter(console_w, console_queue);
     return ret;
 }
+EXPORT_SYMBOL(select);
 
 /* Wrap around select */
 int poll(struct pollfd _pfd[], nfds_t _nfds, int _timeout)
@@ -1136,6 +1176,7 @@ int poll(struct pollfd _pfd[], nfds_t _nfds, int _timeout)
 
     return n;
 }
+EXPORT_SYMBOL(poll);
 
 #ifdef HAVE_LWIP
 int socket(int domain, int type, int protocol)
@@ -1149,6 +1190,7 @@ int socket(int domain, int type, int protocol)
     files[res].fd = fd;
     return res;
 }
+EXPORT_SYMBOL(socket);
 
 int accept(int s, struct sockaddr *addr, socklen_t *addrlen)
 {
@@ -1166,6 +1208,7 @@ int accept(int s, struct sockaddr *addr, socklen_t *addrlen)
     printk("accepted on %d -> %d\n", s, res);
     return res;
 }
+EXPORT_SYMBOL(accept);
 
 #define LWIP_STUB(ret, name, proto, args) \
 ret name proto \
@@ -1180,15 +1223,25 @@ ret name proto \
 }
 
 LWIP_STUB(int, bind, (int s, struct sockaddr *my_addr, socklen_t addrlen), (s, my_addr, addrlen))
+EXPORT_SYMBOL(bind);
 LWIP_STUB(int, getsockopt, (int s, int level, int optname, void *optval, socklen_t *optlen), (s, level, optname, optval, optlen))
+EXPORT_SYMBOL(getsockopt);
 LWIP_STUB(int, setsockopt, (int s, int level, int optname, void *optval, socklen_t optlen), (s, level, optname, optval, optlen))
+EXPORT_SYMBOL(setsockopt);
 LWIP_STUB(int, connect, (int s, struct sockaddr *serv_addr, socklen_t addrlen), (s, serv_addr, addrlen))
+EXPORT_SYMBOL(connect);
 LWIP_STUB(int, listen, (int s, int backlog), (s, backlog));
+EXPORT_SYMBOL(listen);
 LWIP_STUB(ssize_t, recv, (int s, void *buf, size_t len, int flags), (s, buf, len, flags))
+EXPORT_SYMBOL(recv);
 LWIP_STUB(ssize_t, recvfrom, (int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen), (s, buf, len, flags, from, fromlen))
+EXPORT_SYMBOL(recvfrom);
 LWIP_STUB(ssize_t, send, (int s, void *buf, size_t len, int flags), (s, buf, len, flags))
+EXPORT_SYMBOL(send);
 LWIP_STUB(ssize_t, sendto, (int s, void *buf, size_t len, int flags, struct sockaddr *to, socklen_t tolen), (s, buf, len, flags, to, tolen))
+EXPORT_SYMBOL(sendto);
 LWIP_STUB(int, getsockname, (int s, struct sockaddr *name, socklen_t *namelen), (s, name, namelen))
+EXPORT_SYMBOL(getsockname);
 #endif
 
 static char *syslog_ident;
@@ -1197,12 +1250,14 @@ void openlog(const char *ident, int option, int facility)
     free(syslog_ident);
     syslog_ident = strdup(ident);
 }
+EXPORT_SYMBOL(openlog);
 
 void vsyslog(int priority, const char *format, va_list ap)
 {
     printk("%s: ", syslog_ident);
     print(0, format, ap);
 }
+EXPORT_SYMBOL(vsyslog);
 
 void syslog(int priority, const char *format, ...)
 {
@@ -1211,12 +1266,14 @@ void syslog(int priority, const char *format, ...)
     vsyslog(priority, format, ap);
     va_end(ap);
 }
+EXPORT_SYMBOL(syslog);
 
 void closelog(void)
 {
     free(syslog_ident);
     syslog_ident = NULL;
 }
+EXPORT_SYMBOL(closelog);
 
 void vwarn(const char *format, va_list ap)
 {
@@ -1228,6 +1285,7 @@ void vwarn(const char *format, va_list ap)
     }
     printk("%s", strerror(the_errno));
 }
+EXPORT_SYMBOL(vwarn);
 
 void warn(const char *format, ...)
 {
@@ -1236,12 +1294,14 @@ void warn(const char *format, ...)
     vwarn(format, ap);
     va_end(ap);
 }
+EXPORT_SYMBOL(warn);
 
 void verr(int eval, const char *format, va_list ap)
 {
     vwarn(format, ap);
     exit(eval);
 }
+EXPORT_SYMBOL(verr);
 
 void err(int eval, const char *format, ...)
 {
@@ -1250,6 +1310,7 @@ void err(int eval, const char *format, ...)
     verr(eval, format, ap);
     va_end(ap);
 }
+EXPORT_SYMBOL(err);
 
 void vwarnx(const char *format, va_list ap)
 {
@@ -1257,6 +1318,7 @@ void vwarnx(const char *format, va_list ap)
     if (format)
         print(0, format, ap);
 }
+EXPORT_SYMBOL(vwarnx);
 
 void warnx(const char *format, ...)
 {
@@ -1265,12 +1327,14 @@ void warnx(const char *format, ...)
     vwarnx(format, ap);
     va_end(ap);
 }
+EXPORT_SYMBOL(warnx);
 
 void verrx(int eval, const char *format, va_list ap)
 {
     vwarnx(format, ap);
     exit(eval);
 }
+EXPORT_SYMBOL(verrx);
 
 void errx(int eval, const char *format, ...)
 {
@@ -1279,6 +1343,7 @@ void errx(int eval, const char *format, ...)
     verrx(eval, format, ap);
     va_end(ap);
 }
+EXPORT_SYMBOL(errx);
 
 int nanosleep(const struct timespec *req, struct timespec *rem)
 {
@@ -1304,6 +1369,7 @@ int nanosleep(const struct timespec *req, struct timespec *rem)
 
     return 0;
 }
+EXPORT_SYMBOL(nanosleep);
 
 int usleep(useconds_t usec)
 {
@@ -1317,6 +1383,7 @@ int usleep(useconds_t usec)
 
     return 0;
 }
+EXPORT_SYMBOL(usleep);
 
 unsigned int sleep(unsigned int seconds)
 {
@@ -1332,6 +1399,7 @@ unsigned int sleep(unsigned int seconds)
 
     return rem.tv_sec;
 }
+EXPORT_SYMBOL(sleep);
 
 int clock_gettime(clockid_t clk_id, struct timespec *tp)
 {
@@ -1364,37 +1432,44 @@ int clock_gettime(clockid_t clk_id, struct timespec *tp)
 
     return 0;
 }
+EXPORT_SYMBOL(clock_gettime);
 
 uid_t getuid(void)
 {
 	return 0;
 }
+EXPORT_SYMBOL(getuid);
 
 uid_t geteuid(void)
 {
 	return 0;
 }
+EXPORT_SYMBOL(geteuid);
 
 gid_t getgid(void)
 {
 	return 0;
 }
+EXPORT_SYMBOL(getgid);
 
 gid_t getegid(void)
 {
 	return 0;
 }
+EXPORT_SYMBOL(getegid);
 
 int gethostname(char *name, size_t namelen)
 {
 	strncpy(name, "mini-os", namelen);
 	return 0;
 }
+EXPORT_SYMBOL(gethostname);
 
 size_t getpagesize(void)
 {
     return PAGE_SIZE;
 }
+EXPORT_SYMBOL(getpagesize);
 
 void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset)
 {
@@ -1412,6 +1487,8 @@ void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset
         return map_frames_ex(&first_mfn, n, 0, 1, 1, DOMID_IO, NULL, _PAGE_PRESENT|_PAGE_RW);
     } else ASSERT(0);
 }
+EXPORT_SYMBOL(mmap);
+EXPORT_SYMBOL(mmap64);
 
 int munmap(void *start, size_t length)
 {
@@ -1425,6 +1502,7 @@ int munmap(void *start, size_t length)
     }
     return 0;
 }
+EXPORT_SYMBOL(munmap);
 
 void sparse(unsigned long data, size_t size)
 {
@@ -1465,6 +1543,7 @@ int nice(int inc)
     printk("nice() stub called with inc=%d\n", inc);
     return 0;
 }
+EXPORT_SYMBOL(nice);
 
 /* Limited termios terminal settings support */
 const struct termios default_termios = {0,             /* iflag */
@@ -1512,6 +1591,7 @@ int tcsetattr(int fildes, int action, const struct termios *tios)
 
     return 0;
 }
+EXPORT_SYMBOL(tcsetattr);
 
 int tcgetattr(int fildes, struct termios *tios)
 {
@@ -1545,6 +1625,7 @@ int tcgetattr(int fildes, struct termios *tios)
 
     return 0;
 }
+EXPORT_SYMBOL(tcgetattr);
 
 void cfmakeraw(struct termios *tios)
 {
@@ -1555,6 +1636,7 @@ void cfmakeraw(struct termios *tios)
     tios->c_cflag &= ~(CSIZE | PARENB);
     tios->c_cflag |= CS8;
 }
+EXPORT_SYMBOL(cfmakeraw);
 
 /* Not supported by FS yet.  */
 unsupported_function_crash(link);
@@ -1659,8 +1741,8 @@ unsupported_function_log(int, ftruncate64, -1);
 unsupported_function_log(int, fchown, -1);
 unsupported_function_log(int, fchmod, -1);
 unsupported_function_crash(execvp);
-unsupported_function_log(int, dup, -1)
-unsupported_function_log(int, chroot, -1)
+unsupported_function_log(int, dup, -1);
+unsupported_function_log(int, chroot, -1);
 unsupported_function_log(int, chown, -1);
 unsupported_function_log(int, chmod, -1);
 unsupported_function_crash(alarm);
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:56:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:56:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647205.1010050 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACEw-0007mv-Uc; Mon, 04 Dec 2023 16:56:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647205.1010050; Mon, 04 Dec 2023 16: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 1rACEw-0007ml-Rm; Mon, 04 Dec 2023 16:56:14 +0000
Received: by outflank-mailman (input) for mailman id 647205;
 Mon, 04 Dec 2023 16: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 1rACEv-0007mZ-R9
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16: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 1rACEv-0006tM-QN
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:56:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACEv-0003WA-PY
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16: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=x5HvBW4I0CK/a4gJYXJPcQM3YcA2n0y1DRHjyXPAPFU=; b=E7DzhYYTzY2CmFb1LaeLMdJCcF
	CRS+uy/omI5unB4QQ8m8wqF4VAPBhM/48/wPjzrNg026U/rY35L/O0ayzn4Jaz1YVRN86UiMiKXXA
	l/mM2NBd87l3CPD/Wahap2/8pmyDCigIR+GXCZuz+AARTvZGgqehSwmqP5/B5PvM0Lr4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to lib/string.c
Message-Id: <E1rACEv-0003WA-PY@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:56:13 +0000

commit f978a0ad3b83cd2c4d08f10c2eabe6031b7c071b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:24:59 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to lib/string.c
    
    Add the needed instances of EXPORT_SYMBOL() to lib/string.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 lib/string.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/lib/string.c b/lib/string.c
index 8b24146..b0b628c 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -19,6 +19,7 @@
  */
 
 #include <strings.h>
+#include <mini-os/export.h>
 
 /* newlib defines ffs but not ffsll or ffsl */
 int __ffsti2 (long long int lli)
@@ -49,11 +50,13 @@ int ffsl (long int li)
 {
     return __ffsti2 ((long long int) li);
 }
+EXPORT_SYMBOL(ffsl);
 
 int ffsll (long long int lli)
 {
     return __ffsti2 (lli);
 }
+EXPORT_SYMBOL(ffsll);
 
 #if !defined HAVE_LIBC
 
@@ -72,6 +75,7 @@ int memcmp(const void * cs,const void * ct,size_t count)
 			break;
 	return res;
 }
+EXPORT_SYMBOL(memcmp);
 
 void * memcpy(void * dest,const void *src,size_t count)
 {
@@ -83,6 +87,7 @@ void * memcpy(void * dest,const void *src,size_t count)
 
 	return dest;
 }
+EXPORT_SYMBOL(memcpy);
 
 int strncmp(const char * cs,const char * ct,size_t count)
 {
@@ -96,6 +101,7 @@ int strncmp(const char * cs,const char * ct,size_t count)
 
 	return __res;
 }
+EXPORT_SYMBOL(strncmp);
 
 int strcmp(const char * cs,const char * ct)
 {
@@ -108,6 +114,7 @@ int strcmp(const char * cs,const char * ct)
 
         return __res;
 }
+EXPORT_SYMBOL(strcmp);
 
 char * strcpy(char * dest,const char *src)
 {
@@ -117,6 +124,7 @@ char * strcpy(char * dest,const char *src)
                 /* nothing */;
         return tmp;
 }
+EXPORT_SYMBOL(strcpy);
 
 char * strncpy(char * dest,const char *src,size_t count)
 {
@@ -127,6 +135,7 @@ char * strncpy(char * dest,const char *src,size_t count)
 
         return tmp;
 }
+EXPORT_SYMBOL(strncpy);
 
 void * memset(void * s,int c,size_t count)
 {
@@ -137,6 +146,7 @@ void * memset(void * s,int c,size_t count)
 
         return s;
 }
+EXPORT_SYMBOL(memset);
 
 size_t strnlen(const char * s, size_t count)
 {
@@ -146,6 +156,7 @@ size_t strnlen(const char * s, size_t count)
                 /* nothing */;
         return sc - s;
 }
+EXPORT_SYMBOL(strnlen);
 
 
 char * strcat(char * dest, const char * src)
@@ -159,6 +170,7 @@ char * strcat(char * dest, const char * src)
     
     return tmp;
 }
+EXPORT_SYMBOL(strcat);
 
 size_t strlen(const char * s)
 {
@@ -168,6 +180,7 @@ size_t strlen(const char * s)
 		/* nothing */;
 	return sc - s;
 }
+EXPORT_SYMBOL(strlen);
 
 char * strchr(const char * s, int c)
 {
@@ -176,6 +189,7 @@ char * strchr(const char * s, int c)
                         return NULL;
         return (char *)s;
 }
+EXPORT_SYMBOL(strchr);
 
 char * strrchr(const char * s, int c)
 {
@@ -185,6 +199,7 @@ char * strrchr(const char * s, int c)
                         res = s;
         return (char *)res;
 }
+EXPORT_SYMBOL(strrchr);
 
 char * strstr(const char * s1,const char * s2)
 {
@@ -202,6 +217,7 @@ char * strstr(const char * s1,const char * s2)
         }
         return NULL;
 }
+EXPORT_SYMBOL(strstr);
 
 char *strdup(const char *x)
 {
@@ -211,6 +227,7 @@ char *strdup(const char *x)
     memcpy(res, x, l + 1);
     return res;
 }
+EXPORT_SYMBOL(strdup);
 
 int ffs(int i)
 {
@@ -224,5 +241,6 @@ int ffs(int i)
    } while (i);
    return 0;
 }
+EXPORT_SYMBOL(ffs);
 
 #endif
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:56:25 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:56:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647207.1010054 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACF6-0007rq-Vr; Mon, 04 Dec 2023 16:56:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647207.1010054; Mon, 04 Dec 2023 16:56:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACF6-0007ri-TA; Mon, 04 Dec 2023 16:56:24 +0000
Received: by outflank-mailman (input) for mailman id 647207;
 Mon, 04 Dec 2023 16: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 1rACF5-0007rU-UG
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16: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 1rACF5-0006tT-TO
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:56:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACF5-0003Xb-SP
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16: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=+6PkVa/XbcR1+CN1ENDDlWO8DBkNNAGtxiexMDK4Mo0=; b=u++2NlDevPEyxOp7A57Ls04h+v
	FyHZrsUgxsIJ7LkTuqkeEv+sbf4MmZNpppy4aERhqi8C0cjenetcK8yHWmqR2ybmKyXi9JJn9gDa3
	Tq66DWnB0Cke2hG/ApWHpwdmCxeLrOJO0bYt17knv60vS6V1NeB1tCdAuYb8tlBpokv8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to lib/math.c
Message-Id: <E1rACF5-0003Xb-SP@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:56:23 +0000

commit 416e6dd51c7a44ace2a57206a365783ea440fb71
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:00 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to lib/math.c
    
    Add the needed instances of EXPORT_SYMBOL() to lib/math.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 lib/math.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/math.c b/lib/math.c
index b98cc1d..9ee9fcd 100644
--- a/lib/math.c
+++ b/lib/math.c
@@ -338,6 +338,7 @@ __qdivrem(u_quad_t uq, u_quad_t vq, u_quad_t *arq)
 	tmp.ul[L] = COMBINE(qspace[3], qspace[4]);
 	return (tmp.q);
 }
+EXPORT_SYMBOL(__qdivrem);
 
 /*
  * From
@@ -365,6 +366,7 @@ __divdi3(quad_t a, quad_t b)
 	uq = __qdivrem(ua, ub, (u_quad_t *)0);
 	return (neg ? -uq : uq);
 }
+EXPORT_SYMBOL(__divdi3);
 
 /*
  * From
@@ -379,6 +381,7 @@ __udivdi3(u_quad_t a, u_quad_t b)
 {
 	return (__qdivrem(a, b, (u_quad_t *)0));
 }
+EXPORT_SYMBOL(__udivdi3);
 
 /*
  * From
@@ -396,6 +399,7 @@ __umoddi3(u_quad_t a, u_quad_t b)
 	(void)__qdivrem(a, b, &r);
 	return (r);
 }
+EXPORT_SYMBOL(__umoddi3);
 
 /*
  * Returns the quotient and places remainder in r
@@ -405,6 +409,7 @@ __udivmoddi4(u_quad_t a, u_quad_t b, u_quad_t *r)
 {
 	return __qdivrem(a, b, r);
 }
+EXPORT_SYMBOL(__udivmoddi4);
 
 /*
  * From
@@ -434,3 +439,4 @@ __moddi3(quad_t a, quad_t b)
 	(void)__qdivrem(ua, ub, &ur);
 	return (neg ? -ur : ur);
 }
+EXPORT_SYMBOL(__moddi3);
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:56:35 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:56:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647209.1010068 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACFH-0008BV-De; Mon, 04 Dec 2023 16:56:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647209.1010068; Mon, 04 Dec 2023 16:56: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 1rACFH-0008BN-Ao; Mon, 04 Dec 2023 16:56:35 +0000
Received: by outflank-mailman (input) for mailman id 647209;
 Mon, 04 Dec 2023 16:56: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 1rACFG-0007ua-1I
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:56: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 1rACFG-0006v9-0B
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:56:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACFF-0003YF-VV
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16: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=cel3kYe5wjNsdApEPjX/wDCWD7aLP24Ds7f+GxUPpps=; b=ofvpSZLFx2N4yIIvovjhx+75R6
	9xw1A+dzyIBfXw8x6o7NMqlxZc8qkwXLWkHm4MHHvk8oPN+WUU6lcHBwh9Y04KpuR1HLqBUrEil/M
	M5E4jlG6YhnNNa1ZiVlSCuBOqeF/l8cE/JXtspM/8zOEBpi3JRjaGnUSoxhfwDGVywHg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to lib/printf.c
Message-Id: <E1rACFF-0003YF-VV@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:56:33 +0000

commit dc03eceb97b117e2f3aae2aa4beada10aaa650b1
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:01 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to lib/printf.c
    
    Add the needed instances of EXPORT_SYMBOL() to lib/printf.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 lib/printf.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/printf.c b/lib/printf.c
index f9e9d68..0e05495 100644
--- a/lib/printf.c
+++ b/lib/printf.c
@@ -150,6 +150,7 @@ strtoul(const char *nptr, char **endptr, int base)
                 *endptr = __DECONST(char *, any ? s - 1 : nptr);
         return (acc);
 }
+EXPORT_SYMBOL(strtoul);
 
 /*
  * Convert a string to a quad integer.
@@ -241,6 +242,7 @@ strtoq(const char *nptr, char **endptr, int base)
                 *endptr = __DECONST(char *, any ? s - 1 : nptr);
         return (acc);
 }
+EXPORT_SYMBOL(strtoq);
 
 /*
  * Convert a string to an unsigned quad integer.
@@ -309,6 +311,7 @@ strtouq(const char *nptr, char **endptr, int base)
                 *endptr = __DECONST(char *, any ? s - 1 : nptr);
         return (acc);
 }
+EXPORT_SYMBOL(strtouq);
 
 /*
  * Scaled down version of printf(3).
@@ -585,6 +588,7 @@ number:
         }
 #undef PCHAR
 }
+EXPORT_SYMBOL(vsnprintf);
 
 /**
  * snprintf - Format a string and place it in a buffer
@@ -603,6 +607,7 @@ int snprintf(char * buf, size_t size, const char *fmt, ...)
     va_end(args);
     return i;
 }
+EXPORT_SYMBOL(snprintf);
 
 /**
  * vsprintf - Format a string and place it in a buffer
@@ -617,7 +622,7 @@ int vsprintf(char *buf, const char *fmt, va_list args)
 {
     return vsnprintf(buf, 0xFFFFFFFFUL, fmt, args);
 }
-
+EXPORT_SYMBOL(vsprintf);
 
 /**
  * sprintf - Format a string and place it in a buffer
@@ -635,6 +640,7 @@ int sprintf(char * buf, const char *fmt, ...)
     va_end(args);
     return i;
 }
+EXPORT_SYMBOL(sprintf);
 
 /*
  * Fill in the given table from the scanset at the given format
@@ -1214,6 +1220,7 @@ input_failure:
 match_failure:
         return (nassigned);
 }
+EXPORT_SYMBOL(vsscanf);
 
 /**
  * sscanf - Unformat a buffer into a list of arguments
@@ -1231,5 +1238,6 @@ int sscanf(const char * buf, const char * fmt, ...)
 	va_end(args);
 	return i;
 }
+EXPORT_SYMBOL(sscanf);
 
 #endif
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:56:45 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:56:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647210.1010071 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACFR-0008MH-Ek; Mon, 04 Dec 2023 16:56:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647210.1010071; Mon, 04 Dec 2023 16:56:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACFR-0008M6-CA; Mon, 04 Dec 2023 16:56:45 +0000
Received: by outflank-mailman (input) for mailman id 647210;
 Mon, 04 Dec 2023 16:56: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 1rACFQ-0008LR-40
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:56: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 1rACFQ-0006vg-3B
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:56:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACFQ-0003Yi-24
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:56: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=XwqVYFCAiDZ/NSeaQHcc0gM7/aRYOFaTn1pDI/lBDTQ=; b=CAbkax2JfKGcfJRZg1yAZN66Kg
	qCRD50hGO1nRDfFk6rfQYLjSLJMwZOupM7Te5NqYRRQROqt3bKPJS7dJV0kVY0mjkn2shzyks5Jtp
	wYFilputcLgJqS+z2VVejNUHC3HczP+aOpnnkomRyMjoyCoVgtxEdI9VWQQwIIpqz8ok=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to lib/ctype.c
Message-Id: <E1rACFQ-0003Yi-24@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:56:44 +0000

commit d572fac23e754a96ec4c3a36f3db165474e76176
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:02 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to lib/ctype.c
    
    Add the needed instances of EXPORT_SYMBOL() to lib/ctype.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 lib/ctype.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/ctype.c b/lib/ctype.c
index 3f3bdb0..309ebbc 100644
--- a/lib/ctype.c
+++ b/lib/ctype.c
@@ -1,5 +1,6 @@
 #ifndef HAVE_LIBC
 #include <ctype.h>
+#include <mini-os/export.h>
 
 unsigned char _ctype[] = {
 _C,_C,_C,_C,_C,_C,_C,_C,                        /* 0-7 */
@@ -26,4 +27,5 @@ _U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,       /* 192-207 */
 _U,_U,_U,_U,_U,_U,_U,_P,_U,_U,_U,_U,_U,_U,_U,_L,       /* 208-223 */
 _L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,       /* 224-239 */
 _L,_L,_L,_L,_L,_L,_L,_P,_L,_L,_L,_L,_L,_L,_L,_L};      /* 240-255 */
+EXPORT_SYMBOL(_ctype);
 #endif
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:56:55 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:56:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647212.1010076 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACFb-0000CE-G6; Mon, 04 Dec 2023 16:56:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647212.1010076; Mon, 04 Dec 2023 16: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 1rACFb-0000C6-DZ; Mon, 04 Dec 2023 16:56:55 +0000
Received: by outflank-mailman (input) for mailman id 647212;
 Mon, 04 Dec 2023 16:56: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 1rACFa-0000BY-6q
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:56: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 1rACFa-0006w6-67
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:56:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACFa-0003Z8-5B
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:56: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=YC5KyzGXSpvc3ubrF69hd3zyk9bAYIc2S99QLKuEpQs=; b=HP//tr++uC/qWaR56TSVEtawH9
	KBdXvXcjQiIeUtO9DGcHWg45V+CIlTrm/pKqt3CohpZLW9mz3tRJYua++MozCjmYj23cLC/ZdsxFr
	o4Qn5N64bixg1SaT1Sj16RLV0zjUHyt2CA5AFDz4GYhWheoSUEHidwq47Yp82bC3heqg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to lib/xmalloc.c
Message-Id: <E1rACFa-0003Z8-5B@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:56:54 +0000

commit a422097480393eca10d1de412d3246bb157761e2
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:03 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to lib/xmalloc.c
    
    Add the needed instances of EXPORT_SYMBOL() to lib/xmalloc.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 lib/xmalloc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/xmalloc.c b/lib/xmalloc.c
index e16f161..cc5db11 100644
--- a/lib/xmalloc.c
+++ b/lib/xmalloc.c
@@ -271,6 +271,7 @@ void *malloc(size_t size)
 {
     return _xmalloc(size, DEFAULT_ALIGN);
 }
+EXPORT_SYMBOL(malloc);
 
 void *realloc(void *ptr, size_t size)
 {
@@ -301,11 +302,13 @@ void *realloc(void *ptr, size_t size)
 
     return new;
 }
+EXPORT_SYMBOL(realloc);
 
 void free(void *ptr)
 {
     xfree(ptr);
 }
+EXPORT_SYMBOL(free);
 #endif
 
 /*
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:57:05 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:57:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647214.1010080 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACFl-0000J2-HZ; Mon, 04 Dec 2023 16:57:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647214.1010080; Mon, 04 Dec 2023 16:57: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 1rACFl-0000Iu-Et; Mon, 04 Dec 2023 16:57:05 +0000
Received: by outflank-mailman (input) for mailman id 647214;
 Mon, 04 Dec 2023 16:57: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 1rACFk-0000I6-9m
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:57: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 1rACFk-0006we-91
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:57:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACFk-0003bO-8G
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:57: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=QO6YSlyXjRfG7FVqMf82oBuMUoJP6hVvUYHKSgTBUgo=; b=NR1bVHeEqzs8GyunLcTwhcXwMU
	ZoX6Q9D7O4+CzcaLr5PwSFkZBQN+B+gZyay1UxEopcFx+h+R3tAzGNX2VTfE91GxIeU3vcIUKLHDk
	8pROxFX03NXI/ff+mqQcFTrhNBMM5TRny62j0qoBNa0HW0Jf7ialP9cuE2T1Kx1Fd1Fk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to lib/xs.c
Message-Id: <E1rACFk-0003bO-8G@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:57:04 +0000

commit b1b56b558725576edf43da51389145135dccf046
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:04 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to lib/xs.c
    
    Add the needed instances of EXPORT_SYMBOL() to lib/xs.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 lib/xs.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/xs.c b/lib/xs.c
index 7fe9b03..ff0768c 100644
--- a/lib/xs.c
+++ b/lib/xs.c
@@ -64,6 +64,7 @@ struct xs_handle *xs_daemon_open()
     printk("xs_daemon_open -> %d, %p\n", fd, &file->dev);
     return (void*)(intptr_t) fd;
 }
+EXPORT_SYMBOL(xs_daemon_open);
 
 void xs_daemon_close(struct xs_handle *h)
 {
@@ -74,6 +75,7 @@ int xs_fileno(struct xs_handle *h)
 {
     return _xs_fileno(h);
 }
+EXPORT_SYMBOL(xs_fileno);
 
 void *xs_read(struct xs_handle *h, xs_transaction_t t,
 	     const char *path, unsigned int *len)
@@ -92,6 +94,7 @@ void *xs_read(struct xs_handle *h, xs_transaction_t t,
 	*len = strlen(value);
     return value;
 }
+EXPORT_SYMBOL(xs_read);
 
 bool xs_write(struct xs_handle *h, xs_transaction_t t,
 	      const char *path, const void *data, unsigned int len)
@@ -110,6 +113,7 @@ bool xs_write(struct xs_handle *h, xs_transaction_t t,
     }
     return true;
 }
+EXPORT_SYMBOL(xs_write);
 
 static bool xs_bool(char *reply)
 {
@@ -123,6 +127,7 @@ bool xs_rm(struct xs_handle *h, xs_transaction_t t, const char *path)
 {
     return xs_bool(xenbus_rm(t, path));
 }
+EXPORT_SYMBOL(xs_rm);
 
 static void *xs_talkv(struct xs_handle *h, xs_transaction_t t,
 		enum xsd_sockmsg_type type,
@@ -163,6 +168,7 @@ char *xs_get_domain_path(struct xs_handle *h, unsigned int domid)
 
     return xs_single(h, XBT_NULL, XS_GET_DOMAIN_PATH, domid_str, NULL);
 }
+EXPORT_SYMBOL(xs_get_domain_path);
 
 char **xs_directory(struct xs_handle *h, xs_transaction_t t,
 		    const char *path, unsigned int *num)
@@ -199,6 +205,7 @@ char **xs_directory(struct xs_handle *h, xs_transaction_t t,
     free(res);
     return entries;
 }
+EXPORT_SYMBOL(xs_directory);
 
 bool xs_watch(struct xs_handle *h, const char *path, const char *token)
 {
@@ -208,6 +215,7 @@ bool xs_watch(struct xs_handle *h, const char *path, const char *token)
     return xs_bool(xenbus_watch_path_token(XBT_NULL, path, token,
                                            (xenbus_event_queue *)&file->dev));
 }
+EXPORT_SYMBOL(xs_watch);
 
 char **xs_read_watch(struct xs_handle *h, unsigned int *num)
 {
@@ -220,10 +228,12 @@ char **xs_read_watch(struct xs_handle *h, unsigned int *num)
     *num = 2;
     return (char **) &event->path;
 }
+EXPORT_SYMBOL(xs_read_watch);
 
 bool xs_unwatch(struct xs_handle *h, const char *path, const char *token)
 {
     printk("xs_unwatch(%s, %s)\n", path, token);
     return xs_bool(xenbus_unwatch_path_token(XBT_NULL, path, token));
 }
+EXPORT_SYMBOL(xs_unwatch);
 #endif
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:57:15 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:57:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647216.1010084 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACFv-0000QC-Ix; Mon, 04 Dec 2023 16:57:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647216.1010084; Mon, 04 Dec 2023 16:57: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 1rACFv-0000Q4-GI; Mon, 04 Dec 2023 16:57:15 +0000
Received: by outflank-mailman (input) for mailman id 647216;
 Mon, 04 Dec 2023 16:57: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 1rACFu-0000Pt-Ea
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:57: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 1rACFu-0006wl-Dp
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:57:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACFu-0003c6-B8
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:57: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=smGDiv3KVhvExJPkohVCSyhu1BYUvbLEq+3Kbih1jCA=; b=sooJwrfwW42oEk/TRHjJh10Cfw
	qLszn5XfY4JBxldjwWte0bh0ZuUexEXLi775f0ZsEqCwIPSKzWWkhtUhc5iPXYO3KT1Ed95h2oQDq
	8GuFNPaIxEva6jQSdc41gxTlhBTNMWj3v9ziTecfjpmfki9QhLMHiGhqtnnt00T5dlSY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to main.c
Message-Id: <E1rACFu-0003c6-B8@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:57:14 +0000

commit 37325d59e5355ae5697ddb341162b288bf2dc469
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:05 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to main.c
    
    Add the needed instances of EXPORT_SYMBOL() to main.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/main.c b/main.c
index a93bc9d..c5c1c42 100644
--- a/main.c
+++ b/main.c
@@ -38,10 +38,12 @@ int main(int argc, char *argv[], char *envp[])
 void _init(void)
 {
 }
+EXPORT_SYMBOL(_init);
 
 void _fini(void)
 {
 }
+EXPORT_SYMBOL(_fini);
 
 extern char __app_bss_start, __app_bss_end;
 static void call_main(void *p)
@@ -189,6 +191,7 @@ void _exit(int ret)
     }
     do_exit();
 }
+EXPORT_SYMBOL(_exit);
 
 int app_main(void *p)
 {
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:57:25 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:57:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647217.1010088 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACG5-0000Te-Kd; Mon, 04 Dec 2023 16:57:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647217.1010088; Mon, 04 Dec 2023 16:57: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 1rACG5-0000TW-Hk; Mon, 04 Dec 2023 16:57:25 +0000
Received: by outflank-mailman (input) for mailman id 647217;
 Mon, 04 Dec 2023 16:57: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 1rACG4-0000TI-HU
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:57: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 1rACG4-0006ws-Gj
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:57:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACG4-0003cX-Fv
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:57: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=Rd8abi6FDgeQwpApUB1eyhzfy9UwHOPnQswaVZsjT1Y=; b=6wy8YWpA2J9f7nsmDh/jUrLExN
	mQBIsqDVDCeOLxsMnqMVSacBCoRmZct2o0AtutjA+TFC4Y5rjry0B32YBJOOL3HM2kHq0NlINMcUQ
	xFXYAA54xqqB/VxehjFPUYYXKAIWXOYq4WpOoUvydMLSyp8vFrruzYOMVz5fAejjIou4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to console.c
Message-Id: <E1rACG4-0003cX-Fv@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:57:24 +0000

commit 2cb46a4017d0780592fd1e4adb88b049275770a4
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:06 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to console.c
    
    Add the needed instances of EXPORT_SYMBOL() to console.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 console.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/console.c b/console.c
index 5d205c7..0107b68 100644
--- a/console.c
+++ b/console.c
@@ -125,6 +125,7 @@ void console_print(struct consfront_dev *dev, const char *data, int length)
 
     ring_send_fn(dev, copied_ptr, length);
 }
+EXPORT_SYMBOL(console_print);
 
 void print(int direct, const char *fmt, va_list args)
 {
@@ -155,6 +156,7 @@ void printk(const char *fmt, ...)
     print(0, fmt, args);
     va_end(args);
 }
+EXPORT_SYMBOL(printk);
 
 void xprintk(const char *fmt, ...)
 {
@@ -164,6 +166,8 @@ void xprintk(const char *fmt, ...)
     print(1, fmt, args);
     va_end(args);
 }
+EXPORT_SYMBOL(xprintk);
+
 void init_console(void)
 {
     printk("Initialising console ... ");
@@ -320,6 +324,7 @@ int xencons_ring_avail(struct consfront_dev *dev)
 
     return prod - cons;
 }
+EXPORT_SYMBOL(xencons_ring_avail);
 
 int xencons_ring_recv(struct consfront_dev *dev, char *data, unsigned int len)
 {
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:57:35 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:57:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647218.1010091 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACGF-0000Zg-O3; Mon, 04 Dec 2023 16:57:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647218.1010091; Mon, 04 Dec 2023 16:57: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 1rACGF-0000ZY-LC; Mon, 04 Dec 2023 16:57:35 +0000
Received: by outflank-mailman (input) for mailman id 647218;
 Mon, 04 Dec 2023 16:57: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 1rACGE-0000ZK-KN
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:57: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 1rACGE-0006xB-Je
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:57:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACGE-0003cy-In
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:57: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=vSYiC1Cm0OOkf93NKoo37+tGmy4xXhrhjPqtgGx2iRU=; b=N5ZDnfvdJj62TASySLnjrIYSG+
	mJHoN7xTxjLnd9fAoopxGg8rzdwfT5S8Jf8YDlu5kVqMRQfwLg9rvJBGRComm5D+jSkvsW9jgkdnj
	GKMJFlkl8dj0Kj0aWjfyXICiZQ8geU7QchcUWojrO1cC+gtI47wbWS2Uu0Ol91fYSejY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to events.c
Message-Id: <E1rACGE-0003cy-In@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:57:34 +0000

commit 90fded650ae8c10e3541141745f1cda1312585f4
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:07 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to events.c
    
    Add the needed instances of EXPORT_SYMBOL() to events.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 events.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/events.c b/events.c
index 4683e8e..9f3dbf0 100644
--- a/events.c
+++ b/events.c
@@ -119,6 +119,7 @@ void unbind_evtchn(evtchn_port_t port )
     if ( rc )
         printk("WARN: close_port %d failed rc=%d. ignored\n", port, rc);
 }
+EXPORT_SYMBOL(unbind_evtchn);
 
 evtchn_port_t bind_virq(uint32_t virq, evtchn_handler_t handler, void *data)
 {
@@ -138,6 +139,7 @@ evtchn_port_t bind_virq(uint32_t virq, evtchn_handler_t handler, void *data)
     bind_evtchn(op.port, handler, data);
 	return op.port;
 }
+EXPORT_SYMBOL(bind_virq);
 
 evtchn_port_t bind_pirq(uint32_t pirq, int will_share,
                         evtchn_handler_t handler, void *data)
@@ -157,6 +159,7 @@ evtchn_port_t bind_pirq(uint32_t pirq, int will_share,
 	bind_evtchn(op.port, handler, data);
 	return op.port;
 }
+EXPORT_SYMBOL(bind_pirq);
 
 /*
  * Initially all events are without a handler and disabled
@@ -217,6 +220,7 @@ int evtchn_alloc_unbound(domid_t pal, evtchn_handler_t handler,
     *port = bind_evtchn(op.port, handler, data);
     return rc;
 }
+EXPORT_SYMBOL(evtchn_alloc_unbound);
 
 /* Connect to a port so as to allow the exchange of notifications with
    the pal. Returns the result of the hypervisor call. */
@@ -240,6 +244,7 @@ int evtchn_bind_interdomain(domid_t pal, evtchn_port_t remote_port,
     *local_port = bind_evtchn(port, handler, data);
     return rc;
 }
+EXPORT_SYMBOL(evtchn_bind_interdomain);
 
 int evtchn_get_peercontext(evtchn_port_t local_port, char *ctx, int size)
 {
@@ -260,6 +265,7 @@ int evtchn_get_peercontext(evtchn_port_t local_port, char *ctx, int size)
     rc = HYPERVISOR_xsm_op(&op);
     return rc;
 }
+EXPORT_SYMBOL(evtchn_get_peercontext);
 
 /* Replace below when a hypercall is available to get the domid. */
 domid_t get_domid(void)
@@ -294,6 +300,7 @@ domid_t get_domid(void)
 
     return domid;
 }
+EXPORT_SYMBOL(get_domid);
 
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:57:45 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:57:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647219.1010096 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACGP-0000cj-Pf; Mon, 04 Dec 2023 16:57:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647219.1010096; Mon, 04 Dec 2023 16:57: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 1rACGP-0000cb-Mh; Mon, 04 Dec 2023 16:57:45 +0000
Received: by outflank-mailman (input) for mailman id 647219;
 Mon, 04 Dec 2023 16:57: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 1rACGO-0000cS-NF
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:57: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 1rACGO-0006xa-MU
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:57:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACGO-0003dN-Lg
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:57: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=Sw0+jSATY1qrGKtpRlJJ+BPNc+dzD/4zzE6lkClozUc=; b=o2e8mYOZke40Zv73eITVKI4/D0
	9lTHcqlPkP8/VFX8sRAeHqjap4+x4rhMd6XvI4wOMOpjDM2pNC3GduVjkWpHQZqNBWRFmqp1RMqjL
	L+yRirM25MvL1nEM/l8pnS6vjkpKZ1xNVJkO/LnXGAVGrhmmxhhKMharsRLtzbz5QPsg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to gntmap.c
Message-Id: <E1rACGO-0003dN-Lg@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:57:44 +0000

commit 9b725278779ac55f66df9b56cade2684e78cceda
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:08 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to gntmap.c
    
    Add the needed instances of EXPORT_SYMBOL() to gntmap.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 gntmap.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gntmap.c b/gntmap.c
index 3422ab2..5f57d6b 100644
--- a/gntmap.c
+++ b/gntmap.c
@@ -106,6 +106,7 @@ gntmap_set_max_grants(struct gntmap *map, int count)
     map->nentries = count;
     return 0;
 }
+EXPORT_SYMBOL(gntmap_set_max_grants);
 
 static int
 _gntmap_unmap_grant_ref(struct gntmap *map, int idx)
@@ -209,6 +210,7 @@ gntmap_munmap(struct gntmap *map, unsigned long start_address, int count)
 
     return 0;
 }
+EXPORT_SYMBOL(gntmap_munmap);
 
 void*
 gntmap_map_grant_refs(struct gntmap *map, 
@@ -251,6 +253,7 @@ gntmap_map_grant_refs(struct gntmap *map,
 
     return (void*) addr;
 }
+EXPORT_SYMBOL(gntmap_map_grant_refs);
 
 void
 gntmap_init(struct gntmap *map)
@@ -259,6 +262,7 @@ gntmap_init(struct gntmap *map)
     map->nentries = 0;
     map->entries = NULL;
 }
+EXPORT_SYMBOL(gntmap_init);
 
 void
 gntmap_fini(struct gntmap *map)
@@ -281,3 +285,4 @@ gntmap_fini(struct gntmap *map)
     map->entries = NULL;
     map->nentries = 0;
 }
+EXPORT_SYMBOL(gntmap_fini);
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:57:55 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:57:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647220.1010100 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACGZ-0000gp-Qn; Mon, 04 Dec 2023 16:57:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647220.1010100; Mon, 04 Dec 2023 16:57: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 1rACGZ-0000gh-O5; Mon, 04 Dec 2023 16:57:55 +0000
Received: by outflank-mailman (input) for mailman id 647220;
 Mon, 04 Dec 2023 16:57: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 1rACGY-0000gW-QD
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:57: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 1rACGY-0006xh-PL
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:57:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACGY-0003dm-OZ
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:57: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=wRzMlRg1z1RiLHmAoimrtyggXIkVnFNf81T2YkwMLgM=; b=u2nVpHUce1XB9hWrJPYZnbecml
	DRQWitTt2Qcwo/8F3aD4In1XD4dJZJZEKxd38zzbBW9khsprD8689ngRfwchhIrQyBpQ0EDe+b2pT
	cLoYcvV2IJLF46R4rU2zaGo6KvKrcEM7P+hzvUJrwC8PisXpTq8D4yoj/pCCMjCcP44o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to gnttab.c
Message-Id: <E1rACGY-0003dm-OZ@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:57:54 +0000

commit 953c7a4aafd571bcdd328325ad94632c5dcea17b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:09 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to gnttab.c
    
    Add the needed instances of EXPORT_SYMBOL() to gnttab.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 gnttab.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnttab.c b/gnttab.c
index 6978a9b..8168ed5 100644
--- a/gnttab.c
+++ b/gnttab.c
@@ -80,6 +80,7 @@ gnttab_grant_access(domid_t domid, unsigned long frame, int readonly)
 
     return ref;
 }
+EXPORT_SYMBOL(gnttab_grant_access);
 
 grant_ref_t
 gnttab_grant_transfer(domid_t domid, unsigned long pfn)
@@ -94,6 +95,7 @@ gnttab_grant_transfer(domid_t domid, unsigned long pfn)
 
     return ref;
 }
+EXPORT_SYMBOL(gnttab_grant_transfer);
 
 int
 gnttab_end_access(grant_ref_t ref)
@@ -114,6 +116,7 @@ gnttab_end_access(grant_ref_t ref)
     put_free_entry(ref);
     return 1;
 }
+EXPORT_SYMBOL(gnttab_end_access);
 
 unsigned long
 gnttab_end_transfer(grant_ref_t ref)
@@ -144,6 +147,7 @@ gnttab_end_transfer(grant_ref_t ref)
 
     return frame;
 }
+EXPORT_SYMBOL(gnttab_end_transfer);
 
 grant_ref_t
 gnttab_alloc_and_grant(void **map)
@@ -156,6 +160,7 @@ gnttab_alloc_and_grant(void **map)
     gref = gnttab_grant_access(0, mfn, 0);
     return gref;
 }
+EXPORT_SYMBOL(gnttab_alloc_and_grant);
 
 static const char * const gnttabop_error_msgs[] = GNTTABOP_error_msgs;
 
@@ -168,6 +173,7 @@ gnttabop_error(int16_t status)
     else
         return gnttabop_error_msgs[status];
 }
+EXPORT_SYMBOL(gnttabop_error);
 
 void
 init_gnttab(void)
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:58:06 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:58:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647221.1010104 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACGk-0000lM-SF; Mon, 04 Dec 2023 16:58:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647221.1010104; Mon, 04 Dec 2023 16:58: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 1rACGk-0000lE-PV; Mon, 04 Dec 2023 16:58:06 +0000
Received: by outflank-mailman (input) for mailman id 647221;
 Mon, 04 Dec 2023 16:58: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 1rACGi-0000kt-Sz
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:58: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 1rACGi-0006y4-SI
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:58:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACGi-0003fG-RT
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:58: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=M5JCpwf7Qs5aJhZaZtgtEp3CZeJV8n4YZhnMHywh30s=; b=xVyTtTFeYluyLZlSAudwR6Wx0m
	a9wwVhten9xQtyctre65ddGmbA/9iEAaBN2eyq8Tv8p/7hihbRgyn8Y/3Bxt7t+YbtkPOHqeWhxM+
	gPaVqk5ZL3IlbcTO/D5D4ZesNYgnw+oCrG7ILSw3KEuwzlkVrKFUa6RBPzNIy/QrOX6Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to ioremap.c
Message-Id: <E1rACGi-0003fG-RT@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:58:04 +0000

commit 3d463d2004c71e17923543445baff14e1e927cf4
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:10 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to ioremap.c
    
    Add the needed instances of EXPORT_SYMBOL() to ioremap.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/ioremap.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86/ioremap.c b/arch/x86/ioremap.c
index 4384b1c..fda74d5 100644
--- a/arch/x86/ioremap.c
+++ b/arch/x86/ioremap.c
@@ -51,11 +51,13 @@ void *ioremap(unsigned long phys_addr, unsigned long size)
 {
     return __do_ioremap(phys_addr, size, IO_PROT);
 }
+EXPORT_SYMBOL(ioremap);
 
 void *ioremap_nocache(unsigned long phys_addr, unsigned long size)
 {
     return __do_ioremap(phys_addr, size, IO_PROT_NOCACHE);
 }
+EXPORT_SYMBOL(ioremap_nocache);
 
 /* Un-map the io-remapped region. Currently no list of existing mappings is
  * maintained, so the caller has to supply the size */
@@ -69,7 +71,6 @@ void iounmap(void *virt_addr, unsigned long size)
 
     unmap_frames(va & PAGE_MASK, num_pages);
 }
-
-
+EXPORT_SYMBOL(iounmap);
 
 /* -*-  Mode:C; c-basic-offset:4; tab-width:4 indent-tabs-mode:nil -*- */
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:58:16 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:58:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647222.1010108 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACGu-0000oO-TU; Mon, 04 Dec 2023 16:58:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647222.1010108; Mon, 04 Dec 2023 16:58: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 1rACGu-0000oG-Qv; Mon, 04 Dec 2023 16:58:16 +0000
Received: by outflank-mailman (input) for mailman id 647222;
 Mon, 04 Dec 2023 16:58: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 1rACGs-0000o7-Vv
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:58: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 1rACGs-0006yG-V5
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:58:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACGs-0003fv-UI
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:58: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=fIDaLbCca2se5m4fRSDZTSdpVkReGtlbciW5gruycOc=; b=tb0FXo9JWTfV5kUMCDq2b+3aKn
	dISOVyu8gGLd2s2a/IMO48Rrhob02Ovktmxnp0jR4x2OxP/6Ql/vIlIumvo3i5WKVdUFZFeLDm4t4
	lxyf+eFHkAo/PH8HZ1zIrWWSRHc6oDWQ9P1axLV49b/j3Kfms5zEPAE3s10C8sc97lu8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to lock.c
Message-Id: <E1rACGs-0003fv-UI@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:58:14 +0000

commit ca92da51f7f511a4200f4fedd1aedbe548021a06
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:11 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to lock.c
    
    Add the needed instances of EXPORT_SYMBOL() to lock.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 lock.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lock.c b/lock.c
index 61194e5..8f58344 100644
--- a/lock.c
+++ b/lock.c
@@ -17,6 +17,7 @@ int ___lock_init(_LOCK_T *lock)
     init_waitqueue_head(&lock->wait);
     return 0;
 }
+EXPORT_SYMBOL(___lock_init);
 
 int ___lock_acquire(_LOCK_T *lock)
 {
@@ -32,6 +33,7 @@ int ___lock_acquire(_LOCK_T *lock)
     local_irq_restore(flags);
     return 0;
 }
+EXPORT_SYMBOL(___lock_acquire);
 
 int ___lock_try_acquire(_LOCK_T *lock)
 {
@@ -45,6 +47,7 @@ int ___lock_try_acquire(_LOCK_T *lock)
     local_irq_restore(flags);
     return ret;
 }
+EXPORT_SYMBOL(___lock_try_acquire);
 
 int ___lock_release(_LOCK_T *lock)
 {
@@ -55,7 +58,7 @@ int ___lock_release(_LOCK_T *lock)
     local_irq_restore(flags);
     return 0;
 }
-
+EXPORT_SYMBOL(___lock_release);
 
 int ___lock_init_recursive(_LOCK_RECURSIVE_T *lock)
 {
@@ -63,6 +66,7 @@ int ___lock_init_recursive(_LOCK_RECURSIVE_T *lock)
     init_waitqueue_head(&lock->wait);
     return 0;
 }
+EXPORT_SYMBOL(___lock_init_recursive);
 
 int ___lock_acquire_recursive(_LOCK_RECURSIVE_T *lock)
 {
@@ -81,6 +85,7 @@ int ___lock_acquire_recursive(_LOCK_RECURSIVE_T *lock)
     lock->count++;
     return 0;
 }
+EXPORT_SYMBOL(___lock_acquire_recursive);
 
 int ___lock_try_acquire_recursive(_LOCK_RECURSIVE_T *lock)
 {
@@ -95,6 +100,7 @@ int ___lock_try_acquire_recursive(_LOCK_RECURSIVE_T *lock)
     local_irq_restore(flags);
     return ret;
 }
+EXPORT_SYMBOL(___lock_try_acquire_recursive);
 
 int ___lock_release_recursive(_LOCK_RECURSIVE_T *lock)
 {
@@ -108,5 +114,6 @@ int ___lock_release_recursive(_LOCK_RECURSIVE_T *lock)
     local_irq_restore(flags);
     return 0;
 }
+EXPORT_SYMBOL(___lock_release_recursive);
 
 #endif
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:58:26 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:58:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647223.1010111 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACH4-0000sl-Uo; Mon, 04 Dec 2023 16:58:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647223.1010111; Mon, 04 Dec 2023 16:58: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 1rACH4-0000se-SK; Mon, 04 Dec 2023 16:58:26 +0000
Received: by outflank-mailman (input) for mailman id 647223;
 Mon, 04 Dec 2023 16:58: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 1rACH3-0000qv-2M
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:58: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 1rACH3-0006yO-1g
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:58:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACH3-0003gV-0x
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:58: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=yaRAvb0Adz+FefETMDfkBD0G0S7M1GU4Pc2BE37uGcc=; b=3bs8YodHHUjcf+3y0+cvNicYKQ
	k1L+3n/GOAkVl+HzHOK8th5X783zxTy+ok3CqWjK6w+I9lrpOw9ynFIyiidS1A2ANBnPPx/5RIjjN
	Uug6Lyh9oXWxdwukK03OJmFLSYwmtyljc/aCs7eappM+lqgPVI4LGwERmKNYVgtiMe9k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to time.c
Message-Id: <E1rACH3-0003gV-0x@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:58:25 +0000

commit efc05eaf1103a32e5ec5cbbeb1282a0f47d87ba9
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:12 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to time.c
    
    Add the needed instances of EXPORT_SYMBOL() to time.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 arch/arm/time.c | 1 +
 arch/x86/time.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/time.c b/arch/arm/time.c
index a088981..3483511 100644
--- a/arch/arm/time.c
+++ b/arch/arm/time.c
@@ -83,6 +83,7 @@ int gettimeofday(struct timeval *tv, void *tz)
 
     return 0;
 }
+EXPORT_SYMBOL(gettimeofday);
 
 /* Set the timer and mask. */
 void write_timer_ctl(uint32_t value) {
diff --git a/arch/x86/time.c b/arch/x86/time.c
index 8077c80..332c026 100644
--- a/arch/x86/time.c
+++ b/arch/x86/time.c
@@ -204,7 +204,7 @@ int gettimeofday(struct timeval *tv, void *tz)
 
     return 0;
 }
-
+EXPORT_SYMBOL(gettimeofday);
 
 void block_domain(s_time_t until)
 {
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:58:37 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:58:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647224.1010116 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACHF-0000wn-0r; Mon, 04 Dec 2023 16:58:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647224.1010116; Mon, 04 Dec 2023 16:58: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 1rACHE-0000wf-Tq; Mon, 04 Dec 2023 16:58:36 +0000
Received: by outflank-mailman (input) for mailman id 647224;
 Mon, 04 Dec 2023 16:58: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 1rACHD-0000wO-5G
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:58: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 1rACHD-0006yX-4X
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:58:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACHD-0003ic-3i
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:58: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=uJ76NkgtDy8XPo0u1pbge9/Pjl/EbrOUbclT616lQ4c=; b=PFXID+zeZWHzVBxAjM7H0q9+kx
	1jTE8wcZ7KtoGzaqj2Dn0Ox8yU4mGl1fD6bB4JYZt2brmwLoeWN1Ul563+x66Ihd0PJgZDZ1oHJhk
	94PpWtnBZiCwWJbSNzwJtyYi7cfAJVoeZQcp9bwm/m9NEee6mcEFolrp36XN0IMWQvNo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to lwip-*.c
Message-Id: <E1rACHD-0003ic-3i@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:58:35 +0000

commit 56403cfb17ccf4f3eddcf02792d75d925e535d85
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:13 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to lwip-*.c
    
    Add the needed instances of EXPORT_SYMBOL() to lwip-*.c.
    
    Most added symbols are in LWIP, but we can't add the EXPORT_SYMBOL()
    instances easily there.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
---
 lwip-arch.c | 9 +++++++++
 lwip-net.c  | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/lwip-arch.c b/lwip-arch.c
index 21e941e..7907f44 100644
--- a/lwip-arch.c
+++ b/lwip-arch.c
@@ -12,7 +12,9 @@
 #include <console.h>
 #include <xmalloc.h>
 #include <lwip/sys.h>
+#include <lwip/inet.h>
 #include <stdarg.h>
+#include <mini-os/export.h>
 
 /* Is called to initialize the sys_arch layer */
 void sys_init(void)
@@ -293,3 +295,10 @@ void lwip_die(char *fmt, ...)
     printk("\n");
     BUG();
 }
+
+EXPORT_SYMBOL(htonl);
+EXPORT_SYMBOL(htons);
+EXPORT_SYMBOL(inet_aton);
+EXPORT_SYMBOL(inet_ntoa);
+EXPORT_SYMBOL(ntohl);
+EXPORT_SYMBOL(ntohs);
diff --git a/lwip-net.c b/lwip-net.c
index 16950d3..e71a11c 100644
--- a/lwip-net.c
+++ b/lwip-net.c
@@ -250,7 +250,7 @@ void networking_set_addr(struct ip_addr *ipaddr, struct ip_addr *netmask, struct
   netif_set_netmask(the_interface, netmask);
   netif_set_gw(the_interface, gw);
 }
-
+EXPORT_SYMBOL(networking_set_addr);
 
 static void
 arp_timer(void *arg)
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:58:47 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:58:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647226.1010120 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACHP-00012L-1z; Mon, 04 Dec 2023 16:58:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647226.1010120; Mon, 04 Dec 2023 16:58:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACHO-00012E-VS; Mon, 04 Dec 2023 16:58:46 +0000
Received: by outflank-mailman (input) for mailman id 647226;
 Mon, 04 Dec 2023 16:58: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 1rACHN-00010k-8T
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:58: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 1rACHN-0006yu-7n
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:58:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACHN-0003j3-6o
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:58: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=WF/FW68s6HQy4zvWzF13IKmSuWKwFKBlzWdNOvCyisU=; b=ARcg55Nv8MNQ7gA3RvVUQ3NCw3
	/CHMu9j4VLzMoNrsGCzJPwNn2+DVOVoVjYrMdYzD8noLms9Wz5MJD4gnYvMnBVZdLgsQeeWXBXaTG
	xXO8SC1oepr2n3tD8LZT2TjE1sjKYevGeCV1j3VDWiYz3PSOBvNCmS5gRNlwVgZ7WexE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to 9pfront.c
Message-Id: <E1rACHN-0003j3-6o@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:58:45 +0000

commit b6a5bfc6d89db5c45cd074604449f84f0bfa2324
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:14 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to 9pfront.c
    
    Add the needed instances of EXPORT_SYMBOL() to 9pfront.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 9pfront.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/9pfront.c b/9pfront.c
index 35c5552..315089b 100644
--- a/9pfront.c
+++ b/9pfront.c
@@ -1243,6 +1243,7 @@ void *init_9pfront(unsigned int id, const char *mnt)
     free(msg);
     return NULL;
 }
+EXPORT_SYMBOL(init_9pfront);
 
 void shutdown_9pfront(void *dev)
 {
@@ -1286,6 +1287,7 @@ void shutdown_9pfront(void *dev)
         printk("9pfsfront shutdown %u failed, %s\n", dev9p->id, reason);
     free(msg);
 }
+EXPORT_SYMBOL(shutdown_9pfront);
 
 static const struct file_ops ops_9pfs = {
     .name = "9pfs",
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:58:57 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:58:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647227.1010125 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACHZ-00016m-41; Mon, 04 Dec 2023 16:58:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647227.1010125; Mon, 04 Dec 2023 16:58:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACHZ-00016e-0c; Mon, 04 Dec 2023 16:58:57 +0000
Received: by outflank-mailman (input) for mailman id 647227;
 Mon, 04 Dec 2023 16:58: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 1rACHX-00016L-BN
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:58: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 1rACHX-0006z4-Ad
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:58:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACHX-0003jZ-9t
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:58: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=xqG1My6xrYxZDrq5B4s+xIRKhRPGQef2ABYA2AaNros=; b=foCtzaMSguDFusJYR89qT9vXdM
	NbIZHrbbZMuS8SkyhczSMTmZ350t9NA8xb5Vk9L7r2T9AD2HpLqonUu4EUkUoOysLUe3lDP10tLTS
	YZdck1mbtzrquMfnB1w3TQbolyONZ0b3LwI9kGOwBGc6TYZySTUYCQb8lcuVJhNJFowU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to blkfront.c
Message-Id: <E1rACHX-0003jZ-9t@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:58:55 +0000

commit 35a45c8ab3673ca9e9cfb226789c9bd6e8b25399
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:15 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to blkfront.c
    
    Add the needed instances of EXPORT_SYMBOL() to blkfront.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 blkfront.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/blkfront.c b/blkfront.c
index 8f14089..b0fc80d 100644
--- a/blkfront.c
+++ b/blkfront.c
@@ -23,9 +23,7 @@
 /* Note: we really suppose non-preemptive threads.  */
 
 DECLARE_WAIT_QUEUE_HEAD(blkfront_queue);
-
-
-
+EXPORT_SYMBOL(blkfront_queue);
 
 #define BLK_RING_SIZE __RING_SIZE((struct blkif_sring *)0, PAGE_SIZE)
 #define GRANT_INVALID_REF 0
@@ -243,6 +241,7 @@ error:
     free_blkfront(dev);
     return NULL;
 }
+EXPORT_SYMBOL(init_blkfront);
 
 void shutdown_blkfront(struct blkfront_dev *dev)
 {
@@ -304,6 +303,7 @@ close:
     if (!err)
         free_blkfront(dev);
 }
+EXPORT_SYMBOL(shutdown_blkfront);
 
 static void blkfront_wait_slot(struct blkfront_dev *dev)
 {
@@ -386,6 +386,7 @@ void blkfront_aio(struct blkfront_aiocb *aiocbp, int write)
 
     if(notify) notify_remote_via_evtchn(dev->evtchn);
 }
+EXPORT_SYMBOL(blkfront_aio);
 
 static void blkfront_aio_cb(struct blkfront_aiocb *aiocbp, int ret)
 {
@@ -417,6 +418,7 @@ void blkfront_io(struct blkfront_aiocb *aiocbp, int write)
     remove_waiter(w, blkfront_queue);
     local_irq_restore(flags);
 }
+EXPORT_SYMBOL(blkfront_io);
 
 static void blkfront_push_operation(struct blkfront_dev *dev, uint8_t op, uint64_t id)
 {
@@ -444,6 +446,7 @@ void blkfront_aio_push_operation(struct blkfront_aiocb *aiocbp, uint8_t op)
     struct blkfront_dev *dev = aiocbp->aio_dev;
     blkfront_push_operation(dev, op, (uintptr_t) aiocbp);
 }
+EXPORT_SYMBOL(blkfront_aio_push_operation);
 
 void blkfront_sync(struct blkfront_dev *dev)
 {
@@ -473,6 +476,7 @@ void blkfront_sync(struct blkfront_dev *dev)
     remove_waiter(w, blkfront_queue);
     local_irq_restore(flags);
 }
+EXPORT_SYMBOL(blkfront_sync);
 
 int blkfront_aio_poll(struct blkfront_dev *dev)
 {
@@ -557,6 +561,7 @@ moretodo:
 
     return nr_consumed;
 }
+EXPORT_SYMBOL(blkfront_aio_poll);
 
 #ifdef HAVE_LIBC
 static int blkfront_posix_rwop(struct file *file, uint8_t *buf, size_t count,
@@ -773,4 +778,5 @@ int blkfront_open(struct blkfront_dev *dev)
 
     return dev->fd;
 }
+EXPORT_SYMBOL(blkfront_open);
 #endif
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:59:07 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:59:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647228.1010128 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACHj-0001CE-6i; Mon, 04 Dec 2023 16:59:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647228.1010128; Mon, 04 Dec 2023 16:59: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 1rACHj-0001Bx-3p; Mon, 04 Dec 2023 16:59:07 +0000
Received: by outflank-mailman (input) for mailman id 647228;
 Mon, 04 Dec 2023 16:59: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 1rACHh-0001Ab-EG
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:59: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 1rACHh-0006zL-DU
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:59:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACHh-0003kF-Cg
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:59: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=L7ozIHAk7cGjA9qU9a/FSMLouR69PNSNodezQdqhzj0=; b=4FamOp+evi+bktvVuDUJh7hi1m
	D5PjTTOpCUnmtyhsHnhaP185FXL1fih5p0Gq48e/sUdMWN3hv/j8Yp7WimrVdOkqzFVk4V88SHHn+
	7K8JAOg4gy7SegOZQq6Hmqu0eQGGwIeYJetzQiD0z4/0WpGHCDr6Sk8SQ80fbfqMr86s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to fbfront.c
Message-Id: <E1rACHh-0003kF-Cg@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:59:05 +0000

commit d30dd4e8bc05f99f971fb864ca7f028b023046e8
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:16 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to fbfront.c
    
    Add the needed instances of EXPORT_SYMBOL() to fbfront.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 fbfront.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/fbfront.c b/fbfront.c
index 1b67f52..d4e28d0 100644
--- a/fbfront.c
+++ b/fbfront.c
@@ -201,6 +201,7 @@ error:
     free_kbdfront(dev);
     return NULL;
 }
+EXPORT_SYMBOL(init_kbdfront);
 
 int kbdfront_receive(struct kbdfront_dev *dev, union xenkbd_in_event *buf, int n)
 {
@@ -239,7 +240,7 @@ int kbdfront_receive(struct kbdfront_dev *dev, union xenkbd_in_event *buf, int n
 
     return i;
 }
-
+EXPORT_SYMBOL(kbdfront_receive);
 
 void shutdown_kbdfront(struct kbdfront_dev *dev)
 {
@@ -301,6 +302,7 @@ close_kbdfront:
     if (!err)
         free_kbdfront(dev);
 }
+EXPORT_SYMBOL(shutdown_kbdfront);
 
 #ifdef HAVE_LIBC
 static int kbd_read(struct file *file, void *buf, size_t nbytes)
@@ -351,6 +353,7 @@ int kbdfront_open(struct kbdfront_dev *dev)
 
     return dev->fd;
 }
+EXPORT_SYMBOL(kbdfront_open);
 #endif
 
 
@@ -451,6 +454,7 @@ int fbfront_receive(struct fbfront_dev *dev, union xenfb_in_event *buf, int n)
 
     return i;
 }
+EXPORT_SYMBOL(fbfront_receive);
 
 struct fbfront_dev *init_fbfront(char *_nodename, unsigned long *mfns, int width, int height, int depth, int stride, int n)
 {
@@ -617,6 +621,7 @@ error:
     free_fbfront(dev);
     return NULL;
 }
+EXPORT_SYMBOL(init_fbfront);
 
 static void fbfront_out_event(struct fbfront_dev *dev, union xenfb_out_event *event)
 {
@@ -668,6 +673,7 @@ void fbfront_update(struct fbfront_dev *dev, int x, int y, int width, int height
     update.height = height;
     fbfront_out_event(dev, (union xenfb_out_event *) &update);
 }
+EXPORT_SYMBOL(fbfront_update);
 
 void fbfront_resize(struct fbfront_dev *dev, int width, int height, int stride, int depth, int offset)
 {
@@ -681,6 +687,7 @@ void fbfront_resize(struct fbfront_dev *dev, int width, int height, int stride,
     dev->offset = resize.offset = offset;
     fbfront_out_event(dev, (union xenfb_out_event *) &resize);
 }
+EXPORT_SYMBOL(fbfront_resize);
 
 void shutdown_fbfront(struct fbfront_dev *dev)
 {
@@ -745,6 +752,7 @@ close_fbfront:
     if (!err)
         free_fbfront(dev);
 }
+EXPORT_SYMBOL(shutdown_fbfront);
 
 #ifdef HAVE_LIBC
 static int fbfront_read(struct file *file, void *buf, size_t nbytes)
@@ -794,5 +802,6 @@ int fbfront_open(struct fbfront_dev *dev)
     file->dev = dev;
     return dev->fd;
 }
+EXPORT_SYMBOL(fbfront_open);
 #endif
 
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:59:16 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:59:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647230.1010131 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACHs-0001G3-7s; Mon, 04 Dec 2023 16:59:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647230.1010131; Mon, 04 Dec 2023 16:59: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 1rACHs-0001Fv-5I; Mon, 04 Dec 2023 16:59:16 +0000
Received: by outflank-mailman (input) for mailman id 647230;
 Mon, 04 Dec 2023 16:59: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 1rACHr-0001Fp-HE
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:59: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 1rACHr-0006zT-GP
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:59:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACHr-0003km-FX
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:59: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=RJQC2Ez6aMl2z207WaWYcdsGORvoHUT1PLYyN5Qt7o8=; b=hUO031X/VIYybuIzDo6ktpGQJ6
	oHj5jwPOvGDZnbgry1MOTzK3/jLZAtOwomsonHmBgOYMMseP5pZhQdq8S6ygsNrEdQwecXFDkI8dD
	k2NRGnRmmHtqkkTtS/3mRGVrNX55hF77bk/lasBRNcj0v22axBHYGJijOxGYU0HrSeb4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to netfront.c
Message-Id: <E1rACHr-0003km-FX@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:59:15 +0000

commit 927a76be50d3b8a5dfb394bdd04c352fe118adde
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:17 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to netfront.c
    
    Add the needed instances of EXPORT_SYMBOL() to netfront.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
---
 netfront.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/netfront.c b/netfront.c
index 164fdc6..7de2498 100644
--- a/netfront.c
+++ b/netfront.c
@@ -370,16 +370,19 @@ out:
 err:
     return dev;
 }
+EXPORT_SYMBOL(init_netfront);
 
 char *netfront_get_netmask(struct netfront_dev *dev)
 {
     return dev->mask ? strdup(dev->mask) : NULL;
 }
+EXPORT_SYMBOL(netfront_get_netmask);
 
 char *netfront_get_gateway(struct netfront_dev *dev)
 {
     return dev->gw ? strdup(dev->gw) : NULL;
 }
+EXPORT_SYMBOL(netfront_get_gateway);
 
 static struct netfront_dev *_init_netfront(struct netfront_dev *dev)
 {
@@ -625,6 +628,7 @@ int netfront_tap_open(char *nodename) {
     file->dev = dev;
     return dev->fd;
 }
+EXPORT_SYMBOL(netfront_tap_open);
 #endif
 
 void shutdown_netfront(struct netfront_dev *dev)
@@ -654,6 +658,7 @@ void shutdown_netfront(struct netfront_dev *dev)
         free_netfront(dev);
     }
 }
+EXPORT_SYMBOL(shutdown_netfront);
 
 static int _shutdown_netfront(struct netfront_dev *dev)
 {
@@ -813,6 +818,7 @@ void netfront_xmit(struct netfront_dev *dev, const unsigned char *data, int len)
     network_tx_buf_gc(dev);
     local_irq_restore(flags);
 }
+EXPORT_SYMBOL(netfront_xmit);
 
 #ifdef HAVE_LIBC
 ssize_t netfront_receive(struct netfront_dev *dev, unsigned char *data, size_t len)
@@ -840,6 +846,7 @@ ssize_t netfront_receive(struct netfront_dev *dev, unsigned char *data, size_t l
 
     return dev->rlen;
 }
+EXPORT_SYMBOL(netfront_receive);
 #endif
 
 void netfront_set_rx_handler(struct netfront_dev *dev,
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:59:26 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:59:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647231.1010135 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACI2-0001Nd-9K; Mon, 04 Dec 2023 16:59:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647231.1010135; Mon, 04 Dec 2023 16:59: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 1rACI2-0001NW-6l; Mon, 04 Dec 2023 16:59:26 +0000
Received: by outflank-mailman (input) for mailman id 647231;
 Mon, 04 Dec 2023 16:59: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 1rACI1-0001MC-K3
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:59: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 1rACI1-0006zd-JP
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:59:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACI1-0003lj-IZ
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:59:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QDDpIXXPhOt1K23rZK29JefB7lOFzuCP9+XHmWO2v48=; b=LwvL2Afcv5qG0sc9QZcmnZoTMJ
	t+958a0+HFL+sRJw0Z9iRVlUYWs/WIbM0YwAj5CaVKrYFXnLUcif7WvKZ4udUgPhjQ4U6h/kp6hcS
	5zdjgh9XwmAas9i8pbNBnHQzGY+ONmExhn0bC4XUWQjH/WHh2rd99QfBrAZVnaNBD2s0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to pcifront.c
Message-Id: <E1rACI1-0003lj-IZ@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:59:25 +0000

commit a8c9c62e4689101057fe11877fe65e7ea5d971c9
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:18 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to pcifront.c
    
    Add the needed instances of EXPORT_SYMBOL() to pcifront.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 pcifront.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/pcifront.c b/pcifront.c
index 5642356..f1d6939 100644
--- a/pcifront.c
+++ b/pcifront.c
@@ -278,6 +278,7 @@ error:
     free_pcifront(dev);
     return NULL;
 }
+EXPORT_SYMBOL(init_pcifront);
 
 void pcifront_scan(struct pcifront_dev *dev, void (*func)(unsigned int domain, unsigned int bus, unsigned slot, unsigned int fun))
 {
@@ -319,6 +320,7 @@ void pcifront_scan(struct pcifront_dev *dev, void (*func)(unsigned int domain, u
     }
     free(path);
 }
+EXPORT_SYMBOL(pcifront_scan);
 
 void shutdown_pcifront(struct pcifront_dev *dev)
 {
@@ -377,6 +379,7 @@ close_pcifront:
     if (!err)
         free_pcifront(dev);
 }
+EXPORT_SYMBOL(shutdown_pcifront);
 
 int pcifront_physical_to_virtual (struct pcifront_dev *dev,
                                   unsigned int *dom,
@@ -451,6 +454,7 @@ void pcifront_op(struct pcifront_dev *dev, struct xen_pci_op *op)
     rmb();
     *op = dev->info->op;
 }
+EXPORT_SYMBOL(pcifront_op);
 
 int pcifront_conf_read(struct pcifront_dev *dev,
                        unsigned int dom,
@@ -481,6 +485,7 @@ int pcifront_conf_read(struct pcifront_dev *dev,
 
     return 0;
 }
+EXPORT_SYMBOL(pcifront_conf_read);
 
 int pcifront_conf_write(struct pcifront_dev *dev,
                         unsigned int dom,
@@ -508,6 +513,7 @@ int pcifront_conf_write(struct pcifront_dev *dev,
 
     return op.err;
 }
+EXPORT_SYMBOL(pcifront_conf_write);
 
 int pcifront_enable_msi(struct pcifront_dev *dev,
                         unsigned int dom,
@@ -533,6 +539,7 @@ int pcifront_enable_msi(struct pcifront_dev *dev,
     else
         return op.value;
 }
+EXPORT_SYMBOL(pcifront_enable_msi);
 
 int pcifront_disable_msi(struct pcifront_dev *dev,
                          unsigned int dom,
@@ -555,6 +562,7 @@ int pcifront_disable_msi(struct pcifront_dev *dev,
     
     return op.err;
 }
+EXPORT_SYMBOL(pcifront_disable_msi);
 
 int pcifront_enable_msix(struct pcifront_dev *dev,
                          unsigned int dom,
@@ -589,7 +597,7 @@ int pcifront_enable_msix(struct pcifront_dev *dev,
 
     return 0;
 }
-
+EXPORT_SYMBOL(pcifront_enable_msix);
 
 int pcifront_disable_msix(struct pcifront_dev *dev,
                           unsigned int dom,
@@ -612,3 +620,4 @@ int pcifront_disable_msix(struct pcifront_dev *dev,
     
     return op.err;
 }
+EXPORT_SYMBOL(pcifront_disable_msix);
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:59:36 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:59:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647232.1010140 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACIC-0001QH-B6; Mon, 04 Dec 2023 16:59:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647232.1010140; Mon, 04 Dec 2023 16:59: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 1rACIC-0001Q7-8I; Mon, 04 Dec 2023 16:59:36 +0000
Received: by outflank-mailman (input) for mailman id 647232;
 Mon, 04 Dec 2023 16:59: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 1rACIB-0001Q0-N4
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:59: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 1rACIB-0006zo-MK
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:59:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACIB-0003mv-LS
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:59:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Bq1xvYW2rp/gdJDozIPKFIXtGcjjNh0RpqmpQqYDeg0=; b=wkuOiizyPPfeiDBjjW+WDBrNDI
	eUxlq/r7W6u4rBtJvMJx+60R64Nb61ycqz+Ye/7iqm9Du6hD13HMy1TYLXN46TI1ZLXtIX+5PNknt
	2MbufchzsU3stWc6408HTPSpSin1sLhHtXDuo6ImzWH7LbYLchzp6+VfqclAfNdfD504=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to tpmback.c
Message-Id: <E1rACIB-0003mv-LS@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:59:35 +0000

commit c1eb200304e0a0583d26a56d5a7528547632eb1f
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:19 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to tpmback.c
    
    Add the needed instances of EXPORT_SYMBOL() to tpmback.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 tpmback.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tpmback.c b/tpmback.c
index 22adbd3..ab0df12 100644
--- a/tpmback.c
+++ b/tpmback.c
@@ -804,6 +804,7 @@ void* tpmback_get_opaque(domid_t domid, unsigned int handle)
 
    return tpmif->opaque;
 }
+EXPORT_SYMBOL(tpmback_get_opaque);
 
 int tpmback_set_opaque(domid_t domid, unsigned int handle, void *opaque)
 {
@@ -816,6 +817,7 @@ int tpmback_set_opaque(domid_t domid, unsigned int handle, void *opaque)
    tpmif->opaque = opaque;
    return 0;
 }
+EXPORT_SYMBOL(tpmback_set_opaque);
 
 unsigned char* tpmback_get_uuid(domid_t domid, unsigned int handle)
 {
@@ -827,6 +829,7 @@ unsigned char* tpmback_get_uuid(domid_t domid, unsigned int handle)
 
    return tpmif->uuid;
 }
+EXPORT_SYMBOL(tpmback_get_uuid);
 
 int tpmback_get_peercontext(domid_t domid, unsigned int handle, void* buffer, int buflen)
 {
@@ -838,6 +841,7 @@ int tpmback_get_peercontext(domid_t domid, unsigned int handle, void* buffer, in
 
    return evtchn_get_peercontext(tpmif->evtchn, buffer, buflen);
 }
+EXPORT_SYMBOL(tpmback_get_peercontext);
 
 static void event_listener(void)
 {
@@ -903,6 +907,7 @@ void init_tpmback(void (*open_cb)(domid_t, unsigned int), void (*close_cb)(domid
    eventthread = create_thread("tpmback-listener", event_thread, NULL);
 
 }
+EXPORT_SYMBOL(init_tpmback);
 
 void shutdown_tpmback(void)
 {
@@ -923,6 +928,7 @@ void shutdown_tpmback(void)
    wake_up(&waitq);
    schedule();
 }
+EXPORT_SYMBOL(shutdown_tpmback);
 
 static void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, void *opaque)
 {
@@ -1061,6 +1067,7 @@ tpmcmd_t* tpmback_req_any(void)
    TPMBACK_ERR("backend request ready flag was set but no interfaces were actually ready\n");
    return NULL;
 }
+EXPORT_SYMBOL(tpmback_req_any);
 
 tpmcmd_t* tpmback_req(domid_t domid, unsigned int handle)
 {
@@ -1081,6 +1088,7 @@ tpmcmd_t* tpmback_req(domid_t domid, unsigned int handle)
 
    return get_request(tpmif);
 }
+EXPORT_SYMBOL(tpmback_req);
 
 void tpmback_resp(tpmcmd_t* tpmcmd)
 {
@@ -1108,6 +1116,7 @@ end:
    free(tpmcmd);
    return;
 }
+EXPORT_SYMBOL(tpmback_resp);
 
 int tpmback_wait_for_frontend_connect(domid_t *domid, unsigned int *handle)
 {
@@ -1125,8 +1134,10 @@ int tpmback_wait_for_frontend_connect(domid_t *domid, unsigned int *handle)
 
    return 0;
 }
+EXPORT_SYMBOL(tpmback_wait_for_frontend_connect);
 
 int tpmback_num_frontends(void)
 {
    return gtpmdev.num_tpms;
 }
+EXPORT_SYMBOL(tpmback_num_frontends);
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:59:46 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:59:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647233.1010144 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACIM-0001Vm-CN; Mon, 04 Dec 2023 16:59:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647233.1010144; Mon, 04 Dec 2023 16:59: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 1rACIM-0001Ve-9m; Mon, 04 Dec 2023 16:59:46 +0000
Received: by outflank-mailman (input) for mailman id 647233;
 Mon, 04 Dec 2023 16:59: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 1rACIL-0001VW-Q3
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:59: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 1rACIL-000708-PB
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:59:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACIL-0003nM-OI
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:59:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=obY9qboYPNkmZbw5XiuZqFAD63fN3xnjv0r5wePHx4o=; b=hE4bwkSNlvEbBO/Li6xJWFm0VS
	wM9quMxidw/Qdi3VeUBa3osWrzVselMQA0i8YtbQtHzycPKlhttMWrjr2GDSc2VqqVQOwH7SgdquI
	7YWQRnAHzBwuKS/UMNQfKwN+iopO4pmRxmoAYSmHLjcAuZ1gXOsBa69OGWkY10V7dbcw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to tpmfront.c
Message-Id: <E1rACIL-0003nM-OI@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:59:45 +0000

commit 7b34559e035a5fb7840038d5e2be6ef05f6ebdd5
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:20 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to tpmfront.c
    
    Add the needed instances of EXPORT_SYMBOL() to tpmfront.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 tpmfront.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tpmfront.c b/tpmfront.c
index f4864d6..83768d0 100644
--- a/tpmfront.c
+++ b/tpmfront.c
@@ -338,6 +338,8 @@ error:
    shutdown_tpmfront(dev);
    return NULL;
 }
+EXPORT_SYMBOL(init_tpmfront);
+
 void shutdown_tpmfront(struct tpmfront_dev* dev)
 {
    char* err;
@@ -402,6 +404,7 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
    }
    free(dev);
 }
+EXPORT_SYMBOL(shutdown_tpmfront);
 
 int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 {
@@ -528,6 +531,7 @@ int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t*
 
    return 0;
 }
+EXPORT_SYMBOL(tpmfront_cmd);
 
 int tpmfront_set_locality(struct tpmfront_dev* dev, int locality)
 {
@@ -536,6 +540,7 @@ int tpmfront_set_locality(struct tpmfront_dev* dev, int locality)
    dev->page->locality = locality;
    return 0;
 }
+EXPORT_SYMBOL(tpmfront_set_locality);
 
 #ifdef HAVE_LIBC
 #include <errno.h>
@@ -663,5 +668,6 @@ int tpmfront_open(struct tpmfront_dev *dev)
 
     return dev->fd;
 }
+EXPORT_SYMBOL(tpmfront_open);
 
 #endif
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 16:59:56 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 16:59:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647234.1010148 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACIW-0001Zj-Dy; Mon, 04 Dec 2023 16:59:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647234.1010148; Mon, 04 Dec 2023 16:59: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 1rACIW-0001ZZ-BK; Mon, 04 Dec 2023 16:59:56 +0000
Received: by outflank-mailman (input) for mailman id 647234;
 Mon, 04 Dec 2023 16:59: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 1rACIV-0001ZL-Sm
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:59: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 1rACIV-00070H-S1
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:59:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACIV-0003oA-RE
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 16:59:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZWORrtujNnlIRVgAuChxS5xzwVBvFBTyl6csQmypLBM=; b=yLVXcSyt2xchcFH4c73KTVBP8K
	gbK3xA1kCbiOAKxlXziBJfVYuqHDCHHIi0uzpf7Q5eQ844Oj919av9RCs6DT9g5dI4pv6hM67f0PZ
	58ofuoSg4+3ftQDEiWTpXADGYO7KtOVZBjJQTb048wzM82fi7BbBDesrX5Fu6GeRU1jk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to tpm_tis.c
Message-Id: <E1rACIV-0003oA-RE@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 16:59:55 +0000

commit ec9bf07942c2354a078bd5381c046e272fca847c
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:21 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to tpm_tis.c
    
    Add the needed instances of EXPORT_SYMBOL() to tpm_tis.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tpm_tis.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tpm_tis.c b/tpm_tis.c
index c3998f2..ad95e28 100644
--- a/tpm_tis.c
+++ b/tpm_tis.c
@@ -673,6 +673,7 @@ int tpm_tis_request_locality(struct tpm_chip* tpm, int l) {
    printk("REQ LOCALITY FAILURE\n");
    return -1;
 }
+EXPORT_SYMBOL(tpm_tis_request_locality);
 
 static uint8_t tpm_tis_status(struct tpm_chip* tpm) {
    return ioread8(TPM_STS(tpm, tpm->locality));
@@ -1264,6 +1265,7 @@ abort_egress:
    }
    return NULL;
 }
+EXPORT_SYMBOL(init_tpm_tis);
 
 int tpm_tis_cmd(struct tpm_chip* tpm, uint8_t* req, size_t reqlen, uint8_t** resp, size_t* resplen)
 {
@@ -1281,6 +1283,7 @@ int tpm_tis_cmd(struct tpm_chip* tpm, uint8_t* req, size_t reqlen, uint8_t** res
    memcpy(*resp, tpm->data_buffer, *resplen);
    return 0;
 }
+EXPORT_SYMBOL(tpm_tis_cmd);
 
 #ifdef HAVE_LIBC
 #include <sys/stat.h>
@@ -1392,6 +1395,7 @@ int tpm_tis_open(struct tpm_chip *tpm)
 
     return tpm->fd;
 }
+EXPORT_SYMBOL(tpm_tis_open);
 
 /* TPM 2.0 */
 
@@ -1550,4 +1554,5 @@ abort_egress:
     }
     return NULL;
 }
+EXPORT_SYMBOL(init_tpm2_tis);
 #endif
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 17:00:09 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 17:00:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647235.1010151 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACIh-0002Z3-FP; Mon, 04 Dec 2023 17:00:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647235.1010151; Mon, 04 Dec 2023 17:00:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACIh-0002Yv-Co; Mon, 04 Dec 2023 17:00:07 +0000
Received: by outflank-mailman (input) for mailman id 647235;
 Mon, 04 Dec 2023 17:00:06 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACIg-0002XR-51
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 17:00:06 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACIf-00072s-Um
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 17:00:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACIf-0003r8-U1
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 17:00:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XC07F50mR+C0BSqf1G50L0Gy+FsSxMv+s3ckAtKPCeQ=; b=ylos91ouAFZ+UIze1yKSvO6nMu
	164iv5py5QkBzsWoPjIl9nVgyz+0M2YFxNzhI5yXhu2HLt+Zkar/dnhwE1mvshyiAx67QmZAhgeCH
	NSQvUq/2deq4x6edrCMFTGvVFvF7+3EYoNBOMmNZJrtfAWBHi9P57xJjrru2hxnJ3DFY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: add EXPORT_SYMBOL() instances to xenbus.c
Message-Id: <E1rACIf-0003r8-U1@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 17:00:05 +0000

commit fbdf8b2a0d6520fed9f8ac93ed2ef9d7c57f71fe
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:22 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: add EXPORT_SYMBOL() instances to xenbus.c
    
    Add the needed instances of EXPORT_SYMBOL() to xenbus.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 xenbus.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/xenbus.c b/xenbus.c
index 8bfd5bd..eb9af05 100644
--- a/xenbus.c
+++ b/xenbus.c
@@ -123,6 +123,7 @@ char **xenbus_wait_for_watch_return(xenbus_event_queue *queue)
 
     return &event->path;
 }
+EXPORT_SYMBOL(xenbus_wait_for_watch_return);
 
 void xenbus_wait_for_watch(xenbus_event_queue *queue)
 {
@@ -136,6 +137,7 @@ void xenbus_wait_for_watch(xenbus_event_queue *queue)
     else
         printk("unexpected path returned by watch\n");
 }
+EXPORT_SYMBOL(xenbus_wait_for_watch);
 
 void xenbus_release_wait_for_watch(xenbus_event_queue *queue)
 {
@@ -145,6 +147,7 @@ void xenbus_release_wait_for_watch(xenbus_event_queue *queue)
     *queue = event;
     wake_up(&xenbus_watch_queue);
 }
+EXPORT_SYMBOL(xenbus_release_wait_for_watch);
 
 char *xenbus_wait_for_value(const char *path, const char *value,
                             xenbus_event_queue *queue)
@@ -170,6 +173,7 @@ char *xenbus_wait_for_value(const char *path, const char *value,
         xenbus_wait_for_watch(queue);
     }
 }
+EXPORT_SYMBOL(xenbus_wait_for_value);
 
 char *xenbus_switch_state(xenbus_transaction_t xbt, const char *path,
                           XenbusState state)
@@ -220,6 +224,7 @@ exit:
 
     return msg;
 }
+EXPORT_SYMBOL(xenbus_switch_state);
 
 char *xenbus_wait_for_state_change(const char *path, XenbusState *state,
                                    xenbus_event_queue *queue)
@@ -249,6 +254,7 @@ char *xenbus_wait_for_state_change(const char *path, XenbusState *state,
     }
     return NULL;
 }
+EXPORT_SYMBOL(xenbus_wait_for_state_change);
 
 static void xenbus_read_data(char *buf, unsigned int len)
 {
@@ -602,6 +608,7 @@ struct xsd_sockmsg *xenbus_msg_reply(int type, xenbus_transaction_t trans,
 
     return rep;
 }
+EXPORT_SYMBOL(xenbus_msg_reply);
 
 static char *errmsg(struct xsd_sockmsg *rep)
 {
@@ -664,6 +671,7 @@ char *xenbus_ls(xenbus_transaction_t xbt, const char *pre, char ***contents)
 
     return NULL;
 }
+EXPORT_SYMBOL(xenbus_ls);
 
 char *xenbus_read(xenbus_transaction_t xbt, const char *path, char **value)
 {
@@ -687,6 +695,7 @@ char *xenbus_read(xenbus_transaction_t xbt, const char *path, char **value)
 
     return NULL;
 }
+EXPORT_SYMBOL(xenbus_read);
 
 char *xenbus_write(xenbus_transaction_t xbt, const char *path,
                    const char *value)
@@ -707,6 +716,7 @@ char *xenbus_write(xenbus_transaction_t xbt, const char *path,
 
     return NULL;
 }
+EXPORT_SYMBOL(xenbus_write);
 
 char* xenbus_watch_path_token(xenbus_transaction_t xbt, const char *path,
                               const char *token, xenbus_event_queue *events)
@@ -738,6 +748,7 @@ char* xenbus_watch_path_token(xenbus_transaction_t xbt, const char *path,
 
     return NULL;
 }
+EXPORT_SYMBOL(xenbus_watch_path_token);
 
 char* xenbus_unwatch_path_token(xenbus_transaction_t xbt, const char *path,
                                 const char *token)
@@ -771,6 +782,7 @@ char* xenbus_unwatch_path_token(xenbus_transaction_t xbt, const char *path,
 
     return NULL;
 }
+EXPORT_SYMBOL(xenbus_unwatch_path_token);
 
 char *xenbus_rm(xenbus_transaction_t xbt, const char *path)
 {
@@ -787,6 +799,7 @@ char *xenbus_rm(xenbus_transaction_t xbt, const char *path)
 
     return NULL;
 }
+EXPORT_SYMBOL(xenbus_rm);
 
 char *xenbus_get_perms(xenbus_transaction_t xbt, const char *path, char **value)
 {
@@ -810,6 +823,7 @@ char *xenbus_get_perms(xenbus_transaction_t xbt, const char *path, char **value)
 
     return NULL;
 }
+EXPORT_SYMBOL(xenbus_get_perms);
 
 #define PERM_MAX_SIZE 32
 char *xenbus_set_perms(xenbus_transaction_t xbt, const char *path, domid_t dom,
@@ -834,6 +848,7 @@ char *xenbus_set_perms(xenbus_transaction_t xbt, const char *path, domid_t dom,
 
     return NULL;
 }
+EXPORT_SYMBOL(xenbus_set_perms);
 
 char *xenbus_transaction_start(xenbus_transaction_t *xbt)
 {
@@ -855,6 +870,7 @@ char *xenbus_transaction_start(xenbus_transaction_t *xbt)
 
     return NULL;
 }
+EXPORT_SYMBOL(xenbus_transaction_start);
 
 char *xenbus_transaction_end(xenbus_transaction_t t, int abort, int *retry)
 {
@@ -883,6 +899,7 @@ char *xenbus_transaction_end(xenbus_transaction_t t, int abort, int *retry)
 
     return NULL;
 }
+EXPORT_SYMBOL(xenbus_transaction_end);
 
 int xenbus_read_integer(const char *path)
 {
@@ -902,6 +919,7 @@ int xenbus_read_integer(const char *path)
 
     return t;
 }
+EXPORT_SYMBOL(xenbus_read_integer);
 
 int xenbus_read_uuid(const char *path, unsigned char uuid[16])
 {
@@ -935,6 +953,7 @@ int xenbus_read_uuid(const char *path, unsigned char uuid[16])
 
     return 1;
 }
+EXPORT_SYMBOL(xenbus_read_uuid);
 
 #define BUFFER_SIZE 256
 static void xenbus_build_path(const char *dir, const char *node, char *res)
@@ -957,6 +976,7 @@ char *xenbus_printf(xenbus_transaction_t xbt, const char* node,
 
     return xenbus_write(xbt,fullpath,val);
 }
+EXPORT_SYMBOL(xenbus_printf);
 
 domid_t xenbus_get_self_id(void)
 {
@@ -968,6 +988,7 @@ domid_t xenbus_get_self_id(void)
 
     return ret;
 }
+EXPORT_SYMBOL(xenbus_get_self_id);
 
 char *xenbus_read_string(xenbus_transaction_t xbt, const char *dir,
                          const char *node, char **value)
@@ -978,6 +999,7 @@ char *xenbus_read_string(xenbus_transaction_t xbt, const char *dir,
 
     return xenbus_read(xbt, path, value);
 }
+EXPORT_SYMBOL(xenbus_read_string);
 
 char *xenbus_read_unsigned(xenbus_transaction_t xbt, const char *dir,
                            const char *node, unsigned int *value)
@@ -997,6 +1019,7 @@ char *xenbus_read_unsigned(xenbus_transaction_t xbt, const char *dir,
 
     return msg;
 }
+EXPORT_SYMBOL(xenbus_read_unsigned);
 
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 04 17:00:16 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Dec 2023 17:00:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.647236.1010156 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACIq-0002e4-II; Mon, 04 Dec 2023 17:00:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 647236.1010156; Mon, 04 Dec 2023 17:00:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rACIq-0002dw-Fc; Mon, 04 Dec 2023 17:00:16 +0000
Received: by outflank-mailman (input) for mailman id 647236;
 Mon, 04 Dec 2023 17:00:16 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACIq-0002do-21
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 17:00:16 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACIq-000732-1L
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 17:00:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rACIq-0003sA-0W
 for xen-changelog@lists.xenproject.org; Mon, 04 Dec 2023 17:00:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4NuMHwivlPxzOM6D1YZ8errU7ACof8+iKBtC+y68W5w=; b=uT0nOvw6BkLP8V9JssQKrx2o37
	QWgy8O6dfESVkBi5Pz9DUWD8dJT2spnrj14odea0LT+CLSfMe2Lmg9WxVpEeMTZ2t636K0AeYAkg7
	Y4gkfwzit11HjNB169Er4kljE4GoUWF+yiijxLL0nWmkaOugSdlsQ66nuQQvYOknz7KA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: hide all symbols not exported via EXPORT_SYMBOLS()
Message-Id: <E1rACIq-0003sA-0W@xenbits.xenproject.org>
Date: Mon, 04 Dec 2023 17:00:16 +0000

commit 33411a11f848853b6c81a38426faaab303477a31
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Nov 27 11:25:23 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Dec 4 16:52:57 2023 +0000

    Mini-OS: hide all symbols not exported via EXPORT_SYMBOLS()
    
    When doing the final linking of the Mini-OS kernel only keep the
    symbols visible which have been marked via EXPORT_SYMBOL().
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index 588496c..456aed0 100644
--- a/Makefile
+++ b/Makefile
@@ -167,6 +167,7 @@ $(OBJ_DIR)/arch/x86/minios-x86%.lds:  arch/x86/minios-x86.lds.S
 $(OBJ_DIR)/$(TARGET)-kern.o: $(OBJS) arch_lib $(OBJ_DIR)/$(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds
 	$(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(OBJS) $(LDARCHLIB) -o $@
 	$(OBJCOPY) --dump-section .export_symbol=$(OBJ_DIR)/syms $@
+	$(OBJCOPY) -w -G $(GLOBAL_PREFIX)* --keep-global-symbols=$(OBJ_DIR)/syms --remove-section=.export_symbol $@ $@
 
 $(OBJ_DIR)/$(TARGET): $(OBJ_DIR)/$(TARGET)-kern.o $(APP_O)
 	$(LD) -r $(LDFLAGS) $(OBJ_DIR)/$(TARGET)-kern.o $(APP_O) $(LDLIBS) -o $@.o
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 06 06:11:12 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 06 Dec 2023 06:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.648879.1012883 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rAl7f-0001ZR-5d; Wed, 06 Dec 2023 06:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 648879.1012883; Wed, 06 Dec 2023 06:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rAl7f-0001ZJ-2k; Wed, 06 Dec 2023 06:11:03 +0000
Received: by outflank-mailman (input) for mailman id 648879;
 Wed, 06 Dec 2023 06:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rAl7e-0001ZD-0Z
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rAl7d-0000LO-Rb
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rAl7d-0006h6-PT
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06:11:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=t774XmAz9aRMgndRmlcAF7w9GC6F1inWcqtKJwjLOHw=; b=2YkDP10uMINZARqFwyJGAdqWru
	f7LvgDGZhPwCYdKTKUOtBD8tqgk9SCMq1Cd6W+EQVRfpIj540CfirzMCBTGnpHrZE4y8a2JL1zdmc
	IQOjn4yTi3AtEzkiMMZwheLFxkmoU8EMpdmHz6jA/Phi4q1sEB0zfEiP32R8y7FEDox8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/p2m: preparation work for xenmem_add_to_physmap_one()
Message-Id: <E1rAl7d-0006h6-PT@xenbits.xenproject.org>
Date: Wed, 06 Dec 2023 06:11:01 +0000

commit f0a00ab1a62164908cf50dfbd42963e1797fe3ca
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Tue Dec 5 09:54:07 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 5 09:54:07 2023 +0100

    x86/p2m: preparation work for xenmem_add_to_physmap_one()
    
    The objective is to use parameter name "gfn" for
    xenmem_add_to_physmap_one().
    Since the name "gfn" is currently used 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
    "gfn" to "gmfn", in line with XENMAPSPACE_gmfn which is the only
    space it is used with.
    
    No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm/p2m.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index fe9ccabb87..42508e1e7e 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2417,7 +2417,7 @@ int xenmem_add_to_physmap_one(
     gfn_t gpfn)
 {
     struct page_info *page = NULL;
-    unsigned long gfn = 0 /* gcc ... */, old_gpfn;
+    unsigned long gmfn = 0 /* gcc ... */, old_gpfn;
     mfn_t prev_mfn;
     int rc = 0;
     mfn_t mfn = INVALID_MFN;
@@ -2440,12 +2440,12 @@ int xenmem_add_to_physmap_one(
 
     case XENMAPSPACE_gmfn:
     {
-        gfn = idx;
-        mfn = get_gfn_unshare(d, gfn, &p2mt);
+        gmfn = idx;
+        mfn = get_gfn_unshare(d, gmfn, &p2mt);
         /* If the page is still shared, exit early */
         if ( p2m_is_shared(p2mt) )
         {
-            put_gfn(d, gfn);
+            put_gfn(d, gmfn);
             return -ENOMEM;
         }
         page = get_page_from_mfn(mfn, d);
@@ -2480,7 +2480,7 @@ int xenmem_add_to_physmap_one(
     /* XENMAPSPACE_gmfn: Check if the MFN is associated with another GFN. */
     old_gpfn = get_gpfn_from_mfn(mfn_x(mfn));
     ASSERT(!SHARED_M2P(old_gpfn));
-    if ( space == XENMAPSPACE_gmfn && old_gpfn != gfn )
+    if ( space == XENMAPSPACE_gmfn && old_gpfn != gmfn )
     {
         rc = -EXDEV;
         goto put_all;
@@ -2518,7 +2518,7 @@ int xenmem_add_to_physmap_one(
      */
     if ( space == XENMAPSPACE_gmfn )
     {
-        put_gfn(d, gfn);
+        put_gfn(d, gmfn);
         if ( !rc && extra.ppage )
         {
             *extra.ppage = page;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 06 06:11:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 06 Dec 2023 06:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.648880.1012886 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rAl7p-0001bI-6X; Wed, 06 Dec 2023 06:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 648880.1012886; Wed, 06 Dec 2023 06: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 1rAl7p-0001bB-46; Wed, 06 Dec 2023 06:11:13 +0000
Received: by outflank-mailman (input) for mailman id 648880;
 Wed, 06 Dec 2023 06:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rAl7o-0001at-0A
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rAl7n-0000Ln-Vf
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rAl7n-0006iM-Tj
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06:11:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WO1K3UwG2y2WMPz5JfYXGmliyn5q7fNFkfzkCcHZryc=; b=fCiHReoae4aIWBYDvoSGmo9Q8t
	JnUApkIXldnVYfrIWEEOHE7I75vKh7peRUdBGr3SqeoLJM9TefVgx73GI9dd0UZDpU5is0JceoYO8
	9TA6r+El39Cl3vdLEENJtOjcshdrgJc0SPR+vIRHMJ2UGiE3jPTj0hSMMgVooP3AZ7TQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/p2m: address a violation of MISRA C:2012 Rule 8.3
Message-Id: <E1rAl7n-0006iM-Tj@xenbits.xenproject.org>
Date: Wed, 06 Dec 2023 06:11:11 +0000

commit 80a7669afd7ef42c79da17132668ad22c72ce66d
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Tue Dec 5 09:54:52 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 5 09:54:52 2023 +0100

    x86/p2m: address a violation of MISRA C:2012 Rule 8.3
    
    Make function declaration and definition consistent changing
    parameter name from "gpfn" to "gfn".
    For consistency, rename also "old_gpfn" to "old_gfn".
    No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm/p2m.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 42508e1e7e..6eb446e437 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2414,10 +2414,10 @@ int xenmem_add_to_physmap_one(
     unsigned int space,
     union add_to_physmap_extra extra,
     unsigned long idx,
-    gfn_t gpfn)
+    gfn_t gfn)
 {
     struct page_info *page = NULL;
-    unsigned long gmfn = 0 /* gcc ... */, old_gpfn;
+    unsigned long gmfn = 0 /* gcc ... */, old_gfn;
     mfn_t prev_mfn;
     int rc = 0;
     mfn_t mfn = INVALID_MFN;
@@ -2431,7 +2431,7 @@ int xenmem_add_to_physmap_one(
         break;
 
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gpfn, &mfn);
+        rc = gnttab_map_frame(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
         /* Need to take care of the reference obtained in gnttab_map_frame(). */
@@ -2455,7 +2455,7 @@ int xenmem_add_to_physmap_one(
     }
 
     case XENMAPSPACE_gmfn_foreign:
-        return p2m_add_foreign(d, idx, gfn_x(gpfn), extra.foreign_domid);
+        return p2m_add_foreign(d, idx, gfn_x(gfn), extra.foreign_domid);
     }
 
     if ( mfn_eq(mfn, INVALID_MFN) )
@@ -2475,12 +2475,12 @@ int xenmem_add_to_physmap_one(
      * Upon freeing we wouldn't be able to find other mappings in the P2M
      * (unless we did a brute force search).
      */
-    prev_mfn = get_gfn(d, gfn_x(gpfn), &p2mt);
+    prev_mfn = get_gfn(d, gfn_x(gfn), &p2mt);
 
     /* XENMAPSPACE_gmfn: Check if the MFN is associated with another GFN. */
-    old_gpfn = get_gpfn_from_mfn(mfn_x(mfn));
-    ASSERT(!SHARED_M2P(old_gpfn));
-    if ( space == XENMAPSPACE_gmfn && old_gpfn != gmfn )
+    old_gfn = get_gpfn_from_mfn(mfn_x(mfn));
+    ASSERT(!SHARED_M2P(old_gfn));
+    if ( space == XENMAPSPACE_gmfn && old_gfn != gmfn )
     {
         rc = -EXDEV;
         goto put_all;
@@ -2493,22 +2493,22 @@ int xenmem_add_to_physmap_one(
     {
         if ( is_special_page(mfn_to_page(prev_mfn)) )
             /* Special pages are simply unhooked from this phys slot. */
-            rc = p2m_remove_page(d, gpfn, prev_mfn, PAGE_ORDER_4K);
+            rc = p2m_remove_page(d, gfn, prev_mfn, PAGE_ORDER_4K);
         else if ( !mfn_eq(mfn, prev_mfn) )
             /* Normal domain memory is freed, to avoid leaking memory. */
-            rc = guest_remove_page(d, gfn_x(gpfn));
+            rc = guest_remove_page(d, gfn_x(gfn));
     }
 
     /* Unmap from old location, if any. */
-    if ( !rc && old_gpfn != INVALID_M2P_ENTRY && !gfn_eq(_gfn(old_gpfn), gpfn) )
-        rc = p2m_remove_page(d, _gfn(old_gpfn), mfn, PAGE_ORDER_4K);
+    if ( !rc && old_gfn != INVALID_M2P_ENTRY && !gfn_eq(_gfn(old_gfn), gfn) )
+        rc = p2m_remove_page(d, _gfn(old_gfn), mfn, PAGE_ORDER_4K);
 
     /* Map at new location. */
     if ( !rc )
-        rc = p2m_add_page(d, gpfn, mfn, PAGE_ORDER_4K, p2m_ram_rw);
+        rc = p2m_add_page(d, gfn, mfn, PAGE_ORDER_4K, p2m_ram_rw);
 
  put_all:
-    put_gfn(d, gfn_x(gpfn));
+    put_gfn(d, gfn_x(gfn));
 
  put_both:
     /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 06 06:11:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 06 Dec 2023 06:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.648881.1012891 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rAl7z-0001du-8D; Wed, 06 Dec 2023 06:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 648881.1012891; Wed, 06 Dec 2023 06: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 1rAl7z-0001dm-5X; Wed, 06 Dec 2023 06:11:23 +0000
Received: by outflank-mailman (input) for mailman id 648881;
 Wed, 06 Dec 2023 06:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rAl7y-0001dW-43
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06:11:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rAl7y-0000M0-3J
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rAl7y-0006ir-1j
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06:11:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Vu3ny1S973SqoUnqBxvWgQ5WM+N3/BHvUfhZATqIlqo=; b=roXYs08pWCAKXj5m/2X/PfkW1G
	fnUuwQvNE7MNx8vIFirJmc8/sr/DvjjkLJsF+S4DH60XDqolxMyI2WDQSzdiT/nxl3+6/UBwsGt4q
	KzIZuKAtr+HTMo6Ue8NkvHd+/e7YtR636GZRFqj2fxQpjMlgJc5UleNqVlsAZiDvrUn4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/public: fix flexible array definitions
Message-Id: <E1rAl7y-0006ir-1j@xenbits.xenproject.org>
Date: Wed, 06 Dec 2023 06:11:22 +0000

commit 93d913c6e66e01597681d0a456c1523279218524
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Dec 5 09:56:08 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 5 09:56:08 2023 +0100

    xen/public: fix flexible array definitions
    
    Flexible arrays in public headers can be problematic with some
    compilers.
    
    With XEN_FLEX_ARRAY_DIM there is a mechanism available to deal with
    this issue, but care must be taken to not change the affected structs
    in an incompatible way.
    
    So bump __XEN_LATEST_INTERFACE_VERSION__ and introduce a new macro
    XENPV_FLEX_ARRAY_DIM which will be XENPV_FLEX_ARRAY_DIM with the
    interface version being new enough and "1" (the value used today in
    the affected headers) when the interface version is an old one.
    
    Replace the arr[1] instances (this includes the ones seen to be
    problematic in recent Linux kernels [1]) with arr[XENPV_FLEX_ARRAY_DIM]
    in order to avoid compilation errors.
    
    [1]: https://bugzilla.kernel.org/show_bug.cgi?id=217693
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Henry Wang <Henry.Wang@arm.com> # CHANGELOG
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 CHANGELOG.md                     |  2 ++
 xen/include/public/io/cameraif.h |  2 +-
 xen/include/public/io/displif.h  |  2 +-
 xen/include/public/io/fsif.h     |  4 ++--
 xen/include/public/io/pvcalls.h  |  2 +-
 xen/include/public/io/ring.h     | 12 ++++++++++--
 xen/include/public/io/sndif.h    |  2 +-
 xen/include/public/xen-compat.h  |  2 +-
 8 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4ecebb9f68..5ee5d41fc9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,8 @@ 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
+ - Changed flexible array definitions in public I/O interface headers to not
+   use "1" as the number of array elements.
 
 ### Added
  - On x86:
diff --git a/xen/include/public/io/cameraif.h b/xen/include/public/io/cameraif.h
index 13763abef9..a389443769 100644
--- a/xen/include/public/io/cameraif.h
+++ b/xen/include/public/io/cameraif.h
@@ -763,7 +763,7 @@ struct xencamera_buf_create_req {
  */
 struct xencamera_page_directory {
     grant_ref_t gref_dir_next_page;
-    grant_ref_t gref[1]; /* Variable length */
+    grant_ref_t gref[XENPV_FLEX_ARRAY_DIM];
 };
 
 /*
diff --git a/xen/include/public/io/displif.h b/xen/include/public/io/displif.h
index 73d0cbdf15..132c96fa5c 100644
--- a/xen/include/public/io/displif.h
+++ b/xen/include/public/io/displif.h
@@ -537,7 +537,7 @@ struct xendispl_dbuf_create_req {
 
 struct xendispl_page_directory {
     grant_ref_t gref_dir_next_page;
-    grant_ref_t gref[1]; /* Variable length */
+    grant_ref_t gref[XENPV_FLEX_ARRAY_DIM];
 };
 
 /*
diff --git a/xen/include/public/io/fsif.h b/xen/include/public/io/fsif.h
index ec57850233..dcade1c698 100644
--- a/xen/include/public/io/fsif.h
+++ b/xen/include/public/io/fsif.h
@@ -40,7 +40,7 @@ struct fsif_read_request {
     int32_t pad;
     uint64_t len;
     uint64_t offset;
-    grant_ref_t grefs[1];  /* Variable length */
+    grant_ref_t grefs[XENPV_FLEX_ARRAY_DIM];
 };
 
 struct fsif_write_request {
@@ -48,7 +48,7 @@ struct fsif_write_request {
     int32_t pad;
     uint64_t len;
     uint64_t offset;
-    grant_ref_t grefs[1];  /* Variable length */
+    grant_ref_t grefs[XENPV_FLEX_ARRAY_DIM];
 };
 
 struct fsif_stat_request {
diff --git a/xen/include/public/io/pvcalls.h b/xen/include/public/io/pvcalls.h
index 230b0719e3..c8c7602470 100644
--- a/xen/include/public/io/pvcalls.h
+++ b/xen/include/public/io/pvcalls.h
@@ -30,7 +30,7 @@ struct pvcalls_data_intf {
     uint8_t pad2[52];
 
     RING_IDX ring_order;
-    grant_ref_t ref[];
+    grant_ref_t ref[XEN_FLEX_ARRAY_DIM];
 };
 DEFINE_XEN_FLEX_RING(pvcalls);
 
diff --git a/xen/include/public/io/ring.h b/xen/include/public/io/ring.h
index 0cae4367be..a79d913142 100644
--- a/xen/include/public/io/ring.h
+++ b/xen/include/public/io/ring.h
@@ -25,8 +25,16 @@
  * and grant_table.h from the Xen public headers.
  */
 
+#include "../xen.h"
 #include "../xen-compat.h"
 
+/* Some PV I/O interfaces need a compatibility variant. */
+#if __XEN_INTERFACE_VERSION__ < 0x00041300
+#define XENPV_FLEX_ARRAY_DIM  1 /* variable size */
+#else
+#define XENPV_FLEX_ARRAY_DIM  XEN_FLEX_ARRAY_DIM
+#endif
+
 #if __XEN_INTERFACE_VERSION__ < 0x00030208
 #define xen_mb()  mb()
 #define xen_rmb() rmb()
@@ -110,7 +118,7 @@ struct __name##_sring {                                                 \
         uint8_t pvt_pad[4];                                             \
     } pvt;                                                              \
     uint8_t __pad[44];                                                  \
-    union __name##_sring_entry ring[1]; /* variable-length */           \
+    union __name##_sring_entry ring[XENPV_FLEX_ARRAY_DIM];              \
 };                                                                      \
                                                                         \
 /* "Front" end's private variables */                                   \
@@ -479,7 +487,7 @@ struct name##_data_intf {                                                     \
     uint8_t pad2[56];                                                         \
                                                                               \
     RING_IDX ring_order;                                                      \
-    grant_ref_t ref[];                                                        \
+    grant_ref_t ref[XEN_FLEX_ARRAY_DIM];                                      \
 };                                                                            \
 DEFINE_XEN_FLEX_RING(name)
 
diff --git a/xen/include/public/io/sndif.h b/xen/include/public/io/sndif.h
index 4234a47c87..cce1459b7b 100644
--- a/xen/include/public/io/sndif.h
+++ b/xen/include/public/io/sndif.h
@@ -659,7 +659,7 @@ struct xensnd_open_req {
 
 struct xensnd_page_directory {
     grant_ref_t gref_dir_next_page;
-    grant_ref_t gref[1]; /* Variable length */
+    grant_ref_t gref[XENPV_FLEX_ARRAY_DIM];
 };
 
 /*
diff --git a/xen/include/public/xen-compat.h b/xen/include/public/xen-compat.h
index 97fe698498..078b796664 100644
--- a/xen/include/public/xen-compat.h
+++ b/xen/include/public/xen-compat.h
@@ -10,7 +10,7 @@
 #ifndef __XEN_PUBLIC_XEN_COMPAT_H__
 #define __XEN_PUBLIC_XEN_COMPAT_H__
 
-#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040e00
+#define __XEN_LATEST_INTERFACE_VERSION__ 0x00041300
 
 #if defined(__XEN__) || defined(__XEN_TOOLS__)
 /* Xen is built with matching headers and implements the latest interface. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 06 06:11:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 06 Dec 2023 06:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.648883.1012894 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rAl89-0001gm-9X; Wed, 06 Dec 2023 06:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 648883.1012894; Wed, 06 Dec 2023 06: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 1rAl89-0001ge-71; Wed, 06 Dec 2023 06:11:33 +0000
Received: by outflank-mailman (input) for mailman id 648883;
 Wed, 06 Dec 2023 06: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 1rAl88-0001gV-7o
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06: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 1rAl88-0000Ng-79
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rAl88-0006jG-5k
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06: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=0s4oVzrXjmxTzzbBtVFaiU0ASo5RtX5CgdQj0ZfDhRc=; b=hCaXweCY5F5h39Ovbu3h/Xffql
	w9kKQ+9UjlDo76YaRdJTRovRD3bNZsXZj4DKBh2xLNjB9hdgrAiNF94VMxDmyO0BLOCI2k5Kb1GwS
	LETtbiCFMg/3KfjJI6FJXIdE2KKkXktDBgDFJRNE2eC3nmtUaHj5zSys7IQVpwkZMgbk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86emul: avoid triggering event related assertions
Message-Id: <E1rAl88-0006jG-5k@xenbits.xenproject.org>
Date: Wed, 06 Dec 2023 06:11:32 +0000

commit 787d11c5aaf4d3411d4658cff137cd49b0bd951b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 5 09:57:05 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 5 09:57:05 2023 +0100

    x86emul: avoid triggering event related assertions
    
    The assertion at the end of x86_emulate_wrapper() as well as the ones
    in x86_emul_{hw_exception,pagefault}() can trigger if we ignore
    X86EMUL_EXCEPTION coming back from certain hook functions. Squash
    exceptions when merely probing MSRs, plus on SWAPGS'es "best effort"
    error handling path.
    
    In adjust_bnd() add another assertion after the read_xcr(0, ...)
    invocation, paralleling the one in x86emul_get_fpu() - XCR0 reads should
    never fault when XSAVE is (implicitly) known to be available.
    
    Also update the respective comment in x86_emulate_wrapper().
    
    Fixes: 14a6be89ec04 ("x86emul: correct EFLAGS.TF handling")
    Fixes: cb2626c75813 ("x86emul: conditionally clear BNDn for branches")
    Fixes: 6eb43fcf8a0b ("x86emul: support SWAPGS")
    Reported-by: AFL
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/x86_emulate/0f01.c        |  6 ++++--
 xen/arch/x86/x86_emulate/0fae.c        |  3 +++
 xen/arch/x86/x86_emulate/x86_emulate.c | 28 +++++++++++++++++++++++-----
 3 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/0f01.c b/xen/arch/x86/x86_emulate/0f01.c
index ba43fc394b..1ba99609d6 100644
--- a/xen/arch/x86/x86_emulate/0f01.c
+++ b/xen/arch/x86/x86_emulate/0f01.c
@@ -200,8 +200,10 @@ int x86emul_0f01(struct x86_emulate_state *s,
         if ( (rc = ops->write_segment(x86_seg_gs, &sreg,
                                       ctxt)) != X86EMUL_OKAY )
         {
-            /* Best effort unwind (i.e. no error checking). */
-            ops->write_msr(MSR_SHADOW_GS_BASE, msr_val, ctxt);
+            /* Best effort unwind (i.e. no real error checking). */
+            if ( ops->write_msr(MSR_SHADOW_GS_BASE, msr_val,
+                                ctxt) == X86EMUL_EXCEPTION )
+                x86_emul_reset_event(ctxt);
             goto done;
         }
         break;
diff --git a/xen/arch/x86/x86_emulate/0fae.c b/xen/arch/x86/x86_emulate/0fae.c
index 00840b1d07..ba77af58f2 100644
--- a/xen/arch/x86/x86_emulate/0fae.c
+++ b/xen/arch/x86/x86_emulate/0fae.c
@@ -55,7 +55,10 @@ int x86emul_0fae(struct x86_emulate_state *s,
                     cr4 = X86_CR4_OSFXSR;
                 if ( !ops->read_msr ||
                      ops->read_msr(MSR_EFER, &msr_val, ctxt) != X86EMUL_OKAY )
+                {
+                    x86_emul_reset_event(ctxt);
                     msr_val = 0;
+                }
                 if ( !(cr4 & X86_CR4_OSFXSR) ||
                      (mode_64bit() && mode_ring0() && (msr_val & EFER_FFXSE)) )
                     s->op_bytes = offsetof(struct x86_fxsr, xmm[0]);
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 94caec1d14..cf780da501 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -1143,10 +1143,18 @@ static bool is_branch_step(struct x86_emulate_ctxt *ctxt,
                            const struct x86_emulate_ops *ops)
 {
     uint64_t debugctl;
+    int rc = X86EMUL_UNHANDLEABLE;
 
-    return ops->read_msr &&
-           ops->read_msr(MSR_IA32_DEBUGCTLMSR, &debugctl, ctxt) == X86EMUL_OKAY &&
-           (debugctl & IA32_DEBUGCTLMSR_BTF);
+    if ( !ops->read_msr ||
+         (rc = ops->read_msr(MSR_IA32_DEBUGCTLMSR, &debugctl,
+                             ctxt)) != X86EMUL_OKAY )
+    {
+        if ( rc == X86EMUL_EXCEPTION )
+            x86_emul_reset_event(ctxt);
+        debugctl = 0;
+    }
+
+    return debugctl & IA32_DEBUGCTLMSR_BTF;
 }
 
 static void adjust_bnd(struct x86_emulate_ctxt *ctxt,
@@ -1160,13 +1168,21 @@ static void adjust_bnd(struct x86_emulate_ctxt *ctxt,
 
     if ( !ops->read_xcr || ops->read_xcr(0, &xcr0, ctxt) != X86EMUL_OKAY ||
          !(xcr0 & X86_XCR0_BNDREGS) || !(xcr0 & X86_XCR0_BNDCSR) )
+    {
+        ASSERT(!ctxt->event_pending);
         return;
+    }
 
     if ( !mode_ring0() )
         bndcfg = read_bndcfgu();
     else if ( !ops->read_msr ||
-              ops->read_msr(MSR_IA32_BNDCFGS, &bndcfg, ctxt) != X86EMUL_OKAY )
+              (rc = ops->read_msr(MSR_IA32_BNDCFGS, &bndcfg,
+                                  ctxt)) != X86EMUL_OKAY )
+    {
+        if ( rc == X86EMUL_EXCEPTION )
+            x86_emul_reset_event(ctxt);
         return;
+    }
     if ( (bndcfg & IA32_BNDCFGS_ENABLE) && !(bndcfg & IA32_BNDCFGS_PRESERVE) )
     {
         /*
@@ -8677,7 +8693,9 @@ int x86_emulate_wrapper(
      * An event being pending should exactly match returning
      * X86EMUL_EXCEPTION.  (If this trips, the chances are a codepath has
      * called hvm_inject_hw_exception() rather than using
-     * x86_emul_hw_exception().)
+     * x86_emul_hw_exception(), or the invocation of a hook has caused an
+     * exception to be raised, while the caller was only checking for
+     * success/failure.)
      */
     ASSERT(ctxt->event_pending == (rc == X86EMUL_EXCEPTION));
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 06 06:11:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 06 Dec 2023 06:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.648884.1012899 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rAl8J-0001ko-B3; Wed, 06 Dec 2023 06:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 648884.1012899; Wed, 06 Dec 2023 06: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 1rAl8J-0001kg-8S; Wed, 06 Dec 2023 06:11:43 +0000
Received: by outflank-mailman (input) for mailman id 648884;
 Wed, 06 Dec 2023 06: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 1rAl8I-0001kY-BU
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06: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 1rAl8I-0000Nr-Ah
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rAl8I-0006jf-9D
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06: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=L/HiThr4Odr/R/vPchbX1QirVqhOdLUkfeMjpXiI4bM=; b=l/AO0BQQFWYI6Lif58rFLiKleK
	tAD5eTaAkXLbk4EH3PNvq0A2LM1skBcMYAIqLi7Nm4HcibJlAytcJ/OHUoqdtmLpz7gf8Tcw2BPSv
	Nh5CwwihoyWlIqB2Kr/xKSq3/GKsNfX5Pd3ABpqOEoAsDFQEVY4y5KF7NCyG6SexLr2g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/sched: fix adding offline cpu to cpupool
Message-Id: <E1rAl8I-0006jf-9D@xenbits.xenproject.org>
Date: Wed, 06 Dec 2023 06:11:42 +0000

commit 06e8d65d33896aa90f5b6d9b2bce7f11433b33c9
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Dec 5 09:57:38 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 5 09:57:38 2023 +0100

    xen/sched: fix adding offline cpu to cpupool
    
    Trying to add an offline cpu to a cpupool can crash the hypervisor,
    as the probably non-existing percpu area of the cpu is accessed before
    the availability of the cpu is being tested. This can happen in case
    the cpupool's granularity is "core" or "socket".
    
    Fix that by testing the cpu to be online.
    
    Fixes: cb563d7665f2 ("xen/sched: support core scheduling for moving cpus to/from cpupools")
    Reported-by: René Winther Højgaard <renewin@proton.me>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/sched/cpupool.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/common/sched/cpupool.c b/xen/common/sched/cpupool.c
index 2e094b0cfa..ad8f608462 100644
--- a/xen/common/sched/cpupool.c
+++ b/xen/common/sched/cpupool.c
@@ -892,6 +892,8 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op)
         if ( cpu >= nr_cpu_ids )
             goto addcpu_out;
         ret = -ENODEV;
+        if ( !cpu_online(cpu) )
+            goto addcpu_out;
         cpus = sched_get_opt_cpumask(c->gran, cpu);
         if ( !cpumask_subset(cpus, &cpupool_free_cpus) ||
              cpumask_intersects(cpus, &cpupool_locked_cpus) )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 06 06:11:53 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 06 Dec 2023 06:11:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.648885.1012903 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rAl8T-0001oM-E3; Wed, 06 Dec 2023 06:11:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 648885.1012903; Wed, 06 Dec 2023 06: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 1rAl8T-0001oE-BL; Wed, 06 Dec 2023 06:11:53 +0000
Received: by outflank-mailman (input) for mailman id 648885;
 Wed, 06 Dec 2023 06: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 1rAl8S-0001o4-EJ
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06: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 1rAl8S-0000Nz-DZ
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rAl8S-0006k5-Ch
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06: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=Au/7puh5u64M5VTJG6C9uo0PYRUKyFwo+GdYYWDBzwA=; b=pozW5nx4UQsVje1xipGYN5u6cH
	gkoCWG++MmTkTFSIQ9EuLMwSKgnAomQjbiBkfj3XhfDyP8W6h1Y6IOgW8d/g4uEegRAVd2vZGHBUE
	jW3ixkRgajBp+HaZ7DnkSQ2SfoOXHinzvA7xrl/U21P8vDsNLryWds6SqPUcz2z7+YKw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] bump default SeaBIOS version to 1.16.3
Message-Id: <E1rAl8S-0006k5-Ch@xenbits.xenproject.org>
Date: Wed, 06 Dec 2023 06:11:52 +0000

commit 3e7a3f08ce05f030fcd727604051c70ffac7f207
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 5 09:58:17 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 5 09:58:17 2023 +0100

    bump default SeaBIOS version to 1.16.3
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 Config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Config.mk b/Config.mk
index 2c43702958..594c70d8bb 100644
--- a/Config.mk
+++ b/Config.mk
@@ -229,7 +229,7 @@ MINIOS_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/mini-os.git
 MINIOS_UPSTREAM_REVISION ?= b08019f0b2fbc30c75169a160acb9fd9af5d68f4
 
 SEABIOS_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/seabios.git
-SEABIOS_UPSTREAM_REVISION ?= rel-1.16.2
+SEABIOS_UPSTREAM_REVISION ?= rel-1.16.3
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 06 06:12:03 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 06 Dec 2023 06:12:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.648886.1012909 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rAl8d-0001r4-GP; Wed, 06 Dec 2023 06:12:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 648886.1012909; Wed, 06 Dec 2023 06: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 1rAl8d-0001qw-Cl; Wed, 06 Dec 2023 06:12:03 +0000
Received: by outflank-mailman (input) for mailman id 648886;
 Wed, 06 Dec 2023 06: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 1rAl8c-0001qp-Gz
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06: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 1rAl8c-0000OU-GG
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06:12:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rAl8c-0006l3-Fa
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06: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=I2fU+B+tTTLdkhsEOE0HjEz+6rmXe0V57vPNwWoo0Ug=; b=yvvILr5W1usAcU040aeutNmy2a
	8Y/O3I59g338+L8PULAMlcsHQQixBYVaszjR6PX5QFrUGA6nv3huulVxtUe7Ob6P0JhxCocp+UQ79
	LXXZwtCBqhADXr/Vh2SprbHpwLTgghcExRX/YWnqGBqHnslAphQzibtt6AI6lGbbFscs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: address violations of MISRA C:2012 Rule 11.8
Message-Id: <E1rAl8c-0006l3-Fa@xenbits.xenproject.org>
Date: Wed, 06 Dec 2023 06:12:02 +0000

commit 6f7db3e0a01cb532ebe34fad7a5b58a16a237c91
Author:     Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
AuthorDate: Tue Dec 5 09:58:37 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 5 09:58:37 2023 +0100

    xen: address violations of MISRA C:2012 Rule 11.8
    
    Remove or amend casts to comply with Rule 11.8.
    
    Fix violations by adding missing const qualifier in cast.
    Fix violations by removing unnecessary cast.
    Change type of operands from char* to uintptr_t: uintptr_t is
    the appropriate type for memory address operations.
    
    No functional changes.
    
    Signed-off-by: Maria Celeste Cesario  <maria.celeste.cesario@bugseng.com>
    Signed-off-by: Simone Ballarin  <simone.ballarin@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/dom0less-build.c     | 2 +-
 xen/arch/arm/include/asm/atomic.h | 2 +-
 xen/arch/arm/include/asm/regs.h   | 2 +-
 xen/arch/x86/include/asm/regs.h   | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index d39cbd969a..fb63ec6fd1 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -354,7 +354,7 @@ static int __init handle_passthrough_prop(struct kernel_info *kinfo,
     if ( node == NULL )
     {
         printk(XENLOG_ERR "Couldn't find node %s in host_dt!\n",
-               (char *)xen_path->data);
+               xen_path->data);
         return -EINVAL;
     }
 
diff --git a/xen/arch/arm/include/asm/atomic.h b/xen/arch/arm/include/asm/atomic.h
index 64314d59b3..517216d2a8 100644
--- a/xen/arch/arm/include/asm/atomic.h
+++ b/xen/arch/arm/include/asm/atomic.h
@@ -154,7 +154,7 @@ static always_inline void write_atomic_size(volatile void *p,
  */
 static inline int atomic_read(const atomic_t *v)
 {
-    return *(volatile int *)&v->counter;
+    return *(const volatile int *)&v->counter;
 }
 
 static inline int _atomic_read(atomic_t v)
diff --git a/xen/arch/arm/include/asm/regs.h b/xen/arch/arm/include/asm/regs.h
index 8a0db95415..f998aedff5 100644
--- a/xen/arch/arm/include/asm/regs.h
+++ b/xen/arch/arm/include/asm/regs.h
@@ -48,7 +48,7 @@ static inline bool regs_mode_is_32bit(const struct cpu_user_regs *regs)
 
 static inline bool guest_mode(const struct cpu_user_regs *r)
 {
-    unsigned long diff = (char *)guest_cpu_user_regs() - (char *)(r);
+    unsigned long diff = (uintptr_t)guest_cpu_user_regs() - (uintptr_t)(r);
     /* Frame pointer must point into current CPU stack. */
     ASSERT(diff < STACK_SIZE);
     /* If not a guest frame, it must be a hypervisor frame. */
diff --git a/xen/arch/x86/include/asm/regs.h b/xen/arch/x86/include/asm/regs.h
index 3fb94deedc..ddf5e14e57 100644
--- a/xen/arch/x86/include/asm/regs.h
+++ b/xen/arch/x86/include/asm/regs.h
@@ -6,7 +6,7 @@
 
 #define guest_mode(r)                                                         \
 ({                                                                            \
-    unsigned long diff = (char *)guest_cpu_user_regs() - (char *)(r);         \
+    unsigned long diff = (uintptr_t)guest_cpu_user_regs() - (uintptr_t)(r);   \
     /* Frame pointer must point into current CPU stack. */                    \
     ASSERT(diff < STACK_SIZE);                                                \
     /* If not a guest frame, it must be a hypervisor frame. */                \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 06 06:12:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 06 Dec 2023 06:12:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.648887.1012911 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rAl8n-0001u2-Gr; Wed, 06 Dec 2023 06:12:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 648887.1012911; Wed, 06 Dec 2023 06: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 1rAl8n-0001tu-ED; Wed, 06 Dec 2023 06:12:13 +0000
Received: by outflank-mailman (input) for mailman id 648887;
 Wed, 06 Dec 2023 06: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 1rAl8m-0001ti-Ld
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06: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 1rAl8m-0000Oz-JJ
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06:12:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rAl8m-0006lW-IK
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06: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=ggTMdVIrggMccqeujy/hxf3mfj0AdjNUc2DnzPfMNzA=; b=e/oQunDGWnJcKniziz5+xije7/
	bimsMF7dRTAec0j8KIQp5gTW6QbLPhueNN3IG57eW414lJXu8+cKsXmxFruSLCkaSqa3dq+qQgvsT
	Xrbv4xfvHtv/yFJa/slO0VlUkCCWqGGaagwlgkAA+Q7M7m6xFqr5JRzPkZnrGXdc76IU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/vpci: header: status register handler
Message-Id: <E1rAl8m-0006lW-IK@xenbits.xenproject.org>
Date: Wed, 06 Dec 2023 06:12:12 +0000

commit a3c8fb450a8911266c38dbbc88503eae9cc12ba4
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Tue Dec 5 09:59:45 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 5 09:59:45 2023 +0100

    xen/vpci: header: status register handler
    
    Introduce a handler for the PCI status register, with ability to mask
    the capabilities bit. The status register contains RsvdZ bits,
    read-only bits, and write-1-to-clear bits. Additionally, we use RsvdP to
    mask the capabilities bit. Introduce bitmasks to handle these in vPCI.
    If a bit in the bitmask is set, then the special meaning applies:
    
      ro_mask: read normal, guest write ignore (preserve on write to hardware)
      rw1c_mask: read normal, write 1 to clear
      rsvdp_mask: read as zero, guest write ignore (preserve on write to hardware)
      rsvdz_mask: read as zero, guest write ignore (write zero to hardware)
    
    The RO/RW1C/RsvdP/RsvdZ naming and definitions were borrowed from the
    PCI Express Base 6.1 specification. RsvdP/RsvdZ bits help Xen enforce
    our view of the world. Xen preserves the value of read-only bits on
    write to hardware, discarding the guests write value. This is done in
    case hardware wrongly implements R/O bits as R/W.
    
    The mask_cap_list flag will be set in a follow-on change.
    
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 tools/tests/vpci/main.c    | 111 +++++++++++++++++++++++++++++++++++++++++++++
 xen/drivers/vpci/header.c  |  12 +++++
 xen/drivers/vpci/vpci.c    |  52 +++++++++++++++------
 xen/include/xen/pci_regs.h |   9 ++++
 xen/include/xen/vpci.h     |  24 ++++++++--
 5 files changed, 189 insertions(+), 19 deletions(-)

diff --git a/tools/tests/vpci/main.c b/tools/tests/vpci/main.c
index b9a0a6006b..64d4552936 100644
--- a/tools/tests/vpci/main.c
+++ b/tools/tests/vpci/main.c
@@ -70,6 +70,28 @@ static void vpci_write32(const struct pci_dev *pdev, unsigned int reg,
     *(uint32_t *)data = val;
 }
 
+struct mask_data {
+    uint32_t val;
+    uint32_t rw1c_mask;
+};
+
+static uint32_t vpci_read32_mask(const struct pci_dev *pdev, unsigned int reg,
+                                 void *data)
+{
+    const struct mask_data *md = data;
+
+    return md->val;
+}
+
+static void vpci_write32_mask(const struct pci_dev *pdev, unsigned int reg,
+                              uint32_t val, void *data)
+{
+    struct mask_data *md = data;
+
+    md->val  = val | (md->val & md->rw1c_mask);
+    md->val &= ~(val & md->rw1c_mask);
+}
+
 #define VPCI_READ(reg, size, data) ({                           \
     data = vpci_read((pci_sbdf_t){ .sbdf = 0 }, reg, size);     \
 })
@@ -94,9 +116,21 @@ static void vpci_write32(const struct pci_dev *pdev, unsigned int reg,
     assert(!vpci_add_register(test_pdev.vpci, fread, fwrite, off, size,     \
                               &store))
 
+#define VPCI_ADD_REG_MASK(fread, fwrite, off, size, store,                     \
+                          ro_mask, rw1c_mask, rsvdp_mask, rsvdz_mask)          \
+    assert(!vpci_add_register_mask(test_pdev.vpci, fread, fwrite, off, size,   \
+                                   &store,                                     \
+                                   ro_mask, rw1c_mask, rsvdp_mask, rsvdz_mask))
+
 #define VPCI_ADD_INVALID_REG(fread, fwrite, off, size)                      \
     assert(vpci_add_register(test_pdev.vpci, fread, fwrite, off, size, NULL))
 
+#define VPCI_ADD_INVALID_REG_MASK(fread, fwrite, off, size,                   \
+                                  ro_mask, rw1c_mask, rsvdp_mask, rsvdz_mask) \
+    assert(vpci_add_register_mask(test_pdev.vpci, fread, fwrite, off, size,   \
+                                  NULL, ro_mask, rw1c_mask, rsvdp_mask,       \
+                                  rsvdz_mask))
+
 #define VPCI_REMOVE_REG(off, size)                                          \
     assert(!vpci_remove_register(test_pdev.vpci, off, size))
 
@@ -154,6 +188,7 @@ main(int argc, char **argv)
     uint16_t r20[2] = { };
     uint32_t r24 = 0;
     uint8_t r28, r30;
+    struct mask_data r32;
     unsigned int i;
     int rc;
 
@@ -213,6 +248,24 @@ main(int argc, char **argv)
     /* Try to add a register with missing handlers. */
     VPCI_ADD_INVALID_REG(NULL, NULL, 8, 2);
 
+    /* Try to add registers with the same bits set in multiple masks. */
+    VPCI_ADD_INVALID_REG_MASK(vpci_read32, vpci_write32, 8, 4, 1, 1, 0, 0);
+    VPCI_ADD_INVALID_REG_MASK(vpci_read32, vpci_write32, 8, 4, 1, 0, 1, 0);
+    VPCI_ADD_INVALID_REG_MASK(vpci_read32, vpci_write32, 8, 4, 1, 0, 0, 1);
+    VPCI_ADD_INVALID_REG_MASK(vpci_read32, vpci_write32, 8, 4, 0, 1, 1, 0);
+    VPCI_ADD_INVALID_REG_MASK(vpci_read32, vpci_write32, 8, 4, 0, 1, 0, 1);
+    VPCI_ADD_INVALID_REG_MASK(vpci_read32, vpci_write32, 8, 4, 0, 0, 1, 1);
+
+    /* Try to add registers with mask bits set beyond the register size */
+    VPCI_ADD_INVALID_REG_MASK(vpci_read8, vpci_write8, 8, 1, 0x100U, 0, 0, 0);
+    VPCI_ADD_INVALID_REG_MASK(vpci_read8, vpci_write8, 8, 1, 0, 0x100U, 0, 0);
+    VPCI_ADD_INVALID_REG_MASK(vpci_read8, vpci_write8, 8, 1, 0, 0, 0x100U, 0);
+    VPCI_ADD_INVALID_REG_MASK(vpci_read8, vpci_write8, 8, 1, 0, 0, 0, 0x100U);
+    VPCI_ADD_INVALID_REG_MASK(vpci_read16, vpci_write16, 8, 2, 0x10000U,0,0,0);
+    VPCI_ADD_INVALID_REG_MASK(vpci_read16, vpci_write16, 8, 2, 0,0x10000U,0,0);
+    VPCI_ADD_INVALID_REG_MASK(vpci_read16, vpci_write16, 8, 2, 0,0,0x10000U,0);
+    VPCI_ADD_INVALID_REG_MASK(vpci_read16, vpci_write16, 8, 2, 0,0,0,0x10000U);
+
     /* Read/write of unset register. */
     VPCI_READ_CHECK(8, 4, 0xffffffff);
     VPCI_READ_CHECK(8, 2, 0xffff);
@@ -287,6 +340,64 @@ main(int argc, char **argv)
     VPCI_ADD_REG(vpci_read8, vpci_write8, 30, 1, r30);
     VPCI_WRITE_CHECK(28, 4, 0xffacffdc);
 
+    /*
+     * Test ro/rw1c/rsvdp/rsvdz masks.
+     *
+     * 32     24     16      8      0
+     *  +------+------+------+------+
+     *  |rsvdz |rsvdp | rw1c |  ro  | 32
+     *  +------+------+------+------+
+     *
+     */
+    r32.rw1c_mask = 0x0000ff00U;
+    VPCI_ADD_REG_MASK(vpci_read32_mask, vpci_write32_mask, 32, 4, r32,
+                      0x000000ffU   /* RO    */,
+                      r32.rw1c_mask /* RW1C  */,
+                      0x00ff0000U   /* RsvdP */,
+                      0xff000000U   /* RsvdZ */);
+
+    /* ro */
+    r32.val = 0x0f0f0f0fU;
+    VPCI_READ_CHECK(32, 1, 0x0f);
+    VPCI_WRITE(32, 1, 0x5a);
+    VPCI_READ_CHECK(32, 1, 0x0f);
+    assert(r32.val == 0x000f0f0fU);
+
+    /* rw1c */
+    r32.val = 0x0f0f0f0fU;
+    VPCI_READ_CHECK(33, 1, 0x0f);
+    VPCI_WRITE(33, 1, 0x5a);
+    VPCI_READ_CHECK(33, 1, 0x05);
+    assert(r32.val == 0x000f050fU);
+
+    /* rsvdp */
+    r32.val = 0x0f0f0f0fU;
+    VPCI_READ_CHECK(34, 1, 0);
+    VPCI_WRITE(34, 1, 0x5a);
+    VPCI_READ_CHECK(34, 1, 0);
+    assert(r32.val == 0x000f0f0fU);
+
+    /* rsvdz */
+    r32.val = 0x0f0f0f0fU;
+    VPCI_READ_CHECK(35, 1, 0);
+    VPCI_WRITE(35, 1, 0x5a);
+    VPCI_READ_CHECK(35, 1, 0);
+    assert(r32.val == 0x000f0f0fU);
+
+    /* write all 0's */
+    r32.val = 0x0f0f0f0fU;
+    VPCI_READ_CHECK(32, 4, 0x00000f0fU);
+    VPCI_WRITE(32, 4, 0);
+    VPCI_READ_CHECK(32, 4, 0x00000f0fU);
+    assert(r32.val == 0x000f0f0fU);
+
+    /* write all 1's */
+    r32.val = 0x0f0f0f0fU;
+    VPCI_READ_CHECK(32, 4, 0x00000f0fU);
+    VPCI_WRITE(32, 4, 0xffffffffU);
+    VPCI_READ_CHECK(32, 4, 0x0000000fU);
+    assert(r32.val == 0x000f000fU);
+
     /* Finally try to remove a couple of registers. */
     VPCI_REMOVE_REG(28, 1);
     VPCI_REMOVE_REG(24, 4);
diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index 767c1ba718..351318121e 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -521,6 +521,7 @@ static int cf_check init_bars(struct pci_dev *pdev)
     struct vpci_header *header = &pdev->vpci->header;
     struct vpci_bar *bars = header->bars;
     int rc;
+    bool mask_cap_list = false;
 
     switch ( pci_conf_read8(pdev->sbdf, PCI_HEADER_TYPE) & 0x7f )
     {
@@ -544,6 +545,17 @@ static int cf_check init_bars(struct pci_dev *pdev)
     if ( rc )
         return rc;
 
+    /* Utilize rsvdp_mask to hide PCI_STATUS_CAP_LIST from the guest. */
+    rc = vpci_add_register_mask(pdev->vpci, vpci_hw_read16, vpci_hw_write16,
+                                PCI_STATUS, 2, NULL,
+                                PCI_STATUS_RO_MASK &
+                                    ~(mask_cap_list ? PCI_STATUS_CAP_LIST : 0),
+                                PCI_STATUS_RW1C_MASK,
+                                mask_cap_list ? PCI_STATUS_CAP_LIST : 0,
+                                PCI_STATUS_RSVDZ_MASK);
+    if ( rc )
+        return rc;
+
     if ( pdev->ignore_bars )
         return 0;
 
diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
index 3bec9a4153..d569f596a4 100644
--- a/xen/drivers/vpci/vpci.c
+++ b/xen/drivers/vpci/vpci.c
@@ -29,6 +29,10 @@ struct vpci_register {
     unsigned int offset;
     void *private;
     struct list_head node;
+    uint32_t ro_mask;
+    uint32_t rw1c_mask;
+    uint32_t rsvdp_mask;
+    uint32_t rsvdz_mask;
 };
 
 #ifdef __XEN__
@@ -145,9 +149,17 @@ uint32_t cf_check vpci_hw_read32(
     return pci_conf_read32(pdev->sbdf, reg);
 }
 
-int vpci_add_register(struct vpci *vpci, vpci_read_t *read_handler,
-                      vpci_write_t *write_handler, unsigned int offset,
-                      unsigned int size, void *data)
+void cf_check vpci_hw_write16(
+    const struct pci_dev *pdev, unsigned int reg, uint32_t val, void *data)
+{
+    pci_conf_write16(pdev->sbdf, reg, val);
+}
+
+int vpci_add_register_mask(struct vpci *vpci, vpci_read_t *read_handler,
+                           vpci_write_t *write_handler, unsigned int offset,
+                           unsigned int size, void *data, uint32_t ro_mask,
+                           uint32_t rw1c_mask, uint32_t rsvdp_mask,
+                           uint32_t rsvdz_mask)
 {
     struct list_head *prev;
     struct vpci_register *r;
@@ -155,7 +167,14 @@ int vpci_add_register(struct vpci *vpci, vpci_read_t *read_handler,
     /* Some sanity checks. */
     if ( (size != 1 && size != 2 && size != 4) ||
          offset >= PCI_CFG_SPACE_EXP_SIZE || (offset & (size - 1)) ||
-         (!read_handler && !write_handler) )
+         (!read_handler && !write_handler) || (ro_mask & rw1c_mask) ||
+         (ro_mask & rsvdp_mask) || (ro_mask & rsvdz_mask) ||
+         (rw1c_mask & rsvdp_mask) || (rw1c_mask & rsvdz_mask) ||
+         (rsvdp_mask & rsvdz_mask) )
+        return -EINVAL;
+
+    if ( size != 4 &&
+         ((ro_mask | rw1c_mask | rsvdp_mask | rsvdz_mask) >> (8 * size)) )
         return -EINVAL;
 
     r = xmalloc(struct vpci_register);
@@ -167,6 +186,10 @@ int vpci_add_register(struct vpci *vpci, vpci_read_t *read_handler,
     r->size = size;
     r->offset = offset;
     r->private = data;
+    r->ro_mask = ro_mask;
+    r->rw1c_mask = rw1c_mask;
+    r->rsvdp_mask = rsvdp_mask;
+    r->rsvdz_mask = rsvdz_mask;
 
     spin_lock(&vpci->lock);
 
@@ -376,6 +399,7 @@ uint32_t vpci_read(pci_sbdf_t sbdf, unsigned int reg, unsigned int size)
         }
 
         val = r->read(pdev, r->offset, r->private);
+        val &= ~(r->rsvdp_mask | r->rsvdz_mask);
 
         /* Check if the read is in the middle of a register. */
         if ( r->offset < emu.offset )
@@ -407,26 +431,26 @@ uint32_t vpci_read(pci_sbdf_t sbdf, unsigned int reg, unsigned int size)
 
 /*
  * Perform a maybe partial write to a register.
- *
- * Note that this will only work for simple registers, if Xen needs to
- * trap accesses to rw1c registers (like the status PCI header register)
- * the logic in vpci_write will have to be expanded in order to correctly
- * deal with them.
  */
 static void vpci_write_helper(const struct pci_dev *pdev,
                               const struct vpci_register *r, unsigned int size,
                               unsigned int offset, uint32_t data)
 {
+    uint32_t curval = 0;
+    uint32_t preserved_mask = r->ro_mask | r->rsvdp_mask;
+
     ASSERT(size <= r->size);
 
-    if ( size != r->size )
+    if ( (size != r->size) || preserved_mask )
     {
-        uint32_t val;
-
-        val = r->read(pdev, r->offset, r->private);
-        data = merge_result(val, data, size, offset);
+        curval = r->read(pdev, r->offset, r->private);
+        curval &= ~r->rw1c_mask;
+        data = merge_result(curval, data, size, offset);
     }
 
+    data &= ~(preserved_mask | r->rsvdz_mask);
+    data |= curval & preserved_mask;
+
     r->write(pdev, r->offset, data & (0xffffffffU >> (32 - 8 * r->size)),
              r->private);
 }
diff --git a/xen/include/xen/pci_regs.h b/xen/include/xen/pci_regs.h
index 84b18736a8..9909b27425 100644
--- a/xen/include/xen/pci_regs.h
+++ b/xen/include/xen/pci_regs.h
@@ -66,6 +66,15 @@
 #define  PCI_STATUS_REC_MASTER_ABORT	0x2000 /* Set on master abort */
 #define  PCI_STATUS_SIG_SYSTEM_ERROR	0x4000 /* Set when we drive SERR */
 #define  PCI_STATUS_DETECTED_PARITY	0x8000 /* Set on parity error */
+#define  PCI_STATUS_RSVDZ_MASK		0x0046 /* Includes PCI_STATUS_UDF */
+
+#define  PCI_STATUS_RO_MASK (PCI_STATUS_IMM_READY | PCI_STATUS_INTERRUPT | \
+    PCI_STATUS_CAP_LIST | PCI_STATUS_66MHZ | PCI_STATUS_FAST_BACK | \
+    PCI_STATUS_DEVSEL_MASK)
+#define  PCI_STATUS_RW1C_MASK (PCI_STATUS_PARITY | \
+    PCI_STATUS_SIG_TARGET_ABORT | PCI_STATUS_REC_TARGET_ABORT | \
+    PCI_STATUS_REC_MASTER_ABORT | PCI_STATUS_SIG_SYSTEM_ERROR | \
+    PCI_STATUS_DETECTED_PARITY)
 
 #define PCI_CLASS_REVISION	0x08	/* High 24 bits are class, low 8 revision */
 #define PCI_REVISION_ID		0x08	/* Revision ID */
diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
index d743d96a10..85c52a1eba 100644
--- a/xen/include/xen/vpci.h
+++ b/xen/include/xen/vpci.h
@@ -32,11 +32,23 @@ int __must_check vpci_add_handlers(struct pci_dev *pdev);
 void vpci_remove_device(struct pci_dev *pdev);
 
 /* Add/remove a register handler. */
-int __must_check vpci_add_register(struct vpci *vpci,
-                                   vpci_read_t *read_handler,
-                                   vpci_write_t *write_handler,
-                                   unsigned int offset, unsigned int size,
-                                   void *data);
+int __must_check vpci_add_register_mask(struct vpci *vpci,
+                                        vpci_read_t *read_handler,
+                                        vpci_write_t *write_handler,
+                                        unsigned int offset, unsigned int size,
+                                        void *data, uint32_t ro_mask,
+                                        uint32_t rw1c_mask, uint32_t rsvdp_mask,
+                                        uint32_t rsvdz_mask);
+static inline int __must_check vpci_add_register(struct vpci *vpci,
+                                                 vpci_read_t *read_handler,
+                                                 vpci_write_t *write_handler,
+                                                 unsigned int offset,
+                                                 unsigned int size, void *data)
+{
+    return vpci_add_register_mask(vpci, read_handler, write_handler, offset,
+                                  size, data, 0, 0, 0, 0);
+}
+
 int __must_check vpci_remove_register(struct vpci *vpci, unsigned int offset,
                                       unsigned int size);
 
@@ -50,6 +62,8 @@ uint32_t cf_check vpci_hw_read16(
     const struct pci_dev *pdev, unsigned int reg, void *data);
 uint32_t cf_check vpci_hw_read32(
     const struct pci_dev *pdev, unsigned int reg, void *data);
+void cf_check vpci_hw_write16(
+    const struct pci_dev *pdev, unsigned int reg, uint32_t val, void *data);
 
 /*
  * Check for pending vPCI operations on this vcpu. Returns true if the vcpu
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 06 06:12:24 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 06 Dec 2023 06:12:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.648891.1012925 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rAl8x-0002Cx-R3; Wed, 06 Dec 2023 06:12:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 648891.1012925; Wed, 06 Dec 2023 06: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 1rAl8x-0002Cp-OA; Wed, 06 Dec 2023 06:12:23 +0000
Received: by outflank-mailman (input) for mailman id 648891;
 Wed, 06 Dec 2023 06: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 1rAl8w-0002CW-N3
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06: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 1rAl8w-0000PD-MO
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06:12:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rAl8w-0006m6-LU
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06: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=5a+EKe5mkAEKTe9H7uPJ3wqunbWdRuBelwAiGl5gzBs=; b=dLCiowPu16vm8fRTZqVyQ0WNV3
	+iTF5yKEwOQuasZo3Phc2PAk3llKD0yIrvU5MxN2sYCuLMmiHRlvSeUpiOAS6tyd1j4KPkUgHY4mx
	Ny0NFSckWWG+DiFDvCmRfRU6F60yYU3SHTRyOhdd2KNgy8qFTGkV098rAjUTS/w/VBtk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/vpci: header: filter PCI capabilities
Message-Id: <E1rAl8w-0006m6-LU@xenbits.xenproject.org>
Date: Wed, 06 Dec 2023 06:12:22 +0000

commit d830b0a7bc7e82289b6280a28aaa4fefd54e6e19
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Tue Dec 5 10:00:18 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 5 10:00:18 2023 +0100

    xen/vpci: header: filter PCI capabilities
    
    Currently, Xen vPCI only supports virtualizing the MSI and MSI-X capabilities.
    Hide all other PCI capabilities (including extended capabilities) from domUs for
    now, even though there may be certain devices/drivers that depend on being able
    to discover certain capabilities.
    
    We parse the physical PCI capabilities linked list and add vPCI register
    handlers for the next elements, inserting our own next value, thus presenting a
    modified linked list to the domU.
    
    Introduce helper functions vpci_hw_read8 and vpci_read_val. The vpci_read_val
    helper function returns a fixed value, which may be used for read as zero
    registers, or registers whose value doesn't change.
    
    Introduce pci_find_next_cap_ttl() helper while adapting the logic from
    pci_find_next_cap() to suit our needs, and implement the existing
    pci_find_next_cap() in terms of the new helper.
    
    Rename init_bars() to init_header() since it is now doing more than initializing
    BARs.
    
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/pci/pci.c     | 33 +++++++++++++++--------
 xen/drivers/vpci/header.c | 67 +++++++++++++++++++++++++++++++++++++++++++++--
 xen/drivers/vpci/vpci.c   | 12 +++++++++
 xen/include/xen/pci.h     |  3 +++
 xen/include/xen/vpci.h    |  6 +++++
 5 files changed, 108 insertions(+), 13 deletions(-)

diff --git a/xen/drivers/pci/pci.c b/xen/drivers/pci/pci.c
index 3569ccb24e..edf5b9f7ae 100644
--- a/xen/drivers/pci/pci.c
+++ b/xen/drivers/pci/pci.c
@@ -39,31 +39,42 @@ unsigned int pci_find_cap_offset(pci_sbdf_t sbdf, unsigned int cap)
     return 0;
 }
 
-unsigned int pci_find_next_cap(pci_sbdf_t sbdf, unsigned int pos,
-                               unsigned int cap)
+unsigned int pci_find_next_cap_ttl(pci_sbdf_t sbdf, unsigned int pos,
+                                   const unsigned int caps[], unsigned int n,
+                                   unsigned int *ttl)
 {
-    u8 id;
-    int ttl = 48;
-
-    while ( ttl-- )
+    while ( (*ttl)-- )
     {
+        unsigned int id, i;
+
         pos = pci_conf_read8(sbdf, pos);
         if ( pos < 0x40 )
             break;
 
-        pos &= ~3;
-        id = pci_conf_read8(sbdf, pos + PCI_CAP_LIST_ID);
+        id = pci_conf_read8(sbdf, (pos & ~3) + PCI_CAP_LIST_ID);
 
         if ( id == 0xff )
             break;
-        if ( id == cap )
-            return pos;
+        for ( i = 0; i < n; i++ )
+        {
+            if ( id == caps[i] )
+                return pos;
+        }
 
-        pos += PCI_CAP_LIST_NEXT;
+        pos = (pos & ~3) + PCI_CAP_LIST_NEXT;
     }
+
     return 0;
 }
 
+unsigned int pci_find_next_cap(pci_sbdf_t sbdf, unsigned int pos,
+                               unsigned int cap)
+{
+    unsigned int ttl = 48;
+
+    return pci_find_next_cap_ttl(sbdf, pos, &cap, 1, &ttl) & ~3;
+}
+
 /**
  * pci_find_ext_capability - Find an extended capability
  * @sbdf: PCI device to query
diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index 351318121e..58195549d5 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -18,6 +18,7 @@
  */
 
 #include <xen/iocap.h>
+#include <xen/lib.h>
 #include <xen/sched.h>
 #include <xen/softirq.h>
 #include <xen/vpci.h>
@@ -513,7 +514,7 @@ static void cf_check rom_write(
         rom->addr = val & PCI_ROM_ADDRESS_MASK;
 }
 
-static int cf_check init_bars(struct pci_dev *pdev)
+static int cf_check init_header(struct pci_dev *pdev)
 {
     uint16_t cmd;
     uint64_t addr, size;
@@ -545,6 +546,68 @@ static int cf_check init_bars(struct pci_dev *pdev)
     if ( rc )
         return rc;
 
+    if ( !is_hardware_domain(pdev->domain) )
+    {
+        if ( pci_conf_read16(pdev->sbdf, PCI_STATUS) & PCI_STATUS_CAP_LIST )
+        {
+            /* Only expose capabilities to the guest that vPCI can handle. */
+            unsigned int next, ttl = 48;
+            static const unsigned int supported_caps[] = {
+                PCI_CAP_ID_MSI,
+                PCI_CAP_ID_MSIX,
+            };
+
+            next = pci_find_next_cap_ttl(pdev->sbdf, PCI_CAPABILITY_LIST,
+                                         supported_caps,
+                                         ARRAY_SIZE(supported_caps), &ttl);
+
+            rc = vpci_add_register(pdev->vpci, vpci_read_val, NULL,
+                                   PCI_CAPABILITY_LIST, 1,
+                                   (void *)(uintptr_t)next);
+            if ( rc )
+                return rc;
+
+            next &= ~3;
+
+            if ( !next )
+                /*
+                 * If we don't have any supported capabilities to expose to the
+                 * guest, mask the PCI_STATUS_CAP_LIST bit in the status
+                 * register.
+                 */
+                mask_cap_list = true;
+
+            while ( next && ttl )
+            {
+                unsigned int pos = next;
+
+                next = pci_find_next_cap_ttl(pdev->sbdf,
+                                             pos + PCI_CAP_LIST_NEXT,
+                                             supported_caps,
+                                             ARRAY_SIZE(supported_caps), &ttl);
+
+                rc = vpci_add_register(pdev->vpci, vpci_hw_read8, NULL,
+                                       pos + PCI_CAP_LIST_ID, 1, NULL);
+                if ( rc )
+                    return rc;
+
+                rc = vpci_add_register(pdev->vpci, vpci_read_val, NULL,
+                                       pos + PCI_CAP_LIST_NEXT, 1,
+                                       (void *)(uintptr_t)next);
+                if ( rc )
+                    return rc;
+
+                next &= ~3;
+            }
+        }
+
+        /* Extended capabilities read as zero, write ignore */
+        rc = vpci_add_register(pdev->vpci, vpci_read_val, NULL, 0x100, 4,
+                               (void *)0);
+        if ( rc )
+            return rc;
+    }
+
     /* Utilize rsvdp_mask to hide PCI_STATUS_CAP_LIST from the guest. */
     rc = vpci_add_register_mask(pdev->vpci, vpci_hw_read16, vpci_hw_write16,
                                 PCI_STATUS, 2, NULL,
@@ -642,7 +705,7 @@ static int cf_check init_bars(struct pci_dev *pdev)
 
     return (cmd & PCI_COMMAND_MEMORY) ? modify_bars(pdev, cmd, false) : 0;
 }
-REGISTER_VPCI_INIT(init_bars, VPCI_PRIORITY_MIDDLE);
+REGISTER_VPCI_INIT(init_header, VPCI_PRIORITY_MIDDLE);
 
 /*
  * Local variables:
diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
index d569f596a4..72ef277c4f 100644
--- a/xen/drivers/vpci/vpci.c
+++ b/xen/drivers/vpci/vpci.c
@@ -137,6 +137,18 @@ static void cf_check vpci_ignored_write(
 {
 }
 
+uint32_t cf_check vpci_read_val(
+    const struct pci_dev *pdev, unsigned int reg, void *data)
+{
+    return (uintptr_t)data;
+}
+
+uint32_t cf_check vpci_hw_read8(
+    const struct pci_dev *pdev, unsigned int reg, void *data)
+{
+    return pci_conf_read8(pdev->sbdf, reg);
+}
+
 uint32_t cf_check vpci_hw_read16(
     const struct pci_dev *pdev, unsigned int reg, void *data)
 {
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 50d7dfb2a2..2a0a01bf92 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -205,6 +205,9 @@ int pci_mmcfg_read(unsigned int seg, unsigned int bus,
 int pci_mmcfg_write(unsigned int seg, unsigned int bus,
                     unsigned int devfn, int reg, int len, u32 value);
 unsigned int pci_find_cap_offset(pci_sbdf_t sbdf, unsigned int cap);
+unsigned int pci_find_next_cap_ttl(pci_sbdf_t sbdf, unsigned int pos,
+                                   const unsigned int caps[], unsigned int n,
+                                   unsigned int *ttl);
 unsigned int pci_find_next_cap(pci_sbdf_t sbdf, unsigned int pos,
                                unsigned int cap);
 unsigned int pci_find_ext_capability(pci_sbdf_t sbdf, unsigned int cap);
diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
index 85c52a1eba..d20c301a3d 100644
--- a/xen/include/xen/vpci.h
+++ b/xen/include/xen/vpci.h
@@ -57,7 +57,13 @@ uint32_t vpci_read(pci_sbdf_t sbdf, unsigned int reg, unsigned int size);
 void vpci_write(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
                 uint32_t data);
 
+/* Helper to return the value passed in data. */
+uint32_t cf_check vpci_read_val(
+    const struct pci_dev *pdev, unsigned int reg, void *data);
+
 /* Passthrough handlers. */
+uint32_t cf_check vpci_hw_read8(
+    const struct pci_dev *pdev, unsigned int reg, void *data);
 uint32_t cf_check vpci_hw_read16(
     const struct pci_dev *pdev, unsigned int reg, void *data);
 uint32_t cf_check vpci_hw_read32(
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 06 06:12:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 06 Dec 2023 06:12:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.648892.1012929 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rAl97-0002Jt-UB; Wed, 06 Dec 2023 06:12:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 648892.1012929; Wed, 06 Dec 2023 06: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 1rAl97-0002Jl-Ra; Wed, 06 Dec 2023 06:12:33 +0000
Received: by outflank-mailman (input) for mailman id 648892;
 Wed, 06 Dec 2023 06:12:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rAl96-0002I6-RO
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06:12:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rAl96-0000PT-Qd
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06:12:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rAl96-0006mj-OX
 for xen-changelog@lists.xenproject.org; Wed, 06 Dec 2023 06: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=jOJ/PFDC+x95SHYaZDtWMIcEpG5S7qtGAuPCdlG2x6Y=; b=n0/YiK2M/y5avHHC/zvGhpw0Lw
	SEv7iSo5E7YLr5YpQF7N/9M/I0MN6y8QD1mZnn8AGRJCx3iMr6EJypo4WpoFMjX7v7NZcDbYoYhqt
	sul9ohEfZ19iO4Tj8T7gQl3e9r9xiOfBL9bUFPM1miffCwtqZo532E55zcH5mvG4YMo0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/domain: fix error path in domain_create()
Message-Id: <E1rAl96-0006mj-OX@xenbits.xenproject.org>
Date: Wed, 06 Dec 2023 06:12:32 +0000

commit ff1178062094837d55ef342070e58316c43a54c9
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Tue Dec 5 10:00:51 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 5 10:00:51 2023 +0100

    xen/domain: fix error path in domain_create()
    
    If rangeset_new() fails, err would not be set to an appropriate error
    code. Set it to -ENOMEM.
    
    Fixes: 580c458699e3 ("xen/domain: Call arch_domain_create() as early as possible in domain_create()")
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/domain.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index cd2ca6d49a..c5954cdb1a 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -710,6 +710,7 @@ struct domain *domain_create(domid_t domid,
         watchdog_domain_init(d);
         init_status |= INIT_watchdog;
 
+        err = -ENOMEM;
         d->iomem_caps = rangeset_new(d, "I/O Memory", RANGESETF_prettyprint_hex);
         d->irq_caps   = rangeset_new(d, "Interrupts", 0);
         if ( !d->iomem_caps || !d->irq_caps )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 01:00:12 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 01:00:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.649500.1014036 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rB2kG-0006Kg-38; Thu, 07 Dec 2023 01:00:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 649500.1014036; Thu, 07 Dec 2023 01:00:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rB2kG-0006K8-0D; Thu, 07 Dec 2023 01:00:04 +0000
Received: by outflank-mailman (input) for mailman id 649500;
 Thu, 07 Dec 2023 01:00:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB2kE-0005VS-KD
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01:00:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB2kE-00074x-Dh
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB2kE-0004Zk-CL
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01:00:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dbZPp2GH1I7Bb6kuUrzbV+Y2YFhfCbHgFWX/up60JG0=; b=6GlVnkLrBnp6JEC6Pu2bPqeqqg
	a3GErAQY7tTd1NVPbFb0teLwPvfrQ/VEJVpPsoCDCW+ea54j1yRvk8k2EfEoj2KGwDybLEnN+3lBb
	2WL0OrbwoOurte3DRHBEQ7FfWDS1tij5il09k26jD1HLaFwO0ZTce1UZgVpDyVterU8Y=;
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: Release domain if we are not able to enable memory sharing
Message-Id: <E1rB2kE-0004Zk-CL@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 01:00:02 +0000

commit 90a6d821757edf1202c527143b8a05b0d2a3dfaa
Author:     Frediano Ziglio <frediano.ziglio@cloud.com>
AuthorDate: Wed Dec 6 10:37:13 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:37:13 2023 +0100

    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>
    master commit: fbcec32d6d3ea0ac329301925b317478316209ed
    master date: 2023-11-27 12:06:13 +0000
---
 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..429d27ef85 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#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 01:00:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 01:00:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.649501.1014042 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rB2kQ-0001vo-4k; Thu, 07 Dec 2023 01:00:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 649501.1014042; Thu, 07 Dec 2023 01: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 1rB2kQ-0001v9-1j; Thu, 07 Dec 2023 01:00:14 +0000
Received: by outflank-mailman (input) for mailman id 649501;
 Thu, 07 Dec 2023 01:00:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB2kO-0001PH-IM
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01:00:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB2kO-0002bj-HN
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01:00:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB2kO-0004bX-GH
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01:00:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KKmv8WyV96yZcQWY8TqIYjt7khS87iz1gNjxZr8jk3g=; b=6VevxqHi/T9PZxEm0hsTqDpnmX
	wpVGgdebLGKPkObeoqTNS4RrERcqAeO84m07szVatmrFhrxZnPDJYZS2U3VEGlHIezPf0Z85UlIMD
	YYwSBhPbi+LI3mcUSPU9MuaXwdXg0VeCHVuZVbC+f8luz0t09HJ1NzqKMjGW3SBrixKg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] livepatch: do not use .livepatch.funcs section to store internal state
Message-Id: <E1rB2kO-0004bX-GH@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 01:00:12 +0000

commit 480168fcb3135f0da6e7a6b3b754c78fabc24d4f
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Dec 6 10:38:03 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:38:03 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/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>
    master commit: 82182ad7b46e0f7a3856bb12c7a9bf2e2a4570bc
    master date: 2023-11-27 15:16:01 +0100
    master commit: 902377b690f42ddf44ae91c4b0751d597f1cd694
    master date: 2023-11-29 10:46:42 +0000
---
 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 +-
 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 +-
 15 files changed, 130 insertions(+), 88 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 d89a904bd4..e635606c10 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 9fdb29c382..537d3d58b6 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_t 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. */
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#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 01:00:24 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 01:00:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.649502.1014045 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rB2ka-0005ZL-7U; Thu, 07 Dec 2023 01:00:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 649502.1014045; Thu, 07 Dec 2023 01:00:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rB2ka-0005Yp-4e; Thu, 07 Dec 2023 01:00:24 +0000
Received: by outflank-mailman (input) for mailman id 649502;
 Thu, 07 Dec 2023 01: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 1rB2kY-0004y8-MH
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01: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 1rB2kY-0006VF-Kh
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01:00:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB2kY-0004cO-Ja
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01:00:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lYLkO60OfcYN611rwCjMjAKrur2WzOizkkwwTsyb124=; b=tRIq/bNX7ZEuCwi2NPh3/DNAG4
	uxfW9tlTFp7FF3KGunSRtXjDYasYPf1JQklJaibymQdWbFlBg8zUN5AOc+lUdManzVSL+OUAd864N
	ESNAaukBJeMLhzufBoEegnKoad8oClLi864ACsyZhh9NAnjuT88kA8cbTBgZ/QZNMPZw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] xen/x86: In x2APIC mode, derive LDR from APIC ID
Message-Id: <E1rB2kY-0004cO-Ja@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 01:00:22 +0000

commit 61d032e322b178a49983359b0dfd64a42c1f5fca
Author:     Alejandro Vallejo <alejandro.vallejo@cloud.com>
AuthorDate: Wed Dec 6 10:39:15 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:39:15 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>
    master commit: 90309854fd2440fb08b4c808f47d7670ba0d250d
    master date: 2023-11-29 10:05:55 +0100
---
 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 c7ce82d064..ba569043ea 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#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 01:00:34 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 01:00:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.649503.1014049 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rB2kk-0000oX-8x; Thu, 07 Dec 2023 01:00:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 649503.1014049; Thu, 07 Dec 2023 01:00:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rB2kk-0000o4-67; Thu, 07 Dec 2023 01:00:34 +0000
Received: by outflank-mailman (input) for mailman id 649503;
 Thu, 07 Dec 2023 01: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 1rB2ki-0000Kj-ON
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01: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 1rB2ki-0001pU-Nf
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01:00:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB2ki-0004ex-Mg
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01: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=TLfWq1rrfXy2Xx43i9FVjc3IpSwHX5HsqZfqN3km7is=; b=ckt7I+G8xhap9HS2eYLxaM/noI
	3DC9hZo14WAc+qTKYOeAG1roBfNGdnXd+dNOY1nJMlNJeuHTRaSh3S2VPZQzJC+qhQgfZ5o+VmVNG
	yABPfX5rj2S1lewbtgAyzAGlTPltIw9olbXSVo2dezlzWp8mNPuSc6D4lERDzjDQK2V4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] tools/xg: Fix potential memory leak in cpu policy getters/setters
Message-Id: <E1rB2ki-0004ex-Mg@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 01:00:32 +0000

commit 3af9d1cbb602a9dcbab2e43fab74a881c2e05d81
Author:     Alejandro Vallejo <alejandro.vallejo@cloud.com>
AuthorDate: Wed Dec 6 10:39:55 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:39:55 2023 +0100

    tools/xg: Fix potential memory leak in cpu policy getters/setters
    
    They allocate two different hypercall buffers, but leak the first
    allocation if the second one failed due to an early return that bypasses
    cleanup.
    
    Remove the early exit and go through _post() instead. Invoking _post() is
    benign even if _pre() failed.
    
    Fixes: 6b85e427098c ('x86/sysctl: Implement XEN_SYSCTL_get_cpu_policy')
    Fixes: 60529dfeca14 ('x86/domctl: Implement XEN_DOMCTL_get_cpu_policy')
    Fixes: 14ba07e6f816 ('x86/domctl: Implement XEN_DOMCTL_set_cpumsr_policy')
    Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
    master commit: 1571ff7a987b88b20598a6d49910457f3b2c59f1
    master date: 2023-12-01 10:53:07 +0100
---
 tools/libs/guest/xg_cpuid_x86.c | 86 +++++++++++++++++++----------------------
 1 file changed, 39 insertions(+), 47 deletions(-)

diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x86.c
index f2b1e80901..3a74bb2b37 100644
--- a/tools/libs/guest/xg_cpuid_x86.c
+++ b/tools/libs/guest/xg_cpuid_x86.c
@@ -136,20 +136,20 @@ static int get_system_cpu_policy(xc_interface *xch, uint32_t index,
     DECLARE_HYPERCALL_BOUNCE(msrs,
                              *nr_msrs * sizeof(*msrs),
                              XC_HYPERCALL_BUFFER_BOUNCE_OUT);
-    int ret;
-
-    if ( xc_hypercall_bounce_pre(xch, leaves) ||
-         xc_hypercall_bounce_pre(xch, msrs) )
-        return -1;
+    int ret = -1;
 
-    sysctl.cmd = XEN_SYSCTL_get_cpu_policy;
-    sysctl.u.cpu_policy.index = index;
-    sysctl.u.cpu_policy.nr_leaves = *nr_leaves;
-    set_xen_guest_handle(sysctl.u.cpu_policy.leaves, leaves);
-    sysctl.u.cpu_policy.nr_msrs = *nr_msrs;
-    set_xen_guest_handle(sysctl.u.cpu_policy.msrs, msrs);
-
-    ret = do_sysctl(xch, &sysctl);
+    if ( !xc_hypercall_bounce_pre(xch, leaves) &&
+         !xc_hypercall_bounce_pre(xch, msrs) )
+    {
+        sysctl.cmd = XEN_SYSCTL_get_cpu_policy;
+        sysctl.u.cpu_policy.index = index;
+        sysctl.u.cpu_policy.nr_leaves = *nr_leaves;
+        set_xen_guest_handle(sysctl.u.cpu_policy.leaves, leaves);
+        sysctl.u.cpu_policy.nr_msrs = *nr_msrs;
+        set_xen_guest_handle(sysctl.u.cpu_policy.msrs, msrs);
+
+        ret = do_sysctl(xch, &sysctl);
+    }
 
     xc_hypercall_bounce_post(xch, leaves);
     xc_hypercall_bounce_post(xch, msrs);
@@ -174,20 +174,20 @@ static int get_domain_cpu_policy(xc_interface *xch, uint32_t domid,
     DECLARE_HYPERCALL_BOUNCE(msrs,
                              *nr_msrs * sizeof(*msrs),
                              XC_HYPERCALL_BUFFER_BOUNCE_OUT);
-    int ret;
-
-    if ( xc_hypercall_bounce_pre(xch, leaves) ||
-         xc_hypercall_bounce_pre(xch, msrs) )
-        return -1;
-
-    domctl.cmd = XEN_DOMCTL_get_cpu_policy;
-    domctl.domain = domid;
-    domctl.u.cpu_policy.nr_leaves = *nr_leaves;
-    set_xen_guest_handle(domctl.u.cpu_policy.leaves, leaves);
-    domctl.u.cpu_policy.nr_msrs = *nr_msrs;
-    set_xen_guest_handle(domctl.u.cpu_policy.msrs, msrs);
+    int ret = -1;
 
-    ret = do_domctl(xch, &domctl);
+    if ( !xc_hypercall_bounce_pre(xch, leaves) &&
+         !xc_hypercall_bounce_pre(xch, msrs) )
+    {
+        domctl.cmd = XEN_DOMCTL_get_cpu_policy;
+        domctl.domain = domid;
+        domctl.u.cpu_policy.nr_leaves = *nr_leaves;
+        set_xen_guest_handle(domctl.u.cpu_policy.leaves, leaves);
+        domctl.u.cpu_policy.nr_msrs = *nr_msrs;
+        set_xen_guest_handle(domctl.u.cpu_policy.msrs, msrs);
+
+        ret = do_domctl(xch, &domctl);
+    }
 
     xc_hypercall_bounce_post(xch, leaves);
     xc_hypercall_bounce_post(xch, msrs);
@@ -214,32 +214,24 @@ int xc_set_domain_cpu_policy(xc_interface *xch, uint32_t domid,
     DECLARE_HYPERCALL_BOUNCE(msrs,
                              nr_msrs * sizeof(*msrs),
                              XC_HYPERCALL_BUFFER_BOUNCE_IN);
-    int ret;
-
-    if ( err_leaf_p )
-        *err_leaf_p = -1;
-    if ( err_subleaf_p )
-        *err_subleaf_p = -1;
-    if ( err_msr_p )
-        *err_msr_p = -1;
+    int ret = -1;
 
-    if ( xc_hypercall_bounce_pre(xch, leaves) )
-        return -1;
-
-    if ( xc_hypercall_bounce_pre(xch, msrs) )
-        return -1;
-
-    domctl.cmd = XEN_DOMCTL_set_cpu_policy;
-    domctl.domain = domid;
-    domctl.u.cpu_policy.nr_leaves = nr_leaves;
-    set_xen_guest_handle(domctl.u.cpu_policy.leaves, leaves);
-    domctl.u.cpu_policy.nr_msrs = nr_msrs;
-    set_xen_guest_handle(domctl.u.cpu_policy.msrs, msrs);
     domctl.u.cpu_policy.err_leaf = -1;
     domctl.u.cpu_policy.err_subleaf = -1;
     domctl.u.cpu_policy.err_msr = -1;
 
-    ret = do_domctl(xch, &domctl);
+    if ( !xc_hypercall_bounce_pre(xch, leaves) &&
+         !xc_hypercall_bounce_pre(xch, msrs) )
+    {
+        domctl.cmd = XEN_DOMCTL_set_cpu_policy;
+        domctl.domain = domid;
+        domctl.u.cpu_policy.nr_leaves = nr_leaves;
+        set_xen_guest_handle(domctl.u.cpu_policy.leaves, leaves);
+        domctl.u.cpu_policy.nr_msrs = nr_msrs;
+        set_xen_guest_handle(domctl.u.cpu_policy.msrs, msrs);
+
+        ret = do_domctl(xch, &domctl);
+    }
 
     xc_hypercall_bounce_post(xch, leaves);
     xc_hypercall_bounce_post(xch, msrs);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 01:00:44 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 01:00:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.649504.1014053 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rB2ku-0004ci-AJ; Thu, 07 Dec 2023 01:00:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 649504.1014053; Thu, 07 Dec 2023 01:00:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rB2ku-0004bF-7Z; Thu, 07 Dec 2023 01:00:44 +0000
Received: by outflank-mailman (input) for mailman id 649504;
 Thu, 07 Dec 2023 01: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 1rB2ks-00044J-TS
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01: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 1rB2ks-0005iU-Rq
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01:00:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB2ks-0004hb-QA
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01: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=ScCPj2bwzFE5XIm2l3Sez2iV5LLzlaSgjrLu4rJ89Oc=; b=Tk3FP0JmaLpMyab5WgDpzWGFHq
	OGEhAPiUVJ0gZ1j3RGrSFllQPGrr+f6S3W/sBbb6p6quhnRdGYnky2CXIKMjN0SPHI9jBFsD/GYQW
	F8i1vSD8YoPJEe+XT/B0s3yVXDxVqpZEClhNMsYc40yJAK9YlIK8ToTcIfMzp4VVX32E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86emul: avoid triggering event related assertions
Message-Id: <E1rB2ks-0004hb-QA@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 01:00:42 +0000

commit 18f900b77b3a85acadc2fe152ea354a02569acab
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Dec 6 10:40:19 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:40:19 2023 +0100

    x86emul: avoid triggering event related assertions
    
    The assertion at the end of x86_emulate_wrapper() as well as the ones
    in x86_emul_{hw_exception,pagefault}() can trigger if we ignore
    X86EMUL_EXCEPTION coming back from certain hook functions. Squash
    exceptions when merely probing MSRs, plus on SWAPGS'es "best effort"
    error handling path.
    
    In adjust_bnd() add another assertion after the read_xcr(0, ...)
    invocation, paralleling the one in x86emul_get_fpu() - XCR0 reads should
    never fault when XSAVE is (implicitly) known to be available.
    
    Also update the respective comment in x86_emulate_wrapper().
    
    Fixes: 14a6be89ec04 ("x86emul: correct EFLAGS.TF handling")
    Fixes: cb2626c75813 ("x86emul: conditionally clear BNDn for branches")
    Fixes: 6eb43fcf8a0b ("x86emul: support SWAPGS")
    Reported-by: AFL
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 787d11c5aaf4d3411d4658cff137cd49b0bd951b
    master date: 2023-12-05 09:57:05 +0100
---
 xen/arch/x86/x86_emulate/0f01.c        |  6 ++++--
 xen/arch/x86/x86_emulate/0fae.c        |  3 +++
 xen/arch/x86/x86_emulate/x86_emulate.c | 28 +++++++++++++++++++++++-----
 3 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/0f01.c b/xen/arch/x86/x86_emulate/0f01.c
index ba43fc394b..1ba99609d6 100644
--- a/xen/arch/x86/x86_emulate/0f01.c
+++ b/xen/arch/x86/x86_emulate/0f01.c
@@ -200,8 +200,10 @@ int x86emul_0f01(struct x86_emulate_state *s,
         if ( (rc = ops->write_segment(x86_seg_gs, &sreg,
                                       ctxt)) != X86EMUL_OKAY )
         {
-            /* Best effort unwind (i.e. no error checking). */
-            ops->write_msr(MSR_SHADOW_GS_BASE, msr_val, ctxt);
+            /* Best effort unwind (i.e. no real error checking). */
+            if ( ops->write_msr(MSR_SHADOW_GS_BASE, msr_val,
+                                ctxt) == X86EMUL_EXCEPTION )
+                x86_emul_reset_event(ctxt);
             goto done;
         }
         break;
diff --git a/xen/arch/x86/x86_emulate/0fae.c b/xen/arch/x86/x86_emulate/0fae.c
index 00840b1d07..ba77af58f2 100644
--- a/xen/arch/x86/x86_emulate/0fae.c
+++ b/xen/arch/x86/x86_emulate/0fae.c
@@ -55,7 +55,10 @@ int x86emul_0fae(struct x86_emulate_state *s,
                     cr4 = X86_CR4_OSFXSR;
                 if ( !ops->read_msr ||
                      ops->read_msr(MSR_EFER, &msr_val, ctxt) != X86EMUL_OKAY )
+                {
+                    x86_emul_reset_event(ctxt);
                     msr_val = 0;
+                }
                 if ( !(cr4 & X86_CR4_OSFXSR) ||
                      (mode_64bit() && mode_ring0() && (msr_val & EFER_FFXSE)) )
                     s->op_bytes = offsetof(struct x86_fxsr, xmm[0]);
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 94caec1d14..cf780da501 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -1143,10 +1143,18 @@ static bool is_branch_step(struct x86_emulate_ctxt *ctxt,
                            const struct x86_emulate_ops *ops)
 {
     uint64_t debugctl;
+    int rc = X86EMUL_UNHANDLEABLE;
 
-    return ops->read_msr &&
-           ops->read_msr(MSR_IA32_DEBUGCTLMSR, &debugctl, ctxt) == X86EMUL_OKAY &&
-           (debugctl & IA32_DEBUGCTLMSR_BTF);
+    if ( !ops->read_msr ||
+         (rc = ops->read_msr(MSR_IA32_DEBUGCTLMSR, &debugctl,
+                             ctxt)) != X86EMUL_OKAY )
+    {
+        if ( rc == X86EMUL_EXCEPTION )
+            x86_emul_reset_event(ctxt);
+        debugctl = 0;
+    }
+
+    return debugctl & IA32_DEBUGCTLMSR_BTF;
 }
 
 static void adjust_bnd(struct x86_emulate_ctxt *ctxt,
@@ -1160,13 +1168,21 @@ static void adjust_bnd(struct x86_emulate_ctxt *ctxt,
 
     if ( !ops->read_xcr || ops->read_xcr(0, &xcr0, ctxt) != X86EMUL_OKAY ||
          !(xcr0 & X86_XCR0_BNDREGS) || !(xcr0 & X86_XCR0_BNDCSR) )
+    {
+        ASSERT(!ctxt->event_pending);
         return;
+    }
 
     if ( !mode_ring0() )
         bndcfg = read_bndcfgu();
     else if ( !ops->read_msr ||
-              ops->read_msr(MSR_IA32_BNDCFGS, &bndcfg, ctxt) != X86EMUL_OKAY )
+              (rc = ops->read_msr(MSR_IA32_BNDCFGS, &bndcfg,
+                                  ctxt)) != X86EMUL_OKAY )
+    {
+        if ( rc == X86EMUL_EXCEPTION )
+            x86_emul_reset_event(ctxt);
         return;
+    }
     if ( (bndcfg & IA32_BNDCFGS_ENABLE) && !(bndcfg & IA32_BNDCFGS_PRESERVE) )
     {
         /*
@@ -8677,7 +8693,9 @@ int x86_emulate_wrapper(
      * An event being pending should exactly match returning
      * X86EMUL_EXCEPTION.  (If this trips, the chances are a codepath has
      * called hvm_inject_hw_exception() rather than using
-     * x86_emul_hw_exception().)
+     * x86_emul_hw_exception(), or the invocation of a hook has caused an
+     * exception to be raised, while the caller was only checking for
+     * success/failure.)
      */
     ASSERT(ctxt->event_pending == (rc == X86EMUL_EXCEPTION));
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 01:00:54 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 01:00:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.649505.1014057 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rB2l4-0000Cf-Bh; Thu, 07 Dec 2023 01:00:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 649505.1014057; Thu, 07 Dec 2023 01:00:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rB2l4-0000CH-90; Thu, 07 Dec 2023 01:00:54 +0000
Received: by outflank-mailman (input) for mailman id 649505;
 Thu, 07 Dec 2023 01:00:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB2l2-00085H-Vk
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01: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 1rB2l2-00010U-Ux
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01:00:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB2l2-0004iy-Tv
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01: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=xCCXFI4SIWuT9uZRdZg5Y9MOQNyVM2Lib5zrMsieAF0=; b=hD5DoXfoQwdfbP0DYdwQaZoOeO
	w4FB/ue47Ve8ZLCKhrxV8JY65bZsgiyJL5TXoP/x0JPqlTztm+WLOCvRHC5Ws8/rkYk+WWZwGNxNx
	DykMqOZugnbv1s4Bt/eK5Bacqy6hdNNaRaWx+HuIcX89BYU2RI4tfIto8nwPSNL/sqio=;
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 adding offline cpu to cpupool
Message-Id: <E1rB2l2-0004iy-Tv@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 01:00:52 +0000

commit 5ac87c8afd2ae2b1a9fd46a9b80d9152d650fb26
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Dec 6 10:40:54 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:40:54 2023 +0100

    xen/sched: fix adding offline cpu to cpupool
    
    Trying to add an offline cpu to a cpupool can crash the hypervisor,
    as the probably non-existing percpu area of the cpu is accessed before
    the availability of the cpu is being tested. This can happen in case
    the cpupool's granularity is "core" or "socket".
    
    Fix that by testing the cpu to be online.
    
    Fixes: cb563d7665f2 ("xen/sched: support core scheduling for moving cpus to/from cpupools")
    Reported-by: René Winther Højgaard <renewin@proton.me>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 06e8d65d33896aa90f5b6d9b2bce7f11433b33c9
    master date: 2023-12-05 09:57:38 +0100
---
 xen/common/sched/cpupool.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/common/sched/cpupool.c b/xen/common/sched/cpupool.c
index 2e094b0cfa..ad8f608462 100644
--- a/xen/common/sched/cpupool.c
+++ b/xen/common/sched/cpupool.c
@@ -892,6 +892,8 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op)
         if ( cpu >= nr_cpu_ids )
             goto addcpu_out;
         ret = -ENODEV;
+        if ( !cpu_online(cpu) )
+            goto addcpu_out;
         cpus = sched_get_opt_cpumask(c->gran, cpu);
         if ( !cpumask_subset(cpus, &cpupool_free_cpus) ||
              cpumask_intersects(cpus, &cpupool_locked_cpus) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 01:01:04 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 01:01:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.649506.1014060 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rB2lE-0004Ub-Cr; Thu, 07 Dec 2023 01:01:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 649506.1014060; Thu, 07 Dec 2023 01:01:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rB2lE-0004U4-AL; Thu, 07 Dec 2023 01:01:04 +0000
Received: by outflank-mailman (input) for mailman id 649506;
 Thu, 07 Dec 2023 01:01:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB2lD-0003vo-2M
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01:01:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB2lD-0004hg-1Y
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01:01:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB2lD-0004jl-0k
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 01:01:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aISGRiJrxBhgHs9s0koJzUc1roTQxqNxDb+H7gDArig=; b=Axr7mbGp4E7OacQx22WL5+M6/E
	bGBlrLojgGOOxKZnbLZlAi5o/73aOGvTzqXHFGtcjEA38ptavISA+n57ZMjrwKwwXwRJYU52v+qCb
	n0rnN4UBdAtkfQJU/1LNJHisBMcJjznpkyGC8BV9YUfLprGm+NUaL3oPpoUSdv7qKU/4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] xen/domain: fix error path in domain_create()
Message-Id: <E1rB2lD-0004jl-0k@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 01:01:03 +0000

commit 25b7f9ed0f8c7e138a2cecb113bd377c613153d7
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Wed Dec 6 10:41:19 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:41:19 2023 +0100

    xen/domain: fix error path in domain_create()
    
    If rangeset_new() fails, err would not be set to an appropriate error
    code. Set it to -ENOMEM.
    
    Fixes: 580c458699e3 ("xen/domain: Call arch_domain_create() as early as possible in domain_create()")
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: ff1178062094837d55ef342070e58316c43a54c9
    master date: 2023-12-05 10:00:51 +0100
---
 xen/common/domain.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 8f9ab01c0c..003f4ab125 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -703,6 +703,7 @@ struct domain *domain_create(domid_t domid,
         watchdog_domain_init(d);
         init_status |= INIT_watchdog;
 
+        err = -ENOMEM;
         d->iomem_caps = rangeset_new(d, "I/O Memory", RANGESETF_prettyprint_hex);
         d->irq_caps   = rangeset_new(d, "Interrupts", 0);
         if ( !d->iomem_caps || !d->irq_caps )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 05:11:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 05:11:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.649549.1014164 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rB6f8-0006wr-3N; Thu, 07 Dec 2023 05:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 649549.1014164; Thu, 07 Dec 2023 05:11:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rB6f8-0006wj-0T; Thu, 07 Dec 2023 05:11:02 +0000
Received: by outflank-mailman (input) for mailman id 649549;
 Thu, 07 Dec 2023 05:11:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB6f7-0006wd-Fs
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 05:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB6f7-00022t-Ew
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 05:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB6f7-0007aX-Dr
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 05:11:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=eDyj+pFBneZgLvhL3s8aWxJrEXCZ+nw1r/Ml9U8PrWQ=; b=TsweDBi/8JOIuuJq2ISnAaLb8T
	PeM/zqM4grpin9kso6oL1lupZQluM5OaAjeSzPthW5ypHy00/Q0lNzOTOv4TEp3bd5U3pDjrCUIe8
	aRjzRR4iRysOJ0KIxRxSn4sm7a3R0y9ZI/rMnpcX7+D4yESadGrLTp4ylu9QRPOKU6Kw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] ubsan: Introduce CONFIG_UBSAN_FATAL to panic on UBSAN failure
Message-Id: <E1rB6f7-0007aX-Dr@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 05:11:01 +0000

commit afb2692c473cd6b559bf774224e00cc614217705
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Mon Nov 27 15:41:55 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Dec 5 17:59:32 2023 +0000

    ubsan: Introduce CONFIG_UBSAN_FATAL to panic on UBSAN failure
    
    Introduce the CONFIG_UBSAN_FATAL option to cater to scenarios where prompt
    attention to undefined behavior issues, notably during CI test runs, is
    essential. When enabled, this option causes Xen to panic upon detecting
    UBSAN failure (as the last step in ubsan_epilogue()).
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/Kconfig.debug        | 7 +++++++
 xen/common/ubsan/ubsan.c | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug
index 94e818ee09..e19e9d4881 100644
--- a/xen/Kconfig.debug
+++ b/xen/Kconfig.debug
@@ -107,6 +107,13 @@ config UBSAN
 
 	  If unsure, say N here.
 
+config UBSAN_FATAL
+	bool "Panic on UBSAN failure"
+	depends on UBSAN
+	help
+	  Enabling this option will cause Xen to panic when an undefined behavior
+	  is detected by UBSAN. If unsure, say N here.
+
 config DEBUG_TRACE
 	bool "Debug trace support"
 	---help---
diff --git a/xen/common/ubsan/ubsan.c b/xen/common/ubsan/ubsan.c
index a3a80fa99e..5d50c10742 100644
--- a/xen/common/ubsan/ubsan.c
+++ b/xen/common/ubsan/ubsan.c
@@ -174,6 +174,9 @@ static void ubsan_epilogue(unsigned long *flags)
 		"========================================\n");
 	spin_unlock_irqrestore(&report_lock, *flags);
 	current->in_ubsan--;
+
+	if (IS_ENABLED(CONFIG_UBSAN_FATAL))
+	    panic("UBSAN failure detected\n");
 }
 
 static void handle_overflow(struct overflow_data *data, unsigned long lhs,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 05:11:12 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 05:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.649550.1014168 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rB6fI-0006zM-66; Thu, 07 Dec 2023 05:11:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 649550.1014168; Thu, 07 Dec 2023 05:11:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rB6fI-0006zE-3T; Thu, 07 Dec 2023 05:11:12 +0000
Received: by outflank-mailman (input) for mailman id 649550;
 Thu, 07 Dec 2023 05:11:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB6fH-0006z4-Iq
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 05:11:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB6fH-00023J-I7
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 05:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB6fH-0007az-H1
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 05:11:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cCaq1wGx3+9BQojdlr3i2qylH/x8eD6FhIWAJn/I5ng=; b=D4778L1fvLWfKGSeZrLRg2bsnp
	RBILp8aIw68knfevpc2wpqZk6OUFucbfOfWR6kzAzz8BU7LZgeM9DLEtrwZPHnwZTlXQlytYV3rsw
	SdzgWf6YkorEyQ1wOUqdgUmAU5x0y69+pgtwr4kyga432/4ssjji7W5PV5rLkYuOREtg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation/alpine: add elfutils-dev
Message-Id: <E1rB6fH-0007az-H1@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 05:11:11 +0000

commit 948e03303138482bf12f67740d8ebd8272824903
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Nov 28 11:03:49 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Dec 5 18:02:51 2023 +0000

    automation/alpine: add elfutils-dev
    
    In preparation for adding some livepatch-build-tools test update the Alpine
    container to also install elfutils-dev.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/build/alpine/3.18.dockerfile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/automation/build/alpine/3.18.dockerfile b/automation/build/alpine/3.18.dockerfile
index 4ae9cb5e9e..8d5dac05b0 100644
--- a/automation/build/alpine/3.18.dockerfile
+++ b/automation/build/alpine/3.18.dockerfile
@@ -47,3 +47,5 @@ RUN apk --no-cache add \
   libcap-ng-dev \
   ninja \
   pixman-dev \
+  # livepatch-tools deps
+  elfutils-dev \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 05:11:22 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 05:11:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.649551.1014173 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rB6fS-00072R-7u; Thu, 07 Dec 2023 05:11:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 649551.1014173; Thu, 07 Dec 2023 05:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rB6fS-00072K-4t; Thu, 07 Dec 2023 05:11:22 +0000
Received: by outflank-mailman (input) for mailman id 649551;
 Thu, 07 Dec 2023 05:11: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 1rB6fR-000728-Mv
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 05:11:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB6fR-00023k-LQ
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 05:11:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rB6fR-0007bQ-KC
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 05:11:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zPEAth5ZrKXsZy7yii+38EHc2tlvq4fxbJbVaR8+LKg=; b=COsezSlfUrOi33DRMYAmO2MYH6
	yd75jAoUG3F/TgujaNdjIiyqPVrdTNeU9jKFRU21ZZwFyzRwYMWiDP1PX5Ve8JNFNLsAPvvl827R7
	6BWSYuE2Iv21mIuWnz6zBYI2EBMhBx8c3OKAvsSlVOM9BEvqXiDp1iL7elwqMytzoGT8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] ns16550: remove partial explicit initializer
Message-Id: <E1rB6fR-0007bQ-KC@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 05:11:21 +0000

commit 01da0aeecd41435cea8bd2fe0f547e0a474f6e45
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Tue Dec 5 17:31:23 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Dec 5 20:29:00 2023 +0000

    ns16550: remove partial explicit initializer
    
    The initializer of 'ns16550_com' violates MISRA C Rule 9.3
    because it explicitly initializes only the first element of the array,
    but the semantics is the same if the explicit initialization is
    omitted.
    
    No functional change.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/drivers/char/ns16550.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index ddf2a48be6..c8a51ed660 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -73,7 +73,7 @@ static struct ns16550 {
     bool msi;
     const struct ns16550_config_param *param; /* Points into .init.*! */
 #endif
-} ns16550_com[2] = { { 0 } };
+} ns16550_com[2] = {};
 
 #ifdef NS16550_PCI
 struct ns16550_config {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 08:55:07 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 08:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.649630.1014356 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBA9u-0000EO-T6; Thu, 07 Dec 2023 08:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 649630.1014356; Thu, 07 Dec 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 1rBA9u-0000EH-Qj; Thu, 07 Dec 2023 08:55:02 +0000
Received: by outflank-mailman (input) for mailman id 649630;
 Thu, 07 Dec 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 1rBA9u-0000EB-4k
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBA9u-0006rB-10
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 08:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rBA9t-00030E-W6
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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=me+T4EOclFcp0QMzrwOGmZWnDVTmi+jIIBhvfJKjr/Q=; b=hH9T2B2R0Z+1e6wXkm2SU833Wc
	kdjgo2aNqu4b3MniicV+4dWcMC/ancFtu2dgjQFXVS5/tV9MtA/q1v5od6MOj2htl7orWGn9duSpS
	LEKiby96aE5JHvKgMEfUSJPlSEctW5xPfNBkbRPDhHolg2ZX10vDhGjt7shhmCRRpmAY=;
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: Release domain if we are not able to enable memory sharing
Message-Id: <E1rBA9t-00030E-W6@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 08:55:01 +0000

commit 32c3403e4c1ce5522e08e554b9e404f2c9fd0908
Author:     Frediano Ziglio <frediano.ziglio@cloud.com>
AuthorDate: Wed Dec 6 10:46:01 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:46:01 2023 +0100

    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>
    master commit: fbcec32d6d3ea0ac329301925b317478316209ed
    master date: 2023-11-27 12:06:13 +0000
---
 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 90ffb10401..af72008d6a 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -2018,7 +2018,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#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 08:55:12 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 08:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.649631.1014361 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBAA4-0000GO-Uw; Thu, 07 Dec 2023 08:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 649631.1014361; Thu, 07 Dec 2023 08: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 1rBAA4-0000GH-SE; Thu, 07 Dec 2023 08:55:12 +0000
Received: by outflank-mailman (input) for mailman id 649631;
 Thu, 07 Dec 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 1rBAA4-0000G8-8A
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBAA4-0006rM-6S
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBAA4-00030n-3Y
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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=BYZ+MykDJNjp85yWEMIXgOj10O5/bJO6AXPHfI30IVs=; b=0vsc7Z9HXJOTIHehZOdSdGYvjE
	1qmCwBuHN5C/hNDG+LHMUXI3JecF7RkbphB+o4zNSLCv1J+7ZjZTrKIQf4OVn3KvqGG3fVc5C2k+a
	kVlvLh8WAXFKSog2Nvxyx1PVxsR7yWO5saX01//oHo6TTTVaEb3aIO1XVhatvFmwQXhw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] livepatch: do not use .livepatch.funcs section to store internal state
Message-Id: <E1rBAA4-00030n-3Y@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 08:55:12 +0000

commit e3c1ffb2a3ebad0bc26576fe811dc9ef43d6c507
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Dec 6 10:46:47 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:46:47 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/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>
    master commit: 82182ad7b46e0f7a3856bb12c7a9bf2e2a4570bc
    master date: 2023-11-27 15:16:01 +0100
    master commit: 902377b690f42ddf44ae91c4b0751d597f1cd694
    master date: 2023-11-29 10:46:42 +0000
---
 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 +-
 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 +-
 15 files changed, 130 insertions(+), 88 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 57abc746e6..1deee35b1d 100644
--- a/xen/arch/arm/livepatch.c
+++ b/xen/arch/arm/livepatch.c
@@ -68,7 +68,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;
 
@@ -78,15 +78,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 d385f882c6..c2ae84d18b 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 )
             {
@@ -1305,7 +1314,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();
 
@@ -1341,7 +1350,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
@@ -1382,9 +1391,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");
@@ -2101,7 +2111,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 7eb8de8fa4..ef4f364a74 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -861,10 +861,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 9fdb29c382..537d3d58b6 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_t 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. */
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#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 08:55:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 08:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.649632.1014364 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBAAF-0000KL-1x; Thu, 07 Dec 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 649632.1014364; Thu, 07 Dec 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 1rBAAE-0000KD-VR; Thu, 07 Dec 2023 08:55:22 +0000
Received: by outflank-mailman (input) for mailman id 649632;
 Thu, 07 Dec 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 1rBAAE-0000Jr-Ag
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBAAE-0006rm-9l
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBAAE-00031J-8n
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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=MFZvpfjFMIWsgt8f+hprXRyhaE9/SU7IxPPHBIe1bCM=; b=ef8PVor2zlQfkKI8BQoyF7pMJW
	KJ1b+ZVRa7AJFYk2RmzJbCAPAhEqgb36y9NRpp1YXe9TKf1TBrjZNI0o53cIyhLBYcA16Whgl21VC
	h9eWnLucGJ6z0ZkzRNSJeh9H17geWEdHZSRPV6lP1ul/9f9TZYGpmlWaNS+TiHrgjacE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] xen/x86: In x2APIC mode, derive LDR from APIC ID
Message-Id: <E1rBAAE-00031J-8n@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 08:55:22 +0000

commit eac655d6bef218fb3964634008e26d8faa9e1d56
Author:     Alejandro Vallejo <alejandro.vallejo@cloud.com>
AuthorDate: Wed Dec 6 10:47:52 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:47:52 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>
    master commit: 90309854fd2440fb08b4c808f47d7670ba0d250d
    master date: 2023-11-29 10:05:55 +0100
---
 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 5909935e0b..c10d313215 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1072,13 +1072,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 value)
@@ -1509,27 +1522,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 698455444e..e8e59a72bc 100644
--- a/xen/arch/x86/include/asm/hvm/domain.h
+++ b/xen/arch/x86/include/asm/hvm/domain.h
@@ -117,6 +117,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#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 08:55:34 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 08:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.649633.1014368 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBAAQ-0000NP-3Z; Thu, 07 Dec 2023 08:55:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 649633.1014368; Thu, 07 Dec 2023 08:55:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBAAQ-0000NG-0p; Thu, 07 Dec 2023 08:55:34 +0000
Received: by outflank-mailman (input) for mailman id 649633;
 Thu, 07 Dec 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 1rBAAO-0000N5-Dg
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBAAO-0006rt-Co
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBAAO-00031i-Bs
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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=tk2UR63JXib82L8TQ6cU3POQjIC1VOGdBv8Jo2xr1pQ=; b=0C2M7m6gsCWTXqIM7YaM9QV0CQ
	YsslwWhhgMK06+vt9RWeKJEnohXXIXTMBW8o9MMQvQHQSpfYVomMx5z11ti73s/gzsDTwLdkv8W6G
	LBD4faR+lXHdMKjhYUHYlsfBNVswJFR+koN/p26EMMOpQz7OXHo0V31TTJXZAkRZGQWo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] tools/xg: Fix potential memory leak in cpu policy getters/setters
Message-Id: <E1rBAAO-00031i-Bs@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 08:55:32 +0000

commit 4923450c0e640521046fcbccac96077325df3a86
Author:     Alejandro Vallejo <alejandro.vallejo@cloud.com>
AuthorDate: Wed Dec 6 10:48:32 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:48:32 2023 +0100

    tools/xg: Fix potential memory leak in cpu policy getters/setters
    
    They allocate two different hypercall buffers, but leak the first
    allocation if the second one failed due to an early return that bypasses
    cleanup.
    
    Remove the early exit and go through _post() instead. Invoking _post() is
    benign even if _pre() failed.
    
    Fixes: 6b85e427098c ('x86/sysctl: Implement XEN_SYSCTL_get_cpu_policy')
    Fixes: 60529dfeca14 ('x86/domctl: Implement XEN_DOMCTL_get_cpu_policy')
    Fixes: 14ba07e6f816 ('x86/domctl: Implement XEN_DOMCTL_set_cpumsr_policy')
    Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
    master commit: 1571ff7a987b88b20598a6d49910457f3b2c59f1
    master date: 2023-12-01 10:53:07 +0100
---
 tools/libs/guest/xg_cpuid_x86.c | 86 +++++++++++++++++++----------------------
 1 file changed, 39 insertions(+), 47 deletions(-)

diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x86.c
index 0c7d162da6..84babe6908 100644
--- a/tools/libs/guest/xg_cpuid_x86.c
+++ b/tools/libs/guest/xg_cpuid_x86.c
@@ -136,20 +136,20 @@ static int get_system_cpu_policy(xc_interface *xch, uint32_t index,
     DECLARE_HYPERCALL_BOUNCE(msrs,
                              *nr_msrs * sizeof(*msrs),
                              XC_HYPERCALL_BUFFER_BOUNCE_OUT);
-    int ret;
-
-    if ( xc_hypercall_bounce_pre(xch, leaves) ||
-         xc_hypercall_bounce_pre(xch, msrs) )
-        return -1;
+    int ret = -1;
 
-    sysctl.cmd = XEN_SYSCTL_get_cpu_policy;
-    sysctl.u.cpu_policy.index = index;
-    sysctl.u.cpu_policy.nr_leaves = *nr_leaves;
-    set_xen_guest_handle(sysctl.u.cpu_policy.leaves, leaves);
-    sysctl.u.cpu_policy.nr_msrs = *nr_msrs;
-    set_xen_guest_handle(sysctl.u.cpu_policy.msrs, msrs);
-
-    ret = do_sysctl(xch, &sysctl);
+    if ( !xc_hypercall_bounce_pre(xch, leaves) &&
+         !xc_hypercall_bounce_pre(xch, msrs) )
+    {
+        sysctl.cmd = XEN_SYSCTL_get_cpu_policy;
+        sysctl.u.cpu_policy.index = index;
+        sysctl.u.cpu_policy.nr_leaves = *nr_leaves;
+        set_xen_guest_handle(sysctl.u.cpu_policy.leaves, leaves);
+        sysctl.u.cpu_policy.nr_msrs = *nr_msrs;
+        set_xen_guest_handle(sysctl.u.cpu_policy.msrs, msrs);
+
+        ret = do_sysctl(xch, &sysctl);
+    }
 
     xc_hypercall_bounce_post(xch, leaves);
     xc_hypercall_bounce_post(xch, msrs);
@@ -174,20 +174,20 @@ static int get_domain_cpu_policy(xc_interface *xch, uint32_t domid,
     DECLARE_HYPERCALL_BOUNCE(msrs,
                              *nr_msrs * sizeof(*msrs),
                              XC_HYPERCALL_BUFFER_BOUNCE_OUT);
-    int ret;
-
-    if ( xc_hypercall_bounce_pre(xch, leaves) ||
-         xc_hypercall_bounce_pre(xch, msrs) )
-        return -1;
-
-    domctl.cmd = XEN_DOMCTL_get_cpu_policy;
-    domctl.domain = domid;
-    domctl.u.cpu_policy.nr_leaves = *nr_leaves;
-    set_xen_guest_handle(domctl.u.cpu_policy.leaves, leaves);
-    domctl.u.cpu_policy.nr_msrs = *nr_msrs;
-    set_xen_guest_handle(domctl.u.cpu_policy.msrs, msrs);
+    int ret = -1;
 
-    ret = do_domctl(xch, &domctl);
+    if ( !xc_hypercall_bounce_pre(xch, leaves) &&
+         !xc_hypercall_bounce_pre(xch, msrs) )
+    {
+        domctl.cmd = XEN_DOMCTL_get_cpu_policy;
+        domctl.domain = domid;
+        domctl.u.cpu_policy.nr_leaves = *nr_leaves;
+        set_xen_guest_handle(domctl.u.cpu_policy.leaves, leaves);
+        domctl.u.cpu_policy.nr_msrs = *nr_msrs;
+        set_xen_guest_handle(domctl.u.cpu_policy.msrs, msrs);
+
+        ret = do_domctl(xch, &domctl);
+    }
 
     xc_hypercall_bounce_post(xch, leaves);
     xc_hypercall_bounce_post(xch, msrs);
@@ -214,32 +214,24 @@ int xc_set_domain_cpu_policy(xc_interface *xch, uint32_t domid,
     DECLARE_HYPERCALL_BOUNCE(msrs,
                              nr_msrs * sizeof(*msrs),
                              XC_HYPERCALL_BUFFER_BOUNCE_IN);
-    int ret;
-
-    if ( err_leaf_p )
-        *err_leaf_p = -1;
-    if ( err_subleaf_p )
-        *err_subleaf_p = -1;
-    if ( err_msr_p )
-        *err_msr_p = -1;
+    int ret = -1;
 
-    if ( xc_hypercall_bounce_pre(xch, leaves) )
-        return -1;
-
-    if ( xc_hypercall_bounce_pre(xch, msrs) )
-        return -1;
-
-    domctl.cmd = XEN_DOMCTL_set_cpu_policy;
-    domctl.domain = domid;
-    domctl.u.cpu_policy.nr_leaves = nr_leaves;
-    set_xen_guest_handle(domctl.u.cpu_policy.leaves, leaves);
-    domctl.u.cpu_policy.nr_msrs = nr_msrs;
-    set_xen_guest_handle(domctl.u.cpu_policy.msrs, msrs);
     domctl.u.cpu_policy.err_leaf = -1;
     domctl.u.cpu_policy.err_subleaf = -1;
     domctl.u.cpu_policy.err_msr = -1;
 
-    ret = do_domctl(xch, &domctl);
+    if ( !xc_hypercall_bounce_pre(xch, leaves) &&
+         !xc_hypercall_bounce_pre(xch, msrs) )
+    {
+        domctl.cmd = XEN_DOMCTL_set_cpu_policy;
+        domctl.domain = domid;
+        domctl.u.cpu_policy.nr_leaves = nr_leaves;
+        set_xen_guest_handle(domctl.u.cpu_policy.leaves, leaves);
+        domctl.u.cpu_policy.nr_msrs = nr_msrs;
+        set_xen_guest_handle(domctl.u.cpu_policy.msrs, msrs);
+
+        ret = do_domctl(xch, &domctl);
+    }
 
     xc_hypercall_bounce_post(xch, leaves);
     xc_hypercall_bounce_post(xch, msrs);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 08:55:44 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 08:55:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.649634.1014373 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBAAa-0000Pp-4q; Thu, 07 Dec 2023 08:55:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 649634.1014373; Thu, 07 Dec 2023 08:55:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBAAa-0000Pi-2H; Thu, 07 Dec 2023 08:55:44 +0000
Received: by outflank-mailman (input) for mailman id 649634;
 Thu, 07 Dec 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 1rBAAY-0000Pa-Hp
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBAAY-0006s1-H1
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBAAY-00032B-FL
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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=hmQeYQf75n+054PyUHAjuAOqVPQbQ90EqKx2KgmflDk=; b=iX1SulsZkHEHTXH1cyfaa7Ipox
	CjTQeIcIHQHyRgujB2u3FTf8rgipALcqOPVEcAOJCbOnr8/N2fg32QIaNYH3XSN1JMWTrnx12EppN
	k3SNRr9O0vLVhyPIQmwYxnQ1+rzxdC5gZhpv0mlHm6juUvDNfWsU3ACWGA8+i3Xgy0tU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86emul: avoid triggering event related assertions
Message-Id: <E1rBAAY-00032B-FL@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 08:55:42 +0000

commit 7d8bd64e11081d075af7700a844096f6eeb70446
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Dec 6 10:48:56 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:48:56 2023 +0100

    x86emul: avoid triggering event related assertions
    
    The assertion at the end of x86_emulate_wrapper() as well as the ones
    in x86_emul_{hw_exception,pagefault}() can trigger if we ignore
    X86EMUL_EXCEPTION coming back from certain hook functions. Squash
    exceptions when merely probing MSRs, plus on SWAPGS'es "best effort"
    error handling path.
    
    In adjust_bnd() add another assertion after the read_xcr(0, ...)
    invocation, paralleling the one in x86emul_get_fpu() - XCR0 reads should
    never fault when XSAVE is (implicitly) known to be available.
    
    Also update the respective comment in x86_emulate_wrapper().
    
    Fixes: 14a6be89ec04 ("x86emul: correct EFLAGS.TF handling")
    Fixes: cb2626c75813 ("x86emul: conditionally clear BNDn for branches")
    Fixes: 6eb43fcf8a0b ("x86emul: support SWAPGS")
    Reported-by: AFL
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 787d11c5aaf4d3411d4658cff137cd49b0bd951b
    master date: 2023-12-05 09:57:05 +0100
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 37 +++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 7a4d3437dd..0c0336f737 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2476,10 +2476,18 @@ static bool is_branch_step(struct x86_emulate_ctxt *ctxt,
                            const struct x86_emulate_ops *ops)
 {
     uint64_t debugctl;
+    int rc = X86EMUL_UNHANDLEABLE;
 
-    return ops->read_msr &&
-           ops->read_msr(MSR_IA32_DEBUGCTLMSR, &debugctl, ctxt) == X86EMUL_OKAY &&
-           (debugctl & IA32_DEBUGCTLMSR_BTF);
+    if ( !ops->read_msr ||
+         (rc = ops->read_msr(MSR_IA32_DEBUGCTLMSR, &debugctl,
+                             ctxt)) != X86EMUL_OKAY )
+    {
+        if ( rc == X86EMUL_EXCEPTION )
+            x86_emul_reset_event(ctxt);
+        debugctl = 0;
+    }
+
+    return debugctl & IA32_DEBUGCTLMSR_BTF;
 }
 
 static bool umip_active(struct x86_emulate_ctxt *ctxt,
@@ -2504,13 +2512,21 @@ static void adjust_bnd(struct x86_emulate_ctxt *ctxt,
 
     if ( !ops->read_xcr || ops->read_xcr(0, &xcr0, ctxt) != X86EMUL_OKAY ||
          !(xcr0 & X86_XCR0_BNDREGS) || !(xcr0 & X86_XCR0_BNDCSR) )
+    {
+        ASSERT(!ctxt->event_pending);
         return;
+    }
 
     if ( !mode_ring0() )
         bndcfg = read_bndcfgu();
     else if ( !ops->read_msr ||
-              ops->read_msr(MSR_IA32_BNDCFGS, &bndcfg, ctxt) != X86EMUL_OKAY )
+              (rc = ops->read_msr(MSR_IA32_BNDCFGS, &bndcfg,
+                                  ctxt)) != X86EMUL_OKAY )
+    {
+        if ( rc == X86EMUL_EXCEPTION )
+            x86_emul_reset_event(ctxt);
         return;
+    }
     if ( (bndcfg & IA32_BNDCFGS_ENABLE) && !(bndcfg & IA32_BNDCFGS_PRESERVE) )
     {
         /*
@@ -5868,8 +5884,10 @@ x86_emulate(
             if ( (rc = ops->write_segment(x86_seg_gs, &sreg,
                                           ctxt)) != X86EMUL_OKAY )
             {
-                /* Best effort unwind (i.e. no error checking). */
-                ops->write_msr(MSR_SHADOW_GS_BASE, msr_val, ctxt);
+                /* Best effort unwind (i.e. no real error checking). */
+                if ( ops->write_msr(MSR_SHADOW_GS_BASE, msr_val,
+                                    ctxt) == X86EMUL_EXCEPTION )
+                    x86_emul_reset_event(ctxt);
                 goto done;
             }
             break;
@@ -8250,7 +8268,10 @@ x86_emulate(
                     cr4 = X86_CR4_OSFXSR;
                 if ( !ops->read_msr ||
                      ops->read_msr(MSR_EFER, &msr_val, ctxt) != X86EMUL_OKAY )
+                {
+                    x86_emul_reset_event(ctxt);
                     msr_val = 0;
+                }
                 if ( !(cr4 & X86_CR4_OSFXSR) ||
                      (mode_64bit() && mode_ring0() && (msr_val & EFER_FFXSE)) )
                     op_bytes = offsetof(struct x86_fxsr, xmm[0]);
@@ -12215,7 +12236,9 @@ int x86_emulate_wrapper(
      * An event being pending should exactly match returning
      * X86EMUL_EXCEPTION.  (If this trips, the chances are a codepath has
      * called hvm_inject_hw_exception() rather than using
-     * x86_emul_hw_exception().)
+     * x86_emul_hw_exception(), or the invocation of a hook has caused an
+     * exception to be raised, while the caller was only checking for
+     * success/failure.)
      */
     ASSERT(ctxt->event_pending == (rc == X86EMUL_EXCEPTION));
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 08:55:54 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 08:55:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.649635.1014377 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBAAk-0000Yq-6Z; Thu, 07 Dec 2023 08:55:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 649635.1014377; Thu, 07 Dec 2023 08:55:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBAAk-0000Yi-3y; Thu, 07 Dec 2023 08:55:54 +0000
Received: by outflank-mailman (input) for mailman id 649635;
 Thu, 07 Dec 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 1rBAAi-0000Wc-OV
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBAAi-0006sA-Lg
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBAAi-000332-J4
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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=o51TVK+QVH5/zcqm8+fiattSEt03f8R2wHi5b8f0+rk=; b=R/0R9wpd16OXDGvNYY/nqttDK6
	1Bp2v5SFuuYLUJa1xF2WEWoU7nDLI+N+m39MvRfCs9bdA9m9C5RBzZqGQ87VGyKFOVv+6le9jmj4i
	WCym4LLT8QNtImCFC5fR9EpvMlfEXolkjtvgFF4onwNecAARihaMFH2AFXzZqjT475QE=;
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 adding offline cpu to cpupool
Message-Id: <E1rBAAi-000332-J4@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 08:55:52 +0000

commit 5d01aa7ad5ee7d6da1e4d519d716f3256fcc36a5
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Dec 6 10:49:29 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:49:29 2023 +0100

    xen/sched: fix adding offline cpu to cpupool
    
    Trying to add an offline cpu to a cpupool can crash the hypervisor,
    as the probably non-existing percpu area of the cpu is accessed before
    the availability of the cpu is being tested. This can happen in case
    the cpupool's granularity is "core" or "socket".
    
    Fix that by testing the cpu to be online.
    
    Fixes: cb563d7665f2 ("xen/sched: support core scheduling for moving cpus to/from cpupools")
    Reported-by: René Winther Højgaard <renewin@proton.me>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 06e8d65d33896aa90f5b6d9b2bce7f11433b33c9
    master date: 2023-12-05 09:57:38 +0100
---
 xen/common/sched/cpupool.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/common/sched/cpupool.c b/xen/common/sched/cpupool.c
index bdf6030ab0..400b27b7c7 100644
--- a/xen/common/sched/cpupool.c
+++ b/xen/common/sched/cpupool.c
@@ -892,6 +892,8 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op)
         if ( cpu >= nr_cpu_ids )
             goto addcpu_out;
         ret = -ENODEV;
+        if ( !cpu_online(cpu) )
+            goto addcpu_out;
         cpus = sched_get_opt_cpumask(c->gran, cpu);
         if ( !cpumask_subset(cpus, &cpupool_free_cpus) ||
              cpumask_intersects(cpus, &cpupool_locked_cpus) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 08:56:04 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 08:56:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.649636.1014381 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBAAu-0000fm-80; Thu, 07 Dec 2023 08:56:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 649636.1014381; Thu, 07 Dec 2023 08: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 1rBAAu-0000fe-5J; Thu, 07 Dec 2023 08:56:04 +0000
Received: by outflank-mailman (input) for mailman id 649636;
 Thu, 07 Dec 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 1rBAAs-0000fT-PM
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBAAs-0006sZ-OZ
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBAAs-00034w-Nf
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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=ovfCrx4MhM4Fpqnoj+lVNCdSwQTEX5cXmp0SobZ+/XM=; b=MXi0gw7yAYFRBkLokISu3Q6HAs
	/qsxV8SKDg1puHhy9kG26fjTdktJO1/KCzvAcHDzdWebebxDn15W/lK8B1ePVxXfsKCnbNdgzdIWc
	D4ml8D25g5I1i/7Lk8U7Z2fGxbbN9h96e9tEsI4ETh9z+Qcd0uApdgAVZKGHPpSNJvdg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] xen/domain: fix error path in domain_create()
Message-Id: <E1rBAAs-00034w-Nf@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 08:56:02 +0000

commit 6eb98dda5c91e68555684c57a2c9bd119ff082c1
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Wed Dec 6 10:49:54 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:49:54 2023 +0100

    xen/domain: fix error path in domain_create()
    
    If rangeset_new() fails, err would not be set to an appropriate error
    code. Set it to -ENOMEM.
    
    Fixes: 580c458699e3 ("xen/domain: Call arch_domain_create() as early as possible in domain_create()")
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: ff1178062094837d55ef342070e58316c43a54c9
    master date: 2023-12-05 10:00:51 +0100
---
 xen/common/domain.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 30c2279673..8f924d5cdd 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -674,6 +674,7 @@ struct domain *domain_create(domid_t domid,
         watchdog_domain_init(d);
         init_status |= INIT_watchdog;
 
+        err = -ENOMEM;
         d->iomem_caps = rangeset_new(d, "I/O Memory", RANGESETF_prettyprint_hex);
         d->irq_caps   = rangeset_new(d, "Interrupts", 0);
         if ( !d->iomem_caps || !d->irq_caps )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 18:55:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 18:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650122.1015388 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBJWZ-0004fh-FB; Thu, 07 Dec 2023 18:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650122.1015388; Thu, 07 Dec 2023 18: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 1rBJWZ-0004fZ-Cd; Thu, 07 Dec 2023 18:55:03 +0000
Received: by outflank-mailman (input) for mailman id 650122;
 Thu, 07 Dec 2023 18: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 1rBJWY-0004fR-7Q
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 18: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 1rBJWY-0001nz-2Q
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 18:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rBJWY-0003H2-0i
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 18: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=dUtwnGtFmNPPgjVoUfgrE8XHTI04xRI9rxuIExWGO/Q=; b=AZbyqMAXnBiHICJcH9tcZOxvR1
	LiybiPHbNhICSLYEDq09kGKAPWXYPW7w7vWfNSAlOreQg/6aEaP9sv2p8FmaBnitemvsvu6JyyrQn
	bCnaQyMLg6ZMIspedWL9eJ5jMofSCXnWZvuQIjRfdfzq458+EdZnBYVi5mkemcoXUinA=;
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 use objcopy --dump-section
Message-Id: <E1rBJWY-0003H2-0i@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 18:55:02 +0000

commit 090eeeb1631f00a9a41ebf66d9b4aacb97eb51e7
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Dec 6 17:17:44 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Dec 7 18:53:04 2023 +0000

    Mini-OS: don't use objcopy --dump-section
    
    The objcopy option "--dump-section" isn't supported in binutils before
    version 2.25, which are still supported by the Xen build system.
    
    Avoid that by using the "-O binary" format together with
    "--only-section". This requires to set the "alloc" section flag.
    
    Fixes: 33411a11f848 ("Mini-OS: hide all symbols not exported via EXPORT_SYMBOLS()")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 456aed0..6c8df8b 100644
--- a/Makefile
+++ b/Makefile
@@ -166,7 +166,9 @@ $(OBJ_DIR)/arch/x86/minios-x86%.lds:  arch/x86/minios-x86.lds.S
 
 $(OBJ_DIR)/$(TARGET)-kern.o: $(OBJS) arch_lib $(OBJ_DIR)/$(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds
 	$(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(OBJS) $(LDARCHLIB) -o $@
-	$(OBJCOPY) --dump-section .export_symbol=$(OBJ_DIR)/syms $@
+	# The following would be neat, but isn't supported in binutils < 2.25
+	# $(OBJCOPY) --dump-section .export_symbol=$(OBJ_DIR)/syms $@
+	$(OBJCOPY) --set-section-flags .export_symbol=alloc -O binary --only-section=.export_symbol $@ $(OBJ_DIR)/syms
 	$(OBJCOPY) -w -G $(GLOBAL_PREFIX)* --keep-global-symbols=$(OBJ_DIR)/syms --remove-section=.export_symbol $@ $@
 
 $(OBJ_DIR)/$(TARGET): $(OBJ_DIR)/$(TARGET)-kern.o $(APP_O)
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 21:33:07 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 21:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650183.1015453 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBLzT-0003R9-07; Thu, 07 Dec 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 650183.1015453; Thu, 07 Dec 2023 21: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 1rBLzS-0003R1-Ti; Thu, 07 Dec 2023 21:33:02 +0000
Received: by outflank-mailman (input) for mailman id 650183;
 Thu, 07 Dec 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 1rBLzS-0003Qv-JM
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBLzS-0004rh-Cl
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBLzS-0002Ga-At
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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=KrTMwW0KD6VbAeOYkUU9sXcR3uNUMcbbr+kmRuGfa2M=; b=fpxGRnMkILVWJ4xgaXKBLBv8Rz
	KObzElZieE3g3ppgSNzpeESDpEmirtnswccKtg8mvqNUqCZBDF+iKjhtgP/ShZ6hx96nyph4NbQqo
	7XFHTUwTgjRFk0rM6YOjm3SuQrhFpt47RyXHX8tp/KkzaeFxT0VGaY54Vmu27YTy9dbU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: Fix fallout from adding elfutils-dev to the build container
Message-Id: <E1rBLzS-0002Ga-At@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 21:33:02 +0000

commit 4c6142a1ab004be132f386da3cabce07b44fac2d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Dec 5 21:54:25 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Dec 5 23:02:18 2023 +0000

    CI: Fix fallout from adding elfutils-dev to the build container
    
    Commit 948e03303138 ("automation/alpine: add elfutils-dev") had an unintended
    consequence of causing Qemu to gain a runtime dependency on libdw.so
    
    The {adl,zen3p}-pci-hvm-x86-64-gcc-debug tests, which are the only two tests
    that run the built Qemu, started failing with:
    
      Error loading shared library libdw.so.1: No such file or directory (needed by /usr/local/lib/xen/bin/qemu-system-i386)
      Error relocating /usr/local/lib/xen/bin/qemu-system-i386: dwfl_begin: symbol not found
    
    Update the test container with libelf to cope.
    
    While editing the runtime dependency list, fix up two other problems.  texinfo
    isn't a runtime dependency, and we should be using xz itself, not it's
    development libraries.  Both changes shrink the initrd used for tests.
    
    Fixes: 948e03303138 ("automation/alpine: add elfutils-dev")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile | 3 +--
 automation/tests-artifacts/alpine/3.18.dockerfile         | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile b/automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile
index 94f69621f4..0e5ae7f2b4 100644
--- a/automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile
+++ b/automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile
@@ -21,10 +21,9 @@ RUN \
   apk add python3 && \
   apk add zlib && \
   apk add ncurses && \
-  apk add texinfo && \
   apk add yajl && \
   apk add libaio && \
-  apk add xz-dev && \
+  apk add xz && \
   apk add util-linux && \
   apk add argp-standalone && \
   apk add libfdt && \
diff --git a/automation/tests-artifacts/alpine/3.18.dockerfile b/automation/tests-artifacts/alpine/3.18.dockerfile
index f1b4a8b7a1..9cde6c9ad4 100644
--- a/automation/tests-artifacts/alpine/3.18.dockerfile
+++ b/automation/tests-artifacts/alpine/3.18.dockerfile
@@ -22,10 +22,9 @@ RUN \
   apk add python3 && \
   apk add zlib && \
   apk add ncurses && \
-  apk add texinfo && \
   apk add yajl && \
   apk add libaio && \
-  apk add xz-dev && \
+  apk add xz && \
   apk add util-linux && \
   apk add argp-standalone && \
   apk add libfdt && \
@@ -34,6 +33,7 @@ RUN \
   apk add curl && \
   apk add udev && \
   apk add pciutils && \
+  apk add libelf && \
   \
   # Xen
   cd / && \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 21:33:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 21:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650184.1015457 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBLzd-0003TG-1o; Thu, 07 Dec 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 650184.1015457; Thu, 07 Dec 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 1rBLzc-0003T8-VF; Thu, 07 Dec 2023 21:33:12 +0000
Received: by outflank-mailman (input) for mailman id 650184;
 Thu, 07 Dec 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 1rBLzc-0003Sy-I7
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBLzc-0004rp-GR
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBLzc-0002H7-En
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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=aX2GMJF47di9Z/dxMz+zxtTW99zWjzlC8bH3mICCDVs=; b=oEt9BQfS5fJ2bAXRxwbnjh8ljv
	fzcNYWcUQo1j73lGrMdkJIU8OICIWbLGH96RKr12wJfprvRPVoS7QpiZtqM3/ryMvbi39fbfrlwmf
	WOPAdemEDDSJnV/tVnol8G/78zqxQZYQIiAbfM7NMtq6QDvW055LoeL7wdw6jIw9zHSs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/misra: deviate deliberately unused labels
Message-Id: <E1rBLzc-0002H7-En@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 21:33:12 +0000

commit d97d6a7f08c6a5d43047ee029a71e87316ab7f4f
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Mon Dec 4 19:23:11 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Dec 5 19:22:23 2023 -0800

    docs/misra: deviate deliberately unused labels
    
    The labels marked with __maybe_unused are either used only
    in certain build configurations or deliberately unused.
    See the justification in docs/misra/deviations.rst.
    
    No functional changes.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++++
 docs/misra/deviations.rst                        | 8 ++++++++
 2 files changed, 12 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index c9e3a90801..f18ed6345e 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -37,6 +37,10 @@ removed by the compiler, the resulting slowdown is negligible."
 -config=MC3R1.R2.2,reports+={disapplied,"any()"}
 -doc_end
 
+-doc_begin="Some labels are unused in certain build configurations, or are deliberately marked as unused, so that the compiler is entitled to remove them."
+-config=MC3R1.R2.6,reports+={deliberate, "any_area(text(^.*__maybe_unused.*$))"}
+-doc_end
+
 #
 # Series 3.
 #
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 160513b997..9979ddae7c 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -73,6 +73,14 @@ Deviations related to MISRA C:2012 Rules:
        resulting slowdown is negligible.
      - Project-wide deviation, tagged as `disapplied` for ECLAIR.
 
+   * - R2.6
+     - Labels deliberately marked as unused trough the pseudo-attribute
+       `__maybe_unused` are either the result of them not being in certain build
+       configurations, or as a deliberate practice (e.g., `unimplemented_insn`).
+       Given that the compiler is then entitled to remove them, the presence of
+       such labels poses no risks.
+     - Tagged as `deliberate` for ECLAIR.
+
    * - R3.1
      - Comments starting with '/\*' and containing hyperlinks are safe as they
        are not instances of commented-out code.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 21:33:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 21:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650185.1015461 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBLzn-0003Vd-3H; Thu, 07 Dec 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 650185.1015461; Thu, 07 Dec 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 1rBLzn-0003VV-0Q; Thu, 07 Dec 2023 21:33:23 +0000
Received: by outflank-mailman (input) for mailman id 650185;
 Thu, 07 Dec 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 1rBLzm-0003VN-Kk
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBLzm-0004s1-Jz
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBLzm-0002HW-IV
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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=xfpXFle7cqze1d1uZfZb6z/LUbuIti/cr06YSQ/umtU=; b=bq05bJNKQqg88mPJ+NMQwJkdyt
	ECTFWSSc/oZ8SztBDEss8VBQq3n+uwYNEnV8fDzrJ2XEmE6zR21xYerGVpQe6iEdn4FPUrE9lOn/I
	cLTzMrdwqP9idrqfLGwpSIqBeQGdJ88pss3bXe++zk0qZ1NPMdg2XoVu0dlqaMUy5DXs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation/eclair: add deviations for MISRA C:2012 Rule 5.6
Message-Id: <E1rBLzm-0002HW-IV@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 21:33:22 +0000

commit 1ff6d92938da6a1fba96c98f1ce77927cfa6aca2
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Nov 29 09:35:05 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Dec 5 19:23:07 2023 -0800

    automation/eclair: add deviations for MISRA C:2012 Rule 5.6
    
    Update ECLAIR configuration to take into account the adopted files
    and type "ret_t".
    Update docs/misra/deviations.rst accordingly.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 11 +++++++++++
 docs/misra/deviations.rst                        | 15 +++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index f18ed6345e..b0c79741b5 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -85,6 +85,17 @@ 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="The type \"ret_t\" is deliberately defined multiple times,
+depending on the guest."
+-config=MC3R1.R5.6,reports+={deliberate,"any_area(any_loc(text(^.*ret_t.*$)))"}
+-doc_end
+
+-doc_begin="The following files are imported from the gnu-efi package."
+-file_tag+={adopted_r5_6,"^xen/include/efi/.*$"}
+-file_tag+={adopted_r5_6,"^xen/arch/.*/include/asm/.*/efibind\\.h$"}
+-config=MC3R1.R5.6,reports+={deliberate,"any_area(any_loc(file(adopted_r5_6)))"}
+-doc_end
+
 #
 # Series 7.
 #
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 9979ddae7c..6e7c4f25b8 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -98,6 +98,21 @@ Deviations related to MISRA C:2012 Rules:
          - __emulate_2op and __emulate_2op_nobyte
          - read_debugreg and write_debugreg
 
+   * - R5.6
+     - The type ret_t is deliberately defined multiple times depending on the
+       type of guest to service.
+     - Tagged as `deliberate` for ECLAIR.
+
+   * - R5.6
+     - Some files are not subject to respect MISRA rules at
+       the moment, but, among these out-of-scope files, there are definitions
+       of typedef names that are already defined within in-scope files and
+       therefore, ECLAIR does report a violation since not all the files
+       involved in the violation are excluded from the analysis.
+     - Tagged as `deliberate` for ECLAIR. Such excluded files are:
+         - xen/include/efi/*
+         - xen/arch/*/include/asm/*/efibind.h
+
    * - R7.1
      - It is safe to use certain octal constants the way they are defined
        in specifications, manuals, and algorithm descriptions. Such places
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 21:33:34 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 21:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650186.1015465 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBLzy-0003YT-4S; Thu, 07 Dec 2023 21:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650186.1015465; Thu, 07 Dec 2023 21:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBLzy-0003YI-1s; Thu, 07 Dec 2023 21:33:34 +0000
Received: by outflank-mailman (input) for mailman id 650186;
 Thu, 07 Dec 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 1rBLzw-0003Y6-Np
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBLzw-0004sR-N3
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBLzw-0002Ji-M2
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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=D7DLIp77U77lVOy5dZpdL0KODeKy4eLPah3R0gppH/E=; b=f0d1Q0MW/4E+nZotvWJXlmMJCc
	sgF/ElqvhHWaxiNcAb1zFinVVeZ9Roy1uMHxq4vYcJGk5YOtsM0Aai3SJj/+BKlGp3ZJeHzf1qiI4
	3KUnul/z0HVgHghnMJ6cIzh1y6FbRGJZSIVu3C53Llc5owPuTW07VUgZ/e2/ix5fWwiM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation/eclair: tag function calls to address violations of MISRA C:2012 Rule 13.1
Message-Id: <E1rBLzw-0002Ji-M2@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 21:33:32 +0000

commit 3e5672d69fe09e240195fa6744686b59db6d7d69
Author:     Simone Ballarin <simone.ballarin@bugseng.com>
AuthorDate: Fri Nov 24 18:29:41 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Dec 5 19:25:02 2023 -0800

    automation/eclair: tag function calls to address violations of MISRA C:2012 Rule 13.1
    
    Rule 13.1: Initializer lists shall not contain persistent side effects
    
    Invocations of functions in initializer lists cause violations of rule
    13.1 if the called functions are not tagged with __attribute_pure__ or
    __attribute_const__ as they can produce persistent side effects.
    
    Handling these violations with  attributes is not always possible: the
    pure and const attributes may cause unwanted and potentially dangerous
    optimisations.
    
    To avoid this problem ECLAIR allows using the same attributes in the
    -call_properties setting. Additionally, it adds the noeffect attribute
    with the following definition:
    "like pure but can also read volatile variable not triggering side effects"
    
    These patch tags some functions used in initializer lists to address
    violations of Rule 13.1.
    
    No functional changes.
    
    Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 .../eclair_analysis/ECLAIR/call_properties.ecl     | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/call_properties.ecl b/automation/eclair_analysis/ECLAIR/call_properties.ecl
index 3f7794bf8b..c2b2a6182e 100644
--- a/automation/eclair_analysis/ECLAIR/call_properties.ecl
+++ b/automation/eclair_analysis/ECLAIR/call_properties.ecl
@@ -73,6 +73,17 @@
 -call_properties+={"macro(^va_start$)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
 -call_properties+={"macro(^memcmp$)", {"pointee_write(1..2=never)", "taken()"}}
 -call_properties+={"macro(^memcpy$)", {"pointee_write(1=always&&2..=never)", "pointee_read(1=never&&2..=always)", "taken()"}}
+-call_properties+={"name(get_cpu_info)",{pure}}
+-call_properties+={"name(pdx_to_pfn)",{pure}}
+-call_properties+={"name(is_pci_passthrough_enabled)",{const}}
+-call_properties+={"name(get_cycles)", {"noeffect"}}
+-call_properties+={"name(msi_gflags)",{const}}
+-call_properties+={"name(hvm_save_size)",{pure}}
+-call_properties+={"name(cpu_has)",{pure}}
+-call_properties+={"name(boot_cpu_has)",{pure}}
+-call_properties+={"name(get_cpu_info)",{pure}}
+-call_properties+={"name(put_pte_flags)",{const}}
+-call_properties+={"name(is_pv_vcpu)",{pure}}
 
 -doc_begin="Property inferred as a consequence of the semantics of device_tree_get_reg"
 -call_properties+={"name(acquire_static_memory_bank)", {"pointee_write(4..=always)", "pointee_read(4..=never)", "taken()"}}
@@ -104,3 +115,14 @@ Furthermore, their uses do initialize the involved variables as needed by futher
 -call_properties+={"macro(^(__)?(raw_)?copy_from_(paddr|guest|compat)(_offset)?$)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
 -call_properties+={"macro(^(__)?copy_to_(guest|compat)(_offset)?$)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
 -doc_end
+
+-doc_begin="Functions generated by build_atomic_read cannot be considered pure
+since the input pointer is volatile, but they do not produce any persistent side
+effect."
+-call_properties+={"^read_u(8|16|32|64|int)_atomic.*$", {noeffect}}
+-doc_end
+
+-doc_begin="Functions generated by TYPE_SAFE are const."
+-call_properties+={"^(mfn|gfn|pfn)_x\\(.*$",{const}}
+-call_properties+={"^_(mfn|gfn|pfn)\\(.*$",{const}}
+-doc_end
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 21:33:44 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 21:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650187.1015468 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBM08-0003bT-5t; Thu, 07 Dec 2023 21:33:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650187.1015468; Thu, 07 Dec 2023 21:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBM08-0003bM-3N; Thu, 07 Dec 2023 21:33:44 +0000
Received: by outflank-mailman (input) for mailman id 650187;
 Thu, 07 Dec 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 1rBM06-0003bD-R6
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBM06-0004sY-QH
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBM06-0002K9-P9
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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=1qG3/M5riQN7vpLwhiG9E1GmW/zglFUPVryTeCnr1Tw=; b=Z1OMkI3tlYWDurYYJVuGepLbEd
	x2mC55QegKdToJX3/oS7D9dOc/A7x6zoZhC4dCV7yjfFK6YAJMeVdOWX9TfDe8AuWxLZe5tV7sqNB
	azHOFggoFsdo44prmiz3AeE2CMCB+157Fn2QqW1F0TXpW9vtLEU+WPABpHLXcDNJ8gmI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv:introduce asm/byteorder.h
Message-Id: <E1rBM06-0002K9-P9@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 21:33:42 +0000

commit 204aa245df5c4b8afc3eb82117fd5120a6794faf
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Dec 6 10:19:59 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:19:59 2023 +0100

    xen/riscv:introduce asm/byteorder.h
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/byteorder.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/xen/arch/riscv/include/asm/byteorder.h b/xen/arch/riscv/include/asm/byteorder.h
new file mode 100644
index 0000000000..320a03c88f
--- /dev/null
+++ b/xen/arch/riscv/include/asm/byteorder.h
@@ -0,0 +1,16 @@
+#ifndef __ASM_RISCV_BYTEORDER_H__
+#define __ASM_RISCV_BYTEORDER_H__
+
+#define __BYTEORDER_HAS_U64__
+
+#include <xen/byteorder/little_endian.h>
+
+#endif /* __ASM_RISCV_BYTEORDER_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 Dec 07 21:33:54 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 21:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650188.1015473 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBM0I-0003eG-7Z; Thu, 07 Dec 2023 21:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650188.1015473; Thu, 07 Dec 2023 21:33:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBM0I-0003e8-4o; Thu, 07 Dec 2023 21:33:54 +0000
Received: by outflank-mailman (input) for mailman id 650188;
 Thu, 07 Dec 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 1rBM0G-0003dx-U3
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBM0G-0004sf-TJ
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBM0G-0002Kd-SJ
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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=+laFhPp5i1CgsUL7cmkUUrzbWDtpqjGy5MvQtSMP428=; b=S6MKC7f6hBSexGNacYBpd7bvjO
	53cRImAgbJro3kOmhJozRrZWtyF4BpvVDbe1QgMefZT8GZgWaI106F5gVCc9rOnIu0U26D2PbXcyv
	6frcp4zzjawZRsbnD/NA4FbeUcZQ7xozMBy1QB3hqchi7fmne04S2lnlrFPznINM+ZAA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: introduce spinlock.h
Message-Id: <E1rBM0G-0002Kd-SJ@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 21:33:52 +0000

commit 55cd2eaec3b1819284308c5ab533c41c3aae59aa
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Dec 6 10:20:27 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:20:27 2023 +0100

    xen/riscv: introduce spinlock.h
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/spinlock.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/xen/arch/riscv/include/asm/spinlock.h b/xen/arch/riscv/include/asm/spinlock.h
new file mode 100644
index 0000000000..bf45a7f005
--- /dev/null
+++ b/xen/arch/riscv/include/asm/spinlock.h
@@ -0,0 +1,15 @@
+#ifndef __ASM_RISCV_SPINLOCK_H
+#define __ASM_RISCV_SPINLOCK_H
+
+#define arch_lock_acquire_barrier() smp_mb()
+#define arch_lock_release_barrier() smp_mb()
+
+#define arch_lock_relax() cpu_relax()
+#define arch_lock_signal() ((void)0)
+#define arch_lock_signal_wmb()      \
+({                                  \
+    smp_wmb();                      \
+    arch_lock_signal();             \
+})
+
+#endif /* __ASM_RISCV_SPINLOCK_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 21:34:04 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 21:34:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650189.1015477 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBM0S-0003hT-AO; Thu, 07 Dec 2023 21:34:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650189.1015477; Thu, 07 Dec 2023 21:34:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBM0S-0003hK-7a; Thu, 07 Dec 2023 21:34:04 +0000
Received: by outflank-mailman (input) for mailman id 650189;
 Thu, 07 Dec 2023 21: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 1rBM0R-0003hB-1l
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 21: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 1rBM0R-0004t1-0y
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 21:34:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rBM0Q-0002Le-Va
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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=lxXwvXYsUoVfdJ6nN9mBm/n5aZoZe+i2xuGEhr0V+28=; b=nv7BpJRvbqqLS6DCnCxTNvlvYe
	D+XyeWBBkHYNsW28hdmc93lXPLNzcnR2QwTp5XzJyS9OFQ19dcREh4EnXBW4z0XxCC+xaNm1KVqLu
	kh+qSGb9mfGSMsSs+WR8UFLsUuflsF2BrKovPRyLXRO3vjS6JbuUQmKMC8ncbNswjNHU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/HVM: introduce hvm_get_entry()
Message-Id: <E1rBM0Q-0002Le-Va@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 21:34:02 +0000

commit 634c6e15ac44cd6b09a79126bf1424fd72ab31df
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Dec 6 10:21:51 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:21:51 2023 +0100

    x86/HVM: introduce hvm_get_entry()
    
    ... to accompany hvm_read_entry() when actual copying isn't desirable.
    This allows to remove open-coded stream accesses from hpet_load(),
    along with using the helper in hvm_load() itself.
    
    Since arch_hvm_load()'s declaration would need changing, and since the
    function is not used from elsewhere, purge the declaration. With that it
    makes little sense to keep arch_hvm_save()'s around; convert that
    function to static then at the same time.
    
    In hpet_load() simplify the specific case of error return that's in
    context anyway: There's no need to hold the lock when only updating a
    local variable.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hpet.c             | 13 ++++---------
 xen/arch/x86/hvm/save.c             | 13 +++++++------
 xen/arch/x86/include/asm/hvm/save.h | 20 +++++++++++++++-----
 3 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c
index 80f323316c..f6b554ecc7 100644
--- a/xen/arch/x86/hvm/hpet.c
+++ b/xen/arch/x86/hvm/hpet.c
@@ -637,7 +637,7 @@ static int cf_check hpet_save(struct vcpu *v, hvm_domain_context_t *h)
 static int cf_check hpet_load(struct domain *d, hvm_domain_context_t *h)
 {
     HPETState *hp = domain_vhpet(d);
-    struct hvm_hw_hpet *rec;
+    const struct hvm_hw_hpet *rec;
     uint64_t cmp;
     uint64_t guest_time;
     int i;
@@ -645,17 +645,12 @@ static int cf_check hpet_load(struct domain *d, hvm_domain_context_t *h)
     if ( !has_vhpet(d) )
         return -ENODEV;
 
-    write_lock(&hp->lock);
-
     /* Reload the HPET registers */
-    if ( _hvm_check_entry(h, HVM_SAVE_CODE(HPET), HVM_SAVE_LENGTH(HPET), 1) )
-    {
-        write_unlock(&hp->lock);
+    rec = hvm_get_entry(HPET, h);
+    if ( !rec )
         return -EINVAL;
-    }
 
-    rec = (struct hvm_hw_hpet *)&h->data[h->cur];
-    h->cur += HVM_SAVE_LENGTH(HPET);
+    write_lock(&hp->lock);
 
 #define C(x) hp->hpet.x = rec->x
     C(capability);
diff --git a/xen/arch/x86/hvm/save.c b/xen/arch/x86/hvm/save.c
index 79713cd6ca..78b34e5cff 100644
--- a/xen/arch/x86/hvm/save.c
+++ b/xen/arch/x86/hvm/save.c
@@ -15,7 +15,7 @@
 
 #include <public/hvm/save.h>
 
-void arch_hvm_save(struct domain *d, struct hvm_save_header *hdr)
+static void arch_hvm_save(struct domain *d, struct hvm_save_header *hdr)
 {
     uint32_t eax, ebx, ecx, edx;
 
@@ -30,7 +30,7 @@ void arch_hvm_save(struct domain *d, struct hvm_save_header *hdr)
     d->arch.hvm.sync_tsc = rdtsc();
 }
 
-int arch_hvm_load(struct domain *d, struct hvm_save_header *hdr)
+static int arch_hvm_load(struct domain *d, const struct hvm_save_header *hdr)
 {
     uint32_t eax, ebx, ecx, edx;
 
@@ -277,7 +277,7 @@ int hvm_save(struct domain *d, hvm_domain_context_t *h)
 
 int hvm_load(struct domain *d, hvm_domain_context_t *h)
 {
-    struct hvm_save_header hdr;
+    const struct hvm_save_header *hdr;
     struct hvm_save_descriptor *desc;
     hvm_load_handler handler;
     struct vcpu *v;
@@ -286,11 +286,12 @@ int hvm_load(struct domain *d, hvm_domain_context_t *h)
     if ( d->is_dying )
         return -EINVAL;
 
-    /* Read the save header, which must be first */
-    if ( hvm_load_entry(HEADER, h, &hdr) != 0 )
+    /* Get at the save header, which must be first */
+    hdr = hvm_get_entry(HEADER, h);
+    if ( !hdr )
         return -ENODATA;
 
-    rc = arch_hvm_load(d, &hdr);
+    rc = arch_hvm_load(d, hdr);
     if ( rc )
         return rc;
 
diff --git a/xen/arch/x86/include/asm/hvm/save.h b/xen/arch/x86/include/asm/hvm/save.h
index fa201f5d59..992a91d646 100644
--- a/xen/arch/x86/include/asm/hvm/save.h
+++ b/xen/arch/x86/include/asm/hvm/save.h
@@ -39,6 +39,21 @@ void _hvm_write_entry(struct hvm_domain_context *h,
 int _hvm_check_entry(struct hvm_domain_context *h,
                      uint16_t type, uint32_t len, bool strict_length);
 
+/*
+ * Unmarshalling: check, then return pointer. Evaluates to non-NULL on success.
+ * This macro requires the save entry to be the same size as the dest structure.
+ */
+#define hvm_get_entry(x, h) ({                                  \
+    const void *ptr = NULL;                                     \
+    BUILD_BUG_ON(HVM_SAVE_HAS_COMPAT(x));                       \
+    if ( _hvm_check_entry(h, HVM_SAVE_CODE(x),                  \
+                          HVM_SAVE_LENGTH(x), true) == 0 )      \
+    {                                                           \
+        ptr = &(h)->data[(h)->cur];                             \
+        h->cur += HVM_SAVE_LENGTH(x);                           \
+    }                                                           \
+    ptr; })
+
 /* Unmarshalling: copy the contents in a type-safe way */
 void _hvm_read_entry(struct hvm_domain_context *h,
                      void *dest, uint32_t dest_len);
@@ -127,9 +142,4 @@ int hvm_save_one(struct domain *d, unsigned int typecode, unsigned int instance,
                  XEN_GUEST_HANDLE_64(uint8) handle, uint64_t *bufsz);
 int hvm_load(struct domain *d, hvm_domain_context_t *h);
 
-/* Arch-specific definitions. */
-struct hvm_save_header;
-void arch_hvm_save(struct domain *d, struct hvm_save_header *hdr);
-int arch_hvm_load(struct domain *d, struct hvm_save_header *hdr);
-
 #endif /* __XEN_HVM_SAVE_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 21:34:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 21:34:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650190.1015481 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBM0c-0003kM-Bx; Thu, 07 Dec 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 650190.1015481; Thu, 07 Dec 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 1rBM0c-0003kE-9C; Thu, 07 Dec 2023 21:34:14 +0000
Received: by outflank-mailman (input) for mailman id 650190;
 Thu, 07 Dec 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 1rBM0b-0003k2-4r
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBM0b-0004t8-45
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBM0b-0002MU-30
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 21:34:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KIwrhIxKb+zOdh1p0Rotlw9XVkIyEpEOuwGZWm2xp3U=; b=s+c+2XK6lbnjZOCU2ZP2okzdN/
	xgSOZ1YFFd6aP5MUKukboALzhIOYOmg2VDd8SZ9a9TpBpvbVmNlndVxBxYw8VvFcw22R+qgMzEhSf
	iMFxsZuOwUWZncsduatKSiF6tAtOJQyU5UkhHdddRSbznTY6I5CvSSfykvTWft9a/X5s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/vPIC: vpic_elcr_mask() master bit 2 control
Message-Id: <E1rBM0b-0002MU-30@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 21:34:13 +0000

commit 2e5e9ec4ff900e03fb87612d968c5aaa9c9af511
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Dec 6 10:22:46 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:22:46 2023 +0100

    x86/vPIC: vpic_elcr_mask() master bit 2 control
    
    Master bit 2 is treated specially: We force it set, but we don't expose
    the bit being set to the guest. While right now the read and write
    handling can easily use the fixed mask, the restore input checking that
    is about to be put in place wants to use the inverted mask to prove that
    no bits are unduly set. That will require master bit 2 to be set. Otoh
    the read path requires the bit to be clear (the bit can have either
    value for the use on the write path). Hence allow use sites control over
    that bit.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hvm/vpic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
index 938d611361..5f822844db 100644
--- a/xen/arch/x86/hvm/vpic.c
+++ b/xen/arch/x86/hvm/vpic.c
@@ -41,7 +41,7 @@
 #define vpic_lock(v)   spin_lock(__vpic_lock(v))
 #define vpic_unlock(v) spin_unlock(__vpic_lock(v))
 #define vpic_is_locked(v) spin_is_locked(__vpic_lock(v))
-#define vpic_elcr_mask(v) ((v)->is_master ? 0xf8 : 0xde)
+#define vpic_elcr_mask(v, mb2) ((v)->is_master ? 0xf8 | ((mb2) << 2) : 0xde)
 
 /* Return the highest priority found in mask. Return 8 if none. */
 #define VPIC_PRIO_NONE 8
@@ -387,7 +387,7 @@ static int cf_check vpic_intercept_elcr_io(
         if ( dir == IOREQ_WRITE )
         {
             /* Some IRs are always edge trig. Slave IR is always level trig. */
-            data = (*val >> shift) & vpic_elcr_mask(vpic);
+            data = (*val >> shift) & vpic_elcr_mask(vpic, 1);
             if ( vpic->is_master )
                 data |= 1 << 2;
             vpic->elcr = data;
@@ -395,7 +395,7 @@ static int cf_check vpic_intercept_elcr_io(
         else
         {
             /* Reader should not see hardcoded level-triggered slave IR. */
-            data = vpic->elcr & vpic_elcr_mask(vpic);
+            data = vpic->elcr & vpic_elcr_mask(vpic, 0);
             if ( !shift )
                 *val = data;
             else
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 21:34:24 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 21:34:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650191.1015484 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBM0m-0003n1-D8; Thu, 07 Dec 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 650191.1015484; Thu, 07 Dec 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 1rBM0m-0003mt-Ab; Thu, 07 Dec 2023 21:34:24 +0000
Received: by outflank-mailman (input) for mailman id 650191;
 Thu, 07 Dec 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 1rBM0l-0003mf-7p
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBM0l-0004tK-6v
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBM0l-0002NI-63
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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=Xep9jG5fUjCzH5vf63AcugrbJzWGW+Uy58ZT/dBQyfA=; b=BgVubJXNQCl+8ggYc9mSxZMnTQ
	ErGNCYj5o6zn4QE9Llm3j95o90GUBWRc6LQB0Ex6uUDWhe30dfJGgW3y7kdqy4M0COszqSKVm5JUp
	GZ/ohSURk8EK3W5Rjoi7vcSg2PFgwms56dD6AfSdcjn/SOO9ga1h3zPSgyvXpjJeqWgg=;
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: <E1rBM0l-0002NI-63@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 21:34:23 +0000

commit fa9171ed0511cc8d61e077e064c32d3a3fd743f6
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Dec 6 10:23:20 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:23:20 2023 +0100

    config: update Mini-OS commit
    
    Update the Mini-OS upstream revision.
    
    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 594c70d8bb..c184add653 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 ?= b08019f0b2fbc30c75169a160acb9fd9af5d68f4
+MINIOS_UPSTREAM_REVISION ?= 33411a11f848853b6c81a38426faaab303477a31
 
 SEABIOS_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/seabios.git
 SEABIOS_UPSTREAM_REVISION ?= rel-1.16.3
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 21:34:34 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 21:34:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650192.1015489 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBM0w-0003pd-EY; Thu, 07 Dec 2023 21:34:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650192.1015489; Thu, 07 Dec 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 1rBM0w-0003pV-C1; Thu, 07 Dec 2023 21:34:34 +0000
Received: by outflank-mailman (input) for mailman id 650192;
 Thu, 07 Dec 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 1rBM0v-0003pM-An
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBM0v-0004th-A1
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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 1rBM0v-0002O9-92
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 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=Jnb5fbLq0dk2BXpAIr1msDSB1uCYptdctnROJKCvYF0=; b=lHHUluFCXFrF5PlPXhKdRaufLe
	IGUa5s4epqoEo9eiUUHPMHXvKGZ0IxwxIJZdJBBmnRx9xJndlIzEsQGLISyNP2nq2Vpupo//tFa1W
	u5WIIGnUVGH2pyVk67uRMHxyFs9f1LMC/b37XCnqr9AlX3uDRG9Cd4EhydZBNCgukBoY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/page: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1rBM0v-0002O9-92@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 21:34:33 +0000

commit 8b0dc4a88ff6084d164f50f7e7b98877abdd8b5c
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Dec 6 10:23:35 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:23:35 2023 +0100

    x86/page: 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/arch/x86/include/asm/page.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/page.h b/xen/arch/x86/include/asm/page.h
index 93a7b368ac..350d1fb110 100644
--- a/xen/arch/x86/include/asm/page.h
+++ b/xen/arch/x86/include/asm/page.h
@@ -232,8 +232,8 @@ typedef struct { u64 pfn; } pagetable_t;
 #define pagetable_from_paddr(p) pagetable_from_pfn((p)>>PAGE_SHIFT)
 #define pagetable_null()        pagetable_from_pfn(0)
 
-void clear_page_sse2(void *);
-void copy_page_sse2(void *, const void *);
+void clear_page_sse2(void *pg);
+void copy_page_sse2(void *to, const void *from);
 
 #define clear_page(_p)      clear_page_sse2(_p)
 #define copy_page(_t, _f)   copy_page_sse2(_t, _f)
@@ -303,7 +303,7 @@ extern l3_pgentry_t l3_bootmap[L3_PAGETABLE_ENTRIES];
 extern l2_pgentry_t l2_directmap[4*L2_PAGETABLE_ENTRIES];
 extern l1_pgentry_t l1_fixmap[L1_PAGETABLE_ENTRIES];
 void paging_init(void);
-void efi_update_l4_pgtable(unsigned int l4idx, l4_pgentry_t);
+void efi_update_l4_pgtable(unsigned int l4idx, l4_pgentry_t l4e);
 #endif /* !defined(__ASSEMBLY__) */
 
 #define _PAGE_NONE     _AC(0x000,U)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 21:34:44 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 21:34:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650193.1015493 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBM16-0003sW-Gd; Thu, 07 Dec 2023 21:34:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650193.1015493; Thu, 07 Dec 2023 21:34:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBM16-0003sP-DR; Thu, 07 Dec 2023 21:34:44 +0000
Received: by outflank-mailman (input) for mailman id 650193;
 Thu, 07 Dec 2023 21: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 1rBM15-0003s8-Dc
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 21: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 1rBM15-0004tp-Cs
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 21:34:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rBM15-0002Os-C8
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 21:34:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HGLUfZoFPXjXh6Sd66TIJyPnFpyONXJMtn5MdEr5qhk=; b=RCKtbhrQhedynEhOCqDx0seJ22
	upkKKvsBUf8moV8VIVW179UoukD5unjGMYXFbL1eatyFDsnBz6DJHtJ1PxU2Cppv14TkvVm7bqPyx
	1Tcs6bhYiHTpPi7jO9Fwoy/afP8g8HRfc4fGyzWLFWhsxSNu+vEYpnKpzQdrMSS9rLIE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mce: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1rBM15-0002Os-C8@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 21:34:43 +0000

commit 24b267269599d3c6043ea1af529e64a241fd00f0
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Dec 6 10:24:14 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:24:14 2023 +0100

    x86/mce: 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/arch/x86/cpu/mcheck/mce.h  | 2 +-
 xen/arch/x86/include/asm/mce.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.h b/xen/arch/x86/cpu/mcheck/mce.h
index b6fc9c3617..34285296b4 100644
--- a/xen/arch/x86/cpu/mcheck/mce.h
+++ b/xen/arch/x86/cpu/mcheck/mce.h
@@ -158,7 +158,7 @@ extern void mce_need_clearbank_register(mce_need_clearbank_t cbfunc);
  * MCi_STATUS value for that bank.
  */
 typedef struct mcinfo_extended *(*x86_mce_callback_t)
-    (struct mc_info *, uint16_t, uint64_t);
+    (struct mc_info *mi, uint16_t bank, uint64_t status);
 extern void x86_mce_callback_register(x86_mce_callback_t cbfunc);
 
 void *x86_mcinfo_reserve(struct mc_info *mi,
diff --git a/xen/arch/x86/include/asm/mce.h b/xen/arch/x86/include/asm/mce.h
index 2c63318c08..6ce56b5b85 100644
--- a/xen/arch/x86/include/asm/mce.h
+++ b/xen/arch/x86/include/asm/mce.h
@@ -37,8 +37,8 @@ struct domain;
 struct vcpu;
 
 /* Guest vMCE MSRs virtualization */
-extern void vmce_init_vcpu(struct vcpu *);
-extern int vmce_restore_vcpu(struct vcpu *, const struct hvm_vmce_vcpu *);
+extern void vmce_init_vcpu(struct vcpu *v);
+extern int vmce_restore_vcpu(struct vcpu *v, const struct hvm_vmce_vcpu *ctxt);
 extern int vmce_wrmsr(uint32_t msr, uint64_t val);
 extern int vmce_rdmsr(uint32_t msr, uint64_t *val);
 extern bool vmce_has_lmce(const struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 21:34:54 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 21:34:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650194.1015499 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBM1G-0003v9-JT; Thu, 07 Dec 2023 21:34:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650194.1015499; Thu, 07 Dec 2023 21: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 1rBM1G-0003ux-F9; Thu, 07 Dec 2023 21:34:54 +0000
Received: by outflank-mailman (input) for mailman id 650194;
 Thu, 07 Dec 2023 21: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 1rBM1F-0003um-HI
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 21: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 1rBM1F-0004ty-GW
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 21:34:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rBM1F-0002Pf-Ew
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 21: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=6vEOGnlykv0/+30TQ667wrSfNOPp3R6AUPUrlwFueJQ=; b=BsKlqoZI6atxqS5TID8ifEHAnL
	6OT5Vf0Uv3wRpp2kuIaOVub3Wao4mjhB9a9R1zzI7Aa+kAa/Z7DnCmWXMZpdKhBqPDXHvMkrq8pis
	ynbideQWBVOEFYLORJJcN/uyKQ7tyZaL90cg37ESqtipgQuYXaoumpi1yxh2PziWyS20=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/pci: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1rBM1F-0002Pf-Ew@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 21:34:53 +0000

commit e4c0489ec5ddf7727a42d1a2c98a1528baf934b0
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Dec 6 10:24:47 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:24:47 2023 +0100

    xen/pci: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names to address violations of MISRA C:2012
    Rule 8.2. Furthermore, use C standard types to comply with XEN coding style.
    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/drivers/passthrough/pci.c | 8 ++++----
 xen/include/xen/pci.h         | 3 ++-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 04d00c7c37..28ed8ea817 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -104,9 +104,9 @@ static struct pci_seg *alloc_pseg(u16 seg)
 }
 
 static int pci_segments_iterate(
-    int (*handler)(struct pci_seg *, void *), void *arg)
+    int (*handler)(struct pci_seg *pseg, void *arg), void *arg)
 {
-    u16 seg = 0;
+    uint16_t seg = 0;
     int rc = 0;
 
     do {
@@ -1077,7 +1077,7 @@ int __init scan_pci_devices(void)
 
 struct setup_hwdom {
     struct domain *d;
-    int (*handler)(u8 devfn, struct pci_dev *);
+    int (*handler)(uint8_t devfn, struct pci_dev *pdev);
 };
 
 static void __hwdom_init setup_one_hwdom_device(const struct setup_hwdom *ctxt,
@@ -1157,7 +1157,7 @@ static int __hwdom_init cf_check _setup_hwdom_pci_devices(
 }
 
 void __hwdom_init setup_hwdom_pci_devices(
-    struct domain *d, int (*handler)(u8 devfn, struct pci_dev *))
+    struct domain *d, int (*handler)(uint8_t devfn, struct pci_dev *pdev))
 {
     struct setup_hwdom ctxt = { .d = d, .handler = handler };
 
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 2a0a01bf92..54a974abc6 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -178,7 +178,8 @@ enum pdev_type pdev_type(u16 seg, u8 bus, u8 devfn);
 int find_upstream_bridge(u16 seg, u8 *bus, u8 *devfn, u8 *secbus);
 
 void setup_hwdom_pci_devices(struct domain *d,
-                            int (*handler)(u8 devfn, struct pci_dev *pdev));
+                             int (*handler)(uint8_t devfn,
+                                            struct pci_dev *pdev));
 int pci_release_devices(struct domain *d);
 void pci_segments_init(void);
 int pci_add_segment(u16 seg);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 21:35:04 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 21:35:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650195.1015501 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBM1Q-0003xo-Ji; Thu, 07 Dec 2023 21:35:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650195.1015501; Thu, 07 Dec 2023 21: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 1rBM1Q-0003xg-Gq; Thu, 07 Dec 2023 21:35:04 +0000
Received: by outflank-mailman (input) for mailman id 650195;
 Thu, 07 Dec 2023 21: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 1rBM1P-0003xO-Kk
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 21: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 1rBM1P-0004uJ-Jn
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 21:35:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rBM1P-0002Qh-Iu
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 21: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=2KAW1GzufAcEZ2ConvwDXJJD9GEpmBjnDqhNpTpSuDQ=; b=F+pHojPr3rlf+D6eKnhAXmXeC3
	Tc3koMb2F26mSJDy3P/TFQ6I37gLXbrjcFvUZjt6gnh8BqZS/yRJM+bUcTanGXoQsSRyVdDIM79LS
	Y6kXLFeFU8PBFghJx/JbLUu5C9v4FrFA9ZjKTfWEF3YJ4Map2Do7vd5oVuqSRhy9Z79U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/DMI: adjustments to comply with Misra C:2012 Rule 9.3
Message-Id: <E1rBM1P-0002Qh-Iu@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 21:35:03 +0000

commit 59df2851318357763be3ad8a5f300d6a9e7c6e38
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Dec 6 10:25:21 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 6 10:25:21 2023 +0100

    x86/DMI: adjustments to comply with Misra C:2012 Rule 9.3
    
    The rule demands that all array elements be initialized (or dedicated
    initializers be used). Introduce a small set of macros to allow doing so
    without unduly affecting use sites (in particular in terms of how many
    elements .matches[] actually has; right now there's no use of
    DMI_MATCH4(), so we could even consider reducing the array size to 3).
    
    Note that DMI_MATCH() needs adjustment because of the comma included in
    its expansion, which - due to being unparenthesized - would otherwise
    cause macro arguments in the "further replacement" step to be wrong.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/x86/genapic/bigsmp.c       |  11 ++-
 xen/arch/x86/hvm/quirks.c           |  25 ++---
 xen/arch/x86/ioport_emulate.c       |  40 +++-----
 xen/arch/x86/shutdown.c             | 190 +++++++++++++++---------------------
 xen/arch/x86/x86_64/mmconf-fam10h.c |   5 +-
 xen/include/xen/dmi.h               |   7 +-
 6 files changed, 117 insertions(+), 161 deletions(-)

diff --git a/xen/arch/x86/genapic/bigsmp.c b/xen/arch/x86/genapic/bigsmp.c
index 2000383ab0..9ed46cea91 100644
--- a/xen/arch/x86/genapic/bigsmp.c
+++ b/xen/arch/x86/genapic/bigsmp.c
@@ -19,11 +19,14 @@ static int __init cf_check force_bigsmp(const struct dmi_system_id *d)
 
 
 static const struct dmi_system_id __initconstrel bigsmp_dmi_table[] = {
-	{ force_bigsmp, "UNISYS ES7000-ONE", {
-		DMI_MATCH(DMI_PRODUCT_NAME, "ES7000-ONE")
-	 }},
+	{
+	    .ident = "UNISYS ES7000-ONE",
+	    .callback = force_bigsmp,
+	    DMI_MATCH1(
+		DMI_MATCH(DMI_PRODUCT_NAME, "ES7000-ONE")),
+	},
 	
-	 { }
+	{ }
 };
 
 
diff --git a/xen/arch/x86/hvm/quirks.c b/xen/arch/x86/hvm/quirks.c
index bd30b0f881..09face0c51 100644
--- a/xen/arch/x86/hvm/quirks.c
+++ b/xen/arch/x86/hvm/quirks.c
@@ -36,42 +36,37 @@ static int __init cf_check check_port80(void)
         {
             .callback = dmi_hvm_deny_port80,
             .ident    = "Compaq Presario V6000",
-            .matches  = {
+	    DMI_MATCH2(
                 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
-                DMI_MATCH(DMI_BOARD_NAME,   "30B7")
-            }
+                DMI_MATCH(DMI_BOARD_NAME,   "30B7")),
         },
         {
             .callback = dmi_hvm_deny_port80,
             .ident    = "HP Pavilion dv9000z",
-            .matches  = {
+	    DMI_MATCH2(
                 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
-                DMI_MATCH(DMI_BOARD_NAME,   "30B9")
-            }
+                DMI_MATCH(DMI_BOARD_NAME,   "30B9")),
         },
         {
             .callback = dmi_hvm_deny_port80,
             .ident    = "HP Pavilion dv6000",
-            .matches  = {
+	    DMI_MATCH2(
                 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
-                DMI_MATCH(DMI_BOARD_NAME,   "30B8")
-            }
+                DMI_MATCH(DMI_BOARD_NAME,   "30B8")),
         },
         {
             .callback = dmi_hvm_deny_port80,
             .ident    = "HP Pavilion tx1000",
-            .matches  = {
+	    DMI_MATCH2(
                 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
-                DMI_MATCH(DMI_BOARD_NAME,   "30BF")
-            }
+                DMI_MATCH(DMI_BOARD_NAME,   "30BF")),
         },
         {
             .callback = dmi_hvm_deny_port80,
             .ident    = "Presario F700",
-            .matches  = {
+	    DMI_MATCH2(
                 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
-                DMI_MATCH(DMI_BOARD_NAME,   "30D3")
-            }
+                DMI_MATCH(DMI_BOARD_NAME,   "30D3")),
         },
         { }
     };
diff --git a/xen/arch/x86/ioport_emulate.c b/xen/arch/x86/ioport_emulate.c
index 6caeb3d470..57fbe9d09a 100644
--- a/xen/arch/x86/ioport_emulate.c
+++ b/xen/arch/x86/ioport_emulate.c
@@ -43,59 +43,51 @@ static const struct dmi_system_id __initconstrel ioport_quirks_tbl[] = {
      */
     {
         .ident = "HP ProLiant DL3xx",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL3"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL3")),
     },
     {
         .ident = "HP ProLiant DL5xx",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL5"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL5")),
     },
     {
         .ident = "HP ProLiant DL7xx",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL7"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL7")),
     },
     {
         .ident = "HP ProLiant ML3xx",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant ML3"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant ML3")),
     },
     {
         .ident = "HP ProLiant ML5xx",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant ML5"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant ML5")),
     },
     {
         .ident = "HP ProLiant BL2xx",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL2"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL2")),
     },
     {
         .ident = "HP ProLiant BL4xx",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL4"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL4")),
     },
     {
         .ident = "HP ProLiant BL6xx",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL6"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL6")),
     },
     { }
 };
diff --git a/xen/arch/x86/shutdown.c b/xen/arch/x86/shutdown.c
index 7619544d14..acceec2a38 100644
--- a/xen/arch/x86/shutdown.c
+++ b/xen/arch/x86/shutdown.c
@@ -187,348 +187,310 @@ static const struct dmi_system_id __initconstrel reboot_dmi_table[] = {
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell E520",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM061"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM061")),
     },
     {    /* Handle problems with rebooting on Dell 1300's */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell PowerEdge 1300",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/")),
     },
     {    /* Handle problems with rebooting on Dell 300's */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell PowerEdge 300",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/")),
     },
     {    /* Handle problems with rebooting on Dell Optiplex 745's SFF */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell OptiPlex 745",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745")),
     },
     {    /* Handle problems with rebooting on Dell Optiplex 745's DFF */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell OptiPlex 745",
-        .matches = {
+        DMI_MATCH3(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
             DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
-            DMI_MATCH(DMI_BOARD_NAME, "0MM599"),
-        },
+            DMI_MATCH(DMI_BOARD_NAME, "0MM599")),
     },
     {    /* Handle problems with rebooting on Dell Optiplex 745 with 0KW626 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell OptiPlex 745",
-        .matches = {
+        DMI_MATCH3(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
             DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
-            DMI_MATCH(DMI_BOARD_NAME, "0KW626"),
-        },
+            DMI_MATCH(DMI_BOARD_NAME, "0KW626")),
     },
     {    /* Handle problems with rebooting on Dell Optiplex 330 with 0KP561 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell OptiPlex 330",
-        .matches = {
+        DMI_MATCH3(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
             DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 330"),
-            DMI_MATCH(DMI_BOARD_NAME, "0KP561"),
-        },
+            DMI_MATCH(DMI_BOARD_NAME, "0KP561")),
     },
     {    /* Handle problems with rebooting on Dell Optiplex 360 with 0T656F */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell OptiPlex 360",
-        .matches = {
+        DMI_MATCH3(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
             DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 360"),
-            DMI_MATCH(DMI_BOARD_NAME, "0T656F"),
-        },
+            DMI_MATCH(DMI_BOARD_NAME, "0T656F")),
     },
     {    /* Handle problems with rebooting on Dell OptiPlex 760 with 0G919G */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell OptiPlex 760",
-        .matches = {
+        DMI_MATCH3(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
             DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 760"),
-            DMI_MATCH(DMI_BOARD_NAME, "0G919G"),
-        },
+            DMI_MATCH(DMI_BOARD_NAME, "0G919G")),
     },
     {    /* Handle problems with rebooting on Dell 2400's */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell PowerEdge 2400",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400")),
     },
     {    /* Handle problems with rebooting on Dell T5400's */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell Precision T5400",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T5400"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T5400")),
     },
     {    /* Handle problems with rebooting on Dell T7400's */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell Precision T7400",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T7400"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T7400")),
     },
     {    /* Handle problems with rebooting on HP laptops */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "HP Compaq Laptop",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq")),
     },
     {    /* Handle problems with rebooting on Dell XPS710 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell XPS710",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Dell XPS710"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Dell XPS710")),
     },
     {    /* Handle problems with rebooting on Dell DXP061 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell DXP061",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DXP061"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DXP061")),
     },
     {    /* Handle problems with rebooting on Sony VGN-Z540N */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Sony VGN-Z540N",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N")),
     },
     {    /* Handle problems with rebooting on ASUS P4S800 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "ASUS P4S800",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-            DMI_MATCH(DMI_BOARD_NAME, "P4S800"),
-        },
+            DMI_MATCH(DMI_BOARD_NAME, "P4S800")),
     },
     {    /* Handle reboot issue on Acer Aspire one */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Acer Aspire One A110",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "AOA110")),
     },
     {    /* Handle problems with rebooting on Apple MacBook5 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Apple MacBook5",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5")),
     },
     {    /* Handle problems with rebooting on Apple MacBookPro5 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Apple MacBookPro5",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5")),
     },
     {    /* Handle problems with rebooting on Apple Macmini3,1 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Apple Macmini3,1",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Macmini3,1"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Macmini3,1")),
     },
     {    /* Handle problems with rebooting on the iMac9,1. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Apple iMac9,1",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1")),
     },
     {    /* Handle problems with rebooting on the Latitude E6320. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6320",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320")),
     },
     {    /* Handle problems with rebooting on the Latitude E5420. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E5420",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E5420"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E5420")),
     },
     {       /* Handle problems with rebooting on the Latitude E6220. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6220",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6220"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6220")),
     },
     {    /* Handle problems with rebooting on the Latitude E6420. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6420",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420")),
     },
     {    /* Handle problems with rebooting on the OptiPlex 990. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell OptiPlex 990",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990")),
     },
     {    /* Handle problems with rebooting on the Precision M6600. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell OptiPlex 990",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Precision M6600"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Precision M6600")),
     },
     {    /* Handle problems with rebooting on the Latitude E6520. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6520",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520")),
     },
     {       /* Handle problems with rebooting on the OptiPlex 790. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell OptiPlex 790",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 790"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 790")),
     },
     {    /* Handle problems with rebooting on the OptiPlex 990. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell OptiPlex 990",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990")),
     },
     {    /* Handle problems with rebooting on the OptiPlex 390. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell OptiPlex 390",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 390"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 390")),
     },
     {    /* Handle problems with rebooting on Dell OptiPlex 9020. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_ACPI,
         .ident = "Dell OptiPlex 9020",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 9020"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 9020")),
     },
     {    /* Handle problems with rebooting on the Latitude E6320. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6320",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320")),
     },
     {    /* Handle problems with rebooting on the Latitude E6420. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6420",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420")),
     },
     {    /* Handle problems with rebooting on the Latitude E6520. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6520",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520")),
     },
     {    /* Handle problems with rebooting on Dell PowerEdge R540. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_ACPI,
         .ident = "Dell PowerEdge R540",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R540"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R540")),
     },
     {    /* Handle problems with rebooting on Dell PowerEdge R740. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_ACPI,
         .ident = "Dell PowerEdge R740",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R740"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R740")),
     },
     { }
 };
diff --git a/xen/arch/x86/x86_64/mmconf-fam10h.c b/xen/arch/x86/x86_64/mmconf-fam10h.c
index 270dd97b6a..fd745baa56 100644
--- a/xen/arch/x86/x86_64/mmconf-fam10h.c
+++ b/xen/arch/x86/x86_64/mmconf-fam10h.c
@@ -188,9 +188,8 @@ void fam10h_check_enable_mmcfg(void)
 static const struct dmi_system_id __initconstrel mmconf_dmi_table[] = {
 	{
 		.ident = "Sun Microsystems Machine",
-		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Sun Microsystems"),
-		},
+		DMI_MATCH1(
+			DMI_MATCH(DMI_SYS_VENDOR, "Sun Microsystems")),
 	},
 	{}
 };
diff --git a/xen/include/xen/dmi.h b/xen/include/xen/dmi.h
index 0fef41842e..552b258cf6 100644
--- a/xen/include/xen/dmi.h
+++ b/xen/include/xen/dmi.h
@@ -30,7 +30,12 @@ struct dmi_system_id {
 	void *driver_data;
 };
 
-#define DMI_MATCH(a,b)	{ a, b }
+#define DMI_MATCH(a,b)	((struct dmi_strmatch){ a, b })
+
+#define DMI_MATCH4(m1, m2, m3, m4) .matches = { m1, m2, m3, m4 }
+#define DMI_MATCH3(m1, m2, m3) DMI_MATCH4(m1, m2, m3, DMI_MATCH(0, NULL))
+#define DMI_MATCH2(m1, m2)     DMI_MATCH3(m1, m2, DMI_MATCH(0, NULL))
+#define DMI_MATCH1(m1)         DMI_MATCH2(m1, DMI_MATCH(0, NULL))
 
 extern int dmi_check_system(const struct dmi_system_id *list);
 extern void dmi_scan_machine(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 07 21:35:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 21:35:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650196.1015505 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBM1a-00041F-Ma; Thu, 07 Dec 2023 21:35:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650196.1015505; Thu, 07 Dec 2023 21: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 1rBM1a-000417-Jx; Thu, 07 Dec 2023 21:35:14 +0000
Received: by outflank-mailman (input) for mailman id 650196;
 Thu, 07 Dec 2023 21: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 1rBM1Z-00040y-Nr
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 21: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 1rBM1Z-0004uT-N8
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 21:35:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rBM1Z-0002RW-MG
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 21: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=C7jiRSdHJxPSyznN7bRCirlF9gSCE/NujJZP7+kuAOs=; b=wULaU2hkbQ0dC6Dghwvj1ikRE0
	cc05esPUFJY0n92LdShFPzLwFxqV2VkIdPNwwxJoMEwwExiCzgDrtJC++x1QnAQhFfJ6Pk9e9DCTO
	uW7wTViW26gvgZ0Gzpmd1d7FEagVtdVP7ifAGmQ/H48OLPODbZXeHQf9JS1+Dqv2xa40=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Only compile the hypervisor with -Wdeclaration-after-statement
Message-Id: <E1rBM1Z-0002RW-MG@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 21:35:13 +0000

commit 40be6307ec005539635e7b8fcef67e989dc441f6
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Tue Dec 5 18:32:26 2023 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Dec 6 19:12:40 2023 +0000

    Only compile the hypervisor with -Wdeclaration-after-statement
    
    Right now, all tools and hypervisor will be complied with the option
    -Wdeclaration-after-statement. While most of the code in the hypervisor
    is controlled by us, for tools we may import external libraries.
    
    The build will fail if one of them are using the construct we are
    trying to prevent. This is the case when building against Python 3.12
    and Yocto:
    
    | In file included from /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/Python.h:44,
    |                  from xen/lowlevel/xc/xc.c:8:
    | /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/object.h: In function 'Py_SIZE':
    | /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/object.h:233:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
    |   233 |     PyVarObject *var_ob = _PyVarObject_CAST(ob);
    |       |     ^~~~~~~~~~~
    | In file included from /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/Python.h:53:
    | /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/cpython/longintrepr.h: In function '_PyLong_CompactValue':
    | /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/cpython/longintrepr.h:121:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
    |   121 |     Py_ssize_t sign = 1 - (op->long_value.lv_tag & _PyLong_SIGN_MASK);
    |       |     ^~~~~~~~~~
    | cc1: all warnings being treated as errors
    
    Looking at the tools directory, a fair few directory already add
    -Wno-declaration-after-statement to inhibit the default behavior.
    
    We have always build the hypervisor with the flag, so for now remove
    only the flag for anything but the hypervisor. We can decide at later
    time whether we want to relax.
    
    Also remove the -Wno-declaration-after-statement in some subdirectory
    as the flag is now unnecessary.
    
    Part of the commit message was take from Alexander's first proposal:
    
    Link: https://lore.kernel.org/xen-devel/20231128174729.3880113-1-alex@linutronix.de/
    Reported-by: Alexander Kanavin <alex@linutronix.de>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
---
 Config.mk                   | 2 --
 stubdom/Makefile            | 2 +-
 stubdom/vtpmmgr/Makefile    | 2 +-
 tools/libs/light/Makefile   | 3 +--
 tools/libs/util/Makefile    | 3 +--
 tools/tests/depriv/Makefile | 2 --
 tools/xl/Makefile           | 3 +--
 xen/Makefile                | 1 +
 8 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/Config.mk b/Config.mk
index c184add653..98ca1e2847 100644
--- a/Config.mk
+++ b/Config.mk
@@ -177,8 +177,6 @@ CFLAGS += -std=gnu99
 
 CFLAGS += -Wall -Wstrict-prototypes
 
-$(call cc-option-add,HOSTCFLAGS,HOSTCC,-Wdeclaration-after-statement)
-$(call cc-option-add,CFLAGS,CC,-Wdeclaration-after-statement)
 $(call cc-option-add,CFLAGS,CC,-Wno-unused-but-set-variable)
 $(call cc-option-add,CFLAGS,CC,-Wno-unused-local-typedefs)
 
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 71c9b2200e..8c503c2bf8 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -245,7 +245,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	patch -d $@ -p1 < vtpm-command-duration.patch
 	patch -d $@ -p1 < vtpm-tpm_bn_t-addr.patch
 	mkdir $@/build
-	cd $@/build; CC=${CC} $(CMAKE) .. -DCMAKE_C_FLAGS:STRING="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
+	cd $@/build; CC=${CC} $(CMAKE) .. -DCMAKE_C_FLAGS:STRING="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS)"
 	touch $@
 
 TPMEMU_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm.a
diff --git a/stubdom/vtpmmgr/Makefile b/stubdom/vtpmmgr/Makefile
index 6dae034a07..c29bb49838 100644
--- a/stubdom/vtpmmgr/Makefile
+++ b/stubdom/vtpmmgr/Makefile
@@ -17,7 +17,7 @@ OBJS += vtpm_disk.o disk_tpm.o disk_io.o disk_crypto.o disk_read.o disk_write.o
 OBJS += mgmt_authority.o
 
 CFLAGS+=-Werror -Iutil -Icrypto -Itcs
-CFLAGS+=-Wno-declaration-after-statement -Wno-unused-label
+CFLAGS+=-Wno-unused-label
 
 build: $(TARGET)
 $(TARGET): $(OBJS)
diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index ba4c1b7933..37e4d16709 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -38,8 +38,7 @@ vpath static_tables.c $(ACPI_PATH)/
 
 OBJS-$(CONFIG_X86) += $(ACPI_OBJS)
 
-CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
-	-Wno-declaration-after-statement -Wformat-nonliteral
+CFLAGS += -Wno-format-zero-length -Wmissing-declarations -Wformat-nonliteral
 
 CFLAGS-$(CONFIG_X86) += -DCONFIG_PCI_SUPP_LEGACY_IRQ
 
diff --git a/tools/libs/util/Makefile b/tools/libs/util/Makefile
index c3b21875dc..936ec90a31 100644
--- a/tools/libs/util/Makefile
+++ b/tools/libs/util/Makefile
@@ -9,8 +9,7 @@ OBJS-y += libxlu_disk.o
 OBJS-y += libxlu_vif.o
 OBJS-y += libxlu_pci.o
 
-CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
-	-Wno-declaration-after-statement -Wformat-nonliteral
+CFLAGS += -Wno-format-zero-length -Wmissing-declarations -Wformat-nonliteral
 CFLAGS += $(CFLAGS_libxenctrl)
 
 CFLAGS += $(PTHREAD_CFLAGS)
diff --git a/tools/tests/depriv/Makefile b/tools/tests/depriv/Makefile
index 7d9e3b01bb..5404a12f47 100644
--- a/tools/tests/depriv/Makefile
+++ b/tools/tests/depriv/Makefile
@@ -1,8 +1,6 @@
 XEN_ROOT=$(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += -Wno-declaration-after-statement
-
 CFLAGS += $(CFLAGS_xeninclude)
 CFLAGS += $(CFLAGS_libxenctrl)
 CFLAGS += $(CFLAGS_libxencall)
diff --git a/tools/xl/Makefile b/tools/xl/Makefile
index 5f7aa5f46c..d742e96a5b 100644
--- a/tools/xl/Makefile
+++ b/tools/xl/Makefile
@@ -5,8 +5,7 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
-	-Wno-declaration-after-statement -Wformat-nonliteral
+CFLAGS += -Wno-format-zero-length -Wmissing-declarations -Wformat-nonliteral
 CFLAGS += -fPIC
 
 CFLAGS += $(PTHREAD_CFLAGS)
diff --git a/xen/Makefile b/xen/Makefile
index ca571103c8..360fb6dcae 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -393,6 +393,7 @@ CFLAGS-$(CONFIG_CC_SPLIT_SECTIONS) += -ffunction-sections -fdata-sections
 
 CFLAGS += -nostdinc -fno-builtin -fno-common
 CFLAGS += -Werror -Wredundant-decls -Wwrite-strings -Wno-pointer-arith
+$(call cc-option-add,CFLAGS,CC,-Wdeclaration-after-statement)
 $(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 Thu Dec 07 21:35:24 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 Dec 2023 21:35:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650197.1015509 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBM1k-00043r-Ny; Thu, 07 Dec 2023 21:35:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650197.1015509; Thu, 07 Dec 2023 21: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 1rBM1k-00043j-LP; Thu, 07 Dec 2023 21:35:24 +0000
Received: by outflank-mailman (input) for mailman id 650197;
 Thu, 07 Dec 2023 21: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 1rBM1j-00043c-Qv
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 21: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 1rBM1j-0004ua-Q9
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 21:35:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rBM1j-0002SM-PS
 for xen-changelog@lists.xenproject.org; Thu, 07 Dec 2023 21: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=QDSq2jwpRtCi8XafkAcSiIm1H1N4U1Hj5KccEu4EOt4=; b=NBfWCwqZghfQlIeifVtIFFnV/B
	+pXKh8dQK934yMvLjatsI5m+n4HQlQear/dIaZA8MrdRmSNrKVHS/v7t12MygdgimAo5+y4+tXcLb
	pywRs/B9ImfpCw4zPYCTnXXAzk02sLh7pe6updT61Fqq992pGnQb8fkFayjqaTFneGqI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/hypervisor: Don't use cc-option-add for -Wdeclaration-after-statement
Message-Id: <E1rBM1j-0002SM-PS@xenbits.xenproject.org>
Date: Thu, 07 Dec 2023 21:35:23 +0000

commit d4bfd3899886d0fbe259c20660dadb1e00170f2d
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Wed Dec 6 19:19:58 2023 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Dec 6 19:19:59 2023 +0000

    xen/hypervisor: Don't use cc-option-add for -Wdeclaration-after-statement
    
    Per Andrew's comment in [1] all the compilers we support should
    recognize the flag.
    
    I forgot to address the comment while committing.
    
    [1] fcf00090-304a-49f7-8a61-a54347e90a3b@citrix.com
    
    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 360fb6dcae..21832d6402 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -393,7 +393,7 @@ CFLAGS-$(CONFIG_CC_SPLIT_SECTIONS) += -ffunction-sections -fdata-sections
 
 CFLAGS += -nostdinc -fno-builtin -fno-common
 CFLAGS += -Werror -Wredundant-decls -Wwrite-strings -Wno-pointer-arith
-$(call cc-option-add,CFLAGS,CC,-Wdeclaration-after-statement)
+CFLAGS += -Wdeclaration-after-statement
 $(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 Dec 08 10:33:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 08 Dec 2023 10:33:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650555.1016210 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBYAJ-0003hM-Dd; Fri, 08 Dec 2023 10:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650555.1016210; Fri, 08 Dec 2023 10:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBYAJ-0003hF-AS; Fri, 08 Dec 2023 10:33:03 +0000
Received: by outflank-mailman (input) for mailman id 650555;
 Fri, 08 Dec 2023 10:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rBYAH-0003h9-VF
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10: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 1rBYAH-0004Ih-L4
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rBYAH-0004WN-Js
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10: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=DfRwttS9AEUaPBHFRVFA0OQT4gomFfapRca1IL6O0nE=; b=QzmV21dnnJaiU/GUx21mNEHETG
	XvAWt879DLr1WKMVn/ecAykPmwLD6GIJELid6XmQgtqPXFjLIrWKe9yEbTjBXV8uEZoLgJRUr3323
	kW1MbFqD0XIyg2Yuf6cuH++di+wG3q2yPEgM6CWja0OwSFdgkwIILYsCCeJZwlg97zEs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Revert "x86/DMI: adjustments to comply with Misra C:2012 Rule 9.3"
Message-Id: <E1rBYAH-0004WN-Js@xenbits.xenproject.org>
Date: Fri, 08 Dec 2023 10:33:01 +0000

commit add7046baf65850dbf7dcc4107b835589459b991
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 7 08:32:38 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 7 08:32:38 2023 +0100

    Revert "x86/DMI: adjustments to comply with Misra C:2012 Rule 9.3"
    
    This reverts commit 59df2851318357763be3ad8a5f300d6a9e7c6e38.
    I mistakenly committed v1 of the patch, instead of v2.
---
 xen/arch/x86/genapic/bigsmp.c       |  11 +--
 xen/arch/x86/hvm/quirks.c           |  25 +++--
 xen/arch/x86/ioport_emulate.c       |  40 +++++---
 xen/arch/x86/shutdown.c             | 190 +++++++++++++++++++++---------------
 xen/arch/x86/x86_64/mmconf-fam10h.c |   5 +-
 xen/include/xen/dmi.h               |   7 +-
 6 files changed, 161 insertions(+), 117 deletions(-)

diff --git a/xen/arch/x86/genapic/bigsmp.c b/xen/arch/x86/genapic/bigsmp.c
index 9ed46cea91..2000383ab0 100644
--- a/xen/arch/x86/genapic/bigsmp.c
+++ b/xen/arch/x86/genapic/bigsmp.c
@@ -19,14 +19,11 @@ static int __init cf_check force_bigsmp(const struct dmi_system_id *d)
 
 
 static const struct dmi_system_id __initconstrel bigsmp_dmi_table[] = {
-	{
-	    .ident = "UNISYS ES7000-ONE",
-	    .callback = force_bigsmp,
-	    DMI_MATCH1(
-		DMI_MATCH(DMI_PRODUCT_NAME, "ES7000-ONE")),
-	},
+	{ force_bigsmp, "UNISYS ES7000-ONE", {
+		DMI_MATCH(DMI_PRODUCT_NAME, "ES7000-ONE")
+	 }},
 	
-	{ }
+	 { }
 };
 
 
diff --git a/xen/arch/x86/hvm/quirks.c b/xen/arch/x86/hvm/quirks.c
index 09face0c51..bd30b0f881 100644
--- a/xen/arch/x86/hvm/quirks.c
+++ b/xen/arch/x86/hvm/quirks.c
@@ -36,37 +36,42 @@ static int __init cf_check check_port80(void)
         {
             .callback = dmi_hvm_deny_port80,
             .ident    = "Compaq Presario V6000",
-	    DMI_MATCH2(
+            .matches  = {
                 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
-                DMI_MATCH(DMI_BOARD_NAME,   "30B7")),
+                DMI_MATCH(DMI_BOARD_NAME,   "30B7")
+            }
         },
         {
             .callback = dmi_hvm_deny_port80,
             .ident    = "HP Pavilion dv9000z",
-	    DMI_MATCH2(
+            .matches  = {
                 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
-                DMI_MATCH(DMI_BOARD_NAME,   "30B9")),
+                DMI_MATCH(DMI_BOARD_NAME,   "30B9")
+            }
         },
         {
             .callback = dmi_hvm_deny_port80,
             .ident    = "HP Pavilion dv6000",
-	    DMI_MATCH2(
+            .matches  = {
                 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
-                DMI_MATCH(DMI_BOARD_NAME,   "30B8")),
+                DMI_MATCH(DMI_BOARD_NAME,   "30B8")
+            }
         },
         {
             .callback = dmi_hvm_deny_port80,
             .ident    = "HP Pavilion tx1000",
-	    DMI_MATCH2(
+            .matches  = {
                 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
-                DMI_MATCH(DMI_BOARD_NAME,   "30BF")),
+                DMI_MATCH(DMI_BOARD_NAME,   "30BF")
+            }
         },
         {
             .callback = dmi_hvm_deny_port80,
             .ident    = "Presario F700",
-	    DMI_MATCH2(
+            .matches  = {
                 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
-                DMI_MATCH(DMI_BOARD_NAME,   "30D3")),
+                DMI_MATCH(DMI_BOARD_NAME,   "30D3")
+            }
         },
         { }
     };
diff --git a/xen/arch/x86/ioport_emulate.c b/xen/arch/x86/ioport_emulate.c
index 57fbe9d09a..6caeb3d470 100644
--- a/xen/arch/x86/ioport_emulate.c
+++ b/xen/arch/x86/ioport_emulate.c
@@ -43,51 +43,59 @@ static const struct dmi_system_id __initconstrel ioport_quirks_tbl[] = {
      */
     {
         .ident = "HP ProLiant DL3xx",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL3")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL3"),
+        },
     },
     {
         .ident = "HP ProLiant DL5xx",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL5")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL5"),
+        },
     },
     {
         .ident = "HP ProLiant DL7xx",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL7")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL7"),
+        },
     },
     {
         .ident = "HP ProLiant ML3xx",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant ML3")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant ML3"),
+        },
     },
     {
         .ident = "HP ProLiant ML5xx",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant ML5")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant ML5"),
+        },
     },
     {
         .ident = "HP ProLiant BL2xx",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL2")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL2"),
+        },
     },
     {
         .ident = "HP ProLiant BL4xx",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL4")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL4"),
+        },
     },
     {
         .ident = "HP ProLiant BL6xx",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL6")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL6"),
+        },
     },
     { }
 };
diff --git a/xen/arch/x86/shutdown.c b/xen/arch/x86/shutdown.c
index acceec2a38..7619544d14 100644
--- a/xen/arch/x86/shutdown.c
+++ b/xen/arch/x86/shutdown.c
@@ -187,310 +187,348 @@ static const struct dmi_system_id __initconstrel reboot_dmi_table[] = {
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell E520",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM061")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM061"),
+        },
     },
     {    /* Handle problems with rebooting on Dell 1300's */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell PowerEdge 1300",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/"),
+        },
     },
     {    /* Handle problems with rebooting on Dell 300's */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell PowerEdge 300",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"),
+        },
     },
     {    /* Handle problems with rebooting on Dell Optiplex 745's SFF */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell OptiPlex 745",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
+        },
     },
     {    /* Handle problems with rebooting on Dell Optiplex 745's DFF */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell OptiPlex 745",
-        DMI_MATCH3(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
             DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
-            DMI_MATCH(DMI_BOARD_NAME, "0MM599")),
+            DMI_MATCH(DMI_BOARD_NAME, "0MM599"),
+        },
     },
     {    /* Handle problems with rebooting on Dell Optiplex 745 with 0KW626 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell OptiPlex 745",
-        DMI_MATCH3(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
             DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
-            DMI_MATCH(DMI_BOARD_NAME, "0KW626")),
+            DMI_MATCH(DMI_BOARD_NAME, "0KW626"),
+        },
     },
     {    /* Handle problems with rebooting on Dell Optiplex 330 with 0KP561 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell OptiPlex 330",
-        DMI_MATCH3(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
             DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 330"),
-            DMI_MATCH(DMI_BOARD_NAME, "0KP561")),
+            DMI_MATCH(DMI_BOARD_NAME, "0KP561"),
+        },
     },
     {    /* Handle problems with rebooting on Dell Optiplex 360 with 0T656F */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell OptiPlex 360",
-        DMI_MATCH3(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
             DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 360"),
-            DMI_MATCH(DMI_BOARD_NAME, "0T656F")),
+            DMI_MATCH(DMI_BOARD_NAME, "0T656F"),
+        },
     },
     {    /* Handle problems with rebooting on Dell OptiPlex 760 with 0G919G */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell OptiPlex 760",
-        DMI_MATCH3(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
             DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 760"),
-            DMI_MATCH(DMI_BOARD_NAME, "0G919G")),
+            DMI_MATCH(DMI_BOARD_NAME, "0G919G"),
+        },
     },
     {    /* Handle problems with rebooting on Dell 2400's */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell PowerEdge 2400",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
+        },
     },
     {    /* Handle problems with rebooting on Dell T5400's */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell Precision T5400",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T5400")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T5400"),
+        },
     },
     {    /* Handle problems with rebooting on Dell T7400's */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell Precision T7400",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T7400")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T7400"),
+        },
     },
     {    /* Handle problems with rebooting on HP laptops */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "HP Compaq Laptop",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq"),
+        },
     },
     {    /* Handle problems with rebooting on Dell XPS710 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell XPS710",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Dell XPS710")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Dell XPS710"),
+        },
     },
     {    /* Handle problems with rebooting on Dell DXP061 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell DXP061",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DXP061")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DXP061"),
+        },
     },
     {    /* Handle problems with rebooting on Sony VGN-Z540N */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Sony VGN-Z540N",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N"),
+        },
     },
     {    /* Handle problems with rebooting on ASUS P4S800 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "ASUS P4S800",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-            DMI_MATCH(DMI_BOARD_NAME, "P4S800")),
+            DMI_MATCH(DMI_BOARD_NAME, "P4S800"),
+        },
     },
     {    /* Handle reboot issue on Acer Aspire one */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Acer Aspire One A110",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "AOA110")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"),
+        },
     },
     {    /* Handle problems with rebooting on Apple MacBook5 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Apple MacBook5",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5"),
+        },
     },
     {    /* Handle problems with rebooting on Apple MacBookPro5 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Apple MacBookPro5",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5"),
+        },
     },
     {    /* Handle problems with rebooting on Apple Macmini3,1 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Apple Macmini3,1",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Macmini3,1")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Macmini3,1"),
+        },
     },
     {    /* Handle problems with rebooting on the iMac9,1. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Apple iMac9,1",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1"),
+        },
     },
     {    /* Handle problems with rebooting on the Latitude E6320. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6320",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"),
+        },
     },
     {    /* Handle problems with rebooting on the Latitude E5420. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E5420",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E5420")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E5420"),
+        },
     },
     {       /* Handle problems with rebooting on the Latitude E6220. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6220",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6220")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6220"),
+        },
     },
     {    /* Handle problems with rebooting on the Latitude E6420. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6420",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"),
+        },
     },
     {    /* Handle problems with rebooting on the OptiPlex 990. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell OptiPlex 990",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
+        },
     },
     {    /* Handle problems with rebooting on the Precision M6600. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell OptiPlex 990",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Precision M6600")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Precision M6600"),
+        },
     },
     {    /* Handle problems with rebooting on the Latitude E6520. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6520",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520"),
+        },
     },
     {       /* Handle problems with rebooting on the OptiPlex 790. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell OptiPlex 790",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 790")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 790"),
+        },
     },
     {    /* Handle problems with rebooting on the OptiPlex 990. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell OptiPlex 990",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
+        },
     },
     {    /* Handle problems with rebooting on the OptiPlex 390. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell OptiPlex 390",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 390")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 390"),
+        },
     },
     {    /* Handle problems with rebooting on Dell OptiPlex 9020. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_ACPI,
         .ident = "Dell OptiPlex 9020",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 9020")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 9020"),
+        },
     },
     {    /* Handle problems with rebooting on the Latitude E6320. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6320",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"),
+        },
     },
     {    /* Handle problems with rebooting on the Latitude E6420. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6420",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"),
+        },
     },
     {    /* Handle problems with rebooting on the Latitude E6520. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6520",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520"),
+        },
     },
     {    /* Handle problems with rebooting on Dell PowerEdge R540. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_ACPI,
         .ident = "Dell PowerEdge R540",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R540")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R540"),
+        },
     },
     {    /* Handle problems with rebooting on Dell PowerEdge R740. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_ACPI,
         .ident = "Dell PowerEdge R740",
-        DMI_MATCH2(
+        .matches = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R740")),
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R740"),
+        },
     },
     { }
 };
diff --git a/xen/arch/x86/x86_64/mmconf-fam10h.c b/xen/arch/x86/x86_64/mmconf-fam10h.c
index fd745baa56..270dd97b6a 100644
--- a/xen/arch/x86/x86_64/mmconf-fam10h.c
+++ b/xen/arch/x86/x86_64/mmconf-fam10h.c
@@ -188,8 +188,9 @@ void fam10h_check_enable_mmcfg(void)
 static const struct dmi_system_id __initconstrel mmconf_dmi_table[] = {
 	{
 		.ident = "Sun Microsystems Machine",
-		DMI_MATCH1(
-			DMI_MATCH(DMI_SYS_VENDOR, "Sun Microsystems")),
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Sun Microsystems"),
+		},
 	},
 	{}
 };
diff --git a/xen/include/xen/dmi.h b/xen/include/xen/dmi.h
index 552b258cf6..0fef41842e 100644
--- a/xen/include/xen/dmi.h
+++ b/xen/include/xen/dmi.h
@@ -30,12 +30,7 @@ struct dmi_system_id {
 	void *driver_data;
 };
 
-#define DMI_MATCH(a,b)	((struct dmi_strmatch){ a, b })
-
-#define DMI_MATCH4(m1, m2, m3, m4) .matches = { m1, m2, m3, m4 }
-#define DMI_MATCH3(m1, m2, m3) DMI_MATCH4(m1, m2, m3, DMI_MATCH(0, NULL))
-#define DMI_MATCH2(m1, m2)     DMI_MATCH3(m1, m2, DMI_MATCH(0, NULL))
-#define DMI_MATCH1(m1)         DMI_MATCH2(m1, DMI_MATCH(0, NULL))
+#define DMI_MATCH(a,b)	{ a, b }
 
 extern int dmi_check_system(const struct dmi_system_id *list);
 extern void dmi_scan_machine(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 08 10:33:12 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 08 Dec 2023 10:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650556.1016215 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBYAS-0003jV-Gg; Fri, 08 Dec 2023 10:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650556.1016215; Fri, 08 Dec 2023 10: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 1rBYAS-0003jM-Dr; Fri, 08 Dec 2023 10:33:12 +0000
Received: by outflank-mailman (input) for mailman id 650556;
 Fri, 08 Dec 2023 10: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 1rBYAR-0003jF-Pi
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10: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 1rBYAR-0004J4-Oc
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rBYAR-0004Wm-NH
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10: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=5QPVr2UPV5IZWFuvRzIj6nVJNZ4PdvGI5FXqSsPbRXU=; b=ixESNxEYJUbLIeiN7ssVx/IXRN
	ifTYI6PDssN3vHyVvnvo5OeW29ICuMnmvOIvrAnx4R/WalVa+DDYsJf05rzxzfnvRRNkaeLllFw63
	oVZzP8ToTcVNNU8YUBwjit7rCjAOLRkJKe7cSzwYyQ+c5Fho5Qyr9nJ3laDD17veCynM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/DMI: adjustments to comply with Misra C:2012 Rule 9.3
Message-Id: <E1rBYAR-0004Wm-NH@xenbits.xenproject.org>
Date: Fri, 08 Dec 2023 10:33:11 +0000

commit dbe69e1c8555b40a43cde482615501eb8515ab80
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 7 08:33:55 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 7 08:33:55 2023 +0100

    x86/DMI: adjustments to comply with Misra C:2012 Rule 9.3
    
    The rule demands that all array elements be initialized (or dedicated
    initializers be used). Introduce a small set of macros to allow doing so
    without unduly affecting use sites (in particular in terms of how many
    elements .matches[] actually has; right now there's no use of
    DMI_MATCH4(), so we could even consider reducing the array size to 3).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/x86/genapic/bigsmp.c       |  11 ++-
 xen/arch/x86/hvm/quirks.c           |  25 ++---
 xen/arch/x86/ioport_emulate.c       |  40 +++-----
 xen/arch/x86/shutdown.c             | 190 +++++++++++++++---------------------
 xen/arch/x86/x86_64/mmconf-fam10h.c |   5 +-
 xen/include/xen/dmi.h               |   5 +
 6 files changed, 116 insertions(+), 160 deletions(-)

diff --git a/xen/arch/x86/genapic/bigsmp.c b/xen/arch/x86/genapic/bigsmp.c
index 2000383ab0..9ed46cea91 100644
--- a/xen/arch/x86/genapic/bigsmp.c
+++ b/xen/arch/x86/genapic/bigsmp.c
@@ -19,11 +19,14 @@ static int __init cf_check force_bigsmp(const struct dmi_system_id *d)
 
 
 static const struct dmi_system_id __initconstrel bigsmp_dmi_table[] = {
-	{ force_bigsmp, "UNISYS ES7000-ONE", {
-		DMI_MATCH(DMI_PRODUCT_NAME, "ES7000-ONE")
-	 }},
+	{
+	    .ident = "UNISYS ES7000-ONE",
+	    .callback = force_bigsmp,
+	    DMI_MATCH1(
+		DMI_MATCH(DMI_PRODUCT_NAME, "ES7000-ONE")),
+	},
 	
-	 { }
+	{ }
 };
 
 
diff --git a/xen/arch/x86/hvm/quirks.c b/xen/arch/x86/hvm/quirks.c
index bd30b0f881..09face0c51 100644
--- a/xen/arch/x86/hvm/quirks.c
+++ b/xen/arch/x86/hvm/quirks.c
@@ -36,42 +36,37 @@ static int __init cf_check check_port80(void)
         {
             .callback = dmi_hvm_deny_port80,
             .ident    = "Compaq Presario V6000",
-            .matches  = {
+	    DMI_MATCH2(
                 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
-                DMI_MATCH(DMI_BOARD_NAME,   "30B7")
-            }
+                DMI_MATCH(DMI_BOARD_NAME,   "30B7")),
         },
         {
             .callback = dmi_hvm_deny_port80,
             .ident    = "HP Pavilion dv9000z",
-            .matches  = {
+	    DMI_MATCH2(
                 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
-                DMI_MATCH(DMI_BOARD_NAME,   "30B9")
-            }
+                DMI_MATCH(DMI_BOARD_NAME,   "30B9")),
         },
         {
             .callback = dmi_hvm_deny_port80,
             .ident    = "HP Pavilion dv6000",
-            .matches  = {
+	    DMI_MATCH2(
                 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
-                DMI_MATCH(DMI_BOARD_NAME,   "30B8")
-            }
+                DMI_MATCH(DMI_BOARD_NAME,   "30B8")),
         },
         {
             .callback = dmi_hvm_deny_port80,
             .ident    = "HP Pavilion tx1000",
-            .matches  = {
+	    DMI_MATCH2(
                 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
-                DMI_MATCH(DMI_BOARD_NAME,   "30BF")
-            }
+                DMI_MATCH(DMI_BOARD_NAME,   "30BF")),
         },
         {
             .callback = dmi_hvm_deny_port80,
             .ident    = "Presario F700",
-            .matches  = {
+	    DMI_MATCH2(
                 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
-                DMI_MATCH(DMI_BOARD_NAME,   "30D3")
-            }
+                DMI_MATCH(DMI_BOARD_NAME,   "30D3")),
         },
         { }
     };
diff --git a/xen/arch/x86/ioport_emulate.c b/xen/arch/x86/ioport_emulate.c
index 6caeb3d470..57fbe9d09a 100644
--- a/xen/arch/x86/ioport_emulate.c
+++ b/xen/arch/x86/ioport_emulate.c
@@ -43,59 +43,51 @@ static const struct dmi_system_id __initconstrel ioport_quirks_tbl[] = {
      */
     {
         .ident = "HP ProLiant DL3xx",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL3"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL3")),
     },
     {
         .ident = "HP ProLiant DL5xx",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL5"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL5")),
     },
     {
         .ident = "HP ProLiant DL7xx",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL7"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL7")),
     },
     {
         .ident = "HP ProLiant ML3xx",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant ML3"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant ML3")),
     },
     {
         .ident = "HP ProLiant ML5xx",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant ML5"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant ML5")),
     },
     {
         .ident = "HP ProLiant BL2xx",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL2"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL2")),
     },
     {
         .ident = "HP ProLiant BL4xx",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL4"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL4")),
     },
     {
         .ident = "HP ProLiant BL6xx",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL6"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL6")),
     },
     { }
 };
diff --git a/xen/arch/x86/shutdown.c b/xen/arch/x86/shutdown.c
index 7619544d14..acceec2a38 100644
--- a/xen/arch/x86/shutdown.c
+++ b/xen/arch/x86/shutdown.c
@@ -187,348 +187,310 @@ static const struct dmi_system_id __initconstrel reboot_dmi_table[] = {
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell E520",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM061"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM061")),
     },
     {    /* Handle problems with rebooting on Dell 1300's */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell PowerEdge 1300",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/")),
     },
     {    /* Handle problems with rebooting on Dell 300's */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell PowerEdge 300",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/")),
     },
     {    /* Handle problems with rebooting on Dell Optiplex 745's SFF */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell OptiPlex 745",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745")),
     },
     {    /* Handle problems with rebooting on Dell Optiplex 745's DFF */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell OptiPlex 745",
-        .matches = {
+        DMI_MATCH3(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
             DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
-            DMI_MATCH(DMI_BOARD_NAME, "0MM599"),
-        },
+            DMI_MATCH(DMI_BOARD_NAME, "0MM599")),
     },
     {    /* Handle problems with rebooting on Dell Optiplex 745 with 0KW626 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell OptiPlex 745",
-        .matches = {
+        DMI_MATCH3(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
             DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
-            DMI_MATCH(DMI_BOARD_NAME, "0KW626"),
-        },
+            DMI_MATCH(DMI_BOARD_NAME, "0KW626")),
     },
     {    /* Handle problems with rebooting on Dell Optiplex 330 with 0KP561 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell OptiPlex 330",
-        .matches = {
+        DMI_MATCH3(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
             DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 330"),
-            DMI_MATCH(DMI_BOARD_NAME, "0KP561"),
-        },
+            DMI_MATCH(DMI_BOARD_NAME, "0KP561")),
     },
     {    /* Handle problems with rebooting on Dell Optiplex 360 with 0T656F */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell OptiPlex 360",
-        .matches = {
+        DMI_MATCH3(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
             DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 360"),
-            DMI_MATCH(DMI_BOARD_NAME, "0T656F"),
-        },
+            DMI_MATCH(DMI_BOARD_NAME, "0T656F")),
     },
     {    /* Handle problems with rebooting on Dell OptiPlex 760 with 0G919G */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell OptiPlex 760",
-        .matches = {
+        DMI_MATCH3(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
             DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 760"),
-            DMI_MATCH(DMI_BOARD_NAME, "0G919G"),
-        },
+            DMI_MATCH(DMI_BOARD_NAME, "0G919G")),
     },
     {    /* Handle problems with rebooting on Dell 2400's */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell PowerEdge 2400",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400")),
     },
     {    /* Handle problems with rebooting on Dell T5400's */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell Precision T5400",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T5400"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T5400")),
     },
     {    /* Handle problems with rebooting on Dell T7400's */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell Precision T7400",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T7400"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T7400")),
     },
     {    /* Handle problems with rebooting on HP laptops */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "HP Compaq Laptop",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq")),
     },
     {    /* Handle problems with rebooting on Dell XPS710 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell XPS710",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Dell XPS710"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Dell XPS710")),
     },
     {    /* Handle problems with rebooting on Dell DXP061 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Dell DXP061",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DXP061"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DXP061")),
     },
     {    /* Handle problems with rebooting on Sony VGN-Z540N */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Sony VGN-Z540N",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N")),
     },
     {    /* Handle problems with rebooting on ASUS P4S800 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "ASUS P4S800",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-            DMI_MATCH(DMI_BOARD_NAME, "P4S800"),
-        },
+            DMI_MATCH(DMI_BOARD_NAME, "P4S800")),
     },
     {    /* Handle reboot issue on Acer Aspire one */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
         .ident = "Acer Aspire One A110",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "AOA110")),
     },
     {    /* Handle problems with rebooting on Apple MacBook5 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Apple MacBook5",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5")),
     },
     {    /* Handle problems with rebooting on Apple MacBookPro5 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Apple MacBookPro5",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5")),
     },
     {    /* Handle problems with rebooting on Apple Macmini3,1 */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Apple Macmini3,1",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Macmini3,1"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Macmini3,1")),
     },
     {    /* Handle problems with rebooting on the iMac9,1. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Apple iMac9,1",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1")),
     },
     {    /* Handle problems with rebooting on the Latitude E6320. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6320",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320")),
     },
     {    /* Handle problems with rebooting on the Latitude E5420. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E5420",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E5420"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E5420")),
     },
     {       /* Handle problems with rebooting on the Latitude E6220. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6220",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6220"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6220")),
     },
     {    /* Handle problems with rebooting on the Latitude E6420. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6420",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420")),
     },
     {    /* Handle problems with rebooting on the OptiPlex 990. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell OptiPlex 990",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990")),
     },
     {    /* Handle problems with rebooting on the Precision M6600. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell OptiPlex 990",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Precision M6600"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Precision M6600")),
     },
     {    /* Handle problems with rebooting on the Latitude E6520. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6520",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520")),
     },
     {       /* Handle problems with rebooting on the OptiPlex 790. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell OptiPlex 790",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 790"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 790")),
     },
     {    /* Handle problems with rebooting on the OptiPlex 990. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell OptiPlex 990",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990")),
     },
     {    /* Handle problems with rebooting on the OptiPlex 390. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell OptiPlex 390",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 390"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 390")),
     },
     {    /* Handle problems with rebooting on Dell OptiPlex 9020. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_ACPI,
         .ident = "Dell OptiPlex 9020",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 9020"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 9020")),
     },
     {    /* Handle problems with rebooting on the Latitude E6320. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6320",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320")),
     },
     {    /* Handle problems with rebooting on the Latitude E6420. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6420",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420")),
     },
     {    /* Handle problems with rebooting on the Latitude E6520. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_CF9,
         .ident = "Dell Latitude E6520",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520")),
     },
     {    /* Handle problems with rebooting on Dell PowerEdge R540. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_ACPI,
         .ident = "Dell PowerEdge R540",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R540"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R540")),
     },
     {    /* Handle problems with rebooting on Dell PowerEdge R740. */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_ACPI,
         .ident = "Dell PowerEdge R740",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R740"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R740")),
     },
     { }
 };
diff --git a/xen/arch/x86/x86_64/mmconf-fam10h.c b/xen/arch/x86/x86_64/mmconf-fam10h.c
index 270dd97b6a..fd745baa56 100644
--- a/xen/arch/x86/x86_64/mmconf-fam10h.c
+++ b/xen/arch/x86/x86_64/mmconf-fam10h.c
@@ -188,9 +188,8 @@ void fam10h_check_enable_mmcfg(void)
 static const struct dmi_system_id __initconstrel mmconf_dmi_table[] = {
 	{
 		.ident = "Sun Microsystems Machine",
-		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Sun Microsystems"),
-		},
+		DMI_MATCH1(
+			DMI_MATCH(DMI_SYS_VENDOR, "Sun Microsystems")),
 	},
 	{}
 };
diff --git a/xen/include/xen/dmi.h b/xen/include/xen/dmi.h
index 0fef41842e..ed6ffda315 100644
--- a/xen/include/xen/dmi.h
+++ b/xen/include/xen/dmi.h
@@ -32,6 +32,11 @@ struct dmi_system_id {
 
 #define DMI_MATCH(a,b)	{ a, b }
 
+#define DMI_MATCH4(m1, m2, m3, m4) .matches = { m1, m2, m3, m4 }
+#define DMI_MATCH3(m1, m2, m3)     .matches = { [0] = m1, [1] = m2, [2] = m3 }
+#define DMI_MATCH2(m1, m2)         .matches = { [0] = m1, [1] = m2 }
+#define DMI_MATCH1(m1)             .matches = { [0] = m1 }
+
 extern int dmi_check_system(const struct dmi_system_id *list);
 extern void dmi_scan_machine(void);
 extern const char *dmi_get_table(paddr_t *base, u32 *len);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 08 10:33:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 08 Dec 2023 10:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650557.1016219 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBYAd-0003lz-I0; Fri, 08 Dec 2023 10:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650557.1016219; Fri, 08 Dec 2023 10: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 1rBYAd-0003lr-FP; Fri, 08 Dec 2023 10:33:23 +0000
Received: by outflank-mailman (input) for mailman id 650557;
 Fri, 08 Dec 2023 10: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 1rBYAb-0003lb-SV
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10: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 1rBYAb-0004JM-Rk
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10:33:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rBYAb-0004XB-R0
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10: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=2Es5diHdHWFZ2jgmAFjiFWPErlL/23g8nWLr2q3u0LU=; b=5TBdpCtftnQ1CpiDDl9DfaKYeH
	f1BDIK/8dzReDR6jEjj6cWbKfu4x+dUxBtyNSjqL8mOKvjLZB14pqS+6mivB0O9MPyflbU884qs0u
	RwaFW2+NIrINyuXgBtDpgDOE5v+NeAOYj93nNW9BrA9dW9pHKVrGVoXBMOcSf3oQQMjg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: remove "-D" command line parameter
Message-Id: <E1rBYAb-0004XB-R0@xenbits.xenproject.org>
Date: Fri, 08 Dec 2023 10:33:21 +0000

commit 98f2cb76f62c7e138ef33975cd7ba35902345a1d
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Nov 21 12:40:44 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Dec 7 12:56:34 2023 +0000

    tools/xenstored: remove "-D" command line parameter
    
    Remove the "-D" command parameter, which is disabling initialization of
    the mandatory domain data handling.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 tools/xenstored/core.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index 184b130d12..5f3e4150a1 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -2661,7 +2661,6 @@ static void usage(void)
 "\n"
 "where options may include:\n"
 "\n"
-"  -D, --no-domain-init    to state that xenstored should not initialise dom0,\n"
 "  -F, --pid-file <file>   giving a file for the daemon's pid to be written,\n"
 "  -H, --help              to output this message,\n"
 "  -N, --no-fork           to request that the daemon does not fork,\n"
@@ -2708,7 +2707,6 @@ static void usage(void)
 
 
 static struct option options[] = {
-	{ "no-domain-init", 0, NULL, 'D' },
 	{ "entry-nb", 1, NULL, 'E' },
 	{ "pid-file", 1, NULL, 'F' },
 	{ "event", 1, NULL, 'e' },
@@ -2841,7 +2839,6 @@ int main(int argc, char *argv[])
 	int sock_pollfd_idx = -1;
 	bool dofork = true;
 	bool outputpid = false;
-	bool no_domain_init = false;
 	bool live_update = false;
 	const char *pidfile = NULL;
 	int timeout;
@@ -2850,12 +2847,9 @@ int main(int argc, char *argv[])
 	orig_argv = argv;
 
 	while ((opt = getopt_long(argc, argv,
-				  "DE:F:H::KNPS:t:A:M:Q:q:T:RVW:w:U",
+				  "E:F:H::KNPS:t:A:M:Q:q:T:RVW:w:U",
 				  options, NULL)) != -1) {
 		switch (opt) {
-		case 'D':
-			no_domain_init = true;
-			break;
 		case 'E':
 			hard_quotas[ACC_NODES].val = get_optval_uint(optarg);
 			break;
@@ -2964,7 +2958,7 @@ int main(int argc, char *argv[])
 	init_pipe(reopen_log_pipe);
 
 	/* Listen to hypervisor. */
-	if (!no_domain_init && !live_update) {
+	if (!live_update) {
 		domain_init(-1);
 		dom0_init();
 	}
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 08 10:33:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 08 Dec 2023 10:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650558.1016224 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBYAn-0003ob-KW; Fri, 08 Dec 2023 10:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650558.1016224; Fri, 08 Dec 2023 10: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 1rBYAn-0003oQ-Gn; Fri, 08 Dec 2023 10:33:33 +0000
Received: by outflank-mailman (input) for mailman id 650558;
 Fri, 08 Dec 2023 10: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 1rBYAm-0003oA-0c
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10: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 1rBYAl-0004Jd-W9
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10:33:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rBYAl-0004Ze-U2
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10: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=NQDsb8Nmwj0+9TvxLyEtFHrxnwnMGcWLflOmtBP1Kv8=; b=Y9dYejqkVKsUcWrI/4nqIfhKC3
	Fr0fI/rgBtYmQdr7ZBUntHfRupPQMr5vyfkNVhiGpI8OZdIIpR4xCPzqjjMUi29ils8xABWni7x1O
	xHb4m5YiUkHdHy9HewVXYfO6hrMRuE2XHQANqBUK4ca2fR9hNiaZassfbhWSp57V3DxE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: remove "-V" command line option
Message-Id: <E1rBYAl-0004Ze-U2@xenbits.xenproject.org>
Date: Fri, 08 Dec 2023 10:33:31 +0000

commit cddc66b1ea80bed653fce43d5cd98221dabbccf6
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Nov 21 12:40:45 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Dec 7 12:56:34 2023 +0000

    tools/xenstored: remove "-V" command line option
    
    The "-V" (verbose) command line option is nearly completely redundant
    with "io" tracing. Just the time of the printed data is a little bit
    different, while the tracing is more informative.
    
    Remove the verbose option.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 tools/xenstored/core.c | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index 5f3e4150a1..6dd810c092 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -76,7 +76,6 @@ static int sock = -1;
 int orig_argc;
 char **orig_argv;
 
-static bool verbose = false;
 LIST_HEAD(connections);
 int tracefd = -1;
 static bool recovery = true;
@@ -329,11 +328,6 @@ static bool write_messages(struct connection *conn)
 		return true;
 
 	if (out->inhdr) {
-		if (verbose)
-			xprintf("Writing msg %s (%.*s) out to %p\n",
-				sockmsg_string(out->hdr.msg.type),
-				out->hdr.msg.len,
-				out->buffer, conn);
 		ret = conn->funcs->write(conn, out->hdr.raw + out->used,
 					 sizeof(out->hdr) - out->used);
 		if (ret < 0)
@@ -2134,11 +2128,6 @@ static bool process_delayed_message(struct delayed_request *req)
 
 static void consider_message(struct connection *conn)
 {
-	if (verbose)
-		xprintf("Got message %s len %i from %p\n",
-			sockmsg_string(conn->in->hdr.msg.type),
-			conn->in->hdr.msg.len, conn);
-
 	conn->is_stalled = false;
 	/*
 	 * Currently, Live-Update is not supported if there is active
@@ -2701,8 +2690,7 @@ static void usage(void)
 "  -R, --no-recovery       to request that no recovery should be attempted when\n"
 "                          the store is corrupted (debug only),\n"
 "  -K, --keep-orphans      don't delete nodes owned by a domain when the\n"
-"                          domain is deleted (this is a security risk!)\n"
-"  -V, --verbose           to request verbose execution.\n");
+"                          domain is deleted (this is a security risk!)\n");
 }
 
 
@@ -2726,7 +2714,6 @@ static struct option options[] = {
 	{ "timeout", 1, NULL, 'w' },
 	{ "no-recovery", 0, NULL, 'R' },
 	{ "keep-orphans", 0, NULL, 'K' },
-	{ "verbose", 0, NULL, 'V' },
 	{ "watch-nb", 1, NULL, 'W' },
 #ifndef NO_LIVE_UPDATE
 	{ "live-update", 0, NULL, 'U' },
@@ -2847,7 +2834,7 @@ int main(int argc, char *argv[])
 	orig_argv = argv;
 
 	while ((opt = getopt_long(argc, argv,
-				  "E:F:H::KNPS:t:A:M:Q:q:T:RVW:w:U",
+				  "E:F:H::KNPS:t:A:M:Q:q:T:RW:w:U",
 				  options, NULL)) != -1) {
 		switch (opt) {
 		case 'E':
@@ -2884,9 +2871,6 @@ int main(int argc, char *argv[])
 		case 'K':
 			keep_orphans = true;
 			break;
-		case 'V':
-			verbose = true;
-			break;
 		case 'W':
 			hard_quotas[ACC_WATCH].val = get_optval_uint(optarg);
 			break;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 08 10:33:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 08 Dec 2023 10:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650559.1016227 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBYAx-0003sO-NB; Fri, 08 Dec 2023 10:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650559.1016227; Fri, 08 Dec 2023 10: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 1rBYAx-0003sG-KR; Fri, 08 Dec 2023 10:33:43 +0000
Received: by outflank-mailman (input) for mailman id 650559;
 Fri, 08 Dec 2023 10: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 1rBYAw-0003rn-3i
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10: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 1rBYAw-0004K5-36
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rBYAw-0004a7-28
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10: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=6/YA0HJWe5Bp9GdADZtXOoIHiyKGHyw/N4s6aqM6Pu8=; b=bxAyZctJHjYfw9PeELmH6z3Ghj
	NZWICuedcmc1MGYAZLl2jUkqCH7u/e10DfMJ1TlwfPKk1eLBGvL96gvvNwWQeP7h+hl8/W7Hyl9zt
	BCpZroeP8m8MPuAIeNVg42+SpafaZX6Dmc1cF6e29HzcguR0Kx7GqgJzyZpwm/S/64to=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: remove the "-P" command line option
Message-Id: <E1rBYAw-0004a7-28@xenbits.xenproject.org>
Date: Fri, 08 Dec 2023 10:33:42 +0000

commit cc6609eed2d0f399b8b6d17921860449d3cf23d2
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Nov 21 12:40:46 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Dec 7 12:56:34 2023 +0000

    tools/xenstored: remove the "-P" command line option
    
    The "-P" command line option just results in printing the PID of the
    xenstored daemon to stdout before stdout is being closed. The same
    information can be retrieved from the PID file via the "-F" option.
    
    Remove the redundant "-P" option.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 tools/xenstored/core.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index 6dd810c092..1f5505d05e 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -2653,7 +2653,6 @@ static void usage(void)
 "  -F, --pid-file <file>   giving a file for the daemon's pid to be written,\n"
 "  -H, --help              to output this message,\n"
 "  -N, --no-fork           to request that the daemon does not fork,\n"
-"  -P, --output-pid        to request that the pid of the daemon is output,\n"
 "  -T, --trace-file <file> giving the file for logging, and\n"
 "      --trace-control=+<switch> activate a specific <switch>\n"
 "      --trace-control=-<switch> deactivate a specific <switch>\n"
@@ -2702,7 +2701,6 @@ static struct option options[] = {
 	{ "help", 0, NULL, 'H' },
 	{ "no-fork", 0, NULL, 'N' },
 	{ "priv-domid", 1, NULL, 'p' },
-	{ "output-pid", 0, NULL, 'P' },
 	{ "entry-size", 1, NULL, 'S' },
 	{ "trace-file", 1, NULL, 'T' },
 	{ "trace-control", 1, NULL, 1 },
@@ -2825,7 +2823,6 @@ int main(int argc, char *argv[])
 	int opt;
 	int sock_pollfd_idx = -1;
 	bool dofork = true;
-	bool outputpid = false;
 	bool live_update = false;
 	const char *pidfile = NULL;
 	int timeout;
@@ -2834,7 +2831,7 @@ int main(int argc, char *argv[])
 	orig_argv = argv;
 
 	while ((opt = getopt_long(argc, argv,
-				  "E:F:H::KNPS:t:A:M:Q:q:T:RW:w:U",
+				  "E:F:H::KNS:t:A:M:Q:q:T:RW:w:U",
 				  options, NULL)) != -1) {
 		switch (opt) {
 		case 'E':
@@ -2849,9 +2846,6 @@ int main(int argc, char *argv[])
 		case 'N':
 			dofork = false;
 			break;
-		case 'P':
-			outputpid = true;
-			break;
 		case 'R':
 			recovery = false;
 			break;
@@ -2947,11 +2941,6 @@ int main(int argc, char *argv[])
 		dom0_init();
 	}
 
-	if (outputpid) {
-		printf("%ld\n", (long)getpid());
-		fflush(stdout);
-	}
-
 	/* redirect to /dev/null now we're ready to accept connections */
 	if (dofork && !live_update)
 		finish_daemonize();
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 08 10:33:53 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 08 Dec 2023 10:33:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650560.1016230 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBYB7-0003vB-OM; Fri, 08 Dec 2023 10:33:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650560.1016230; Fri, 08 Dec 2023 10: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 1rBYB7-0003v1-Ls; Fri, 08 Dec 2023 10:33:53 +0000
Received: by outflank-mailman (input) for mailman id 650560;
 Fri, 08 Dec 2023 10: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 1rBYB6-0003uq-7D
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10: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 1rBYB6-0004KC-6a
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rBYB6-0004ab-5I
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10: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=VbwuevrgAzYaIjqXc2E2Hj5VJUwa4IDwQReayOrWeow=; b=kIv71vH9XjdR4Z9cEyk6kBPJ2J
	a8P3ScG1Z7AWU9xqCfc1kRUJZUQpoWKogTjyoO+fa3w/cPjKdcJuGFY9W7Xj1K0EcVacAA2+/IvWK
	Im/axTcZGhJVe8ITItZ/CvyZBAa1NTv/r9dYLbgscOHP8srfC3D1aqaGt7/r2WXOH6SU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: remove the "-R" command line option
Message-Id: <E1rBYB6-0004ab-5I@xenbits.xenproject.org>
Date: Fri, 08 Dec 2023 10:33:52 +0000

commit c4ccad6f3f169f2aa4de02e772891c3e973a6c88
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Nov 21 12:40:47 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Dec 7 12:56:34 2023 +0000

    tools/xenstored: remove the "-R" command line option
    
    The "-R" (no recovery) command line option enables to omit fixing the
    node store in case of detected inconsistencies.
    
    This might have been of interest in the past, when the node data base
    was kept in a file, but now the usability of this option is zero.
    
    Remove the "-R" option.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 tools/xenstored/core.c | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index 1f5505d05e..31968df0ce 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -78,7 +78,6 @@ char **orig_argv;
 
 LIST_HEAD(connections);
 int tracefd = -1;
-static bool recovery = true;
 bool keep_orphans = false;
 static int reopen_log_pipe[2];
 static int reopen_log_pipe0_pollfd_idx = -1;
@@ -2443,9 +2442,6 @@ int remember_string(struct hashtable *hash, const char *str)
  * have a corresponding child node (and if so, delete them).  Each valid child
  * is then recursively checked.
  *
- * No deleting is performed if the recovery flag is cleared (i.e. -R was
- * passed on the command line).
- *
  * As we go, we record each node in the given reachable hashtable.  These
  * entries will be used later in clean_store.
  */
@@ -2462,8 +2458,7 @@ static int check_store_step(const void *ctx, struct connection *conn,
 
 	if (hashtable_search(data->reachable, (void *)node->name)) {
 		log("check_store: '%s' is duplicated!", node->name);
-		return recovery ? WALK_TREE_RM_CHILDENTRY
-				: WALK_TREE_SKIP_CHILDREN;
+		return WALK_TREE_RM_CHILDENTRY;
 	}
 
 	if (remember_string(data->reachable, node->name))
@@ -2479,7 +2474,7 @@ static int check_store_enoent(const void *ctx, struct connection *conn,
 {
 	log("check_store: node '%s' not found", name);
 
-	return recovery ? WALK_TREE_RM_CHILDENTRY : WALK_TREE_OK;
+	return WALK_TREE_RM_CHILDENTRY;
 }
 
 
@@ -2504,8 +2499,7 @@ static int clean_store_(const void *key, void *val, void *private)
 	}
 	if (!hashtable_search(reachable, name)) {
 		log("clean_store: '%s' is orphaned!", name);
-		if (recovery)
-			db_delete(NULL, name, NULL);
+		db_delete(NULL, name, NULL);
 	}
 
 	talloc_free(name);
@@ -2686,8 +2680,6 @@ static void usage(void)
 "  -w, --timeout <what>=<seconds>   set the timeout in seconds for <what>,\n"
 "                          allowed timeout candidates are:\n"
 "                          watch-event: time a watch-event is kept pending\n"
-"  -R, --no-recovery       to request that no recovery should be attempted when\n"
-"                          the store is corrupted (debug only),\n"
 "  -K, --keep-orphans      don't delete nodes owned by a domain when the\n"
 "                          domain is deleted (this is a security risk!)\n");
 }
@@ -2710,7 +2702,6 @@ static struct option options[] = {
 	{ "quota", 1, NULL, 'Q' },
 	{ "quota-soft", 1, NULL, 'q' },
 	{ "timeout", 1, NULL, 'w' },
-	{ "no-recovery", 0, NULL, 'R' },
 	{ "keep-orphans", 0, NULL, 'K' },
 	{ "watch-nb", 1, NULL, 'W' },
 #ifndef NO_LIVE_UPDATE
@@ -2831,7 +2822,7 @@ int main(int argc, char *argv[])
 	orig_argv = argv;
 
 	while ((opt = getopt_long(argc, argv,
-				  "E:F:H::KNS:t:A:M:Q:q:T:RW:w:U",
+				  "E:F:H::KNS:t:A:M:Q:q:T:W:w:U",
 				  options, NULL)) != -1) {
 		switch (opt) {
 		case 'E':
@@ -2846,9 +2837,6 @@ int main(int argc, char *argv[])
 		case 'N':
 			dofork = false;
 			break;
-		case 'R':
-			recovery = false;
-			break;
 		case 'S':
 			hard_quotas[ACC_NODESZ].val = get_optval_uint(optarg);
 			break;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 08 10:34:03 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 08 Dec 2023 10:34:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650561.1016235 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBYBH-0003xi-Q3; Fri, 08 Dec 2023 10:34:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650561.1016235; Fri, 08 Dec 2023 10: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 1rBYBH-0003xa-NL; Fri, 08 Dec 2023 10:34:03 +0000
Received: by outflank-mailman (input) for mailman id 650561;
 Fri, 08 Dec 2023 10: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 1rBYBG-0003xH-AZ
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10: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 1rBYBG-0004KY-9p
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10:34:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rBYBG-0004ba-8j
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10: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=LluISz7knA0A0eec55fJNdiXiq15Dc4VZJZ1VsSjWwc=; b=hx8ZY7zBu4mYW+v4RVMQ4AhR+i
	UDL/aWKRTZiEUgJUcNpKSHn6t1laz71BsR4zq5W0/vgW6BbTtLkPi9j6BfmqnHskEQOu1p5a8z+B3
	5Mc7eaFaACAMHDuqo3Z+o0kL5iBVLeAspm9zDnQV7XDHSalCfoHxvyBEcBXSh1kHKpQE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: bootfdt: Check return code of device_tree_for_each_node()
Message-Id: <E1rBYBG-0004ba-8j@xenbits.xenproject.org>
Date: Fri, 08 Dec 2023 10:34:02 +0000

commit 02d0a615b32d03702f79807fa5e88f0cf78dde84
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Thu Dec 7 11:14:32 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Dec 7 12:57:21 2023 +0000

    xen/arm: bootfdt: Check return code of device_tree_for_each_node()
    
    As a result of not checking the return code of device_tree_for_each_node()
    in boot_fdt_info(), any error occured during early FDT parsing does not
    stop Xen from booting. This can result in an unwanted behavior in later
    boot stages. Fix it by checking the return code and panicing on an error.
    
    Fixes: 9cf4a9a46717 ("device tree: add device_tree_for_each_node()")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/bootfdt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
index b1f03eb2fc..f496a8cf94 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/arch/arm/bootfdt.c
@@ -541,7 +541,9 @@ size_t __init boot_fdt_info(const void *fdt, paddr_t paddr)
 
     add_boot_module(BOOTMOD_FDT, paddr, fdt_totalsize(fdt), false);
 
-    device_tree_for_each_node((void *)fdt, 0, early_scan_node, NULL);
+    ret = device_tree_for_each_node((void *)fdt, 0, early_scan_node, NULL);
+    if ( ret )
+        panic("Early FDT parsing failed (%d)\n", ret);
 
     /*
      * On Arm64 setup_directmap_mappings() expects to be called with the lowest
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 08 10:34:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 08 Dec 2023 10:34:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650562.1016238 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBYBR-00040D-RB; Fri, 08 Dec 2023 10:34:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650562.1016238; Fri, 08 Dec 2023 10: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 1rBYBR-000406-Ol; Fri, 08 Dec 2023 10:34:13 +0000
Received: by outflank-mailman (input) for mailman id 650562;
 Fri, 08 Dec 2023 10: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 1rBYBQ-0003zs-Dc
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10: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 1rBYBQ-0004Kh-Cq
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10:34:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rBYBQ-0004ce-C1
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10: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=872bqvQygIWKtGNfjqP+sukJj1/9ic6p0AnJOKyDFh0=; b=tNMP8Oc3XWWx3Bd0ZyQvM1P31A
	yZCtLMfT+DrsespCRj6zv08BRQHu8F2jDCdzCA/Gm/q7sr2cHswiWvm/LUYAHbGxMwDGEYH1hGNgj
	GK4bvgd/ZOk7daRbDZfJBoYOxsL4RFnjQkPT9sZnJgJdB/XDJstWtePHeBUo+mz6IPqU=;
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: <E1rBYBQ-0004ce-C1@xenbits.xenproject.org>
Date: Fri, 08 Dec 2023 10:34:12 +0000

commit 23792cc0f22cff4e106d838b83aa9ae1cb6ffaf4
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Dec 4 16:23:20 2023 +0100
Commit:     George Dunlap <george.dunlap@cloud.com>
CommitDate: Thu Dec 7 13:37:25 2023 +0000

    xen/sched: fix sched_move_domain()
    
    Do cleanup in sched_move_domain() in a dedicated service function,
    which is called either in error case with newly allocated data, or in
    success case with the old data to be freed.
    
    This will at once fix some subtle bugs which sneaked in due to
    forgetting to overwrite some pointers in the error case.
    
    Fixes: 70fadc41635b ("xen/cpupool: support moving domain between cpupools with different granularity")
    Reported-by: René Winther Højgaard <renewin@proton.me>
    Initial-fix-by: Jan Beulich <jbeulich@suse.com>
    Initial-fix-by: George Dunlap <george.dunlap@cloud.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: George Dunlap <george.dunlap@cloud.com>
---
 xen/common/sched/core.c | 47 +++++++++++++++++++++++++++--------------------
 1 file changed, 27 insertions(+), 20 deletions(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index eba0cea4bb..901782bbb4 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -647,6 +647,24 @@ static void sched_move_irqs(const struct sched_unit *unit)
         vcpu_move_irqs(v);
 }
 
+static void sched_move_domain_cleanup(const struct scheduler *ops,
+                                      struct sched_unit *units,
+                                      void *domdata)
+{
+    struct sched_unit *unit, *old_unit;
+
+    for ( unit = units; unit; )
+    {
+        if ( unit->priv )
+            sched_free_udata(ops, unit->priv);
+        old_unit = unit;
+        unit = unit->next_in_list;
+        xfree(old_unit);
+    }
+
+    sched_free_domdata(ops, domdata);
+}
+
 /*
  * Move a domain from one cpupool to another.
  *
@@ -686,7 +704,6 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
     void *old_domdata;
     unsigned int gran = cpupool_get_granularity(c);
     unsigned int n_units = d->vcpu[0] ? DIV_ROUND_UP(d->max_vcpus, gran) : 0;
-    int ret = 0;
 
     for_each_vcpu ( d, v )
     {
@@ -699,8 +716,9 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
     domdata = sched_alloc_domdata(c->sched, d);
     if ( IS_ERR(domdata) )
     {
-        ret = PTR_ERR(domdata);
-        goto out;
+        rcu_read_unlock(&sched_res_rculock);
+
+        return PTR_ERR(domdata);
     }
 
     for ( unit_idx = 0; unit_idx < n_units; unit_idx++ )
@@ -718,10 +736,10 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
 
         if ( !unit || !unit->priv )
         {
-            old_units = new_units;
-            old_domdata = domdata;
-            ret = -ENOMEM;
-            goto out_free;
+            sched_move_domain_cleanup(c->sched, new_units, domdata);
+            rcu_read_unlock(&sched_res_rculock);
+
+            return -ENOMEM;
         }
 
         unit_ptr = &unit->next_in_list;
@@ -808,22 +826,11 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
 
     domain_unpause(d);
 
- out_free:
-    for ( unit = old_units; unit; )
-    {
-        if ( unit->priv )
-            sched_free_udata(c->sched, unit->priv);
-        old_unit = unit;
-        unit = unit->next_in_list;
-        xfree(old_unit);
-    }
-
-    sched_free_domdata(old_ops, old_domdata);
+    sched_move_domain_cleanup(old_ops, old_units, old_domdata);
 
- out:
     rcu_read_unlock(&sched_res_rculock);
 
-    return ret;
+    return 0;
 }
 
 void sched_destroy_vcpu(struct vcpu *v)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 08 10:34:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 08 Dec 2023 10:34:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650563.1016243 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBYBb-00043G-TC; Fri, 08 Dec 2023 10:34:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650563.1016243; Fri, 08 Dec 2023 10: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 1rBYBb-000438-QF; Fri, 08 Dec 2023 10:34:23 +0000
Received: by outflank-mailman (input) for mailman id 650563;
 Fri, 08 Dec 2023 10: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 1rBYBa-00042v-GX
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10: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 1rBYBa-0004Ks-Fv
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10:34:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rBYBa-0004di-F9
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10: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=KlW72rouLSx+xpcGcfXIPVNzRvGq4Fu/1r4lCmhHx9U=; b=Us3x1f3jN9iflGhcJpzY5Ugyk6
	teqTa7Yv9OqTW/a1ScNF/LgritZ6d44CfE+9865pNDbQeXpkj7utR5aTey5ZBKWhWGR+dWNSDEFe0
	xyfolOHco5epSd1eInPydZE/EQayVr02YIhJHDP/jHs4SZKP+ZDmP2LvaO3CWn+8D+AY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/sched: do some minor cleanup of sched_move_domain()
Message-Id: <E1rBYBa-0004di-F9@xenbits.xenproject.org>
Date: Fri, 08 Dec 2023 10:34:22 +0000

commit 25147005daf5a4e121b96496d6d208fac05fca35
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Dec 4 16:23:21 2023 +0100
Commit:     George Dunlap <george.dunlap@cloud.com>
CommitDate: Thu Dec 7 13:37:28 2023 +0000

    xen/sched: do some minor cleanup of sched_move_domain()
    
    Do some minor cleanups:
    
    - Move setting of old_domdata and old_units next to each other
    - Drop incrementing unit_idx in the final loop of sched_move_domain()
      as it isn't used afterwards
    - Rename new_p to new_cpu and unit_p to unit_cpu
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@cloud.com>
---
 xen/common/sched/core.c | 27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 901782bbb4..f6ac1e5af8 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -698,7 +698,7 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
     struct sched_unit *unit, *old_unit;
     struct sched_unit *new_units = NULL, *old_units;
     struct sched_unit **unit_ptr = &new_units;
-    unsigned int new_p, unit_idx;
+    unsigned int new_cpu, unit_idx;
     void *domdata;
     struct scheduler *old_ops = dom_scheduler(d);
     void *old_domdata;
@@ -748,13 +748,14 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
     domain_pause(d);
 
     old_domdata = d->sched_priv;
+    old_units = d->sched_unit_list;
 
     /*
      * 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);
+    new_cpu = cpumask_first(d->cpupool->cpu_valid);
     for_each_sched_unit ( d, unit )
     {
         spinlock_t *lock;
@@ -762,12 +763,10 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
         sched_remove_unit(old_ops, unit);
 
         lock = unit_schedule_lock_irq(unit);
-        sched_set_res(unit, get_sched_res(new_p));
+        sched_set_res(unit, get_sched_res(new_cpu));
         spin_unlock_irq(lock);
     }
 
-    old_units = d->sched_unit_list;
-
     d->cpupool = c;
     d->sched_priv = domdata;
 
@@ -781,32 +780,32 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
         unit->state_entry_time = old_unit->state_entry_time;
         unit->runstate_cnt[v->runstate.state]++;
         /* Temporarily use old resource assignment */
-        unit->res = get_sched_res(new_p);
+        unit->res = get_sched_res(new_cpu);
 
         v->sched_unit = unit;
     }
 
     d->sched_unit_list = new_units;
 
-    new_p = cpumask_first(c->cpu_valid);
+    new_cpu = cpumask_first(c->cpu_valid);
     for_each_sched_unit ( d, unit )
     {
         spinlock_t *lock;
-        unsigned int unit_p = new_p;
+        unsigned int unit_cpu = new_cpu;
 
         for_each_sched_unit_vcpu ( unit, v )
         {
-            migrate_timer(&v->periodic_timer, new_p);
-            migrate_timer(&v->singleshot_timer, new_p);
-            migrate_timer(&v->poll_timer, new_p);
-            new_p = cpumask_cycle(new_p, c->cpu_valid);
+            migrate_timer(&v->periodic_timer, new_cpu);
+            migrate_timer(&v->singleshot_timer, new_cpu);
+            migrate_timer(&v->poll_timer, new_cpu);
+            new_cpu = cpumask_cycle(new_cpu, c->cpu_valid);
         }
 
         lock = unit_schedule_lock_irq(unit);
 
         sched_set_affinity(unit, &cpumask_all, &cpumask_all);
 
-        sched_set_res(unit, get_sched_res(unit_p));
+        sched_set_res(unit, get_sched_res(unit_cpu));
         /*
          * With v->processor modified we must not
          * - make any further changes assuming we hold the scheduler lock,
@@ -818,8 +817,6 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
             sched_move_irqs(unit);
 
         sched_insert_unit(c->sched, unit);
-
-        unit_idx++;
     }
 
     domain_update_node_affinity(d);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 08 10:34:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 08 Dec 2023 10:34:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.650564.1016247 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rBYBl-00045v-UP; Fri, 08 Dec 2023 10:34:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 650564.1016247; Fri, 08 Dec 2023 10: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 1rBYBl-00045m-Rh; Fri, 08 Dec 2023 10:34:33 +0000
Received: by outflank-mailman (input) for mailman id 650564;
 Fri, 08 Dec 2023 10: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 1rBYBk-00045a-JN
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10: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 1rBYBk-0004Kz-Ig
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10:34:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rBYBk-0004eT-I3
 for xen-changelog@lists.xenproject.org; Fri, 08 Dec 2023 10: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=VL6j0uPlJDOUPxfDJtLudQ2aqMygW2Wixpi8teV6Np8=; b=l5GWuSqIG0aqMqwDtWuNdFPh8L
	61vHJU7McnQ0l9zxQDKiVCodj/oaoXGBDoAKa20LI8nMgcRlIufX/h1P1O02mpIa0ilj2Qg83Xynf
	yvz2rUf3MGbRDdPZ/+7FxugwKmWu/7bg3lfLJj4LgOMjBVLbXfVNlgcYxaYyRnKJ4/QA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CODING_STYLE: Add a section of the naming convention
Message-Id: <E1rBYBk-0004eT-I3@xenbits.xenproject.org>
Date: Fri, 08 Dec 2023 10:34:32 +0000

commit d2b7c442b4a066bb670ee83e24800cabc415241d
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Tue Dec 5 18:12:18 2023 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Dec 7 15:37:25 2023 +0000

    CODING_STYLE: Add a section of the naming convention
    
    Several maintainers have expressed a stronger preference
    to use '-' when in filename and option that contains multiple
    words.
    
    So document it in CODING_STYLE.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
---
 CODING_STYLE | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/CODING_STYLE b/CODING_STYLE
index ced3ade5a6..ed13ee2b66 100644
--- a/CODING_STYLE
+++ b/CODING_STYLE
@@ -144,6 +144,15 @@ separate lines and each line should begin with a leading '*'.
  * Note beginning and end markers on separate lines and leading '*'.
  */
 
+Naming convention for files and command line options
+----------------------------------------------------
+
+'-' should be used to separate words in commandline options and filenames.
+E.g. timer-works.
+
+Note that some of the options and filenames are using '_'. This is now
+deprecated.
+
 Emacs local variables
 ---------------------
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 13 08:55:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 Dec 2023 08:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.653771.1020298 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rDL1C-0003QO-J3; Wed, 13 Dec 2023 08:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 653771.1020298; Wed, 13 Dec 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 1rDL1C-0003QG-GR; Wed, 13 Dec 2023 08:55:02 +0000
Received: by outflank-mailman (input) for mailman id 653771;
 Wed, 13 Dec 2023 08: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 1rDL1B-0003QA-Hf
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 08: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 1rDL1B-0004ce-E7
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 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 1rDL1B-00082X-Bz
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 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=SOs3l50aNUEmK8m8Iy3XUwDb7Z/cLadVaM39g9Bx5qI=; b=4gb0qfEKkOZ/xidNzSGaqU7frl
	15cTcUn4XBDylOj1FAgYh1mcJ4NvEoMOSq3YjF1hUIn5pT+NH5LH1gJs8stsiZ73JwF2ZqfsPru0K
	Olp6PbSmhhYtDEBHpDaV/KiIFqWCxgaTW3BLZxEuTUmykTUeIvLBS+Wl8ef/4aFgcXsc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] Only compile the hypervisor with -Wdeclaration-after-statement
Message-Id: <E1rDL1B-00082X-Bz@xenbits.xenproject.org>
Date: Wed, 13 Dec 2023 08:55:01 +0000

commit a56d598e13db413f98e149f8e10cc13e8d4c1635
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Tue Dec 12 14:26:18 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 12 14:26:18 2023 +0100

    Only compile the hypervisor with -Wdeclaration-after-statement
    
    Right now, all tools and hypervisor will be complied with the option
    -Wdeclaration-after-statement. While most of the code in the hypervisor
    is controlled by us, for tools we may import external libraries.
    
    The build will fail if one of them are using the construct we are
    trying to prevent. This is the case when building against Python 3.12
    and Yocto:
    
    | In file included from /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/Python.h:44,
    |                  from xen/lowlevel/xc/xc.c:8:
    | /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/object.h: In function 'Py_SIZE':
    | /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/object.h:233:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
    |   233 |     PyVarObject *var_ob = _PyVarObject_CAST(ob);
    |       |     ^~~~~~~~~~~
    | In file included from /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/Python.h:53:
    | /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/cpython/longintrepr.h: In function '_PyLong_CompactValue':
    | /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/cpython/longintrepr.h:121:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
    |   121 |     Py_ssize_t sign = 1 - (op->long_value.lv_tag & _PyLong_SIGN_MASK);
    |       |     ^~~~~~~~~~
    | cc1: all warnings being treated as errors
    
    Looking at the tools directory, a fair few directory already add
    -Wno-declaration-after-statement to inhibit the default behavior.
    
    We have always build the hypervisor with the flag, so for now remove
    only the flag for anything but the hypervisor. We can decide at later
    time whether we want to relax.
    
    Also remove the -Wno-declaration-after-statement in some subdirectory
    as the flag is now unnecessary.
    
    Part of the commit message was take from Alexander's first proposal:
    
    Link: https://lore.kernel.org/xen-devel/20231128174729.3880113-1-alex@linutronix.de/
    Reported-by: Alexander Kanavin <alex@linutronix.de>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    
    xen/hypervisor: Don't use cc-option-add for -Wdeclaration-after-statement
    
    Per Andrew's comment in [1] all the compilers we support should
    recognize the flag.
    
    I forgot to address the comment while committing.
    
    [1] fcf00090-304a-49f7-8a61-a54347e90a3b@citrix.com
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    master commit: 40be6307ec005539635e7b8fcef67e989dc441f6
    master date: 2023-12-06 19:12:40 +0000
    master commit: d4bfd3899886d0fbe259c20660dadb1e00170f2d
    master date: 2023-12-06 19:19:59 +0000
---
 Config.mk                   | 2 --
 stubdom/Makefile            | 2 +-
 stubdom/vtpmmgr/Makefile    | 2 +-
 tools/libs/light/Makefile   | 3 +--
 tools/libs/util/Makefile    | 3 +--
 tools/tests/depriv/Makefile | 2 --
 tools/xl/Makefile           | 3 +--
 xen/Makefile                | 1 +
 8 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/Config.mk b/Config.mk
index 29b0d1e12a..2a3e16d0bd 100644
--- a/Config.mk
+++ b/Config.mk
@@ -177,8 +177,6 @@ CFLAGS += -std=gnu99
 
 CFLAGS += -Wall -Wstrict-prototypes
 
-$(call cc-option-add,HOSTCFLAGS,HOSTCC,-Wdeclaration-after-statement)
-$(call cc-option-add,CFLAGS,CC,-Wdeclaration-after-statement)
 $(call cc-option-add,CFLAGS,CC,-Wno-unused-but-set-variable)
 $(call cc-option-add,CFLAGS,CC,-Wno-unused-local-typedefs)
 
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 0ddfce1ba2..888fa20d72 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -245,7 +245,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	patch -d $@ -p1 < vtpm-command-duration.patch
 	patch -d $@ -p1 < vtpm-tpm_bn_t-addr.patch
 	mkdir $@/build
-	cd $@/build; CC=${CC} $(CMAKE) .. -DCMAKE_C_FLAGS:STRING="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
+	cd $@/build; CC=${CC} $(CMAKE) .. -DCMAKE_C_FLAGS:STRING="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS)"
 	touch $@
 
 TPMEMU_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm.a
diff --git a/stubdom/vtpmmgr/Makefile b/stubdom/vtpmmgr/Makefile
index 6dae034a07..c29bb49838 100644
--- a/stubdom/vtpmmgr/Makefile
+++ b/stubdom/vtpmmgr/Makefile
@@ -17,7 +17,7 @@ OBJS += vtpm_disk.o disk_tpm.o disk_io.o disk_crypto.o disk_read.o disk_write.o
 OBJS += mgmt_authority.o
 
 CFLAGS+=-Werror -Iutil -Icrypto -Itcs
-CFLAGS+=-Wno-declaration-after-statement -Wno-unused-label
+CFLAGS+=-Wno-unused-label
 
 build: $(TARGET)
 $(TARGET): $(OBJS)
diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index ba4c1b7933..37e4d16709 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -38,8 +38,7 @@ vpath static_tables.c $(ACPI_PATH)/
 
 OBJS-$(CONFIG_X86) += $(ACPI_OBJS)
 
-CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
-	-Wno-declaration-after-statement -Wformat-nonliteral
+CFLAGS += -Wno-format-zero-length -Wmissing-declarations -Wformat-nonliteral
 
 CFLAGS-$(CONFIG_X86) += -DCONFIG_PCI_SUPP_LEGACY_IRQ
 
diff --git a/tools/libs/util/Makefile b/tools/libs/util/Makefile
index c3b21875dc..936ec90a31 100644
--- a/tools/libs/util/Makefile
+++ b/tools/libs/util/Makefile
@@ -9,8 +9,7 @@ OBJS-y += libxlu_disk.o
 OBJS-y += libxlu_vif.o
 OBJS-y += libxlu_pci.o
 
-CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
-	-Wno-declaration-after-statement -Wformat-nonliteral
+CFLAGS += -Wno-format-zero-length -Wmissing-declarations -Wformat-nonliteral
 CFLAGS += $(CFLAGS_libxenctrl)
 
 CFLAGS += $(PTHREAD_CFLAGS)
diff --git a/tools/tests/depriv/Makefile b/tools/tests/depriv/Makefile
index 7d9e3b01bb..5404a12f47 100644
--- a/tools/tests/depriv/Makefile
+++ b/tools/tests/depriv/Makefile
@@ -1,8 +1,6 @@
 XEN_ROOT=$(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += -Wno-declaration-after-statement
-
 CFLAGS += $(CFLAGS_xeninclude)
 CFLAGS += $(CFLAGS_libxenctrl)
 CFLAGS += $(CFLAGS_libxencall)
diff --git a/tools/xl/Makefile b/tools/xl/Makefile
index 5f7aa5f46c..d742e96a5b 100644
--- a/tools/xl/Makefile
+++ b/tools/xl/Makefile
@@ -5,8 +5,7 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
-	-Wno-declaration-after-statement -Wformat-nonliteral
+CFLAGS += -Wno-format-zero-length -Wmissing-declarations -Wformat-nonliteral
 CFLAGS += -fPIC
 
 CFLAGS += $(PTHREAD_CFLAGS)
diff --git a/xen/Makefile b/xen/Makefile
index e39290f638..a92709b43e 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -392,6 +392,7 @@ CFLAGS-$(CONFIG_CC_SPLIT_SECTIONS) += -ffunction-sections -fdata-sections
 
 CFLAGS += -nostdinc -fno-builtin -fno-common
 CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
+CFLAGS += -Wdeclaration-after-statement
 $(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#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Wed Dec 13 08:55:12 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 Dec 2023 08:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.653772.1020302 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rDL1M-0003SA-L0; Wed, 13 Dec 2023 08:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 653772.1020302; Wed, 13 Dec 2023 08: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 1rDL1M-0003S2-Hw; Wed, 13 Dec 2023 08:55:12 +0000
Received: by outflank-mailman (input) for mailman id 653772;
 Wed, 13 Dec 2023 08: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 1rDL1L-0003Ru-KK
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 08: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 1rDL1L-0004cw-JU
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 08:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDL1L-000837-GI
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 08: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=B92dPRf5m8OKezQ6PDHYsoV/FFYDMTzd7nviN/kzdgk=; b=TOFmcT8YxnhmcGHMTwFCR78T88
	l099P0LXxeH/0iFx2wV4fMVmzJiFReyfw6tBy8lTZFwUKjPG0R7S1bopsERoVj3h8E+y1h+Yvtwbw
	a7seH/eTSZtNVTYfcbVoHVKMkx/VqRRX4x56sLrBr1kyn2p+Z1TKn+a4PAJSRXBimxCs=;
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: <E1rDL1L-000837-GI@xenbits.xenproject.org>
Date: Wed, 13 Dec 2023 08:55:11 +0000

commit 48eb9e91990b3fd42f8e847780f6cdb188245b4a
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Dec 12 14:26:35 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 12 14:26:35 2023 +0100

    xen/sched: fix sched_move_domain()
    
    Do cleanup in sched_move_domain() in a dedicated service function,
    which is called either in error case with newly allocated data, or in
    success case with the old data to be freed.
    
    This will at once fix some subtle bugs which sneaked in due to
    forgetting to overwrite some pointers in the error case.
    
    Fixes: 70fadc41635b ("xen/cpupool: support moving domain between cpupools with different granularity")
    Reported-by: René Winther Højgaard <renewin@proton.me>
    Initial-fix-by: Jan Beulich <jbeulich@suse.com>
    Initial-fix-by: George Dunlap <george.dunlap@cloud.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: George Dunlap <george.dunlap@cloud.com>
    master commit: 23792cc0f22cff4e106d838b83aa9ae1cb6ffaf4
    master date: 2023-12-07 13:37:25 +0000
---
 xen/common/sched/core.c | 47 +++++++++++++++++++++++++++--------------------
 1 file changed, 27 insertions(+), 20 deletions(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index eba0cea4bb..901782bbb4 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -647,6 +647,24 @@ static void sched_move_irqs(const struct sched_unit *unit)
         vcpu_move_irqs(v);
 }
 
+static void sched_move_domain_cleanup(const struct scheduler *ops,
+                                      struct sched_unit *units,
+                                      void *domdata)
+{
+    struct sched_unit *unit, *old_unit;
+
+    for ( unit = units; unit; )
+    {
+        if ( unit->priv )
+            sched_free_udata(ops, unit->priv);
+        old_unit = unit;
+        unit = unit->next_in_list;
+        xfree(old_unit);
+    }
+
+    sched_free_domdata(ops, domdata);
+}
+
 /*
  * Move a domain from one cpupool to another.
  *
@@ -686,7 +704,6 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
     void *old_domdata;
     unsigned int gran = cpupool_get_granularity(c);
     unsigned int n_units = d->vcpu[0] ? DIV_ROUND_UP(d->max_vcpus, gran) : 0;
-    int ret = 0;
 
     for_each_vcpu ( d, v )
     {
@@ -699,8 +716,9 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
     domdata = sched_alloc_domdata(c->sched, d);
     if ( IS_ERR(domdata) )
     {
-        ret = PTR_ERR(domdata);
-        goto out;
+        rcu_read_unlock(&sched_res_rculock);
+
+        return PTR_ERR(domdata);
     }
 
     for ( unit_idx = 0; unit_idx < n_units; unit_idx++ )
@@ -718,10 +736,10 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
 
         if ( !unit || !unit->priv )
         {
-            old_units = new_units;
-            old_domdata = domdata;
-            ret = -ENOMEM;
-            goto out_free;
+            sched_move_domain_cleanup(c->sched, new_units, domdata);
+            rcu_read_unlock(&sched_res_rculock);
+
+            return -ENOMEM;
         }
 
         unit_ptr = &unit->next_in_list;
@@ -808,22 +826,11 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
 
     domain_unpause(d);
 
- out_free:
-    for ( unit = old_units; unit; )
-    {
-        if ( unit->priv )
-            sched_free_udata(c->sched, unit->priv);
-        old_unit = unit;
-        unit = unit->next_in_list;
-        xfree(old_unit);
-    }
-
-    sched_free_domdata(old_ops, old_domdata);
+    sched_move_domain_cleanup(old_ops, old_units, old_domdata);
 
- out:
     rcu_read_unlock(&sched_res_rculock);
 
-    return ret;
+    return 0;
 }
 
 void sched_destroy_vcpu(struct vcpu *v)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Wed Dec 13 08:55:22 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 Dec 2023 08:55:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.653773.1020307 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rDL1W-0003VA-M9; Wed, 13 Dec 2023 08:55:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 653773.1020307; Wed, 13 Dec 2023 08: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 1rDL1W-0003V2-JV; Wed, 13 Dec 2023 08:55:22 +0000
Received: by outflank-mailman (input) for mailman id 653773;
 Wed, 13 Dec 2023 08:55: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 1rDL1V-0003Uq-OV
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 08:55: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 1rDL1V-0004dM-Nk
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 08:55:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDL1V-00083Y-Lb
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 08: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=vczhAZ/O0a+P17KJ9w1VHFBEJEfsilsBbcDfCqPpBLg=; b=YhrAhIJPi5QboqllgwFdCxsoPX
	51wS8nJfrONT41KTclzZR2wldmxTzQ9BU6alHnyYXRXAxCYAcTm6aQPG/LVt7dYZnPP8p0QNx37Bc
	GIZAVZZpVL5wgYH8kJzYScLnEmwlEBCuGsDEZJNUNRp0a9tHZi7pDTOvD9vedhmh3oo8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] xen/arm: page: Avoid pointer overflow on cache clean & invalidate
Message-Id: <E1rDL1V-00083Y-Lb@xenbits.xenproject.org>
Date: Wed, 13 Dec 2023 08:55:21 +0000

commit a4f3f5a62c10a5adc898cf45261783209f5bc037
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Dec 12 14:27:10 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 12 14:27:10 2023 +0100

    xen/arm: page: Avoid pointer overflow on cache clean & invalidate
    
    On Arm32, after cleaning and invalidating the last dcache line of the top
    domheap page i.e. VA = 0xfffff000 (as a result of flushing the page to
    RAM), we end up adding the value of a dcache line size to the pointer
    once again, which results in a pointer arithmetic overflow (with 64B line
    size, operation 0xffffffc0 + 0x40 overflows to 0x0). Such behavior is
    undefined and given the wide range of compiler versions we support, it is
    difficult to determine what could happen in such scenario.
    
    Modify clean_and_invalidate_dcache_va_range() as well as
    clean_dcache_va_range() and invalidate_dcache_va_range() due to similarity
    of handling to prevent pointer arithmetic overflow. Modify the loops to
    use an additional variable to store the index of the next cacheline.
    Add an assert to prevent passing a region that wraps around which is
    illegal and would end up in a page fault anyway (region 0-2MB is
    unmapped). Lastly, return early if size passed is 0.
    
    Note that on Arm64, we don't have this problem given that the max VA
    space we support is 48-bits.
    
    This is XSA-447 / CVE-2023-46837.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    master commit: 190b7f49af6487a9665da63d43adc9d9a5fbd01e
    master date: 2023-12-12 14:01:00 +0100
---
 xen/arch/arm/include/asm/page.h | 35 ++++++++++++++++++++++++++++-------
 1 file changed, 28 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/include/asm/page.h b/xen/arch/arm/include/asm/page.h
index aa0080e8d7..645331fc89 100644
--- a/xen/arch/arm/include/asm/page.h
+++ b/xen/arch/arm/include/asm/page.h
@@ -162,6 +162,13 @@ static inline size_t read_dcache_line_bytes(void)
 static inline int invalidate_dcache_va_range(const void *p, unsigned long size)
 {
     size_t cacheline_mask = dcache_line_bytes - 1;
+    unsigned long idx = 0;
+
+    if ( !size )
+        return 0;
+
+    /* Passing a region that wraps around is illegal */
+    ASSERT(((uintptr_t)p + size - 1) >= (uintptr_t)p);
 
     dsb(sy);           /* So the CPU issues all writes to the range */
 
@@ -174,11 +181,11 @@ static inline int invalidate_dcache_va_range(const void *p, unsigned long size)
     }
 
     for ( ; size >= dcache_line_bytes;
-            p += dcache_line_bytes, size -= dcache_line_bytes )
-        asm volatile (__invalidate_dcache_one(0) : : "r" (p));
+            idx += dcache_line_bytes, size -= dcache_line_bytes )
+        asm volatile (__invalidate_dcache_one(0) : : "r" (p + idx));
 
     if ( size > 0 )
-        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p));
+        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p + idx));
 
     dsb(sy);           /* So we know the flushes happen before continuing */
 
@@ -188,14 +195,21 @@ static inline int invalidate_dcache_va_range(const void *p, unsigned long size)
 static inline int clean_dcache_va_range(const void *p, unsigned long size)
 {
     size_t cacheline_mask = dcache_line_bytes - 1;
+    unsigned long idx = 0;
+
+    if ( !size )
+        return 0;
+
+    /* Passing a region that wraps around is illegal */
+    ASSERT(((uintptr_t)p + size - 1) >= (uintptr_t)p);
 
     dsb(sy);           /* So the CPU issues all writes to the range */
     size += (uintptr_t)p & cacheline_mask;
     size = (size + cacheline_mask) & ~cacheline_mask;
     p = (void *)((uintptr_t)p & ~cacheline_mask);
     for ( ; size >= dcache_line_bytes;
-            p += dcache_line_bytes, size -= dcache_line_bytes )
-        asm volatile (__clean_dcache_one(0) : : "r" (p));
+            idx += dcache_line_bytes, size -= dcache_line_bytes )
+        asm volatile (__clean_dcache_one(0) : : "r" (p + idx));
     dsb(sy);           /* So we know the flushes happen before continuing */
     /* ARM callers assume that dcache_* functions cannot fail. */
     return 0;
@@ -205,14 +219,21 @@ static inline int clean_and_invalidate_dcache_va_range
     (const void *p, unsigned long size)
 {
     size_t cacheline_mask = dcache_line_bytes - 1;
+    unsigned long idx = 0;
+
+    if ( !size )
+        return 0;
+
+    /* Passing a region that wraps around is illegal */
+    ASSERT(((uintptr_t)p + size - 1) >= (uintptr_t)p);
 
     dsb(sy);         /* So the CPU issues all writes to the range */
     size += (uintptr_t)p & cacheline_mask;
     size = (size + cacheline_mask) & ~cacheline_mask;
     p = (void *)((uintptr_t)p & ~cacheline_mask);
     for ( ; size >= dcache_line_bytes;
-            p += dcache_line_bytes, size -= dcache_line_bytes )
-        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p));
+            idx += dcache_line_bytes, size -= dcache_line_bytes )
+        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p + idx));
     dsb(sy);         /* So we know the flushes happen before continuing */
     /* ARM callers assume that dcache_* functions cannot fail. */
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Wed Dec 13 09:55:06 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 Dec 2023 09:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.653811.1020411 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rDLxH-0005mm-DO; Wed, 13 Dec 2023 09:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 653811.1020411; Wed, 13 Dec 2023 09: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 1rDLxH-0005me-Aj; Wed, 13 Dec 2023 09:55:03 +0000
Received: by outflank-mailman (input) for mailman id 653811;
 Wed, 13 Dec 2023 09: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 1rDLxG-0005mY-Rc
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 09: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 1rDLxG-0005tP-Pj
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 09:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDLxG-0002u8-Og
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 09: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=ucoA/KyDD4fIwx9wKstbf5Wy903a0sBVHZYZ93FMZtY=; b=j2QjLcfIJyZAYFbiMMcCUSLe4N
	/CkUAkfr00B3YzvcQ9C/6pkYokXOd6hDuHGYpg2Zuh2CKathBk4zU91HNRKRGWvFehI+sJ+ZBPlJb
	ZjjN0jSGBH3DX+WhV34ARnTYMFI8kpa3gSjyDNNwOhKEthe8JIHP51qH1nZyyiI36oF4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] x86: fix building with Clang
Message-Id: <E1rDLxG-0002u8-Og@xenbits.xenproject.org>
Date: Wed, 13 Dec 2023 09:55:02 +0000

commit 078cba0bc93f48132a66764b36e95740b9e5630d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Dec 13 10:48:41 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 13 10:48:41 2023 +0100

    x86: fix building with Clang
    
    It doesn't understand -fno-reorder-blocks. Whether without that option
    the resulting binary is actually functional I can't tell, though.
    
    For $(cc-option ...) to be usable in arch.mk, at least CC needs setting
    earlier in Config.mk. Move up the entire "Set tools" section.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 Config.mk        | 54 +++++++++++++++++++++++++++---------------------------
 arch/x86/arch.mk |  3 ++-
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/Config.mk b/Config.mk
index bfdf885..f2d1f0a 100644
--- a/Config.mk
+++ b/Config.mk
@@ -86,6 +86,33 @@ TARGET_ARCH_DIR := arch/$(TARGET_ARCH_FAM)
 export TARGET_ARCH_DIR
 export TARGET_ARCH_FAM
 
+# Set tools
+AS         = $(CROSS_COMPILE)as
+LD         = $(CROSS_COMPILE)ld
+ifeq ($(clang),y)
+CC         = $(CROSS_COMPILE)clang
+LD_LTO     = $(CROSS_COMPILE)llvm-ld
+else
+CC         = $(CROSS_COMPILE)gcc
+LD_LTO     = $(CROSS_COMPILE)ld
+endif
+CPP        = $(CC) -E
+AR         = $(CROSS_COMPILE)ar
+RANLIB     = $(CROSS_COMPILE)ranlib
+NM         = $(CROSS_COMPILE)nm
+STRIP      = $(CROSS_COMPILE)strip
+OBJCOPY    = $(CROSS_COMPILE)objcopy
+OBJDUMP    = $(CROSS_COMPILE)objdump
+SIZEUTIL   = $(CROSS_COMPILE)size
+
+# Allow git to be wrappered in the environment
+GIT        ?= git
+
+INSTALL      = install
+INSTALL_DIR  = $(INSTALL) -d -m0755 -p
+INSTALL_DATA = $(INSTALL) -m0644 -p
+INSTALL_PROG = $(INSTALL) -m0755 -p
+
 # This is used for architecture specific links.
 # This can be overwritten from arch specific rules.
 ARCH_LINKS =
@@ -119,33 +146,6 @@ DEF_CPPFLAGS += -isystem $(LWIPDIR)/src/include
 DEF_CPPFLAGS += -isystem $(LWIPDIR)/src/include/ipv4
 endif
 
-# Set tools
-AS         = $(CROSS_COMPILE)as
-LD         = $(CROSS_COMPILE)ld
-ifeq ($(clang),y)
-CC         = $(CROSS_COMPILE)clang
-LD_LTO     = $(CROSS_COMPILE)llvm-ld
-else
-CC         = $(CROSS_COMPILE)gcc
-LD_LTO     = $(CROSS_COMPILE)ld
-endif
-CPP        = $(CC) -E
-AR         = $(CROSS_COMPILE)ar
-RANLIB     = $(CROSS_COMPILE)ranlib
-NM         = $(CROSS_COMPILE)nm
-STRIP      = $(CROSS_COMPILE)strip
-OBJCOPY    = $(CROSS_COMPILE)objcopy
-OBJDUMP    = $(CROSS_COMPILE)objdump
-SIZEUTIL   = $(CROSS_COMPILE)size
-
-# Allow git to be wrappered in the environment
-GIT        ?= git
-
-INSTALL      = install
-INSTALL_DIR  = $(INSTALL) -d -m0755 -p
-INSTALL_DATA = $(INSTALL) -m0644 -p
-INSTALL_PROG = $(INSTALL) -m0755 -p
-
 BOOT_DIR ?= /boot
 
 SOCKET_LIBS =
diff --git a/arch/x86/arch.mk b/arch/x86/arch.mk
index 00028a0..72d03f3 100644
--- a/arch/x86/arch.mk
+++ b/arch/x86/arch.mk
@@ -14,7 +14,8 @@ EXTRA_SRC += arch/$(EXTRA_INC)
 endif
 
 ifeq ($(MINIOS_TARGET_ARCH),x86_64)
-ARCH_CFLAGS := -m64 -mno-red-zone -fno-reorder-blocks
+ARCH_CFLAGS := -m64 -mno-red-zone
+ARCH_CFLAGS += $(call cc-option,$(CC),-fno-reorder-blocks)
 ARCH_CFLAGS += -fno-asynchronous-unwind-tables
 ARCH_ASFLAGS := -m64
 ARCH_LDFLAGS := -m elf_x86_64
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 13 09:55:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 Dec 2023 09:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.653812.1020415 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rDLxR-0005om-F2; Wed, 13 Dec 2023 09:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 653812.1020415; Wed, 13 Dec 2023 09: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 1rDLxR-0005of-CB; Wed, 13 Dec 2023 09:55:13 +0000
Received: by outflank-mailman (input) for mailman id 653812;
 Wed, 13 Dec 2023 09: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 1rDLxQ-0005oZ-Ti
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 09: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 1rDLxQ-0005tX-St
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 09:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDLxQ-0002uw-Rm
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 09: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=tNZTkguMIquHGibQtFCmw/HHs3KyRWwCJSAScxQSaiY=; b=IQssNWoBTmcOXtUjYfqEO46HxR
	0LOmgtNr4GoIAw1y/22jKzJkIwSnhrweyJD7fwm2uBYhcjFcthnPm4oCjvFPhFh0kYtc2EY8909FU
	3juO2faMrZBsp5Dbb0R1SBMzm9uCH9whDJoh6pNrdmYz3ud6IDcrNw53NmF8l8RwKs14=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: use BUG() instead of dereferencing NULL
Message-Id: <E1rDLxQ-0002uw-Rm@xenbits.xenproject.org>
Date: Wed, 13 Dec 2023 09:55:12 +0000

commit 23247d6586110ec3d73cae8a693c0db879a58184
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Dec 13 10:49:06 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 13 10:49:06 2023 +0100

    Mini-OS: use BUG() instead of dereferencing NULL
    
    There are some places using a dereference of NULL to cause a crash.
    
    Use BUG() instead.
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 lib/xmalloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/xmalloc.c b/lib/xmalloc.c
index cc5db11..2aa0713 100644
--- a/lib/xmalloc.c
+++ b/lib/xmalloc.c
@@ -219,7 +219,7 @@ void xfree(const void *p)
     if(((long)p & PAGE_MASK) != ((long)hdr & PAGE_MASK))
     {
         printk("Header should be on the same page\n");
-        *(int*)0=0;
+        BUG();
     }
 
     /* Merge with other free block, or put in list. */
@@ -255,7 +255,7 @@ void xfree(const void *p)
         if((((unsigned long)hdr) & (PAGE_SIZE-1)) != 0)
         {
             printk("Bug\n");
-            *(int*)0=0;
+            BUG();
         }
         free_page(hdr);
     }
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 13 09:55:24 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 Dec 2023 09:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.653813.1020419 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rDLxc-0005rk-IE; Wed, 13 Dec 2023 09:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 653813.1020419; Wed, 13 Dec 2023 09: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 1rDLxc-0005rc-FX; Wed, 13 Dec 2023 09:55:24 +0000
Received: by outflank-mailman (input) for mailman id 653813;
 Wed, 13 Dec 2023 09:55:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDLxb-0005rO-2I
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 09:55:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDLxb-0005tu-1X
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 09:55:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDLxa-0002vd-V4
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 09: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=L614ygUgkZn/2zjGxb6K5DNfU+5A12+cnynaCp2w1AA=; b=5MKnxmAw1RA8c7qUtXdunDE1v2
	J/OroIDSErHCTlft43iF7y/Mx/5hEHw4ZsZKuAXh0uw3bPx4poe/V8s9Hy8I0JR7SFoBdWDnr8P7a
	U1pnDRzwkI1chGsPEclty3QL/oEDfKer08r4hUWfBoV0AF+HUXyQHKDx1vTjsSsM6tSo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: call event handlers always with interrupts off
Message-Id: <E1rDLxa-0002vd-V4@xenbits.xenproject.org>
Date: Wed, 13 Dec 2023 09:55:22 +0000

commit fbf15891cc38eb493c81b02964ba8c48f7ff6f63
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Dec 13 10:49:40 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 13 10:49:40 2023 +0100

    Mini-OS: call event handlers always with interrupts off
    
    When unmasking an event channel the associated event handler can be
    called with interrupts enabled when not running as a PV guest.
    
    This can result in hard to debug races in case e.g. a handler is
    registered for multiple events or when the handler is not using a lock
    as it assumes to have interrupts disabled.
    
    Instead of using the PV interrupt disabling points just before calling
    the handler, do the disabling once at the very start of
    force_evtchn_callback().
    
    Replace the evtchn_upcall_mask test in unmask_evtchn() with the more
    appropriate irqs_disabled() test.
    
    As a precaution add a test to do_hypervisor_callback() that interrupts
    are really disabled and crash in case this is not true.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 hypervisor.c | 26 +++++++++-----------------
 1 file changed, 9 insertions(+), 17 deletions(-)

diff --git a/hypervisor.c b/hypervisor.c
index f2cbbc1..5309daa 100644
--- a/hypervisor.c
+++ b/hypervisor.c
@@ -102,6 +102,8 @@ void do_hypervisor_callback(struct pt_regs *regs)
     shared_info_t *s = HYPERVISOR_shared_info;
     vcpu_info_t   *vcpu_info = &s->vcpu_info[cpu];
 
+    BUG_ON(!irqs_disabled());
+
     in_callback = 1;
    
     vcpu_info->evtchn_upcall_pending = 0;
@@ -131,27 +133,19 @@ void do_hypervisor_callback(struct pt_regs *regs)
 
 void force_evtchn_callback(void)
 {
-#ifdef XEN_HAVE_PV_UPCALL_MASK
-    int save;
-#endif
     vcpu_info_t *vcpu;
+    unsigned long flags;
+
+    local_irq_save(flags);
+
     vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];
-#ifdef XEN_HAVE_PV_UPCALL_MASK
-    save = vcpu->evtchn_upcall_mask;
-#endif
 
     while (vcpu->evtchn_upcall_pending) {
-#ifdef XEN_HAVE_PV_UPCALL_MASK
-        vcpu->evtchn_upcall_mask = 1;
-#endif
-        barrier();
         do_hypervisor_callback(NULL);
         barrier();
-#ifdef XEN_HAVE_PV_UPCALL_MASK
-        vcpu->evtchn_upcall_mask = save;
-        barrier();
-#endif
     };
+
+    local_irq_restore(flags);
 }
 
 inline void mask_evtchn(uint32_t port)
@@ -177,9 +171,7 @@ inline void unmask_evtchn(uint32_t port)
               &vcpu_info->evtchn_pending_sel) )
     {
         vcpu_info->evtchn_upcall_pending = 1;
-#ifdef XEN_HAVE_PV_UPCALL_MASK
-        if ( !vcpu_info->evtchn_upcall_mask )
-#endif
+        if ( !irqs_disabled() )
             force_evtchn_callback();
     }
 }
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 13 09:55:34 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 Dec 2023 09:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.653814.1020423 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rDLxm-0005ug-JZ; Wed, 13 Dec 2023 09:55:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 653814.1020423; Wed, 13 Dec 2023 09: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 1rDLxm-0005uY-Gy; Wed, 13 Dec 2023 09:55:34 +0000
Received: by outflank-mailman (input) for mailman id 653814;
 Wed, 13 Dec 2023 09:55:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDLxl-0005uQ-79
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 09:55: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 1rDLxl-0005u2-6F
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 09:55:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDLxl-0002w4-3X
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 09:55: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=M+OnQa990nit+FINEOwBMz7IAjdSPOkY6lNaJ9W00Ls=; b=tfSusMZp0PnsShbI0n4xPkT3zw
	snY8JZTfMAK6y4nJGUF31GUsyr5S8P5yyJX7GrQwyxBwx4uYAndR0+iPDtK9i45eRIbHGJcOyuKM7
	qAKtEtVsrlgsqpJSQiKoOaHYSaK6xJjBfe1PIxYr6f+BeYo90lc7t0F/toKJHaQSXiO4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: drop in_callback variable
Message-Id: <E1rDLxl-0002w4-3X@xenbits.xenproject.org>
Date: Wed, 13 Dec 2023 09:55:33 +0000

commit 3c637a6af245cb2802cd8ec92c918b48cd391fd3
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Dec 13 10:49:54 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 13 10:49:54 2023 +0100

    Mini-OS: drop in_callback variable
    
    Now that do_hypervisor_callback() is always called with interrupts off
    the in_callback variable meant to handle recursive calls of
    do_hypervisor_callback() can be dropped.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 hypervisor.c         |  6 ------
 include/hypervisor.h |  2 --
 sched.c              | 11 -----------
 3 files changed, 19 deletions(-)

diff --git a/hypervisor.c b/hypervisor.c
index 5309daa..6facce3 100644
--- a/hypervisor.c
+++ b/hypervisor.c
@@ -37,8 +37,6 @@ EXPORT_SYMBOL(hypercall_page);
     ((sh)->evtchn_pending[idx] &                \
      ~(sh)->evtchn_mask[idx])
 
-int in_callback;
-
 #ifndef CONFIG_PARAVIRT
 extern shared_info_t shared_info;
 
@@ -104,8 +102,6 @@ void do_hypervisor_callback(struct pt_regs *regs)
 
     BUG_ON(!irqs_disabled());
 
-    in_callback = 1;
-   
     vcpu_info->evtchn_upcall_pending = 0;
     /* NB x86. No need for a barrier here -- XCHG is a barrier on x86. */
 #if !defined(__i386__) && !defined(__x86_64__)
@@ -127,8 +123,6 @@ void do_hypervisor_callback(struct pt_regs *regs)
             do_event(port, regs);
         }
     }
-
-    in_callback = 0;
 }
 
 void force_evtchn_callback(void)
diff --git a/include/hypervisor.h b/include/hypervisor.h
index 1d09271..b852a42 100644
--- a/include/hypervisor.h
+++ b/include/hypervisor.h
@@ -50,6 +50,4 @@ void mask_evtchn(uint32_t port);
 void unmask_evtchn(uint32_t port);
 void clear_evtchn(uint32_t port);
 
-extern int in_callback;
-
 #endif /* __HYPERVISOR_H__ */
diff --git a/sched.c b/sched.c
index e162cb6..3335efa 100644
--- a/sched.c
+++ b/sched.c
@@ -76,11 +76,6 @@ void schedule(void)
     prev = current;
     local_irq_save(flags); 
 
-    if (in_callback) {
-        printk("Must not call schedule() from a callback\n");
-        BUG();
-    }
-
     do {
         /* Examine all threads.
            Find a runnable thread, but also wake up expired ones and find the
@@ -151,15 +146,12 @@ struct thread* create_thread(char *name, void (*function)(void *), void *data)
 EXPORT_SYMBOL(create_thread);
 
 #ifdef HAVE_LIBC
-static struct _reent callback_reent;
 struct _reent *__getreent(void)
 {
     struct _reent *_reent;
 
     if (!threads_started)
         _reent = _impure_ptr;
-    else if (in_callback)
-        _reent = &callback_reent;
     else
         _reent = &get_current()->reent;
 
@@ -246,9 +238,6 @@ void init_sched(void)
 {
     printk("Initialising scheduler\n");
 
-#ifdef HAVE_LIBC
-    _REENT_INIT_PTR((&callback_reent))
-#endif
     idle_thread = create_thread("Idle", idle_thread_fn, NULL);
 }
 
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 13 09:55:44 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 Dec 2023 09:55:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.653815.1020426 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rDLxw-0005xl-Ko; Wed, 13 Dec 2023 09:55:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 653815.1020426; Wed, 13 Dec 2023 09: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 1rDLxw-0005xe-IP; Wed, 13 Dec 2023 09:55:44 +0000
Received: by outflank-mailman (input) for mailman id 653815;
 Wed, 13 Dec 2023 09: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 1rDLxv-0005xT-C5
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 09:55:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDLxv-0005u9-AF
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 09:55:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDLxv-0002wT-8B
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 09:55:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HYOHjgDRjEREXdaTxTOcBmIyDAM0L6c0AeeCLGWKeMk=; b=6lMSvBbdDrJsfivbW4OXglguuF
	nVdiuobNFJsRzQkupW6jqBLgBJ2/ujvDtFjql2gJv7Ftfv2ZCHpvl+475I6Hf3wzflRDcpmbqUKpv
	XoKJQNw1NgisGMsFYhBMz79PZEtRYdbXcNZVWEQ9+cAGQ2r4w6T6G2zQXFXWKIaGqVPc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] Mini-OS: cleanup hypervisor.c
Message-Id: <E1rDLxv-0002wT-8B@xenbits.xenproject.org>
Date: Wed, 13 Dec 2023 09:55:43 +0000

commit 79839db5e40b4fa56ebbc8f6d17049d4aaf32a8d
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Dec 13 10:50:17 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 13 10:50:17 2023 +0100

    Mini-OS: cleanup hypervisor.c
    
    Do the following cleanups in hypervisor.c:
    
    - Let hypervisor.c conform to the coding style.
    - Drop the bogus "inline" attributes of exported functions.
    - Replace a always zero cpu variable with smp_processor_id() as
      elsewhere in the code.
    - Replace "if () BUG()" with BUG_ON() in case the condition has no
      side effects.
    - Drop the unused cpu parameter from the active_evtchns() macro.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 hypervisor.c | 62 ++++++++++++++++++++++++++++++------------------------------
 1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/hypervisor.c b/hypervisor.c
index 6facce3..ba53555 100644
--- a/hypervisor.c
+++ b/hypervisor.c
@@ -1,27 +1,27 @@
 /******************************************************************************
  * hypervisor.c
- * 
+ *
  * Communication to/from hypervisor.
- * 
+ *
  * Copyright (c) 2002-2003, K A Fraser
  * Copyright (c) 2005, Grzegorz Milos, gm281@cam.ac.uk,Intel Research Cambridge
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
  * deal in the Software without restriction, including without limitation the
  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  * sell copies of the Software, and to permit persons to whom the Software is
  * furnished to do so, subject to the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
 
@@ -33,9 +33,8 @@
 
 EXPORT_SYMBOL(hypercall_page);
 
-#define active_evtchns(cpu,sh,idx)              \
-    ((sh)->evtchn_pending[idx] &                \
-     ~(sh)->evtchn_mask[idx])
+#define active_evtchns(sh, idx)                           \
+    ((sh)->evtchn_pending[idx] & ~(sh)->evtchn_mask[idx])
 
 #ifndef CONFIG_PARAVIRT
 extern shared_info_t shared_info;
@@ -48,10 +47,10 @@ int hvm_get_parameter(int idx, uint64_t *value)
     xhv.domid = DOMID_SELF;
     xhv.index = idx;
     ret = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv);
-    if ( ret < 0 )
-        BUG();
+    BUG_ON(ret < 0);
 
     *value = xhv.value;
+
     return ret;
 }
 
@@ -62,6 +61,7 @@ int hvm_set_parameter(int idx, uint64_t value)
     xhv.domid = DOMID_SELF;
     xhv.index = idx;
     xhv.value = value;
+
     return HYPERVISOR_hvm_op(HVMOP_set_param, &xhv);
 }
 
@@ -87,18 +87,15 @@ void unmap_shared_info(void)
     xrtp.gpfn = virt_to_pfn(&shared_info);
     if ( HYPERVISOR_memory_op(XENMEM_remove_from_physmap, &xrtp) != 0 )
         BUG();
-
-    return;
 }
 #endif
 
 void do_hypervisor_callback(struct pt_regs *regs)
 {
-    unsigned long  l1, l2, l1i, l2i;
-    unsigned int   port;
-    int            cpu = 0;
+    unsigned long l1, l2, l1i, l2i;
+    unsigned int port;
     shared_info_t *s = HYPERVISOR_shared_info;
-    vcpu_info_t   *vcpu_info = &s->vcpu_info[cpu];
+    vcpu_info_t *vcpu_info = &s->vcpu_info[smp_processor_id()];
 
     BUG_ON(!irqs_disabled());
 
@@ -113,13 +110,13 @@ void do_hypervisor_callback(struct pt_regs *regs)
     {
         l1i = __ffs(l1);
         l1 &= ~(1UL << l1i);
-        
-        while ( (l2 = active_evtchns(cpu, s, l1i)) != 0 )
+
+        while ( (l2 = active_evtchns(s, l1i)) != 0 )
         {
             l2i = __ffs(l2);
             l2 &= ~(1UL << l2i);
 
-            port = (l1i * (sizeof(unsigned long) * 8)) + l2i;
+            port = l1i * sizeof(unsigned long) * 8 + l2i;
             do_event(port, regs);
         }
     }
@@ -134,7 +131,8 @@ void force_evtchn_callback(void)
 
     vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];
 
-    while (vcpu->evtchn_upcall_pending) {
+    while ( vcpu->evtchn_upcall_pending )
+    {
         do_hypervisor_callback(NULL);
         barrier();
     };
@@ -142,14 +140,15 @@ void force_evtchn_callback(void)
     local_irq_restore(flags);
 }
 
-inline void mask_evtchn(uint32_t port)
+void mask_evtchn(uint32_t port)
 {
     shared_info_t *s = HYPERVISOR_shared_info;
+
     synch_set_bit(port, &s->evtchn_mask[0]);
 }
 EXPORT_SYMBOL(mask_evtchn);
 
-inline void unmask_evtchn(uint32_t port)
+void unmask_evtchn(uint32_t port)
 {
     shared_info_t *s = HYPERVISOR_shared_info;
     vcpu_info_t *vcpu_info = &s->vcpu_info[smp_processor_id()];
@@ -160,9 +159,9 @@ inline void unmask_evtchn(uint32_t port)
      * The following is basically the equivalent of 'hw_resend_irq'. Just like
      * a real IO-APIC we 'lose the interrupt edge' if the channel is masked.
      */
-    if (  synch_test_bit        (port,    &s->evtchn_pending[0]) && 
+    if ( synch_test_bit(port, &s->evtchn_pending[0]) &&
          !synch_test_and_set_bit(port / (sizeof(unsigned long) * 8),
-              &vcpu_info->evtchn_pending_sel) )
+                                 &vcpu_info->evtchn_pending_sel) )
     {
         vcpu_info->evtchn_upcall_pending = 1;
         if ( !irqs_disabled() )
@@ -171,9 +170,10 @@ inline void unmask_evtchn(uint32_t port)
 }
 EXPORT_SYMBOL(unmask_evtchn);
 
-inline void clear_evtchn(uint32_t port)
+void clear_evtchn(uint32_t port)
 {
     shared_info_t *s = HYPERVISOR_shared_info;
+
     synch_clear_bit(port, &s->evtchn_pending[0]);
 }
 EXPORT_SYMBOL(clear_evtchn);
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 13 10:22:03 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 Dec 2023 10:22:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.653834.1020471 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rDMNN-000678-LH; Wed, 13 Dec 2023 10:22:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 653834.1020471; Wed, 13 Dec 2023 10:22:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rDMNN-000671-Il; Wed, 13 Dec 2023 10:22:01 +0000
Received: by outflank-mailman (input) for mailman id 653834;
 Wed, 13 Dec 2023 10:22:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDMNN-00066v-BU
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 10:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDMNN-0006Tg-Ag
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 10:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDMNN-0004J7-9X
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 10:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Fl8zm/vfOVblmrtTXbU2+Pn9caWtqLCKD7Bj09YA+DU=; b=u8UUT5q1fGBtEtTjCqMV31Z9dX
	lkz5JgdVz5EySGmBXcvMQQ7SzoX2S+IiqUU3j1L/Lngc0fgRiE1PceFp66l/NrRDrsCa9kKGUNGJY
	oBD1AyuEk4mkz3vEPHmYuay955qyLnUI4ZIPHFxsuo25rT1Px9HidllcAYpY6sYrSyK8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.15] xen/arm: page: Avoid pointer overflow on cache clean & invalidate
Message-Id: <E1rDMNN-0004J7-9X@xenbits.xenproject.org>
Date: Wed, 13 Dec 2023 10:22:01 +0000

commit 6400013f07e5c7fec9f68821755aed94683b663c
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Dec 12 14:53:51 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 12 14:53:51 2023 +0100

    xen/arm: page: Avoid pointer overflow on cache clean & invalidate
    
    On Arm32, after cleaning and invalidating the last dcache line of the top
    domheap page i.e. VA = 0xfffff000 (as a result of flushing the page to
    RAM), we end up adding the value of a dcache line size to the pointer
    once again, which results in a pointer arithmetic overflow (with 64B line
    size, operation 0xffffffc0 + 0x40 overflows to 0x0). Such behavior is
    undefined and given the wide range of compiler versions we support, it is
    difficult to determine what could happen in such scenario.
    
    Modify clean_and_invalidate_dcache_va_range() as well as
    clean_dcache_va_range() and invalidate_dcache_va_range() due to similarity
    of handling to prevent pointer arithmetic overflow. Modify the loops to
    use an additional variable to store the index of the next cacheline.
    Add an assert to prevent passing a region that wraps around which is
    illegal and would end up in a page fault anyway (region 0-2MB is
    unmapped). Lastly, return early if size passed is 0.
    
    Note that on Arm64, we don't have this problem given that the max VA
    space we support is 48-bits.
    
    This is XSA-447 / CVE-2023-46837.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    master commit: 190b7f49af6487a9665da63d43adc9d9a5fbd01e
    master date: 2023-12-12 14:01:00 +0100
---
 xen/include/asm-arm/page.h | 35 ++++++++++++++++++++++++++++-------
 1 file changed, 28 insertions(+), 7 deletions(-)

diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index 05e347f8d1..628589c318 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -153,6 +153,13 @@ static inline size_t read_dcache_line_bytes(void)
 static inline int invalidate_dcache_va_range(const void *p, unsigned long size)
 {
     size_t cacheline_mask = dcache_line_bytes - 1;
+    unsigned long idx = 0;
+
+    if ( !size )
+        return 0;
+
+    /* Passing a region that wraps around is illegal */
+    ASSERT(((uintptr_t)p + size - 1) >= (uintptr_t)p);
 
     dsb(sy);           /* So the CPU issues all writes to the range */
 
@@ -165,11 +172,11 @@ static inline int invalidate_dcache_va_range(const void *p, unsigned long size)
     }
 
     for ( ; size >= dcache_line_bytes;
-            p += dcache_line_bytes, size -= dcache_line_bytes )
-        asm volatile (__invalidate_dcache_one(0) : : "r" (p));
+            idx += dcache_line_bytes, size -= dcache_line_bytes )
+        asm volatile (__invalidate_dcache_one(0) : : "r" (p + idx));
 
     if ( size > 0 )
-        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p));
+        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p + idx));
 
     dsb(sy);           /* So we know the flushes happen before continuing */
 
@@ -179,14 +186,21 @@ static inline int invalidate_dcache_va_range(const void *p, unsigned long size)
 static inline int clean_dcache_va_range(const void *p, unsigned long size)
 {
     size_t cacheline_mask = dcache_line_bytes - 1;
+    unsigned long idx = 0;
+
+    if ( !size )
+        return 0;
+
+    /* Passing a region that wraps around is illegal */
+    ASSERT(((uintptr_t)p + size - 1) >= (uintptr_t)p);
 
     dsb(sy);           /* So the CPU issues all writes to the range */
     size += (uintptr_t)p & cacheline_mask;
     size = (size + cacheline_mask) & ~cacheline_mask;
     p = (void *)((uintptr_t)p & ~cacheline_mask);
     for ( ; size >= dcache_line_bytes;
-            p += dcache_line_bytes, size -= dcache_line_bytes )
-        asm volatile (__clean_dcache_one(0) : : "r" (p));
+            idx += dcache_line_bytes, size -= dcache_line_bytes )
+        asm volatile (__clean_dcache_one(0) : : "r" (p + idx));
     dsb(sy);           /* So we know the flushes happen before continuing */
     /* ARM callers assume that dcache_* functions cannot fail. */
     return 0;
@@ -196,14 +210,21 @@ static inline int clean_and_invalidate_dcache_va_range
     (const void *p, unsigned long size)
 {
     size_t cacheline_mask = dcache_line_bytes - 1;
+    unsigned long idx = 0;
+
+    if ( !size )
+        return 0;
+
+    /* Passing a region that wraps around is illegal */
+    ASSERT(((uintptr_t)p + size - 1) >= (uintptr_t)p);
 
     dsb(sy);         /* So the CPU issues all writes to the range */
     size += (uintptr_t)p & cacheline_mask;
     size = (size + cacheline_mask) & ~cacheline_mask;
     p = (void *)((uintptr_t)p & ~cacheline_mask);
     for ( ; size >= dcache_line_bytes;
-            p += dcache_line_bytes, size -= dcache_line_bytes )
-        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p));
+            idx += dcache_line_bytes, size -= dcache_line_bytes )
+        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p + idx));
     dsb(sy);         /* So we know the flushes happen before continuing */
     /* ARM callers assume that dcache_* functions cannot fail. */
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15


From xen-changelog-bounces@lists.xenproject.org Wed Dec 13 14:44:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 Dec 2023 14:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654069.1020698 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rDQT7-0000M4-Tp; Wed, 13 Dec 2023 14:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654069.1020698; Wed, 13 Dec 2023 14: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 1rDQT7-0000Lw-RG; Wed, 13 Dec 2023 14:44:13 +0000
Received: by outflank-mailman (input) for mailman id 654069;
 Wed, 13 Dec 2023 14: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 1rDQT6-0000Lq-Dl
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 14: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 1rDQT6-0002io-Cx
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 14:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDQT6-00011s-AC
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 14: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=BvYjTxzVl/90TLb35X0bq3hVb5i+ph7YEk1EN0Ea9jA=; b=NLz3CbQVwRqWDdKFzSxCU+pAMg
	XPAhnjXcphvlkBlcOU821I8AJfv+znSyKHFnxjtXMQGmEQ9vgJFoiRa4OKM+tjbRg179ETEibhdWd
	Aj27oMSmDo/zMIm3NLbzjGKZ87qrF+49yoJANbwBpgeeis+53tjAp2RhA1GV8B/mrkr4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] Only compile the hypervisor with -Wdeclaration-after-statement
Message-Id: <E1rDQT6-00011s-AC@xenbits.xenproject.org>
Date: Wed, 13 Dec 2023 14:44:12 +0000

commit 4000522008711b1329a7cbb24612dfc355f3e46c
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Tue Dec 12 14:49:55 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 12 14:49:55 2023 +0100

    Only compile the hypervisor with -Wdeclaration-after-statement
    
    Right now, all tools and hypervisor will be complied with the option
    -Wdeclaration-after-statement. While most of the code in the hypervisor
    is controlled by us, for tools we may import external libraries.
    
    The build will fail if one of them are using the construct we are
    trying to prevent. This is the case when building against Python 3.12
    and Yocto:
    
    | In file included from /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/Python.h:44,
    |                  from xen/lowlevel/xc/xc.c:8:
    | /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/object.h: In function 'Py_SIZE':
    | /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/object.h:233:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
    |   233 |     PyVarObject *var_ob = _PyVarObject_CAST(ob);
    |       |     ^~~~~~~~~~~
    | In file included from /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/Python.h:53:
    | /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/cpython/longintrepr.h: In function '_PyLong_CompactValue':
    | /srv/storage/alex/yocto/build-virt/tmp/work/core2-64-poky-linux/xen-tools/4.17+stable/recipe-sysroot/usr/include/python3.12/cpython/longintrepr.h:121:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
    |   121 |     Py_ssize_t sign = 1 - (op->long_value.lv_tag & _PyLong_SIGN_MASK);
    |       |     ^~~~~~~~~~
    | cc1: all warnings being treated as errors
    
    Looking at the tools directory, a fair few directory already add
    -Wno-declaration-after-statement to inhibit the default behavior.
    
    We have always build the hypervisor with the flag, so for now remove
    only the flag for anything but the hypervisor. We can decide at later
    time whether we want to relax.
    
    Also remove the -Wno-declaration-after-statement in some subdirectory
    as the flag is now unnecessary.
    
    Part of the commit message was take from Alexander's first proposal:
    
    Link: https://lore.kernel.org/xen-devel/20231128174729.3880113-1-alex@linutronix.de/
    Reported-by: Alexander Kanavin <alex@linutronix.de>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    
    xen/hypervisor: Don't use cc-option-add for -Wdeclaration-after-statement
    
    Per Andrew's comment in [1] all the compilers we support should
    recognize the flag.
    
    I forgot to address the comment while committing.
    
    [1] fcf00090-304a-49f7-8a61-a54347e90a3b@citrix.com
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    master commit: 40be6307ec005539635e7b8fcef67e989dc441f6
    master date: 2023-12-06 19:12:40 +0000
    master commit: d4bfd3899886d0fbe259c20660dadb1e00170f2d
    master date: 2023-12-06 19:19:59 +0000
---
 Config.mk                   | 2 --
 stubdom/Makefile            | 2 +-
 stubdom/vtpmmgr/Makefile    | 2 +-
 tools/libs/light/Makefile   | 3 +--
 tools/libs/util/Makefile    | 3 +--
 tools/tests/depriv/Makefile | 2 --
 tools/xl/Makefile           | 3 +--
 xen/Makefile                | 1 +
 8 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/Config.mk b/Config.mk
index 4864033c73..8adce1b21a 100644
--- a/Config.mk
+++ b/Config.mk
@@ -177,8 +177,6 @@ CFLAGS += -std=gnu99
 
 CFLAGS += -Wall -Wstrict-prototypes
 
-$(call cc-option-add,HOSTCFLAGS,HOSTCC,-Wdeclaration-after-statement)
-$(call cc-option-add,CFLAGS,CC,-Wdeclaration-after-statement)
 $(call cc-option-add,CFLAGS,CC,-Wno-unused-but-set-variable)
 $(call cc-option-add,CFLAGS,CC,-Wno-unused-local-typedefs)
 
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 8db60d4ee0..92d35125da 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -243,7 +243,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	patch -d $@ -p1 < vtpm-command-duration.patch
 	patch -d $@ -p1 < vtpm-tpm_bn_t-addr.patch
 	mkdir $@/build
-	cd $@/build; CC=${CC} $(CMAKE) .. -DCMAKE_C_FLAGS:STRING="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
+	cd $@/build; CC=${CC} $(CMAKE) .. -DCMAKE_C_FLAGS:STRING="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS)"
 	touch $@
 
 TPMEMU_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm.a
diff --git a/stubdom/vtpmmgr/Makefile b/stubdom/vtpmmgr/Makefile
index 6dae034a07..c29bb49838 100644
--- a/stubdom/vtpmmgr/Makefile
+++ b/stubdom/vtpmmgr/Makefile
@@ -17,7 +17,7 @@ OBJS += vtpm_disk.o disk_tpm.o disk_io.o disk_crypto.o disk_read.o disk_write.o
 OBJS += mgmt_authority.o
 
 CFLAGS+=-Werror -Iutil -Icrypto -Itcs
-CFLAGS+=-Wno-declaration-after-statement -Wno-unused-label
+CFLAGS+=-Wno-unused-label
 
 build: $(TARGET)
 $(TARGET): $(OBJS)
diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index c8eeef12ab..afb779dd05 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -38,8 +38,7 @@ vpath static_tables.c $(ACPI_PATH)/
 
 OBJS-$(CONFIG_X86) += $(ACPI_OBJS)
 
-CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
-	-Wno-declaration-after-statement -Wformat-nonliteral
+CFLAGS += -Wno-format-zero-length -Wmissing-declarations -Wformat-nonliteral
 
 CFLAGS-$(CONFIG_X86) += -DCONFIG_PCI_SUPP_LEGACY_IRQ
 
diff --git a/tools/libs/util/Makefile b/tools/libs/util/Makefile
index fee4ea0dc7..016e18e657 100644
--- a/tools/libs/util/Makefile
+++ b/tools/libs/util/Makefile
@@ -9,8 +9,7 @@ OBJS-y += libxlu_disk.o
 OBJS-y += libxlu_vif.o
 OBJS-y += libxlu_pci.o
 
-CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
-	-Wno-declaration-after-statement -Wformat-nonliteral
+CFLAGS += -Wno-format-zero-length -Wmissing-declarations -Wformat-nonliteral
 CFLAGS += $(CFLAGS_libxenctrl)
 
 CFLAGS += $(PTHREAD_CFLAGS)
diff --git a/tools/tests/depriv/Makefile b/tools/tests/depriv/Makefile
index 7d9e3b01bb..5404a12f47 100644
--- a/tools/tests/depriv/Makefile
+++ b/tools/tests/depriv/Makefile
@@ -1,8 +1,6 @@
 XEN_ROOT=$(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += -Wno-declaration-after-statement
-
 CFLAGS += $(CFLAGS_xeninclude)
 CFLAGS += $(CFLAGS_libxenctrl)
 CFLAGS += $(CFLAGS_libxencall)
diff --git a/tools/xl/Makefile b/tools/xl/Makefile
index 5f7aa5f46c..d742e96a5b 100644
--- a/tools/xl/Makefile
+++ b/tools/xl/Makefile
@@ -5,8 +5,7 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
-	-Wno-declaration-after-statement -Wformat-nonliteral
+CFLAGS += -Wno-format-zero-length -Wmissing-declarations -Wformat-nonliteral
 CFLAGS += -fPIC
 
 CFLAGS += $(PTHREAD_CFLAGS)
diff --git a/xen/Makefile b/xen/Makefile
index 455916c757..93aca9350f 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -392,6 +392,7 @@ CFLAGS-$(CONFIG_CC_SPLIT_SECTIONS) += -ffunction-sections -fdata-sections
 
 CFLAGS += -nostdinc -fno-builtin -fno-common
 CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
+CFLAGS += -Wdeclaration-after-statement
 $(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#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Dec 13 14:44:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 Dec 2023 14:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654068.1020695 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rDQSx-0000KV-Sc; Wed, 13 Dec 2023 14:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654068.1020695; Wed, 13 Dec 2023 14: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 1rDQSx-0000KN-Pi; Wed, 13 Dec 2023 14:44:03 +0000
Received: by outflank-mailman (input) for mailman id 654068;
 Wed, 13 Dec 2023 14: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 1rDQSw-0000KH-Ad
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 14: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 1rDQSw-0002ij-7u
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 14:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDQSw-00011F-4t
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 14: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=IjQIj9PgYbT3YC1TBtiF2e83eDW2yRO3BiYaJbnJIKg=; b=rdquQ8fZxkF9ypCjsrSEn6xvyc
	f9V0slSpPYYYMECPqGcBSVt9VS7e0vRUnbRCFeuXsz8DgTgnKRWL88VDLOu4Ok8MJPOWL+qeZeBcE
	qWdNB8x9jHM2OaFE1tpqZ1GbT2KdnxkPVvGtVe4Lv5icapCrmbOLoxxrRlz+ZsjSbPJQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/x2apic: introduce a mixed physical/cluster mode
Message-Id: <E1rDQSw-00011F-4t@xenbits.xenproject.org>
Date: Wed, 13 Dec 2023 14:44:02 +0000

commit 83ae677d2a11be30920393ef9507cacfe3f1ca8d
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Dec 12 14:47:02 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 12 14:47:02 2023 +0100

    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>
    master commit: e3c409d59ac87ccdf97b8c7708c81efa8069cb31
    master date: 2023-11-07 09:59:48 +0000
---
 CHANGELOG.md                      |  2 +
 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, 118 insertions(+), 35 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3da238d5b9..40bbe1d94f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 ### Added
  - On x86, support for enforcing system-wide operation in Data Operand
    Independent Timing Mode.
+ - On x86, introduce a new x2APIC driver that uses Cluster Logical addressing
+   mode for IPIs and Physical addressing mode for external interrupts.
 
 ## [4.17.0](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.17.0) - 2022-12-12
 
diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 038ac7398c..05f613c71c 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2758,6 +2758,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>`
 
@@ -2768,6 +2777,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 ab47cc23ac..471cfd8a80 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 33103d3e91..e43b779036 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -244,11 +244,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 15a62f874b..c64038adaa 100644
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -191,6 +191,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)
 {
@@ -231,38 +261,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,
@@ -271,7 +319,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#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Dec 13 14:44:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 Dec 2023 14:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654070.1020702 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rDQTH-0000Oz-VA; Wed, 13 Dec 2023 14:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654070.1020702; Wed, 13 Dec 2023 14: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 1rDQTH-0000Os-Sk; Wed, 13 Dec 2023 14:44:23 +0000
Received: by outflank-mailman (input) for mailman id 654070;
 Wed, 13 Dec 2023 14: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 1rDQTG-0000Oi-JC
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 14: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 1rDQTG-0002jK-GA
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 14:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDQTG-00012N-FB
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 14: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=MSsCgUN7RWLJkE/wMc5nyQ4TkzpZt0JV3nTOkVPXUZk=; b=FkYc11qrLm22FjnYQ45tD6QNL4
	7mEx3SomqEiX9VnHM9U2NF5TD9UGLGTIMnppXH98OPQVyNeJODz/0dgSiekA4x4pi4vjwMzm6aj2h
	HtgFidg8LvadAZGOM9kBrBhcaigOHtLrdbFDqHuvO1vCnFXGhnKb6giqGbh8Vlvm1GKk=;
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: <E1rDQTG-00012N-FB@xenbits.xenproject.org>
Date: Wed, 13 Dec 2023 14:44:22 +0000

commit e2caee491ac74ff1360b149cbabdd8b2e9bf2a30
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Dec 12 14:50:10 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 12 14:50:10 2023 +0100

    xen/sched: fix sched_move_domain()
    
    Do cleanup in sched_move_domain() in a dedicated service function,
    which is called either in error case with newly allocated data, or in
    success case with the old data to be freed.
    
    This will at once fix some subtle bugs which sneaked in due to
    forgetting to overwrite some pointers in the error case.
    
    Fixes: 70fadc41635b ("xen/cpupool: support moving domain between cpupools with different granularity")
    Reported-by: René Winther Højgaard <renewin@proton.me>
    Initial-fix-by: Jan Beulich <jbeulich@suse.com>
    Initial-fix-by: George Dunlap <george.dunlap@cloud.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: George Dunlap <george.dunlap@cloud.com>
    master commit: 23792cc0f22cff4e106d838b83aa9ae1cb6ffaf4
    master date: 2023-12-07 13:37:25 +0000
---
 xen/common/sched/core.c | 47 +++++++++++++++++++++++++++--------------------
 1 file changed, 27 insertions(+), 20 deletions(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 4bba16d315..078beb1adb 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -647,6 +647,24 @@ static void sched_move_irqs(const struct sched_unit *unit)
         vcpu_move_irqs(v);
 }
 
+static void sched_move_domain_cleanup(const struct scheduler *ops,
+                                      struct sched_unit *units,
+                                      void *domdata)
+{
+    struct sched_unit *unit, *old_unit;
+
+    for ( unit = units; unit; )
+    {
+        if ( unit->priv )
+            sched_free_udata(ops, unit->priv);
+        old_unit = unit;
+        unit = unit->next_in_list;
+        xfree(old_unit);
+    }
+
+    sched_free_domdata(ops, domdata);
+}
+
 /*
  * Move a domain from one cpupool to another.
  *
@@ -686,7 +704,6 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
     void *old_domdata;
     unsigned int gran = cpupool_get_granularity(c);
     unsigned int n_units = d->vcpu[0] ? DIV_ROUND_UP(d->max_vcpus, gran) : 0;
-    int ret = 0;
 
     for_each_vcpu ( d, v )
     {
@@ -699,8 +716,9 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
     domdata = sched_alloc_domdata(c->sched, d);
     if ( IS_ERR(domdata) )
     {
-        ret = PTR_ERR(domdata);
-        goto out;
+        rcu_read_unlock(&sched_res_rculock);
+
+        return PTR_ERR(domdata);
     }
 
     for ( unit_idx = 0; unit_idx < n_units; unit_idx++ )
@@ -718,10 +736,10 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
 
         if ( !unit || !unit->priv )
         {
-            old_units = new_units;
-            old_domdata = domdata;
-            ret = -ENOMEM;
-            goto out_free;
+            sched_move_domain_cleanup(c->sched, new_units, domdata);
+            rcu_read_unlock(&sched_res_rculock);
+
+            return -ENOMEM;
         }
 
         unit_ptr = &unit->next_in_list;
@@ -808,22 +826,11 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
 
     domain_unpause(d);
 
- out_free:
-    for ( unit = old_units; unit; )
-    {
-        if ( unit->priv )
-            sched_free_udata(c->sched, unit->priv);
-        old_unit = unit;
-        unit = unit->next_in_list;
-        xfree(old_unit);
-    }
-
-    sched_free_domdata(old_ops, old_domdata);
+    sched_move_domain_cleanup(old_ops, old_units, old_domdata);
 
- out:
     rcu_read_unlock(&sched_res_rculock);
 
-    return ret;
+    return 0;
 }
 
 void sched_destroy_vcpu(struct vcpu *v)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Dec 13 14:44:34 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 Dec 2023 14:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654071.1020708 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rDQTS-0000Rj-28; Wed, 13 Dec 2023 14:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654071.1020708; Wed, 13 Dec 2023 14:44:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rDQTR-0000Ra-UL; Wed, 13 Dec 2023 14:44:33 +0000
Received: by outflank-mailman (input) for mailman id 654071;
 Wed, 13 Dec 2023 14: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 1rDQTQ-0000RO-Jv
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 14: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 1rDQTQ-0002jW-J7
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 14:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDQTQ-000144-IG
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 14: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=FJnjffBgFWwG6CwQCC+quEjWk1WIgsbDPF2M4nhuOk8=; b=rUmiwF++CG01nr2z6RaxWoZ7dq
	1+nVStCR4pN3CfZ0C2K3w+wEfuTV+79x1z6R09eirZe0d22wCMhRksrdn7aQ+xZfrr8m9rn27aE6G
	iHgG34Fl2jGsDEYf+BQYwk4pM9aLqqBCwBPc8SzqVqLY4L4r1VoHWJMa6QiKUVXm0/tI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] xen/arm: page: Avoid pointer overflow on cache clean & invalidate
Message-Id: <E1rDQTQ-000144-IG@xenbits.xenproject.org>
Date: Wed, 13 Dec 2023 14:44:32 +0000

commit 958706fd2e178ffe8e5597b05b694b494e24258b
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Dec 12 14:51:20 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 12 14:51:20 2023 +0100

    xen/arm: page: Avoid pointer overflow on cache clean & invalidate
    
    On Arm32, after cleaning and invalidating the last dcache line of the top
    domheap page i.e. VA = 0xfffff000 (as a result of flushing the page to
    RAM), we end up adding the value of a dcache line size to the pointer
    once again, which results in a pointer arithmetic overflow (with 64B line
    size, operation 0xffffffc0 + 0x40 overflows to 0x0). Such behavior is
    undefined and given the wide range of compiler versions we support, it is
    difficult to determine what could happen in such scenario.
    
    Modify clean_and_invalidate_dcache_va_range() as well as
    clean_dcache_va_range() and invalidate_dcache_va_range() due to similarity
    of handling to prevent pointer arithmetic overflow. Modify the loops to
    use an additional variable to store the index of the next cacheline.
    Add an assert to prevent passing a region that wraps around which is
    illegal and would end up in a page fault anyway (region 0-2MB is
    unmapped). Lastly, return early if size passed is 0.
    
    Note that on Arm64, we don't have this problem given that the max VA
    space we support is 48-bits.
    
    This is XSA-447 / CVE-2023-46837.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    master commit: 190b7f49af6487a9665da63d43adc9d9a5fbd01e
    master date: 2023-12-12 14:01:00 +0100
---
 xen/arch/arm/include/asm/page.h | 35 ++++++++++++++++++++++++++++-------
 1 file changed, 28 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/include/asm/page.h b/xen/arch/arm/include/asm/page.h
index d7fe770a5e..bf71042fb5 100644
--- a/xen/arch/arm/include/asm/page.h
+++ b/xen/arch/arm/include/asm/page.h
@@ -161,6 +161,13 @@ static inline size_t read_dcache_line_bytes(void)
 static inline int invalidate_dcache_va_range(const void *p, unsigned long size)
 {
     size_t cacheline_mask = dcache_line_bytes - 1;
+    unsigned long idx = 0;
+
+    if ( !size )
+        return 0;
+
+    /* Passing a region that wraps around is illegal */
+    ASSERT(((uintptr_t)p + size - 1) >= (uintptr_t)p);
 
     dsb(sy);           /* So the CPU issues all writes to the range */
 
@@ -173,11 +180,11 @@ static inline int invalidate_dcache_va_range(const void *p, unsigned long size)
     }
 
     for ( ; size >= dcache_line_bytes;
-            p += dcache_line_bytes, size -= dcache_line_bytes )
-        asm volatile (__invalidate_dcache_one(0) : : "r" (p));
+            idx += dcache_line_bytes, size -= dcache_line_bytes )
+        asm volatile (__invalidate_dcache_one(0) : : "r" (p + idx));
 
     if ( size > 0 )
-        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p));
+        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p + idx));
 
     dsb(sy);           /* So we know the flushes happen before continuing */
 
@@ -187,14 +194,21 @@ static inline int invalidate_dcache_va_range(const void *p, unsigned long size)
 static inline int clean_dcache_va_range(const void *p, unsigned long size)
 {
     size_t cacheline_mask = dcache_line_bytes - 1;
+    unsigned long idx = 0;
+
+    if ( !size )
+        return 0;
+
+    /* Passing a region that wraps around is illegal */
+    ASSERT(((uintptr_t)p + size - 1) >= (uintptr_t)p);
 
     dsb(sy);           /* So the CPU issues all writes to the range */
     size += (uintptr_t)p & cacheline_mask;
     size = (size + cacheline_mask) & ~cacheline_mask;
     p = (void *)((uintptr_t)p & ~cacheline_mask);
     for ( ; size >= dcache_line_bytes;
-            p += dcache_line_bytes, size -= dcache_line_bytes )
-        asm volatile (__clean_dcache_one(0) : : "r" (p));
+            idx += dcache_line_bytes, size -= dcache_line_bytes )
+        asm volatile (__clean_dcache_one(0) : : "r" (p + idx));
     dsb(sy);           /* So we know the flushes happen before continuing */
     /* ARM callers assume that dcache_* functions cannot fail. */
     return 0;
@@ -204,14 +218,21 @@ static inline int clean_and_invalidate_dcache_va_range
     (const void *p, unsigned long size)
 {
     size_t cacheline_mask = dcache_line_bytes - 1;
+    unsigned long idx = 0;
+
+    if ( !size )
+        return 0;
+
+    /* Passing a region that wraps around is illegal */
+    ASSERT(((uintptr_t)p + size - 1) >= (uintptr_t)p);
 
     dsb(sy);         /* So the CPU issues all writes to the range */
     size += (uintptr_t)p & cacheline_mask;
     size = (size + cacheline_mask) & ~cacheline_mask;
     p = (void *)((uintptr_t)p & ~cacheline_mask);
     for ( ; size >= dcache_line_bytes;
-            p += dcache_line_bytes, size -= dcache_line_bytes )
-        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p));
+            idx += dcache_line_bytes, size -= dcache_line_bytes )
+        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p + idx));
     dsb(sy);         /* So we know the flushes happen before continuing */
     /* ARM callers assume that dcache_* functions cannot fail. */
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Wed Dec 13 16:33:09 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 Dec 2023 16:33:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654119.1020812 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rDSAR-0005vU-88; Wed, 13 Dec 2023 16:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654119.1020812; Wed, 13 Dec 2023 16:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rDSAR-0005vM-4t; Wed, 13 Dec 2023 16:33:03 +0000
Received: by outflank-mailman (input) for mailman id 654119;
 Wed, 13 Dec 2023 16:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDSAQ-0005vC-2i
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 16:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDSAQ-0005DQ-1o
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 16:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rDSAQ-0006Fa-0p
 for xen-changelog@lists.xenproject.org; Wed, 13 Dec 2023 16: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=a763LqN4cLqa1dUrR4txzv9h08RxGHPDJlQIkYp5pSc=; b=Klg3AtVIBlsE2EoEvOCeOV5/de
	GBg+oNQyY9dva4SyMwEZ2Y07vGoTFFFkvFkbk+z4UKxuFsqKg5RP5KfnvAZNpI4hvZpVN5elAOFRF
	DFQdLV2gDHUYx5Ok/Ob9K6uiGWOsoHyNhvTAgV0j3ECtYp3gUxDzk9fFbuDYak22z/T8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.16] xen/arm: page: Avoid pointer overflow on cache clean & invalidate
Message-Id: <E1rDSAQ-0006Fa-0p@xenbits.xenproject.org>
Date: Wed, 13 Dec 2023 16:33:02 +0000

commit e7c3d6ceaf73120098f9213fd12f79fd50e8e588
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Dec 12 14:53:13 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 12 14:53:13 2023 +0100

    xen/arm: page: Avoid pointer overflow on cache clean & invalidate
    
    On Arm32, after cleaning and invalidating the last dcache line of the top
    domheap page i.e. VA = 0xfffff000 (as a result of flushing the page to
    RAM), we end up adding the value of a dcache line size to the pointer
    once again, which results in a pointer arithmetic overflow (with 64B line
    size, operation 0xffffffc0 + 0x40 overflows to 0x0). Such behavior is
    undefined and given the wide range of compiler versions we support, it is
    difficult to determine what could happen in such scenario.
    
    Modify clean_and_invalidate_dcache_va_range() as well as
    clean_dcache_va_range() and invalidate_dcache_va_range() due to similarity
    of handling to prevent pointer arithmetic overflow. Modify the loops to
    use an additional variable to store the index of the next cacheline.
    Add an assert to prevent passing a region that wraps around which is
    illegal and would end up in a page fault anyway (region 0-2MB is
    unmapped). Lastly, return early if size passed is 0.
    
    Note that on Arm64, we don't have this problem given that the max VA
    space we support is 48-bits.
    
    This is XSA-447 / CVE-2023-46837.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    master commit: 190b7f49af6487a9665da63d43adc9d9a5fbd01e
    master date: 2023-12-12 14:01:00 +0100
---
 xen/include/asm-arm/page.h | 35 ++++++++++++++++++++++++++++-------
 1 file changed, 28 insertions(+), 7 deletions(-)

diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index eff5883ef8..b6784417ed 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -153,6 +153,13 @@ static inline size_t read_dcache_line_bytes(void)
 static inline int invalidate_dcache_va_range(const void *p, unsigned long size)
 {
     size_t cacheline_mask = dcache_line_bytes - 1;
+    unsigned long idx = 0;
+
+    if ( !size )
+        return 0;
+
+    /* Passing a region that wraps around is illegal */
+    ASSERT(((uintptr_t)p + size - 1) >= (uintptr_t)p);
 
     dsb(sy);           /* So the CPU issues all writes to the range */
 
@@ -165,11 +172,11 @@ static inline int invalidate_dcache_va_range(const void *p, unsigned long size)
     }
 
     for ( ; size >= dcache_line_bytes;
-            p += dcache_line_bytes, size -= dcache_line_bytes )
-        asm volatile (__invalidate_dcache_one(0) : : "r" (p));
+            idx += dcache_line_bytes, size -= dcache_line_bytes )
+        asm volatile (__invalidate_dcache_one(0) : : "r" (p + idx));
 
     if ( size > 0 )
-        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p));
+        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p + idx));
 
     dsb(sy);           /* So we know the flushes happen before continuing */
 
@@ -179,14 +186,21 @@ static inline int invalidate_dcache_va_range(const void *p, unsigned long size)
 static inline int clean_dcache_va_range(const void *p, unsigned long size)
 {
     size_t cacheline_mask = dcache_line_bytes - 1;
+    unsigned long idx = 0;
+
+    if ( !size )
+        return 0;
+
+    /* Passing a region that wraps around is illegal */
+    ASSERT(((uintptr_t)p + size - 1) >= (uintptr_t)p);
 
     dsb(sy);           /* So the CPU issues all writes to the range */
     size += (uintptr_t)p & cacheline_mask;
     size = (size + cacheline_mask) & ~cacheline_mask;
     p = (void *)((uintptr_t)p & ~cacheline_mask);
     for ( ; size >= dcache_line_bytes;
-            p += dcache_line_bytes, size -= dcache_line_bytes )
-        asm volatile (__clean_dcache_one(0) : : "r" (p));
+            idx += dcache_line_bytes, size -= dcache_line_bytes )
+        asm volatile (__clean_dcache_one(0) : : "r" (p + idx));
     dsb(sy);           /* So we know the flushes happen before continuing */
     /* ARM callers assume that dcache_* functions cannot fail. */
     return 0;
@@ -196,14 +210,21 @@ static inline int clean_and_invalidate_dcache_va_range
     (const void *p, unsigned long size)
 {
     size_t cacheline_mask = dcache_line_bytes - 1;
+    unsigned long idx = 0;
+
+    if ( !size )
+        return 0;
+
+    /* Passing a region that wraps around is illegal */
+    ASSERT(((uintptr_t)p + size - 1) >= (uintptr_t)p);
 
     dsb(sy);         /* So the CPU issues all writes to the range */
     size += (uintptr_t)p & cacheline_mask;
     size = (size + cacheline_mask) & ~cacheline_mask;
     p = (void *)((uintptr_t)p & ~cacheline_mask);
     for ( ; size >= dcache_line_bytes;
-            p += dcache_line_bytes, size -= dcache_line_bytes )
-        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p));
+            idx += dcache_line_bytes, size -= dcache_line_bytes )
+        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p + idx));
     dsb(sy);         /* So we know the flushes happen before continuing */
     /* ARM callers assume that dcache_* functions cannot fail. */
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.16


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 05:00:10 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 05:00:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654868.1022338 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE0Iu-00065W-Hs; Fri, 15 Dec 2023 05:00:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654868.1022338; Fri, 15 Dec 2023 05:00:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE0Iu-00065O-EX; Fri, 15 Dec 2023 05:00:04 +0000
Received: by outflank-mailman (input) for mailman id 654868;
 Fri, 15 Dec 2023 05:00:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE0Is-0005i6-NK
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 05:00:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE0Is-0004cN-7e
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 05:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE0Is-0002TL-6U
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 05:00:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mbprmxcpBrFUQCu2vacTnc/jsdTeJcBiZh20FJssVw0=; b=r2sbfLVxmGp557x0ArrOTEJd/t
	Tn1XjVokO32UhOXNQvTWoAa8RkyovMr05rmdtaBUcVkp7xAwJXVWV29NbKl6E93s1gyWHUMtHib8l
	1sudZmBqZMR+Vi1WBty+oZjZaZs7eq2rMscEn4yH8+0ZTS+/rYK0r8qwqfrs5XaUKiuc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/x2apic: introduce a mixed physical/cluster mode
Message-Id: <E1rE0Is-0002TL-6U@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 05:00:02 +0000

commit 1792d1723b7fb45a20b145d2de4d233913b22c09
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Dec 12 14:45:52 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 12 14:45:52 2023 +0100

    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>
    master commit: e3c409d59ac87ccdf97b8c7708c81efa8069cb31
    master date: 2023-11-07 09:59:48 +0000
---
 CHANGELOG.md                      |  7 +++
 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, 123 insertions(+), 35 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7fb4d366c3..5aa01dae5d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,13 @@ 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.1](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.18.1)
+
+### Added
+ - On x86:
+   - Introduce a new x2APIC driver that uses Cluster Logical addressing mode
+     for IPIs and Physical addressing mode for external interrupts.
+
 ## [4.18.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.18.0) - 2023-11-16
 
 ### Changed
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#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:33:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:33:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654920.1022412 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3d1-0002xW-FC; Fri, 15 Dec 2023 08:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654920.1022412; Fri, 15 Dec 2023 08: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 1rE3d1-0002xO-CX; Fri, 15 Dec 2023 08:33:03 +0000
Received: by outflank-mailman (input) for mailman id 654920;
 Fri, 15 Dec 2023 08: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 1rE3d0-0002xI-87
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3cz-0000j9-Un
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3cz-0005n9-TO
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=ccCRHffWxN3Fh4y3xhJJ0Nt7EsKIyiiFtGy4OyX/hpQ=; b=JLWFuI+5CvZ4gTf+WbGexdxY5d
	oobv3PthACBSCRAqrud2O/N0T89OnSp6z+vyWtoJnbK/L1hd4Lc8itKq+azD8LzS9n7zL3qYJ9K86
	fkUx3gKv6Z7XNknL6EPcduU363fDF58IxgvUxObg0ySfUMRWR2vNfpu3ngJV7gcElLiA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Config: Update MiniOS revision
Message-Id: <E1rE3cz-0005n9-TO@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:33:01 +0000

commit e6e8c5831a64420a56f83e87919ed157ab810fab
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Dec 7 18:54:45 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Dec 7 20:10:57 2023 +0000

    Config: Update MiniOS revision
    
    Fixes for CI breakages
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 Config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Config.mk b/Config.mk
index 98ca1e2847..f7d6d84847 100644
--- a/Config.mk
+++ b/Config.mk
@@ -224,7 +224,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 ?= 33411a11f848853b6c81a38426faaab303477a31
+MINIOS_UPSTREAM_REVISION ?= 090eeeb1631f00a9a41ebf66d9b4aacb97eb51e7
 
 SEABIOS_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/seabios.git
 SEABIOS_UPSTREAM_REVISION ?= rel-1.16.3
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:33:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654921.1022416 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3dB-0002ze-GY; Fri, 15 Dec 2023 08:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654921.1022416; Fri, 15 Dec 2023 08: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 1rE3dB-0002zW-Dz; Fri, 15 Dec 2023 08:33:13 +0000
Received: by outflank-mailman (input) for mailman id 654921;
 Fri, 15 Dec 2023 08: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 1rE3dA-0002z8-2y
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3dA-0000jI-28
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3dA-0005nm-0g
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=y6WPV082ZcyyIwnwiJd2ad+XRBvuyRHY2T7sB/Bq/y4=; b=nwC2e8lcN/eCXHbN+zVohZGVGF
	ZuEwArlU9jo7hQkRLqU9ISBsQb88oiswKQ5d7JJLCrZRIgM3H2ufWhR5PtTW5SbYoPPMW/fyB1KTZ
	y719MdESihzygsNJ9mlJ+d0YbjXUtIGwxWgp2VMfT8hFP5ky+sJfAtJijbm+MTRNltb0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libs/evtchn: replace assert()s in stubdom with proper locking
Message-Id: <E1rE3dA-0005nm-0g@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:33:12 +0000

commit bc4fe94a69d4dab103c37045d97e589ef75f8647
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Dec 7 07:25:51 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Dec 7 20:10:57 2023 +0000

    tools/libs/evtchn: replace assert()s in stubdom with proper locking
    
    In tools/libs/evtchn/minios.c there are assert()s for the current
    thread being the main thread when binding an event channel.
    
    As Mini-OS is supporting multiple threads, there is no real reason
    why the binding shouldn't be allowed to happen in any other thread.
    
    Drop the assert()s and replace them with proper locking of the
    port_list.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
---
 tools/libs/evtchn/minios.c | 79 +++++++++++++++++++++++++++++++---------------
 1 file changed, 54 insertions(+), 25 deletions(-)

diff --git a/tools/libs/evtchn/minios.c b/tools/libs/evtchn/minios.c
index 28743cb055..c807e17f55 100644
--- a/tools/libs/evtchn/minios.c
+++ b/tools/libs/evtchn/minios.c
@@ -25,6 +25,7 @@
 #include <mini-os/os.h>
 #include <mini-os/lib.h>
 #include <mini-os/events.h>
+#include <mini-os/semaphore.h>
 #include <mini-os/wait.h>
 
 #include <assert.h>
@@ -40,6 +41,11 @@
 
 XEN_LIST_HEAD(port_list, struct port_info);
 
+struct ports {
+    struct port_list list;
+    struct semaphore sem;
+};
+
 struct port_info {
     XEN_LIST_ENTRY(struct port_info) list;
     evtchn_port_t port;
@@ -47,12 +53,11 @@ struct port_info {
     bool bound;
 };
 
-/* XXX Note: This is not threadsafe */
 static struct port_info *port_alloc(xenevtchn_handle *xce)
 {
     struct port_info *port_info;
     struct file *file = get_file_from_fd(xce->fd);
-    struct port_list *port_list = file->dev;
+    struct ports *ports = file->dev;
 
     port_info = malloc(sizeof(struct port_info));
     if ( port_info == NULL )
@@ -62,7 +67,9 @@ static struct port_info *port_alloc(xenevtchn_handle *xce)
     port_info->port = -1;
     port_info->bound = false;
 
-    XEN_LIST_INSERT_HEAD(port_list, port_info, list);
+    down(&ports->sem);
+    XEN_LIST_INSERT_HEAD(&ports->list, port_info, list);
+    up(&ports->sem);
 
     return port_info;
 }
@@ -79,11 +86,12 @@ static void port_dealloc(struct port_info *port_info)
 static int evtchn_close_fd(struct file *file)
 {
     struct port_info *port_info, *tmp;
-    struct port_list *port_list = file->dev;
+    struct ports *ports = file->dev;
 
-    XEN_LIST_FOREACH_SAFE(port_info, port_list, list, tmp)
+    XEN_LIST_FOREACH_SAFE(port_info, &ports->list, list, tmp)
         port_dealloc(port_info);
-    free(port_list);
+
+    free(ports);
 
     return 0;
 }
@@ -110,10 +118,10 @@ int osdep_evtchn_open(xenevtchn_handle *xce, unsigned int flags)
 {
     int fd;
     struct file *file;
-    struct port_list *list;
+    struct ports *ports;
 
-    list = malloc(sizeof(*list));
-    if ( !list )
+    ports = malloc(sizeof(*ports));
+    if ( !ports )
         return -1;
 
     fd = alloc_fd(ftype_evtchn);
@@ -121,12 +129,13 @@ int osdep_evtchn_open(xenevtchn_handle *xce, unsigned int flags)
 
     if ( !file )
     {
-        free(list);
+        free(ports);
         return -1;
     }
 
-    file->dev = list;
-    XEN_LIST_INIT(list);
+    file->dev = ports;
+    XEN_LIST_INIT(&ports->list);
+    init_SEMAPHORE(&ports->sem, 1);
     xce->fd = fd;
     printf("evtchn_open() -> %d\n", fd);
 
@@ -168,16 +177,22 @@ static void evtchn_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
     xenevtchn_handle *xce = data;
     struct file *file = get_file_from_fd(xce->fd);
     struct port_info *port_info;
-    struct port_list *port_list;
+    struct ports *ports;
 
     assert(file);
-    port_list = file->dev;
+    ports = file->dev;
     mask_evtchn(port);
-    XEN_LIST_FOREACH(port_info, port_list, list)
+
+    down(&ports->sem);
+    XEN_LIST_FOREACH(port_info, &ports->list, list)
     {
         if ( port_info->port == port )
+        {
+            up(&ports->sem);
             goto found;
+        }
     }
+    up(&ports->sem);
 
     printk("Unknown port %d for handle %d\n", port, xce->fd);
     return;
@@ -188,6 +203,16 @@ static void evtchn_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
     wake_up(&event_queue);
 }
 
+static void port_remove(xenevtchn_handle *xce, struct port_info *port_info)
+{
+    struct file *file = get_file_from_fd(xce->fd);
+    struct ports *ports = file->dev;
+
+    down(&ports->sem);
+    port_dealloc(port_info);
+    up(&ports->sem);
+}
+
 xenevtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce,
                                                       uint32_t domid)
 {
@@ -195,7 +220,6 @@ xenevtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce,
     int ret;
     evtchn_port_t port;
 
-    assert(get_current() == main_thread);
     port_info = port_alloc(xce);
     if ( port_info == NULL )
         return -1;
@@ -206,7 +230,7 @@ xenevtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce,
 
     if ( ret < 0 )
     {
-        port_dealloc(port_info);
+        port_remove(xce, port_info);
         errno = -ret;
         return -1;
     }
@@ -226,7 +250,6 @@ xenevtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce,
     evtchn_port_t local_port;
     int ret;
 
-    assert(get_current() == main_thread);
     port_info = port_alloc(xce);
     if ( port_info == NULL )
         return -1;
@@ -238,7 +261,7 @@ xenevtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce,
 
     if ( ret < 0 )
     {
-        port_dealloc(port_info);
+        port_remove(xce, port_info);
         errno = -ret;
         return -1;
     }
@@ -255,16 +278,19 @@ int xenevtchn_unbind(xenevtchn_handle *xce, evtchn_port_t port)
     int fd = xce->fd;
     struct file *file = get_file_from_fd(fd);
     struct port_info *port_info;
-    struct port_list *port_list = file->dev;
+    struct ports *ports = file->dev;
 
-    XEN_LIST_FOREACH(port_info, port_list, list)
+    down(&ports->sem);
+    XEN_LIST_FOREACH(port_info, &ports->list, list)
     {
         if ( port_info->port == port )
         {
             port_dealloc(port_info);
+            up(&ports->sem);
             return 0;
         }
     }
+    up(&ports->sem);
 
     printf("Warning: couldn't find port %"PRId32" for xc handle %x\n",
            port, fd);
@@ -279,7 +305,6 @@ xenevtchn_port_or_error_t xenevtchn_bind_virq(xenevtchn_handle *xce,
     struct port_info *port_info;
     evtchn_port_t port;
 
-    assert(get_current() == main_thread);
     port_info = port_alloc(xce);
     if ( port_info == NULL )
         return -1;
@@ -290,7 +315,7 @@ xenevtchn_port_or_error_t xenevtchn_bind_virq(xenevtchn_handle *xce,
 
     if ( port < 0 )
     {
-        port_dealloc(port_info);
+        port_remove(xce, port_info);
         errno = -port;
         return -1;
     }
@@ -306,15 +331,17 @@ xenevtchn_port_or_error_t xenevtchn_pending(xenevtchn_handle *xce)
 {
     struct file *file = get_file_from_fd(xce->fd);
     struct port_info *port_info;
-    struct port_list *port_list = file->dev;
+    struct ports *ports = file->dev;
     unsigned long flags;
     evtchn_port_t ret = -1;
 
+    down(&ports->sem);
+
     local_irq_save(flags);
 
     file->read = false;
 
-    XEN_LIST_FOREACH(port_info, port_list, list)
+    XEN_LIST_FOREACH(port_info, &ports->list, list)
     {
         if ( port_info->port != -1 && port_info->pending )
         {
@@ -333,6 +360,8 @@ xenevtchn_port_or_error_t xenevtchn_pending(xenevtchn_handle *xce)
 
     local_irq_restore(flags);
 
+    up(&ports->sem);
+
     return ret;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:33:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654922.1022422 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3dL-00032a-Jo; Fri, 15 Dec 2023 08:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654922.1022422; Fri, 15 Dec 2023 08: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 1rE3dL-00032N-FR; Fri, 15 Dec 2023 08:33:23 +0000
Received: by outflank-mailman (input) for mailman id 654922;
 Fri, 15 Dec 2023 08: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 1rE3dK-00031x-66
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3dK-0000jS-5C
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3dK-0005ot-4E
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=2Mt1Euz/yGMNffpiFr6ZDbbU2WfXgqoBF7TWBQhgCxM=; b=Bhu/InxiSWeV2xqU0Yvi/fmC+J
	YVUpR378DEiQjeWO/jmhastz8/cHtaWxUvk97GjGocx0YmNhos9TPZbuD8G6Kq8q41e/Yrpk9ID9g
	kS8XVb8H2xYTAyVrHufgAs7+/DPmAftDHGb09SEyTQDz044wKzEIJFmlamqtDGAhu7JE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/acpi: remove acpi_pic_sci_set_trigger()
Message-Id: <E1rE3dK-0005ot-4E@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:33:22 +0000

commit 807321b6f355dc93dc77de7e44c7d9afb3e5f8a1
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Mon Dec 11 11:26:16 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 11 11:26:16 2023 +0100

    x86/acpi: remove acpi_pic_sci_set_trigger()
    
    Remove apci_pic_set_trigger() declaration: there is no definition and there are
    no calls to such function in the XEN project.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/acpi.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/acpi.h b/xen/arch/x86/include/asm/acpi.h
index 0df92d3714..48b1d69946 100644
--- a/xen/arch/x86/include/asm/acpi.h
+++ b/xen/arch/x86/include/asm/acpi.h
@@ -81,7 +81,6 @@ extern bool acpi_lapic, acpi_ioapic, acpi_noirq;
 extern bool acpi_force, acpi_ht, acpi_disabled;
 extern u32 acpi_smi_cmd;
 extern u8 acpi_enable_value, acpi_disable_value;
-void acpi_pic_sci_set_trigger(unsigned int, u16);
 
 static inline void disable_acpi(void)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:33:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654924.1022423 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3dV-000365-KU; Fri, 15 Dec 2023 08:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654924.1022423; Fri, 15 Dec 2023 08: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 1rE3dV-00035x-I2; Fri, 15 Dec 2023 08:33:33 +0000
Received: by outflank-mailman (input) for mailman id 654924;
 Fri, 15 Dec 2023 08: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 1rE3dU-00035m-Ak
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3dU-0000jb-88
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3dU-0005pR-7I
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=Q7kYFfZxkxt3pnLrEchRLvrqg1lXder7pOHXhwoM/t8=; b=1Ax2o5geqwnkTb1tToBDgcfysy
	EzMeYdV+qo91www+OAX0dToaP4rni3IGVMl6FA+UniE8FxcoSzeBxEiHVVRmvtYKNS//k5UMLDjzj
	vBfRSmfMga61ES1fTLI+hPrumaoXG9afXZWIq9oKbafGdh9v7pRdNia0+y6UQ4toALR0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: address violations of MISRA C:2012 Rule 14.4
Message-Id: <E1rE3dU-0005pR-7I@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:33:32 +0000

commit 519c7a1d589cc263f1d0e291f53fd33a9980a239
Author:     Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
AuthorDate: Mon Dec 11 11:27:07 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 11 11:27:07 2023 +0100

    xen: address violations of MISRA C:2012 Rule 14.4
    
    The xen sources contain violations of MISRA C:2012 Rule 14.4 whose
    headline states:
    "The controlling expression of an if statement and the controlling
    expression of an iteration-statement shall have essentially Boolean type".
    
    Struct domain member is_dying is an anonymous enum designed to act as boolean.
    Add deviation to mark its uses in controlling expressions as deliberate.
    
    Signed-off-by: Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
    Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 6 ++++++
 docs/misra/deviations.rst                        | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index b0c79741b5..683f2bbfe8 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -321,6 +321,12 @@ statements are deliberate"
 -config=MC3R1.R14.3,statements={deliberate , "wrapped(any(),node(if_stmt))" }
 -doc_end
 
+-doc_begin="The XEN team relies on the fact that the enum is_dying has the
+constant with assigned value 0 act as false and the other ones as true,
+therefore have the same behavior of a boolean"
+-config=MC3R1.R14.4,etypes+={deliberate, "stmt(child(cond,child(expr,ref(^<?domain>?::is_dying$))))","src_type(enum)"}
+-doc_end
+
 #
 # Series 20.
 #
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 6e7c4f25b8..eda3c8100c 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -270,6 +270,12 @@ Deviations related to MISRA C:2012 Rules:
        statements are deliberate.
      - Project-wide deviation; tagged as `disapplied` for ECLAIR.
 
+   * - R14.4
+     - The XEN team relies on the fact that the enum is_dying has the
+       constant with assigned value 0 act as false and the other ones as true,
+       therefore have the same behavior of a boolean.
+     - Project-wide deviation; tagged as `deliberate` for ECLAIR.
+
    * - R20.7
      - Code violating Rule 20.7 is safe when macro parameters are used:
        (1) as function arguments;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:33:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654925.1022428 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3df-00038w-ML; Fri, 15 Dec 2023 08:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654925.1022428; Fri, 15 Dec 2023 08: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 1rE3df-00038p-JX; Fri, 15 Dec 2023 08:33:43 +0000
Received: by outflank-mailman (input) for mailman id 654925;
 Fri, 15 Dec 2023 08: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 1rE3de-00038h-Cs
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3de-0000ji-Az
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3de-0005pz-AC
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=XOWAN8uaQ6mihCMI+CK2dScrXZdqFaS53Bi8fRfdt0Q=; b=65qkVkkRoL9lQ6LAg1+ArIT/ay
	FARz9vc7gV6nUeVIq8Y5Fr7josGM1WZHC9N0Zna8bhg+B85V5nLTGG61r0QuvnEqEkhD5ejreOERA
	QW9VNd0GjyciMTlPPbxgE+V6RBJfM1woCX0E+B7daivosXTJ07xt+PKgDwd2/aSIGK1A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/misra/rules.rst: add more rules
Message-Id: <E1rE3de-0005pz-AC@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:33:42 +0000

commit f45e488e7bc96b43faa5078c8418c6f496e466c1
Author:     Stefano Stabellini <stefano.stabellini@amd.com>
AuthorDate: Mon Dec 11 11:27:20 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 11 11:27:20 2023 +0100

    docs/misra/rules.rst: add more rules
    
    Add the rules accepted in the last three MISRA C working group meetings.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 docs/misra/rules.rst | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 75921b9a34..1dc3fa4c9d 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -462,6 +462,13 @@ maintainers if you want to suggest a change.
 
        while(0) and while(1) and alike are allowed.
 
+   * - `Rule 16.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_16_03.c>`_
+     - Required
+     - An unconditional break statement shall terminate every
+       switch-clause
+     - In addition to break, also other unconditional flow control statements
+       such as continue, return, goto are allowed.
+
    * - `Rule 16.7 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_16_07.c>`_
      - Required
      - A switch-expression shall not have essentially Boolean type
@@ -478,12 +485,27 @@ maintainers if you want to suggest a change.
        have an explicit return statement with an expression
      -
 
+   * - `Rule 17.5 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_17_05.c>`_
+     - Advisory
+     - The function argument corresponding to a parameter declared to
+       have an array type shall have an appropriate number of elements
+     -
+
    * - `Rule 17.6 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_17_06.c>`_
      - Mandatory
      - The declaration of an array parameter shall not contain the
        static keyword between the [ ]
      -
 
+   * - `Rule 17.7 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_17_07.c>`_
+     - Required
+     - The value returned by a function having non-void return type
+       shall be used
+     - Please beware that this rule has many violations in the Xen
+       codebase today, and its adoption is aspirational. However, when
+       submitting new patches please try to decrease the number of
+       violations when possible.
+
    * - `Rule 18.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_18_03.c>`_
      - Required
      - The relational operators > >= < and <= shall not be applied to objects of pointer type except where they point into the same object
@@ -498,6 +520,11 @@ maintainers if you want to suggest a change.
        instances where Eclair is unable to verify that the code is valid
        in regard to Rule 19.1. Caution reports are not violations.
 
+   * - `Rule 20.4 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_20_04.c>`_
+     - Required
+     - A macro shall not be defined with the same name as a keyword
+     -
+
    * - `Rule 20.7 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_20_07.c>`_
      - Required
      - Expressions resulting from the expansion of macro parameters
@@ -506,6 +533,13 @@ maintainers if you want to suggest a change.
        as function arguments, as macro arguments, array indices, lhs in
        assignments
 
+   * - `Rule 20.9 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_20_09.c>`_
+     - Required
+     - All identifiers used in the controlling expression of #if or
+       #elif preprocessing directives shall be #define'd before
+       evaluation
+     -
+
    * - `Rule 20.13 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_20_13.c>`_
      - Required
      - A line whose first token is # shall be a valid preprocessing
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:33:53 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:33:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654926.1022432 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3dp-0003BW-O3; Fri, 15 Dec 2023 08:33:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654926.1022432; Fri, 15 Dec 2023 08: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 1rE3dp-0003BN-L6; Fri, 15 Dec 2023 08:33:53 +0000
Received: by outflank-mailman (input) for mailman id 654926;
 Fri, 15 Dec 2023 08: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 1rE3do-0003BB-Ey
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3do-0000k9-EB
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3do-0005qb-D6
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=FmjAzPVPAT71SkCagmorf6Y5A5tMRvnA0q5PsTWu2rQ=; b=cJCxumQfJrEG49lZ59eQhWu2Pq
	PydcGSmXbRi+X+FJZiytXPxsnsG30SUa/1jMSVybM5ysE3muBba5OSmHjAIrquTM+HJqz0MrGKGyo
	Mp/jvR7HQmP6dNtixb2aA6wDfWHa6B7dno2oRh5kZ+hbMG1iWR0w7RoAWcMc3Gg73GuU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/viridian: make build_assertions static
Message-Id: <E1rE3do-0005qb-D6@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:33:52 +0000

commit 1403131596fa77663708f6baa0fee8bf7b95eb5a
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Mon Dec 11 11:28:02 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 11 11:28:02 2023 +0100

    x86/viridian: make build_assertions static
    
    This is consistent with other instances of the same function
    and also resolves a violation of MISRA C:2012 Rule 8.4.
    
    No functional change.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Paul Durrant <paul@xen.org>
---
 xen/arch/x86/hvm/viridian/synic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/viridian/synic.c b/xen/arch/x86/hvm/viridian/synic.c
index 8cf600cec6..3375e55e95 100644
--- a/xen/arch/x86/hvm/viridian/synic.c
+++ b/xen/arch/x86/hvm/viridian/synic.c
@@ -18,7 +18,7 @@
 #include "private.h"
 
 
-void __init __maybe_unused build_assertions(void)
+static void __init __maybe_unused build_assertions(void)
 {
     BUILD_BUG_ON(sizeof(struct hv_message) != HV_MESSAGE_SIZE);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:34:04 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:34:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654927.1022436 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3e0-0003EO-P5; Fri, 15 Dec 2023 08:34:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654927.1022436; Fri, 15 Dec 2023 08:34:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3e0-0003EH-MU; Fri, 15 Dec 2023 08:34:04 +0000
Received: by outflank-mailman (input) for mailman id 654927;
 Fri, 15 Dec 2023 08: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 1rE3dy-0003Ds-I8
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3dy-0000kd-HL
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:34:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3dy-0005rY-GU
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=vySwIcNyE3HyOptMkjraA1EvdVgX35aCrdKSZhX+1Lo=; b=1yu5nUxnUSRwdKbhbP1bM3wOzf
	PoMzkNcOudfs9OtckQZwshHvgJMM0wBcZmUePdDsIVCIjWyOstPpQpDC6F9tu1vlW6fY1g1p8n5pR
	YoM8tNZKfUjUVnhO6nPXTRvQLRHynGbnypDyaC9XVoQZcWvdgi9M8mAiL3+gjawFfKto=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: potentially split trace_io() out message
Message-Id: <E1rE3dy-0005rY-GU@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:34:02 +0000

commit cf40abbc7ff2a73eaaea84e919fc7762354e75ad
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 23 17:08:34 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Dec 12 10:14:12 2023 +0000

    tools/xenstored: potentially split trace_io() out message
    
    Today write_messages() will call trace_io() after having written the
    complete message to the ring buffer or socket.
    
    In case the message can't be written in one go, split it by writing
    one trace entry when starting the write and one when finishing it.
    
    In order to distinguish a complete OUT message from a split one, let the
    caller of trace_io specify the prefix string ("IN", "OUT", "OUT(START)",
    "OUT(END)") directly instead via an int.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 tools/xenstored/core.c | 30 ++++++++++++++++++++----------
 1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index 31968df0ce..d4c76d71dc 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -121,7 +121,7 @@ void trace(const char *fmt, ...)
 
 static void trace_io(const struct connection *conn,
 		     const struct buffered_data *data,
-		     int out)
+		     const char *type)
 {
 	unsigned int i;
 	time_t now;
@@ -134,8 +134,7 @@ static void trace_io(const struct connection *conn,
 	tm = localtime(&now);
 
 	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,
+	      type, 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));
 	
@@ -321,43 +320,54 @@ static bool write_messages(struct connection *conn)
 {
 	int ret;
 	struct buffered_data *out;
+	bool started = false;
 
 	out = list_top(&conn->out_list, struct buffered_data, list);
 	if (out == NULL)
 		return true;
 
 	if (out->inhdr) {
+		started = !out->used;
 		ret = conn->funcs->write(conn, out->hdr.raw + out->used,
 					 sizeof(out->hdr) - out->used);
 		if (ret < 0)
-			return false;
+			goto err;
 
 		out->used += ret;
 		if (out->used < sizeof(out->hdr))
-			return true;
+			goto start;
 
 		out->inhdr = false;
 		out->used = 0;
 
 		/* Second write might block if non-zero. */
 		if (out->hdr.msg.len && !conn->domain)
-			return true;
+			goto start;
 	}
 
 	ret = conn->funcs->write(conn, out->buffer + out->used,
 				 out->hdr.msg.len - out->used);
 	if (ret < 0)
-		return false;
+		goto err;
 
 	out->used += ret;
 	if (out->used != out->hdr.msg.len)
-		return true;
+		goto start;
 
-	trace_io(conn, out, 1);
+	trace_io(conn, out, started ? "OUT" : "OUT(END)");
 
 	free_buffered_data(out, conn);
 
 	return true;
+
+ err:
+	trace_io(conn, out, "OUT(ERR)");
+	return false;
+
+ start:
+	if (started)
+		trace_io(conn, out, "OUT(START)");
+	return true;
 }
 
 static int undelay_request(void *_req)
@@ -2067,7 +2077,7 @@ static void process_message(struct connection *conn, struct buffered_data *in)
 
 	/* At least send_error() and send_reply() expects conn->in == in */
 	assert(conn->in == in);
-	trace_io(conn, in, 0);
+	trace_io(conn, in, "IN");
 
 	if ((unsigned int)type >= XS_TYPE_COUNT || !wire_funcs[type].func) {
 		eprintf("Client unknown operation %i", type);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:34:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:34:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654928.1022439 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3e9-0003Gv-Qg; Fri, 15 Dec 2023 08:34:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654928.1022439; Fri, 15 Dec 2023 08: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 1rE3e9-0003Gn-Ns; Fri, 15 Dec 2023 08:34:13 +0000
Received: by outflank-mailman (input) for mailman id 654928;
 Fri, 15 Dec 2023 08: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 1rE3e8-0003Gd-L8
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3e8-0000kl-KJ
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:34:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3e8-0005sN-JT
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=DZz0ylK54MHevQKnLTUbO5ePTNEXWma1h0OkignPvCk=; b=PIQtJdPw7lu8ffzekvZZmuHTFM
	7HtbQOYszwxOs03U8kDmGEwXBQpKpGL0lTtBqgHhnUPgbKNH7UrXp662IHYfxwUs0o9zPoUYPz2e7
	fyn7NjnfgscBtWXLXNFZ/CkQalHi8DrZvIKViWZZPWxNdVTPS6ekAOjj2FpX+yo69sDY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: set -mno-unaligned-access compiler option for Arm32
Message-Id: <E1rE3e8-0005sN-JT@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:34:12 +0000

commit 3e3ff7f9cddfeb3d972bd20c4e0be5e08c6b3dcb
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Dec 11 14:16:14 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Dec 12 11:41:49 2023 +0000

    xen/arm: set -mno-unaligned-access compiler option for Arm32
    
    As the hypervisor is disabling unaligned accesses for Arm32, set the
    -mno-unaligned-access compiler option for building. This will prohibit
    unaligned accesses when e.g. accessing 2- or 4-byte data items in
    packed data structures.
    
    Backport: 4.15+
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/arch.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/arm/arch.mk b/xen/arch/arm/arch.mk
index 58db76c4e1..022dcda192 100644
--- a/xen/arch/arm/arch.mk
+++ b/xen/arch/arm/arch.mk
@@ -7,6 +7,7 @@ $(call cc-option-add,CFLAGS,CC,-Wnested-externs)
 # Prevent floating-point variables from creeping into Xen.
 CFLAGS-$(CONFIG_ARM_32) += -msoft-float
 CFLAGS-$(CONFIG_ARM_32) += -mcpu=cortex-a15
+CFLAGS-$(CONFIG_ARM_32) += -mno-unaligned-access
 
 CFLAGS-$(CONFIG_ARM_64) += -mcpu=generic
 CFLAGS-$(CONFIG_ARM_64) += -mgeneral-regs-only # No fp registers etc
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:34:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:34:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654929.1022444 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3eJ-0003JZ-SH; Fri, 15 Dec 2023 08:34:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654929.1022444; Fri, 15 Dec 2023 08: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 1rE3eJ-0003JR-PP; Fri, 15 Dec 2023 08:34:23 +0000
Received: by outflank-mailman (input) for mailman id 654929;
 Fri, 15 Dec 2023 08: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 1rE3eI-0003JH-O8
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3eI-0000ks-NG
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:34:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3eI-0005t8-MS
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=/4h7ftk8h/XXYCy82JSwvfNfLrXJj2Gu96nHUrJgHOU=; b=4YSaJdbknKShGy8/J6pXbBTQj+
	LkWN9tG1noRfzbBOtGZLuXLZqyaXZKyzZP8SYoHoRxP6DJbTFFVo4rHmUBuXYXoHuxDEvE/fDsEpV
	od8RLBzOE411ww53jfbn/yKCR0TPeTF8whtEGel+AMksSlhpvtFMSPWe+tgVR6OIEbHU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: make include/xen/unaligned.h usable on all architectures
Message-Id: <E1rE3eI-0005t8-MS@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:34:22 +0000

commit 6c4be4950391d77b78e824d41115def397dbc487
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Dec 11 14:16:15 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Dec 12 11:41:49 2023 +0000

    xen: make include/xen/unaligned.h usable on all architectures
    
    Instead of defining get_unaligned() and put_unaligned() in a way that
    is only supporting architectures allowing unaligned accesses, use the
    same approach as the Linux kernel and let the compiler do the
    decision how to generate the code for probably unaligned data accesses.
    
    Update include/xen/unaligned.h from include/asm-generic/unaligned.h of
    the Linux kernel.
    
    The generated code has been checked to be the same on x86.
    
    Modify the Linux variant to not use underscore prefixed identifiers,
    avoid unneeded parentheses and drop the 24-bit accessors.
    
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 803f4e1eab7a
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/unaligned.h | 53 +++++++++++++++++++++++++--------------------
 1 file changed, 30 insertions(+), 23 deletions(-)

diff --git a/xen/include/xen/unaligned.h b/xen/include/xen/unaligned.h
index 0a2b16d05d..3eda0ece11 100644
--- a/xen/include/xen/unaligned.h
+++ b/xen/include/xen/unaligned.h
@@ -1,12 +1,4 @@
-/*
- * This header can be used by architectures where unaligned accesses work
- * without faulting, and at least reasonably efficiently.  Other architectures
- * will need to have a custom asm/unaligned.h.
- */
-#ifndef __ASM_UNALIGNED_H__
-#error "xen/unaligned.h should not be included directly - include asm/unaligned.h instead"
-#endif
-
+/* SPDX-License-Identifier: GPL-2.0 */
 #ifndef __XEN_UNALIGNED_H__
 #define __XEN_UNALIGNED_H__
 
@@ -15,67 +7,82 @@
 #include <asm/byteorder.h>
 #endif
 
-#define get_unaligned(p) (*(p))
-#define put_unaligned(val, p) (*(p) = (val))
+/*
+ * This is the most generic implementation of unaligned accesses
+ * and should work almost anywhere.
+ */
+
+#define get_unaligned_t(type, ptr) ({					\
+	const struct { type x; } __packed *ptr_ = (typeof(ptr_))(ptr);	\
+	ptr_->x;							\
+})
+
+#define put_unaligned_t(type, val, ptr) do {				\
+	struct { type x; } __packed *ptr_ = (typeof(ptr_))(ptr);	\
+	ptr_->x = val;							\
+} while (0)
+
+#define get_unaligned(ptr)	get_unaligned_t(typeof(*(ptr)), ptr)
+#define put_unaligned(val, ptr) put_unaligned_t(typeof(*(ptr)), val, ptr)
 
 static inline uint16_t get_unaligned_be16(const void *p)
 {
-	return be16_to_cpup(p);
+	return be16_to_cpu(get_unaligned_t(__be16, p));
 }
 
 static inline void put_unaligned_be16(uint16_t val, void *p)
 {
-	*(__force __be16*)p = cpu_to_be16(val);
+	put_unaligned_t(__be16, cpu_to_be16(val), p);
 }
 
 static inline uint32_t get_unaligned_be32(const void *p)
 {
-	return be32_to_cpup(p);
+	return be32_to_cpu(get_unaligned_t(__be32, p));
 }
 
 static inline void put_unaligned_be32(uint32_t val, void *p)
 {
-	*(__force __be32*)p = cpu_to_be32(val);
+	put_unaligned_t(__be32, cpu_to_be32(val), p);
 }
 
 static inline uint64_t get_unaligned_be64(const void *p)
 {
-	return be64_to_cpup(p);
+	return be64_to_cpu(get_unaligned_t(__be64, p));
 }
 
 static inline void put_unaligned_be64(uint64_t val, void *p)
 {
-	*(__force __be64*)p = cpu_to_be64(val);
+	put_unaligned_t(__be64, cpu_to_be64(val), p);
 }
 
 static inline uint16_t get_unaligned_le16(const void *p)
 {
-	return le16_to_cpup(p);
+	return le16_to_cpu(get_unaligned_t(__le16, p));
 }
 
 static inline void put_unaligned_le16(uint16_t val, void *p)
 {
-	*(__force __le16*)p = cpu_to_le16(val);
+	put_unaligned_t(__le16, cpu_to_le16(val), p);
 }
 
 static inline uint32_t get_unaligned_le32(const void *p)
 {
-	return le32_to_cpup(p);
+	return le32_to_cpu(get_unaligned_t(__le32, p));
 }
 
 static inline void put_unaligned_le32(uint32_t val, void *p)
 {
-	*(__force __le32*)p = cpu_to_le32(val);
+	put_unaligned_t(__le32, cpu_to_le32(val), p);
 }
 
 static inline uint64_t get_unaligned_le64(const void *p)
 {
-	return le64_to_cpup(p);
+	return le64_to_cpu(get_unaligned_t(__le64, p));
 }
 
 static inline void put_unaligned_le64(uint64_t val, void *p)
 {
-	*(__force __le64*)p = cpu_to_le64(val);
+	put_unaligned_t(__le64, cpu_to_le64(val), p);
 }
 
 #endif /* __XEN_UNALIGNED_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:34:34 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:34:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654930.1022449 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3eT-0003M7-Ty; Fri, 15 Dec 2023 08:34:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654930.1022449; Fri, 15 Dec 2023 08: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 1rE3eT-0003Lz-Qn; Fri, 15 Dec 2023 08:34:33 +0000
Received: by outflank-mailman (input) for mailman id 654930;
 Fri, 15 Dec 2023 08: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 1rE3eS-0003Lq-RK
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3eS-0000l2-QS
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:34:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3eS-0005tt-Pc
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=vDMGUlSi4VAZ2bJzEnkEBE1VQAzCa6ssb4LGwnYPVKc=; b=fAGcPlWZUqOlw5eIp2VFOacynG
	Jl3vNC0jNOzEXvRRrvgxlf0IzEVyIHYfNKwT3HIKN7Uy62PYtQiR6M7rKKeUSMdQw7gqLSnAtTLEU
	c+2KyMVdMA+USCeUcTQ8zrhB4UPmBKD3YPDTMxGsD/PICQXJfavvK1WFCXhhYQRRYsGo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: remove asm/unaligned.h
Message-Id: <E1rE3eS-0005tt-Pc@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:34:32 +0000

commit 6619c6f8913a8c7b2b980dd49a430c62ce6ce5ab
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Dec 11 14:16:16 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Dec 12 11:41:49 2023 +0000

    xen: remove asm/unaligned.h
    
    With include/xen/unaligned.h now dealing properly with unaligned
    accesses for all architectures, asm/unaligned.h can be removed and
    users can be switched to include xen/unaligned.h instead.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/unaligned.h | 6 ------
 xen/common/lz4/defs.h                | 2 +-
 xen/common/lzo.c                     | 2 +-
 xen/common/unlzo.c                   | 2 +-
 xen/common/xz/private.h              | 2 +-
 xen/common/zstd/mem.h                | 2 +-
 xen/lib/xxhash32.c                   | 2 +-
 xen/lib/xxhash64.c                   | 2 +-
 8 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/include/asm/unaligned.h b/xen/arch/x86/include/asm/unaligned.h
deleted file mode 100644
index 6070801d4a..0000000000
--- a/xen/arch/x86/include/asm/unaligned.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ASM_UNALIGNED_H__
-#define __ASM_UNALIGNED_H__
-
-#include <xen/unaligned.h>
-
-#endif /* __ASM_UNALIGNED_H__ */
diff --git a/xen/common/lz4/defs.h b/xen/common/lz4/defs.h
index 10609f5a53..6d81113266 100644
--- a/xen/common/lz4/defs.h
+++ b/xen/common/lz4/defs.h
@@ -10,7 +10,7 @@
 
 #ifdef __XEN__
 #include <asm/byteorder.h>
-#include <asm/unaligned.h>
+#include <xen/unaligned.h>
 #else
 
 static inline u16 get_unaligned_le16(const void *p)
diff --git a/xen/common/lzo.c b/xen/common/lzo.c
index a87c76dded..cc03f0f554 100644
--- a/xen/common/lzo.c
+++ b/xen/common/lzo.c
@@ -97,7 +97,7 @@
 #ifdef __XEN__
 #include <xen/lib.h>
 #include <asm/byteorder.h>
-#include <asm/unaligned.h>
+#include <xen/unaligned.h>
 #else
 #define get_unaligned_le16(_p) (*(u16 *)(_p))
 #endif
diff --git a/xen/common/unlzo.c b/xen/common/unlzo.c
index 74056778eb..bdcefa95b3 100644
--- a/xen/common/unlzo.c
+++ b/xen/common/unlzo.c
@@ -34,7 +34,7 @@
 
 #ifdef __XEN__
 #include <asm/byteorder.h>
-#include <asm/unaligned.h>
+#include <xen/unaligned.h>
 #else
 
 static inline u16 get_unaligned_be16(const void *p)
diff --git a/xen/common/xz/private.h b/xen/common/xz/private.h
index e6814250e8..2299705378 100644
--- a/xen/common/xz/private.h
+++ b/xen/common/xz/private.h
@@ -13,7 +13,7 @@
 #ifdef __XEN__
 #include <xen/kernel.h>
 #include <asm/byteorder.h>
-#include <asm/unaligned.h>
+#include <xen/unaligned.h>
 #else
 
 static inline u32 get_unaligned_le32(const void *p)
diff --git a/xen/common/zstd/mem.h b/xen/common/zstd/mem.h
index 2acae6a8ed..ae1e305126 100644
--- a/xen/common/zstd/mem.h
+++ b/xen/common/zstd/mem.h
@@ -23,7 +23,7 @@
 #ifdef __XEN__
 #include <xen/string.h> /* memcpy */
 #include <xen/types.h>  /* size_t, ptrdiff_t */
-#include <asm/unaligned.h>
+#include <xen/unaligned.h>
 #endif
 
 /*-****************************************
diff --git a/xen/lib/xxhash32.c b/xen/lib/xxhash32.c
index e8d403e5ce..32efa651c5 100644
--- a/xen/lib/xxhash32.c
+++ b/xen/lib/xxhash32.c
@@ -42,7 +42,7 @@
 #include <xen/errno.h>
 #include <xen/string.h>
 #include <xen/xxhash.h>
-#include <asm/unaligned.h>
+#include <xen/unaligned.h>
 
 /*-*************************************
  * Macros
diff --git a/xen/lib/xxhash64.c b/xen/lib/xxhash64.c
index 481e76fbcf..1858e236fe 100644
--- a/xen/lib/xxhash64.c
+++ b/xen/lib/xxhash64.c
@@ -43,7 +43,7 @@
 #include <xen/errno.h>
 #include <xen/string.h>
 #include <xen/xxhash.h>
-#include <asm/unaligned.h>
+#include <xen/unaligned.h>
 #endif
 
 /*-*************************************
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:34:44 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:34:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654931.1022452 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3ee-0003PH-0I; Fri, 15 Dec 2023 08:34:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654931.1022452; Fri, 15 Dec 2023 08: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 1rE3ed-0003P9-U1; Fri, 15 Dec 2023 08:34:43 +0000
Received: by outflank-mailman (input) for mailman id 654931;
 Fri, 15 Dec 2023 08:34: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 1rE3ec-0003Oy-UG
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:34: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 1rE3ec-0000l9-TU
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:34:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3ec-0005uz-Se
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=vYdugWZJYBzsg0cFkPYVRA8kn8botUYoZzsICZHev6U=; b=XqEykAZaLu3sE4d3GIMsctL6eE
	6SUpcPFSXvEF+XyDMILNrOUt1GPg/LwmTXs7GkACxV2Z6+TplG//EoURMPgMeQb8MH/t9mUHOvkNM
	MdEyVN/fOnu3apdSyb5Zjt86DoHaD2HI51XLi7fzZ400mwZ//Lmz2Paihnc9KpKsQYV8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] MAINTAINERS: Hand over the release manager role to Oleksii Kurochko
Message-Id: <E1rE3ec-0005uz-Se@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:34:42 +0000

commit 0fb4b6b0ea8505fbd4888faa440212e878002494
Author:     Henry Wang <Henry.Wang@arm.com>
AuthorDate: Fri Dec 8 00:20:36 2023 +0800
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Dec 12 11:46:08 2023 +0000

    MAINTAINERS: Hand over the release manager role to Oleksii Kurochko
    
    I've finished the opportunity to do two releases (4.17 and 4.18)
    and Oleksii Kurochko has volunteered to be the next release manager.
    Hand over the role to him by changing the maintainership of the
    CHANGELOG.md.
    
    Signed-off-by: Henry Wang <Henry.Wang@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 0fcf5a6f36..702032cc12 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -278,7 +278,7 @@ S:	Supported
 F:	xen/drivers/passthrough/arm/smmu-v3.c
 
 Change Log
-M:	Henry Wang <Henry.Wang@arm.com>
+M:	Oleksii Kurochko <oleksii.kurochko@gmail.com>
 R:	Community Manager <community.manager@xenproject.org>
 S:	Maintained
 F:	CHANGELOG.md
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:34:54 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:34:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654932.1022456 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3eo-0003Rl-1f; Fri, 15 Dec 2023 08:34:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654932.1022456; Fri, 15 Dec 2023 08: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 1rE3en-0003Rd-VT; Fri, 15 Dec 2023 08:34:53 +0000
Received: by outflank-mailman (input) for mailman id 654932;
 Fri, 15 Dec 2023 08: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 1rE3en-0003RS-0w
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3en-0000lf-07
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:34:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3em-0005w8-Vc
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:34: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=iZYxVO4gKBm4F2JWLeP/ohpAu5FsXRbjqOl2JIs/bFU=; b=hZymYfidNNqMu6slfWbQSJPbOa
	Sf52CFlYfuo/t9YQJ4/KUdx3s1wGAWPZsReBpcDOjvqb/SfQgMlDeEvb1Mv/MQOE9qNC3eIG2yaWV
	K7fla5Dk5lc7JDcgHZrcdnAzLXVSChkliLue7m8Z84SnA84ly1Ca3kLmtjTE4dBfBgGM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: page: Avoid pointer overflow on cache clean & invalidate
Message-Id: <E1rE3em-0005w8-Vc@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:34:52 +0000

commit 190b7f49af6487a9665da63d43adc9d9a5fbd01e
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Thu Nov 23 15:53:02 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 12 14:01:00 2023 +0100

    xen/arm: page: Avoid pointer overflow on cache clean & invalidate
    
    On Arm32, after cleaning and invalidating the last dcache line of the top
    domheap page i.e. VA = 0xfffff000 (as a result of flushing the page to
    RAM), we end up adding the value of a dcache line size to the pointer
    once again, which results in a pointer arithmetic overflow (with 64B line
    size, operation 0xffffffc0 + 0x40 overflows to 0x0). Such behavior is
    undefined and given the wide range of compiler versions we support, it is
    difficult to determine what could happen in such scenario.
    
    Modify clean_and_invalidate_dcache_va_range() as well as
    clean_dcache_va_range() and invalidate_dcache_va_range() due to similarity
    of handling to prevent pointer arithmetic overflow. Modify the loops to
    use an additional variable to store the index of the next cacheline.
    Add an assert to prevent passing a region that wraps around which is
    illegal and would end up in a page fault anyway (region 0-2MB is
    unmapped). Lastly, return early if size passed is 0.
    
    Note that on Arm64, we don't have this problem given that the max VA
    space we support is 48-bits.
    
    This is XSA-447 / CVE-2023-46837.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/include/asm/page.h | 35 ++++++++++++++++++++++++++++-------
 1 file changed, 28 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/include/asm/page.h b/xen/arch/arm/include/asm/page.h
index ebaf5964f1..69f817d1e6 100644
--- a/xen/arch/arm/include/asm/page.h
+++ b/xen/arch/arm/include/asm/page.h
@@ -162,6 +162,13 @@ static inline size_t read_dcache_line_bytes(void)
 static inline int invalidate_dcache_va_range(const void *p, unsigned long size)
 {
     size_t cacheline_mask = dcache_line_bytes - 1;
+    unsigned long idx = 0;
+
+    if ( !size )
+        return 0;
+
+    /* Passing a region that wraps around is illegal */
+    ASSERT(((uintptr_t)p + size - 1) >= (uintptr_t)p);
 
     dsb(sy);           /* So the CPU issues all writes to the range */
 
@@ -174,11 +181,11 @@ static inline int invalidate_dcache_va_range(const void *p, unsigned long size)
     }
 
     for ( ; size >= dcache_line_bytes;
-            p += dcache_line_bytes, size -= dcache_line_bytes )
-        asm volatile (__invalidate_dcache_one(0) : : "r" (p));
+            idx += dcache_line_bytes, size -= dcache_line_bytes )
+        asm volatile (__invalidate_dcache_one(0) : : "r" (p + idx));
 
     if ( size > 0 )
-        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p));
+        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p + idx));
 
     dsb(sy);           /* So we know the flushes happen before continuing */
 
@@ -188,14 +195,21 @@ static inline int invalidate_dcache_va_range(const void *p, unsigned long size)
 static inline int clean_dcache_va_range(const void *p, unsigned long size)
 {
     size_t cacheline_mask = dcache_line_bytes - 1;
+    unsigned long idx = 0;
+
+    if ( !size )
+        return 0;
+
+    /* Passing a region that wraps around is illegal */
+    ASSERT(((uintptr_t)p + size - 1) >= (uintptr_t)p);
 
     dsb(sy);           /* So the CPU issues all writes to the range */
     size += (uintptr_t)p & cacheline_mask;
     size = (size + cacheline_mask) & ~cacheline_mask;
     p = (void *)((uintptr_t)p & ~cacheline_mask);
     for ( ; size >= dcache_line_bytes;
-            p += dcache_line_bytes, size -= dcache_line_bytes )
-        asm volatile (__clean_dcache_one(0) : : "r" (p));
+            idx += dcache_line_bytes, size -= dcache_line_bytes )
+        asm volatile (__clean_dcache_one(0) : : "r" (p + idx));
     dsb(sy);           /* So we know the flushes happen before continuing */
     /* ARM callers assume that dcache_* functions cannot fail. */
     return 0;
@@ -205,14 +219,21 @@ static inline int clean_and_invalidate_dcache_va_range
     (const void *p, unsigned long size)
 {
     size_t cacheline_mask = dcache_line_bytes - 1;
+    unsigned long idx = 0;
+
+    if ( !size )
+        return 0;
+
+    /* Passing a region that wraps around is illegal */
+    ASSERT(((uintptr_t)p + size - 1) >= (uintptr_t)p);
 
     dsb(sy);         /* So the CPU issues all writes to the range */
     size += (uintptr_t)p & cacheline_mask;
     size = (size + cacheline_mask) & ~cacheline_mask;
     p = (void *)((uintptr_t)p & ~cacheline_mask);
     for ( ; size >= dcache_line_bytes;
-            p += dcache_line_bytes, size -= dcache_line_bytes )
-        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p));
+            idx += dcache_line_bytes, size -= dcache_line_bytes )
+        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p + idx));
     dsb(sy);         /* So we know the flushes happen before continuing */
     /* ARM callers assume that dcache_* functions cannot fail. */
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:35:04 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:35:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654933.1022459 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3ey-0003UC-3D; Fri, 15 Dec 2023 08:35:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654933.1022459; Fri, 15 Dec 2023 08: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 1rE3ey-0003U4-0f; Fri, 15 Dec 2023 08:35:04 +0000
Received: by outflank-mailman (input) for mailman id 654933;
 Fri, 15 Dec 2023 08: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 1rE3ex-0003Tu-3r
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3ex-0000lz-39
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:35:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3ex-0005xY-2L
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=3IU9HZy+vq73p3SrD4D9/5zRz04yfjgDg1F6TSKDtPo=; b=xDElvoQU6cjPL5dD1H2b9yp+7N
	4zTZcDZbImhvq+z8XexeTuun4fDivZCUoIlKvCsUyrWfEpXZW9rTDWVGsmN2a7kFHWzHRW60/otT9
	KQLE7MkstDB28BrLnxWLUkXTOJo+JQG/qFlrKH60mWo16rgVYYrylKuvYvRl7piSdI4k=;
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: <E1rE3ex-0005xY-2L@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:35:03 +0000

commit 431ada87e574f004001193a4ad44dda435dd0361
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Tue Dec 12 14:01:56 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 12 14:01:56 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>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/acpi/apei.h                   |  5 +++--
 xen/include/acpi/cpufreq/cpufreq.h        |  2 +-
 xen/include/acpi/cpufreq/processor_perf.h | 16 ++++++++--------
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/xen/include/acpi/apei.h b/xen/include/acpi/apei.h
index eab16e2543..495819e362 100644
--- a/xen/include/acpi/apei.h
+++ b/xen/include/acpi/apei.h
@@ -12,8 +12,9 @@
 
 #define FIX_APEI_RANGE_MAX 64
 
-typedef int (*apei_hest_func_t)(const struct acpi_hest_header *, void *);
-int apei_hest_parse(apei_hest_func_t, void *);
+typedef int (*apei_hest_func_t)(const struct acpi_hest_header *hest_hdr,
+                                void *data);
+int apei_hest_parse(apei_hest_func_t func, void *data);
 
 int erst_write(const struct cper_record_header *record);
 ssize_t erst_get_record_count(void);
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 3456d4c95f..b4685a9085 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -177,7 +177,7 @@ struct cpufreq_driver {
 
 extern struct cpufreq_driver cpufreq_driver;
 
-int cpufreq_register_driver(const struct cpufreq_driver *);
+int cpufreq_register_driver(const struct cpufreq_driver *driver_data);
 
 static inline
 void cpufreq_verify_within_limits(struct cpufreq_policy *policy,
diff --git a/xen/include/acpi/cpufreq/processor_perf.h b/xen/include/acpi/cpufreq/processor_perf.h
index 8b5a1b9bde..7cd2400619 100644
--- a/xen/include/acpi/cpufreq/processor_perf.h
+++ b/xen/include/acpi/cpufreq/processor_perf.h
@@ -10,16 +10,16 @@
 int powernow_cpufreq_init(void);
 unsigned int powernow_register_driver(void);
 unsigned int get_measured_perf(unsigned int cpu, unsigned int flag);
-void cpufreq_residency_update(unsigned int, uint8_t);
-void cpufreq_statistic_update(unsigned int, uint8_t, uint8_t);
-int  cpufreq_statistic_init(unsigned int);
-void cpufreq_statistic_exit(unsigned int);
-void cpufreq_statistic_reset(unsigned int);
+void cpufreq_residency_update(unsigned int cpu, uint8_t state);
+void cpufreq_statistic_update(unsigned int cpu, uint8_t from, uint8_t to);
+int  cpufreq_statistic_init(unsigned int cpuid);
+void cpufreq_statistic_exit(unsigned int cpuid);
+void cpufreq_statistic_reset(unsigned int cpuid);
 
-int  cpufreq_limit_change(unsigned int);
+int  cpufreq_limit_change(unsigned int cpu);
 
-int  cpufreq_add_cpu(unsigned int);
-int  cpufreq_del_cpu(unsigned int);
+int  cpufreq_add_cpu(unsigned int cpu);
+int  cpufreq_del_cpu(unsigned int cpu);
 
 struct processor_performance {
     uint32_t state;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:35:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:35:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654934.1022464 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3f8-0003X1-4z; Fri, 15 Dec 2023 08:35:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654934.1022464; Fri, 15 Dec 2023 08: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 1rE3f8-0003Wr-25; Fri, 15 Dec 2023 08:35:14 +0000
Received: by outflank-mailman (input) for mailman id 654934;
 Fri, 15 Dec 2023 08: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 1rE3f7-0003Wh-75
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3f7-0000m8-6B
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:35:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3f7-0005yc-5T
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=k1yMALbaXIIzBajYRamv3zQv4xB2d+fcOWCj7Wo3lO4=; b=oMjYj8K/GvDtOwJcULrUFyAjX3
	YvecvBO9u8lUapq+zj6wnOV2YdB0HvPEOxQr+3nMa6LV9+L5OSvUvEHqiSzeYyqOH2Bepoe8U5+1g
	UgyhERO9zcP7prVRawMzp4Agv2OSLgwUw0DC5LSlt6/Hxewv0LFRcTNB8IxgGAeyjafI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mm: remove compat_subarch_memory_op()
Message-Id: <E1rE3f7-0005yc-5T@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:35:13 +0000

commit fbc8cff877e5e0243a7bef3fbbc9d06a269051e8
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Tue Dec 12 14:02:25 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 12 14:02:25 2023 +0100

    x86/mm: remove compat_subarch_memory_op()
    
    Remove remove compat_subarch_memory_op() declaration: there is no
    definition and there are no calls to such function in the XEN project.
    
    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/mm.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index 05dfe35502..639163948e 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -573,7 +573,6 @@ int __sync_local_execstate(void);
 long arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg);
 long subarch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg);
 int compat_arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void));
-int compat_subarch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void));
 
 #define NIL(type) ((type *)-sizeof(type))
 #define IS_NIL(ptr) (!((uintptr_t)(ptr) + sizeof(*(ptr))))
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:35:24 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:35:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654935.1022468 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3fI-0003Zx-6J; Fri, 15 Dec 2023 08:35:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654935.1022468; Fri, 15 Dec 2023 08: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 1rE3fI-0003Zp-3X; Fri, 15 Dec 2023 08:35:24 +0000
Received: by outflank-mailman (input) for mailman id 654935;
 Fri, 15 Dec 2023 08: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 1rE3fH-0003Zh-9z
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3fH-0000mG-9G
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:35:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3fH-0005zU-8X
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=BL1fQt0IERtBTh+DMIUNKKSS6kS5TjRuve2Mg2ohoNo=; b=GHpu7eLpBtDggKdppwjv/erAvQ
	bijEE1Js/YgtfQBQ3GpxiSt8yJf9HI+m8h15HGKwT6Vio2c1gmxV/Y7bCJO7W17ObNv5iTkYI/XjT
	JCwTFvUJcIhzhsEKUL1cJDEjxUZVNAZ/jmsR6TRnFVU02NT84CU97ur5MdumU9jz8Q+8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mm: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1rE3fH-0005zU-8X@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:35:23 +0000

commit 6d5e94ca7dc1a121b94e44c1a2eee678f58c9b38
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Tue Dec 12 14:02:58 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 12 14:02:58 2023 +0100

    x86/mm: 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/arch/x86/include/asm/mm.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index 639163948e..7d26d9cd2f 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -406,7 +406,7 @@ void put_page_type(struct page_info *page);
 int  get_page_type(struct page_info *page, unsigned long type);
 int  put_page_type_preemptible(struct page_info *page);
 int  get_page_type_preemptible(struct page_info *page, unsigned long type);
-int  put_old_guest_table(struct vcpu *);
+int  put_old_guest_table(struct vcpu *v);
 int  get_page_from_l1e(
     l1_pgentry_t l1e, struct domain *l1e_owner, struct domain *pg_owner);
 void put_page_from_l1e(l1_pgentry_t l1e, struct domain *l1e_owner);
@@ -557,7 +557,7 @@ void audit_domains(void);
 
 void make_cr3(struct vcpu *v, mfn_t mfn);
 pagetable_t update_cr3(struct vcpu *v);
-int vcpu_destroy_pagetables(struct vcpu *);
+int vcpu_destroy_pagetables(struct vcpu *v);
 void *do_page_walk(struct vcpu *v, unsigned long addr);
 
 /* Allocator functions for Xen pagetables. */
@@ -572,19 +572,19 @@ int __sync_local_execstate(void);
 /* Arch-specific portion of memory_op hypercall. */
 long arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg);
 long subarch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg);
-int compat_arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void));
+int compat_arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg);
 
 #define NIL(type) ((type *)-sizeof(type))
 #define IS_NIL(ptr) (!((uintptr_t)(ptr) + sizeof(*(ptr))))
 
-int create_perdomain_mapping(struct domain *, unsigned long va,
-                             unsigned int nr, l1_pgentry_t **,
-                             struct page_info **);
-void destroy_perdomain_mapping(struct domain *, unsigned long va,
+int create_perdomain_mapping(struct domain *d, unsigned long va,
+                             unsigned int nr, l1_pgentry_t **pl1tab,
+                             struct page_info **ppg);
+void destroy_perdomain_mapping(struct domain *d, unsigned long va,
                                unsigned int nr);
-void free_perdomain_mappings(struct domain *);
+void free_perdomain_mappings(struct domain *d);
 
-void __iomem *ioremap_wc(paddr_t, size_t);
+void __iomem *ioremap_wc(paddr_t pa, size_t len);
 
 extern int memory_add(unsigned long spfn, unsigned long epfn, unsigned int pxm);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:35:34 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:35:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654936.1022472 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3fS-0003ci-7j; Fri, 15 Dec 2023 08:35:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654936.1022472; Fri, 15 Dec 2023 08: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 1rE3fS-0003cb-51; Fri, 15 Dec 2023 08:35:34 +0000
Received: by outflank-mailman (input) for mailman id 654936;
 Fri, 15 Dec 2023 08: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 1rE3fR-0003cK-DD
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3fR-0000mN-CP
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:35:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3fR-00060I-BZ
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=98gESv7n+4Qb3FKuPNv0ifPzFijfkGh03/0r4pxkdko=; b=5w2mP8iymX7JHwg/7ZUXsp9UTy
	NqxbBDdB9GShF0Fz5CK6bJymOagMVK3j+/jzndPdNQC9I6ZczxY96jZvTVbpvZ4xZ5Y/+okf8HrLw
	iLXUoNxDGjF/SNRkvOZi0AFxUq1czQsAYEsBPAQgn5cVgZxGkvJftD23I/hikYP/1VDU=;
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 8.2
Message-Id: <E1rE3fR-00060I-BZ@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:35:33 +0000

commit f0bb77bf734ed5833712205fb839ea03e98cadc7
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Tue Dec 12 14:03:33 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 12 14:03:33 2023 +0100

    AMD/IOMMU: address violations of MISRA C:2012 Rule 8.2
    
    Add missing parameter names to address violations of MISRA C:2012
    Rule 8.2. Remove trailing spaces and use C standard types to comply
    with XEN coding style. 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/drivers/passthrough/amd/iommu.h      | 17 ++++++++++-------
 xen/drivers/passthrough/amd/iommu_init.c | 24 ++++++++++++++----------
 2 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu.h b/xen/drivers/passthrough/amd/iommu.h
index d4416ebc43..1b62c083ba 100644
--- a/xen/drivers/passthrough/amd/iommu.h
+++ b/xen/drivers/passthrough/amd/iommu.h
@@ -138,10 +138,12 @@ struct ivrs_mappings {
 extern unsigned int ivrs_bdf_entries;
 extern u8 ivhd_type;
 
-struct ivrs_mappings *get_ivrs_mappings(u16 seg);
-int iterate_ivrs_mappings(int (*)(u16 seg, struct ivrs_mappings *));
-int iterate_ivrs_entries(int (*)(const struct amd_iommu *,
-                                 struct ivrs_mappings *, uint16_t));
+struct ivrs_mappings *get_ivrs_mappings(uint16_t seg);
+int iterate_ivrs_mappings(int (*handler)(uint16_t seg,
+                                         struct ivrs_mappings *map));
+int iterate_ivrs_entries(int (*handler)(const struct amd_iommu *iommu,
+                                        struct ivrs_mappings *map,
+                                        uint16_t bdf));
 
 /* iommu tables in guest space */
 struct mmio_reg {
@@ -226,7 +228,7 @@ struct acpi_ivrs_hardware;
 /* amd-iommu-detect functions */
 int amd_iommu_get_ivrs_dev_entries(void);
 int amd_iommu_get_supported_ivhd_type(void);
-int amd_iommu_detect_one_acpi(const struct acpi_ivrs_hardware *);
+int amd_iommu_detect_one_acpi(const struct acpi_ivrs_hardware *ivhd_block);
 int amd_iommu_detect_acpi(void);
 void get_iommu_features(struct amd_iommu *iommu);
 
@@ -295,9 +297,10 @@ struct amd_iommu *find_iommu_for_device(int seg, int bdf);
 bool cf_check iov_supports_xt(void);
 int amd_iommu_setup_ioapic_remapping(void);
 void *amd_iommu_alloc_intremap_table(
-    const struct amd_iommu *, unsigned long **, unsigned int nr);
+    const struct amd_iommu *iommu, unsigned long **inuse_map, unsigned int nr);
 int cf_check amd_iommu_free_intremap_table(
-    const struct amd_iommu *, struct ivrs_mappings *, uint16_t);
+    const struct amd_iommu *iommu, struct ivrs_mappings *ivrs_mapping,
+    uint16_t bdf);
 unsigned int amd_iommu_intremap_table_order(
     const void *irt, const struct amd_iommu *iommu);
 void cf_check amd_iommu_ioapic_update_ire(
diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index 5515cb70fd..25e62f20ae 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -300,12 +300,13 @@ static void cf_check set_iommu_ppr_log_control(
 static int iommu_read_log(struct amd_iommu *iommu,
                           struct ring_buffer *log,
                           unsigned int entry_size,
-                          void (*parse_func)(struct amd_iommu *, u32 *))
+                          void (*parse_func)(struct amd_iommu *iommu,
+                                             uint32_t *entry))
 {
     unsigned int tail, tail_offest, head_offset;
 
     BUG_ON(!iommu || ((log != &iommu->event_log) && (log != &iommu->ppr_log)));
-    
+
     spin_lock(&log->lock);
 
     /* make sure there's an entry in the log */
@@ -361,14 +362,15 @@ static int iommu_read_log(struct amd_iommu *iommu,
 
  out:
     spin_unlock(&log->lock);
-   
+
     return 0;
 }
 
 /* reset event log or ppr log when overflow */
 static void iommu_reset_log(struct amd_iommu *iommu,
                             struct ring_buffer *log,
-                            void (*ctrl_func)(struct amd_iommu *iommu, bool))
+                            void (*ctrl_func)(struct amd_iommu *iommu,
+                                              bool enable))
 {
     unsigned int entry, run_bit, loop_count = 1000;
     bool log_run;
@@ -1158,14 +1160,15 @@ static void __init amd_iommu_init_cleanup(void)
     iommuv2_enabled = 0;
 }
 
-struct ivrs_mappings *get_ivrs_mappings(u16 seg)
+struct ivrs_mappings *get_ivrs_mappings(uint16_t seg)
 {
     return radix_tree_lookup(&ivrs_maps, seg);
 }
 
-int iterate_ivrs_mappings(int (*handler)(u16 seg, struct ivrs_mappings *))
+int iterate_ivrs_mappings(int (*handler)(uint16_t seg,
+                                         struct ivrs_mappings *map))
 {
-    u16 seg = 0;
+    uint16_t seg = 0;
     int rc = 0;
 
     do {
@@ -1180,10 +1183,11 @@ int iterate_ivrs_mappings(int (*handler)(u16 seg, struct ivrs_mappings *))
     return rc;
 }
 
-int iterate_ivrs_entries(int (*handler)(const struct amd_iommu *,
-                                        struct ivrs_mappings *, uint16_t bdf))
+int iterate_ivrs_entries(int (*handler)(const struct amd_iommu *iommu,
+                                        struct ivrs_mappings *map,
+                                        uint16_t bdf))
 {
-    u16 seg = 0;
+    uint16_t seg = 0;
     int rc = 0;
 
     do {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:35:44 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:35:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654937.1022475 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3fc-0003fj-AL; Fri, 15 Dec 2023 08:35:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654937.1022475; Fri, 15 Dec 2023 08: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 1rE3fc-0003fc-7t; Fri, 15 Dec 2023 08:35:44 +0000
Received: by outflank-mailman (input) for mailman id 654937;
 Fri, 15 Dec 2023 08: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 1rE3fb-0003fT-GX
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3fb-0000mU-Ft
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:35:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3fb-000615-Ej
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=OTgO8YNFReRF+HEJpcaGB5qwpq01ijDSndb6updayyE=; b=FafYrhjbL4OjIugvqrdne2LUfI
	UdjO7SJeSGuU5PeHicXJi2F82jGo1pbDLk/MMIhSbjD2mv4TqXLHBgqO1xDy9KNWGzHWSTCvQ2GjX
	D4rsIo+w3EPCWHpzv7SdfTX545bDpNCrVEm0sXZ/kU4LUHdePmdAA/yxchGX34Pp0iEY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/sched: address MISRA C:2012 Rule 2.1
Message-Id: <E1rE3fb-000615-Ej@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:35:43 +0000

commit 889af18eee001b73383406c4ba1706dd8baaf0a9
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Tue Dec 12 14:03:58 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 12 14:03:58 2023 +0100

    xen/sched: address MISRA C:2012 Rule 2.1
    
    The break statement after the return statement is definitely unreachable
    and can be removed with no functional change.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: George Dunlap <george.dunlap@cloud.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/sched/core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index f6ac1e5af8..d177c675c8 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -2239,7 +2239,6 @@ static bool sched_tasklet_check_cpu(unsigned int cpu)
         /* fallthrough */
     case TASKLET_enqueued|TASKLET_scheduled:
         return true;
-        break;
     case TASKLET_scheduled:
         clear_bit(_TASKLET_scheduled, tasklet_work);
         /* fallthrough */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:35:54 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:35:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654938.1022480 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3fm-0003iH-CJ; Fri, 15 Dec 2023 08:35:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654938.1022480; Fri, 15 Dec 2023 08:35: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 1rE3fm-0003i8-9J; Fri, 15 Dec 2023 08:35:54 +0000
Received: by outflank-mailman (input) for mailman id 654938;
 Fri, 15 Dec 2023 08: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 1rE3fl-0003i0-Ji
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3fl-0000mr-Iz
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:35:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3fl-00061v-IE
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=wQOPQHGbslx69wkXkhap+voTYGkGqr3lhWd4NXEGYt0=; b=zjIib/4mszPuHz6yaFf9IyceSh
	dDfwVv+DUiwSt1f5/+LH+5HijAFt6GrA5kKkvxA4sQUeCR0L7N1iqQLoYXdTkdEr3fHMTjZUt3Tgq
	t1B1UOCLogARjgLHfrS2DI1cvV+QYk4E3cVVGofowbqubNtrOKu3EzES2Ld4AHNnvIQc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: smmu: move phys_addr_t definition to linux-compat.h
Message-Id: <E1rE3fl-00061v-IE@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:35:53 +0000

commit 35431ecb9db8c925a595f652dfbd1d2641bd2ff0
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Tue Dec 12 14:04:22 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 12 14:04:22 2023 +0100

    xen/arm: smmu: move phys_addr_t definition to linux-compat.h
    
    Both smmu and smmu-v3 (ported from Linux) define the typedef name
    "phys_addr_t": move the type definition to the common header
    linux-compat.h to address violations of MISRA C:2012 Rule 5.6
    ("A typedef name shall be a unique identifier").
    No functional change.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Suggested-by: Julien Grall <julien@xen.org>
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/drivers/passthrough/arm/smmu-v3.h | 1 -
 xen/drivers/passthrough/arm/smmu.c    | 1 -
 xen/include/xen/linux-compat.h        | 2 ++
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/arm/smmu-v3.h b/xen/drivers/passthrough/arm/smmu-v3.h
index 05f6b1fb7e..f09048812c 100644
--- a/xen/drivers/passthrough/arm/smmu-v3.h
+++ b/xen/drivers/passthrough/arm/smmu-v3.h
@@ -377,7 +377,6 @@
 
 /* Linux compatibility functions. */
 typedef paddr_t		dma_addr_t;
-typedef paddr_t		phys_addr_t;
 typedef unsigned int		gfp_t;
 
 /* Alias to Xen lock functions */
diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index 11fc1d22ef..32e2ff279b 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -199,7 +199,6 @@ static inline int pci_for_each_dma_alias(struct pci_dev *pdev,
 
 /* Xen: misc */
 #define PHYS_MASK_SHIFT		PADDR_BITS
-typedef paddr_t phys_addr_t;
 
 #define VA_BITS		0	/* Only used for configuring stage-1 input size */
 
diff --git a/xen/include/xen/linux-compat.h b/xen/include/xen/linux-compat.h
index 8d06bb6dc9..62ba71485c 100644
--- a/xen/include/xen/linux-compat.h
+++ b/xen/include/xen/linux-compat.h
@@ -17,4 +17,6 @@ typedef int16_t __s16;
 typedef int32_t __s32;
 typedef int64_t __s64;
 
+typedef paddr_t phys_addr_t;
+
 #endif /* __XEN_LINUX_COMPAT_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:36:04 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:36:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654939.1022484 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3fw-0003kq-DX; Fri, 15 Dec 2023 08:36:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654939.1022484; Fri, 15 Dec 2023 08:36: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 1rE3fw-0003ki-Aj; Fri, 15 Dec 2023 08:36:04 +0000
Received: by outflank-mailman (input) for mailman id 654939;
 Fri, 15 Dec 2023 08: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 1rE3fv-0003kb-MU
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3fv-0000nG-Lj
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:36:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3fv-00065t-L9
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=UKXjVhmFbc8Y2cfy80uPk2mt+u1j6PyFe5N7z/1/QeA=; b=jkH/24QLYe53Ry7CoDNf4qEgCv
	pYOb1krqGqLvgYXz41QSzarXmJPHuo2+uuOeWyha99xVj6g0UqbNho87rCtl1ixTsqMzTv1nX3EQ2
	kRFwveQVlw1R8kJPxTCPnbj7uHLcvV3KTrv2eUSLNSsrxS2CwRBO1nIBytHsGVcWZAXI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/spinlock: reduce lock profile ifdefs
Message-Id: <E1rE3fv-00065t-L9@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:36:03 +0000

commit a77fcbc3899526dcbb10571d01a289c53d124515
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Dec 12 14:04:47 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 12 14:04:47 2023 +0100

    xen/spinlock: reduce lock profile ifdefs
    
    With some small adjustments to the LOCK_PROFILE_* macros some #ifdefs
    can be dropped from spinlock.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/spinlock.c | 49 +++++++++++++++++++++----------------------------
 1 file changed, 21 insertions(+), 28 deletions(-)

diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
index d5fa400b78..09028af864 100644
--- a/xen/common/spinlock.c
+++ b/xen/common/spinlock.c
@@ -267,25 +267,28 @@ void spin_debug_disable(void)
         lock->profile->time_hold += NOW() - lock->profile->time_locked;      \
         lock->profile->lock_cnt++;                                           \
     }
-#define LOCK_PROFILE_VAR    s_time_t block = 0
-#define LOCK_PROFILE_BLOCK  block = block ? : NOW();
-#define LOCK_PROFILE_GOT                                                     \
+#define LOCK_PROFILE_VAR(var, val)    s_time_t var = (val)
+#define LOCK_PROFILE_BLOCK(var)       var = var ? : NOW()
+#define LOCK_PROFILE_BLKACC(tst, val)                                        \
+    if ( tst )                                                               \
+    {                                                                        \
+        lock->profile->time_block += lock->profile->time_locked - (val);     \
+        lock->profile->block_cnt++;                                          \
+    }
+#define LOCK_PROFILE_GOT(val)                                                \
     if ( lock->profile )                                                     \
     {                                                                        \
         lock->profile->time_locked = NOW();                                  \
-        if ( block )                                                         \
-        {                                                                    \
-            lock->profile->time_block += lock->profile->time_locked - block; \
-            lock->profile->block_cnt++;                                      \
-        }                                                                    \
+        LOCK_PROFILE_BLKACC(val, val);                                       \
     }
 
 #else
 
 #define LOCK_PROFILE_REL
-#define LOCK_PROFILE_VAR
-#define LOCK_PROFILE_BLOCK
-#define LOCK_PROFILE_GOT
+#define LOCK_PROFILE_VAR(var, val)
+#define LOCK_PROFILE_BLOCK(var)
+#define LOCK_PROFILE_BLKACC(tst, val)
+#define LOCK_PROFILE_GOT(val)
 
 #endif
 
@@ -308,7 +311,7 @@ static void always_inline spin_lock_common(spinlock_t *lock,
                                            void (*cb)(void *data), void *data)
 {
     spinlock_tickets_t tickets = SPINLOCK_TICKET_INC;
-    LOCK_PROFILE_VAR;
+    LOCK_PROFILE_VAR(block, 0);
 
     check_lock(&lock->debug, false);
     preempt_disable();
@@ -316,14 +319,14 @@ static void always_inline spin_lock_common(spinlock_t *lock,
                                            tickets.head_tail);
     while ( tickets.tail != observe_head(&lock->tickets) )
     {
-        LOCK_PROFILE_BLOCK;
+        LOCK_PROFILE_BLOCK(block);
         if ( cb )
             cb(data);
         arch_lock_relax();
     }
     arch_lock_acquire_barrier();
     got_lock(&lock->debug);
-    LOCK_PROFILE_GOT;
+    LOCK_PROFILE_GOT(block);
 }
 
 void _spin_lock(spinlock_t *lock)
@@ -411,19 +414,15 @@ int _spin_trylock(spinlock_t *lock)
      * arch_lock_acquire_barrier().
      */
     got_lock(&lock->debug);
-#ifdef CONFIG_DEBUG_LOCK_PROFILE
-    if ( lock->profile )
-        lock->profile->time_locked = NOW();
-#endif
+    LOCK_PROFILE_GOT(0);
+
     return 1;
 }
 
 void _spin_barrier(spinlock_t *lock)
 {
     spinlock_tickets_t sample;
-#ifdef CONFIG_DEBUG_LOCK_PROFILE
-    s_time_t block = NOW();
-#endif
+    LOCK_PROFILE_VAR(block, NOW());
 
     check_barrier(&lock->debug);
     smp_mb();
@@ -432,13 +431,7 @@ void _spin_barrier(spinlock_t *lock)
     {
         while ( observe_head(&lock->tickets) == sample.head )
             arch_lock_relax();
-#ifdef CONFIG_DEBUG_LOCK_PROFILE
-        if ( lock->profile )
-        {
-            lock->profile->time_block += NOW() - block;
-            lock->profile->block_cnt++;
-        }
-#endif
+        LOCK_PROFILE_BLKACC(lock->profile, block);
     }
     smp_mb();
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:36:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:36:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654940.1022487 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3g6-0003nY-Ek; Fri, 15 Dec 2023 08:36:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654940.1022487; Fri, 15 Dec 2023 08:36: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 1rE3g6-0003nQ-CD; Fri, 15 Dec 2023 08:36:14 +0000
Received: by outflank-mailman (input) for mailman id 654940;
 Fri, 15 Dec 2023 08: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 1rE3g5-0003nI-PH
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3g5-0000nO-OY
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:36:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3g5-00066r-Nq
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=fHLngPaxeZUPv+NaDZ/DCPeGl9uiNw1GpzxjTcYsq+0=; b=sd3rg1dZpn/+I6BlS8MS3/gHM7
	P5qfvR+0+0z+kaEb1HuOT6FxK9vUTMKWIx7tDvxjMsooq6muZXerrTF7M7lWdqxSakGanPF0jdqkA
	vXSlNarMn+ptsaIrACwVJIwP1tX2rX2y8QYlOIOWL9AQetS1T5RwaQibL5Of4nqkrAb8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/spinlock: make spinlock initializers more readable
Message-Id: <E1rE3g5-00066r-Nq@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:36:13 +0000

commit 7fca0463c71ca5a5b5ba853dbb000a54635c8899
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Dec 12 14:05:19 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 12 14:05:19 2023 +0100

    xen/spinlock: make spinlock initializers more readable
    
    Use named member initializers instead of positional ones for the macros
    used to initialize structures.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/spinlock.h | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index c44e7d4929..1cd9120eac 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -21,7 +21,7 @@ union lock_debug {
         bool unseen:1;
     };
 };
-#define _LOCK_DEBUG { LOCK_DEBUG_INITVAL }
+#define _LOCK_DEBUG { .val = LOCK_DEBUG_INITVAL }
 void check_lock(union lock_debug *debug, bool try);
 void lock_enter(const union lock_debug *debug);
 void lock_exit(const union lock_debug *debug);
@@ -94,12 +94,16 @@ struct lock_profile_qhead {
     int32_t                   idx;     /* index for printout */
 };
 
-#define _LOCK_PROFILE(name) { NULL, #name, &name, 0, 0, 0, 0, 0 }
+#define _LOCK_PROFILE(lockname) { .name = #lockname, .lock = &lockname, }
 #define _LOCK_PROFILE_PTR(name)                                               \
     static struct lock_profile * const __lock_profile_##name                  \
     __used_section(".lockprofile.data") =                                     \
     &__lock_profile_data_##name
-#define _SPIN_LOCK_UNLOCKED(x) { { 0 }, SPINLOCK_NO_CPU, 0, _LOCK_DEBUG, x }
+#define _SPIN_LOCK_UNLOCKED(x) {                                              \
+    .recurse_cpu = SPINLOCK_NO_CPU,                                           \
+    .debug =_LOCK_DEBUG,                                                      \
+    .profile = x,                                                             \
+}
 #define SPIN_LOCK_UNLOCKED _SPIN_LOCK_UNLOCKED(NULL)
 #define DEFINE_SPINLOCK(l)                                                    \
     spinlock_t l = _SPIN_LOCK_UNLOCKED(NULL);                                 \
@@ -142,7 +146,10 @@ extern void cf_check spinlock_profile_reset(unsigned char key);
 
 struct lock_profile_qhead { };
 
-#define SPIN_LOCK_UNLOCKED { { 0 }, SPINLOCK_NO_CPU, 0, _LOCK_DEBUG }
+#define SPIN_LOCK_UNLOCKED {                                                  \
+    .recurse_cpu = SPINLOCK_NO_CPU,                                           \
+    .debug =_LOCK_DEBUG,                                                      \
+}
 #define DEFINE_SPINLOCK(l) spinlock_t l = SPIN_LOCK_UNLOCKED
 
 #define spin_lock_init_prof(s, l) spin_lock_init(&((s)->l))
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:36:25 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:36:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654942.1022492 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3gH-0003s4-GN; Fri, 15 Dec 2023 08:36:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654942.1022492; Fri, 15 Dec 2023 08: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 1rE3gH-0003rw-Dk; Fri, 15 Dec 2023 08:36:25 +0000
Received: by outflank-mailman (input) for mailman id 654942;
 Fri, 15 Dec 2023 08:36: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 1rE3gF-0003rj-SH
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3gF-0000nV-RU
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:36:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3gF-00067e-Qq
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=XcGAc4JbX4Dz3kpUJh3mROlUIGFa1hDJg6MDXQLG9xs=; b=yuaD5g5MKHJMHGmIHlBFePvNpQ
	RBb59adeZe+T0CpnnsUcCuMbPr+T3zkNkpDukTyuyWtJvHC4YDNrKwU+/jFHbYMb3OXF34eLVm7dz
	rR8+d57jZvi6UbNyS9u/kyHzZCg6If2JOgH0cwa175BKx1rJaLI9Iv34QiJSP5gGci+g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Revert "xen: remove asm/unaligned.h"
Message-Id: <E1rE3gF-00067e-Qq@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:36:23 +0000

commit 8fe6219d83fc71ac04100805e726feb720f6a11a
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Tue Dec 12 15:43:19 2023 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Dec 12 15:43:19 2023 +0000

    Revert "xen: remove asm/unaligned.h"
    
    This breaks gitlab CI:
    
    https://gitlab.com/xen-project/hardware/xen/-/jobs/5733143618
    
    This reverts commit 6619c6f8913a8c7b2b980dd49a430c62ce6ce5ab.
---
 xen/arch/x86/include/asm/unaligned.h | 6 ++++++
 xen/common/lz4/defs.h                | 2 +-
 xen/common/lzo.c                     | 2 +-
 xen/common/unlzo.c                   | 2 +-
 xen/common/xz/private.h              | 2 +-
 xen/common/zstd/mem.h                | 2 +-
 xen/lib/xxhash32.c                   | 2 +-
 xen/lib/xxhash64.c                   | 2 +-
 8 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/include/asm/unaligned.h b/xen/arch/x86/include/asm/unaligned.h
new file mode 100644
index 0000000000..6070801d4a
--- /dev/null
+++ b/xen/arch/x86/include/asm/unaligned.h
@@ -0,0 +1,6 @@
+#ifndef __ASM_UNALIGNED_H__
+#define __ASM_UNALIGNED_H__
+
+#include <xen/unaligned.h>
+
+#endif /* __ASM_UNALIGNED_H__ */
diff --git a/xen/common/lz4/defs.h b/xen/common/lz4/defs.h
index 6d81113266..10609f5a53 100644
--- a/xen/common/lz4/defs.h
+++ b/xen/common/lz4/defs.h
@@ -10,7 +10,7 @@
 
 #ifdef __XEN__
 #include <asm/byteorder.h>
-#include <xen/unaligned.h>
+#include <asm/unaligned.h>
 #else
 
 static inline u16 get_unaligned_le16(const void *p)
diff --git a/xen/common/lzo.c b/xen/common/lzo.c
index cc03f0f554..a87c76dded 100644
--- a/xen/common/lzo.c
+++ b/xen/common/lzo.c
@@ -97,7 +97,7 @@
 #ifdef __XEN__
 #include <xen/lib.h>
 #include <asm/byteorder.h>
-#include <xen/unaligned.h>
+#include <asm/unaligned.h>
 #else
 #define get_unaligned_le16(_p) (*(u16 *)(_p))
 #endif
diff --git a/xen/common/unlzo.c b/xen/common/unlzo.c
index bdcefa95b3..74056778eb 100644
--- a/xen/common/unlzo.c
+++ b/xen/common/unlzo.c
@@ -34,7 +34,7 @@
 
 #ifdef __XEN__
 #include <asm/byteorder.h>
-#include <xen/unaligned.h>
+#include <asm/unaligned.h>
 #else
 
 static inline u16 get_unaligned_be16(const void *p)
diff --git a/xen/common/xz/private.h b/xen/common/xz/private.h
index 2299705378..e6814250e8 100644
--- a/xen/common/xz/private.h
+++ b/xen/common/xz/private.h
@@ -13,7 +13,7 @@
 #ifdef __XEN__
 #include <xen/kernel.h>
 #include <asm/byteorder.h>
-#include <xen/unaligned.h>
+#include <asm/unaligned.h>
 #else
 
 static inline u32 get_unaligned_le32(const void *p)
diff --git a/xen/common/zstd/mem.h b/xen/common/zstd/mem.h
index ae1e305126..2acae6a8ed 100644
--- a/xen/common/zstd/mem.h
+++ b/xen/common/zstd/mem.h
@@ -23,7 +23,7 @@
 #ifdef __XEN__
 #include <xen/string.h> /* memcpy */
 #include <xen/types.h>  /* size_t, ptrdiff_t */
-#include <xen/unaligned.h>
+#include <asm/unaligned.h>
 #endif
 
 /*-****************************************
diff --git a/xen/lib/xxhash32.c b/xen/lib/xxhash32.c
index 32efa651c5..e8d403e5ce 100644
--- a/xen/lib/xxhash32.c
+++ b/xen/lib/xxhash32.c
@@ -42,7 +42,7 @@
 #include <xen/errno.h>
 #include <xen/string.h>
 #include <xen/xxhash.h>
-#include <xen/unaligned.h>
+#include <asm/unaligned.h>
 
 /*-*************************************
  * Macros
diff --git a/xen/lib/xxhash64.c b/xen/lib/xxhash64.c
index 1858e236fe..481e76fbcf 100644
--- a/xen/lib/xxhash64.c
+++ b/xen/lib/xxhash64.c
@@ -43,7 +43,7 @@
 #include <xen/errno.h>
 #include <xen/string.h>
 #include <xen/xxhash.h>
-#include <xen/unaligned.h>
+#include <asm/unaligned.h>
 #endif
 
 /*-*************************************
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:36:35 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:36:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654943.1022495 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3gR-0003uZ-Hj; Fri, 15 Dec 2023 08:36:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654943.1022495; Fri, 15 Dec 2023 08: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 1rE3gR-0003uS-FE; Fri, 15 Dec 2023 08:36:35 +0000
Received: by outflank-mailman (input) for mailman id 654943;
 Fri, 15 Dec 2023 08: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 1rE3gP-0003uM-V1
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:36: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 1rE3gP-0000p9-UJ
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:36:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3gP-00068J-Tc
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:36: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=mXYVcOs6vRnKT83WQcB+dmYtBXt2gtx7tszAEI487eM=; b=CeAneaTityBu9t0ivg2wzD6ucb
	MHlZtilTgSDG62eAzNC8yIzEyw/nI6e/0EuGET1eWrzn6ZfaHrR91d49pXXmu9JGf/Miw90PImtfI
	KHJtuNVnXW3Wf72q7IfCcl9J2+OZpebtsvQL/B0UPsOF16KrYLDJ50xwG2085+lcn5PU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Revert "xen: make include/xen/unaligned.h usable on all architectures"
Message-Id: <E1rE3gP-00068J-Tc@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:36:33 +0000

commit a6a8fe0eb177ca27c9155177e7e60c13fc46e5f6
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Tue Dec 12 15:43:49 2023 +0000
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Dec 12 15:43:49 2023 +0000

    Revert "xen: make include/xen/unaligned.h usable on all architectures"
    
    This breaks gitlab CI:
    
    https://gitlab.com/xen-project/hardware/xen/-/jobs/5733143618
    
    This reverts commit 6c4be4950391d77b78e824d41115def397dbc487.
---
 xen/include/xen/unaligned.h | 53 ++++++++++++++++++++-------------------------
 1 file changed, 23 insertions(+), 30 deletions(-)

diff --git a/xen/include/xen/unaligned.h b/xen/include/xen/unaligned.h
index 3eda0ece11..0a2b16d05d 100644
--- a/xen/include/xen/unaligned.h
+++ b/xen/include/xen/unaligned.h
@@ -1,4 +1,12 @@
-/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * This header can be used by architectures where unaligned accesses work
+ * without faulting, and at least reasonably efficiently.  Other architectures
+ * will need to have a custom asm/unaligned.h.
+ */
+#ifndef __ASM_UNALIGNED_H__
+#error "xen/unaligned.h should not be included directly - include asm/unaligned.h instead"
+#endif
+
 #ifndef __XEN_UNALIGNED_H__
 #define __XEN_UNALIGNED_H__
 
@@ -7,82 +15,67 @@
 #include <asm/byteorder.h>
 #endif
 
-/*
- * This is the most generic implementation of unaligned accesses
- * and should work almost anywhere.
- */
-
-#define get_unaligned_t(type, ptr) ({					\
-	const struct { type x; } __packed *ptr_ = (typeof(ptr_))(ptr);	\
-	ptr_->x;							\
-})
-
-#define put_unaligned_t(type, val, ptr) do {				\
-	struct { type x; } __packed *ptr_ = (typeof(ptr_))(ptr);	\
-	ptr_->x = val;							\
-} while (0)
-
-#define get_unaligned(ptr)	get_unaligned_t(typeof(*(ptr)), ptr)
-#define put_unaligned(val, ptr) put_unaligned_t(typeof(*(ptr)), val, ptr)
+#define get_unaligned(p) (*(p))
+#define put_unaligned(val, p) (*(p) = (val))
 
 static inline uint16_t get_unaligned_be16(const void *p)
 {
-	return be16_to_cpu(get_unaligned_t(__be16, p));
+	return be16_to_cpup(p);
 }
 
 static inline void put_unaligned_be16(uint16_t val, void *p)
 {
-	put_unaligned_t(__be16, cpu_to_be16(val), p);
+	*(__force __be16*)p = cpu_to_be16(val);
 }
 
 static inline uint32_t get_unaligned_be32(const void *p)
 {
-	return be32_to_cpu(get_unaligned_t(__be32, p));
+	return be32_to_cpup(p);
 }
 
 static inline void put_unaligned_be32(uint32_t val, void *p)
 {
-	put_unaligned_t(__be32, cpu_to_be32(val), p);
+	*(__force __be32*)p = cpu_to_be32(val);
 }
 
 static inline uint64_t get_unaligned_be64(const void *p)
 {
-	return be64_to_cpu(get_unaligned_t(__be64, p));
+	return be64_to_cpup(p);
 }
 
 static inline void put_unaligned_be64(uint64_t val, void *p)
 {
-	put_unaligned_t(__be64, cpu_to_be64(val), p);
+	*(__force __be64*)p = cpu_to_be64(val);
 }
 
 static inline uint16_t get_unaligned_le16(const void *p)
 {
-	return le16_to_cpu(get_unaligned_t(__le16, p));
+	return le16_to_cpup(p);
 }
 
 static inline void put_unaligned_le16(uint16_t val, void *p)
 {
-	put_unaligned_t(__le16, cpu_to_le16(val), p);
+	*(__force __le16*)p = cpu_to_le16(val);
 }
 
 static inline uint32_t get_unaligned_le32(const void *p)
 {
-	return le32_to_cpu(get_unaligned_t(__le32, p));
+	return le32_to_cpup(p);
 }
 
 static inline void put_unaligned_le32(uint32_t val, void *p)
 {
-	put_unaligned_t(__le32, cpu_to_le32(val), p);
+	*(__force __le32*)p = cpu_to_le32(val);
 }
 
 static inline uint64_t get_unaligned_le64(const void *p)
 {
-	return le64_to_cpu(get_unaligned_t(__le64, p));
+	return le64_to_cpup(p);
 }
 
 static inline void put_unaligned_le64(uint64_t val, void *p)
 {
-	put_unaligned_t(__le64, cpu_to_le64(val), p);
+	*(__force __le64*)p = cpu_to_le64(val);
 }
 
 #endif /* __XEN_UNALIGNED_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:36:45 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:36:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654944.1022499 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3gb-0003xt-Ke; Fri, 15 Dec 2023 08:36:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654944.1022499; Fri, 15 Dec 2023 08: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 1rE3gb-0003xm-Hx; Fri, 15 Dec 2023 08:36:45 +0000
Received: by outflank-mailman (input) for mailman id 654944;
 Fri, 15 Dec 2023 08: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 1rE3ga-0003xT-1V
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3ga-0000pH-0o
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:36:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3ga-00068q-0C
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=CpBRsO7yriT8qlb7TSthkbGJwGEEHrWYmZ0HTCyeRik=; b=bFuunEXKejuFEl+H/VcAoD4Dvh
	BsKMa/O4m4YliEn7D/deXW5jlf6bg5IDAt1Jm752OC9grE84U+l0+2icTD7ZHt2TPt1ieOQeQqyCv
	wKaE2bflVtrhB/+I95GHad12S85+XQ+p9CkCGobc2K0eIrs/sPMTfKtbDxAJkAUEadiM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: define bug frame tables in xen.lds.S
Message-Id: <E1rE3ga-00068q-0C@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:36:44 +0000

commit 56c633bc8e3562c8075b417306abcb26c6ce3a3c
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Dec 13 10:37:22 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 13 10:37:22 2023 +0100

    xen/riscv: define bug frame tables in xen.lds.S
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/xen.lds.S | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S
index 3fa7db3bf9..a10e0ad87c 100644
--- a/xen/arch/riscv/xen.lds.S
+++ b/xen/arch/riscv/xen.lds.S
@@ -45,6 +45,16 @@ SECTIONS
     . = ALIGN(PAGE_SIZE);
     .rodata : {
         _srodata = .;          /* Read-only data */
+        /* Bug frames table */
+        __start_bug_frames = .;
+        *(.bug_frames.0)
+        __stop_bug_frames_0 = .;
+        *(.bug_frames.1)
+        __stop_bug_frames_1 = .;
+        *(.bug_frames.2)
+        __stop_bug_frames_2 = .;
+        *(.bug_frames.3)
+        __stop_bug_frames_3 = .;
         *(.rodata)
         *(.rodata.*)
         *(.data.rel.ro)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:36:55 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:36:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654948.1022515 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3gl-0004Id-4v; Fri, 15 Dec 2023 08:36:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654948.1022515; Fri, 15 Dec 2023 08: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 1rE3gl-0004IV-1C; Fri, 15 Dec 2023 08:36:55 +0000
Received: by outflank-mailman (input) for mailman id 654948;
 Fri, 15 Dec 2023 08: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 1rE3gk-0004Hj-4W
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3gk-0000ps-3k
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:36:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3gk-00069o-31
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=E42KQ1G5ba8+Xju7Dng1v+B52IogaswwZlSLnc2swQs=; b=0zTfTal9v/nfniM6rkU+dTjaFr
	A5f3NMzL3qiA5WJJJn8t6cBRtU6l53OAfd/QLrtgiJ5BGudJxPRXHxAc52JKKhSpsN4pwBZ+LTihF
	LW2PS3myIpxuMRYeebxfIp7W2x44rtK5hX2iGZOzJZz2wklIbuGS0mYts2WMWvM4duNo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] MAINTAINERS: add me as Mini-OS maintainer
Message-Id: <E1rE3gk-00069o-31@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:36:54 +0000

commit abdbf8244830792464ce59f4050adaac8cf6e391
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Dec 13 10:37:44 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 13 10:37:44 2023 +0100

    MAINTAINERS: add me as Mini-OS maintainer
    
    I've been the main contributor to Mini-OS since several years now.
    Add me as a maintainer.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 702032cc12..076cf1e141 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -439,8 +439,8 @@ F:	xen/test/livepatch/*
 
 MINI-OS
 M:	Samuel Thibault <samuel.thibault@ens-lyon.org>
+M:	Juergen Gross <jgross@suse.com>
 R:	Wei Liu <wl@xen.org>
-R:	Juergen Gross <jgross@suse.com>
 S:	Supported
 L:	minios-devel@lists.xenproject.org
 T:	git https://xenbits.xenproject.org/git-http/mini-os.git
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:37:05 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:37:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654951.1022518 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3gv-0004Se-5X; Fri, 15 Dec 2023 08:37:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654951.1022518; Fri, 15 Dec 2023 08: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 1rE3gv-0004SY-2f; Fri, 15 Dec 2023 08:37:05 +0000
Received: by outflank-mailman (input) for mailman id 654951;
 Fri, 15 Dec 2023 08: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 1rE3gu-0004SB-7k
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3gu-0000qC-6w
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:37:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3gu-0006At-63
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=VNdhVqw2BiJK9GETAf+UobmRhkCob7Tcm9iDA5WevZc=; b=GOrmFrqBUniXjaclIIZGOpxi8s
	t+Pw6CrmmiHOnRvyOwHjvG3gEzBIZodBcsYIeW00kj04RQPYVV9mshzTQuWyhdlXJl5AkYjTlIvYE
	nynrMDRCREaq1+l86WlDzmDkZ+suJFb6wXPeNhcYBLINIen9vgj727HWh93y6pwlRLhc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/compat: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1rE3gu-0006At-63@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:37:04 +0000

commit b9905a04e450ced594e7bcc6d9fe843b204b4c78
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Dec 13 10:38:19 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 13 10:38:19 2023 +0100

    xen/compat: 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/compat.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/include/xen/compat.h b/xen/include/xen/compat.h
index 41a5d61eef..7ec9d6567e 100644
--- a/xen/include/xen/compat.h
+++ b/xen/include/xen/compat.h
@@ -232,9 +232,10 @@ int hypercall_xlat_continuation(unsigned int *id, unsigned int nr,
 
 /* In-place translation functons: */
 struct start_info;
-void xlat_start_info(struct start_info *, enum XLAT_start_info_console);
+void xlat_start_info(struct start_info *native,
+                     enum XLAT_start_info_console console);
 struct vcpu_runstate_info;
-void xlat_vcpu_runstate_info(struct vcpu_runstate_info *);
+void xlat_vcpu_runstate_info(struct vcpu_runstate_info *native);
 
 #else
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:37:15 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:37:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654954.1022522 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3h5-0004e2-6u; Fri, 15 Dec 2023 08:37:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654954.1022522; Fri, 15 Dec 2023 08: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 1rE3h5-0004ds-4D; Fri, 15 Dec 2023 08:37:15 +0000
Received: by outflank-mailman (input) for mailman id 654954;
 Fri, 15 Dec 2023 08: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 1rE3h4-0004cS-Aa
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3h4-0000qL-9v
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:37:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3h4-0006Bs-9E
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=dk9W4qVVuysZEI/gF8DjmDrOI7N0NUF90A5ODbBfGqU=; b=Cn4Nj/TXaoN+ZEBdFqUDwwmsY4
	Gyy8h3Y4kIpb2BSSF7GzSSBnEPRxyzsHWi+TOiBdpI5VfGn52U2v1qfCw/iJO9aL2I7XhERfc2KJL
	Jf6MnFZ664GR9WndNIeIhUfyJYzA7uZPYmIGfb9llZuRzge29+jYfnAPD2yUx3qTJQ8Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/include: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1rE3h4-0006Bs-9E@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:37:14 +0000

commit 76ecfc517d0ae539880e31aae20c48f431099db8
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Dec 13 10:39:30 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 13 10:39:30 2023 +0100

    x86/include: 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/arch/x86/include/asm/amd.h       | 2 +-
 xen/arch/x86/include/asm/debugreg.h  | 4 ++--
 xen/arch/x86/include/asm/flushtlb.h  | 3 ++-
 xen/arch/x86/include/asm/hap.h       | 2 +-
 xen/arch/x86/include/asm/iommu.h     | 2 +-
 xen/arch/x86/include/asm/microcode.h | 2 +-
 6 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/include/asm/amd.h b/xen/arch/x86/include/asm/amd.h
index 0700827561..2cc0ce2e9f 100644
--- a/xen/arch/x86/include/asm/amd.h
+++ b/xen/arch/x86/include/asm/amd.h
@@ -157,7 +157,7 @@
 #define is_zen4_uarch()   boot_cpu_has(X86_FEATURE_AUTO_IBRS)
 
 struct cpuinfo_x86;
-int cpu_has_amd_erratum(const struct cpuinfo_x86 *, int, ...);
+int cpu_has_amd_erratum(const struct cpuinfo_x86 *cpu, int osvw_id, ...);
 
 extern s8 opt_allow_unsafe;
 
diff --git a/xen/arch/x86/include/asm/debugreg.h b/xen/arch/x86/include/asm/debugreg.h
index b6454cc04e..2bdaf5d9aa 100644
--- a/xen/arch/x86/include/asm/debugreg.h
+++ b/xen/arch/x86/include/asm/debugreg.h
@@ -96,8 +96,8 @@
 #define breakpoint_addr_ok(a) __addr_ok(a)
 
 struct vcpu;
-long set_debugreg(struct vcpu *, unsigned int reg, unsigned long value);
-void activate_debugregs(const struct vcpu *);
+long set_debugreg(struct vcpu *v, unsigned int reg, unsigned long value);
+void activate_debugregs(const struct vcpu *curr);
 
 struct cpu_policy;
 
diff --git a/xen/arch/x86/include/asm/flushtlb.h b/xen/arch/x86/include/asm/flushtlb.h
index a461ee36ff..bb0ad58db4 100644
--- a/xen/arch/x86/include/asm/flushtlb.h
+++ b/xen/arch/x86/include/asm/flushtlb.h
@@ -141,7 +141,8 @@ unsigned int flush_area_local(const void *va, unsigned int flags);
 #define flush_local(flags) flush_area_local(NULL, flags)
 
 /* Flush specified CPUs' TLBs/caches */
-void flush_area_mask(const cpumask_t *, const void *va, unsigned int flags);
+void flush_area_mask(const cpumask_t *mask, const void *va,
+                     unsigned int flags);
 #define flush_mask(mask, flags) flush_area_mask(mask, NULL, flags)
 
 /* Flush all CPUs' TLBs/caches */
diff --git a/xen/arch/x86/include/asm/hap.h b/xen/arch/x86/include/asm/hap.h
index 05e124ad57..f01ce73fb4 100644
--- a/xen/arch/x86/include/asm/hap.h
+++ b/xen/arch/x86/include/asm/hap.h
@@ -32,7 +32,7 @@ int   hap_track_dirty_vram(struct domain *d,
                            unsigned int nr_frames,
                            XEN_GUEST_HANDLE(void) guest_dirty_bitmap);
 
-extern const struct paging_mode *hap_paging_get_mode(struct vcpu *);
+extern const struct paging_mode *hap_paging_get_mode(struct vcpu *v);
 int hap_set_allocation(struct domain *d, unsigned int pages, bool *preempted);
 unsigned int hap_get_allocation(struct domain *d);
 
diff --git a/xen/arch/x86/include/asm/iommu.h b/xen/arch/x86/include/asm/iommu.h
index eb720205e2..15a848ddc3 100644
--- a/xen/arch/x86/include/asm/iommu.h
+++ b/xen/arch/x86/include/asm/iommu.h
@@ -87,7 +87,7 @@ extern const struct iommu_init_ops *iommu_init_ops;
 void iommu_update_ire_from_apic(unsigned int apic, unsigned int pin,
                                 uint64_t rte);
 unsigned int iommu_read_apic_from_ire(unsigned int apic, unsigned int reg);
-int iommu_setup_hpet_msi(struct msi_desc *);
+int iommu_setup_hpet_msi(struct msi_desc *msi);
 
 static inline void iommu_adjust_irq_affinities(void)
 {
diff --git a/xen/arch/x86/include/asm/microcode.h b/xen/arch/x86/include/asm/microcode.h
index 62ce3418f7..8f59b20b02 100644
--- a/xen/arch/x86/include/asm/microcode.h
+++ b/xen/arch/x86/include/asm/microcode.h
@@ -22,7 +22,7 @@ struct cpu_signature {
 DECLARE_PER_CPU(struct cpu_signature, cpu_sig);
 
 void microcode_set_module(unsigned int idx);
-int microcode_update(XEN_GUEST_HANDLE(const_void), unsigned long len);
+int microcode_update(XEN_GUEST_HANDLE(const_void) buf, unsigned long len);
 int early_microcode_init(unsigned long *module_map,
                          const struct multiboot_info *mbi);
 int microcode_init_cache(unsigned long *module_map,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:37:25 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:37:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654955.1022526 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3hF-0004gi-8a; Fri, 15 Dec 2023 08:37:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654955.1022526; Fri, 15 Dec 2023 08: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 1rE3hF-0004ga-5l; Fri, 15 Dec 2023 08:37:25 +0000
Received: by outflank-mailman (input) for mailman id 654955;
 Fri, 15 Dec 2023 08: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 1rE3hE-0004gN-Da
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3hE-0000qS-Cw
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:37:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3hE-0006D6-CE
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=AF7Pju6uMbX+JyoDOARMJWyo+2rbGx9IpymEDY0diVY=; b=P/JZxjrgNuDbewn/1yGuUCL4rJ
	YeidYOl6n8L4awOyTniQA3+kAcVoLLfOoidMlXrqQFeJjySK0Djlo/Je8LATAAu+Z8Nx0FEIAJ6Cr
	U8qNnxuu9LAN7uici6bIWnHnkm2tRJ5UIr1hTSEi3kbwzNdoPkGjZ1+0yBqvvX4eJ2mM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/drivers: address violations of MISRA C:2012 Rule 8.2
Message-Id: <E1rE3hE-0006D6-CE@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:37:24 +0000

commit 75b6bcbd9e8b1f2bfc9c6177910a4d3c4405c1fd
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Dec 13 10:40:08 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 13 10:40:08 2023 +0100

    xen/drivers: 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/drivers/char/ehci-dbgp.c | 4 ++--
 xen/drivers/video/vga.c      | 2 +-
 xen/include/xen/video.h      | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/char/ehci-dbgp.c b/xen/drivers/char/ehci-dbgp.c
index 72e1beabbb..0f5b41899e 100644
--- a/xen/drivers/char/ehci-dbgp.c
+++ b/xen/drivers/char/ehci-dbgp.c
@@ -341,7 +341,7 @@ struct ehci_dbgp {
     struct ehci_caps __iomem *ehci_caps;
 };
 
-static int ehci_dbgp_external_startup(struct ehci_dbgp *);
+static int ehci_dbgp_external_startup(struct ehci_dbgp *dbgp);
 
 static void ehci_dbgp_status(struct ehci_dbgp *dbgp, const char *str)
 {
@@ -997,7 +997,7 @@ err:
     return -ENODEV;
 }
 
-typedef void (*set_debug_port_t)(struct ehci_dbgp *, unsigned int);
+typedef void (*set_debug_port_t)(struct ehci_dbgp *dbgp, unsigned int port);
 
 static void cf_check default_set_debug_port(
     struct ehci_dbgp *dbgp, unsigned int port)
diff --git a/xen/drivers/video/vga.c b/xen/drivers/video/vga.c
index 18b590cdf0..b4d0183261 100644
--- a/xen/drivers/video/vga.c
+++ b/xen/drivers/video/vga.c
@@ -21,7 +21,7 @@ static unsigned char *video;
 
 static void cf_check vga_text_puts(const char *s, size_t nr);
 static void cf_check vga_noop_puts(const char *s, size_t nr) {}
-void (*video_puts)(const char *, size_t nr) = vga_noop_puts;
+void (*video_puts)(const char *s, size_t nr) = vga_noop_puts;
 
 /*
  * 'vga=<mode-specifier>[,keep]' where <mode-specifier> is one of:
diff --git a/xen/include/xen/video.h b/xen/include/xen/video.h
index 96f8a50132..1ee1aa46b1 100644
--- a/xen/include/xen/video.h
+++ b/xen/include/xen/video.h
@@ -13,7 +13,7 @@
 
 #ifdef CONFIG_VIDEO
 void video_init(void);
-extern void (*video_puts)(const char *, size_t nr);
+extern void (*video_puts)(const char *s, size_t nr);
 void video_endboot(void);
 #else
 #define video_init()    ((void)0)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:37:36 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:37:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654956.1022529 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3hQ-0004jU-9k; Fri, 15 Dec 2023 08:37:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654956.1022529; Fri, 15 Dec 2023 08:37: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 1rE3hQ-0004jN-7F; Fri, 15 Dec 2023 08:37:36 +0000
Received: by outflank-mailman (input) for mailman id 654956;
 Fri, 15 Dec 2023 08: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 1rE3hO-0004jB-GT
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3hO-0000qb-Fm
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:37:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3hO-0006E3-F9
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=HC2ZoXwd1nMx+H3R2m0XMn2u20mH09qZXvwtrMMFL1k=; b=QMSUjdTUJehFUCZtRnMGMqCHXv
	7Pnxfpne+Oskls0sP4qsjM9koNtCGoEjwaLa5snoZbuQNfUpctkezuu+et9Eou89omrzpylr/HXIg
	IPvkMjA2V2yp1l1cGIJ0koWB+1NX+vXI44lnjobgibyaASr+kool5BEMLSrUQSIqG4bg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/iommu: address leftover violation of MISRA C:2012 Rule 8.2
Message-Id: <E1rE3hO-0006E3-F9@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:37:34 +0000

commit 666e3c294d50e4a7f87a4d22757b7ffe5863b4df
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Dec 13 10:40:39 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 13 10:40:39 2023 +0100

    xen/iommu: address leftover 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/iommu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 69d572543c..f53d045e2c 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -296,7 +296,7 @@ struct iommu_ops {
                                  uint64_t rte);
     unsigned int (*read_apic_from_ire)(unsigned int apic, unsigned int reg);
 
-    int (*setup_hpet_msi)(struct msi_desc *);
+    int (*setup_hpet_msi)(struct msi_desc *msi_desc);
 
     void (*adjust_irq_affinities)(void);
     void (*clear_root_pgtable)(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:37:46 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:37:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654957.1022534 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3ha-0004n5-BL; Fri, 15 Dec 2023 08:37:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654957.1022534; Fri, 15 Dec 2023 08:37: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 1rE3ha-0004mx-8j; Fri, 15 Dec 2023 08:37:46 +0000
Received: by outflank-mailman (input) for mailman id 654957;
 Fri, 15 Dec 2023 08: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 1rE3hY-0004mc-JT
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3hY-0000ql-Io
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:37:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3hY-0006F7-I2
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=l/+9l0FPleeCN14q4UNwslFih5IKywuZhQkdQqVBTmY=; b=IP3iWqDRrz6WFqIa7DyOd1kJur
	ZyjXggiNHrwr/6M6GmM2jVKIJjRXcQx1nJKvMGcT39Y1pUQFAHPxTJGgsLxZxc54+6mFGy0s0USNZ
	ddTdGQOAwiCGYuiUhuSR7vTYIYlheeuOz6xVxgaDUiJ7q6ZafyYX8Q2eTpxZ1RU+FSvE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: don't pass iommu properties to hwdom for iommu-map
Message-Id: <E1rE3hY-0006F7-I2@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:37:44 +0000

commit a236b74b961faa045640275605e319bba45483c1
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Thu Nov 9 13:27:04 2023 -0500
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Dec 13 10:40:00 2023 +0000

    xen/arm: don't pass iommu properties to hwdom for iommu-map
    
    A device tree node for a PCIe root controller may have an iommu-map property [1]
    with a phandle reference to the SMMU node, but not necessarily an iommus
    property. In this case, we want to treat it the same as we currently handle
    devices with an iommus property: don't pass the iommu related properties to
    hwdom.
    
    [1] https://www.kernel.org/doc/Documentation/devicetree/bindings/pci/pci-iommu.txt
    
    Reported-by: Michal Orzel <michal.orzel@amd.com>
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/domain_build.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 613b2885ce..6945b9755d 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -550,6 +550,8 @@ static int __init write_properties(struct domain *d, struct kernel_info *kinfo,
      * should be skipped.
      */
     iommu_node = dt_parse_phandle(node, "iommus", 0);
+    if ( !iommu_node )
+        iommu_node = dt_parse_phandle(node, "iommu-map", 1);
     if ( iommu_node && device_get_class(iommu_node) != DEVICE_IOMMU )
         iommu_node = NULL;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:37:56 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:37:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654958.1022538 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3hk-0004qo-D4; Fri, 15 Dec 2023 08:37:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654958.1022538; Fri, 15 Dec 2023 08: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 1rE3hk-0004qh-AB; Fri, 15 Dec 2023 08:37:56 +0000
Received: by outflank-mailman (input) for mailman id 654958;
 Fri, 15 Dec 2023 08: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 1rE3hi-0004qM-MG
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3hi-0000rE-LW
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:37:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3hi-0006Fq-Ku
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=NF8BUM9xXv8UqZXwD8hPhQHLyUYO6vUGKReKeuBxQ5A=; b=maR1IhskN2wkaXfXY/AyrPRhfK
	zhAUBHYy30d4X8E0RHw6nlPiNt7iZ2o6zfODukdTR3eqeDwSswdiGVZ2GEC51Qzgb2Ebv1MF2ZuDm
	DgjuJ89BbJAFR9XJrqU5rpIrY12v7NLMbUwbYu2S2Bb9UbrhxyAgMVC5bQyHMZi8YF60=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: return FFA_RET_NOT_SUPPORTED on unhandled calls
Message-Id: <E1rE3hi-0006Fq-Ku@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:37:54 +0000

commit 75571e162b78b73401307ce40f732021ae57d49a
Author:     Jens Wiklander <jens.wiklander@linaro.org>
AuthorDate: Wed Dec 13 11:32:41 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Dec 13 16:23:55 2023 +0000

    xen/arm: ffa: return FFA_RET_NOT_SUPPORTED on unhandled calls
    
    Until now an unsupported FF-A request has been reported back with
    ARM_SMCCC_ERR_UNKNOWN_FUNCTION in register x0. A FF-A caller would
    rather expect FFA_ERROR in x0 and FFA_RET_NOT_SUPPORTED in x2 so update
    ffa_handle_call() to return true and with the cpu_user_regs updated.
    
    Fixes: 38846de2176b ("xen/arm: tee: add a primitive FF-A mediator")
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/tee/ffa.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 183528d133..98905fec79 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -1477,7 +1477,8 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
 
     default:
         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
-        return false;
+        set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
+        return true;
     }
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:38:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:38:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654959.1022542 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3hu-0004uS-Gh; Fri, 15 Dec 2023 08:38:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654959.1022542; Fri, 15 Dec 2023 08:38: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 1rE3hu-0004uL-E2; Fri, 15 Dec 2023 08:38:06 +0000
Received: by outflank-mailman (input) for mailman id 654959;
 Fri, 15 Dec 2023 08:38: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 1rE3hs-0004u1-U2
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:38: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 1rE3hs-0000rZ-OG
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:38:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3hs-0006H1-Na
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=PlxrbZGTVVy/yoR+dSoh+fLKpTAJMpebx0OGg+5pmpI=; b=Hohj6MdRBCMF2fDF9700Yfdnyr
	4kVjOeheg+uYtIDB8mJiLgSHJv9wt+EPC4W5KwyJbBsMIRLT2NGNEuKJFppawP6fm1MGURckk4KKH
	lGIgeomhperjHzOq3QfQWz0pwm0YgKWRg814gAUxn/8ZMpNgdefiMizMX8DvNoQ3KBIQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libs/evtchn: fix locking in Mini-OS
Message-Id: <E1rE3hs-0006H1-Na@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:38:04 +0000

commit 68e6b7fc117f35217c8649f9b0c8875a468cc370
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Dec 14 10:55:24 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 14 10:55:24 2023 +0100

    tools/libs/evtchn: fix locking in Mini-OS
    
    When adding locking to tools/libs/evtchn/minios.c a semaphore was
    used. This can result in deadlocks, as the lock is taken inside the
    event handler, which can interrupt an already locked region.
    
    The fix is rather simple, as Mini-OS is supporting a single vcpu
    only. So instead of the semaphore it is enough to disable interrupts
    when operating on the port list.
    
    Fixes: bc4fe94a69d4 ("ools/libs/evtchn: replace assert()s in stubdom with proper locking")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/evtchn/minios.c | 45 +++++++++++++++------------------------------
 1 file changed, 15 insertions(+), 30 deletions(-)

diff --git a/tools/libs/evtchn/minios.c b/tools/libs/evtchn/minios.c
index c807e17f55..046cd28d37 100644
--- a/tools/libs/evtchn/minios.c
+++ b/tools/libs/evtchn/minios.c
@@ -25,7 +25,6 @@
 #include <mini-os/os.h>
 #include <mini-os/lib.h>
 #include <mini-os/events.h>
-#include <mini-os/semaphore.h>
 #include <mini-os/wait.h>
 
 #include <assert.h>
@@ -43,7 +42,6 @@ XEN_LIST_HEAD(port_list, struct port_info);
 
 struct ports {
     struct port_list list;
-    struct semaphore sem;
 };
 
 struct port_info {
@@ -58,6 +56,7 @@ static struct port_info *port_alloc(xenevtchn_handle *xce)
     struct port_info *port_info;
     struct file *file = get_file_from_fd(xce->fd);
     struct ports *ports = file->dev;
+    unsigned long flags;
 
     port_info = malloc(sizeof(struct port_info));
     if ( port_info == NULL )
@@ -67,19 +66,24 @@ static struct port_info *port_alloc(xenevtchn_handle *xce)
     port_info->port = -1;
     port_info->bound = false;
 
-    down(&ports->sem);
+    local_irq_save(flags);
     XEN_LIST_INSERT_HEAD(&ports->list, port_info, list);
-    up(&ports->sem);
+    local_irq_restore(flags);
 
     return port_info;
 }
 
 static void port_dealloc(struct port_info *port_info)
 {
+    unsigned long flags;
+
     if ( port_info->bound )
         unbind_evtchn(port_info->port);
 
+    local_irq_save(flags);
     XEN_LIST_REMOVE(port_info, list);
+    local_irq_restore(flags);
+
     free(port_info);
 }
 
@@ -135,7 +139,6 @@ int osdep_evtchn_open(xenevtchn_handle *xce, unsigned int flags)
 
     file->dev = ports;
     XEN_LIST_INIT(&ports->list);
-    init_SEMAPHORE(&ports->sem, 1);
     xce->fd = fd;
     printf("evtchn_open() -> %d\n", fd);
 
@@ -183,16 +186,11 @@ static void evtchn_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
     ports = file->dev;
     mask_evtchn(port);
 
-    down(&ports->sem);
     XEN_LIST_FOREACH(port_info, &ports->list, list)
     {
         if ( port_info->port == port )
-        {
-            up(&ports->sem);
             goto found;
-        }
     }
-    up(&ports->sem);
 
     printk("Unknown port %d for handle %d\n", port, xce->fd);
     return;
@@ -203,16 +201,6 @@ static void evtchn_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
     wake_up(&event_queue);
 }
 
-static void port_remove(xenevtchn_handle *xce, struct port_info *port_info)
-{
-    struct file *file = get_file_from_fd(xce->fd);
-    struct ports *ports = file->dev;
-
-    down(&ports->sem);
-    port_dealloc(port_info);
-    up(&ports->sem);
-}
-
 xenevtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce,
                                                       uint32_t domid)
 {
@@ -230,7 +218,7 @@ xenevtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce,
 
     if ( ret < 0 )
     {
-        port_remove(xce, port_info);
+        port_dealloc(port_info);
         errno = -ret;
         return -1;
     }
@@ -261,7 +249,7 @@ xenevtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce,
 
     if ( ret < 0 )
     {
-        port_remove(xce, port_info);
+        port_dealloc(port_info);
         errno = -ret;
         return -1;
     }
@@ -279,18 +267,19 @@ int xenevtchn_unbind(xenevtchn_handle *xce, evtchn_port_t port)
     struct file *file = get_file_from_fd(fd);
     struct port_info *port_info;
     struct ports *ports = file->dev;
+    unsigned long flags;
 
-    down(&ports->sem);
+    local_irq_save(flags);
     XEN_LIST_FOREACH(port_info, &ports->list, list)
     {
         if ( port_info->port == port )
         {
             port_dealloc(port_info);
-            up(&ports->sem);
+            local_irq_restore(flags);
             return 0;
         }
     }
-    up(&ports->sem);
+    local_irq_restore(flags);
 
     printf("Warning: couldn't find port %"PRId32" for xc handle %x\n",
            port, fd);
@@ -315,7 +304,7 @@ xenevtchn_port_or_error_t xenevtchn_bind_virq(xenevtchn_handle *xce,
 
     if ( port < 0 )
     {
-        port_remove(xce, port_info);
+        port_dealloc(port_info);
         errno = -port;
         return -1;
     }
@@ -335,8 +324,6 @@ xenevtchn_port_or_error_t xenevtchn_pending(xenevtchn_handle *xce)
     unsigned long flags;
     evtchn_port_t ret = -1;
 
-    down(&ports->sem);
-
     local_irq_save(flags);
 
     file->read = false;
@@ -360,8 +347,6 @@ xenevtchn_port_or_error_t xenevtchn_pending(xenevtchn_handle *xce)
 
     local_irq_restore(flags);
 
-    up(&ports->sem);
-
     return ret;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 15 08:38:16 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 Dec 2023 08:38:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.654960.1022545 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rE3i4-0004xV-Ik; Fri, 15 Dec 2023 08:38:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 654960.1022545; Fri, 15 Dec 2023 08:38: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 1rE3i4-0004xN-Fd; Fri, 15 Dec 2023 08:38:16 +0000
Received: by outflank-mailman (input) for mailman id 654960;
 Fri, 15 Dec 2023 08:38: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 1rE3i2-0004x8-S6
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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 1rE3i2-0000rd-RI
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08:38:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rE3i2-0006Hs-QQ
 for xen-changelog@lists.xenproject.org; Fri, 15 Dec 2023 08: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=cq+tr2TNCfUF43MdwrWZoKdSphFNRxMirD9DRMxLkdE=; b=sHaejEwgDyoLZomCz5v3RIpJxB
	uEd7U27GZQSEvuC0n27LPwsluRJGrizh1oLBcdVu1CGjtwMzNn0xVC/OZ1LAOzmyHBDQoUisBGPBa
	IoYn9sA1vMjIh+r84cY7GaQh5CpsvaK5TIB44zAYvIAkGsZuo7b+mC0Jl5Z8lpaveqxc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] smp: move cpu_is_offline() definition
Message-Id: <E1rE3i2-0006Hs-QQ@xenbits.xenproject.org>
Date: Fri, 15 Dec 2023 08:38:14 +0000

commit cad6f9a4c12dd4d5cdb2620e3fe24727ee81c7ce
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 14 10:56:07 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 14 10:56:07 2023 +0100

    smp: move cpu_is_offline() definition
    
    It's all the same for the 3 arch-es which have it, and RISC-V would
    introduce a 4th instance. Put it in xen/smp.h instead, while still
    permitting asm/smp.h to define a custom variant if need be.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: George Dunlap <george.dunlap@cloud.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/include/asm/smp.h | 2 --
 xen/arch/ppc/include/asm/smp.h | 2 --
 xen/arch/x86/include/asm/smp.h | 1 -
 xen/include/xen/smp.h          | 4 ++++
 4 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/include/asm/smp.h b/xen/arch/arm/include/asm/smp.h
index bd489793fa..e99a3a3f53 100644
--- a/xen/arch/arm/include/asm/smp.h
+++ b/xen/arch/arm/include/asm/smp.h
@@ -12,8 +12,6 @@ extern unsigned long smp_up_cpu;
 DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_mask);
 DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
 
-#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
-
 /*
  * 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/ppc/include/asm/smp.h b/xen/arch/ppc/include/asm/smp.h
index eca43f0e6c..7b1517ce18 100644
--- a/xen/arch/ppc/include/asm/smp.h
+++ b/xen/arch/ppc/include/asm/smp.h
@@ -7,8 +7,6 @@
 DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_mask);
 DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
 
-#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
-
 /*
  * 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/x86/include/asm/smp.h b/xen/arch/x86/include/asm/smp.h
index 761edfcd34..c8c7960134 100644
--- a/xen/arch/x86/include/asm/smp.h
+++ b/xen/arch/x86/include/asm/smp.h
@@ -43,7 +43,6 @@ extern u32 x86_cpu_to_apicid[];
 
 #define cpu_physical_id(cpu)	x86_cpu_to_apicid[cpu]
 
-#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
 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);
diff --git a/xen/include/xen/smp.h b/xen/include/xen/smp.h
index 0a9219173f..2ca9ff1bfc 100644
--- a/xen/include/xen/smp.h
+++ b/xen/include/xen/smp.h
@@ -3,6 +3,10 @@
 
 #include <asm/smp.h>
 
+#ifndef cpu_is_offline
+#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
+#endif
+
 /*
  * stops all CPUs but the current one:
  */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Dec 16 10:22:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 16 Dec 2023 10:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.655489.1023235 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rERo3-0001jO-Nh; Sat, 16 Dec 2023 10:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 655489.1023235; Sat, 16 Dec 2023 10:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rERo3-0001jH-Ku; Sat, 16 Dec 2023 10:22:03 +0000
Received: by outflank-mailman (input) for mailman id 655489;
 Sat, 16 Dec 2023 10: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 1rERo2-0001j7-0c
 for xen-changelog@lists.xenproject.org; Sat, 16 Dec 2023 10: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 1rERo1-0006Kx-KY
 for xen-changelog@lists.xenproject.org; Sat, 16 Dec 2023 10:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rERo1-0003sM-JT
 for xen-changelog@lists.xenproject.org; Sat, 16 Dec 2023 10:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vvmhwj2uz0vcW4dXuuXxl1HiJuiVc6Mpzr8eMdaSiGY=; b=LMaJaP/qFH+Y8jvo1zDoTEC1/L
	4mXgbIT24TANNh9dBpKCiTBaW6Pp3BJQfOosaz9cIOkXLrerKeBh+EK91WK1cywu9P6fLhUmE0am4
	24/7PvkzJg2ypSEyQJRkWDUma+yKRZknPc9pwvSjNumcsS6jL0PjBBbshNQWhW/eubJw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation/eclair_analysis: file exclusion automation
Message-Id: <E1rERo1-0003sM-JT@xenbits.xenproject.org>
Date: Sat, 16 Dec 2023 10:22:01 +0000

commit 896c1917868889c3561ef4fec7d12e4a2e309705
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Mon Dec 11 09:55:16 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Dec 15 13:07:11 2023 -0800

    automation/eclair_analysis: file exclusion automation
    
    The file exclude-list.json contains files that are classified as
    adopted code for MISRA compliance. Therefore, this file is used to
    automatically generate a suitable .ecl configuration for ECLAIR.
    
    As such, many entries in out_of_scope.ecl can be removed, as they
    would be duplicates.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/eclair_analysis/ECLAIR/adopted.sh       | 30 ++++++++++
 automation/eclair_analysis/ECLAIR/analysis.ecl     |  3 +
 automation/eclair_analysis/ECLAIR/analyze.sh       |  3 +
 automation/eclair_analysis/ECLAIR/generate_ecl.sh  | 15 +++++
 automation/eclair_analysis/ECLAIR/out_of_scope.ecl | 64 ----------------------
 .../eclair_analysis/ECLAIR/print_analyzed_files.sh |  4 +-
 docs/misra/exclude-list.json                       |  4 ++
 7 files changed, 58 insertions(+), 65 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/adopted.sh b/automation/eclair_analysis/ECLAIR/adopted.sh
new file mode 100755
index 0000000000..9adbc4e582
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/adopted.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# Generates the adopted.ecl file
+
+set -eu
+
+script_name="$(basename "$0")"
+script_dir="$(
+  cd "$(dirname "$0")"
+  echo "${PWD}"
+)"
+
+fatal() {
+  echo "${script_name}: $*" >&2
+  exit 1
+}
+
+usage() {
+  fatal "Usage: ${script_name}"
+}
+
+exclude_list=$1
+outfile=${script_dir}/adopted.ecl
+
+(
+  echo "-doc_begin=\"Adopted files.\"" >"${outfile}"
+  sed -n -E -e 's|^\s+"rel_path":\s+"([^"]*).*$|-file_tag+={adopted,"^xen/\1$"}|p' "${exclude_list}" |
+    sed -E -e 's|\.([ch])|\\\\.\1|g' -e 's|\*|.*|g' >>"${outfile}"
+  printf "%s\n" "-doc_end" >>"${outfile}"
+)
diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/eclair_analysis/ECLAIR/analysis.ecl
index f8d4cc8c99..a604582da3 100644
--- a/automation/eclair_analysis/ECLAIR/analysis.ecl
+++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
@@ -21,6 +21,9 @@ map_strings("scheduled-analysis",analysis_kind)
 
 -eval_file=toolchain.ecl
 -eval_file=public_APIs.ecl
+if(not(scheduled_analysis),
+    eval_file("adopted.ecl")
+)
 if(not(scheduled_analysis),
     eval_file("out_of_scope.ecl")
 )
diff --git a/automation/eclair_analysis/ECLAIR/analyze.sh b/automation/eclair_analysis/ECLAIR/analyze.sh
index 47cdbb03ce..a127e7aaed 100755
--- a/automation/eclair_analysis/ECLAIR/analyze.sh
+++ b/automation/eclair_analysis/ECLAIR/analyze.sh
@@ -82,6 +82,9 @@ export ECLAIR_PROJECT_ROOT="${PWD}"
 rm -rf "${ECLAIR_OUTPUT_DIR:?}/*"
 mkdir -p "${ECLAIR_DATA_DIR}"
 
+# Generate additional configuration files 
+"${SCRIPT_DIR}/generate_ecl.sh"
+
 # Perform the build (from scratch) in an ECLAIR environment.
 "${ECLAIR_BIN_DIR}eclair_env" \
     "-config_file='${SCRIPT_DIR}/analysis.ecl'" \
diff --git a/automation/eclair_analysis/ECLAIR/generate_ecl.sh b/automation/eclair_analysis/ECLAIR/generate_ecl.sh
new file mode 100755
index 0000000000..de20728eb1
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/generate_ecl.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# Generates the .ecl files
+
+set -eu
+
+script_dir="$(
+  cd "$(dirname "$0")"
+  echo "${PWD}"
+)"
+
+exclude_list="${ECLAIR_PROJECT_ROOT}/docs/misra/exclude-list.json"
+
+# Generate the exclude list file
+"${script_dir}/adopted.sh" "${exclude_list}"
diff --git a/automation/eclair_analysis/ECLAIR/out_of_scope.ecl b/automation/eclair_analysis/ECLAIR/out_of_scope.ecl
index e1ec4a607c..fd870716cf 100644
--- a/automation/eclair_analysis/ECLAIR/out_of_scope.ecl
+++ b/automation/eclair_analysis/ECLAIR/out_of_scope.ecl
@@ -1,55 +1,3 @@
--doc_begin="Imported from Linux: ignore for now."
--file_tag+={adopted,"^xen/common/libfdt/.*$"}
--file_tag+={adopted,"^xen/include/xen/libfdt/.*$"}
--file_tag+={adopted,"^xen/common/xz/.*$"}
--file_tag+={adopted,"^xen/common/zstd/.*$"}
--file_tag+={adopted,"^xen/drivers/acpi/apei/.*$"}
--file_tag+={adopted,"^xen/drivers/acpi/tables/.*$"}
--file_tag+={adopted,"^xen/drivers/acpi/utilities/.*$"}
--file_tag+={adopted,"^xen/drivers/video/font_.*$"}
--file_tag+={adopted,"^xen/arch/arm/arm64/cpufeature\\.c$"}
--file_tag+={adopted,"^xen/arch/arm/arm64/insn\\.c$"}
--file_tag+={adopted,"^xen/arch/arm/arm64/lib/find_next_bit\\.c$"}
--file_tag+={adopted,"^xen/common/bitmap\\.c$"}
--file_tag+={adopted,"^xen/common/bunzip2\\.c$"}
--file_tag+={adopted,"^xen/common/earlycpio\\.c$"}
--file_tag+={adopted,"^xen/common/inflate\\.c$"}
--file_tag+={adopted,"^xen/common/lzo\\.c$"}
--file_tag+={adopted,"^xen/common/lz4/decompress\\.c$"}
--file_tag+={adopted,"^xen/common/radix-tree\\.c$"}
--file_tag+={adopted,"^xen/common/ubsan/ubsan\\.c$"}
--file_tag+={adopted,"^xen/drivers/acpi/hwregs\\.c$"}
--file_tag+={adopted,"^xen/drivers/acpi/numa\\.c$"}
--file_tag+={adopted,"^xen/drivers/acpi/osl\\.c$"}
--file_tag+={adopted,"^xen/drivers/acpi/tables\\.c$"}
--file_tag+={adopted,"^xen/include/xen/acpi\\.h$"}
--file_tag+={adopted,"^xen/include/acpi/acpiosxf\\.h$"}
--file_tag+={adopted,"^xen/include/acpi/acpixf\\.h$"}
--file_tag+={adopted,"^xen/lib/list-sort\\.c$"}
--file_tag+={adopted,"^xen/lib/rbtree\\.c$"}
--file_tag+={adopted,"^xen/lib/xxhash.*\\.c$"}
--file_tag+={adopted,"^xen/arch/x86/acpi/boot\\.c$"}
--file_tag+={adopted,"^xen/arch/x86/acpi/cpu_idle\\.c$"}
--file_tag+={adopted,"^xen/arch/x86/acpi/cpufreq/cpufreq\\.c$"}
--file_tag+={adopted,"^xen/arch/x86/acpi/cpuidle_menu\\.c$"}
--file_tag+={adopted,"^xen/arch/x86/acpi/lib\\.c$"}
--file_tag+={adopted,"^xen/arch/x86/cpu/amd\\.c$"}
--file_tag+={adopted,"^xen/arch/x86/cpu/centaur\\.c$"}
--file_tag+={adopted,"^xen/arch/x86/cpu/common\\.c$"}
--file_tag+={adopted,"^xen/arch/x86/cpu/hygon\\.c$"}
--file_tag+={adopted,"^xen/arch/x86/cpu/intel\\.c$"}
--file_tag+={adopted,"^xen/arch/x86/cpu/intel_cacheinfo\\.c$"}
--file_tag+={adopted,"^xen/arch/x86/cpu/mcheck/non-fatal\\.c$"}
--file_tag+={adopted,"^xen/arch/x86/cpu/mtrr/.*$"}
--file_tag+={adopted,"^xen/arch/x86/cpu/mwait-idle\\.c$"}
--file_tag+={adopted,"^xen/arch/x86/delay\\.c$"}
--file_tag+={adopted,"^xen/arch/x86/dmi_scan\\.c$"}
--file_tag+={adopted,"^xen/arch/x86/mpparse\\.c$"}
--file_tag+={adopted,"^xen/arch/x86/srat\\.c$"}
--file_tag+={adopted,"^xen/arch/x86/time\\.c$"}
--file_tag+={adopted,"^xen/arch/x86/x86_64/mmconf-fam10h\\.c$"}
--doc_end
-
 -doc_begin="Intel specific source files are out of scope."
 -file_tag+={out_of_scope,"^xen/arch/x86/cpu/intel\\.c$"}
 -file_tag+={out_of_scope,"^xen/arch/x86/cpu/intel_cacheinfo\\.c$"}
@@ -69,18 +17,6 @@
 -file_tag+={out_of_scope,"^xen/arch/x86/include/asm/intel-family\\.h$"}
 -doc_end
 
--doc_begin="Not in scope initially as it generates many violations and it is not enabled in safety configurations."
--file_tag+={adopted,"^xen/xsm/flask/.*$"}
--doc_end
-
--doc_begin="unlz4.c implementation by Yann Collet, the others un* are from Linux, ignore for now."
--file_tag+={adopted,"^xen/common/un.*\\.c$"}
--doc_end
-
--doc_begin="Origin is external and documented in xen/crypto/README.source ."
--file_tag+={adopted,"^xen/crypto/.*$"}
--doc_end
-
 -doc_begin="Files imported from the gnu-efi package"
 -file_tag+={adopted,"^xen/include/efi/.*$"}
 -file_tag+={adopted,"^xen/arch/x86/include/asm/x86_64/efibind\\.h$"}
diff --git a/automation/eclair_analysis/ECLAIR/print_analyzed_files.sh b/automation/eclair_analysis/ECLAIR/print_analyzed_files.sh
index c19a8ecbd0..7d23127161 100755
--- a/automation/eclair_analysis/ECLAIR/print_analyzed_files.sh
+++ b/automation/eclair_analysis/ECLAIR/print_analyzed_files.sh
@@ -46,7 +46,9 @@ fi
 "${ECLAIR_BIN_DIR}eclair_report" -db="${DB}" -files_txt="${files_txt}"
 
 {
-  # Extracting out of scope code
+  # Extracting out of scope and adopted code
+  adopted_ecl="${script_dir}/adopted.ecl"
+  extrapolate_regex adopted,             "${adopted_ecl}"
   out_of_scope_ecl="${script_dir}/out_of_scope.ecl"
   extrapolate_regex adopted,             "${out_of_scope_ecl}"
   extrapolate_regex out_of_scope_tools,  "${out_of_scope_ecl}"
diff --git a/docs/misra/exclude-list.json b/docs/misra/exclude-list.json
index 24e4de3ca5..48f671c548 100644
--- a/docs/misra/exclude-list.json
+++ b/docs/misra/exclude-list.json
@@ -117,6 +117,10 @@
             "rel_path": "common/libfdt/*",
             "comment": "External library"
         },
+        {
+          "rel_path": "include/xen/libfdt/*",
+          "comment": "External library"
+        },
         {
             "rel_path": "common/livepatch_elf.c",
             "comment": "Not in scope initially as it generates many violations and it is not enabled in safety configurations"
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Dec 16 10:22:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 16 Dec 2023 10:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.655490.1023239 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rERoD-0001km-Pd; Sat, 16 Dec 2023 10:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 655490.1023239; Sat, 16 Dec 2023 10: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 1rERoD-0001ke-MT; Sat, 16 Dec 2023 10:22:13 +0000
Received: by outflank-mailman (input) for mailman id 655490;
 Sat, 16 Dec 2023 10: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 1rERoB-0001kU-OU
 for xen-changelog@lists.xenproject.org; Sat, 16 Dec 2023 10: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 1rERoB-0006LJ-Nc
 for xen-changelog@lists.xenproject.org; Sat, 16 Dec 2023 10:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rERoB-0003u0-Ma
 for xen-changelog@lists.xenproject.org; Sat, 16 Dec 2023 10: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=srU4HdF+a/s7+8Q4ukrfx0inTatOYq9kbmFIqDGQNHY=; b=NCGy5Qr3M+9a7Thhmw/KfIsyMu
	hqBKhzbkxaOuIh+edMZqHL9kYU4UaVAfVOl7ffAsh4zmhAieoE7D1ZTDDjP8M4ytvKE7xPM9j/m02
	4PzbNpIHJigXS2epjrSk4IBhiFgIF6N30sHF7+469G2kCmXhYe0lGN/5EHZtfVebMJT4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/misra/rules.rst: add Rule 16.2
Message-Id: <E1rERoB-0003u0-Ma@xenbits.xenproject.org>
Date: Sat, 16 Dec 2023 10:22:11 +0000

commit a60067f39882a4f40547fc0cd8177bac89cb01b7
Author:     Stefano Stabellini <stefano.stabellini@amd.com>
AuthorDate: Fri Dec 15 13:09:22 2023 -0800
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Dec 15 13:09:22 2023 -0800

    docs/misra/rules.rst: add Rule 16.2
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 docs/misra/rules.rst | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 1dc3fa4c9d..d1996b9a2b 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -469,6 +469,15 @@ maintainers if you want to suggest a change.
      - In addition to break, also other unconditional flow control statements
        such as continue, return, goto are allowed.
 
+   * - `Rule 16.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_16_02.c>`_
+     - Required
+     - A switch label shall only be used when the most closely-enclosing
+       compound statement is the body of a switch statement
+     - The x86 emulator (xen/arch/x86/x86_emulate*) is exempt from
+       compliance with this rule. Efforts to make the x86 emulator
+       adhere to Rule 16.2 would result in increased complexity and
+       maintenance difficulty, and could potentially introduce bugs. 
+
    * - `Rule 16.7 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_16_07.c>`_
      - Required
      - A switch-expression shall not have essentially Boolean type
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Dec 18 21:22:07 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 Dec 2023 21:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.656405.1024518 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rFL3q-000584-Dr; Mon, 18 Dec 2023 21:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 656405.1024518; Mon, 18 Dec 2023 21: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 1rFL3q-00057w-B3; Mon, 18 Dec 2023 21:22:02 +0000
Received: by outflank-mailman (input) for mailman id 656405;
 Mon, 18 Dec 2023 21: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 1rFL3p-00057m-Cc
 for xen-changelog@lists.xenproject.org; Mon, 18 Dec 2023 21: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 1rFL3p-0007HF-Bh
 for xen-changelog@lists.xenproject.org; Mon, 18 Dec 2023 21:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFL3p-0003T6-AD
 for xen-changelog@lists.xenproject.org; Mon, 18 Dec 2023 21: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=6Ao2nHNAVvOaTU/O4JrJ0n8cgafKgWeoykzDub33nUg=; b=6iTo2WsdYyjuwDLeGzsGwGdmQI
	mzUK0dDZ59aMeSO3Nkvj9yOHh20lxsQnElkGmjQUI/QlPQK1VT52aheZT3rpoY5XxFlPXy36cWK/I
	DqKpSzmNN+pxQR2epVAawAruaTfPWNuK9Uf6vogk8hgmyxEDEmTNydujssrZBX+rihXI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] update Xen version to 4.17.3
Message-Id: <E1rFL3p-0003T6-AD@xenbits.xenproject.org>
Date: Mon, 18 Dec 2023 21:22:01 +0000

commit 949a4aad417621638231e4cf9f1b35e8e0328463
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Dec 18 13:10:25 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 18 13:10:25 2023 +0100

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

diff --git a/Config.mk b/Config.mk
index 8adce1b21a..8d91e4c4d5 100644
--- a/Config.mk
+++ b/Config.mk
@@ -231,15 +231,15 @@ SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= 7b4a99be8a39c12d3a7fc4b8db9f0eab4ac688d5
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.17.2
-MINIOS_UPSTREAM_REVISION ?= xen-RELEASE-4.17.1
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.17.3
+MINIOS_UPSTREAM_REVISION ?= xen-RELEASE-4.17.3
 
 SEABIOS_UPSTREAM_REVISION ?= rel-1.16.0
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= xen-4.17.1
+QEMU_TRADITIONAL_REVISION ?= xen-4.17.3
 
 # 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/xen/Makefile b/xen/Makefile
index 93aca9350f..a46e6330db 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    = 17
-export XEN_EXTRAVERSION ?= .3-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .3$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Dec 19 04:44:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 Dec 2023 04:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.656491.1024693 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rFRxb-0001eg-Lv; Tue, 19 Dec 2023 04:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 656491.1024693; Tue, 19 Dec 2023 04: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 1rFRxb-0001eY-J1; Tue, 19 Dec 2023 04:44:03 +0000
Received: by outflank-mailman (input) for mailman id 656491;
 Tue, 19 Dec 2023 04:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFRxa-0001eS-Gk
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 2023 04:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFRxa-000774-AC
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 2023 04:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFRxa-0006IF-9F
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 2023 04:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kgQoYc+pU6Az4yO/ZA3PsAWQjjwZwR1zzrXvKUBFAQw=; b=nF30P0C4JiYLx2xjvPV2dnA3SL
	FIBjJcJIp0YLWqyYqatbAKV8DdVg0nlz8avZ5F3NfRfpxPH5xX+8Uae/PXt7XqmFggwP9GUIG+znu
	dA2xTyEXQWmzEiRsuSUZORfg4/UWHWIeJGqRmvxeYYqnjRIU0vz/hIA6PFaNco8vkmqI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: add public arch-riscv.h
Message-Id: <E1rFRxa-0006IF-9F@xenbits.xenproject.org>
Date: Tue, 19 Dec 2023 04:44:02 +0000

commit fa469c5a8601f67028e9d3f98e2d4adeb2253870
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Dec 18 15:18:13 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 18 15:18:13 2023 +0100

    xen/riscv: add public arch-riscv.h
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/public/arch-riscv.h | 93 +++++++++++++++++++++++++++++++++++++++++
 xen/include/public/xen.h        |  2 +
 2 files changed, 95 insertions(+)

diff --git a/xen/include/public/arch-riscv.h b/xen/include/public/arch-riscv.h
new file mode 100644
index 0000000000..168263b920
--- /dev/null
+++ b/xen/include/public/arch-riscv.h
@@ -0,0 +1,93 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Guest OS interface to RISC-V Xen.
+ * Initially based on the ARM implementation.
+ */
+
+#ifndef __XEN_PUBLIC_ARCH_RISCV_H__
+#define __XEN_PUBLIC_ARCH_RISCV_H__
+
+#if defined(__XEN__) || defined(__XEN_TOOLS__) || defined(__GNUC__)
+#define  int64_aligned_t  int64_t __attribute__((__aligned__(8)))
+#define uint64_aligned_t uint64_t __attribute__((__aligned__(8)))
+#endif
+
+#ifndef __ASSEMBLY__
+#define ___DEFINE_XEN_GUEST_HANDLE(name, type)                  \
+    typedef union { type *p; unsigned long q; }                 \
+        __guest_handle_ ## name;                                \
+    typedef union { type *p; uint64_aligned_t q; }              \
+        __guest_handle_64_ ## name
+
+/*
+ * XEN_GUEST_HANDLE represents a guest pointer, when passed as a field
+ * in a struct in memory. On RISCV is always 8 bytes sizes and 8 bytes
+ * aligned.
+ * XEN_GUEST_HANDLE_PARAM represents a guest pointer, when passed as an
+ * hypercall argument. It is 4 bytes on riscv32 and 8 bytes on riscv64.
+ */
+#define __DEFINE_XEN_GUEST_HANDLE(name, type) \
+    ___DEFINE_XEN_GUEST_HANDLE(name, type);   \
+    ___DEFINE_XEN_GUEST_HANDLE(const_##name, const type)
+#define DEFINE_XEN_GUEST_HANDLE(name)   __DEFINE_XEN_GUEST_HANDLE(name, name)
+#define __XEN_GUEST_HANDLE(name)        __guest_handle_64_ ## name
+#define XEN_GUEST_HANDLE(name)          __XEN_GUEST_HANDLE(name)
+#define XEN_GUEST_HANDLE_PARAM(name)    __guest_handle_ ## name
+#define set_xen_guest_handle_raw(hnd, val)                  \
+    do {                                                    \
+        typeof(&(hnd)) sxghr_tmp_ = &(hnd);                 \
+        sxghr_tmp_->q = 0;                                  \
+        sxghr_tmp_->p = (val);                              \
+    } while ( 0 )
+#define set_xen_guest_handle(hnd, val) set_xen_guest_handle_raw(hnd, val)
+
+typedef uint64_t xen_pfn_t;
+#define PRI_xen_pfn PRIx64
+#define PRIu_xen_pfn PRIu64
+
+typedef uint64_t xen_ulong_t;
+#define PRI_xen_ulong PRIx64
+
+#if defined(__XEN__) || defined(__XEN_TOOLS__)
+
+struct vcpu_guest_context {
+};
+typedef struct vcpu_guest_context vcpu_guest_context_t;
+DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
+
+struct xen_arch_domainconfig {
+};
+
+#endif
+
+/* TODO:  add a placeholder entry if no real ones surface */
+struct arch_vcpu_info {
+};
+typedef struct arch_vcpu_info arch_vcpu_info_t;
+
+/* TODO:  add a placeholder entry if no real ones surface */
+struct arch_shared_info {
+};
+typedef struct arch_shared_info arch_shared_info_t;
+
+/*
+ * Maximum number of virtual CPUs in legacy multi-processor guests.
+ * Only one. All other VCPUS must use VCPUOP_register_vcpu_info.
+ */
+#define XEN_LEGACY_MAX_VCPUS 1
+
+/* Stub definition of PMU structure */
+typedef struct xen_pmu_arch { uint8_t dummy; } xen_pmu_arch_t;
+#endif
+
+#endif /*  __XEN_PUBLIC_ARCH_RISCV_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index b812a0a324..b47d48d0e2 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -18,6 +18,8 @@
 #include "arch-arm.h"
 #elif defined(__powerpc64__)
 #include "arch-ppc.h"
+#elif defined(__riscv)
+#include "arch-riscv.h"
 #else
 #error "Unsupported architecture"
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Dec 19 04:44:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 Dec 2023 04:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.656492.1024696 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rFRxl-0001gq-Mu; Tue, 19 Dec 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 656492.1024696; Tue, 19 Dec 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 1rFRxl-0001gj-KU; Tue, 19 Dec 2023 04:44:13 +0000
Received: by outflank-mailman (input) for mailman id 656492;
 Tue, 19 Dec 2023 04:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFRxk-0001gX-Ft
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 2023 04:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFRxk-00077G-F1
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 2023 04:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFRxk-0006It-CK
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 2023 04:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=b84+/jG8e+7MRoKmhzifMsHXdZ6ovtJTSdDrxLGzoDg=; b=AymIVDsn//0BGk9O/eG5ozxOda
	6zDehCyl8WKFfFET6ALCjH9ZJEC2tgTQ37C45yWQoTKWQGJq5mwkcPTUTypq5VRhnC9yGWDSgv3S/
	qoE2ekVmTDRZewjg2PilFQJIXCT1R7UAH6K8KeTKfGyU3sjUZk4d61FbzcBnsqkPj6ZI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: add RISCV support for pmu.h
Message-Id: <E1rFRxk-0006It-CK@xenbits.xenproject.org>
Date: Tue, 19 Dec 2023 04:44:12 +0000

commit d2ab1347bddf4a8947714fa64fd1b633b10c59ab
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Dec 18 15:18:45 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 18 15:18:45 2023 +0100

    xen: add RISCV support for pmu.h
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/public/pmu.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/include/public/pmu.h b/xen/include/public/pmu.h
index 5a176b6ac3..af8b7babdd 100644
--- a/xen/include/public/pmu.h
+++ b/xen/include/public/pmu.h
@@ -13,6 +13,8 @@
 #include "arch-arm.h"
 #elif defined (__powerpc64__)
 #include "arch-ppc.h"
+#elif defined(__riscv)
+#include "arch-riscv.h"
 #else
 #error "Unsupported architecture"
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Dec 19 04:44:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 Dec 2023 04:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.656493.1024701 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rFRxv-0001jU-OR; Tue, 19 Dec 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 656493.1024701; Tue, 19 Dec 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 1rFRxv-0001jN-Lt; Tue, 19 Dec 2023 04:44:23 +0000
Received: by outflank-mailman (input) for mailman id 656493;
 Tue, 19 Dec 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 1rFRxu-0001jC-L7
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 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 1rFRxu-00077R-JF
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 2023 04:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFRxu-0006JK-H9
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 2023 04: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=8RPszG67Qzlod2DCXeokAhZOhArSay46JHrEJszuB6M=; b=v7Kf7vSUV7EGTUqYXH5EQfclJG
	3J2EIdILs7LEDxahuj6yDE8/7Cxq/LoxlgC26CeGH3sCQ/vCqwmaREXIOjYPX4PDA3Eqf50e74VVJ
	ZsEHJwLy3RrE126OhRxOy8hO1YudmgGZL4SQ1B6R43faJETe2QptLDuaJjIkprP28HO8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: fix compilation issue of serial.c
Message-Id: <E1rFRxu-0006JK-H9@xenbits.xenproject.org>
Date: Tue, 19 Dec 2023 04:44:22 +0000

commit c6dbc6df5266e10131fd04ad68ba5118fc257802
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Dec 18 15:19:01 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 18 15:19:01 2023 +0100

    xen: fix compilation issue of serial.c
    
    The following issue occurs on RISC-V platforms:
    drivers/char/serial.c: In function 'serial_tx_interrupt':
    drivers/char/serial.c:88:9: error: implicit declaration of function 'cpu_relax' [-Werror=implicit-function-declaration]
       88 |         cpu_relax();
    
    cpu_relax() is defined in <asm/processor.h> so it was added
    an inclusion of the header to serial.c.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/char/serial.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c
index 6d792f06dd..324024c29a 100644
--- a/xen/drivers/char/serial.c
+++ b/xen/drivers/char/serial.c
@@ -13,6 +13,8 @@
 #include <xen/serial.h>
 #include <xen/cache.h>
 
+#include <asm/processor.h>
+
 /* Never drop characters, even if the async transmit buffer fills. */
 /* #define SERIAL_NEVER_DROP_CHARS 1 */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Dec 19 04:44:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 Dec 2023 04:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.656494.1024705 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rFRy5-0001mJ-Q6; Tue, 19 Dec 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 656494.1024705; Tue, 19 Dec 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 1rFRy5-0001mB-NN; Tue, 19 Dec 2023 04:44:33 +0000
Received: by outflank-mailman (input) for mailman id 656494;
 Tue, 19 Dec 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 1rFRy4-0001m2-Oj
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 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 1rFRy4-00077c-Ms
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 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 1rFRy4-0006Jj-LM
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 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=+zKBL82fNeWeYfbsq0M+VhcYhgTmH5VoWSILqPXtwT4=; b=GdpT+FFvWEcogQvBJ/5WZATFMG
	Shdh4Sw88z+FnCsVfxH4C7p58+0XB4fYTSNdR6T85Lejstsh6krcrSssmCtdcDd41XHwhJrfclmtj
	FitislLRg7L6Bzqyce5Cz0Rb8rhu5q/ooNreU8KErOw0QJgeYVvCqSHLtufdQ/Emy2U0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/x86: add missing instances of asmlinkage attributes
Message-Id: <E1rFRy4-0006Jj-LM@xenbits.xenproject.org>
Date: Tue, 19 Dec 2023 04:44:32 +0000

commit c714b8807b71fafe7f4b9149b07764dcc88abf79
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Mon Dec 18 15:19:24 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 18 15:19:24 2023 +0100

    xen/x86: add missing instances of asmlinkage attributes
    
    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/arch/x86/efi/efi-boot.h | 5 +++--
 xen/arch/x86/smpboot.c      | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 86467da301..8ea64e31cd 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -808,8 +808,9 @@ static const char *__init get_option(const char *cmd, const char *opt)
     return o;
 }
 
-void __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable,
-                           const char *cmdline)
+void asmlinkage __init efi_multiboot2(EFI_HANDLE ImageHandle,
+                                      EFI_SYSTEM_TABLE *SystemTable,
+                                      const char *cmdline)
 {
     EFI_GRAPHICS_OUTPUT_PROTOCOL *gop;
     EFI_HANDLE gop_handle;
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 4c54ecbc91..8aa621533f 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -310,7 +310,7 @@ static void set_cpu_sibling_map(unsigned int cpu)
     }
 }
 
-void start_secondary(void *unused)
+void asmlinkage start_secondary(void *unused)
 {
     struct cpu_info *info = get_cpu_info();
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Dec 19 04:44:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 Dec 2023 04:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.656495.1024709 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rFRyF-0001or-Rd; Tue, 19 Dec 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 656495.1024709; Tue, 19 Dec 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 1rFRyF-0001ok-Oo; Tue, 19 Dec 2023 04:44:43 +0000
Received: by outflank-mailman (input) for mailman id 656495;
 Tue, 19 Dec 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 1rFRyE-0001oe-RN
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 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 1rFRyE-00077j-QS
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 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 1rFRyE-0006K8-PJ
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 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=0zkkPToZB9Jt07AWVKO9KKdUlkIlfxhZAoUoHTohJCA=; b=6hKwDsPr6rGJJZ0ODuFhOidpAV
	X0o2Dbt0d0029YvMcXl4HZ29UFzqRFjPWQXplpuBKNqf6pfWwyS1vyuop+L1ei33OhZ4ZQtZA01OB
	egpiRAEA9+E1G2X6tFVvh4t73YQHQZBBw0OuE9s9Jr/7H/5Nv8jeC2+NWj0lwKnXPw6o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/x86_emulate: address violations of MISRA C:2012 Rule 14.4
Message-Id: <E1rFRyE-0006K8-PJ@xenbits.xenproject.org>
Date: Tue, 19 Dec 2023 04:44:42 +0000

commit a57680db1a47b6cf4cb68e7cddc1d9da7e0a2dc4
Author:     Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
AuthorDate: Mon Dec 18 15:20:20 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 18 15:20:20 2023 +0100

    xen/x86_emulate: address violations of MISRA C:2012 Rule 14.4
    
    The xen sources contain violations of MISRA C:2012 Rule 14.4 whose
    headline states:
    "The controlling expression of an if statement and the controlling
    expression of an iteration-statement shall have essentially Boolean type".
    
    Add comparisons to avoid using enum constants as controlling expressions
    to comply with Rule 14.4.
    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: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index cf780da501..00b7365ed3 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -1320,7 +1320,7 @@ x86_emulate(
         ea.bytes = 2;
         goto srcmem_common;
     case SrcMem:
-        if ( state->simd_size )
+        if ( state->simd_size != simd_none )
             break;
         ea.bytes = (d & ByteOp) ? 1 : op_bytes;
     srcmem_common:
@@ -1460,7 +1460,7 @@ x86_emulate(
         /* Becomes a normal DstMem operation from here on. */
     case DstMem:
         generate_exception_if(ea.type == OP_MEM && evex.z, X86_EXC_UD);
-        if ( state->simd_size )
+        if ( state->simd_size != simd_none )
         {
             generate_exception_if(lock_prefix, X86_EXC_UD);
             break;
@@ -8176,7 +8176,7 @@ x86_emulate(
         goto done;
     }
 
-    if ( state->rmw )
+    if ( state->rmw != rmw_NONE )
     {
         ea.val = src.val;
         op_bytes = dst.bytes;
@@ -8205,7 +8205,7 @@ x86_emulate(
 
         dst.type = OP_NONE;
     }
-    else if ( state->simd_size )
+    else if ( state->simd_size != simd_none )
     {
         generate_exception_if(!op_bytes, X86_EXC_UD);
         generate_exception_if((vex.opcx && (d & TwoOp) &&
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Dec 19 04:44:53 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 Dec 2023 04:44:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.656496.1024712 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rFRyP-0001rI-Sl; Tue, 19 Dec 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 656496.1024712; Tue, 19 Dec 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 1rFRyP-0001rB-QL; Tue, 19 Dec 2023 04:44:53 +0000
Received: by outflank-mailman (input) for mailman id 656496;
 Tue, 19 Dec 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 1rFRyO-0001r4-UP
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 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 1rFRyO-00078D-TZ
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 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 1rFRyO-0006KZ-Sc
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 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=3gwLiXiDrgzEOZpKwBdMKiS36sP/yqkSKNm3Y80vbp0=; b=1M85aKDD2MLzKQWAhz2t7KqIyz
	zlWhTpNajYW7A3zyX1auesxBfSCXcVvhRSZkukc0l+4kRr9/f2uJRLO44l8d7hkCSoa+MbYiO9QIU
	6RXVGX9zBtiXENhx16/2a3NgqWuxtzhTM5MrS+axFWeuvB4jjj93MWp3BaF6oSUKVp+M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm64: address violations of MISRA C:2012 Rule 11.8
Message-Id: <E1rFRyO-0006KZ-Sc@xenbits.xenproject.org>
Date: Tue, 19 Dec 2023 04:44:52 +0000

commit 5fbb3e9da95fee1a9e60452fb3ffc32a53863591
Author:     Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
AuthorDate: Mon Dec 18 15:20:47 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 18 15:20:47 2023 +0100

    xen/arm64: address violations of MISRA C:2012 Rule 11.8
    
    The xen sources contain violations of MISRA C:2012 Rule 11.8 whose
    headline states:
    "A conversion shall not remove any const, volatile or _Atomic qualification
    from the type pointed to by a pointer".
    
    Add volatile qualifiers missing in casts.
    Arguments p and ptr are originally volatile-qualified.
    There's no reason to drop the qualifiers.
    No functional change.
    
    Signed-off-by: Maria Celeste Cesario  <maria.celeste.cesario@bugseng.com>
    Signed-off-by: Simone Ballarin  <simone.ballarin@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/arm64/lib/bitops.c          |  6 ++++--
 xen/arch/arm/include/asm/arm64/cmpxchg.h | 10 +++++-----
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/arm64/lib/bitops.c b/xen/arch/arm/arm64/lib/bitops.c
index 20e3f3d6ce..275a780329 100644
--- a/xen/arch/arm/arm64/lib/bitops.c
+++ b/xen/arch/arm/arm64/lib/bitops.c
@@ -32,7 +32,8 @@
 static always_inline bool int_##name(int nr, volatile void *p, bool timeout,\
                                      unsigned int max_try)                  \
 {                                                                           \
-    volatile uint32_t *ptr = (uint32_t *)p + BITOP_WORD((unsigned int)nr);  \
+    volatile uint32_t *ptr = (volatile uint32_t *)p +                       \
+                             BITOP_WORD((unsigned int)nr);                  \
     const uint32_t mask = BITOP_MASK((unsigned int)nr);                     \
     unsigned long res, tmp;                                                 \
                                                                             \
@@ -67,7 +68,8 @@ bool name##_timeout(int nr, volatile void *p, unsigned int max_try)         \
 static always_inline bool int_##name(int nr, volatile void *p, int *oldbit, \
                                      bool timeout, unsigned int max_try)    \
 {                                                                           \
-    volatile uint32_t *ptr = (uint32_t *)p + BITOP_WORD((unsigned int)nr);  \
+    volatile uint32_t *ptr = (volatile uint32_t *)p +                       \
+                             BITOP_WORD((unsigned int)nr);                  \
     unsigned int bit = (unsigned int)nr % BITOP_BITS_PER_WORD;              \
     const uint32_t mask = BITOP_MASK(bit);                                  \
     unsigned long res, tmp;                                                 \
diff --git a/xen/arch/arm/include/asm/arm64/cmpxchg.h b/xen/arch/arm/include/asm/arm64/cmpxchg.h
index dbfaf91567..031fa6d92a 100644
--- a/xen/arch/arm/include/asm/arm64/cmpxchg.h
+++ b/xen/arch/arm/include/asm/arm64/cmpxchg.h
@@ -13,7 +13,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size
 		"1:	ldxrb	%w0, %2\n"
 		"	stlxrb	%w1, %w3, %2\n"
 		"	cbnz	%w1, 1b\n"
-			: "=&r" (ret), "=&r" (tmp), "+Q" (*(u8 *)ptr)
+			: "=&r" (ret), "=&r" (tmp), "+Q" (*(volatile u8 *)ptr)
 			: "r" (x)
 			: "memory");
 		break;
@@ -22,7 +22,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size
 		"1:	ldxrh	%w0, %2\n"
 		"	stlxrh	%w1, %w3, %2\n"
 		"	cbnz	%w1, 1b\n"
-			: "=&r" (ret), "=&r" (tmp), "+Q" (*(u16 *)ptr)
+			: "=&r" (ret), "=&r" (tmp), "+Q" (*(volatile u16 *)ptr)
 			: "r" (x)
 			: "memory");
 		break;
@@ -31,7 +31,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size
 		"1:	ldxr	%w0, %2\n"
 		"	stlxr	%w1, %w3, %2\n"
 		"	cbnz	%w1, 1b\n"
-			: "=&r" (ret), "=&r" (tmp), "+Q" (*(u32 *)ptr)
+			: "=&r" (ret), "=&r" (tmp), "+Q" (*(volatile u32 *)ptr)
 			: "r" (x)
 			: "memory");
 		break;
@@ -40,7 +40,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size
 		"1:	ldxr	%0, %2\n"
 		"	stlxr	%w1, %3, %2\n"
 		"	cbnz	%w1, 1b\n"
-			: "=&r" (ret), "=&r" (tmp), "+Q" (*(u64 *)ptr)
+			: "=&r" (ret), "=&r" (tmp), "+Q" (*(volatile u64 *)ptr)
 			: "r" (x)
 			: "memory");
 		break;
@@ -82,7 +82,7 @@ static inline bool __cmpxchg_case_##name(volatile void *ptr,		\
 		"	stxr" #sz "	%w0, %" #w "4, %2\n"		\
 		"1:\n"							\
 		: "=&r" (res), "=&r" (oldval),				\
-		  "+Q" (*(unsigned long *)ptr)				\
+		  "+Q" (*(volatile unsigned long *)ptr)	\
 		: "Ir" (*old), "r" (new)				\
 		: "cc");						\
 									\
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Dec 19 04:45:04 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 Dec 2023 04:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.656497.1024717 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rFRyZ-0001uC-W2; Tue, 19 Dec 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 656497.1024717; Tue, 19 Dec 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 1rFRyZ-0001u4-TJ; Tue, 19 Dec 2023 04:45:03 +0000
Received: by outflank-mailman (input) for mailman id 656497;
 Tue, 19 Dec 2023 04: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 1rFRyZ-0001tw-1m
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 2023 04:45:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFRyZ-00078m-0W
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 2023 04:45:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFRyY-0006LE-Vv
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 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=QaPePChZb409edB/6dEGLFgUvMRo8d/DlmZAW8RgLxk=; b=Hg/BKUUj4T3rm0McDzOnZoI5Zk
	Vkri3Z0VpLOH2tSKGrnuIqqwMtCqYX8n+VS8SlDAxGf3XAwJXD9ebPg4C2iiXqDrKaZTI0QoPWYyj
	HSbDwiXiNpzg8PLF+Nwxi0fKNXxF2rHmC0DiJau9uAYSenUM+tg5Nf8BAHdBufhKyTww=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/efi: address violations of MISRA C:2012 Rule 11.8
Message-Id: <E1rFRyY-0006LE-Vv@xenbits.xenproject.org>
Date: Tue, 19 Dec 2023 04:45:02 +0000

commit b736154e899b44cc21566f0b1849907e8f4ba771
Author:     Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
AuthorDate: Mon Dec 18 15:21:17 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 18 15:21:17 2023 +0100

    xen/efi: address violations of MISRA C:2012 Rule 11.8
    
    The xen sources contain violations of MISRA C:2012 Rule 11.8 whose
    headline states:
    "A conversion shall not remove any const, volatile or _Atomic qualification
    from the type pointed to by a pointer".
    
    Add missing const qualifiers in casts.
    The variables are originally const-qualified.
    There's no reason to drop the qualifiers.
    
    Signed-off-by: Maria Celeste Cesario  <maria.celeste.cesario@bugseng.com>
    Signed-off-by: Simone Ballarin  <simone.ballarin@bugseng.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/boot.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 6110819918..efbec00af9 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -1248,10 +1248,10 @@ static void __init efi_exit_boot(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *Syste
 #endif
 
     /* Adjust pointers into EFI. */
-    efi_ct = (void *)efi_ct + DIRECTMAP_VIRT_START;
-    efi_rs = (void *)efi_rs + DIRECTMAP_VIRT_START;
+    efi_ct = (const void *)efi_ct + DIRECTMAP_VIRT_START;
+    efi_rs = (const void *)efi_rs + DIRECTMAP_VIRT_START;
     efi_memmap = (void *)efi_memmap + DIRECTMAP_VIRT_START;
-    efi_fw_vendor = (void *)efi_fw_vendor + DIRECTMAP_VIRT_START;
+    efi_fw_vendor = (const void *)efi_fw_vendor + DIRECTMAP_VIRT_START;
 }
 
 /* SAF-1-safe */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Dec 19 04:45:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 Dec 2023 04:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.656498.1024721 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rFRyk-0001xI-1R; Tue, 19 Dec 2023 04:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 656498.1024721; Tue, 19 Dec 2023 04: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 1rFRyj-0001xA-Ul; Tue, 19 Dec 2023 04:45:13 +0000
Received: by outflank-mailman (input) for mailman id 656498;
 Tue, 19 Dec 2023 04: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 1rFRyj-0001wz-6O
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 2023 04: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 1rFRyj-00078z-5P
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 2023 04:45:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFRyj-0006Ld-2m
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 2023 04: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=irPAj/lM0/StJEqs5uxrC2EwHJoh7nfAC4WMbJnR0T0=; b=oPG/jGYfRRKFuhVrsKA1FjVVyx
	l6P18PLbeflrWdRpslyjw5qBvxOGBikJ4/Ne9+1sfi6DUw9tojj401+pXSs58PUcEGxssexesw3A+
	m7tp3JvJcQ14PKo/XwLcGhbmVzeH+wkzATqlGlvPIvohwdM9cNW83t6VBr96BMHJ1tqE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/boot: address violations of MISRA C:2012 Rule 11.8
Message-Id: <E1rFRyj-0006Ld-2m@xenbits.xenproject.org>
Date: Tue, 19 Dec 2023 04:45:13 +0000

commit abdee7b1dbfe6ae98ab3e10102fba5804e5ac63e
Author:     Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
AuthorDate: Mon Dec 18 15:21:42 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 18 15:21:42 2023 +0100

    x86/boot: address violations of MISRA C:2012 Rule 11.8
    
    The xen sources contain violations of MISRA C:2012 Rule 11.8 whose
    headline states:
    "A conversion shall not remove any const, volatile or _Atomic qualification
    from the type pointed to by a pointer".
    
    Add missing const qualifiers in casts.
    
    Macro get_mb2_data returns values that are const-qualified.
    The results are stored in const struct pointers, hence
    there's no need to cast away the const qualifiers.
    
    Signed-off-by: Maria Celeste Cesario  <maria.celeste.cesario@bugseng.com>
    Signed-off-by: Simone Ballarin  <simone.ballarin@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/x86/boot/reloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c
index df0bc710a7..77fdb2be05 100644
--- a/xen/arch/x86/boot/reloc.c
+++ b/xen/arch/x86/boot/reloc.c
@@ -300,8 +300,8 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, uint32_t video_out)
                 const struct vesa_mode_info *mi;
 
                 video = _p(video_out);
-                ci = (void *)get_mb2_data(tag, vbe, vbe_control_info);
-                mi = (void *)get_mb2_data(tag, vbe, vbe_mode_info);
+                ci = (const void *)get_mb2_data(tag, vbe, vbe_control_info);
+                mi = (const void *)get_mb2_data(tag, vbe, vbe_mode_info);
 
                 if ( ci->version >= 0x0200 && (mi->attrib & 0x9b) == 0x9b )
                 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Dec 19 04:45:25 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 Dec 2023 04:45:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.656499.1024724 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rFRyv-00020G-2a; Tue, 19 Dec 2023 04:45:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 656499.1024724; Tue, 19 Dec 2023 04:45: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 1rFRyv-000209-04; Tue, 19 Dec 2023 04:45:25 +0000
Received: by outflank-mailman (input) for mailman id 656499;
 Tue, 19 Dec 2023 04: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 1rFRyt-000200-9U
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 2023 04: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 1rFRyt-00079A-8h
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 2023 04:45:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFRyt-0006M8-7i
 for xen-changelog@lists.xenproject.org; Tue, 19 Dec 2023 04: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=89QgA1Zk3FyIFJufAm8q4JCJV707sx4pkPfCRsch1aU=; b=44/By/6Y7Z2+e4U7SZTGrqJs2Z
	GMj+PbZbwt9gmZyLmZ3gCt+EUl2C3IE4rxI50moBHgcLJ0ppi/fFL+knawvHhqtScAg/XRqc6uhcD
	afsW3XXbjg+yQwb7cQ+W6AWCV7HIv45r7dbKpL2G76G4XkL5FWBFqL+Ojh75Rwvqkjxw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvm: address a violation of MISRA C:2012 Rule 11.8
Message-Id: <E1rFRyt-0006M8-7i@xenbits.xenproject.org>
Date: Tue, 19 Dec 2023 04:45:23 +0000

commit 0cc74376d6823e0883f89556be2a267f2240a558
Author:     Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
AuthorDate: Mon Dec 18 15:22:06 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 18 15:22:06 2023 +0100

    x86/hvm: address a violation of MISRA C:2012 Rule 11.8
    
    The xen sources contain violations of MISRA C:2012 Rule 11.8 whose
    headline states:
    "A conversion shall not remove any const, volatile or _Atomic qualification
    from the type pointed to by a pointer".
    
    Remove unnecessary cast.
    from is a const-qualified pointer to void and the function hvm_copy_to_guest_linear
    requires a const void* type argument, therefore the cast to void* is not necessary.
    
    No functional change.
    
    Signed-off-by: Maria Celeste Cesario  <maria.celeste.cesario@bugseng.com>
    Signed-off-by: Simone Ballarin  <simone.ballarin@bugseng.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/x86/hvm/hvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 35a30df3b1..523e0df57c 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3462,7 +3462,7 @@ unsigned int copy_to_user_hvm(void *to, const void *from, unsigned int len)
         return 0;
     }
 
-    rc = hvm_copy_to_guest_linear((unsigned long)to, (void *)from, len, 0, NULL);
+    rc = hvm_copy_to_guest_linear((unsigned long)to, from, len, 0, NULL);
     return rc ? len : 0; /* fake a copy_to_user() return code */
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 20 09:44:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Dec 2023 09:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.657561.1026471 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rFt7T-0000XK-2q; Wed, 20 Dec 2023 09:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 657561.1026471; Wed, 20 Dec 2023 09: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 1rFt7T-0000XD-0Q; Wed, 20 Dec 2023 09:44:03 +0000
Received: by outflank-mailman (input) for mailman id 657561;
 Wed, 20 Dec 2023 09: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 1rFt7R-0000X3-W7
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09: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 1rFt7R-0000s6-VE
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFt7R-0003ag-U4
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09: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=zPMIA7pGYQLxbU3+hn+goSNuyUWcKrgLM4pjet7i9v8=; b=VYl0QQke503Oa/ZsxhMnTu2hyZ
	euYzRraASHSa24rxH1WHY8q+f4o9eCMk1LDCfTwq+FrdYKADvxjoaJUDtlvEB6mAyAFqc0OC7LGKF
	Sv4ZcO/H6B6uXTMdQMDGEtitCh3vJzj044SORxbEzg/b8icAAIZg51lp9mc0MpMVhums=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: allow non-BIGMEM configs to boot on >= 16Tb systems
Message-Id: <E1rFt7R-0003ag-U4@xenbits.xenproject.org>
Date: Wed, 20 Dec 2023 09:44:01 +0000

commit 64d32b75e6e3b093828623d5ce30b4826bb6b1df
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 19 13:47:38 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 19 13:47:38 2023 +0100

    x86: allow non-BIGMEM configs to boot on >= 16Tb systems
    
    While frame table setup, directmap init, and boot allocator population
    respect all intended bounds, the logic passing memory to the heap
    allocator which wasn't passed to the boot allocator fails to respect
    max_{pdx,pfn}. This then typically triggers the BUG() in
    free_heap_pages() after checking page state, because of hitting a struct
    page_info instance which was set to all ~0.
    
    Of course all the memory above the 16Tb boundary is still going to
    remain unused; using it requires BIGMEM=y. And of course this fix
    similarly ought to help BIGMEM=y configurations on >= 123Tb systems
    (where all the memory beyond that boundary continues to be unused).
    
    Fixes: bac2000063ba ("x86-64: reduce range spanned by 1:1 mapping and frame table indexes")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/setup.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 3cba2be0af..62f4686cae 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1731,15 +1731,15 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 
     if ( max_page - 1 > virt_to_mfn(HYPERVISOR_VIRT_END - 1) )
     {
-        unsigned long limit = virt_to_mfn(HYPERVISOR_VIRT_END - 1);
+        unsigned long lo = virt_to_mfn(HYPERVISOR_VIRT_END - 1);
         uint64_t mask = PAGE_SIZE - 1;
 
         if ( !highmem_start )
-            xenheap_max_mfn(limit);
+            xenheap_max_mfn(lo);
 
         end_boot_allocator();
 
-        /* Pass the remaining memory to the allocator. */
+        /* Pass the remaining memory in (lo, max_page) to the allocator. */
         for ( i = 0; i < boot_e820.nr_map; i++ )
         {
             uint64_t s, e;
@@ -1748,10 +1748,12 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
                 continue;
             s = (boot_e820.map[i].addr + mask) & ~mask;
             e = (boot_e820.map[i].addr + boot_e820.map[i].size) & ~mask;
-            if ( PFN_DOWN(e) <= limit )
+            if ( PFN_DOWN(e) <= lo || PFN_DOWN(s) >= max_page )
                 continue;
-            if ( PFN_DOWN(s) <= limit )
-                s = pfn_to_paddr(limit + 1);
+            if ( PFN_DOWN(s) <= lo )
+                s = pfn_to_paddr(lo + 1);
+            if ( PFN_DOWN(e) > max_page )
+                e = pfn_to_paddr(max_page);
             init_domheap_pages(s, e);
         }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 20 09:44:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Dec 2023 09:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.657563.1026486 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rFt7d-0000ve-Gq; Wed, 20 Dec 2023 09:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 657563.1026486; Wed, 20 Dec 2023 09: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 1rFt7d-0000vR-DY; Wed, 20 Dec 2023 09:44:13 +0000
Received: by outflank-mailman (input) for mailman id 657563;
 Wed, 20 Dec 2023 09: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 1rFt7c-0000tK-43
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09: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 1rFt7c-0000sI-3B
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFt7c-0003bP-1F
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09: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=okY6+w707rbNYyocnD8UVqV2NVehD1J48HYO+VAkjz4=; b=D9e6r6tjLMPUkrJIB5aG557Rg5
	n7U0rUunteNxyivnXz9jxR9PxMK4pm5S2tIJHtsVieGcWYWXjxyYo+BEemMBSDr80Po25RkGl8XHO
	/RMyW0BAtE1hDTDE/+v+0vqskWpU/yPTpnAybcamS0x01wfTDsX/01kGKMPTzB+Q9hEM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] iommu/vt-d: do not assume page table levels for quarantine domain
Message-Id: <E1rFt7c-0003bP-1F@xenbits.xenproject.org>
Date: Wed, 20 Dec 2023 09:44:12 +0000

commit 3af0a4f9228c64ebbb342bc333c7c8a765ceb8d2
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Dec 19 13:48:09 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 19 13:48:09 2023 +0100

    iommu/vt-d: do not assume page table levels for quarantine domain
    
    Like XSA-445, do not assume IOMMU page table levels on VT-d are always set
    based on DEFAULT_DOMAIN_ADDRESS_WIDTH and instead fetch the value set by
    intel_iommu_domain_init() from the domain iommu structure.  This prevents
    changes to intel_iommu_domain_init() possibly getting the levels out of sync
    with what intel_iommu_quarantine_init() expects.
    
    No functional change, since on Intel domains are hardcoded to use
    DEFAULT_DOMAIN_ADDRESS_WIDTH.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/vtd/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index e13b7d99db..bc6181c9f9 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -3162,7 +3162,7 @@ static int cf_check intel_iommu_quarantine_init(struct pci_dev *pdev,
 {
     struct domain_iommu *hd = dom_iommu(dom_io);
     struct page_info *pg;
-    unsigned int agaw = width_to_agaw(DEFAULT_DOMAIN_ADDRESS_WIDTH);
+    unsigned int agaw = hd->arch.vtd.agaw;
     unsigned int level = agaw_to_level(agaw);
     const struct acpi_drhd_unit *drhd;
     const struct acpi_rmrr_unit *rmrr;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 20 09:44:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Dec 2023 09:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.657564.1026489 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rFt7n-00015c-Hk; Wed, 20 Dec 2023 09:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 657564.1026489; Wed, 20 Dec 2023 09: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 1rFt7n-00015T-FK; Wed, 20 Dec 2023 09:44:23 +0000
Received: by outflank-mailman (input) for mailman id 657564;
 Wed, 20 Dec 2023 09: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 1rFt7m-00013W-76
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09: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 1rFt7m-0000su-6E
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFt7m-0003c4-5J
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09: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=p3lFH+6hSsd7VWCiiaISUGh6Uvoi3NgeJY3hQD9WEGE=; b=xb1/40LjarlrNtzgkaR64+QLl6
	dOPdaEOPlQPo71kZV4IzPaWdD80QdTX0Ogv5YuPBhyvhO05hl0GD4HPm6J41Bd4LS8NbAKgR0gYm/
	bNkJLMBNxpXxB5TLxUI0wad17hMItRs2qHKPn+pxCu2xNyMfDxlpFcedRa2UDKwN6uCc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/hvm: use NULL as a null pointer constant
Message-Id: <E1rFt7m-0003c4-5J@xenbits.xenproject.org>
Date: Wed, 20 Dec 2023 09:44:22 +0000

commit 0940d342911788af72a870c6375ce5f1532036d0
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Thu Dec 14 12:44:06 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 19 13:48:42 2023 +0100

    xen/hvm: use NULL as a null pointer constant
    
    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/arch/x86/include/asm/hvm/irq.h | 2 +-
 xen/include/public/hvm/save.h      | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/include/asm/hvm/irq.h b/xen/arch/x86/include/asm/hvm/irq.h
index 1817ca6e2d..87e89993a4 100644
--- a/xen/arch/x86/include/asm/hvm/irq.h
+++ b/xen/arch/x86/include/asm/hvm/irq.h
@@ -136,7 +136,7 @@ struct hvm_girq_dpci_mapping {
 
 #define NR_ISAIRQS  16
 #define NR_LINK     4
-#define NR_HVM_DOMU_IRQS ARRAY_SIZE(((struct hvm_hw_vioapic *)0)->redirtbl)
+#define NR_HVM_DOMU_IRQS ARRAY_SIZE(((struct hvm_hw_vioapic *)NULL)->redirtbl)
 
 /* Protected by domain's event_lock */
 struct hvm_irq_dpci {
diff --git a/xen/include/public/hvm/save.h b/xen/include/public/hvm/save.h
index 2cf4238daa..ff0048e5f8 100644
--- a/xen/include/public/hvm/save.h
+++ b/xen/include/public/hvm/save.h
@@ -65,15 +65,15 @@ struct hvm_save_descriptor {
     struct __HVM_SAVE_TYPE_##_x { _type t; char c[_code]; char cpt[1];}
 #endif
 
-#define HVM_SAVE_TYPE(_x) __typeof__ (((struct __HVM_SAVE_TYPE_##_x *)(0))->t)
+#define HVM_SAVE_TYPE(_x) __typeof__(((struct __HVM_SAVE_TYPE_##_x *)NULL)->t)
 #define HVM_SAVE_LENGTH(_x) (sizeof (HVM_SAVE_TYPE(_x)))
-#define HVM_SAVE_CODE(_x) (sizeof (((struct __HVM_SAVE_TYPE_##_x *)(0))->c))
+#define HVM_SAVE_CODE(_x) (sizeof(((struct __HVM_SAVE_TYPE_##_x *)NULL)->c))
 
 #ifdef __XEN__
-# define HVM_SAVE_TYPE_COMPAT(_x) __typeof__ (((struct __HVM_SAVE_TYPE_COMPAT_##_x *)(0))->t)
+# define HVM_SAVE_TYPE_COMPAT(_x) __typeof__(((struct __HVM_SAVE_TYPE_COMPAT_##_x *)NULL)->t)
 # define HVM_SAVE_LENGTH_COMPAT(_x) (sizeof (HVM_SAVE_TYPE_COMPAT(_x)))
 
-# define HVM_SAVE_HAS_COMPAT(_x) (sizeof (((struct __HVM_SAVE_TYPE_##_x *)(0))->cpt)-1)
+# define HVM_SAVE_HAS_COMPAT(_x) (sizeof(((struct __HVM_SAVE_TYPE_##_x *)NULL)->cpt) - 1)
 # define HVM_SAVE_FIX_COMPAT(_x, _dst, _size) __HVM_SAVE_FIX_COMPAT_##_x(_dst, _size)
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 20 09:44:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Dec 2023 09:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.657569.1026494 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rFt7x-0001Lx-Jn; Wed, 20 Dec 2023 09:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 657569.1026494; Wed, 20 Dec 2023 09: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 1rFt7x-0001Lp-Gx; Wed, 20 Dec 2023 09:44:33 +0000
Received: by outflank-mailman (input) for mailman id 657569;
 Wed, 20 Dec 2023 09: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 1rFt7w-0001LM-Ay
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09: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 1rFt7w-0000t4-9m
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFt7w-0003cZ-8h
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09: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=GvTd07mJfhJly0NYtkwfEUBOrShnT6CugirRzP3hkpI=; b=LK+3j7UvsXEqa09cWjqJyqkBme
	eA8a4n+cKwXDZaqzp/raZyS6A72UIvXop6jJqijmpViGmOGh5Jkmp3gZ7+9fVqYQ22V23Fjbf+2xe
	SEgzwRA3oFIowzcFEmp/5/sRqrG88RtT1Yxn0QmRgyOf1TubaMpIOickPj15SNVmCk6k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ioapic: use NULL as a null pointer constant
Message-Id: <E1rFt7w-0003cZ-8h@xenbits.xenproject.org>
Date: Wed, 20 Dec 2023 09:44:32 +0000

commit 985fe473c04a077f6d9fd14db3b68df5044bd6ac
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Thu Dec 14 12:44:07 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 19 13:49:29 2023 +0100

    x86/ioapic: use NULL as a null pointer constant
    
    Resolves violations of MISRA C Rule 11.9.
    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/arch/x86/io_apic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index d11c880544..dd25ba3943 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -207,7 +207,7 @@ struct IO_APIC_route_entry **alloc_ioapic_entries(void)
 
     ioapic_entries = xmalloc_array(struct IO_APIC_route_entry *, nr_ioapics);
     if (!ioapic_entries)
-        return 0;
+        return NULL;
 
     for (apic = 0; apic < nr_ioapics; apic++) {
         ioapic_entries[apic] =
@@ -224,7 +224,7 @@ nomem:
         xfree(ioapic_entries[apic]);
     xfree(ioapic_entries);
 
-    return 0;
+    return NULL;
 }
 
 union entry_union {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 20 09:44:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Dec 2023 09:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.657570.1026498 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rFt87-0001Uc-LH; Wed, 20 Dec 2023 09:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 657570.1026498; Wed, 20 Dec 2023 09: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 1rFt87-0001US-IP; Wed, 20 Dec 2023 09:44:43 +0000
Received: by outflank-mailman (input) for mailman id 657570;
 Wed, 20 Dec 2023 09: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 1rFt86-0001UD-De
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09: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 1rFt86-0000tP-Cm
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFt86-0003d1-Bt
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09: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=0qC/bqNbe2GgEA+4UP15MW89HqsJXv3wZdsBX9xYBx0=; b=AVGuXWVzIBTTxhvF+d+4MUH6CH
	YD0QgGMx6VsFvwObba3Ls5zvwMVDCWpwJHW7Qk9htiafudeYC0kKDwA6fEBMY2qVxQCUazBXuNeSY
	xmhT9li+0Y50rLAWgtLMS3NvI8GWuk2I+nQcaYvhqMwDHe46FTvd7u6+cdWTvVJQUN44=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvm: dom0: use helper to get sizeof struct field
Message-Id: <E1rFt86-0003d1-Bt@xenbits.xenproject.org>
Date: Wed, 20 Dec 2023 09:44:42 +0000

commit e66237eb1a0e8a99424080370373816c7a53cf7d
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Thu Dec 14 12:44:09 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 19 13:49:54 2023 +0100

    x86/hvm: dom0: use helper to get sizeof struct field
    
    Use of the proper helper macro also resolves a violation
    of MISRA C Rule 11.9.
    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/arch/x86/hvm/dom0_build.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 70d31289b0..e59f6657d9 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -1144,8 +1144,7 @@ static int __init pvh_setup_acpi(struct domain *d, paddr_t start_info)
     rc = hvm_copy_to_guest_phys(start_info +
                                 offsetof(struct hvm_start_info, rsdp_paddr),
                                 &rsdp_paddr,
-                                sizeof(((struct hvm_start_info *)
-                                        0)->rsdp_paddr),
+                                sizeof_field(struct hvm_start_info, rsdp_paddr),
                                 d->vcpu[0]);
     if ( rc )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 20 09:44:53 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Dec 2023 09:44:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.657571.1026502 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rFt8H-0001aN-MN; Wed, 20 Dec 2023 09:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 657571.1026502; Wed, 20 Dec 2023 09: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 1rFt8H-0001aF-Js; Wed, 20 Dec 2023 09:44:53 +0000
Received: by outflank-mailman (input) for mailman id 657571;
 Wed, 20 Dec 2023 09: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 1rFt8G-0001a1-GV
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09: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 1rFt8G-0000th-Fl
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFt8G-0003dS-Eq
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09: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=LcRQ9pmZ9pKuEUEFX+Gn0T7ZPXZznUpb01ZxPf75fM0=; b=GdfEfon7aiO008sGlni9zSr8FA
	H/mUWH2HrUOwmZgxM2PXH5CmnN0LSuc4Ou3soHN1tREgT5GwwLnfstLr1808f44gz3pdRTsbko8k6
	6bAhNTlobw8KjNToiItCI3Hj9QDjXLhlNfmJURYLRHzbxLLXxQ6v9HzSwAHcDLXrqa+M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/wait: address violations of MISRA C Rule 11.9
Message-Id: <E1rFt8G-0003dS-Eq@xenbits.xenproject.org>
Date: Wed, 20 Dec 2023 09:44:52 +0000

commit 36a05926b0bc6de7b21759d15325eb86cd188d98
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Thu Dec 14 12:44:10 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 19 13:50:19 2023 +0100

    xen/wait: address violations of MISRA C Rule 11.9
    
    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/common/wait.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/wait.c b/xen/common/wait.c
index 86d3b15419..cb6f5ff3c2 100644
--- a/xen/common/wait.c
+++ b/xen/common/wait.c
@@ -125,7 +125,7 @@ static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
     struct vcpu *curr = current;
     unsigned long dummy;
 
-    ASSERT(wqv->esp == 0);
+    ASSERT(wqv->esp == NULL);
 
     /* Save current VCPU affinity; force wakeup on *this* CPU only. */
     if ( vcpu_temporary_affinity(curr, smp_processor_id(), VCPU_AFFINITY_WAIT) )
@@ -171,7 +171,7 @@ static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
           [sz] "i" (PAGE_SIZE)
         : "memory", "rax", "rdx", "r8", "r9", "r10", "r11" );
 
-    if ( unlikely(wqv->esp == 0) )
+    if ( unlikely(wqv->esp == NULL) )
     {
         gdprintk(XENLOG_ERR, "Stack too large in %s\n", __func__);
         domain_crash(curr->domain);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 20 09:45:03 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Dec 2023 09:45:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.657572.1026505 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rFt8R-0001gQ-O3; Wed, 20 Dec 2023 09:45:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 657572.1026505; Wed, 20 Dec 2023 09: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 1rFt8R-0001gI-LQ; Wed, 20 Dec 2023 09:45:03 +0000
Received: by outflank-mailman (input) for mailman id 657572;
 Wed, 20 Dec 2023 09: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 1rFt8Q-0001g5-Jl
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09: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 1rFt8Q-0000uL-J3
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFt8Q-0003eB-I0
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09: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=umoXYJNhUSefZnr9Mws+DHf85aSrAifnULcJHaatWew=; b=dgMBDukrYx0Kxzhvegq9yOJhtO
	lMG32myG8aixDLhFRPN5+aAnAiIIu9dE9gzhe18OvnDEUdnsYbABnl4S8s4HFYWEMMz0Xfu6VTT/3
	kA4U/h+4qnZ6wQOkC3PxVkd/wGS39p+qtsgWHak2frXqo4cSzjGJpDH0RwEljXgwMO3c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/shutdown: address MISRA C:2012 Rule 2.1
Message-Id: <E1rFt8Q-0003eB-I0@xenbits.xenproject.org>
Date: Wed, 20 Dec 2023 09:45:02 +0000

commit bfd52e979d14ae42a8c3c9bf8c0f2fdd5ea154db
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Mon Dec 18 11:17:27 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 19 13:50:45 2023 +0100

    xen/shutdown: address MISRA C:2012 Rule 2.1
    
    Given that 'hwdom_shutdown' is a noreturn function, unreachable
    breaks can be eliminated to resolve violations of Rule 2.1.
    
    The rename s/maybe_reboot/reboot_or_halt/ is done to clarify
    that the function is noreturn.
    
    No functional change.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl |  2 +-
 xen/common/shutdown.c                            | 15 ++++-----------
 2 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 683f2bbfe8..85741a2c01 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -16,7 +16,7 @@ Constant expressions and unreachable branches of if and switch statements are ex
 
 -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))"}
--config=MC3R1.R2.1,statements+={deliberate, "call(decl(name(__builtin_unreachable||panic||do_unexpected_trap||machine_halt||machine_restart||maybe_reboot)))"}
+-config=MC3R1.R2.1,statements+={deliberate, "call(decl(name(__builtin_unreachable||panic||do_unexpected_trap||machine_halt||machine_restart||reboot_or_halt)))"}
 -doc_end
 
 -doc_begin="Unreachability inside an ASSERT_UNREACHABLE() and analogous macro calls is deliberate and safe."
diff --git a/xen/common/shutdown.c b/xen/common/shutdown.c
index 37901a4f33..dfd5e41097 100644
--- a/xen/common/shutdown.c
+++ b/xen/common/shutdown.c
@@ -15,7 +15,7 @@
 bool __read_mostly opt_noreboot;
 boolean_param("noreboot", opt_noreboot);
 
-static void noreturn maybe_reboot(void)
+static void noreturn reboot_or_halt(void)
 {
     if ( opt_noreboot )
     {
@@ -38,39 +38,32 @@ void hwdom_shutdown(u8 reason)
         printk("Hardware Dom%u halted: halting machine\n",
                hardware_domain->domain_id);
         machine_halt();
-        break; /* not reached */
 
     case SHUTDOWN_crash:
         debugger_trap_immediate();
         printk("Hardware Dom%u crashed: ", hardware_domain->domain_id);
         kexec_crash(CRASHREASON_HWDOM);
-        maybe_reboot();
-        break; /* not reached */
+        reboot_or_halt();
 
     case SHUTDOWN_reboot:
         printk("Hardware Dom%u shutdown: rebooting machine\n",
                hardware_domain->domain_id);
         machine_restart(0);
-        break; /* not reached */
 
     case SHUTDOWN_watchdog:
         printk("Hardware Dom%u shutdown: watchdog rebooting machine\n",
                hardware_domain->domain_id);
         kexec_crash(CRASHREASON_WATCHDOG);
         machine_restart(0);
-        break; /* not reached */
 
     case SHUTDOWN_soft_reset:
         printk("Hardware domain %d did unsupported soft reset, rebooting.\n",
                hardware_domain->domain_id);
         machine_restart(0);
-        break; /* not reached */
 
     default:
         printk("Hardware Dom%u shutdown (unknown reason %u): ",
                hardware_domain->domain_id, reason);
-        maybe_reboot();
-        break; /* not reached */
+        reboot_or_halt();
     }
-}  
-
+}
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 20 09:45:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Dec 2023 09:45:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.657573.1026509 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rFt8b-0001lj-Pl; Wed, 20 Dec 2023 09:45:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 657573.1026509; Wed, 20 Dec 2023 09: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 1rFt8b-0001lb-Ms; Wed, 20 Dec 2023 09:45:13 +0000
Received: by outflank-mailman (input) for mailman id 657573;
 Wed, 20 Dec 2023 09: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 1rFt8a-0001lS-NA
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09: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 1rFt8a-0000uh-MQ
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09:45:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFt8a-0003ee-LM
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09: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=z4vWsG0HdDLHOByEDwx/thSCiQkXbS6YydAWDx3d+JQ=; b=tffcQ1wYRfbZDDZfdvuvohiHiD
	b0IkKdH28a9AU9I86uXdZxvGFxt3xMGML1ZkDui0psP69Vnx9GAJwl1J0k6VNelWsv23/B2i7118D
	gxoZup2BRvkZVLxFeHD8qNHch27hljb+MmNzZwesBvaHhw3Vkm75hTysxkUjzCqxQTXc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation/eclair_analysis: avoid violation of MISRA Rule 2.1
Message-Id: <E1rFt8a-0003ee-LM@xenbits.xenproject.org>
Date: Wed, 20 Dec 2023 09:45:12 +0000

commit 11126964d82f41e70fd1d09e00d06dd1795c54d0
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Mon Dec 18 11:17:33 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 19 13:51:12 2023 +0100

    automation/eclair_analysis: avoid violation of MISRA Rule 2.1
    
    The presence of an unlinked object file triggers a violation
    of MISRA C Rule 2.1, which is deviated, as it's not part of
    the final Xen binary.
    
    No functional change.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 85741a2c01..e3de0fb2ad 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -28,6 +28,11 @@ 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="The following autogenerated file is not linked deliberately."
++-file_tag+={C_runtime_failures,"^automation/eclair_analysis/C-runtime-failures\\.rst\\.c$"}
++-config=MC3R1.R2.1,reports+={deliberate, "any_area(any_loc(file(C_runtime_failures)))"}
++-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
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 20 09:45:24 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Dec 2023 09:45:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.657574.1026513 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rFt8l-0001r0-S3; Wed, 20 Dec 2023 09:45:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 657574.1026513; Wed, 20 Dec 2023 09: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 1rFt8l-0001qs-Pa; Wed, 20 Dec 2023 09:45:23 +0000
Received: by outflank-mailman (input) for mailman id 657574;
 Wed, 20 Dec 2023 09: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 1rFt8k-0001pT-QG
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09: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 1rFt8k-0000up-PT
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09:45:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFt8k-0003fF-OZ
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09: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=bLmofJPkqKdZGKikzM2wx/o3UOOCo0nEWVu/5G8L3F0=; b=oVAooEzYXoErMaZkSmyvnqdfG6
	xNhRG73r/eU+787H3+s9Zq37TUEb8nyJwGzaj6e63j50VXsMovC9WMol+jy+Odwfx94etMXu8YDR3
	tglSVg6vQaYxrHzqzih8NxY6QUL6vIxAGlFkYvyWVVQpI23rfiFQ5L6mHqHFFnTjjeBY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: don't open-code max_page calculation nor pfn_to_paddr()
Message-Id: <E1rFt8k-0003fF-OZ@xenbits.xenproject.org>
Date: Wed, 20 Dec 2023 09:45:22 +0000

commit 05b6368ba01e07aa3b2b1f1856d77332971a7bdf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 19 13:51:40 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 19 13:51:40 2023 +0100

    x86: don't open-code max_page calculation nor pfn_to_paddr()
    
    As observed by Roger while reviewing a somewhat related change, there's
    no need here either to open-code the (largely, i.e. once setup_max_pdx()
    was called) fixed relationship between max_pdx and max_page. Further we
    can avoid open-coding pfn_to_paddr() here.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 62f4686cae..897b7e9208 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1569,7 +1569,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
                 continue;
             }
             map_e = e;
-            e = (pdx_to_pfn(max_pdx - 1) + 1ULL) << PAGE_SHIFT;
+            e = pfn_to_paddr(max_page);
             printk(XENLOG_WARNING "Ignoring inaccessible memory range"
                                   " %013"PRIx64"-%013"PRIx64"\n",
                    e, map_e);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 20 09:45:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Dec 2023 09:45:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.657575.1026518 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rFt8v-0001va-UT; Wed, 20 Dec 2023 09:45:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 657575.1026518; Wed, 20 Dec 2023 09: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 1rFt8v-0001vR-R5; Wed, 20 Dec 2023 09:45:33 +0000
Received: by outflank-mailman (input) for mailman id 657575;
 Wed, 20 Dec 2023 09: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 1rFt8u-0001v4-TO
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09: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 1rFt8u-0000uz-Sg
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09:45:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rFt8u-0003fj-Ro
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 09: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=sq1eC7c9NyghiKuaAQtc8WRTJNXgM5Bn9C4/aJHdQkI=; b=dyyVTz7TGI1ny35/JTC0kLIFbJ
	IjXSCnQo4VqIya6hEZv3LRIodfmMbSOv9gaCHiGL93JwHLjd0Nhfk4h0GIeJHHrd5eCq1fg6SG9//
	xlikRAdjISqn5uWhrjQFxNdATClhe02I7grG3tCflckPlNPzsnKw0nmZYsrQ2kCFCRgc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: return fpi size from FFA_PARTITION_INFO_GET
Message-Id: <E1rFt8u-0003fj-Ro@xenbits.xenproject.org>
Date: Wed, 20 Dec 2023 09:45:32 +0000

commit 1b42304fd1d84adcf7caf8c12c33ec66347b6dcc
Author:     Jens Wiklander <jens.wiklander@linaro.org>
AuthorDate: Wed Dec 13 11:31:35 2023 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Tue Dec 19 18:34:26 2023 +0000

    xen/arm: ffa: return fpi size from FFA_PARTITION_INFO_GET
    
    Until now has FFA_PARTITION_INFO_GET always returned zero in w3, but
    FF-A v1.1 requires FFA_PARTITION_INFO_GET to return the size of each
    partition information descriptor returned if
    FFA_PARTITION_INFO_GET_COUNT_FLAG isn't set.
    
    The SPMC queried with FFA_PARTITION_INFO_GET must also return the each
    partition information descriptor returned so fix this by passing along
    the same value.
    
    Fixes: caf6491e95a9 ("xen/arm: ffa: support guest FFA_PARTITION_INFO_GET")
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/tee/ffa.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 98905fec79..0793c1c758 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -514,7 +514,7 @@ static int32_t ffa_rxtx_map(paddr_t tx_addr, paddr_t rx_addr,
 
 static int32_t ffa_partition_info_get(uint32_t w1, uint32_t w2, uint32_t w3,
                                       uint32_t w4, uint32_t w5,
-                                      uint32_t *count)
+                                      uint32_t *count, uint32_t *fpi_size)
 {
     const struct arm_smccc_1_2_regs arg = {
         .a0 = FFA_PARTITION_INFO_GET,
@@ -531,7 +531,10 @@ static int32_t ffa_partition_info_get(uint32_t w1, uint32_t w2, uint32_t w3,
 
     ret = get_ffa_ret_code(&resp);
     if ( !ret )
+    {
         *count = resp.a2;
+        *fpi_size = resp.a3;
+    }
 
     return ret;
 }
@@ -784,7 +787,7 @@ static uint32_t handle_rxtx_unmap(void)
 
 static int32_t handle_partition_info_get(uint32_t w1, uint32_t w2, uint32_t w3,
                                          uint32_t w4, uint32_t w5,
-                                         uint32_t *count)
+                                         uint32_t *count, uint32_t *fpi_size)
 {
     int32_t ret = FFA_RET_DENIED;
     struct domain *d = current->domain;
@@ -799,7 +802,7 @@ static int32_t handle_partition_info_get(uint32_t w1, uint32_t w2, uint32_t w3,
      */
     if ( w5 == FFA_PARTITION_INFO_GET_COUNT_FLAG &&
          ctx->guest_vers == FFA_VERSION_1_1 )
-        return ffa_partition_info_get(w1, w2, w3, w4, w5, count);
+        return ffa_partition_info_get(w1, w2, w3, w4, w5, count, fpi_size);
     if ( w5 )
         return FFA_RET_INVALID_PARAMETERS;
 
@@ -812,7 +815,7 @@ static int32_t handle_partition_info_get(uint32_t w1, uint32_t w2, uint32_t w3,
     if ( !ctx->page_count || !ctx->rx_is_free )
         goto out;
     spin_lock(&ffa_rx_buffer_lock);
-    ret = ffa_partition_info_get(w1, w2, w3, w4, w5, count);
+    ret = ffa_partition_info_get(w1, w2, w3, w4, w5, count, fpi_size);
     if ( ret )
         goto out_rx_buf_unlock;
     /*
@@ -842,7 +845,7 @@ static int32_t handle_partition_info_get(uint32_t w1, uint32_t w2, uint32_t w3,
     }
     else
     {
-        size_t sz = *count * sizeof(struct ffa_partition_info_1_1);
+        size_t sz = *count * *fpi_size;
 
         if ( ctx->page_count * FFA_PAGE_SIZE < sz )
         {
@@ -1409,6 +1412,7 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     uint32_t fid = get_user_reg(regs, 0);
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
+    uint32_t fpi_size;
     uint32_t count;
     int e;
 
@@ -1444,11 +1448,11 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
                                       get_user_reg(regs, 2),
                                       get_user_reg(regs, 3),
                                       get_user_reg(regs, 4),
-                                      get_user_reg(regs, 5), &count);
+                                      get_user_reg(regs, 5), &count, &fpi_size);
         if ( e )
             set_regs_error(regs, e);
         else
-            set_regs_success(regs, count, 0);
+            set_regs_success(regs, count, fpi_size);
         return true;
     case FFA_RX_RELEASE:
         e = handle_rx_release();
@@ -1630,10 +1634,11 @@ static bool init_subscribers(struct ffa_partition_info_1_1 *fpi, uint16_t count)
 static bool init_sps(void)
 {
     bool ret = false;
+    uint32_t fpi_size;
     uint32_t count;
     int e;
 
-    e = ffa_partition_info_get(0, 0, 0, 0, 0, &count);
+    e = ffa_partition_info_get(0, 0, 0, 0, 0, &count, &fpi_size);
     if ( e )
     {
         printk(XENLOG_ERR "ffa: Failed to get list of SPs: %d\n", e);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 20 23:22:10 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Dec 2023 23:22:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.658367.1027497 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rG5t5-0003K0-9m; Wed, 20 Dec 2023 23:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 658367.1027497; Wed, 20 Dec 2023 23: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 1rG5t5-0003Jt-7M; Wed, 20 Dec 2023 23:22:03 +0000
Received: by outflank-mailman (input) for mailman id 658367;
 Wed, 20 Dec 2023 23: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 1rG5t3-0003Jk-U5
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23: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 1rG5t3-0000iz-Na
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rG5t3-0007j7-Lx
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23: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=OGXCcRuE/hzNK34fO6HnJtqOZ6s7SWNsK4ERncS0WN4=; b=gEQ851frWfHJdd39GdVHfO5aCe
	6IG+CxZUfAyIrKXf/vcQGC/WLBAxQ/aO4+T8HxGbJ54jzxYguBtAOM8RGvRmp82+KoU5KUz8xbWlf
	mypRQ35kLTQ7QhPG0LpADfFzaYVDZnZElA3AMS7cMlQH+ytesyUyL8mMj9MN/z+eZtS0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation/eclair: add deviations for MISRA C:2012 Rule 16.3
Message-Id: <E1rG5t3-0007j7-Lx@xenbits.xenproject.org>
Date: Wed, 20 Dec 2023 23:22:01 +0000

commit a128d8da913b21eff6c6d2e2a7d4c54c054b78db
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Mon Dec 18 10:00:18 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Dec 19 17:08:21 2023 -0800

    automation/eclair: add deviations for MISRA C:2012 Rule 16.3
    
    MISRA C:2012 Rule 16.3 states that an unconditional break statement
    shall terminate every switch-clause.
    
    Update ECLAIR configuration to take into account:
      - continue, goto, return statements;
      - functions with attribute noreturn;
      - pseudo-keyword fallthrough;
      - macro BUG();
      - comments.
    
    Update docs/misra/deviations.rst accordingly.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 28 +++++++++++++++++++++
 docs/misra/deviations.rst                        | 32 ++++++++++++++++++++++++
 2 files changed, 60 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index e3de0fb2ad..6b6c4e4787 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -332,6 +332,34 @@ therefore have the same behavior of a boolean"
 -config=MC3R1.R14.4,etypes+={deliberate, "stmt(child(cond,child(expr,ref(^<?domain>?::is_dying$))))","src_type(enum)"}
 -doc_end
 
+#
+# Series 16.
+#
+
+-doc_begin="Switch clauses ending with continue, goto, return statements are
+safe."
+-config=MC3R1.R16.3,terminals+={safe, "node(continue_stmt||goto_stmt||return_stmt)"}
+-doc_end
+
+-doc_begin="Switch clauses ending with a call to a function that does not give
+the control back (i.e., a function with attribute noreturn) are safe."
+-config=MC3R1.R16.3,terminals+={safe, "call(property(noreturn))"}
+-doc_end
+
+-doc_begin="Switch clauses ending with pseudo-keyword \"fallthrough\" are
+safe."
+-config=MC3R1.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(/fallthrough;/))))"}
+-doc_end
+
+-doc_begin="Switch clauses ending with failure method \"BUG()\" are safe."
+-config=MC3R1.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(/BUG\\(\\);/))))"}
+-doc_end
+
+-doc_begin="Switch clauses not ending with the break statement are safe if an
+explicit comment indicating the fallthrough intention is present."
+-config=MC3R1.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(^(?s).*/\\* [fF]all ?through.? \\*/.*$,0..1))))"}
+-doc_end
+
 #
 # Series 20.
 #
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index eda3c8100c..0131d72959 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -276,6 +276,38 @@ Deviations related to MISRA C:2012 Rules:
        therefore have the same behavior of a boolean.
      - Project-wide deviation; tagged as `deliberate` for ECLAIR.
 
+   * - R16.3
+     - Switch clauses ending with continue, goto, return statements are safe.
+     - Tagged as `safe` for ECLAIR.
+
+   * - R16.3
+     - Switch clauses ending with a call to a function that does not give
+       the control back (i.e., a function with attribute noreturn) are safe.
+     - Tagged as `safe` for ECLAIR.
+
+   * - R16.3
+     - Switch clauses ending with pseudo-keyword \"fallthrough\" are safe.
+     - Tagged as `safe` for ECLAIR.
+
+   * - R16.3
+     - Switch clauses ending with failure method \"BUG()\" are safe.
+     - Tagged as `safe` for ECLAIR.
+
+   * - R16.3
+     - Existing switch clauses not ending with the break statement are safe if
+       an explicit comment indicating the fallthrough intention is present.
+       However, the use of such comments in new code is deprecated:
+       the pseudo-keyword "fallthrough" shall be used.
+     - Tagged as `safe` for ECLAIR. The accepted comments are:
+         - /\* fall through \*/
+         - /\* fall through. \*/
+         - /\* fallthrough \*/
+         - /\* fallthrough. \*/
+         - /\* Fall through \*/
+         - /\* Fall through. \*/
+         - /\* Fallthrough \*/
+         - /\* Fallthrough. \*/
+
    * - R20.7
      - Code violating Rule 20.7 is safe when macro parameters are used:
        (1) as function arguments;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 20 23:22:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Dec 2023 23:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.658368.1027501 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rG5tF-0003Lg-BI; Wed, 20 Dec 2023 23:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 658368.1027501; Wed, 20 Dec 2023 23: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 1rG5tF-0003LZ-8t; Wed, 20 Dec 2023 23:22:13 +0000
Received: by outflank-mailman (input) for mailman id 658368;
 Wed, 20 Dec 2023 23: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 1rG5tD-0003LO-Sg
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23: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 1rG5tD-0000jH-RX
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rG5tD-0007ji-Pj
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23: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=viwyM77XU9zYZIS9ULNVtzpb7VUCVN8FnUNckkOjwQk=; b=5bdZHDHKeyYBcASe3zqoAlmG+t
	QfZzynl/akYFZD7JbyulFj3hnCmQoqMmi0HifoJeSTjRhFevBlQvJf0AcjkF7LoQlAtRcOnWa76KY
	SqQFSM1mU8q18/g19Wgz1Pc698QJwOIKZis7qpWME8Ppiq6cmhFk2jezOs5I4U6xd/O8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation/eclair: update configuration of MISRA C:2012 Rule 5.6
Message-Id: <E1rG5tD-0007ji-Pj@xenbits.xenproject.org>
Date: Wed, 20 Dec 2023 23:22:11 +0000

commit ed45dd16c4790c6006f274706fb1cf3ddac0f0c1
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Mon Dec 18 10:12:00 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Dec 19 17:08:47 2023 -0800

    automation/eclair: update configuration of MISRA C:2012 Rule 5.6
    
    Deviate typedef names that are delberately defined multiple times.
    
    Update docs/misra/deviations.rst accordingly.
    
    Tag Rule 5.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 | 6 ++++++
 automation/eclair_analysis/ECLAIR/tagging.ecl    | 2 +-
 docs/misra/deviations.rst                        | 7 +++++++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 6b6c4e4787..6806f0eea0 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -95,6 +95,12 @@ depending on the guest."
 -config=MC3R1.R5.6,reports+={deliberate,"any_area(any_loc(text(^.*ret_t.*$)))"}
 -doc_end
 
+-doc_begin="On X86, the types \"guest_intpte_t\", \"guest_l1e_t\" and
+\"guest_l2e_t\" are deliberately defined multiple times, depending on the
+number of guest paging levels."
+-config=MC3R1.R5.6,reports+={deliberate,"any_area(any_loc(file(^xen/arch/x86/include/asm/guest_pt\\.h$)))&&any_area(any_loc(text(^.*(guest_intpte_t|guest_l[12]e_t).*$)))"}
+-doc_end
+
 -doc_begin="The following files are imported from the gnu-efi package."
 -file_tag+={adopted_r5_6,"^xen/include/efi/.*$"}
 -file_tag+={adopted_r5_6,"^xen/arch/.*/include/asm/.*/efibind\\.h$"}
diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/eclair_analysis/ECLAIR/tagging.ecl
index d5d3bff396..900c532196 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.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"
+-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.R5.6||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 0131d72959..4bd56eb9cc 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -103,6 +103,13 @@ Deviations related to MISRA C:2012 Rules:
        type of guest to service.
      - Tagged as `deliberate` for ECLAIR.
 
+   * - R5.6
+     - On X86, some types are deliberately defined multiple times, depending on
+       the number of guest paging levels.
+     - Tagged as `deliberate` for ECLAIR. Such types are:
+         - guest_intpte_t
+         - guest_l[12]e_t
+
    * - R5.6
      - Some files are not subject to respect MISRA rules at
        the moment, but, among these out-of-scope files, there are definitions
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 20 23:22:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Dec 2023 23:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.658369.1027506 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rG5tP-0003OD-Cv; Wed, 20 Dec 2023 23:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 658369.1027506; Wed, 20 Dec 2023 23: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 1rG5tP-0003O5-AL; Wed, 20 Dec 2023 23:22:23 +0000
Received: by outflank-mailman (input) for mailman id 658369;
 Wed, 20 Dec 2023 23: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 1rG5tN-0003Nv-VV
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23:22: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 1rG5tN-0000jZ-Ud
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23:22:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rG5tN-0007kC-Tf
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23:22: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=u0SkII5TROJT3zDUuUVyPyWbAMqI47lNe8X/zR5QOO4=; b=RLOpE8k03Zqr6YvEFXf5g2Ecd2
	ravyeNy60G6+3VGwNkM06GCM6Fjb6nFzpgtrjRz8A1lo7n9zLk6mZRKc9PKlzPzlINlRwO/ctk2YM
	f/8Ienqevrt0qSs8Y7X8z7lgrdFwiybuzpxA+iVOKpkEYBbwn8W2fvZWLcki3NRX+qdY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/misra: add entries to exclude-list
Message-Id: <E1rG5tN-0007kC-Tf@xenbits.xenproject.org>
Date: Wed, 20 Dec 2023 23:22:21 +0000

commit fba913a21ab4187453cbba2a8cca8335c679e283
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Mon Dec 18 12:51:45 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Dec 19 17:09:38 2023 -0800

    docs/misra: add entries to exclude-list
    
    Exclude efibind.h for all the architectures: it is used to build the
    efi stub, which is a separate entry point for Xen when booted from EFI
    firmware.
    Remove redundant entries from out_of_scope.ecl.
    
    Exclude common/coverage: it is code to support gcov, hence it is part
    of the testing machinery.
    
    Exclude decompress.h: file ported from Linux that defines a unique and
    documented interface towards all the (adopted) decompress functions.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/eclair_analysis/ECLAIR/out_of_scope.ecl |  5 -----
 docs/misra/exclude-list.json                       | 16 ++++++++++++++++
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/out_of_scope.ecl b/automation/eclair_analysis/ECLAIR/out_of_scope.ecl
index fd870716cf..9bcec4c69d 100644
--- a/automation/eclair_analysis/ECLAIR/out_of_scope.ecl
+++ b/automation/eclair_analysis/ECLAIR/out_of_scope.ecl
@@ -17,11 +17,6 @@
 -file_tag+={out_of_scope,"^xen/arch/x86/include/asm/intel-family\\.h$"}
 -doc_end
 
--doc_begin="Files imported from the gnu-efi package"
--file_tag+={adopted,"^xen/include/efi/.*$"}
--file_tag+={adopted,"^xen/arch/x86/include/asm/x86_64/efibind\\.h$"}
--doc_end
-
 -doc_begin="Build tools are out of scope."
 -file_tag+={out_of_scope_tools,"^xen/tools/.*$"}
 -file_tag+={out_of_scope_tools,"^xen/arch/x86/efi/mkreloc\\.c$"}
diff --git a/docs/misra/exclude-list.json b/docs/misra/exclude-list.json
index 48f671c548..83fae0b4a4 100644
--- a/docs/misra/exclude-list.json
+++ b/docs/misra/exclude-list.json
@@ -1,6 +1,10 @@
 {
     "version": "1.0",
     "content": [
+        {
+            "rel_path": "arch/*/include/asm/*/efibind.h",
+            "comment": "Imported from gnu-efi package, ignore for now"
+        },
         {
             "rel_path": "arch/arm/arm64/cpufeature.c",
             "comment": "Imported from Linux, ignore for now"
@@ -97,6 +101,10 @@
             "rel_path": "arch/x86/efi/check.c",
             "comment": "The resulting code is not included in the final Xen binary, ignore for now"
         },
+        {
+            "rel_path": "common/coverage/*",
+            "comment": "Files to support gcov, ignore for now"
+        },
         {
             "rel_path": "common/bitmap.c",
             "comment": "Imported from Linux, ignore for now"
@@ -213,6 +221,14 @@
             "rel_path": "include/xen/acpi.h",
             "comment": "Imported from Linux, ignore for now"
         },
+        {
+            "rel_path": "include/efi/*",
+            "comment": "Imported from gnu-efi package, ignore for now"
+        },
+        {
+            "rel_path": "include/xen/decompress.h",
+            "comment": "Imported from Linux, ignore for now"
+        },
         {
             "rel_path": "lib/list-sort.c",
             "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 Wed Dec 20 23:22:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Dec 2023 23:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.658370.1027509 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rG5tZ-0003Sc-EL; Wed, 20 Dec 2023 23:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 658370.1027509; Wed, 20 Dec 2023 23: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 1rG5tZ-0003SU-Br; Wed, 20 Dec 2023 23:22:33 +0000
Received: by outflank-mailman (input) for mailman id 658370;
 Wed, 20 Dec 2023 23: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 1rG5tY-0003SH-3c
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23: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 1rG5tY-0000k2-2m
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rG5tY-0007kj-0n
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23: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=zCBVBql8Sw/r6AF3PbUVzwPjM5L+0dCwelDTAt1YHvM=; b=Rx7BpGs3QKT20yz9TQK3oUnu/7
	/AlvHJoOU5ok1nyc1Dsc5HQKcE9Y5kXR5PCZ6nnwCZTNQF7JBB1SoNHggWgoOFQIs6DHkxJEkE9xl
	pWJEnv2Kz0wMXan5M01ZAbEEhxilDy5clldovJZKGWFRb4OxIY62azUvLyGZ/mdEyIdQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: move declaration of first_valid_mfn to xen/numa.h
Message-Id: <E1rG5tY-0007kj-0n@xenbits.xenproject.org>
Date: Wed, 20 Dec 2023 23:22:32 +0000

commit 51ffb33118954574bfd47025a5bc1114bbcf58cd
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Mon Dec 18 16:06:12 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Dec 19 17:09:57 2023 -0800

    xen: move declaration of first_valid_mfn to xen/numa.h
    
    Such declaration is moved in order to provide it for Arm and PPC,
    whilst not violating MISRA C:2012 Rule 8.4 in common/page_alloc.c:
    "A compatible declaration shall be visible when an object or
    function with external linkage is defined".
    
    Signed-off-by: Julien Grall <julien@xen.org>
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/include/asm/numa.h | 6 ------
 xen/arch/ppc/include/asm/numa.h | 6 ------
 xen/common/page_alloc.c         | 6 ++++--
 xen/include/xen/numa.h          | 2 ++
 4 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/include/asm/numa.h b/xen/arch/arm/include/asm/numa.h
index e2bee2bd82..a2c1da4a82 100644
--- a/xen/arch/arm/include/asm/numa.h
+++ b/xen/arch/arm/include/asm/numa.h
@@ -11,12 +11,6 @@ typedef u8 nodeid_t;
 #define cpu_to_node(cpu) 0
 #define node_to_cpumask(node)   (cpu_online_map)
 
-/*
- * TODO: make first_valid_mfn static when NUMA is supported on Arm, this
- * is required because the dummy helpers are using it.
- */
-extern mfn_t first_valid_mfn;
-
 /* XXX: implement NUMA support */
 #define node_spanned_pages(nid) (max_page - mfn_x(first_valid_mfn))
 #define node_start_pfn(nid) (mfn_x(first_valid_mfn))
diff --git a/xen/arch/ppc/include/asm/numa.h b/xen/arch/ppc/include/asm/numa.h
index 7fdf66c3da..204180ad5b 100644
--- a/xen/arch/ppc/include/asm/numa.h
+++ b/xen/arch/ppc/include/asm/numa.h
@@ -10,12 +10,6 @@ typedef uint8_t nodeid_t;
 #define cpu_to_node(cpu) 0
 #define node_to_cpumask(node)   (cpu_online_map)
 
-/*
- * TODO: make first_valid_mfn static when NUMA is supported on PPC, this
- * is required because the dummy helpers are using it.
- */
-extern mfn_t first_valid_mfn;
-
 /* XXX: implement NUMA support */
 #define node_spanned_pages(nid) (max_page - mfn_x(first_valid_mfn))
 #define node_start_pfn(nid) (mfn_x(first_valid_mfn))
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 9b5df74fdd..d874525916 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -255,8 +255,10 @@ static PAGE_LIST_HEAD(page_broken_list);
  */
 
 /*
- * first_valid_mfn is exported because it is use in ARM specific NUMA
- * helpers. See comment in arch/arm/include/asm/numa.h.
+ * first_valid_mfn is exported because it is used when !CONFIG_NUMA.
+ *
+ * TODO: Consider if we can conditionally export first_valid_mfn based
+ * on whether NUMA is selected.
  */
 mfn_t first_valid_mfn = INVALID_MFN_INITIALIZER;
 
diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h
index 287e81ff66..a10d4b1778 100644
--- a/xen/include/xen/numa.h
+++ b/xen/include/xen/numa.h
@@ -108,6 +108,8 @@ extern void numa_set_processor_nodes_parsed(nodeid_t node);
 
 #else
 
+extern mfn_t first_valid_mfn;
+
 static inline nodeid_t mfn_to_nid(mfn_t mfn)
 {
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 20 23:22:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Dec 2023 23:22:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.658371.1027513 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rG5tj-0003Y4-Fu; Wed, 20 Dec 2023 23:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 658371.1027513; Wed, 20 Dec 2023 23:22:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rG5tj-0003Xw-DN; Wed, 20 Dec 2023 23:22:43 +0000
Received: by outflank-mailman (input) for mailman id 658371;
 Wed, 20 Dec 2023 23:22:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rG5ti-0003WV-77
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23:22:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rG5ti-0000kB-6E
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rG5ti-0007lb-4z
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23:22:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=68tDmF+am1hG8y15meTfEHoHojPPacqd2e41O/rgLMc=; b=KrNuYOKdPIEmEp8w3p7frIdKYD
	Rrd9ODlgwIfFIsJxJK1J3vDSDkNbCD1+FSEvUI1/MdxYZb79wbqv371Bqezc2YYZa/UC9OH84K26k
	hI4bd2NCccGc7X43ITW2+O10ZEbip4F8TwzBsWm/ILq6LvRNHY+Wk3ur1lY4dNUTF77A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: address MISRA C:2012 Rule 2.1
Message-Id: <E1rG5ti-0007lb-4z@xenbits.xenproject.org>
Date: Wed, 20 Dec 2023 23:22:42 +0000

commit c877b9092885bc052cc89383585b83d045d392c2
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Mon Dec 18 11:17:29 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Dec 19 17:13:36 2023 -0800

    xen/arm: address MISRA C:2012 Rule 2.1
    
    There are no paths that can reach the last return statement
    of function 'vgic_v3_its_mmio_write' in 'vcig-v3-its.c' and
    'arch_memory_op' in 'arch/arm/mm.c', thus violating
    MISRA C:2012 Rule 2.1:
    "A project shall not contain unreachable code".
    
    Therefore, an ASSERT_UNREACHABLE() is inserted to remove the unreachable
    return statement and protect against possible mistakes.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/mm.c          | 1 +
 xen/arch/arm/vgic-v3-its.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index eeb65ca6bb..b15a18a494 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -283,6 +283,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         return -ENOSYS;
     }
 
+    ASSERT_UNREACHABLE();
     return 0;
 }
 
diff --git a/xen/arch/arm/vgic-v3-its.c b/xen/arch/arm/vgic-v3-its.c
index 05429030b5..70b5aeb822 100644
--- a/xen/arch/arm/vgic-v3-its.c
+++ b/xen/arch/arm/vgic-v3-its.c
@@ -1409,6 +1409,7 @@ static int vgic_v3_its_mmio_write(struct vcpu *v, mmio_info_t *info,
         return 0;
     }
 
+    ASSERT_UNREACHABLE();
     return 1;
 
 write_ignore_64:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 20 23:22:53 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Dec 2023 23:22:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.658372.1027519 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rG5tt-0003ct-If; Wed, 20 Dec 2023 23:22:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 658372.1027519; Wed, 20 Dec 2023 23:22:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rG5tt-0003cl-Et; Wed, 20 Dec 2023 23:22:53 +0000
Received: by outflank-mailman (input) for mailman id 658372;
 Wed, 20 Dec 2023 23:22:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rG5ts-0003cX-BT
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23:22:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rG5ts-0000kS-Ag
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rG5ts-0007m0-8K
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23:22:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/X0py7uBHHHTR8LPpxRC/pAjktt8aPXVdkSA1D0GeOI=; b=fqeXhRGxOw5czc8od//KgB7yWs
	0+vO4ui8GO6AX2lmDNYqg3FKmwJXj98wxwy7gNemIRCXhK1C5luJYWsXW+FN4we19IcVClC0rMojn
	l3RX+a6iwBR7j2SxZBGKwVLt4k1fz0buMQxRlJbCguuSVQoFjUKqDOmTa0wTbfu84cy0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: traps: add ASSERT_UNREACHABLE() where needed
Message-Id: <E1rG5ts-0007m0-8K@xenbits.xenproject.org>
Date: Wed, 20 Dec 2023 23:22:52 +0000

commit 2a0f5a11f27d4b5b4fce0dbe41a16278e17ebc35
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Mon Dec 18 11:17:30 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Dec 19 17:13:50 2023 -0800

    xen/arm: traps: add ASSERT_UNREACHABLE() where needed
    
    The statements after a call to the noreturn function 'do_unexpected_trap'
    can't be reached, thus violating MISRA C:2012 Rule 2.1
    ("A project shall not contain unreachable code.").
    ASSERT_UNREACHABLE() is used to signal that the unreachable break-s are used as
    a defensive coding measure to prevent inadvertent fallthrough.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/traps.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 3784e8276e..77220ba092 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -2152,6 +2152,7 @@ void do_trap_hyp_sync(struct cpu_user_regs *regs)
     case HSR_EC_SVE:
         /* An SVE exception is a bug somewhere in hypervisor code */
         do_unexpected_trap("SVE trap at EL2", regs);
+        ASSERT_UNREACHABLE();
         break;
 #endif
     case HSR_EC_DATA_ABORT_CURR_EL:
@@ -2171,7 +2172,7 @@ void do_trap_hyp_sync(struct cpu_user_regs *regs)
             dump_hyp_walk(get_hfar(is_data));
 
         do_unexpected_trap(fault, regs);
-
+        ASSERT_UNREACHABLE();
         break;
     }
     default:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Dec 20 23:23:03 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Dec 2023 23:23:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.658373.1027522 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rG5u3-0003iZ-MQ; Wed, 20 Dec 2023 23:23:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 658373.1027522; Wed, 20 Dec 2023 23:23:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rG5u3-0003iR-Jo; Wed, 20 Dec 2023 23:23:03 +0000
Received: by outflank-mailman (input) for mailman id 658373;
 Wed, 20 Dec 2023 23:23:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rG5u2-0003iE-Ep
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23:23:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rG5u2-0000kp-Df
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23:23:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rG5u2-0007me-Ci
 for xen-changelog@lists.xenproject.org; Wed, 20 Dec 2023 23:23:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vj1cbuBpoxefuvDQZu2oP9tC0UbRB45sC6HWPyGLeTQ=; b=MD0qmAm0AeDEEfNNbaJNRPFjkp
	QP4m9lf+cASfbHvx4XEb04FlHTe7JUQiz+n2XHrlKiM+g5/TLfSIWDINyA7hTr3LSMucubRfA/5A9
	AbPSWrrMKuenWlEprWiecaintD14UJdTkAhNcON+9Qn/CEkBX/wKPT9AioZu0Njavthk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: vcpreg: address violation of MISRA C Rule 2.1
Message-Id: <E1rG5u2-0007me-Ci@xenbits.xenproject.org>
Date: Wed, 20 Dec 2023 23:23:02 +0000

commit 725acf8e4d406bf0a24441ac1738eb6f4f6ef0c3
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Mon Dec 18 11:17:32 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Dec 19 17:14:02 2023 -0800

    xen/arm: vcpreg: address violation of MISRA C Rule 2.1
    
    There is no path that reaches the call to 'advance_pc', thus violating MISRA C
    Rule 2.1.
    A call to ASSERT_UNREACHABLE() is added after the switch, despite this being
    useful to detect errors only in debug builds; if that marker is ever reached,
    a domain crash is triggered, as a defensive coding measure.
    
    No functional change.
    
    Signed-off-by: Julien Grall <julien@xen.org>
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/vcpreg.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/vcpreg.c b/xen/arch/arm/vcpreg.c
index 39aeda9dab..a2d0500704 100644
--- a/xen/arch/arm/vcpreg.c
+++ b/xen/arch/arm/vcpreg.c
@@ -707,8 +707,14 @@ void do_cp10(struct cpu_user_regs *regs, const union hsr hsr)
         inject_undef_exception(regs, hsr);
         return;
     }
-
-    advance_pc(regs, hsr);
+    
+    /*
+     * All the cases in the switch should return. If this is not the
+     * case, then something went wrong and it is best to crash the
+     * domain.
+     */
+    ASSERT_UNREACHABLE();
+    domain_crash(current->domain);
 }
 
 void do_cp(struct cpu_user_regs *regs, const union hsr hsr)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 21 14:55:05 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Dec 2023 14:55:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.658982.1028401 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGKRz-0001uV-I6; Thu, 21 Dec 2023 14:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 658982.1028401; Thu, 21 Dec 2023 14: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 1rGKRz-0001uN-Eh; Thu, 21 Dec 2023 14:55:03 +0000
Received: by outflank-mailman (input) for mailman id 658982;
 Thu, 21 Dec 2023 14: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 1rGKRy-0001tV-0a
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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 1rGKRx-00028C-Vx
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGKRx-00069E-TC
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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=gCLKsG8Zrv8ocVGJpp89hd7Zf60FP47ZXq3qL8i+ayk=; b=JpG2lzZ4whwuEB9OZEHScB8eGV
	GVSLScHxSmFAWnh+sq14jRuq9GiP/ovqvwNRCNmhgUB6w11iaXPY93knahbeRKSKfcF7093sCBzj6
	KNzgHsrrHXoURGitjMQy+lnP+zSWXMIgNlKAbnejyPdizRBaT9277GW0134HRDhhDjEU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: address violations of MISRA C:2012 Rule 11.8
Message-Id: <E1rGKRx-00069E-TC@xenbits.xenproject.org>
Date: Thu, 21 Dec 2023 14:55:01 +0000

commit 1fb1d3e77fe275b55af05883e0fe01f4ca085690
Author:     Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
AuthorDate: Tue Dec 19 12:05:09 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 20 11:43:14 2023 +0100

    xen/arm: address violations of MISRA C:2012 Rule 11.8
    
    The xen sources contain violations of MISRA C:2012 Rule 11.8 whose
    headline states:
    "A conversion shall not remove any const, volatile or _Atomic qualification
    from the type pointed to by a pointer".
    
    Add missing const qualifiers in casts.
    The variables are originally const-qualified.
    There's no reason to drop the qualifiers.
    
    Drop redundant cast to preserve const qualifier.
    
    No functional change.
    
    Signed-off-by: Maria Celeste Cesario  <maria.celeste.cesario@bugseng.com>
    Signed-off-by: Simone Ballarin  <simone.ballarin@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/bootfdt.c                 | 6 +++---
 xen/arch/arm/include/asm/alternative.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
index f496a8cf94..1cbac3cb2a 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/arch/arm/bootfdt.c
@@ -377,7 +377,7 @@ static int __init process_chosen_node(const void *fdt, int node,
         printk("linux,initrd-start property has invalid length %d\n", len);
         return -EINVAL;
     }
-    start = dt_read_paddr((void *)&prop->data, dt_size_to_cells(len));
+    start = dt_read_paddr((const void *)&prop->data, dt_size_to_cells(len));
 
     prop = fdt_get_property(fdt, node, "linux,initrd-end", &len);
     if ( !prop )
@@ -390,7 +390,7 @@ static int __init process_chosen_node(const void *fdt, int node,
         printk("linux,initrd-end property has invalid length %d\n", len);
         return -EINVAL;
     }
-    end = dt_read_paddr((void *)&prop->data, dt_size_to_cells(len));
+    end = dt_read_paddr((const void *)&prop->data, dt_size_to_cells(len));
 
     if ( start >= end )
     {
@@ -541,7 +541,7 @@ size_t __init boot_fdt_info(const void *fdt, paddr_t paddr)
 
     add_boot_module(BOOTMOD_FDT, paddr, fdt_totalsize(fdt), false);
 
-    ret = device_tree_for_each_node((void *)fdt, 0, early_scan_node, NULL);
+    ret = device_tree_for_each_node(fdt, 0, early_scan_node, NULL);
     if ( ret )
         panic("Early FDT parsing failed (%d)\n", ret);
 
diff --git a/xen/arch/arm/include/asm/alternative.h b/xen/arch/arm/include/asm/alternative.h
index d3210e82f9..c7632668b6 100644
--- a/xen/arch/arm/include/asm/alternative.h
+++ b/xen/arch/arm/include/asm/alternative.h
@@ -20,7 +20,7 @@ struct alt_instr {
 };
 
 /* Xen: helpers used by common code. */
-#define __ALT_PTR(a,f)		((void *)&(a)->f + (a)->f)
+#define __ALT_PTR(a,f)		((const void *)&(a)->f + (a)->f)
 #define ALT_ORIG_PTR(a)		__ALT_PTR(a, orig_offset)
 #define ALT_REPL_PTR(a)		__ALT_PTR(a, repl_offset)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 21 14:55:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Dec 2023 14:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.658983.1028404 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGKS9-00024U-Iz; Thu, 21 Dec 2023 14:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 658983.1028404; Thu, 21 Dec 2023 14: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 1rGKS9-00024M-G5; Thu, 21 Dec 2023 14:55:13 +0000
Received: by outflank-mailman (input) for mailman id 658983;
 Thu, 21 Dec 2023 14: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 1rGKS8-00023e-3n
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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 1rGKS8-00028J-2w
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGKS8-00069h-1q
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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=FqE+9BjDFGg48NXHSdMznCHEqbxJ8kmKXwjOUC8ZTUg=; b=B2KxwYvSD6SR8wePr6haiBQz31
	hcsMqB9NIeowxicU2hTzGXDwPCNtPWLmmdYZ0a/BB4KcUj7bswmcNKzhYbVqeIj55ZYxObOPEd9L+
	0lAIWkh1DN+x3opk/tEr381eOvhu7i4k4pKt/pqCFvwyPOzukbYys39yHe5hlr2jSgBk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: add deviations for Rule 11.8
Message-Id: <E1rGKS8-00069h-1q@xenbits.xenproject.org>
Date: Thu, 21 Dec 2023 14:55:12 +0000

commit 23a5fb3df7aaaa719cf7eccfb4d3ca24933c39a6
Author:     Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
AuthorDate: Tue Dec 19 12:05:11 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 20 11:47:04 2023 +0100

    xen: add deviations for Rule 11.8
    
    The xen sources contain violations of MISRA C:2012 Rule 11.8 whose
    headline states:
    "A conversion shall not remove any const, volatile or _Atomic qualification
    from the type pointed to by a pointer".
    
    The macro 'container_of' violates the Rule because it casts away any
    qualifier to do pointer arithmetic, but making the macro definition compliant
    would add additional complexity, therefore a deviation is introduced.
    
    Signed-off-by: Maria Celeste Cesario  <maria.celeste.cesario@bugseng.com>
    Signed-off-by: Simone Ballarin  <simone.ballarin@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 7 +++++++
 docs/misra/deviations.rst                        | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 6806f0eea0..4b5140fe3f 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -303,6 +303,13 @@ constant expressions are required.\""
 # Series 11
 #
 
+-doc_begin="Violations caused by container_of are due to pointer arithmetic operations
+with the provided offset. The resulting pointer is then immediately cast back to its
+original type, which preserves the qualifier. This use is deemed safe.
+Fixing this violation would require to increase code complexity and lower readability."
+-config=MC3R1.R11.8,reports+={safe,"any_area(any_loc(any_exp(macro(^container_of$))))"}
+-doc_end
+
 -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$))))"
 }
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 4bd56eb9cc..123c78e20a 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -255,6 +255,13 @@ Deviations related to MISRA C:2012 Rules:
        If no bits are set, 0 is returned.
      - Tagged as `safe` for ECLAIR.
 
+   * - R11.8
+     - Violations caused by container_of are due to pointer arithmetic operations
+       with the provided offset. The resulting pointer is then immediately cast back to its
+       original type, which preserves the qualifier. This use is deemed safe.
+       Fixing this violation would require to increase code complexity and lower readability.
+     - 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
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 21 14:55:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Dec 2023 14:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.658988.1028407 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGKSJ-0002MN-KU; Thu, 21 Dec 2023 14:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 658988.1028407; Thu, 21 Dec 2023 14: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 1rGKSJ-0002MF-Hu; Thu, 21 Dec 2023 14:55:23 +0000
Received: by outflank-mailman (input) for mailman id 658988;
 Thu, 21 Dec 2023 14: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 1rGKSI-0002IH-6t
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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 1rGKSI-00028R-62
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGKSI-0006A6-52
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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=dyBlTkrWs6HEovslobeyu/WNFiMhUWuv96uX3YyU/ZQ=; b=YZ4Q33bnWzcAfRfMG6muZBglfe
	5PwzpFZxq51kWrAGBxFH7Ewdooml8TeK5RgnMnpmUc4g4sQs6zjfZovNfnI95HVrS+6wJNqolfqEF
	UbF4LG+FxKx5M9SzOgLjqaMe8QZETWjaCe60Q0CjtRw77nED6DXYom3HNm4CNZJUVpXs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: remove unused function ERR_CAST
Message-Id: <E1rGKSI-0006A6-52@xenbits.xenproject.org>
Date: Thu, 21 Dec 2023 14:55:22 +0000

commit 9d8c3bc887142762d0d223c70ed5be359b9eb35d
Author:     Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
AuthorDate: Tue Dec 19 12:05:13 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 20 11:47:31 2023 +0100

    xen: remove unused function ERR_CAST
    
    Function ERR_CAST contains a violation of MISRA C:2012 Rule 11.8,
    whose headline states:
    "A conversion shall not remove any const, volatile or _Atomic qualification
    from the type pointed to by a pointer".
    
    Since the function has no users, it is appropriate to remove it.
    
    Signed-off-by: Maria Celeste Cesario  <maria.celeste.cesario@bugseng.com>
    Signed-off-by: Simone Ballarin  <simone.ballarin@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/include/xen/err.h | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/xen/include/xen/err.h b/xen/include/xen/err.h
index 2f29b57d28..cbdd1bf7f8 100644
--- a/xen/include/xen/err.h
+++ b/xen/include/xen/err.h
@@ -36,19 +36,6 @@ static inline long __must_check IS_ERR_OR_NULL(const void *ptr)
 	return !ptr || IS_ERR_VALUE((unsigned long)ptr);
 }
 
-/**
- * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type
- * @ptr: The pointer to cast.
- *
- * Explicitly cast an error-valued pointer to another pointer type in such a
- * way as to make it clear that's what's going on.
- */
-static inline void * __must_check ERR_CAST(const void *ptr)
-{
-	/* cast away the const */
-	return (void *)ptr;
-}
-
 static inline int __must_check PTR_RET(const void *ptr)
 {
 	return IS_ERR(ptr) ? PTR_ERR(ptr) : 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 21 14:55:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Dec 2023 14:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.658989.1028411 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGKST-0002Qm-Lv; Thu, 21 Dec 2023 14:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 658989.1028411; Thu, 21 Dec 2023 14: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 1rGKST-0002Qf-JG; Thu, 21 Dec 2023 14:55:33 +0000
Received: by outflank-mailman (input) for mailman id 658989;
 Thu, 21 Dec 2023 14: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 1rGKSS-0002QQ-ES
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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 1rGKSS-00028Y-Ai
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGKSS-0006Aa-85
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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=0NUxDpevD+2EQmk5/t9SD+A5UqwqqnbwZpJznfY/lsw=; b=xWR/5YNWAJH/fApyl0aaIHp9xk
	0JdUe2KYq4Xf/ft9yaC5R6gAr3ICwd06Hiytel3iHPkXkhZlGR1gKnqd/5XLC7I+4dxoeloTK34dW
	DPoToo2nvjQ4FdE7XC7PuvB9DNvi/WjfgYhdfb/A30ZsLA89GUdeJigzoptUKEhSXvJc=;
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 11.8
Message-Id: <E1rGKSS-0006Aa-85@xenbits.xenproject.org>
Date: Thu, 21 Dec 2023 14:55:32 +0000

commit e6cb988a3d7894883971d6aae9584af4268b9754
Author:     Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
AuthorDate: Tue Dec 19 12:05:14 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 20 11:47:50 2023 +0100

    xen/common: address violations of MISRA C:2012 Rule 11.8
    
    The xen sources contain violations of MISRA C:2012 Rule 11.8 whose
    headline states:
    "A conversion shall not remove any const, volatile or _Atomic qualification
    from the type pointed to by a pointer".
    
    Change cast type from void* to uintptr_t.
    void* type cast resulted in violation of the Rule, a cast to type uintptr_t
    is more appropriate type-wise.
    
    Signed-off-by: Maria Celeste Cesario  <maria.celeste.cesario@bugseng.com>
    Signed-off-by: Simone Ballarin  <simone.ballarin@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/version.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/version.c b/xen/common/version.c
index d320135208..e807ef4de0 100644
--- a/xen/common/version.c
+++ b/xen/common/version.c
@@ -178,7 +178,7 @@ void __init xen_build_init(void)
     if ( &n[1] >= __note_gnu_build_id_end )
         return;
 
-    sz = (void *)__note_gnu_build_id_end - (void *)n;
+    sz = (uintptr_t)__note_gnu_build_id_end - (uintptr_t)n;
 
     rc = xen_build_id_check(n, sz, &build_id_p, &build_id_len);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 21 14:55:42 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Dec 2023 14:55:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.658990.1028416 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGKSc-0002U7-N9; Thu, 21 Dec 2023 14:55:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 658990.1028416; Thu, 21 Dec 2023 14:55: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 1rGKSc-0002U0-Ki; Thu, 21 Dec 2023 14:55:42 +0000
Received: by outflank-mailman (input) for mailman id 658990;
 Thu, 21 Dec 2023 14: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 1rGKSc-0002Tm-Ee
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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 1rGKSc-00028v-Dq
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGKSc-0006Az-Cv
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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=vg+I0sW1U/WQTgfIf9jsUuAcKjpDUpOxZ+NXZNgiXvM=; b=kx6xfH6OlqEpZuMSkled7UQNQ2
	uKV1AKmvySGNLrNX4t3/ch2hBKN5sk68pLVfddJlTUr8o9iPvKNj1x9mQQrjoPWX4MxyHaOJZPMP+
	/OjKljZP2dqHWT/MHvtPyCuLgIpK+Wg5349+AUy58LqAsP4qZmdnknc/S2Fy66Qz/hoo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/IO-APIC: correct RTE polarity comment
Message-Id: <E1rGKSc-0006Az-Cv@xenbits.xenproject.org>
Date: Thu, 21 Dec 2023 14:55:42 +0000

commit 913a1774168f82565bbdc7d41a46013a40ba302d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Dec 20 11:48:31 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 20 11:48:31 2023 +0100

    x86/IO-APIC: correct RTE polarity comment
    
    The comment there was the wrong way round, documentation clearly states
    that 0 is high and 1 is low.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/include/asm/io_apic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/io_apic.h b/xen/arch/x86/include/asm/io_apic.h
index 206bb961c0..78268ea8f6 100644
--- a/xen/arch/x86/include/asm/io_apic.h
+++ b/xen/arch/x86/include/asm/io_apic.h
@@ -101,7 +101,7 @@ struct IO_APIC_route_entry {
                                            */
             unsigned int dest_mode:1;     /* 0: physical, 1: logical */
             unsigned int delivery_status:1;
-            unsigned int polarity:1;      /* 0: low, 1: high */
+            unsigned int polarity:1;      /* 0: high, 1: low */
             unsigned int irr:1;
             unsigned int trigger:1;       /* 0: edge, 1: level */
             unsigned int mask:1;          /* 0: enabled, 1: disabled */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 21 14:55:53 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Dec 2023 14:55:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.658991.1028420 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGKSn-0002Z9-Oz; Thu, 21 Dec 2023 14:55:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 658991.1028420; Thu, 21 Dec 2023 14: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 1rGKSn-0002Yz-ME; Thu, 21 Dec 2023 14:55:53 +0000
Received: by outflank-mailman (input) for mailman id 658991;
 Thu, 21 Dec 2023 14: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 1rGKSm-0002Yd-HZ
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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 1rGKSm-00029A-Gv
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGKSm-0006BS-G5
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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=DfzQbHpLUcvFOD0H1bXHWZZB3ae0atr/mpes3opGm8Q=; b=dMtEhxo73nogoyJb3Ge8NLsfkU
	mObV36NBJLoKS/DuWNFGclxGipmLPajKpo91nYUT/6YLJPuX2/MrT3XSDuUzAoupoTGuB12C4q32m
	PEyHCp2P5CATWXGmLaU0cepSCNtA8mfxvrMqZQVrbGPFZap7zv9DgeBi10Ygzi9PrZwE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/misra/rules.rst: add Rule 17.1
Message-Id: <E1rGKSm-0006BS-G5@xenbits.xenproject.org>
Date: Thu, 21 Dec 2023 14:55:52 +0000

commit 5171930429aa7b20e404fca773bd400456ee16d2
Author:     Stefano Stabellini <sstabellini@kernel.org>
AuthorDate: Fri Dec 8 17:39:31 2023 -0800
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Dec 20 10:17:53 2023 -0800

    docs/misra/rules.rst: add Rule 17.1
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 docs/misra/rules.rst | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index d1996b9a2b..182331089d 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -483,6 +483,11 @@ maintainers if you want to suggest a change.
      - A switch-expression shall not have essentially Boolean type
      -
 
+   * - `Rule 17.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_17_01.c>`_
+     - Required
+     - The features of <stdarg.h> shall not be used
+     -
+
    * - `Rule 17.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_17_03.c>`_
      - Mandatory
      - A function shall not be declared implicitly
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 21 14:56:03 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Dec 2023 14:56:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.658992.1028424 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGKSx-0002cR-QP; Thu, 21 Dec 2023 14:56:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 658992.1028424; Thu, 21 Dec 2023 14: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 1rGKSx-0002cJ-Nb; Thu, 21 Dec 2023 14:56:03 +0000
Received: by outflank-mailman (input) for mailman id 658992;
 Thu, 21 Dec 2023 14: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 1rGKSw-0002c3-Kf
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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 1rGKSw-00029p-Jz
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14:56:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGKSw-0006E2-J7
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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=uQQ1DozSY5PgVAJmUeKS9qcFzuPmbkHdSifIllf2VdE=; b=xQWtMD304orn75tuwyuZNY3wSP
	gZNP+cPcyYQBNwNxhP4hSTnI4zNGcm9H+bCn97g76OXrTZVQdWwCEkD18h7bNHPoqVOtx9fUNm864
	zk07eMFubDIOUP+9wD2h1oFGLME5DjIQmZ89abuVXgkwg0ajZq8bEOA9ncv2rwfxgRYU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation/eclair_analysis: fix typo in deviation.
Message-Id: <E1rGKSw-0006E2-J7@xenbits.xenproject.org>
Date: Thu, 21 Dec 2023 14:56:02 +0000

commit 18828f00e4fd712313d9fe1a040d4daf8c8ba3d6
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Wed Dec 20 11:44:25 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Dec 20 10:18:45 2023 -0800

    automation/eclair_analysis: fix typo in deviation.
    
    Unwanted leading '+'-s cause the deviation not to work as expected,
    leading to wrong analysis counts.
    
    Fixes: 11126964d82f ("automation/eclair_analysis: avoid violation of MISRA Rule 2.1")
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 4b5140fe3f..fd32ff8a9c 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -28,10 +28,10 @@ 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="The following autogenerated file is not linked deliberately."
-+-file_tag+={C_runtime_failures,"^automation/eclair_analysis/C-runtime-failures\\.rst\\.c$"}
-+-config=MC3R1.R2.1,reports+={deliberate, "any_area(any_loc(file(C_runtime_failures)))"}
-+-doc_end
+-doc_begin="The following autogenerated file is not linked deliberately."
+-file_tag+={C_runtime_failures,"^automation/eclair_analysis/C-runtime-failures\\.rst\\.c$"}
+-config=MC3R1.R2.1,reports+={deliberate, "any_area(any_loc(file(C_runtime_failures)))"}
+-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
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 21 14:56:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Dec 2023 14:56:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.658993.1028427 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGKT7-0002fZ-RV; Thu, 21 Dec 2023 14:56:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 658993.1028427; Thu, 21 Dec 2023 14: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 1rGKT7-0002fS-P3; Thu, 21 Dec 2023 14:56:13 +0000
Received: by outflank-mailman (input) for mailman id 658993;
 Thu, 21 Dec 2023 14: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 1rGKT6-0002fC-Np
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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 1rGKT6-0002A0-N2
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14:56:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGKT6-0006Eg-M9
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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=zrW29u5z02bjDw6p1qUssmBUuBu0TMMQ+TT320vGyLw=; b=oXBlaDDCIiJswgTfGN5lxZR+V/
	xvikHrvHNUEYBTe5whhz3QWtgvSscIWCQ8acGxBVyoXJ2ZI8l4NGvQbVduiN4elouqWUl0UG5fNd6
	MwLqugwA3I9Cq3JNurC+vncLQsQ9pHTVfBvaNOerQmn+F6jFI6+8bzZinDpuMGzdXoUI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: gic-v3: address violations of MISRA C:2012 Rule 16.3
Message-Id: <E1rGKT6-0006Eg-M9@xenbits.xenproject.org>
Date: Thu, 21 Dec 2023 14:56:12 +0000

commit 7d18ab2b9bc1f56469702e95944524889ef3475a
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Dec 20 12:03:01 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Dec 20 10:19:15 2023 -0800

    xen/arm: gic-v3: address violations of MISRA C:2012 Rule 16.3
    
    Add the pseudo-keyword fallthrough to meet the requirements to
    deviate Rule 16.3 ("An unconditional `break' statement shall terminate
    every switch-clause").
    No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/gic-v3.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 18289cd645..bf0e5c1b75 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -65,34 +65,49 @@ static inline void gicv3_save_lrs(struct vcpu *v)
     {
     case 16:
         v->arch.gic.v3.lr[15] = READ_SYSREG_LR(15);
+        fallthrough;
     case 15:
         v->arch.gic.v3.lr[14] = READ_SYSREG_LR(14);
+        fallthrough;
     case 14:
         v->arch.gic.v3.lr[13] = READ_SYSREG_LR(13);
+        fallthrough;
     case 13:
         v->arch.gic.v3.lr[12] = READ_SYSREG_LR(12);
+        fallthrough;
     case 12:
         v->arch.gic.v3.lr[11] = READ_SYSREG_LR(11);
+        fallthrough;
     case 11:
         v->arch.gic.v3.lr[10] = READ_SYSREG_LR(10);
+        fallthrough;
     case 10:
         v->arch.gic.v3.lr[9] = READ_SYSREG_LR(9);
+        fallthrough;
     case 9:
         v->arch.gic.v3.lr[8] = READ_SYSREG_LR(8);
+        fallthrough;
     case 8:
         v->arch.gic.v3.lr[7] = READ_SYSREG_LR(7);
+        fallthrough;
     case 7:
         v->arch.gic.v3.lr[6] = READ_SYSREG_LR(6);
+        fallthrough;
     case 6:
         v->arch.gic.v3.lr[5] = READ_SYSREG_LR(5);
+        fallthrough;
     case 5:
         v->arch.gic.v3.lr[4] = READ_SYSREG_LR(4);
+        fallthrough;
     case 4:
         v->arch.gic.v3.lr[3] = READ_SYSREG_LR(3);
+        fallthrough;
     case 3:
         v->arch.gic.v3.lr[2] = READ_SYSREG_LR(2);
+        fallthrough;
     case 2:
         v->arch.gic.v3.lr[1] = READ_SYSREG_LR(1);
+        fallthrough;
     case 1:
          v->arch.gic.v3.lr[0] = READ_SYSREG_LR(0);
          break;
@@ -112,34 +127,49 @@ static inline void gicv3_restore_lrs(const struct vcpu *v)
     {
     case 16:
         WRITE_SYSREG_LR(v->arch.gic.v3.lr[15], 15);
+        fallthrough;
     case 15:
         WRITE_SYSREG_LR(v->arch.gic.v3.lr[14], 14);
+        fallthrough;
     case 14:
         WRITE_SYSREG_LR(v->arch.gic.v3.lr[13], 13);
+        fallthrough;
     case 13:
         WRITE_SYSREG_LR(v->arch.gic.v3.lr[12], 12);
+        fallthrough;
     case 12:
         WRITE_SYSREG_LR(v->arch.gic.v3.lr[11], 11);
+        fallthrough;
     case 11:
         WRITE_SYSREG_LR(v->arch.gic.v3.lr[10], 10);
+        fallthrough;
     case 10:
         WRITE_SYSREG_LR(v->arch.gic.v3.lr[9], 9);
+        fallthrough;
     case 9:
         WRITE_SYSREG_LR(v->arch.gic.v3.lr[8], 8);
+        fallthrough;
     case 8:
         WRITE_SYSREG_LR(v->arch.gic.v3.lr[7], 7);
+        fallthrough;
     case 7:
         WRITE_SYSREG_LR(v->arch.gic.v3.lr[6], 6);
+        fallthrough;
     case 6:
         WRITE_SYSREG_LR(v->arch.gic.v3.lr[5], 5);
+        fallthrough;
     case 5:
         WRITE_SYSREG_LR(v->arch.gic.v3.lr[4], 4);
+        fallthrough;
     case 4:
         WRITE_SYSREG_LR(v->arch.gic.v3.lr[3], 3);
+        fallthrough;
     case 3:
         WRITE_SYSREG_LR(v->arch.gic.v3.lr[2], 2);
+        fallthrough;
     case 2:
         WRITE_SYSREG_LR(v->arch.gic.v3.lr[1], 1);
+        fallthrough;
     case 1:
         WRITE_SYSREG_LR(v->arch.gic.v3.lr[0], 0);
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 21 14:56:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Dec 2023 14:56:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.658994.1028432 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGKTH-0002kq-Ul; Thu, 21 Dec 2023 14:56:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 658994.1028432; Thu, 21 Dec 2023 14: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 1rGKTH-0002ki-Rr; Thu, 21 Dec 2023 14:56:23 +0000
Received: by outflank-mailman (input) for mailman id 658994;
 Thu, 21 Dec 2023 14: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 1rGKTG-0002kQ-Qn
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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 1rGKTG-0002A7-Q2
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14:56:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGKTG-0006F7-PD
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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=5pJldfDXj454oSnqXN2foTAobUFUU+zGzdFkSjijbmE=; b=Xdb58EmjRnX4m+LVPek4IIpW9Z
	TTidLpJGARvDFnFjP+VghK7st0P9HAFxe53RwIxlgtkMhyg7FITYF+zQ0ibgaRKRCm9JViIxsAmLb
	Xo5vsYJ0qtr6/zFJOx5kLnH0zbbOM3w07eSYuj4rM8FTk5kUffvjZvB1zLYFt3UxuKoE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: traps: address violations of MISRA C:2012 Rule 16.3
Message-Id: <E1rGKTG-0006F7-PD@xenbits.xenproject.org>
Date: Thu, 21 Dec 2023 14:56:22 +0000

commit f1e956cdbfbb2e8a975356f952edee1a9b7e0665
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Dec 20 12:03:02 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Dec 20 10:19:34 2023 -0800

    xen/arm: traps: address violations of MISRA C:2012 Rule 16.3
    
    MISRA C:2012 Rule 16.3 states: "An unconditional `break' statement
    shall terminate every switch-clause".
    
    Add missing break statements to address violations of Rule 16.3.
    Add pseudo-keyword "fallthrough" to make explicit the intended
    behavior and satisfy the requirements to deviate Rule 16.3.
    No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/traps.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 77220ba092..9c10e8f78c 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1414,10 +1414,18 @@ static void do_trap_hypercall(struct cpu_user_regs *regs, register_t *nr,
     {
         /* Deliberately corrupt parameter regs used by this hypercall. */
         switch ( hypercall_args[*nr] ) {
-        case 5: HYPERCALL_ARG5(regs) = 0xDEADBEEFU;
-        case 4: HYPERCALL_ARG4(regs) = 0xDEADBEEFU;
-        case 3: HYPERCALL_ARG3(regs) = 0xDEADBEEFU;
-        case 2: HYPERCALL_ARG2(regs) = 0xDEADBEEFU;
+        case 5:
+            HYPERCALL_ARG5(regs) = 0xDEADBEEFU;
+            fallthrough;
+        case 4:
+            HYPERCALL_ARG4(regs) = 0xDEADBEEFU;
+            fallthrough;
+        case 3:
+            HYPERCALL_ARG3(regs) = 0xDEADBEEFU;
+            fallthrough;
+        case 2:
+            HYPERCALL_ARG2(regs) = 0xDEADBEEFU;
+            fallthrough;
         case 1: /* Don't clobber x0/r0 -- it's the return value */
         case 0: /* -ENOSYS case */
             break;
@@ -1929,6 +1937,7 @@ static void do_trap_stage2_abort_guest(struct cpu_user_regs *regs,
         gprintk(XENLOG_WARNING,
                 "Unsupported FSC: HSR=%#"PRIregister" DFSC=%#x\n",
                 hsr.bits, xabt.fsc);
+        break;
     }
 
 inject_abt:
@@ -2136,6 +2145,7 @@ void asmlinkage do_trap_guest_sync(struct cpu_user_regs *regs)
                 "Unknown Guest Trap. HSR=%#"PRIregister" EC=0x%x IL=%x Syndrome=0x%"PRIx32"\n",
                 hsr.bits, hsr.ec, hsr.len, hsr.iss);
         inject_undef_exception(regs, hsr);
+        break;
     }
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 21 14:56:34 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Dec 2023 14:56:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.658995.1028436 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGKTR-0002nm-Vv; Thu, 21 Dec 2023 14:56:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 658995.1028436; Thu, 21 Dec 2023 14: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 1rGKTR-0002ne-TJ; Thu, 21 Dec 2023 14:56:33 +0000
Received: by outflank-mailman (input) for mailman id 658995;
 Thu, 21 Dec 2023 14: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 1rGKTQ-0002nV-Tq
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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 1rGKTQ-0002Bn-T1
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14:56:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGKTQ-0006FY-S7
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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=42+MR5UHYdOLREFRdPmhqRc/pgVAPymt69qLde1orRI=; b=M/Vpy4RTASUF2u1ZWrYYvIwwJ7
	bRXL3KZOEC5NOd2M5ZaUP98JJpnQRxH5wZbQsc44qOSydxUBYBtEeHqOZGLPJ9eTaIneifxSu2Wsp
	T7rZLVVZQEDTuL6fU73Cb0sQx79DiJnEF03FKuIBR9/PTdClHGQUWCIG6oj5Z2YqCczM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: guest_walk: address violations of MISRA C:2012 Rule 16.3
Message-Id: <E1rGKTQ-0006FY-S7@xenbits.xenproject.org>
Date: Thu, 21 Dec 2023 14:56:32 +0000

commit 2750111969f06351d8febb215de76096a90c71e0
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Dec 20 12:03:03 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Dec 20 10:19:57 2023 -0800

    xen/arm: guest_walk: address violations of MISRA C:2012 Rule 16.3
    
    Add missing break statements to address violations of Rule 16.3
    ("An unconditional `break' statement shall terminate every
    switch-clause").
    No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/guest_walk.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/arm/guest_walk.c b/xen/arch/arm/guest_walk.c
index d99b411f3b..2f7d3a0da7 100644
--- a/xen/arch/arm/guest_walk.c
+++ b/xen/arch/arm/guest_walk.c
@@ -165,6 +165,8 @@ static bool guest_walk_sd(const struct vcpu *v,
             *perms |= GV2M_WRITE;
         if ( !pte.sec.xn )
             *perms |= GV2M_EXEC;
+
+        break;
     }
 
     return true;
@@ -260,6 +262,7 @@ static bool get_ttbr_and_gran_64bit(uint64_t *ttbr, unsigned int *gran,
              * fall back to 4K by default.
              */
             *gran = GRANULE_SIZE_INDEX_4K;
+            break;
         }
 
         /* Use TTBR0 for GVA to IPA translation. */
@@ -291,6 +294,7 @@ static bool get_ttbr_and_gran_64bit(uint64_t *ttbr, unsigned int *gran,
              * fall back to 4K by default.
              */
             *gran = GRANULE_SIZE_INDEX_4K;
+            break;
         }
 
         /* Use TTBR1 for GVA to IPA translation. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Dec 21 14:56:44 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Dec 2023 14:56:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.658996.1028440 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGKTc-0002qS-1K; Thu, 21 Dec 2023 14:56:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 658996.1028440; Thu, 21 Dec 2023 14:56: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 1rGKTb-0002qL-Uj; Thu, 21 Dec 2023 14:56:43 +0000
Received: by outflank-mailman (input) for mailman id 658996;
 Thu, 21 Dec 2023 14: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 1rGKTb-0002q9-0n
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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 1rGKTb-0002CA-01
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14:56:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGKTa-0006G3-VL
 for xen-changelog@lists.xenproject.org; Thu, 21 Dec 2023 14: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=Wq9wuQH/CWcLeDiwyR/TxtWUzkQ9DO5FIOeMV0MoLKs=; b=wFFoOqocqnLwxK4AnHwPxEfXGB
	+wtsi3G0RxlSsMeZjTUwroNCzVaHhVmvcP+CjzTLDlH22on0a7g96Pw3U3fYL1dHCbN10/1cqMhz7
	GqqWZlfUxdn7F68+iHBTAJD4wNfMr6ijI53oGFE42q1O7BgZ41Ya/yXhZoOArbK1XMCk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: mmu: address a violations of MISRA C:2012 Rule 16.3
Message-Id: <E1rGKTa-0006G3-VL@xenbits.xenproject.org>
Date: Thu, 21 Dec 2023 14:56:42 +0000

commit e9786ba9ee5f0b4b6eadb4ca80417f195ce251a0
Author:     Federico Serafini <federico.serafini@bugseng.com>
AuthorDate: Wed Dec 20 12:03:06 2023 +0100
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Dec 20 10:20:16 2023 -0800

    xen/arm: mmu: address a violations of MISRA C:2012 Rule 16.3
    
    Add missing break at the end of the switch-clause to address a
    violation of MISRA C:2012 Rule 16.3 ("An unconditional `break'
    statement shall terminate every switch-clause").
    No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/mmu/p2m.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/arm/mmu/p2m.c b/xen/arch/arm/mmu/p2m.c
index 6a5a080307..41fcca011c 100644
--- a/xen/arch/arm/mmu/p2m.c
+++ b/xen/arch/arm/mmu/p2m.c
@@ -657,6 +657,7 @@ static lpae_t mfn_to_p2m_entry(mfn_t mfn, p2m_type_t t, p2m_access_t a)
     default:
         e.p2m.mattr = MATTR_MEM;
         e.p2m.sh = LPAE_SH_INNER;
+        break;
     }
 
     p2m_set_permission(&e, t, a);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 22 04:33:08 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Dec 2023 04:33:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.659196.1028697 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGXDc-0008Pz-D5; Fri, 22 Dec 2023 04:33:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 659196.1028697; Fri, 22 Dec 2023 04: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 1rGXDc-0008Ps-AD; Fri, 22 Dec 2023 04:33:04 +0000
Received: by outflank-mailman (input) for mailman id 659196;
 Fri, 22 Dec 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 1rGXDa-0008N0-Ao
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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 1rGXDa-0000Jo-9t
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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 1rGXDa-00065v-7o
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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=zsza9jSPRlQE0isn6ed6SUnTngHFuyrXrDIpsScXzms=; b=aIKbG5k2UWImstNuV+WkcuR4xm
	42OHrwQNbWFknJ7OXpasnEg7Lmi6A6pLfU8PF38no9UeEajk6nlBNl5G9tQ9T+0FXu6hxvzIVftbv
	zaZjTKHVWVnNKQRgBTHYfJTYlpAjWD7m7PS6Niuxdg9/1qng9ipS1fAkY6+l4MkZKkL0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/pygrub: Drop compatibility symlink
Message-Id: <E1rGXDa-00065v-7o@xenbits.xenproject.org>
Date: Fri, 22 Dec 2023 04:33:02 +0000

commit 1fa104ee7a4bd85756d2843bdc9d3b2eece4ec26
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Nov 23 16:28:36 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Dec 20 19:15:30 2023 +0000

    tools/pygrub: Drop compatibility symlink
    
    This was deprecated in commit 10c88f1c18b7 ("tools: Install pv bootloaders in
    libexec rather than /usr/bin") and caused to warn in commit c31d6a7ee2ea
    ("libxl: Warn that /usr/bin/pygrub is deprecated"), both in 2012.
    
    New versions of RPM warn against absolute symlinks, so take out fully, 11
    years later.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
---
 CHANGELOG.md          | 3 +++
 tools/pygrub/Makefile | 6 ------
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5ee5d41fc9..723d064254 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,6 +18,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 ### Removed
 - caml-stubdom.  It hasn't built since 2014, was pinned to Ocaml 4.02, and has
   been superseded by the MirageOS/SOLO5 projects.
+- /usr/bin/pygrub symlink.  This was deprecated in Xen 4.2 (2012) but left for
+  compatibility reasons.  VMs configured with bootloader="/usr/bin/pygrub"
+  should be updated to just bootloader="pygrub".
 
 ## [4.18.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.18.0) - 2023-11-16
 
diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile
index 4963bc89c6..d5e291ea06 100644
--- a/tools/pygrub/Makefile
+++ b/tools/pygrub/Makefile
@@ -22,15 +22,9 @@ install: all
 	$(setup.py) install --record $(INSTALL_LOG) $(PYTHON_PREFIX_ARG) \
 		--root="$(DESTDIR)" --force
 	$(INSTALL_PYTHON_PROG) src/pygrub $(DESTDIR)/$(LIBEXEC_BIN)/pygrub
-	set -e; if [ $(bindir) != $(LIBEXEC_BIN) -a \
-	             "`readlink -f $(DESTDIR)/$(bindir)`" != \
-	             "`readlink -f $(LIBEXEC_BIN)`" ]; then \
-	    ln -sf $(LIBEXEC_BIN)/pygrub $(DESTDIR)/$(bindir); \
-	fi
 
 .PHONY: uninstall
 uninstall:
-	rm -f $(DESTDIR)/$(bindir)/pygrub
 	if [ -e $(INSTALL_LOG) ]; then \
 		cat $(INSTALL_LOG) | xargs -i rm -f $(DESTDIR)/{}; \
 	fi
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 22 04:33:14 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Dec 2023 04:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.659199.1028701 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGXDm-00006F-EL; Fri, 22 Dec 2023 04:33:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 659199.1028701; Fri, 22 Dec 2023 04:33:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGXDm-000067-Bn; Fri, 22 Dec 2023 04:33:14 +0000
Received: by outflank-mailman (input) for mailman id 659199;
 Fri, 22 Dec 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 1rGXDk-0008WC-E7
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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 1rGXDk-0000Jw-DH
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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 1rGXDk-00066O-CE
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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=oxgtdUCN/CZbX71sIvt2qi06oKpG1MLTeA++XkvDbU0=; b=aHDNptrOoeLCTyLJ4/sP++B0a1
	/+H5OYGn3+XJ0w8a1FdswqYgYVj/rV4f9YGvEI4uKsTLVHtfsQDCNKYCYcx5vKgKZafcbONWYRNBJ
	16psKRRt7c2ObEBe27/ENBX+PmOU9BcB01aVwixP12itCwPepv7lmTGa7KeOIcqK8h5o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] driver/char: Drop run_in_exception_handler() ifdefary
Message-Id: <E1rGXDk-00066O-CE@xenbits.xenproject.org>
Date: Fri, 22 Dec 2023 04:33:12 +0000

commit 5f7fd392d9f69ae76e7356101f4073ca272c0774
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 15 08:42:01 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Dec 20 19:15:30 2023 +0000

    driver/char: Drop run_in_exception_handler() ifdefary
    
    Since commit 60a9b0715055 ("xen: introduce CONFIG_GENERIC_BUG_FRAME"), the new
    common bug.h provides an implementation of run_in_exception_handler() in all
    cases, making the #else here dead.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/drivers/char/ehci-dbgp.c | 4 ----
 xen/drivers/char/ns16550.c   | 4 ----
 2 files changed, 8 deletions(-)

diff --git a/xen/drivers/char/ehci-dbgp.c b/xen/drivers/char/ehci-dbgp.c
index 0f5b41899e..bbf4e51c02 100644
--- a/xen/drivers/char/ehci-dbgp.c
+++ b/xen/drivers/char/ehci-dbgp.c
@@ -1293,11 +1293,7 @@ static void cf_check _ehci_dbgp_poll(struct cpu_user_regs *regs)
 static void cf_check ehci_dbgp_poll(void *data)
 {
     poll_port = data;
-#ifdef run_in_exception_handler
     run_in_exception_handler(_ehci_dbgp_poll);
-#else
-    _ehci_dbgp_poll(guest_cpu_user_regs());
-#endif
 }
 
 static bool ehci_dbgp_setup_preirq(struct ehci_dbgp *dbgp)
diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index c8a51ed660..29691e8d3a 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -233,11 +233,7 @@ out:
 static void cf_check ns16550_poll(void *data)
 {
     this_cpu(poll_port) = data;
-#ifdef run_in_exception_handler
     run_in_exception_handler(__ns16550_poll);
-#else
-    __ns16550_poll(guest_cpu_user_regs());
-#endif
 }
 
 static int cf_check ns16550_tx_ready(struct serial_port *port)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 22 04:33:24 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Dec 2023 04:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.659200.1028705 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGXDw-00009F-Fm; Fri, 22 Dec 2023 04:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 659200.1028705; Fri, 22 Dec 2023 04:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGXDw-000097-DA; Fri, 22 Dec 2023 04:33:24 +0000
Received: by outflank-mailman (input) for mailman id 659200;
 Fri, 22 Dec 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 1rGXDu-00008f-IE
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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 1rGXDu-0000K7-HQ
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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 1rGXDu-00066p-FN
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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=Aq6NmpfNDt3t/BVKUYvSRcbTH1opj/tC35czQ+G27UI=; b=dhTXGM6h4Zdu1T7b9Ttxu4SAhR
	xOTsKFw143X3ei5sXcc3or7w/GDrxZhn29Bym98SC3mNOir0N4zAmHw4HiXmCWmmIBbSfH98lD1mw
	jc9VvRnQMtgfIcT5g17MsPOiEWRCCgO5LxfNh9mw6usyzfHOU2EeIrurQH3KjXCoFLpA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/bug: Complete outstanding TODO
Message-Id: <E1rGXDu-00066p-FN@xenbits.xenproject.org>
Date: Fri, 22 Dec 2023 04:33:22 +0000

commit ecabcd0d4e49734d012a7c8ccfba68129aeaa999
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 15 08:47:32 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Dec 20 19:15:30 2023 +0000

    xen/bug: Complete outstanding TODO
    
    Since this TODO was written, BUILD_BUG_ON() has been moved out of xen/lib.h
    into xen/macros.h, which has done all the hard work.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/include/xen/bug.h | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/xen/include/xen/bug.h b/xen/include/xen/bug.h
index cb5138410e..8cca4486a4 100644
--- a/xen/include/xen/bug.h
+++ b/xen/include/xen/bug.h
@@ -20,7 +20,8 @@
 #define BUG_DEBUGGER_TRAP_FATAL(regs) 0
 #endif
 
-#include <xen/lib.h>
+#include <xen/macros.h>
+#include <xen/types.h>
 
 #ifndef BUG_FRAME_STRUCT
 
@@ -104,14 +105,11 @@ typedef void bug_fn_t(const struct cpu_user_regs *regs);
 
 #ifndef run_in_exception_handler
 
-/*
- * TODO: untangle header dependences, break BUILD_BUG_ON() out of xen/lib.h,
- * and use a real static inline here to get proper type checking of fn().
- */
-#define run_in_exception_handler(fn) do {                   \
-    (void)((fn) == (void (*)(struct cpu_user_regs *))NULL); \
-    BUG_FRAME(BUGFRAME_run_fn, 0, fn, 0, NULL);             \
-} while ( false )
+static void always_inline run_in_exception_handler(
+    void (*fn)(struct cpu_user_regs *regs))
+{
+    BUG_FRAME(BUGFRAME_run_fn, 0, fn, 0, NULL);
+}
 
 #endif /* run_in_exception_handler */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 22 04:33:34 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Dec 2023 04:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.659201.1028708 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGXE6-0000Cb-HY; Fri, 22 Dec 2023 04:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 659201.1028708; Fri, 22 Dec 2023 04:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGXE6-0000CT-Em; Fri, 22 Dec 2023 04:33:34 +0000
Received: by outflank-mailman (input) for mailman id 659201;
 Fri, 22 Dec 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 1rGXE4-0000C4-LU
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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 1rGXE4-0000KE-KW
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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 1rGXE4-00067e-JV
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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=IuO9CY0Qe7JOyWHrq6+QBJcsNmYpDS4RdRgrjp5dGOc=; b=v2HMZEoRlwD0Ohxfej0PRlMJeQ
	8X+XFEzQcbX3ClnKAvyN/nfLcj1SSI2mbJLV7IJ6Jnd/RxmLoR8U/TxjtwG767AKA/Ow8C0gL+oKy
	Y/iU1WdNTF92GLAh2NMOGABJrMuJo5kixog43/jKGLfL84/2uuPLmcpYXaRZw9xcHtIk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xg: Reserialise CPU policies with the allocated number of leaves.
Message-Id: <E1rGXE4-00067e-JV@xenbits.xenproject.org>
Date: Fri, 22 Dec 2023 04:33:32 +0000

commit 6efc654a0b529a0e4d08e5d6bb5762fee1bf1eac
Author:     Alejandro Vallejo <alejandro.vallejo@cloud.com>
AuthorDate: Tue Dec 12 10:57:17 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Dec 20 19:15:30 2023 +0000

    tools/xg: Reserialise CPU policies with the allocated number of leaves.
    
    The procedure used to customize the domain CPU policy is broken when
    toolstack tries to set leaves (with subleaves) that the hypervisor didn't
    need to serialise (i.e: because they where empty subleaves).
    
    During typical domain creation xg does the following:
    
      1. Probe Xen for max #leaves that a policy may have
      2. Allocate memory for that many leaves
      3. Tell the hypervisor to dump the policy in the allocated buffer
      4. Deserialise it
      5. Modify it
      6. Reserialise it
      7. Send it back to Xen
    
    The problem is that (3) overrides nr_leaves, which then makes (6) fail in
    the case where (5) has added subleaves that Xen understands but didn't need
    to serialize on (3).
    
    The fix uses an opaque CPU policy object so we can (a) avoid probing Xen
    for sizes, and (b) trivially have knowledge of the actual size of the
    buffer.
    
    While at it, fix xc_cpu_policy_destroy() to preserve errno accross free()
    
    Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/guest/xg_cpuid_x86.c | 98 +++++++++++++++++++----------------------
 1 file changed, 45 insertions(+), 53 deletions(-)

diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x86.c
index db5aebc815..4453178100 100644
--- a/tools/libs/guest/xg_cpuid_x86.c
+++ b/tools/libs/guest/xg_cpuid_x86.c
@@ -583,13 +583,15 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
     int rc;
     bool hvm;
     xc_domaininfo_t di;
-    unsigned int i, nr_leaves, nr_msrs;
-    xen_cpuid_leaf_t *leaves = NULL;
-    struct cpu_policy *p = NULL;
+    struct xc_cpu_policy *p = xc_cpu_policy_init();
+    unsigned int i, nr_leaves = ARRAY_SIZE(p->leaves), nr_msrs = 0;
     uint32_t err_leaf = -1, err_subleaf = -1, err_msr = -1;
     uint32_t host_featureset[FEATURESET_NR_ENTRIES] = {};
     uint32_t len = ARRAY_SIZE(host_featureset);
 
+    if ( !p )
+        return -ENOMEM;
+
     if ( (rc = xc_domain_getinfo_single(xch, domid, &di)) < 0 )
     {
         PERROR("Failed to obtain d%d info", domid);
@@ -598,19 +600,6 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
     }
     hvm = di.flags & XEN_DOMINF_hvm_guest;
 
-    rc = xc_cpu_policy_get_size(xch, &nr_leaves, &nr_msrs);
-    if ( rc )
-    {
-        PERROR("Failed to obtain policy info size");
-        rc = -errno;
-        goto out;
-    }
-
-    rc = -ENOMEM;
-    if ( (leaves = calloc(nr_leaves, sizeof(*leaves))) == NULL ||
-         (p = calloc(1, sizeof(*p))) == NULL )
-        goto out;
-
     /* Get the host policy. */
     rc = xc_get_cpu_featureset(xch, XEN_SYSCTL_cpu_featureset_host,
                                &len, host_featureset);
@@ -623,10 +612,9 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
     }
 
     /* Get the domain's default policy. */
-    nr_msrs = 0;
     rc = get_system_cpu_policy(xch, hvm ? XEN_SYSCTL_cpu_policy_hvm_default
                                         : XEN_SYSCTL_cpu_policy_pv_default,
-                               &nr_leaves, leaves, &nr_msrs, NULL);
+                               &nr_leaves, p->leaves, &nr_msrs, NULL);
     if ( rc )
     {
         PERROR("Failed to obtain %s default policy", hvm ? "hvm" : "pv");
@@ -634,7 +622,7 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
         goto out;
     }
 
-    rc = x86_cpuid_copy_from_buffer(p, leaves, nr_leaves,
+    rc = x86_cpuid_copy_from_buffer(&p->policy, p->leaves, nr_leaves,
                                     &err_leaf, &err_subleaf);
     if ( rc )
     {
@@ -659,18 +647,18 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
          * - Re-enable features which have become (possibly) off by default.
          */
 
-        p->basic.rdrand = test_bit(X86_FEATURE_RDRAND, host_featureset);
-        p->feat.hle = test_bit(X86_FEATURE_HLE, host_featureset);
-        p->feat.rtm = test_bit(X86_FEATURE_RTM, host_featureset);
+        p->policy.basic.rdrand = test_bit(X86_FEATURE_RDRAND, host_featureset);
+        p->policy.feat.hle = test_bit(X86_FEATURE_HLE, host_featureset);
+        p->policy.feat.rtm = test_bit(X86_FEATURE_RTM, host_featureset);
 
         if ( hvm )
         {
-            p->feat.mpx = test_bit(X86_FEATURE_MPX, host_featureset);
+            p->policy.feat.mpx = test_bit(X86_FEATURE_MPX, host_featureset);
         }
 
-        p->basic.max_leaf = min(p->basic.max_leaf, 0xdu);
-        p->feat.max_subleaf = 0;
-        p->extd.max_leaf = min(p->extd.max_leaf, 0x8000001c);
+        p->policy.basic.max_leaf = min(p->policy.basic.max_leaf, 0xdu);
+        p->policy.feat.max_subleaf = 0;
+        p->policy.extd.max_leaf = min(p->policy.extd.max_leaf, 0x8000001c);
     }
 
     if ( featureset )
@@ -714,17 +702,17 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
             }
         }
 
-        x86_cpu_featureset_to_policy(feat, p);
+        x86_cpu_featureset_to_policy(feat, &p->policy);
     }
     else
     {
-        p->extd.itsc = itsc;
+        p->policy.extd.itsc = itsc;
 
         if ( hvm )
         {
-            p->basic.pae = pae;
-            p->basic.vmx = nested_virt;
-            p->extd.svm = nested_virt;
+            p->policy.basic.pae = pae;
+            p->policy.basic.vmx = nested_virt;
+            p->policy.extd.svm = nested_virt;
         }
     }
 
@@ -734,8 +722,8 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
          * On hardware without CPUID Faulting, PV guests see real topology.
          * As a consequence, they also need to see the host htt/cmp fields.
          */
-        p->basic.htt       = test_bit(X86_FEATURE_HTT, host_featureset);
-        p->extd.cmp_legacy = test_bit(X86_FEATURE_CMP_LEGACY, host_featureset);
+        p->policy.basic.htt       = test_bit(X86_FEATURE_HTT, host_featureset);
+        p->policy.extd.cmp_legacy = test_bit(X86_FEATURE_CMP_LEGACY, host_featureset);
     }
     else
     {
@@ -743,28 +731,28 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
          * Topology for HVM guests is entirely controlled by Xen.  For now, we
          * hardcode APIC_ID = vcpu_id * 2 to give the illusion of no SMT.
          */
-        p->basic.htt = true;
-        p->extd.cmp_legacy = false;
+        p->policy.basic.htt = true;
+        p->policy.extd.cmp_legacy = false;
 
         /*
          * Leaf 1 EBX[23:16] is Maximum Logical Processors Per Package.
          * Update to reflect vLAPIC_ID = vCPU_ID * 2, but make sure to avoid
          * overflow.
          */
-        if ( !p->basic.lppp )
-            p->basic.lppp = 2;
-        else if ( !(p->basic.lppp & 0x80) )
-            p->basic.lppp *= 2;
+        if ( !p->policy.basic.lppp )
+            p->policy.basic.lppp = 2;
+        else if ( !(p->policy.basic.lppp & 0x80) )
+            p->policy.basic.lppp *= 2;
 
-        switch ( p->x86_vendor )
+        switch ( p->policy.x86_vendor )
         {
         case X86_VENDOR_INTEL:
-            for ( i = 0; (p->cache.subleaf[i].type &&
-                          i < ARRAY_SIZE(p->cache.raw)); ++i )
+            for ( i = 0; (p->policy.cache.subleaf[i].type &&
+                          i < ARRAY_SIZE(p->policy.cache.raw)); ++i )
             {
-                p->cache.subleaf[i].cores_per_package =
-                    (p->cache.subleaf[i].cores_per_package << 1) | 1;
-                p->cache.subleaf[i].threads_per_cache = 0;
+                p->policy.cache.subleaf[i].cores_per_package =
+                    (p->policy.cache.subleaf[i].cores_per_package << 1) | 1;
+                p->policy.cache.subleaf[i].threads_per_cache = 0;
             }
             break;
 
@@ -784,25 +772,26 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
              * apic_id_size values greater than 7.  Limit the value to
              * 7 for now.
              */
-            if ( p->extd.nc < 0x7f )
+            if ( p->policy.extd.nc < 0x7f )
             {
-                if ( p->extd.apic_id_size != 0 && p->extd.apic_id_size < 0x7 )
-                    p->extd.apic_id_size++;
+                if ( p->policy.extd.apic_id_size != 0 && p->policy.extd.apic_id_size < 0x7 )
+                    p->policy.extd.apic_id_size++;
 
-                p->extd.nc = (p->extd.nc << 1) | 1;
+                p->policy.extd.nc = (p->policy.extd.nc << 1) | 1;
             }
             break;
         }
     }
 
-    rc = x86_cpuid_copy_to_buffer(p, leaves, &nr_leaves);
+    nr_leaves = ARRAY_SIZE(p->leaves);
+    rc = x86_cpuid_copy_to_buffer(&p->policy, p->leaves, &nr_leaves);
     if ( rc )
     {
         ERROR("Failed to serialise CPUID (%d = %s)", -rc, strerror(-rc));
         goto out;
     }
 
-    rc = xc_set_domain_cpu_policy(xch, domid, nr_leaves, leaves, 0, NULL,
+    rc = xc_set_domain_cpu_policy(xch, domid, nr_leaves, p->leaves, 0, NULL,
                                   &err_leaf, &err_subleaf, &err_msr);
     if ( rc )
     {
@@ -825,8 +814,7 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
     rc = 0;
 
 out:
-    free(p);
-    free(leaves);
+    xc_cpu_policy_destroy(p);
 
     return rc;
 }
@@ -839,7 +827,11 @@ xc_cpu_policy_t *xc_cpu_policy_init(void)
 void xc_cpu_policy_destroy(xc_cpu_policy_t *policy)
 {
     if ( policy )
+    {
+        int err = errno;
         free(policy);
+        errno = err;
+    }
 }
 
 static int deserialize_policy(xc_interface *xch, xc_cpu_policy_t *policy,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 22 04:33:44 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Dec 2023 04:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.659202.1028713 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGXEG-0000G6-Kn; Fri, 22 Dec 2023 04:33:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 659202.1028713; Fri, 22 Dec 2023 04:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGXEG-0000Fw-IG; Fri, 22 Dec 2023 04:33:44 +0000
Received: by outflank-mailman (input) for mailman id 659202;
 Fri, 22 Dec 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 1rGXEE-0000Fd-OX
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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 1rGXEE-0000Kb-Nc
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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 1rGXEE-00068A-Mp
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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=2HkCdjdPI46wP1azL47IvXeFvc5yNYmsDmTEgc4ssyU=; b=ZzLZ/jXrFSa9ro/5ALbHeWLzng
	CaQS+ydf2SzuEh2oGSk5JQ5PdgAqgVuf7JEn5gxC1Dt3Q36pseeThF1gNExgM+ohUtQ75rbtGg/hy
	Ffm7kfP0ByzycyIwcvynvJ4nZf52dOIjparLkmg1heuC9cteIVqbuPcon3B0AwGsyn7I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/p2m: move and rename paging_max_paddr_bits()
Message-Id: <E1rGXEE-00068A-Mp@xenbits.xenproject.org>
Date: Fri, 22 Dec 2023 04:33:42 +0000

commit ad3a4b7c767d59052a8149796842957d73b5fd81
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Thu Dec 21 11:44:04 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 21 11:44:04 2023 +0100

    x86/p2m: move and rename paging_max_paddr_bits()
    
    The function also supports non-paging domains, and hence it being placed in
    p2m.h and named with the paging_ prefix is misleading.
    
    Move to x86 domain.c and rename to domain_max_paddr_bits().  Moving to a
    different header is non trivial, as the function depends on helpers declared in
    p2m.h.  There's no performance reason for the function being inline.
    
    Note the function is safe to use against PV or system domains, as it does check
    whether the domain is using external paging, and if not the returned physical
    address width is the host (native) value.
    
    No functional change intended.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu-policy.c         |  2 +-
 xen/arch/x86/domain.c             | 21 +++++++++++++++++++++
 xen/arch/x86/include/asm/domain.h |  3 +++
 xen/arch/x86/include/asm/paging.h | 22 ----------------------
 4 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/xen/arch/x86/cpu-policy.c b/xen/arch/x86/cpu-policy.c
index 423932bc13..76efb050ed 100644
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -864,7 +864,7 @@ void recalculate_cpuid_policy(struct domain *d)
 
     p->extd.maxphysaddr = min(p->extd.maxphysaddr, max->extd.maxphysaddr);
     p->extd.maxphysaddr = min_t(uint8_t, p->extd.maxphysaddr,
-                                paging_max_paddr_bits(d));
+                                domain_max_paddr_bits(d));
     p->extd.maxphysaddr = max_t(uint8_t, p->extd.maxphysaddr,
                                 (p->basic.pae || p->basic.pse36) ? 36 : 32);
 
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 3712e36df9..8a31d18f69 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -2552,6 +2552,27 @@ static int __init cf_check init_vcpu_kick_softirq(void)
 }
 __initcall(init_vcpu_kick_softirq);
 
+unsigned int domain_max_paddr_bits(const struct domain *d)
+{
+    unsigned int bits = paging_mode_hap(d) ? hap_paddr_bits : paddr_bits;
+
+    if ( paging_mode_external(d) )
+    {
+        if ( !IS_ENABLED(CONFIG_BIGMEM) && paging_mode_shadow(d) )
+        {
+            /* Shadowed superpages store GFNs in 32-bit page_info fields. */
+            bits = min(bits, 32U + PAGE_SHIFT);
+        }
+        else
+        {
+            /* Both p2m-ept and p2m-pt only support 4-level page tables. */
+            bits = min(bits, 48U);
+        }
+    }
+
+    return bits;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h
index 4b6b7ceab1..622d22bef2 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -777,6 +777,9 @@ static inline void pv_inject_sw_interrupt(unsigned int vector)
 struct arch_vcpu_io {
 };
 
+/* Maxphysaddr supportable by the paging infrastructure. */
+unsigned int domain_max_paddr_bits(const struct domain *d);
+
 #endif /* __ASM_DOMAIN_H__ */
 
 /*
diff --git a/xen/arch/x86/include/asm/paging.h b/xen/arch/x86/include/asm/paging.h
index 76162a9429..8a2a0af408 100644
--- a/xen/arch/x86/include/asm/paging.h
+++ b/xen/arch/x86/include/asm/paging.h
@@ -336,28 +336,6 @@ static inline bool gfn_valid(const struct domain *d, gfn_t gfn)
     return !(gfn_x(gfn) >> (d->arch.cpuid->extd.maxphysaddr - PAGE_SHIFT));
 }
 
-/* Maxphysaddr supportable by the paging infrastructure. */
-static always_inline unsigned int paging_max_paddr_bits(const struct domain *d)
-{
-    unsigned int bits = paging_mode_hap(d) ? hap_paddr_bits : paddr_bits;
-
-    if ( paging_mode_external(d) )
-    {
-        if ( !IS_ENABLED(CONFIG_BIGMEM) && paging_mode_shadow(d) )
-        {
-            /* Shadowed superpages store GFNs in 32-bit page_info fields. */
-            bits = min(bits, 32U + PAGE_SHIFT);
-        }
-        else
-        {
-            /* Both p2m-ept and p2m-pt only support 4-level page tables. */
-            bits = min(bits, 48U);
-        }
-    }
-
-    return bits;
-}
-
 #endif /* XEN_PAGING_H */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 22 04:33:53 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Dec 2023 04:33:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.659204.1028717 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGXEP-0000K7-ME; Fri, 22 Dec 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 659204.1028717; Fri, 22 Dec 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 1rGXEP-0000Jz-Jc; Fri, 22 Dec 2023 04:33:53 +0000
Received: by outflank-mailman (input) for mailman id 659204;
 Fri, 22 Dec 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 1rGXEO-0000Jp-Rg
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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 1rGXEO-0000Km-Qh
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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 1rGXEO-00068b-Pk
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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=Geq8i/rSEtWFSmk2q4aDi51Bk8qFNpcwf6yv3HOUo9w=; b=xPNe9cF1p/7W57bC6iskj3ksma
	ZGJmEWreUZaesqqAbF/NNyvsPx/zWgPOwCLIHNH0pNsyWD1SiXq4ylnGZHCjBIhle5SuA+xX7nk0U
	Jzhdgu7dtQCBKrujKQa0B0zDIc7C7rKxGw+Qv+5Id6PK+G6viTHpIqvHwcfdUOv32R4U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] amd-vi: set IOMMU page table levels based on guest reported paddr width
Message-Id: <E1rGXEO-00068b-Pk@xenbits.xenproject.org>
Date: Fri, 22 Dec 2023 04:33:52 +0000

commit 94039d97e2e3aeee6c7246ad44ab5e0389509d34
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Thu Dec 21 11:44:55 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 21 11:44:55 2023 +0100

    amd-vi: set IOMMU page table levels based on guest reported paddr width
    
    However take into account the minimum number of levels required by unity maps
    when setting the page table levels.
    
    The previous setting of the page table levels for PV guests based on the
    highest RAM address was bogus, as there can be other non-RAM regions past the
    highest RAM address that need to be mapped, for example device MMIO.
    
    For HVM we also take amd_iommu_min_paging_mode into account, however if unity
    maps require more than 4 levels attempting to add those will currently fail at
    the p2m level, as 4 levels is the maximum supported.
    
    Fixes: 0700c962ac2d ('Add AMD IOMMU support into hypervisor')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 6bc73dc210..4f556e8a72 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -359,21 +359,17 @@ int __read_mostly amd_iommu_min_paging_mode = 1;
 static int cf_check amd_iommu_domain_init(struct domain *d)
 {
     struct domain_iommu *hd = dom_iommu(d);
+    int pglvl = amd_iommu_get_paging_mode(
+                    1UL << (domain_max_paddr_bits(d) - PAGE_SHIFT));
+
+    if ( pglvl < 0 )
+        return pglvl;
 
     /*
-     * Choose the number of levels for the IOMMU page tables.
-     * - PV needs 3 or 4, depending on whether there is RAM (including hotplug
-     *   RAM) above the 512G boundary.
-     * - HVM could in principle use 3 or 4 depending on how much guest
-     *   physical address space we give it, but this isn't known yet so use 4
-     *   unilaterally.
-     * - Unity maps may require an even higher number.
+     * Choose the number of levels for the IOMMU page tables, taking into
+     * account unity maps.
      */
-    hd->arch.amd.paging_mode = max(amd_iommu_get_paging_mode(
-            is_hvm_domain(d)
-            ? 1UL << (DEFAULT_DOMAIN_ADDRESS_WIDTH - PAGE_SHIFT)
-            : get_upper_mfn_bound() + 1),
-        amd_iommu_min_paging_mode);
+    hd->arch.amd.paging_mode = max(pglvl, amd_iommu_min_paging_mode);
 
     return 0;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 22 04:34:03 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Dec 2023 04:34:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.659205.1028720 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGXEZ-0000NM-Nb; Fri, 22 Dec 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 659205.1028720; Fri, 22 Dec 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 1rGXEZ-0000NE-L4; Fri, 22 Dec 2023 04:34:03 +0000
Received: by outflank-mailman (input) for mailman id 659205;
 Fri, 22 Dec 2023 04:34:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGXEY-0000N8-VO
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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 1rGXEY-0000LQ-UV
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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 1rGXEY-00069l-TC
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 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=VUv+u1W8bALhu0fy8YKv1sTmhyGR8nHheBrsbw9ng9U=; b=5D4S1MzRFnw7Li+wYb7+0ml2nB
	B9ay1B0gEmbIklnhmtL0stW5zHM4K4rbQPiHiKMgpisMtk36SaWaVb1KECmvbUAaJ6mgm1sqDdxdC
	TJnYm4JEV8HWs11yDZpJXRPD2JJgiUf6udWSYOMr1OMqPJ4Jm6q7PrhYcjm0397MLWWU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] pci: msi: pass pdev to pci_enable_msi() function
Message-Id: <E1rGXEY-00069l-TC@xenbits.xenproject.org>
Date: Fri, 22 Dec 2023 04:34:02 +0000

commit f4d0859da3d076bb98633c43846df9d48461f90f
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Thu Dec 21 11:45:57 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 21 11:45:57 2023 +0100

    pci: msi: pass pdev to pci_enable_msi() function
    
    Previously pci_enable_msi() function obtained pdev pointer by itself,
    but taking into account upcoming changes to PCI locking, it is better
    when caller passes already acquired pdev pointer to the function,
    because caller knows better how to obtain the pointer and which locks
    are needed to be used. Also, in most cases caller already has pointer
    to pdev, so we can avoid an extra list walk.
    
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/msi.h |  3 ++-
 xen/arch/x86/irq.c             |  2 +-
 xen/arch/x86/msi.c             | 19 ++++++++++---------
 xen/drivers/char/ns16550.c     |  5 ++++-
 4 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/include/asm/msi.h b/xen/arch/x86/include/asm/msi.h
index c1ece2786e..997ccb87be 100644
--- a/xen/arch/x86/include/asm/msi.h
+++ b/xen/arch/x86/include/asm/msi.h
@@ -81,7 +81,8 @@ struct irq_desc;
 struct hw_interrupt_type;
 struct msi_desc;
 /* Helper functions */
-extern int pci_enable_msi(struct msi_info *msi, struct msi_desc **desc);
+extern int pci_enable_msi(struct pci_dev *pdev, struct msi_info *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);
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 6e668b1b4f..50e49e1a4b 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2176,7 +2176,7 @@ int map_domain_pirq(
         if ( !pdev )
             goto done;
 
-        ret = pci_enable_msi(msi, &msi_desc);
+        ret = pci_enable_msi(pdev, msi, &msi_desc);
         if ( ret )
         {
             if ( ret > 0 )
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 7f8e794254..335c0868a2 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -983,13 +983,13 @@ static int msix_capability_init(struct pci_dev *dev,
  * irq or non-zero for otherwise.
  **/
 
-static int __pci_enable_msi(struct msi_info *msi, struct msi_desc **desc)
+static int __pci_enable_msi(struct pci_dev *pdev, struct msi_info *msi,
+                            struct msi_desc **desc)
 {
-    struct pci_dev *pdev;
     struct msi_desc *old_desc;
 
     ASSERT(pcidevs_locked());
-    pdev = pci_get_pdev(NULL, msi->sbdf);
+
     if ( !pdev )
         return -ENODEV;
 
@@ -1038,13 +1038,13 @@ static void __pci_disable_msi(struct msi_desc *entry)
  * of irqs available. Driver should use the returned value to re-send
  * its request.
  **/
-static int __pci_enable_msix(struct msi_info *msi, struct msi_desc **desc)
+static int __pci_enable_msix(struct pci_dev *pdev, struct msi_info *msi,
+                             struct msi_desc **desc)
 {
-    struct pci_dev *pdev;
     struct msi_desc *old_desc;
 
     ASSERT(pcidevs_locked());
-    pdev = pci_get_pdev(NULL, msi->sbdf);
+
     if ( !pdev || !pdev->msix )
         return -ENODEV;
 
@@ -1151,15 +1151,16 @@ int pci_prepare_msix(u16 seg, u8 bus, u8 devfn, bool off)
  * Notice: only construct the msi_desc
  * no change to irq_desc here, and the interrupt is masked
  */
-int pci_enable_msi(struct msi_info *msi, struct msi_desc **desc)
+int pci_enable_msi(struct pci_dev *pdev, struct msi_info *msi,
+                   struct msi_desc **desc)
 {
     ASSERT(pcidevs_locked());
 
     if ( !use_msi )
         return -EPERM;
 
-    return msi->table_base ? __pci_enable_msix(msi, desc) :
-                             __pci_enable_msi(msi, desc);
+    return msi->table_base ? __pci_enable_msix(pdev, msi, desc) :
+                             __pci_enable_msi(pdev, msi, desc);
 }
 
 /*
diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 29691e8d3a..afe3d514b9 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -448,10 +448,13 @@ static void __init cf_check ns16550_init_postirq(struct serial_port *port)
             if ( rc > 0 )
             {
                 struct msi_desc *msi_desc = NULL;
+                struct pci_dev *pdev;
 
                 pcidevs_lock();
 
-                rc = pci_enable_msi(&msi, &msi_desc);
+                pdev = pci_get_pdev(NULL, msi.sbdf);
+                rc = pdev ? pci_enable_msi(pdev, &msi, &msi_desc) : -ENODEV;
+
                 if ( !rc )
                 {
                     struct irq_desc *desc = irq_to_desc(msi.irq);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 22 04:34:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Dec 2023 04:34:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.659206.1028725 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGXEj-0000Q4-PS; Fri, 22 Dec 2023 04:34:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 659206.1028725; Fri, 22 Dec 2023 04: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 1rGXEj-0000Px-Mf; Fri, 22 Dec 2023 04:34:13 +0000
Received: by outflank-mailman (input) for mailman id 659206;
 Fri, 22 Dec 2023 04:34:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGXEj-0000Pk-2u
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 04:34:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGXEj-0000LX-2A
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 04:34:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGXEj-0006AG-0w
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 04:34:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zxXXCqLQI5iiN+EO5yAPZtTewFIeNB54q+pSZvYS9e8=; b=NebgJmIqnvjlb1lsC51Fxx5SKw
	kxPDK3SwcCDA0eK7Z4LC+ZsPnYpnPbDAcxD7qljC/iC0CNjMajOQON0egMzALImjBehx83t/meFhk
	cUn2kNDJ7OXsuIe5Vh1HLx+cnu8EXnpx3hZaujAce+6A96YBjQZzLa4sRS5QSY6ngR7I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] pci: introduce per-domain PCI rwlock
Message-Id: <E1rGXEj-0006AG-0w@xenbits.xenproject.org>
Date: Fri, 22 Dec 2023 04:34:13 +0000

commit 8862c7b8b659c9736347dd133c9a15fdefbe689e
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Thu Dec 21 11:46:32 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 21 11:46:32 2023 +0100

    pci: introduce per-domain PCI rwlock
    
    Add per-domain d->pci_lock that protects access to
    d->pdev_list. Purpose of this lock is to give guarantees to VPCI code
    that underlying pdev will not disappear under feet. This is a rw-lock,
    but this patch adds only write_lock()s. There will be read_lock()
    users in the next patches.
    
    This lock should be taken in write mode every time d->pdev_list is
    altered. All write accesses also should be protected by pcidevs_lock()
    as well. Idea is that any user that wants read access to the list or
    to the devices stored in the list should use either this new
    d->pci_lock or old pcidevs_lock(). Usage of any of this two locks will
    ensure only that pdev of interest will not disappear from under feet
    and that the pdev still will be assigned to the same domain. Of
    course, any new users should use pcidevs_lock() when it is
    appropriate (e.g. when accessing any other state that is protected by
    the said lock). In case both the newly introduced per-domain rwlock
    and the pcidevs lock is taken, the latter must be acquired first.
    
    Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/domain.c                         |  1 +
 xen/drivers/passthrough/amd/pci_amd_iommu.c |  9 +++-
 xen/drivers/passthrough/pci.c               | 71 ++++++++++++++++++++++++-----
 xen/drivers/passthrough/vtd/iommu.c         |  9 +++-
 xen/include/xen/sched.h                     | 22 +++++++++
 5 files changed, 99 insertions(+), 13 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index c5954cdb1a..f6f5574996 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -651,6 +651,7 @@ struct domain *domain_create(domid_t domid,
 
 #ifdef CONFIG_HAS_PCI
     INIT_LIST_HEAD(&d->pdev_list);
+    rwlock_init(&d->pci_lock);
 #endif
 
     /* All error paths can depend on the above setup. */
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 4f556e8a72..f6efd88e36 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -477,8 +477,15 @@ static int cf_check reassign_device(
 
     if ( devfn == pdev->devfn && pdev->domain != target )
     {
-        list_move(&pdev->domain_list, &target->pdev_list);
+        write_lock(&source->pci_lock);
+        list_del(&pdev->domain_list);
+        write_unlock(&source->pci_lock);
+
         pdev->domain = target;
+
+        write_lock(&target->pci_lock);
+        list_add(&pdev->domain_list, &target->pdev_list);
+        write_unlock(&target->pci_lock);
     }
 
     /*
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 28ed8ea817..1439d1ef2b 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -453,7 +453,9 @@ static void __init _pci_hide_device(struct pci_dev *pdev)
     if ( pdev->domain )
         return;
     pdev->domain = dom_xen;
+    write_lock(&dom_xen->pci_lock);
     list_add(&pdev->domain_list, &dom_xen->pdev_list);
+    write_unlock(&dom_xen->pci_lock);
 }
 
 int __init pci_hide_device(unsigned int seg, unsigned int bus,
@@ -746,7 +748,9 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
     if ( !pdev->domain )
     {
         pdev->domain = hardware_domain;
+        write_lock(&hardware_domain->pci_lock);
         list_add(&pdev->domain_list, &hardware_domain->pdev_list);
+        write_unlock(&hardware_domain->pci_lock);
 
         /*
          * For devices not discovered by Xen during boot, add vPCI handlers
@@ -756,7 +760,9 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
         if ( ret )
         {
             printk(XENLOG_ERR "Setup of vPCI failed: %d\n", ret);
+            write_lock(&hardware_domain->pci_lock);
             list_del(&pdev->domain_list);
+            write_unlock(&hardware_domain->pci_lock);
             pdev->domain = NULL;
             goto out;
         }
@@ -764,7 +770,9 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
         if ( ret )
         {
             vpci_remove_device(pdev);
+            write_lock(&hardware_domain->pci_lock);
             list_del(&pdev->domain_list);
+            write_unlock(&hardware_domain->pci_lock);
             pdev->domain = NULL;
             goto out;
         }
@@ -814,7 +822,11 @@ int pci_remove_device(u16 seg, u8 bus, u8 devfn)
             pci_cleanup_msi(pdev);
             ret = iommu_remove_device(pdev);
             if ( pdev->domain )
+            {
+                write_lock(&pdev->domain->pci_lock);
                 list_del(&pdev->domain_list);
+                write_unlock(&pdev->domain->pci_lock);
+            }
             printk(XENLOG_DEBUG "PCI remove device %pp\n", &pdev->sbdf);
             free_pdev(pseg, pdev);
             break;
@@ -885,26 +897,61 @@ static int deassign_device(struct domain *d, uint16_t seg, uint8_t bus,
 
 int pci_release_devices(struct domain *d)
 {
-    struct pci_dev *pdev, *tmp;
-    u8 bus, devfn;
-    int ret;
+    int combined_ret;
+    LIST_HEAD(failed_pdevs);
 
     pcidevs_lock();
-    ret = arch_pci_clean_pirqs(d);
-    if ( ret )
+
+    combined_ret = arch_pci_clean_pirqs(d);
+    if ( combined_ret )
     {
         pcidevs_unlock();
-        return ret;
+        return combined_ret;
     }
-    list_for_each_entry_safe ( pdev, tmp, &d->pdev_list, domain_list )
+
+    write_lock(&d->pci_lock);
+
+    while ( !list_empty(&d->pdev_list) )
     {
-        bus = pdev->bus;
-        devfn = pdev->devfn;
-        ret = deassign_device(d, pdev->seg, bus, devfn) ?: ret;
+        struct pci_dev *pdev = list_first_entry(&d->pdev_list,
+                                                struct pci_dev,
+                                                domain_list);
+        uint16_t seg = pdev->seg;
+        uint8_t bus = pdev->bus;
+        uint8_t devfn = pdev->devfn;
+        int ret;
+
+        write_unlock(&d->pci_lock);
+        ret = deassign_device(d, seg, bus, devfn);
+        write_lock(&d->pci_lock);
+        if ( ret )
+        {
+            const struct pci_dev *tmp;
+
+            /*
+             * We need to check if deassign_device() left our pdev in
+             * domain's list. As we dropped the lock, we can't be sure
+             * that list wasn't permutated in some random way, so we
+             * need to traverse the whole list.
+             */
+            for_each_pdev ( d, tmp )
+            {
+                if ( tmp == pdev )
+                {
+                    list_move_tail(&pdev->domain_list, &failed_pdevs);
+                    break;
+                }
+            }
+
+            combined_ret = combined_ret ?: ret;
+        }
     }
+
+    list_splice(&failed_pdevs, &d->pdev_list);
+    write_unlock(&d->pci_lock);
     pcidevs_unlock();
 
-    return ret;
+    return combined_ret;
 }
 
 #define PCI_CLASS_BRIDGE_HOST    0x0600
@@ -1124,7 +1171,9 @@ static int __hwdom_init cf_check _setup_hwdom_pci_devices(
             if ( !pdev->domain )
             {
                 pdev->domain = ctxt->d;
+                write_lock(&ctxt->d->pci_lock);
                 list_add(&pdev->domain_list, &ctxt->d->pdev_list);
+                write_unlock(&ctxt->d->pci_lock);
                 setup_one_hwdom_device(ctxt, pdev);
             }
             else if ( pdev->domain == dom_xen )
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index bc6181c9f9..99b642f12e 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2816,8 +2816,15 @@ static int cf_check reassign_device_ownership(
 
     if ( devfn == pdev->devfn && pdev->domain != target )
     {
-        list_move(&pdev->domain_list, &target->pdev_list);
+        write_lock(&source->pci_lock);
+        list_del(&pdev->domain_list);
+        write_unlock(&source->pci_lock);
+
         pdev->domain = target;
+
+        write_lock(&target->pci_lock);
+        list_add(&pdev->domain_list, &target->pdev_list);
+        write_unlock(&target->pci_lock);
     }
 
     if ( !has_arch_pdevs(source) )
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 3609ef88c4..9da91e0e62 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -461,6 +461,28 @@ struct domain
 
 #ifdef CONFIG_HAS_PCI
     struct list_head pdev_list;
+    /*
+     * pci_lock protects access to pdev_list.
+     *
+     * Any user *reading* from pdev_list, or from devices stored in pdev_list,
+     * should hold either pcidevs_lock() or pci_lock in read mode. Optionally,
+     * both locks may be held for reads as long as the locking order is
+     * observed.
+     *
+     * Any user *writing* to pdev_list, or to devices stored in pdev_list,
+     * should hold both pcidevs_lock() and pci_lock in write mode, and observe
+     * the locking order.
+     *
+     * The locking order is:
+     * 1. pcidevs_lock()
+     * 2. d->pci_lock
+     *
+     * Additionally, users of both pci_lock and vpci->lock should observe the
+     * following locking order:
+     * 1. d->pci_lock
+     * 2. pdev->vpci->lock
+     */
+    rwlock_t pci_lock;
 #endif
 
 #ifdef CONFIG_HAS_PASSTHROUGH
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 22 04:34:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Dec 2023 04:34:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.659207.1028729 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGXEt-0000T9-R7; Fri, 22 Dec 2023 04:34:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 659207.1028729; Fri, 22 Dec 2023 04: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 1rGXEt-0000T1-OK; Fri, 22 Dec 2023 04:34:23 +0000
Received: by outflank-mailman (input) for mailman id 659207;
 Fri, 22 Dec 2023 04: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 1rGXEt-0000Su-5x
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 04: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 1rGXEt-0000Le-5D
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 04:34:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGXEt-0006Ah-4U
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 04: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=bN3lZ6tozMFS7G49rpTm/spUiqKoZwAPoX8vtP//lmQ=; b=khodsKjeiu5fQOckKdIpZMvA/S
	cPWbvnZr6edlj8jfFktEj5sjdmkLgAekuKMJzWtfZBFEH2+vVuBrJL3QhMGMLuhQXtCMD8cKcetCL
	NnuXDHSP8KWuyEjrrEX6cXt6950ccb2+SXjhxgF3XX8Ycld51BR9xAWG+xUMMr7TQYhE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mm: use "break" in arch_memory_op()
Message-Id: <E1rGXEt-0006Ah-4U@xenbits.xenproject.org>
Date: Fri, 22 Dec 2023 04:34:23 +0000

commit 6ccd2501b42bd2c67904f30a4b5e515c06ce2255
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 21 11:47:10 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 21 11:47:10 2023 +0100

    x86/mm: use "break" in arch_memory_op()
    
    The final return statement is unreachable and hence disliked by Misra
    C:2012 (rule 2.1). Convert those case-specific (main) return statements
    which already use "rc", or in one case when it can be used without
    further adding of code, to break.
    
    No functional change intended.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/x86/mm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 0a66db10b9..b56e0d8065 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4724,7 +4724,7 @@ long arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         spin_unlock(&d->arch.e820_lock);
 
         rcu_unlock_domain(d);
-        return rc;
+        break;
     }
 
     case XENMEM_memory_map:
@@ -4818,7 +4818,7 @@ long arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( __copy_to_guest(arg, &ctxt.map, 1) )
             return -EFAULT;
 
-        return 0;
+        break;
     }
 
     case XENMEM_machphys_mapping:
@@ -4880,7 +4880,7 @@ long arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         }
 
         rcu_unlock_domain(d);
-        return rc;
+        break;
     }
 #endif
 
@@ -4888,7 +4888,7 @@ long arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         return subarch_memory_op(cmd, arg);
     }
 
-    return 0;
+    return rc;
 }
 
 int cf_check mmio_ro_emulated_write(
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 22 04:34:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Dec 2023 04:34:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.659208.1028733 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGXF3-0000We-Tl; Fri, 22 Dec 2023 04:34:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 659208.1028733; Fri, 22 Dec 2023 04: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 1rGXF3-0000WW-R2; Fri, 22 Dec 2023 04:34:33 +0000
Received: by outflank-mailman (input) for mailman id 659208;
 Fri, 22 Dec 2023 04: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 1rGXF3-0000WH-8q
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 04: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 1rGXF3-0000Lo-84
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 04:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGXF3-0006B8-7G
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 04: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=ntzbyzNPYAkCj91oy6M9HUt8/HwMIU1uXRn5xKFH5wM=; b=HWnGBhshsixhP9WQqhzaSo7dJr
	XDxezdLluDtJ+sU9fq0fO+HzFM85fOFVTLWVKGnmdh13FvwZHsB3NJ1myDZ4NDz7fbcY1Sc7vA6yw
	fSnaK6z2Hh37yCjNNla0eLiDrvYM2ShaawDaXKj4freO79veoTxdtQfA6RsXYMZzeJaM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/platform: tidy do_platform_op() a little
Message-Id: <E1rGXF3-0006B8-7G@xenbits.xenproject.org>
Date: Fri, 22 Dec 2023 04:34:33 +0000

commit 773db8f307d84fe06cd199ac172e67799c0a12df
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 21 11:47:41 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 21 11:47:41 2023 +0100

    x86/platform: tidy do_platform_op() a little
    
    The function has a few stray scopes and inconsistent use (indentation)
    of break statements. Drop the stray braces and bring all the break-s in
    line with one another. This in particular means dropping a redundant
    break from XENPF_cpu_offline handling, pleasing Misra C:2012 rule 2.1.
    
    No functional change intended.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/platform_hypercall.c | 33 ++++++++++++++-------------------
 1 file changed, 14 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 4dde71db27..641b045341 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -258,7 +258,6 @@ ret_t do_platform_op(
         break;
 
     case XENPF_add_memtype:
-    {
         ret = mtrr_add_page(
             op->u.add_memtype.mfn,
             op->u.add_memtype.nr_mfns,
@@ -273,11 +272,9 @@ ret_t do_platform_op(
             if ( ret != 0 )
                 mtrr_del_page(ret, 0, 0);
         }
-    }
-    break;
+        break;
 
     case XENPF_del_memtype:
-    {
         if (op->u.del_memtype.handle == 0
             /* mtrr/main.c otherwise does a lookup */
             && (int)op->u.del_memtype.reg >= 0)
@@ -288,8 +285,7 @@ ret_t do_platform_op(
         }
         else
             ret = -EINVAL;
-    }
-    break;
+        break;
 
     case XENPF_read_memtype:
     {
@@ -306,8 +302,8 @@ ret_t do_platform_op(
             ret = __copy_field_to_guest(u_xenpf_op, op, u.read_memtype)
                   ? -EFAULT : 0;
         }
+        break;
     }
-    break;
 
     case XENPF_microcode_update:
     {
@@ -316,8 +312,8 @@ ret_t do_platform_op(
         guest_from_compat_handle(data, op->u.microcode.data);
 
         ret = microcode_update(data, op->u.microcode.length);
+        break;
     }
-    break;
 
     case XENPF_platform_quirk:
     {
@@ -340,8 +336,8 @@ ret_t do_platform_op(
             ret = -EINVAL;
             break;
         }
+        break;
     }
-    break;
 
     case XENPF_firmware_info:
         switch ( op->u.firmware_info.type )
@@ -521,8 +517,8 @@ ret_t do_platform_op(
 
         if ( ret == 0 && __copy_field_to_guest(u_xenpf_op, op, u.getidletime) )
             ret = -EFAULT;
+        break;
     }
-    break;
 
     case XENPF_set_processor_pminfo:
         switch ( op->u.set_pminfo.type )
@@ -560,8 +556,8 @@ ret_t do_platform_op(
 
             guest_from_compat_handle(pdc, op->u.set_pminfo.u.pdc);
             ret = acpi_set_pdc_bits(op->u.set_pminfo.id, pdc);
+            break;
         }
-        break;
 
         default:
             ret = -EINVAL;
@@ -601,8 +597,8 @@ ret_t do_platform_op(
         put_cpu_maps();
 
         ret = __copy_field_to_guest(u_xenpf_op, op, u.pcpu_info) ? -EFAULT : 0;
+        break;
     }
-    break;
 
     case XENPF_get_cpu_version:
     {
@@ -637,8 +633,8 @@ ret_t do_platform_op(
 
         if ( __copy_field_to_guest(u_xenpf_op, op, u.pcpu_version) )
             ret = -EFAULT;
+        break;
     }
-    break;
 
     case XENPF_get_ucode_revision:
     {
@@ -666,8 +662,8 @@ ret_t do_platform_op(
 
         if ( __copy_field_to_guest(u_xenpf_op, op, u.ucode_revision) )
             ret = -EFAULT;
+        break;
     }
-    break;
 
     case XENPF_cpu_online:
     {
@@ -725,7 +721,6 @@ ret_t do_platform_op(
             0, cpu_down_helper, (void *)(unsigned long)cpu);
         break;
     }
-    break;
 
     case XENPF_cpu_hotadd:
         ret = xsm_resource_plug_core(XSM_HOOK);
@@ -735,7 +730,7 @@ ret_t do_platform_op(
         ret = cpu_add(op->u.cpu_add.apic_id,
                       op->u.cpu_add.acpi_id,
                       op->u.cpu_add.pxm);
-    break;
+        break;
 
     case XENPF_mem_hotadd:
         ret = xsm_resource_plug_core(XSM_HOOK);
@@ -775,8 +770,8 @@ ret_t do_platform_op(
             ret = -EINVAL;
             break;
         }
+        break;
     }
-    break;
 
     case XENPF_resource_op:
     {
@@ -842,8 +837,8 @@ ret_t do_platform_op(
             ret = ra.nr_done;
 
         xfree(ra.entries);
+        break;
     }
-    break;
 
     case XENPF_get_symbol:
     {
@@ -870,8 +865,8 @@ ret_t do_platform_op(
             ret = -EFAULT;
         if ( !ret && __copy_field_to_guest(u_xenpf_op, op, u.symdata) )
             ret = -EFAULT;
+        break;
     }
-    break;
 
 #ifdef CONFIG_VIDEO
     case XENPF_get_dom0_console:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 22 04:34:43 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Dec 2023 04:34:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.659209.1028737 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGXFD-0000ZG-VU; Fri, 22 Dec 2023 04:34:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 659209.1028737; Fri, 22 Dec 2023 04: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 1rGXFD-0000Z4-SY; Fri, 22 Dec 2023 04:34:43 +0000
Received: by outflank-mailman (input) for mailman id 659209;
 Fri, 22 Dec 2023 04: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 1rGXFD-0000Yw-Bk
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 04: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 1rGXFD-0000MH-B3
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 04:34:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGXFD-0006BZ-AE
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 04:34:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=G2dl/bOmMvsMo82EEKV/xXXBJ2MuXC2nAQ9NFF5Lhxk=; b=wAgXqffbjzmCCRw6RM8WCwmpnV
	gjHgPJuN+egv3nDtqY/0Rn2iCUuHuElurerzhenKi2iHmt41zyJVN7H+OthXJBk57XbQ2Ykb3GLWB
	rDEugg5YpcYJGh4DzzJ0IjyZpmfHtpGjaBNNuubYt2Xv+wHRduP1B8BSErBgyt9Tu110=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/misra: exclude files inherited from ACPI CA from MISRA compliance
Message-Id: <E1rGXFD-0006BZ-AE@xenbits.xenproject.org>
Date: Fri, 22 Dec 2023 04:34:43 +0000

commit 3909fb4692dfbf7e46c0bcc37b0a3b943a034da9
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Thu Dec 21 11:48:18 2023 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 21 11:48:18 2023 +0100

    docs/misra: exclude files inherited from ACPI CA from MISRA compliance
    
    The files under 'include/acpi/ac*.h' and 'include/acpi/plaform/ac*.h'
    are inherited from Linux and ACPI CA, therefore they are not subject to
    MISRA compliance at the moment.
    
    No functional change.
    
    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, 2 insertions(+), 10 deletions(-)

diff --git a/docs/misra/exclude-list.json b/docs/misra/exclude-list.json
index 83fae0b4a4..7971d0e70f 100644
--- a/docs/misra/exclude-list.json
+++ b/docs/misra/exclude-list.json
@@ -202,19 +202,11 @@
             "comment": "Imported from Linux, ignore for now"
         },
         {
-            "rel_path": "include/acpi/acpiosxf.h",
+            "rel_path": "include/acpi/ac*.h",
             "comment": "Imported from Linux, ignore for now"
         },
         {
-            "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",
+          "rel_path": "include/acpi/platform/ac*.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 Fri Dec 22 17:44:07 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Dec 2023 17:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.659675.1029391 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGjZ4-0003ys-G6; Fri, 22 Dec 2023 17:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 659675.1029391; Fri, 22 Dec 2023 17: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 1rGjZ4-0003yk-Cs; Fri, 22 Dec 2023 17:44:02 +0000
Received: by outflank-mailman (input) for mailman id 659675;
 Fri, 22 Dec 2023 17: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 1rGjZ3-0003ya-UQ
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 17: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 1rGjZ3-0000I6-TM
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 17:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGjZ3-0005zz-RL
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 17: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=nXlxa2RVEK+zahlN5Xvy+EXUqMFZo/3XYt1H2viaXZc=; b=oxS2AyyslEEGZvHx/xxlIqvepJ
	f3yyeYs6KE8haqgNNvmzz1fT/ckApMXeqr45wA4nq0g2FUkdzQk13iFK8uRHDShXKDpY+THKbsksx
	H3DWcfF9blw9co71669A6WDVQRykvr0hhRq3ECS/HS9Ek4sd7UygBJmaNFVyR5fv4x2s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/xmalloc: XMEM_POOL_POISON improvements
Message-Id: <E1rGjZ3-0005zz-RL@xenbits.xenproject.org>
Date: Fri, 22 Dec 2023 17:44:01 +0000

commit b74c735f88275f8ae09521c452e8819832b51a97
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 20 20:34:29 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Dec 21 12:19:40 2023 +0000

    xen/xmalloc: XMEM_POOL_POISON improvements
    
    When in use, the spew:
    
      (XEN) Assertion '!memchr_inv(b->ptr.buffer + MIN_BLOCK_SIZE, POISON_BYTE, (b->size & BLOCK_SIZE_MASK) - MIN_BLOCK_SIZE)' failed at common/xmalloc_tlsf.c:246
    
    is unweidly and likely meaningless to non-Xen developers.  Therefore:
    
     * Switch to IS_ENABLED().  There's no need for full #ifdef-ary.
     * Pull memchr_inv() out into the if(), and provide an error message which
       clearly states that corruption has been found.
     * XMEM_POOL_POISON can be enabled in release builds.  Use printk()+BUG() so
       it doesn't silently stop working when assertions are compiled out.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/xmalloc_tlsf.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c
index 349b31cb4c..5e55fc463e 100644
--- a/xen/common/xmalloc_tlsf.c
+++ b/xen/common/xmalloc_tlsf.c
@@ -249,11 +249,14 @@ static inline void EXTRACT_BLOCK(struct bhdr *b, struct xmem_pool *p, int fl,
     }
     b->ptr.free_ptr = (struct free_ptr) {NULL, NULL};
 
-#ifdef CONFIG_XMEM_POOL_POISON
-    if ( (b->size & BLOCK_SIZE_MASK) > MIN_BLOCK_SIZE )
-        ASSERT(!memchr_inv(b->ptr.buffer + MIN_BLOCK_SIZE, POISON_BYTE,
-                           (b->size & BLOCK_SIZE_MASK) - MIN_BLOCK_SIZE));
-#endif /* CONFIG_XMEM_POOL_POISON */
+    if ( IS_ENABLED(CONFIG_XMEM_POOL_POISON) &&
+         (b->size & BLOCK_SIZE_MASK) > MIN_BLOCK_SIZE &&
+         memchr_inv(b->ptr.buffer + MIN_BLOCK_SIZE, POISON_BYTE,
+                    (b->size & BLOCK_SIZE_MASK) - MIN_BLOCK_SIZE) )
+    {
+        printk(XENLOG_ERR "XMEM Pool corruption found");
+        BUG();
+    }
 }
 
 /**
@@ -261,11 +264,10 @@ static inline void EXTRACT_BLOCK(struct bhdr *b, struct xmem_pool *p, int fl,
  */
 static inline void INSERT_BLOCK(struct bhdr *b, struct xmem_pool *p, int fl, int sl)
 {
-#ifdef CONFIG_XMEM_POOL_POISON
-    if ( (b->size & BLOCK_SIZE_MASK) > MIN_BLOCK_SIZE )
+    if ( IS_ENABLED(CONFIG_XMEM_POOL_POISON) &&
+         (b->size & BLOCK_SIZE_MASK) > MIN_BLOCK_SIZE )
         memset(b->ptr.buffer + MIN_BLOCK_SIZE, POISON_BYTE,
                (b->size & BLOCK_SIZE_MASK) - MIN_BLOCK_SIZE);
-#endif /* CONFIG_XMEM_POOL_POISON */
 
     b->ptr.free_ptr = (struct free_ptr) {NULL, p->matrix[fl][sl]};
     if ( p->matrix[fl][sl] )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 22 17:44:13 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Dec 2023 17:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.659676.1029394 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGjZF-00044I-H6; Fri, 22 Dec 2023 17:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 659676.1029394; Fri, 22 Dec 2023 17: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 1rGjZF-000449-EL; Fri, 22 Dec 2023 17:44:13 +0000
Received: by outflank-mailman (input) for mailman id 659676;
 Fri, 22 Dec 2023 17: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 1rGjZE-00043X-15
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 17: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 1rGjZE-0000IF-0B
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 17:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGjZD-00061D-VY
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 17: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=VC0cQ65Ruw/69R6Cuvek6puN3GV663D+uzEQJiStsCI=; b=cjs5Fhr4lNBYzPr7MBfREy1MAx
	KERVhUXjtli4v3aaDrnwtz4wmrx/SX0m7S+xVedRcr35nejXEb7cZG4Owyve76SsWYshUi6JaSLjO
	KCYClJxZmwEpeXG6EGOzznGHwnFxmFWXpFam9v5iZR4cO+aPkMewrA6ML6s2mAPHyX3w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/amd: Extend CPU erratum #1474 fix to more affected models
Message-Id: <E1rGjZD-00061D-VY@xenbits.xenproject.org>
Date: Fri, 22 Dec 2023 17:44:11 +0000

commit 23db507a01a4ec5259ec0ab43d296a41b1c326ba
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Dec 21 11:08:31 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Dec 21 12:19:40 2023 +0000

    x86/amd: Extend CPU erratum #1474 fix to more affected models
    
    Erratum #1474 has now been extended to cover models from family 17h ranges
    00-2Fh, so the errata now covers all the models released under Family
    17h (Zen, Zen+ and Zen2).
    
    Additionally extend the workaround to Family 18h (Hygon), since it's based on
    the Zen architecture and very likely affected.
    
    Rename all the zen2 related symbols to fam17, since the errata doesn't
    exclusively affect Zen2 anymore.
    
    Reported-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>
---
 xen/arch/x86/cpu/amd.c | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 0f305312ff..d43288ae97 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -54,7 +54,7 @@ bool __read_mostly amd_acpi_c1e_quirk;
 bool __ro_after_init amd_legacy_ssbd;
 bool __initdata amd_virt_spec_ctrl;
 
-static bool __read_mostly zen2_c6_disabled;
+static bool __read_mostly fam17_c6_disabled;
 
 static inline int rdmsr_amd_safe(unsigned int msr, unsigned int *lo,
 				 unsigned int *hi)
@@ -978,24 +978,24 @@ void amd_check_zenbleed(void)
 		       val & chickenbit ? "chickenbit" : "microcode");
 }
 
-static void cf_check zen2_disable_c6(void *arg)
+static void cf_check fam17_disable_c6(void *arg)
 {
 	/* Disable C6 by clearing the CCR{0,1,2}_CC6EN bits. */
 	const uint64_t mask = ~((1ul << 6) | (1ul << 14) | (1ul << 22));
 	uint64_t val;
 
-	if (!zen2_c6_disabled) {
+	if (!fam17_c6_disabled) {
 		printk(XENLOG_WARNING
     "Disabling C6 after 1000 days apparent uptime due to AMD errata 1474\n");
-		zen2_c6_disabled = true;
+		fam17_c6_disabled = true;
 		/*
 		 * Prevent CPU hotplug so that started CPUs will either see
-		 * zen2_c6_disabled set, or will be handled by
+		 * zen_c6_disabled set, or will be handled by
 		 * smp_call_function().
 		 */
 		while (!get_cpu_maps())
 			process_pending_softirqs();
-		smp_call_function(zen2_disable_c6, NULL, 0);
+		smp_call_function(fam17_disable_c6, NULL, 0);
 		put_cpu_maps();
 	}
 
@@ -1294,8 +1294,8 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	amd_check_zenbleed();
 	amd_check_erratum_1485();
 
-	if (zen2_c6_disabled)
-		zen2_disable_c6(NULL);
+	if (fam17_c6_disabled)
+		fam17_disable_c6(NULL);
 
 	check_syscfg_dram_mod_en();
 
@@ -1307,7 +1307,7 @@ const struct cpu_dev amd_cpu_dev = {
 	.c_init		= init_amd,
 };
 
-static int __init cf_check zen2_c6_errata_check(void)
+static int __init cf_check amd_check_erratum_1474(void)
 {
 	/*
 	 * Errata #1474: A Core May Hang After About 1044 Days
@@ -1315,7 +1315,8 @@ static int __init cf_check zen2_c6_errata_check(void)
 	 */
 	s_time_t delta;
 
-	if (cpu_has_hypervisor || boot_cpu_data.x86 != 0x17 || !is_zen2_uarch())
+	if (cpu_has_hypervisor ||
+	    (boot_cpu_data.x86 != 0x17 && boot_cpu_data.x86 != 0x18))
 		return 0;
 
 	/*
@@ -1330,10 +1331,10 @@ static int __init cf_check zen2_c6_errata_check(void)
 	if (delta > 0) {
 		static struct timer errata_c6;
 
-		init_timer(&errata_c6, zen2_disable_c6, NULL, 0);
+		init_timer(&errata_c6, fam17_disable_c6, NULL, 0);
 		set_timer(&errata_c6, NOW() + delta);
 	} else
-		zen2_disable_c6(NULL);
+		fam17_disable_c6(NULL);
 
 	return 0;
 }
@@ -1341,4 +1342,4 @@ static int __init cf_check zen2_c6_errata_check(void)
  * Must be executed after early_time_init() for tsc_ticks2ns() to have been
  * calibrated.  That prevents us doing the check in init_amd().
  */
-presmp_initcall(zen2_c6_errata_check);
+presmp_initcall(amd_check_erratum_1474);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 22 17:44:23 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Dec 2023 17:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.659679.1029399 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGjZP-0004DH-J4; Fri, 22 Dec 2023 17:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 659679.1029399; Fri, 22 Dec 2023 17: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 1rGjZP-0004D9-Fl; Fri, 22 Dec 2023 17:44:23 +0000
Received: by outflank-mailman (input) for mailman id 659679;
 Fri, 22 Dec 2023 17: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 1rGjZO-0004Ce-43
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 17: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 1rGjZO-0000IM-3B
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 17:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGjZO-00061c-2G
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 17: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=bNp5IoBaSULk5L1TsBUJBXSDBMXTR0ElOzht7xPpSpE=; b=rRghD+DTDbx6uSjI5zxlxFkstD
	G61EgLQKa4tp69m0el+Xwp9B017l6fS3+hPlFk6ft0KYndnvcCceghxEL5hLNeqlZzlRw72XnUdjk
	CWk4vIvbIaTI1gw2sMzhqEsqE6X7H68ftWYl7GpstRuQP7U65OVGmjj5SAuFZzdZc8HY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: make include/xen/unaligned.h usable on all architectures
Message-Id: <E1rGjZO-00061c-2G@xenbits.xenproject.org>
Date: Fri, 22 Dec 2023 17:44:22 +0000

commit f61685f1fa9f135d010b12337dbf24396912aaa7
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Dec 12 17:27:01 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Dec 21 12:19:40 2023 +0000

    xen: make include/xen/unaligned.h usable on all architectures
    
    Instead of defining get_unaligned() and put_unaligned() in a way that
    is only supporting architectures allowing unaligned accesses, use the
    same approach as the Linux kernel and let the compiler do the
    decision how to generate the code for probably unaligned data accesses.
    
    Update include/xen/unaligned.h from include/asm-generic/unaligned.h of
    the Linux kernel.
    
    The generated code has been checked to be the same on x86.
    
    Modify the Linux variant to not use underscore prefixed identifiers,
    avoid unneeded parentheses and drop the 24-bit accessors.
    
    Add the definition of __packed to xg_dom_decompress_unsafe_zstd.c in
    libxenguest as it is using a cruel hack to reuse the hypervisor's
    decompressing code for stubdom.
    
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 803f4e1eab7a
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 tools/libs/guest/xg_dom_decompress_unsafe_zstd.c |  2 +-
 xen/include/xen/unaligned.h                      | 53 ++++++++++++++----------
 2 files changed, 31 insertions(+), 24 deletions(-)

diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c b/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c
index 01eafaaaa6..7cd266444b 100644
--- a/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c
+++ b/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c
@@ -26,13 +26,13 @@ typedef uint64_t __be64;
 #define __force
 #define always_inline
 #define noinline
+#define __packed __attribute__((__packed__))
 
 #undef ERROR
 
 #define __BYTEORDER_HAS_U64__
 #define __TYPES_H__ /* xen/types.h guard */
 #include "../../xen/include/xen/byteorder/little_endian.h"
-#define __ASM_UNALIGNED_H__ /* asm/unaligned.h guard */
 #include "../../xen/include/xen/unaligned.h"
 #include "../../xen/include/xen/xxhash.h"
 #include "../../xen/lib/xxhash64.c"
diff --git a/xen/include/xen/unaligned.h b/xen/include/xen/unaligned.h
index 0a2b16d05d..3eda0ece11 100644
--- a/xen/include/xen/unaligned.h
+++ b/xen/include/xen/unaligned.h
@@ -1,12 +1,4 @@
-/*
- * This header can be used by architectures where unaligned accesses work
- * without faulting, and at least reasonably efficiently.  Other architectures
- * will need to have a custom asm/unaligned.h.
- */
-#ifndef __ASM_UNALIGNED_H__
-#error "xen/unaligned.h should not be included directly - include asm/unaligned.h instead"
-#endif
-
+/* SPDX-License-Identifier: GPL-2.0 */
 #ifndef __XEN_UNALIGNED_H__
 #define __XEN_UNALIGNED_H__
 
@@ -15,67 +7,82 @@
 #include <asm/byteorder.h>
 #endif
 
-#define get_unaligned(p) (*(p))
-#define put_unaligned(val, p) (*(p) = (val))
+/*
+ * This is the most generic implementation of unaligned accesses
+ * and should work almost anywhere.
+ */
+
+#define get_unaligned_t(type, ptr) ({					\
+	const struct { type x; } __packed *ptr_ = (typeof(ptr_))(ptr);	\
+	ptr_->x;							\
+})
+
+#define put_unaligned_t(type, val, ptr) do {				\
+	struct { type x; } __packed *ptr_ = (typeof(ptr_))(ptr);	\
+	ptr_->x = val;							\
+} while (0)
+
+#define get_unaligned(ptr)	get_unaligned_t(typeof(*(ptr)), ptr)
+#define put_unaligned(val, ptr) put_unaligned_t(typeof(*(ptr)), val, ptr)
 
 static inline uint16_t get_unaligned_be16(const void *p)
 {
-	return be16_to_cpup(p);
+	return be16_to_cpu(get_unaligned_t(__be16, p));
 }
 
 static inline void put_unaligned_be16(uint16_t val, void *p)
 {
-	*(__force __be16*)p = cpu_to_be16(val);
+	put_unaligned_t(__be16, cpu_to_be16(val), p);
 }
 
 static inline uint32_t get_unaligned_be32(const void *p)
 {
-	return be32_to_cpup(p);
+	return be32_to_cpu(get_unaligned_t(__be32, p));
 }
 
 static inline void put_unaligned_be32(uint32_t val, void *p)
 {
-	*(__force __be32*)p = cpu_to_be32(val);
+	put_unaligned_t(__be32, cpu_to_be32(val), p);
 }
 
 static inline uint64_t get_unaligned_be64(const void *p)
 {
-	return be64_to_cpup(p);
+	return be64_to_cpu(get_unaligned_t(__be64, p));
 }
 
 static inline void put_unaligned_be64(uint64_t val, void *p)
 {
-	*(__force __be64*)p = cpu_to_be64(val);
+	put_unaligned_t(__be64, cpu_to_be64(val), p);
 }
 
 static inline uint16_t get_unaligned_le16(const void *p)
 {
-	return le16_to_cpup(p);
+	return le16_to_cpu(get_unaligned_t(__le16, p));
 }
 
 static inline void put_unaligned_le16(uint16_t val, void *p)
 {
-	*(__force __le16*)p = cpu_to_le16(val);
+	put_unaligned_t(__le16, cpu_to_le16(val), p);
 }
 
 static inline uint32_t get_unaligned_le32(const void *p)
 {
-	return le32_to_cpup(p);
+	return le32_to_cpu(get_unaligned_t(__le32, p));
 }
 
 static inline void put_unaligned_le32(uint32_t val, void *p)
 {
-	*(__force __le32*)p = cpu_to_le32(val);
+	put_unaligned_t(__le32, cpu_to_le32(val), p);
 }
 
 static inline uint64_t get_unaligned_le64(const void *p)
 {
-	return le64_to_cpup(p);
+	return le64_to_cpu(get_unaligned_t(__le64, p));
 }
 
 static inline void put_unaligned_le64(uint64_t val, void *p)
 {
-	*(__force __le64*)p = cpu_to_le64(val);
+	put_unaligned_t(__le64, cpu_to_le64(val), p);
 }
 
 #endif /* __XEN_UNALIGNED_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Dec 22 17:44:33 2023
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Dec 2023 17:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.659680.1029402 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1rGjZZ-0004H5-Jt; Fri, 22 Dec 2023 17:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 659680.1029402; Fri, 22 Dec 2023 17: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 1rGjZZ-0004Gy-HD; Fri, 22 Dec 2023 17:44:33 +0000
Received: by outflank-mailman (input) for mailman id 659680;
 Fri, 22 Dec 2023 17: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 1rGjZY-0004Gm-79
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 17: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 1rGjZY-0000IW-6F
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 17:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1rGjZY-000621-5O
 for xen-changelog@lists.xenproject.org; Fri, 22 Dec 2023 17: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=fQ4ST1/qY5TIlj9lS7BVFJ11R6ioZrGukoJM7x+j19c=; b=vD+4W4DS2cJgFPRqE2yQoqc/Lw
	8/SsTvQDMvryO7o3fWepTxCZbLoPpg9AiHYk8t/IiJq+eWUjfAaYxVbYMmYpL8g+XRsK0vTuC89II
	f5Hs/5BzhpRu2QpfaulzMl6AxoX0UQt16nSD6DQ1DUTPb68PL2zsjMkazimbWAajr86w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: remove asm/unaligned.h
Message-Id: <E1rGjZY-000621-5O@xenbits.xenproject.org>
Date: Fri, 22 Dec 2023 17:44:32 +0000

commit 49818cde637b5ec20383e46b71f93b2e7d867686
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Dec 12 17:27:02 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Dec 21 12:19:40 2023 +0000

    xen: remove asm/unaligned.h
    
    With include/xen/unaligned.h now dealing properly with unaligned
    accesses for all architectures, asm/unaligned.h can be removed and
    users can be switched to include xen/unaligned.h instead.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/unaligned.h | 6 ------
 xen/common/lz4/defs.h                | 2 +-
 xen/common/lzo.c                     | 2 +-
 xen/common/unlzo.c                   | 2 +-
 xen/common/xz/private.h              | 2 +-
 xen/common/zstd/mem.h                | 2 +-
 xen/lib/xxhash32.c                   | 2 +-
 xen/lib/xxhash64.c                   | 2 +-
 8 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/include/asm/unaligned.h b/xen/arch/x86/include/asm/unaligned.h
deleted file mode 100644
index 6070801d4a..0000000000
--- a/xen/arch/x86/include/asm/unaligned.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ASM_UNALIGNED_H__
-#define __ASM_UNALIGNED_H__
-
-#include <xen/unaligned.h>
-
-#endif /* __ASM_UNALIGNED_H__ */
diff --git a/xen/common/lz4/defs.h b/xen/common/lz4/defs.h
index 10609f5a53..6d81113266 100644
--- a/xen/common/lz4/defs.h
+++ b/xen/common/lz4/defs.h
@@ -10,7 +10,7 @@
 
 #ifdef __XEN__
 #include <asm/byteorder.h>
-#include <asm/unaligned.h>
+#include <xen/unaligned.h>
 #else
 
 static inline u16 get_unaligned_le16(const void *p)
diff --git a/xen/common/lzo.c b/xen/common/lzo.c
index a87c76dded..cc03f0f554 100644
--- a/xen/common/lzo.c
+++ b/xen/common/lzo.c
@@ -97,7 +97,7 @@
 #ifdef __XEN__
 #include <xen/lib.h>
 #include <asm/byteorder.h>
-#include <asm/unaligned.h>
+#include <xen/unaligned.h>
 #else
 #define get_unaligned_le16(_p) (*(u16 *)(_p))
 #endif
diff --git a/xen/common/unlzo.c b/xen/common/unlzo.c
index 74056778eb..bdcefa95b3 100644
--- a/xen/common/unlzo.c
+++ b/xen/common/unlzo.c
@@ -34,7 +34,7 @@
 
 #ifdef __XEN__
 #include <asm/byteorder.h>
-#include <asm/unaligned.h>
+#include <xen/unaligned.h>
 #else
 
 static inline u16 get_unaligned_be16(const void *p)
diff --git a/xen/common/xz/private.h b/xen/common/xz/private.h
index e6814250e8..2299705378 100644
--- a/xen/common/xz/private.h
+++ b/xen/common/xz/private.h
@@ -13,7 +13,7 @@
 #ifdef __XEN__
 #include <xen/kernel.h>
 #include <asm/byteorder.h>
-#include <asm/unaligned.h>
+#include <xen/unaligned.h>
 #else
 
 static inline u32 get_unaligned_le32(const void *p)
diff --git a/xen/common/zstd/mem.h b/xen/common/zstd/mem.h
index 2acae6a8ed..ae1e305126 100644
--- a/xen/common/zstd/mem.h
+++ b/xen/common/zstd/mem.h
@@ -23,7 +23,7 @@
 #ifdef __XEN__
 #include <xen/string.h> /* memcpy */
 #include <xen/types.h>  /* size_t, ptrdiff_t */
-#include <asm/unaligned.h>
+#include <xen/unaligned.h>
 #endif
 
 /*-****************************************
diff --git a/xen/lib/xxhash32.c b/xen/lib/xxhash32.c
index e8d403e5ce..32efa651c5 100644
--- a/xen/lib/xxhash32.c
+++ b/xen/lib/xxhash32.c
@@ -42,7 +42,7 @@
 #include <xen/errno.h>
 #include <xen/string.h>
 #include <xen/xxhash.h>
-#include <asm/unaligned.h>
+#include <xen/unaligned.h>
 
 /*-*************************************
  * Macros
diff --git a/xen/lib/xxhash64.c b/xen/lib/xxhash64.c
index 481e76fbcf..1858e236fe 100644
--- a/xen/lib/xxhash64.c
+++ b/xen/lib/xxhash64.c
@@ -43,7 +43,7 @@
 #include <xen/errno.h>
 #include <xen/string.h>
 #include <xen/xxhash.h>
-#include <asm/unaligned.h>
+#include <xen/unaligned.h>
 #endif
 
 /*-*************************************
--
generated by git-patchbot for /home/xen/git/xen.git#master


